feat: graphql client with fetches for initial pages
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
export const rteType = {
|
||||
asset: "asset",
|
||||
p: "p",
|
||||
reference: "reference",
|
||||
}
|
||||
|
||||
export enum RTETypeEnum {
|
||||
asset = "asset",
|
||||
p = "p",
|
||||
reference = "reference",
|
||||
}
|
||||
|
||||
export type RTEType = keyof typeof rteType
|
||||
|
||||
export type RTEText = {
|
||||
text: string
|
||||
}
|
||||
|
||||
export type RTEAssetAttrs = {
|
||||
"alt": string
|
||||
"asset-alt": string
|
||||
"asset-link": string
|
||||
"asset-name": string
|
||||
"asset-type": "image/png" | "image/jpg" | "image/jpeg"
|
||||
"asset-uid": string
|
||||
"display-type": "display"
|
||||
"class-name": string
|
||||
"content-type-uid": "sys_assets"
|
||||
"inline": false
|
||||
"type": RTETypeEnum.asset
|
||||
}
|
||||
|
||||
type RTEBaseObject<T> = {
|
||||
type: T
|
||||
uid: string
|
||||
}
|
||||
|
||||
type AssetReferenceObject = RTEBaseObject<RTETypeEnum.reference> & {
|
||||
attrs: RTEAssetAttrs
|
||||
children: RTEText[]
|
||||
}
|
||||
|
||||
export type RTEObject =
|
||||
| AssetReferenceObject
|
||||
| {
|
||||
attrs: Record<string, any>
|
||||
children: (RTEObject | RTEText)[]
|
||||
type: RTEType
|
||||
uid: string
|
||||
}
|
||||
|
||||
export type RTERootObject = {
|
||||
attrs: RTEAssetAttrs | Record<string, any>
|
||||
children: RTEObject[]
|
||||
uid: string
|
||||
type: "doc"
|
||||
_version: number
|
||||
}
|
||||
Reference in New Issue
Block a user