react-bricks 5.0.0-alpha.13 → 5.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/astro/index.js +1 -1
- package/astro/react-bricks-astro.d.ts +3 -3
- package/astro/react-bricks-astro.esm.js +1 -1
- package/astro/server/index.js +1 -1
- package/astro/server/react-bricks-astro-server.d.ts +73 -3
- package/astro/server/react-bricks-astro-server.esm.js +1 -1
- package/frontend/index.js +1 -1
- package/frontend/react-bricks-frontend.d.ts +1614 -0
- package/frontend/react-bricks-frontend.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +20 -21
- package/react-bricks-4V0EE57f.esm.js +2 -0
- package/react-bricks-B1Vse8mD.esm.js +2 -0
- package/react-bricks-BDLU20-P.esm.js +2 -0
- package/react-bricks-BT4wWCiv.js +2 -0
- package/{react-bricks-BQVbsXJT.js → react-bricks-BXuIniPH.js} +2 -2
- package/react-bricks-Bb-tnKnX.js +2 -0
- package/react-bricks-BoS3Ip9Y.js +2 -0
- package/react-bricks-Bw3CYt-A.js +2 -0
- package/react-bricks-Byc_kz7c.js +2 -0
- package/{react-bricks-DCwTiCyw.esm.js → react-bricks-C6CuP0pr.esm.js} +2 -2
- package/react-bricks-CJr0ozQh.esm.js +2 -0
- package/react-bricks-CQGGPWSX.esm.js +2 -0
- package/react-bricks-CVY80vRp.js +2 -0
- package/react-bricks-CXYPizKP.esm.js +2 -0
- package/{react-bricks-BAU648jh.js → react-bricks-Cv6d5aJM.js} +2 -2
- package/react-bricks-D11wVybc.js +2 -0
- package/react-bricks-D1NCAz33.esm.js +2 -0
- package/{react-bricks-ClSfEDTQ.esm.js → react-bricks-DMrrwMeN.esm.js} +2 -2
- package/react-bricks-DXHTZMxL.js +2 -0
- package/react-bricks-Dj5O36Yd.js +2 -0
- package/react-bricks-DvQS_WEV.js +2 -0
- package/react-bricks-DxllOfhH.js +2 -0
- package/react-bricks-DzHM_JWb.esm.js +2 -0
- package/react-bricks-SER2nxcu.esm.js +2 -0
- package/react-bricks-WhMQmDjb.esm.js +2 -0
- package/react-bricks-hUn6ZQlj.esm.js +2 -0
- package/react-bricks-qteFeXyo.esm.js +2 -0
- package/react-bricks-rWV5-xpq.js +2 -0
- package/react-bricks.d.ts +28 -27
- package/react-bricks.esm.js +1 -1
- package/rsc/client/index.js +1 -1
- package/rsc/client/react-bricks-rsc-client.d.ts +3 -3
- package/rsc/client/react-bricks-rsc-client.esm.js +1 -1
- package/rsc/index.js +1 -1
- package/rsc/react-bricks-rsc.d.ts +91 -5
- package/rsc/react-bricks-rsc.esm.js +1 -1
- package/astro/package.json +0 -22
- package/astro/server/package.json +0 -14
- package/frontend/package.json +0 -13
- package/react-bricks--JIqLlO9.esm.js +0 -2
- package/react-bricks-BEdMMbTo.js +0 -2
- package/react-bricks-BZWdHmRU.js +0 -2
- package/react-bricks-BefVBgFS.js +0 -2
- package/react-bricks-BnvkarEw.esm.js +0 -2
- package/react-bricks-BpcbWC7h.esm.js +0 -2
- package/react-bricks-C6rBDYps.esm.js +0 -2
- package/react-bricks-CEwbAUvL.js +0 -2
- package/react-bricks-CI44eOAm.js +0 -2
- package/react-bricks-CRF9wurx.esm.js +0 -2
- package/react-bricks-CUymLgNs.esm.js +0 -2
- package/react-bricks-CXByFeal.js +0 -2
- package/react-bricks-CaWou2PA.esm.js +0 -2
- package/react-bricks-DQUyUQyM.js +0 -2
- package/react-bricks-DzZdqeB7.esm.js +0 -2
- package/react-bricks-EAyIY-uF.js +0 -2
- package/react-bricks-F62-Rs10.js +0 -2
- package/react-bricks-QksDoll3.esm.js +0 -2
- package/react-bricks-cOZLqCfg.esm.js +0 -2
- package/react-bricks-dMDNjQgZ.js +0 -2
- package/react-bricks-mt_Jo07g.js +0 -2
- package/react-bricks-yESv3dKz.esm.js +0 -2
- package/rsc/client/package.json +0 -13
- package/rsc/package.json +0 -13
|
@@ -0,0 +1,1614 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Descendant, Editor, BaseEditor, Element, Node } from 'slate';
|
|
4
|
+
import { RenderElementProps, RenderLeafProps, ReactEditor } from 'slate-react';
|
|
5
|
+
import { HistoryEditor } from 'slate-history';
|
|
6
|
+
import { Props } from 'react-inlinesvg';
|
|
7
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for Link component
|
|
11
|
+
*/
|
|
12
|
+
interface LinkProps {
|
|
13
|
+
href: string;
|
|
14
|
+
target?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
activeClassName?: string;
|
|
17
|
+
simpleAnchor?: boolean;
|
|
18
|
+
}
|
|
19
|
+
type LinkPropsReal = React.PropsWithChildren<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> & LinkProps>;
|
|
20
|
+
declare const Link: React.FC<LinkPropsReal>;
|
|
21
|
+
|
|
22
|
+
declare namespace types {
|
|
23
|
+
export const EmbedProp = "RB_PAGE_EMBED";
|
|
24
|
+
export const EmbedContent = "RB_PAGE_EMBED_CONTENT";
|
|
25
|
+
/**
|
|
26
|
+
* Type of Sidebar control
|
|
27
|
+
*/
|
|
28
|
+
export enum SideEditPropType {
|
|
29
|
+
Text = "TEXT",
|
|
30
|
+
Textarea = "TEXTAREA",
|
|
31
|
+
Number = "NUMBER",
|
|
32
|
+
Date = "DATE",
|
|
33
|
+
Range = "RANGE",
|
|
34
|
+
Boolean = "BOOLEAN",
|
|
35
|
+
Select = "SELECT",
|
|
36
|
+
Autocomplete = "AUTOCOMPLETE",
|
|
37
|
+
Image = "IMAGE",
|
|
38
|
+
Custom = "CUSTOM",
|
|
39
|
+
Relationship = "RELATIONSHIP",
|
|
40
|
+
IconSelector = "ICON-SELECTOR"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* How to display the options
|
|
44
|
+
*/
|
|
45
|
+
export enum OptionsDisplay {
|
|
46
|
+
Select = "SELECT",
|
|
47
|
+
Radio = "RADIO",
|
|
48
|
+
Color = "COLOR"
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Features for RichText: see also the new RichTextExt
|
|
52
|
+
*/
|
|
53
|
+
export enum RichTextFeatures {
|
|
54
|
+
Bold = "BOLD",
|
|
55
|
+
Italic = "ITALIC",
|
|
56
|
+
Code = "CODE",
|
|
57
|
+
Highlight = "HIGHLIGHT",
|
|
58
|
+
Subscript = "SUB",
|
|
59
|
+
Superscript = "SUP",
|
|
60
|
+
Link = "LINK",
|
|
61
|
+
UnorderedList = "UL",
|
|
62
|
+
OrderedList = "OL",
|
|
63
|
+
Heading1 = "H1",
|
|
64
|
+
Heading2 = "H2",
|
|
65
|
+
Heading3 = "H3",
|
|
66
|
+
Heading4 = "H4",
|
|
67
|
+
Heading5 = "H5",
|
|
68
|
+
Heading6 = "H6",
|
|
69
|
+
Quote = "QUOTE"
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Supported Icon Sets
|
|
73
|
+
*/
|
|
74
|
+
export enum IconSets {
|
|
75
|
+
Lucide = "lu",
|
|
76
|
+
HeroIconSolid = "hi-solid",
|
|
77
|
+
HeroIconOutline = "hi-outline",
|
|
78
|
+
FontAwesome = "fa6",
|
|
79
|
+
Feather = "fi"
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Page status
|
|
83
|
+
*/
|
|
84
|
+
export enum PageStatus {
|
|
85
|
+
Draft = "DRAFT",
|
|
86
|
+
Published = "PUBLISHED"
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Approval status
|
|
90
|
+
*/
|
|
91
|
+
export enum EditStatus {
|
|
92
|
+
Merged = "MERGED",
|
|
93
|
+
Working = "WORKING",
|
|
94
|
+
MergeRequested = "MERGE_REQUESTED"
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Device type for responsive preview (for the icon)
|
|
98
|
+
*/
|
|
99
|
+
export enum DeviceType {
|
|
100
|
+
Desktop = "DESKTOP",
|
|
101
|
+
Tablet = "TABLET",
|
|
102
|
+
Phone = "PHONE"
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Corner for the click-to-edit button
|
|
106
|
+
*/
|
|
107
|
+
export enum ClickToEditSide {
|
|
108
|
+
BottomRight = "BOTTOM-RIGHT",
|
|
109
|
+
BottomLeft = "BOTTOM-LEFT",
|
|
110
|
+
TopRight = "TOP-RIGHT",
|
|
111
|
+
TopLeft = "TOP-LEFT",
|
|
112
|
+
None = "NONE"
|
|
113
|
+
}
|
|
114
|
+
export enum BlockIconsPosition {
|
|
115
|
+
InsideBlock = "INSIDE-BLOCK",
|
|
116
|
+
OutsideBlock = "OUTSIDE-BLOCK"
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A Brick is a type of content block
|
|
120
|
+
*/
|
|
121
|
+
export type Brick<T = {}> = React__default.FC<T> & {
|
|
122
|
+
schema: IBlockType<T>;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Bricks are types of content block
|
|
126
|
+
*/
|
|
127
|
+
export type Bricks = {
|
|
128
|
+
[key: string]: Brick<any>;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* A Category contains bricks
|
|
132
|
+
*/
|
|
133
|
+
export type Category = {
|
|
134
|
+
categoryName: string;
|
|
135
|
+
bricks: Brick<any>[];
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* A Theme contains categories and bricks
|
|
139
|
+
*/
|
|
140
|
+
export type Theme = {
|
|
141
|
+
themeName: string;
|
|
142
|
+
bannerText?: string;
|
|
143
|
+
bannerLink?: string;
|
|
144
|
+
categories: Category[];
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Custom role type
|
|
148
|
+
*/
|
|
149
|
+
export type CustomRole = {
|
|
150
|
+
id: string;
|
|
151
|
+
name: string;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* The type of the user passed to permission functions
|
|
155
|
+
*/
|
|
156
|
+
export type PermissionUser = {
|
|
157
|
+
firstName: string;
|
|
158
|
+
lastName: string;
|
|
159
|
+
email: string;
|
|
160
|
+
isAdmin: boolean;
|
|
161
|
+
role: string;
|
|
162
|
+
customRole?: CustomRole;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* The type of the page passed to permission functions
|
|
166
|
+
*/
|
|
167
|
+
export type PermissionPage = {
|
|
168
|
+
slug: string;
|
|
169
|
+
pageType: string;
|
|
170
|
+
language: string;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* The type of the brick passed to permission functions
|
|
174
|
+
*/
|
|
175
|
+
export type PermissionBrick = {
|
|
176
|
+
name: string;
|
|
177
|
+
category: string;
|
|
178
|
+
theme: string;
|
|
179
|
+
tags: string[];
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* The permission functions
|
|
183
|
+
*/
|
|
184
|
+
export type Permissions = {
|
|
185
|
+
canAddPage?: (user: PermissionUser, pageType: string) => boolean;
|
|
186
|
+
canAddTranslation?: (user: PermissionUser, pageType: string, language: string) => boolean;
|
|
187
|
+
canSeePageType?: (user: PermissionUser, pageType: string) => boolean;
|
|
188
|
+
canSeePage?: (user: PermissionUser, page: Omit<PermissionPage, 'language'>) => boolean;
|
|
189
|
+
canEditPage?: (user: PermissionUser, page: PermissionPage) => boolean;
|
|
190
|
+
canDeletePage?: (user: PermissionUser, page: Omit<PermissionPage, 'language'>) => boolean;
|
|
191
|
+
canDeleteTranslation?: (user: PermissionUser, page: PermissionPage) => boolean;
|
|
192
|
+
canUseBrick?: (user: PermissionUser, brick: PermissionBrick) => boolean;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* The logged-in User
|
|
196
|
+
*/
|
|
197
|
+
export type User = {
|
|
198
|
+
id: string;
|
|
199
|
+
email: string;
|
|
200
|
+
firstName: string;
|
|
201
|
+
lastName: string;
|
|
202
|
+
company: string;
|
|
203
|
+
avatarUrl?: string;
|
|
204
|
+
isAdmin: boolean;
|
|
205
|
+
token: string;
|
|
206
|
+
appName: string;
|
|
207
|
+
appId: string;
|
|
208
|
+
appEnv: string;
|
|
209
|
+
deployHookUrl?: string;
|
|
210
|
+
deployHookMethod?: string;
|
|
211
|
+
deployHookTriggerOnScheduledPublishing: boolean;
|
|
212
|
+
deployHookStagingUrl?: string;
|
|
213
|
+
deployHookStagingMethod?: string;
|
|
214
|
+
deployHookStagingTriggerOnScheduledPublishing: boolean;
|
|
215
|
+
deployHookDevUrl?: string;
|
|
216
|
+
deployHookDevMethod?: string;
|
|
217
|
+
deployHookDevTriggerOnScheduledPublishing: boolean;
|
|
218
|
+
eventsHookUrl?: string;
|
|
219
|
+
eventsHookAuthToken?: string;
|
|
220
|
+
canCreatePage: boolean;
|
|
221
|
+
canDeletePage: boolean;
|
|
222
|
+
canDeploy: boolean;
|
|
223
|
+
canDeployStaging: boolean;
|
|
224
|
+
canDeployDev: boolean;
|
|
225
|
+
canEditPageAttributes: boolean;
|
|
226
|
+
canEditSeo: boolean;
|
|
227
|
+
canApprove: boolean;
|
|
228
|
+
role: string;
|
|
229
|
+
customRole?: CustomRole;
|
|
230
|
+
plan: string;
|
|
231
|
+
isVerified: boolean;
|
|
232
|
+
languages: Language[];
|
|
233
|
+
defaultLanguage: string;
|
|
234
|
+
hostname: string;
|
|
235
|
+
useWorkingCopy: boolean;
|
|
236
|
+
useApprovalWorkflow: boolean;
|
|
237
|
+
subscription: {
|
|
238
|
+
maxStories: number;
|
|
239
|
+
collaboration: boolean;
|
|
240
|
+
deployHookStaging: boolean;
|
|
241
|
+
deployHookDev: boolean;
|
|
242
|
+
scheduledPublishing: boolean;
|
|
243
|
+
abTesting: boolean;
|
|
244
|
+
embedPages: boolean;
|
|
245
|
+
lockBlocks: boolean;
|
|
246
|
+
flexibleRoles: boolean;
|
|
247
|
+
advancedSeo: boolean;
|
|
248
|
+
eventsLog: boolean;
|
|
249
|
+
maxFileSize: number;
|
|
250
|
+
maxImageSize: number;
|
|
251
|
+
maxFilesBatch: number;
|
|
252
|
+
maxFilesConcurrency: number;
|
|
253
|
+
diskSpace: number;
|
|
254
|
+
advancedDam: boolean;
|
|
255
|
+
workingCopy: boolean;
|
|
256
|
+
approvalWorkflow: boolean;
|
|
257
|
+
template: boolean;
|
|
258
|
+
externalData: boolean;
|
|
259
|
+
richTextExt: boolean;
|
|
260
|
+
aiText: boolean;
|
|
261
|
+
aiGen: boolean;
|
|
262
|
+
aiSeo: boolean;
|
|
263
|
+
emailMarketing: boolean;
|
|
264
|
+
forms: boolean;
|
|
265
|
+
};
|
|
266
|
+
emailMarketingConfig?: {
|
|
267
|
+
providers: Array<{
|
|
268
|
+
value: string;
|
|
269
|
+
label: string;
|
|
270
|
+
}>;
|
|
271
|
+
testRecipients: string[];
|
|
272
|
+
};
|
|
273
|
+
} | null;
|
|
274
|
+
/**
|
|
275
|
+
* Translation for a Page
|
|
276
|
+
*/
|
|
277
|
+
export type Translation = {
|
|
278
|
+
language: string;
|
|
279
|
+
slug: string;
|
|
280
|
+
name: string;
|
|
281
|
+
status: PageStatus;
|
|
282
|
+
editStatus: EditStatus;
|
|
283
|
+
isLocked: boolean;
|
|
284
|
+
scheduledForPublishingOn: string;
|
|
285
|
+
};
|
|
286
|
+
/**
|
|
287
|
+
* Variant for a Page
|
|
288
|
+
*/
|
|
289
|
+
export type Variant = {
|
|
290
|
+
name: string;
|
|
291
|
+
weight: number;
|
|
292
|
+
status: PageStatus;
|
|
293
|
+
scheduledForPublishingOn: string;
|
|
294
|
+
scheduledForUnpublishingOn: string;
|
|
295
|
+
isLive: boolean;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* The page editing User
|
|
299
|
+
*/
|
|
300
|
+
export type EditingUser = {
|
|
301
|
+
id: string;
|
|
302
|
+
email: string;
|
|
303
|
+
firstName: string;
|
|
304
|
+
lastName: string;
|
|
305
|
+
company: string;
|
|
306
|
+
avatarUrl?: string;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Date and User of last edit
|
|
310
|
+
*/
|
|
311
|
+
export type LastEditedBy = {
|
|
312
|
+
date: string;
|
|
313
|
+
user: EditingUser;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Provider to send EmailMarketing
|
|
317
|
+
*/
|
|
318
|
+
export type EmailMarketingProvider = 'brevo' | 'getresponse' | 'mailchimp' | 'mailerlite' | 'resend' | 'sendgrid';
|
|
319
|
+
/** EmailMarketing Sender (from address) */
|
|
320
|
+
export type EmailMarketingSender = {
|
|
321
|
+
email: string;
|
|
322
|
+
name: string;
|
|
323
|
+
id?: string;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* EmailMarketing configuration on Page
|
|
327
|
+
*/
|
|
328
|
+
export type EmailMarketingConfig = {
|
|
329
|
+
provider: EmailMarketingProvider;
|
|
330
|
+
sender: string;
|
|
331
|
+
listId: string;
|
|
332
|
+
campaignName: string;
|
|
333
|
+
subject: string;
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* AppOnPage
|
|
337
|
+
*/
|
|
338
|
+
export type AppOnPage = {
|
|
339
|
+
noindex?: boolean;
|
|
340
|
+
hideGeneratorTag?: boolean;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* A React Bricks Page
|
|
344
|
+
*/
|
|
345
|
+
export type Page = {
|
|
346
|
+
id: string;
|
|
347
|
+
type: string;
|
|
348
|
+
name: string;
|
|
349
|
+
slug: string;
|
|
350
|
+
variantName: string;
|
|
351
|
+
variantWeight: number;
|
|
352
|
+
meta: IMeta;
|
|
353
|
+
customValues?: Props;
|
|
354
|
+
externalData?: Props;
|
|
355
|
+
emailMarketingConfig?: EmailMarketingConfig;
|
|
356
|
+
content: IContentBlock[];
|
|
357
|
+
workingContent?: IContentBlock[];
|
|
358
|
+
committedContent?: IContentBlock[];
|
|
359
|
+
authorId?: string;
|
|
360
|
+
author: Author;
|
|
361
|
+
invalidBlocksTypes?: string[];
|
|
362
|
+
status: PageStatus;
|
|
363
|
+
editStatus: EditStatus;
|
|
364
|
+
isLocked: boolean;
|
|
365
|
+
tags: string[];
|
|
366
|
+
category?: string;
|
|
367
|
+
createdAt: string;
|
|
368
|
+
publishedAt?: string;
|
|
369
|
+
scheduledForPublishingOn?: string;
|
|
370
|
+
scheduledForUnpublishingOn?: string;
|
|
371
|
+
language: string;
|
|
372
|
+
translations: Translation[];
|
|
373
|
+
variants: Variant[];
|
|
374
|
+
lastEditedBy: LastEditedBy;
|
|
375
|
+
app?: AppOnPage;
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* Page fields (without content)
|
|
379
|
+
*/
|
|
380
|
+
export type PageValues = Omit<Page, 'content'>;
|
|
381
|
+
/**
|
|
382
|
+
* A Page with all optional fields, used for the patch
|
|
383
|
+
*/
|
|
384
|
+
export type PartialPage = Partial<Page>;
|
|
385
|
+
/**
|
|
386
|
+
* Page from a list (no content)
|
|
387
|
+
*/
|
|
388
|
+
export type PageFromList = Omit<Page, 'content'>;
|
|
389
|
+
/**
|
|
390
|
+
* Page from a list with pagination
|
|
391
|
+
*/
|
|
392
|
+
export type PagesFromListWithPagination = {
|
|
393
|
+
items: PageFromList[];
|
|
394
|
+
pagination: {
|
|
395
|
+
page: number;
|
|
396
|
+
pageSize: number;
|
|
397
|
+
totalItems: number;
|
|
398
|
+
totalPages: number;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* The Author of a Page
|
|
403
|
+
*/
|
|
404
|
+
export type Author = {
|
|
405
|
+
id: string;
|
|
406
|
+
email: string;
|
|
407
|
+
firstName: string;
|
|
408
|
+
lastName: string;
|
|
409
|
+
avatarUrl?: string;
|
|
410
|
+
company?: string;
|
|
411
|
+
};
|
|
412
|
+
export type BrickStory<T = Props> = {
|
|
413
|
+
id: string;
|
|
414
|
+
name: string;
|
|
415
|
+
showAsBrick?: boolean;
|
|
416
|
+
previewImageUrl?: string;
|
|
417
|
+
disabled?: boolean;
|
|
418
|
+
disabledIcon?: 'purchase' | 'maintenance';
|
|
419
|
+
disabledLink?: string;
|
|
420
|
+
disabledTooltip?: string;
|
|
421
|
+
props: T;
|
|
422
|
+
};
|
|
423
|
+
type RepeaterItemDefault = IContentBlock | Omit<IContentBlock, 'id'> | Props;
|
|
424
|
+
export type RepeaterItems<T = RepeaterItemDefault> = Array<T>;
|
|
425
|
+
/**
|
|
426
|
+
* A Language for i18n
|
|
427
|
+
*/
|
|
428
|
+
export type Language = {
|
|
429
|
+
code: string;
|
|
430
|
+
name: string;
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Render function for local links (should use the app's Router)
|
|
434
|
+
*/
|
|
435
|
+
interface LocalLinkProps {
|
|
436
|
+
href: string;
|
|
437
|
+
target?: string;
|
|
438
|
+
className?: string;
|
|
439
|
+
activeClassName?: string;
|
|
440
|
+
isAdmin?: boolean;
|
|
441
|
+
tabIndex?: number;
|
|
442
|
+
}
|
|
443
|
+
type LocalLinkPropsReal = React__default.PropsWithChildren<Omit<React__default.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LocalLinkProps> & LocalLinkProps>;
|
|
444
|
+
export type RenderLocalLink = ({ href, target, className, activeClassName, isAdmin, tabIndex, children, }: LocalLinkPropsReal) => React__default.ReactElement;
|
|
445
|
+
/**-
|
|
446
|
+
* The type of Text and RichText value
|
|
447
|
+
*/
|
|
448
|
+
export type TextValue = Descendant[] | string;
|
|
449
|
+
/**
|
|
450
|
+
* Props of a content block
|
|
451
|
+
*/
|
|
452
|
+
export type Props = {
|
|
453
|
+
[key: string]: any;
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* Options passed to the fetch function
|
|
457
|
+
*/
|
|
458
|
+
export type FetchOptions = {
|
|
459
|
+
apiPrefix?: string;
|
|
460
|
+
cache?: string;
|
|
461
|
+
next?: {
|
|
462
|
+
[key: string]: any;
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Interface for the Schema of a Brick
|
|
467
|
+
*/
|
|
468
|
+
export interface IBlockType<T = Props> {
|
|
469
|
+
name: string;
|
|
470
|
+
label: string;
|
|
471
|
+
description?: string;
|
|
472
|
+
getDefaultProps?: () => Partial<T>;
|
|
473
|
+
hideFromAddMenu?: boolean;
|
|
474
|
+
disabled?: boolean;
|
|
475
|
+
disabledIcon?: 'purchase' | 'maintenance';
|
|
476
|
+
disabledLink?: string;
|
|
477
|
+
disabledTooltip?: string;
|
|
478
|
+
sideEditProps?: Array<ISideEditProp<T> | ISideGroup<T>>;
|
|
479
|
+
repeaterItems?: IRepeaterItem<T>[];
|
|
480
|
+
newItemMenuOpen?: boolean;
|
|
481
|
+
groupByRepeater?: boolean;
|
|
482
|
+
mapExternalDataToProps?: (externalData: Props, brickProps?: T) => Partial<T>;
|
|
483
|
+
getData?: (page: Page, brickProps?: T, args?: any) => Promise<Partial<T>>;
|
|
484
|
+
getExternalData?: (page: Page, brickProps?: T, args?: any) => Promise<Partial<T>>;
|
|
485
|
+
playgroundLinkUrl?: string;
|
|
486
|
+
playgroundLinkLabel?: string;
|
|
487
|
+
theme?: string;
|
|
488
|
+
category?: string;
|
|
489
|
+
tags?: string[];
|
|
490
|
+
previewImageUrl?: string;
|
|
491
|
+
previewIcon?: React__default.ReactElement;
|
|
492
|
+
stories?: BrickStory<Partial<T>>[];
|
|
493
|
+
astroInteractivity?: 'load' | {
|
|
494
|
+
load: true;
|
|
495
|
+
} | 'idle' | {
|
|
496
|
+
idle: true;
|
|
497
|
+
} | {
|
|
498
|
+
idle: {
|
|
499
|
+
timeout: number;
|
|
500
|
+
};
|
|
501
|
+
} | 'visible' | {
|
|
502
|
+
visible: true;
|
|
503
|
+
} | {
|
|
504
|
+
visible: {
|
|
505
|
+
rootMargin: string;
|
|
506
|
+
};
|
|
507
|
+
} | {
|
|
508
|
+
media: string;
|
|
509
|
+
} | {
|
|
510
|
+
only: string;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Item of a Repeater
|
|
515
|
+
*/
|
|
516
|
+
export interface IRepeaterItem<T = any> {
|
|
517
|
+
name: string;
|
|
518
|
+
label?: string;
|
|
519
|
+
itemType?: string;
|
|
520
|
+
itemLabel?: string;
|
|
521
|
+
defaultOpen?: boolean;
|
|
522
|
+
min?: number;
|
|
523
|
+
max?: number;
|
|
524
|
+
getDefaultProps?: () => Props;
|
|
525
|
+
show?: (props: T, page?: Page, user?: User) => boolean;
|
|
526
|
+
items?: {
|
|
527
|
+
type: string;
|
|
528
|
+
label?: string;
|
|
529
|
+
min?: number;
|
|
530
|
+
max?: number;
|
|
531
|
+
getDefaultProps?: () => Props;
|
|
532
|
+
show?: (props: T, page?: Page, user?: User) => boolean;
|
|
533
|
+
}[];
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* The content of a block (instance of a Brick)
|
|
537
|
+
*/
|
|
538
|
+
export interface IContentBlock {
|
|
539
|
+
id: string;
|
|
540
|
+
type: string;
|
|
541
|
+
props: Props;
|
|
542
|
+
locked?: boolean;
|
|
543
|
+
canAddAfter?: boolean;
|
|
544
|
+
canAddBefore?: boolean;
|
|
545
|
+
canEditContent?: boolean;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Option of a select sidebar prop
|
|
549
|
+
*/
|
|
550
|
+
export interface IOption<T = any> {
|
|
551
|
+
value: T;
|
|
552
|
+
label: string;
|
|
553
|
+
disabled?: boolean;
|
|
554
|
+
disabledTooltip?: string;
|
|
555
|
+
[otherProps: string]: unknown;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Interface for Props of a Custom sidebar component
|
|
559
|
+
*/
|
|
560
|
+
export interface ICustomKnobProps {
|
|
561
|
+
id: string;
|
|
562
|
+
value: any;
|
|
563
|
+
onChange: any;
|
|
564
|
+
isValid: boolean;
|
|
565
|
+
errorMessage?: string;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Sidebar edit Props for a Page
|
|
569
|
+
*/
|
|
570
|
+
export interface ISideEditPropPage<T = Props> {
|
|
571
|
+
name: string;
|
|
572
|
+
label: string;
|
|
573
|
+
type: SideEditPropType;
|
|
574
|
+
component?: React__default.FC<ICustomKnobProps>;
|
|
575
|
+
validate?: (value: any, props?: T) => boolean | string;
|
|
576
|
+
show?: (props: T, page?: Page, user?: User) => boolean;
|
|
577
|
+
helperText?: string;
|
|
578
|
+
textareaOptions?: {
|
|
579
|
+
height?: number;
|
|
580
|
+
};
|
|
581
|
+
imageOptions?: {
|
|
582
|
+
maxWidth?: number;
|
|
583
|
+
quality?: number;
|
|
584
|
+
aspectRatio?: number;
|
|
585
|
+
};
|
|
586
|
+
rangeOptions?: {
|
|
587
|
+
min?: number;
|
|
588
|
+
max?: number;
|
|
589
|
+
step?: number;
|
|
590
|
+
};
|
|
591
|
+
selectOptions?: {
|
|
592
|
+
options?: IOption[];
|
|
593
|
+
getOptions?: (props: Props) => IOption[] | Promise<IOption[]>;
|
|
594
|
+
display: OptionsDisplay;
|
|
595
|
+
};
|
|
596
|
+
autocompleteOptions?: {
|
|
597
|
+
placeholder?: string;
|
|
598
|
+
getOptions: (input: string, props: Props) => any[] | Promise<any[]>;
|
|
599
|
+
getKey: (option: any) => string | number;
|
|
600
|
+
getLabel: (option: any) => string;
|
|
601
|
+
renderOption?: ({ option, selected, focus, }: {
|
|
602
|
+
option: any;
|
|
603
|
+
selected: boolean;
|
|
604
|
+
focus: boolean;
|
|
605
|
+
}) => React__default.ReactElement;
|
|
606
|
+
debounceTime?: number;
|
|
607
|
+
getNoOptionsMessage?: (input?: string) => string;
|
|
608
|
+
};
|
|
609
|
+
iconSelectorOptions?: {
|
|
610
|
+
iconSets?: IconSets[];
|
|
611
|
+
};
|
|
612
|
+
relationshipOptions?: {
|
|
613
|
+
label?: string;
|
|
614
|
+
references: string;
|
|
615
|
+
multiple: boolean;
|
|
616
|
+
embedValues?: boolean;
|
|
617
|
+
};
|
|
618
|
+
onChange?: (props: T) => Partial<T>;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Sidebar Edit Props
|
|
622
|
+
*/
|
|
623
|
+
export interface ISideEditProp<T = Props> extends ISideEditPropPage<T> {
|
|
624
|
+
shouldRefreshText?: boolean;
|
|
625
|
+
shouldRefreshStyles?: boolean;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* A collapsible Group of sidebar Props
|
|
629
|
+
*/
|
|
630
|
+
export interface ISideGroup<T = Props> {
|
|
631
|
+
groupName: string;
|
|
632
|
+
defaultOpen?: boolean;
|
|
633
|
+
show?: (props: T, page?: Page, user?: User) => boolean;
|
|
634
|
+
props: ISideEditProp<T>[] | ISideEditPropPage<T>[];
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Image Crop interface
|
|
638
|
+
*/
|
|
639
|
+
export interface ICrop {
|
|
640
|
+
x: number;
|
|
641
|
+
y: number;
|
|
642
|
+
width: number;
|
|
643
|
+
height: number;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Image Transform interface
|
|
647
|
+
*/
|
|
648
|
+
export interface ITransform {
|
|
649
|
+
rotate?: number;
|
|
650
|
+
flip?: {
|
|
651
|
+
horizontal: boolean;
|
|
652
|
+
vertical: boolean;
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Image value interface
|
|
657
|
+
*/
|
|
658
|
+
export interface IImageSource {
|
|
659
|
+
src: string;
|
|
660
|
+
srcSet?: string;
|
|
661
|
+
type?: string;
|
|
662
|
+
fallbackSrc?: string;
|
|
663
|
+
fallbackSrcSet?: string;
|
|
664
|
+
fallbackType?: string;
|
|
665
|
+
placeholderSrc?: string;
|
|
666
|
+
alt?: string;
|
|
667
|
+
seoName?: string;
|
|
668
|
+
width?: number;
|
|
669
|
+
height?: number;
|
|
670
|
+
highPriority?: boolean;
|
|
671
|
+
hashId?: string;
|
|
672
|
+
crop?: ICrop;
|
|
673
|
+
transform?: ITransform;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* File value interface
|
|
677
|
+
*/
|
|
678
|
+
export interface IFileSource {
|
|
679
|
+
name: string;
|
|
680
|
+
url: string;
|
|
681
|
+
size: number;
|
|
682
|
+
extension: string;
|
|
683
|
+
pagesNum: number;
|
|
684
|
+
title?: string | undefined;
|
|
685
|
+
alt?: string | undefined;
|
|
686
|
+
copyright?: string | undefined;
|
|
687
|
+
source?: string | undefined;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* A Color for a Select sidebar prop
|
|
691
|
+
*/
|
|
692
|
+
export interface IColor {
|
|
693
|
+
color: string;
|
|
694
|
+
[propName: string]: any;
|
|
695
|
+
}
|
|
696
|
+
export interface IBrickStory {
|
|
697
|
+
brickName: string;
|
|
698
|
+
storyName: string;
|
|
699
|
+
locked?: boolean;
|
|
700
|
+
canAddAfter?: boolean;
|
|
701
|
+
canAddBefore?: boolean;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* TemplateSlot type
|
|
705
|
+
*/
|
|
706
|
+
export type TemplateSlot = {
|
|
707
|
+
slotName: string;
|
|
708
|
+
label: string;
|
|
709
|
+
min?: number;
|
|
710
|
+
max?: number;
|
|
711
|
+
allowedBlockTypes?: string[];
|
|
712
|
+
excludedBlockTypes?: string[];
|
|
713
|
+
editable?: boolean;
|
|
714
|
+
getDefaultContent?: () => (string | IBrickStory | IContentBlock)[];
|
|
715
|
+
};
|
|
716
|
+
export type RenderEnvironment = 'Frontend' | 'Preview' | 'Admin' | 'Email';
|
|
717
|
+
export interface IRenderWrapperArgs {
|
|
718
|
+
children: React__default.ReactElement;
|
|
719
|
+
page: PageValues;
|
|
720
|
+
renderEnvironment: RenderEnvironment;
|
|
721
|
+
}
|
|
722
|
+
export interface IRenderEmailHtmlArgs {
|
|
723
|
+
children: React__default.ReactElement;
|
|
724
|
+
page: PageValues;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Page type
|
|
728
|
+
*/
|
|
729
|
+
export interface IPageType {
|
|
730
|
+
name: string;
|
|
731
|
+
pluralName: string;
|
|
732
|
+
isEntity?: boolean;
|
|
733
|
+
allowedBlockTypes?: string[];
|
|
734
|
+
excludedBlockTypes?: string[];
|
|
735
|
+
defaultLocked?: boolean;
|
|
736
|
+
defaultStatus?: PageStatus;
|
|
737
|
+
defaultFeaturedImage?: string;
|
|
738
|
+
getDefaultContent?: () => (string | IBrickStory | IContentBlock)[];
|
|
739
|
+
customFields?: Array<ISideEditPropPage | ISideGroup>;
|
|
740
|
+
getExternalData?: (page: Page, args?: any) => Promise<Props>;
|
|
741
|
+
getDefaultMeta?: (page: PageFromList, externalData: Props) => Partial<IMeta>;
|
|
742
|
+
metaImageAspectRatio?: number;
|
|
743
|
+
categories?: ICategory[];
|
|
744
|
+
slugPrefix?: ISlugPrefix;
|
|
745
|
+
template?: Array<TemplateSlot>;
|
|
746
|
+
headlessView?: boolean;
|
|
747
|
+
isEmailMarketing?: boolean;
|
|
748
|
+
renderWrapper?: (args: IRenderWrapperArgs) => React__default.ReactElement;
|
|
749
|
+
renderEmailHtml?: (args: IRenderEmailHtmlArgs) => string | Promise<string>;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Structure returned by the cleanBlocks function
|
|
753
|
+
*/
|
|
754
|
+
export interface ICleanBlocks {
|
|
755
|
+
blocks: IContentBlock[];
|
|
756
|
+
invalidBlocksTypes: string[];
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Responsive breakpoint for preview
|
|
760
|
+
*/
|
|
761
|
+
export interface ResponsiveBreakpoint {
|
|
762
|
+
type: DeviceType;
|
|
763
|
+
width: number | string;
|
|
764
|
+
label: string;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Login UI customization
|
|
768
|
+
*/
|
|
769
|
+
export interface LoginUI {
|
|
770
|
+
sideImage?: string;
|
|
771
|
+
logo?: string;
|
|
772
|
+
logoWidth?: number;
|
|
773
|
+
logoHeight?: number;
|
|
774
|
+
welcomeText?: string;
|
|
775
|
+
welcomeTextStyle?: React__default.CSSProperties;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* MenuItem interface
|
|
779
|
+
*/
|
|
780
|
+
export interface IMenuItem {
|
|
781
|
+
label: string;
|
|
782
|
+
path?: string;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* The ReactBricks configuration
|
|
786
|
+
*/
|
|
787
|
+
export interface ReactBricksConfig {
|
|
788
|
+
appId: string;
|
|
789
|
+
apiKey: string;
|
|
790
|
+
environment?: string;
|
|
791
|
+
bricks?: types.Brick<any>[] | types.Theme[];
|
|
792
|
+
pageTypes?: types.IPageType[];
|
|
793
|
+
logo?: string;
|
|
794
|
+
loginUI?: LoginUI;
|
|
795
|
+
contentClassName?: string;
|
|
796
|
+
defaultTheme?: string;
|
|
797
|
+
renderLocalLink: types.RenderLocalLink;
|
|
798
|
+
navigate: (path: string) => void;
|
|
799
|
+
loginPath?: string;
|
|
800
|
+
editorPath?: string;
|
|
801
|
+
mediaLibraryPath?: string;
|
|
802
|
+
playgroundPath?: string;
|
|
803
|
+
appSettingsPath?: string;
|
|
804
|
+
previewPath?: string;
|
|
805
|
+
getAdminMenu?: (args: {
|
|
806
|
+
isAdmin: boolean;
|
|
807
|
+
}) => IMenuItem[];
|
|
808
|
+
isDarkColorMode?: boolean;
|
|
809
|
+
toggleColorMode?: () => void;
|
|
810
|
+
useCssInJs?: boolean;
|
|
811
|
+
appRootElement: string | HTMLElement;
|
|
812
|
+
clickToEditSide?: ClickToEditSide;
|
|
813
|
+
customFields?: Array<ISideEditPropPage | ISideGroup>;
|
|
814
|
+
responsiveBreakpoints?: ResponsiveBreakpoint[];
|
|
815
|
+
enableAutoSave?: boolean;
|
|
816
|
+
disableSaveIfInvalidProps?: boolean;
|
|
817
|
+
enablePreview?: boolean;
|
|
818
|
+
blockIconsPosition?: BlockIconsPosition;
|
|
819
|
+
enablePreviewImage?: boolean;
|
|
820
|
+
enablePreviewIcon?: boolean;
|
|
821
|
+
enableUnsplash?: boolean;
|
|
822
|
+
unsplashApiKey?: string;
|
|
823
|
+
enableDefaultEmbedBrick?: boolean;
|
|
824
|
+
checkUnsavedChanges?: boolean;
|
|
825
|
+
permissions?: Permissions;
|
|
826
|
+
allowAccentsInSlugs?: boolean;
|
|
827
|
+
warningIfLowBattery?: boolean;
|
|
828
|
+
rtlLanguages?: Array<string>;
|
|
829
|
+
apiPrefix?: string;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* The ReactBricks context
|
|
833
|
+
*/
|
|
834
|
+
export interface IReactBricksContext {
|
|
835
|
+
version: string;
|
|
836
|
+
appId: string;
|
|
837
|
+
apiKey: string;
|
|
838
|
+
environment?: string;
|
|
839
|
+
bricks: Bricks;
|
|
840
|
+
themes: types.Theme[];
|
|
841
|
+
pageTypes: IPageType[];
|
|
842
|
+
logo: string;
|
|
843
|
+
loginUI: LoginUI;
|
|
844
|
+
contentClassName: string;
|
|
845
|
+
defaultTheme: string;
|
|
846
|
+
renderLocalLink: RenderLocalLink;
|
|
847
|
+
navigate: (path: string) => void;
|
|
848
|
+
loginPath: string;
|
|
849
|
+
editorPath: string;
|
|
850
|
+
mediaLibraryPath: string;
|
|
851
|
+
playgroundPath: string;
|
|
852
|
+
appSettingsPath: string;
|
|
853
|
+
previewPath: string;
|
|
854
|
+
getAdminMenu?: (args: {
|
|
855
|
+
isAdmin: boolean;
|
|
856
|
+
}) => IMenuItem[];
|
|
857
|
+
isDarkColorMode?: boolean;
|
|
858
|
+
toggleColorMode?: () => void;
|
|
859
|
+
useCssInJs?: boolean;
|
|
860
|
+
appRootElement: string | HTMLElement;
|
|
861
|
+
clickToEditSide?: ClickToEditSide;
|
|
862
|
+
customFields?: Array<ISideEditPropPage | ISideGroup>;
|
|
863
|
+
responsiveBreakpoints: ResponsiveBreakpoint[];
|
|
864
|
+
enableAutoSave: boolean;
|
|
865
|
+
disableSaveIfInvalidProps: boolean;
|
|
866
|
+
enablePreview: boolean;
|
|
867
|
+
browserSupport: {
|
|
868
|
+
webP: boolean;
|
|
869
|
+
lazyLoading: boolean;
|
|
870
|
+
};
|
|
871
|
+
blockIconsPosition: BlockIconsPosition;
|
|
872
|
+
enablePreviewImage: boolean;
|
|
873
|
+
enablePreviewIcon: boolean;
|
|
874
|
+
enableUnsplash: boolean;
|
|
875
|
+
unsplashApiKey?: string;
|
|
876
|
+
enableDefaultEmbedBrick: boolean;
|
|
877
|
+
checkUnsavedChanges: boolean;
|
|
878
|
+
permissions?: Permissions;
|
|
879
|
+
allowAccentsInSlugs: boolean;
|
|
880
|
+
warningIfLowBattery: boolean;
|
|
881
|
+
isRtlLanguage: ({ language }: {
|
|
882
|
+
language: string;
|
|
883
|
+
}) => boolean;
|
|
884
|
+
rtlLanguages: string[];
|
|
885
|
+
apiPrefix?: string;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* The current page in Admin
|
|
889
|
+
*/
|
|
890
|
+
export interface ICurrentPage {
|
|
891
|
+
pageId: string;
|
|
892
|
+
language?: string;
|
|
893
|
+
variantName?: string;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* The Admin context returned from useAdminContext
|
|
897
|
+
*/
|
|
898
|
+
export interface IReadAdminContext {
|
|
899
|
+
isAdmin: boolean;
|
|
900
|
+
previewMode: boolean;
|
|
901
|
+
currentPage: ICurrentPage;
|
|
902
|
+
showRichTextModal: ShowRichTextModal;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Opengraph type
|
|
906
|
+
*/
|
|
907
|
+
export type OpenGraphType = 'article' | 'website' | 'profile' | 'book' | 'video' | 'music';
|
|
908
|
+
/**
|
|
909
|
+
* OpenGraph data
|
|
910
|
+
*/
|
|
911
|
+
export type OpenGraphData = {
|
|
912
|
+
url?: string;
|
|
913
|
+
type?: OpenGraphType;
|
|
914
|
+
title?: string;
|
|
915
|
+
description?: string;
|
|
916
|
+
image?: types.IImageSource;
|
|
917
|
+
};
|
|
918
|
+
/**
|
|
919
|
+
* Twitter card type
|
|
920
|
+
*/
|
|
921
|
+
export type TwitterCardType = 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
922
|
+
/**
|
|
923
|
+
* Data for Twitter card
|
|
924
|
+
*/
|
|
925
|
+
export type TwitterCardData = {
|
|
926
|
+
card?: TwitterCardType;
|
|
927
|
+
site?: string;
|
|
928
|
+
creator?: string;
|
|
929
|
+
title?: string;
|
|
930
|
+
description?: string;
|
|
931
|
+
image?: types.IImageSource;
|
|
932
|
+
};
|
|
933
|
+
/**
|
|
934
|
+
* Meta Fields type
|
|
935
|
+
* */
|
|
936
|
+
export type MetaData = {
|
|
937
|
+
title?: string;
|
|
938
|
+
description?: string;
|
|
939
|
+
keywords?: string;
|
|
940
|
+
noindex?: boolean;
|
|
941
|
+
hideGeneratorTag?: boolean;
|
|
942
|
+
featuredImage?: string;
|
|
943
|
+
image?: IImageSource;
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* Meta fields on Page
|
|
947
|
+
*/
|
|
948
|
+
export interface IMeta extends MetaData {
|
|
949
|
+
language?: string;
|
|
950
|
+
openGraph?: OpenGraphData;
|
|
951
|
+
twitterCard?: TwitterCardData;
|
|
952
|
+
schemaOrg?: SchemaOrgData;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Category on categories (pageTypes)
|
|
956
|
+
*/
|
|
957
|
+
export interface ICategory {
|
|
958
|
+
category?: string;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* A RichTextExt Plugin
|
|
962
|
+
*/
|
|
963
|
+
export interface RichTextPlugin {
|
|
964
|
+
type: 'Mark' | 'Block' | 'List';
|
|
965
|
+
name: string;
|
|
966
|
+
isInline?: boolean;
|
|
967
|
+
itemName?: string;
|
|
968
|
+
label: string;
|
|
969
|
+
hotKey?: string;
|
|
970
|
+
renderElement?: (props: RenderElementProps) => React__default.ReactElement;
|
|
971
|
+
renderItemElement?: (props: RenderElementProps) => React__default.ReactElement;
|
|
972
|
+
renderLeaf?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
973
|
+
toggle: (editor: Editor, plugins: RichTextPlugin[], showRichTextModal: types.ShowRichTextModal) => void;
|
|
974
|
+
button?: {
|
|
975
|
+
icon: React__default.ReactElement;
|
|
976
|
+
isActive: (editor: Editor) => boolean;
|
|
977
|
+
};
|
|
978
|
+
enhanceEditor?: (editor: Editor) => Editor;
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* Definition for a Mark plugin
|
|
982
|
+
*/
|
|
983
|
+
export interface MarkPlugin {
|
|
984
|
+
name: string;
|
|
985
|
+
label?: string;
|
|
986
|
+
hotKey?: string;
|
|
987
|
+
render: (props: RenderLeafProps) => React__default.ReactElement;
|
|
988
|
+
icon?: React__default.ReactElement;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Constructor for a Mark plugin
|
|
992
|
+
*/
|
|
993
|
+
export type MarkPluginConstructor = (markPlugin: MarkPlugin) => RichTextPlugin;
|
|
994
|
+
/**
|
|
995
|
+
* Definition for a Block plugin
|
|
996
|
+
*/
|
|
997
|
+
export interface BlockPlugin {
|
|
998
|
+
name: string;
|
|
999
|
+
isInline?: boolean;
|
|
1000
|
+
itemName?: string;
|
|
1001
|
+
label?: string;
|
|
1002
|
+
hotKey?: string;
|
|
1003
|
+
render: (props: RenderElementProps) => React__default.ReactElement;
|
|
1004
|
+
renderItem?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1005
|
+
icon?: React__default.ReactElement;
|
|
1006
|
+
}
|
|
1007
|
+
export type BlockWithModalPlugin = BlockPlugin & {
|
|
1008
|
+
getDefaultProps?: () => Props;
|
|
1009
|
+
renderAdmin?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1010
|
+
renderItemAdmin?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1011
|
+
pluginCustomFields: Array<types.ISideEditPropPage | types.ISideGroup>;
|
|
1012
|
+
};
|
|
1013
|
+
/**
|
|
1014
|
+
* Constructor for a Block plugin
|
|
1015
|
+
*/
|
|
1016
|
+
export type BlockPluginConstructor = (blockPlugin: BlockPlugin) => RichTextPlugin;
|
|
1017
|
+
/**
|
|
1018
|
+
* Constructor for a Block with Modal plugin
|
|
1019
|
+
*/
|
|
1020
|
+
export type BlockWithModalPluginConstructor = (blockPlugin: BlockWithModalPlugin) => RichTextPlugin;
|
|
1021
|
+
/**
|
|
1022
|
+
* Icon
|
|
1023
|
+
*/
|
|
1024
|
+
export type Icon = {
|
|
1025
|
+
name: string;
|
|
1026
|
+
svg: string;
|
|
1027
|
+
url: string;
|
|
1028
|
+
set: IconSets;
|
|
1029
|
+
};
|
|
1030
|
+
export {};
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Props for Text
|
|
1035
|
+
*/
|
|
1036
|
+
interface FileProps {
|
|
1037
|
+
propName: string;
|
|
1038
|
+
renderBlock: (props: types.IFileSource | null) => React__default.ReactElement;
|
|
1039
|
+
allowedExtensions?: string[];
|
|
1040
|
+
/**
|
|
1041
|
+
* Field used with React Server Components
|
|
1042
|
+
*/
|
|
1043
|
+
source?: types.IFileSource;
|
|
1044
|
+
}
|
|
1045
|
+
declare const File: React__default.FC<FileProps>;
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Arguments for the renderWrapper function
|
|
1049
|
+
*/
|
|
1050
|
+
interface IRenderWrapperArgs {
|
|
1051
|
+
children: React.ReactNode;
|
|
1052
|
+
width?: number;
|
|
1053
|
+
height?: number;
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* renderWrapper function type
|
|
1057
|
+
*/
|
|
1058
|
+
type RenderWrapper = (args: IRenderWrapperArgs) => React.ReactElement;
|
|
1059
|
+
interface PlaceholderProps {
|
|
1060
|
+
aspectRatio?: number;
|
|
1061
|
+
maxWidth?: number;
|
|
1062
|
+
isDarkColorMode?: boolean;
|
|
1063
|
+
isAdmin: boolean;
|
|
1064
|
+
}
|
|
1065
|
+
interface SharedImageProps {
|
|
1066
|
+
readonly?: boolean;
|
|
1067
|
+
alt: string;
|
|
1068
|
+
noLazyLoad?: boolean;
|
|
1069
|
+
containerClassName?: string;
|
|
1070
|
+
containerStyle?: React.CSSProperties;
|
|
1071
|
+
imageClassName?: string;
|
|
1072
|
+
imageStyle?: React.CSSProperties;
|
|
1073
|
+
noWrapper?: boolean;
|
|
1074
|
+
quality?: number;
|
|
1075
|
+
sizes?: string;
|
|
1076
|
+
loading?: 'lazy' | 'eager';
|
|
1077
|
+
renderWrapper?: RenderWrapper;
|
|
1078
|
+
useNativeLazyLoading?: boolean;
|
|
1079
|
+
useWebP?: boolean;
|
|
1080
|
+
placeholder?: (props: PlaceholderProps) => string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Field used with React Server Components
|
|
1083
|
+
*/
|
|
1084
|
+
source?: types.IImageSource;
|
|
1085
|
+
}
|
|
1086
|
+
interface EditableImage extends SharedImageProps {
|
|
1087
|
+
readonly?: false;
|
|
1088
|
+
propName?: string;
|
|
1089
|
+
metaFieldName?: 'image';
|
|
1090
|
+
customFieldName?: string;
|
|
1091
|
+
aspectRatio?: number;
|
|
1092
|
+
maxWidth?: number;
|
|
1093
|
+
}
|
|
1094
|
+
interface ReadOnlyImage extends SharedImageProps {
|
|
1095
|
+
readonly: true;
|
|
1096
|
+
source: types.IImageSource;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Props for Image
|
|
1100
|
+
*/
|
|
1101
|
+
type ImageProps = EditableImage | ReadOnlyImage;
|
|
1102
|
+
declare const Image: React.FC<ImageProps>;
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* Props for Repeater
|
|
1106
|
+
*/
|
|
1107
|
+
interface RepeaterProps {
|
|
1108
|
+
propName: string;
|
|
1109
|
+
itemProps?: types.Props;
|
|
1110
|
+
renderWrapper?: (items: React.ReactElement) => React.ReactElement;
|
|
1111
|
+
renderItemWrapper?: (item: React.ReactElement, index: number, itemsCount: number) => React.ReactElement;
|
|
1112
|
+
/**
|
|
1113
|
+
* Field used with React Server Components
|
|
1114
|
+
*/
|
|
1115
|
+
items?: types.RepeaterItems;
|
|
1116
|
+
}
|
|
1117
|
+
declare const Repeater: React.FC<RepeaterProps>;
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Props for renderLink render function
|
|
1121
|
+
*/
|
|
1122
|
+
interface RenderLinkElementProps extends RenderElementProps {
|
|
1123
|
+
href: string;
|
|
1124
|
+
target?: string;
|
|
1125
|
+
rel?: string;
|
|
1126
|
+
}
|
|
1127
|
+
interface BaseRichTextProps {
|
|
1128
|
+
renderBlock?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1129
|
+
placeholder?: string;
|
|
1130
|
+
renderPlaceholder?: (props: {
|
|
1131
|
+
children: any;
|
|
1132
|
+
}) => React__default.ReactElement;
|
|
1133
|
+
multiline?: boolean;
|
|
1134
|
+
softLineBreak?: boolean;
|
|
1135
|
+
allowedFeatures?: types.RichTextFeatures[];
|
|
1136
|
+
shouldRefreshStyles?: boolean;
|
|
1137
|
+
renderBold?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
1138
|
+
renderItalic?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
1139
|
+
renderHighlight?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
1140
|
+
renderCode?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
1141
|
+
renderSub?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
1142
|
+
renderSup?: (props: RenderLeafProps) => React__default.ReactElement;
|
|
1143
|
+
renderLink?: (props: RenderLinkElementProps) => React__default.ReactElement;
|
|
1144
|
+
renderUL?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1145
|
+
renderOL?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1146
|
+
renderLI?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1147
|
+
renderH1?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1148
|
+
renderH2?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1149
|
+
renderH3?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1150
|
+
renderH4?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1151
|
+
renderH5?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1152
|
+
renderH6?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1153
|
+
renderQuote?: (props: RenderElementProps) => React__default.ReactElement;
|
|
1154
|
+
}
|
|
1155
|
+
interface RichTextPropsWithPropName extends BaseRichTextProps {
|
|
1156
|
+
propName: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* Field used with React Server Components
|
|
1159
|
+
*/
|
|
1160
|
+
value?: Descendant[] | string;
|
|
1161
|
+
metaFieldName?: never;
|
|
1162
|
+
customFieldName?: never;
|
|
1163
|
+
customFieldPlainText?: never;
|
|
1164
|
+
}
|
|
1165
|
+
interface RichTextPropsWithMetaFieldName extends BaseRichTextProps {
|
|
1166
|
+
propName?: never;
|
|
1167
|
+
value?: never;
|
|
1168
|
+
metaFieldName: 'title' | 'description' | 'language';
|
|
1169
|
+
customFieldName?: never;
|
|
1170
|
+
customFieldPlainText?: never;
|
|
1171
|
+
}
|
|
1172
|
+
interface RichTextPropsWithCustomFieldName extends BaseRichTextProps {
|
|
1173
|
+
propName?: never;
|
|
1174
|
+
value?: never;
|
|
1175
|
+
metaFieldName?: never;
|
|
1176
|
+
customFieldName: string;
|
|
1177
|
+
customFieldPlainText?: boolean;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Props for RichText component
|
|
1181
|
+
*/
|
|
1182
|
+
type RichTextProps$1 = RichTextPropsWithPropName | RichTextPropsWithMetaFieldName | RichTextPropsWithCustomFieldName;
|
|
1183
|
+
declare const CompatibleRichText: React__default.FC<RichTextProps$1>;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Props for RichTextExt (v3)
|
|
1187
|
+
*/
|
|
1188
|
+
interface RichTextProps {
|
|
1189
|
+
renderBlock?: (props: RenderElementProps) => React.ReactElement;
|
|
1190
|
+
placeholder?: string;
|
|
1191
|
+
renderPlaceholder?: (props: {
|
|
1192
|
+
children: any;
|
|
1193
|
+
}) => React.ReactElement;
|
|
1194
|
+
plugins?: types.RichTextPlugin[];
|
|
1195
|
+
multiline?: boolean;
|
|
1196
|
+
softLineBreak?: boolean;
|
|
1197
|
+
propName?: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* Field used with React Server Components
|
|
1200
|
+
*/
|
|
1201
|
+
value?: Descendant[] | string;
|
|
1202
|
+
metaFieldName?: 'title' | 'description' | 'language';
|
|
1203
|
+
customFieldName?: string;
|
|
1204
|
+
customFieldPlainText?: boolean;
|
|
1205
|
+
shouldRefreshStyles?: boolean;
|
|
1206
|
+
}
|
|
1207
|
+
declare const RichText: React.FC<RichTextProps>;
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* CustomElement for Slate
|
|
1211
|
+
*/
|
|
1212
|
+
type CustomElement = {
|
|
1213
|
+
type: string;
|
|
1214
|
+
element?: Element;
|
|
1215
|
+
children: CustomText[];
|
|
1216
|
+
[key: string]: any;
|
|
1217
|
+
};
|
|
1218
|
+
/**
|
|
1219
|
+
* CustomText for Slate
|
|
1220
|
+
*/
|
|
1221
|
+
type CustomText = {
|
|
1222
|
+
text?: string;
|
|
1223
|
+
[key: string]: any;
|
|
1224
|
+
};
|
|
1225
|
+
declare module 'slate' {
|
|
1226
|
+
interface CustomTypes {
|
|
1227
|
+
Editor: BaseEditor & ReactEditor & HistoryEditor;
|
|
1228
|
+
Element: CustomElement;
|
|
1229
|
+
Text: CustomText;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
interface BaseTextProps {
|
|
1233
|
+
renderBlock?: (props: RenderElementProps) => React.ReactElement;
|
|
1234
|
+
placeholder?: string;
|
|
1235
|
+
renderPlaceholder?: (props: {
|
|
1236
|
+
children: any;
|
|
1237
|
+
}) => React.ReactElement;
|
|
1238
|
+
multiline?: boolean;
|
|
1239
|
+
softLineBreak?: boolean;
|
|
1240
|
+
}
|
|
1241
|
+
interface TextPropsWithPropName extends BaseTextProps {
|
|
1242
|
+
propName: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* Field used with React Server Components
|
|
1245
|
+
*/
|
|
1246
|
+
value?: Descendant[] | string;
|
|
1247
|
+
metaFieldName?: never;
|
|
1248
|
+
customFieldName?: never;
|
|
1249
|
+
}
|
|
1250
|
+
interface TextPropsWithMetaFieldName extends BaseTextProps {
|
|
1251
|
+
propName?: never;
|
|
1252
|
+
value?: never;
|
|
1253
|
+
metaFieldName: 'title' | 'description' | 'language';
|
|
1254
|
+
customFieldName?: never;
|
|
1255
|
+
}
|
|
1256
|
+
interface TextPropsWithCustomFieldName extends BaseTextProps {
|
|
1257
|
+
propName?: never;
|
|
1258
|
+
value?: never;
|
|
1259
|
+
metaFieldName?: never;
|
|
1260
|
+
customFieldName: string;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Props for Text component
|
|
1264
|
+
*/
|
|
1265
|
+
type TextProps = TextPropsWithPropName | TextPropsWithMetaFieldName | TextPropsWithCustomFieldName;
|
|
1266
|
+
declare const Text: React.FC<TextProps>;
|
|
1267
|
+
|
|
1268
|
+
declare const useAdminContext: () => types.IReadAdminContext;
|
|
1269
|
+
|
|
1270
|
+
declare const usePageValues: () => [types.PageValues, (pageData: types.PartialPage) => void];
|
|
1271
|
+
|
|
1272
|
+
declare const useVisualEdit: (propName: string) => [any, (value: any) => void, boolean];
|
|
1273
|
+
|
|
1274
|
+
declare const blockPluginConstructor: types.BlockPluginConstructor;
|
|
1275
|
+
|
|
1276
|
+
declare const blockWithModalPluginConstructor: types.BlockWithModalPluginConstructor;
|
|
1277
|
+
|
|
1278
|
+
declare const markPluginConstructor: types.MarkPluginConstructor;
|
|
1279
|
+
|
|
1280
|
+
declare const plugin$f: types.RichTextPlugin;
|
|
1281
|
+
|
|
1282
|
+
declare const plugin$e: types.RichTextPlugin;
|
|
1283
|
+
|
|
1284
|
+
declare const plugin$d: types.RichTextPlugin;
|
|
1285
|
+
|
|
1286
|
+
declare const plugin$c: types.RichTextPlugin;
|
|
1287
|
+
|
|
1288
|
+
declare const plugin$b: types.RichTextPlugin;
|
|
1289
|
+
|
|
1290
|
+
declare const plugin$a: types.RichTextPlugin;
|
|
1291
|
+
|
|
1292
|
+
declare const plugin$9: types.RichTextPlugin;
|
|
1293
|
+
|
|
1294
|
+
declare const plugin$8: types.RichTextPlugin;
|
|
1295
|
+
|
|
1296
|
+
declare const plugin$7: types.RichTextPlugin;
|
|
1297
|
+
|
|
1298
|
+
declare const plugin$6: types.RichTextPlugin;
|
|
1299
|
+
|
|
1300
|
+
declare const plugin$5: types.RichTextPlugin;
|
|
1301
|
+
|
|
1302
|
+
declare const plugin$4: types.RichTextPlugin;
|
|
1303
|
+
|
|
1304
|
+
declare const plugin$3: types.RichTextPlugin;
|
|
1305
|
+
|
|
1306
|
+
declare const plugin$2: types.RichTextPlugin;
|
|
1307
|
+
|
|
1308
|
+
declare const plugin$1: types.RichTextPlugin;
|
|
1309
|
+
|
|
1310
|
+
declare const plugin: types.RichTextPlugin;
|
|
1311
|
+
|
|
1312
|
+
declare namespace index {
|
|
1313
|
+
export {
|
|
1314
|
+
plugin$f as bold,
|
|
1315
|
+
plugin$d as code,
|
|
1316
|
+
plugin$8 as heading1,
|
|
1317
|
+
plugin$7 as heading2,
|
|
1318
|
+
plugin$6 as heading3,
|
|
1319
|
+
plugin$5 as heading4,
|
|
1320
|
+
plugin$4 as heading5,
|
|
1321
|
+
plugin$3 as heading6,
|
|
1322
|
+
plugin$c as highlight,
|
|
1323
|
+
plugin$e as italic,
|
|
1324
|
+
plugin$9 as link,
|
|
1325
|
+
plugin$1 as orderedList,
|
|
1326
|
+
plugin$2 as quote,
|
|
1327
|
+
plugin$b as sub,
|
|
1328
|
+
plugin$a as sup,
|
|
1329
|
+
plugin as unorderedList,
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* Props for PageViewer
|
|
1335
|
+
*/
|
|
1336
|
+
interface PreviewProps {
|
|
1337
|
+
renderWrapper?: (args: types.IRenderWrapperArgs) => React.ReactElement;
|
|
1338
|
+
}
|
|
1339
|
+
declare const Preview: React.FC<PreviewProps>;
|
|
1340
|
+
|
|
1341
|
+
declare const ReactBricks: React.FC<types.ReactBricksConfig & {
|
|
1342
|
+
children: React.ReactNode;
|
|
1343
|
+
}>;
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Icon Props
|
|
1347
|
+
*/
|
|
1348
|
+
interface IconProps extends Omit<Props, 'src'> {
|
|
1349
|
+
icon?: types.Icon;
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Component to render an Icon from an IconSelector sideEditProp
|
|
1353
|
+
*/
|
|
1354
|
+
declare const Icon: React.FC<IconProps>;
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Props for PageViewer
|
|
1358
|
+
*/
|
|
1359
|
+
interface PageViewerProps {
|
|
1360
|
+
page: types.Page | null | undefined;
|
|
1361
|
+
main?: boolean;
|
|
1362
|
+
showClickToEdit?: boolean;
|
|
1363
|
+
preview?: boolean;
|
|
1364
|
+
}
|
|
1365
|
+
declare const PageViewer: React.FC<PageViewerProps>;
|
|
1366
|
+
|
|
1367
|
+
declare const Slot: React__default.FC<SlotProps>;
|
|
1368
|
+
|
|
1369
|
+
declare const getSchemaOrgData: (page: types.Page) => string | null;
|
|
1370
|
+
|
|
1371
|
+
declare const renderJsonLd: React__default.FC<types.Page>;
|
|
1372
|
+
|
|
1373
|
+
interface MetaProps {
|
|
1374
|
+
page: types.Page;
|
|
1375
|
+
}
|
|
1376
|
+
declare const Meta: React.FC<MetaProps>;
|
|
1377
|
+
|
|
1378
|
+
declare const renderMeta: React.FC<types.Page>;
|
|
1379
|
+
|
|
1380
|
+
interface SendFormSubmissionResult {
|
|
1381
|
+
success: boolean;
|
|
1382
|
+
statusCode: number;
|
|
1383
|
+
message: string;
|
|
1384
|
+
}
|
|
1385
|
+
declare const sendFormSubmission: ({ appId, appEnv, token, formId, emailAddress, data, fetchOptions, }: SendFormSubmissionParams) => Promise<SendFormSubmissionResult>;
|
|
1386
|
+
|
|
1387
|
+
declare const fetchForms: (fetchOptions?: types.FetchOptions) => Promise<any>;
|
|
1388
|
+
|
|
1389
|
+
declare const usePage$1: (pageId: string, language?: string, variantName?: string) => QueryObserverResult<TData, TError>;
|
|
1390
|
+
|
|
1391
|
+
declare const usePage: (slug: string, language?: string, variantName?: string) => QueryObserverResult<TData, TError>;
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Values returned from usePages
|
|
1395
|
+
*/
|
|
1396
|
+
interface UsePagesType {
|
|
1397
|
+
<T extends boolean>({ type, types, tag, language, page, pageSize, sort, filterBy, usePagination, }: {
|
|
1398
|
+
type?: string;
|
|
1399
|
+
types?: string[];
|
|
1400
|
+
tag?: string;
|
|
1401
|
+
language: string;
|
|
1402
|
+
page?: number;
|
|
1403
|
+
pageSize?: number;
|
|
1404
|
+
sort?: string;
|
|
1405
|
+
filterBy?: {
|
|
1406
|
+
[key: string]: any;
|
|
1407
|
+
};
|
|
1408
|
+
usePagination: T;
|
|
1409
|
+
}): UseQueryResult<T extends true ? types.PagesFromListWithPagination : types.PageFromList[], unknown>;
|
|
1410
|
+
({ type, types, tag, language, page, pageSize, sort, filterBy, }: {
|
|
1411
|
+
type?: string;
|
|
1412
|
+
types?: string[];
|
|
1413
|
+
language: string;
|
|
1414
|
+
tag?: string;
|
|
1415
|
+
page?: number;
|
|
1416
|
+
pageSize?: number;
|
|
1417
|
+
sort?: string;
|
|
1418
|
+
filterBy?: {
|
|
1419
|
+
[key: string]: any;
|
|
1420
|
+
};
|
|
1421
|
+
}): UseQueryResult<types.PageFromList[], unknown>;
|
|
1422
|
+
(): UseQueryResult<types.PageFromList[], unknown>;
|
|
1423
|
+
}
|
|
1424
|
+
declare const usePages: UsePagesType;
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Values returned from the public usePage
|
|
1428
|
+
*/
|
|
1429
|
+
interface UsePagesPublicType {
|
|
1430
|
+
<T extends boolean>({ type, types, tag, language, page, pageSize, sort, filterBy, usePagination, }: {
|
|
1431
|
+
type?: string;
|
|
1432
|
+
types?: string[];
|
|
1433
|
+
tag?: string;
|
|
1434
|
+
language?: string;
|
|
1435
|
+
page?: number;
|
|
1436
|
+
pageSize?: number;
|
|
1437
|
+
sort?: string;
|
|
1438
|
+
filterBy?: {
|
|
1439
|
+
[key: string]: any;
|
|
1440
|
+
};
|
|
1441
|
+
usePagination: T;
|
|
1442
|
+
}): UseQueryResult<T extends true ? types.PagesFromListWithPagination : types.PageFromList[], unknown>;
|
|
1443
|
+
({ type, types, tag, language, page, pageSize, sort, filterBy, }: {
|
|
1444
|
+
type?: string;
|
|
1445
|
+
types?: string[];
|
|
1446
|
+
tag?: string;
|
|
1447
|
+
language?: string;
|
|
1448
|
+
page?: number;
|
|
1449
|
+
pageSize?: number;
|
|
1450
|
+
sort?: string;
|
|
1451
|
+
filterBy?: {
|
|
1452
|
+
[key: string]: any;
|
|
1453
|
+
};
|
|
1454
|
+
}): UseQueryResult<types.PageFromList[], unknown>;
|
|
1455
|
+
(): UseQueryResult<types.PageFromList[], unknown>;
|
|
1456
|
+
}
|
|
1457
|
+
declare const usePagesPublic: UsePagesPublicType;
|
|
1458
|
+
|
|
1459
|
+
declare const useTagsPublic: (page?: number, pageSize?: number, options?: {
|
|
1460
|
+
q?: string;
|
|
1461
|
+
language?: string;
|
|
1462
|
+
}) => QueryObserverResult<TData, TError>;
|
|
1463
|
+
|
|
1464
|
+
declare const useReactBricksContext: () => types.IReactBricksContext;
|
|
1465
|
+
|
|
1466
|
+
declare function fetchPage({ slug, language, variantName, getExternalDataArgs, config, }: {
|
|
1467
|
+
slug: string;
|
|
1468
|
+
language?: string;
|
|
1469
|
+
variantName?: string;
|
|
1470
|
+
getExternalDataArgs?: any;
|
|
1471
|
+
config: types.ReactBricksConfig;
|
|
1472
|
+
fetchOptions?: types.FetchOptions;
|
|
1473
|
+
}): Promise<types.Page>;
|
|
1474
|
+
declare function fetchPage(slug: string, apiKey: string, language?: string, pageTypes?: types.IPageType[], getExternalDataArgs?: any): Promise<types.Page>;
|
|
1475
|
+
|
|
1476
|
+
declare function fetchPages<T extends boolean>(apiKey: string, { type, types, tag, language, page, pageSize, sort, filterBy, usePagination, }: {
|
|
1477
|
+
type?: string;
|
|
1478
|
+
types?: string[];
|
|
1479
|
+
tag?: string;
|
|
1480
|
+
language?: string;
|
|
1481
|
+
page?: number;
|
|
1482
|
+
pageSize?: number;
|
|
1483
|
+
sort?: string;
|
|
1484
|
+
filterBy?: {
|
|
1485
|
+
[key: string]: any;
|
|
1486
|
+
};
|
|
1487
|
+
usePagination: T;
|
|
1488
|
+
}): Promise<T extends true ? types.PagesFromListWithPagination : types.PageFromList[]>;
|
|
1489
|
+
declare function fetchPages(apiKey: string, { type, types, tag, language, page, pageSize, filterBy, sort, }: {
|
|
1490
|
+
type?: string;
|
|
1491
|
+
types?: string[];
|
|
1492
|
+
tag?: string;
|
|
1493
|
+
language?: string;
|
|
1494
|
+
page?: number;
|
|
1495
|
+
pageSize?: number;
|
|
1496
|
+
sort?: string;
|
|
1497
|
+
filterBy?: {
|
|
1498
|
+
[key: string]: any;
|
|
1499
|
+
};
|
|
1500
|
+
}): Promise<types.PageFromList[]>;
|
|
1501
|
+
declare function fetchPages(apiKey: string): Promise<types.PageFromList[]>;
|
|
1502
|
+
declare function fetchPages<T extends boolean>(options: {
|
|
1503
|
+
type?: string;
|
|
1504
|
+
types?: string[];
|
|
1505
|
+
tag?: string;
|
|
1506
|
+
language?: string;
|
|
1507
|
+
page?: number;
|
|
1508
|
+
pageSize?: number;
|
|
1509
|
+
sort?: string;
|
|
1510
|
+
filterBy?: {
|
|
1511
|
+
[key: string]: any;
|
|
1512
|
+
};
|
|
1513
|
+
usePagination: T;
|
|
1514
|
+
fetchExternalData?: boolean;
|
|
1515
|
+
getExternalDataArgs?: any;
|
|
1516
|
+
config: types.ReactBricksConfig;
|
|
1517
|
+
}): Promise<T extends true ? types.PagesFromListWithPagination : types.PageFromList[]>;
|
|
1518
|
+
declare function fetchPages<T extends boolean>(options: {
|
|
1519
|
+
type?: string;
|
|
1520
|
+
types?: string[];
|
|
1521
|
+
tag?: string;
|
|
1522
|
+
language?: string;
|
|
1523
|
+
page?: number;
|
|
1524
|
+
pageSize?: number;
|
|
1525
|
+
sort?: string;
|
|
1526
|
+
filterBy?: {
|
|
1527
|
+
[key: string]: any;
|
|
1528
|
+
};
|
|
1529
|
+
fetchExternalData?: boolean;
|
|
1530
|
+
getExternalDataArgs?: any;
|
|
1531
|
+
config: types.ReactBricksConfig;
|
|
1532
|
+
}): Promise<types.PageFromList[]>;
|
|
1533
|
+
|
|
1534
|
+
type FetchTagsResult = {
|
|
1535
|
+
items: string[];
|
|
1536
|
+
pagination: {
|
|
1537
|
+
page: number;
|
|
1538
|
+
pageSize: number;
|
|
1539
|
+
totalItems: number;
|
|
1540
|
+
totalPages: number;
|
|
1541
|
+
};
|
|
1542
|
+
};
|
|
1543
|
+
declare function fetchTags(apiKey: string, page?: number, pageSize?: number, options?: {
|
|
1544
|
+
q?: string;
|
|
1545
|
+
language?: string;
|
|
1546
|
+
}, fetchOptions?: types.FetchOptions): Promise<FetchTagsResult>;
|
|
1547
|
+
declare function fetchTags(options: {
|
|
1548
|
+
page?: number;
|
|
1549
|
+
pageSize?: number;
|
|
1550
|
+
filterBy?: {
|
|
1551
|
+
q?: string;
|
|
1552
|
+
language?: string;
|
|
1553
|
+
};
|
|
1554
|
+
config: types.ReactBricksConfig;
|
|
1555
|
+
fetchOptions?: types.FetchOptions;
|
|
1556
|
+
}): Promise<FetchTagsResult>;
|
|
1557
|
+
|
|
1558
|
+
declare const _default: {
|
|
1559
|
+
serialize: (nodes: Node[]) => string;
|
|
1560
|
+
serializeLight: (nodes: any[]) => string | any[];
|
|
1561
|
+
deserialize: (input: string) => Descendant[];
|
|
1562
|
+
isText: (value: any) => boolean;
|
|
1563
|
+
isSlateContent: (value: any) => boolean;
|
|
1564
|
+
};
|
|
1565
|
+
|
|
1566
|
+
declare const cleanPage: (page: types.Page, pageTypes: types.IPageType[], bricks: types.Bricks) => types.Page;
|
|
1567
|
+
|
|
1568
|
+
declare const getPagePlainText: (blocks: types.IContentBlock[]) => string[];
|
|
1569
|
+
|
|
1570
|
+
interface JsonLdProps {
|
|
1571
|
+
page: types.Page;
|
|
1572
|
+
}
|
|
1573
|
+
declare const JsonLd: React__default.FC<JsonLdProps>;
|
|
1574
|
+
|
|
1575
|
+
interface CookieReader {
|
|
1576
|
+
get(name: string): {
|
|
1577
|
+
value: string | undefined;
|
|
1578
|
+
} | string | undefined | null;
|
|
1579
|
+
}
|
|
1580
|
+
interface CookieWriter {
|
|
1581
|
+
set(name: string, value: string, options?: Record<string, unknown>): void;
|
|
1582
|
+
delete(name: string): void;
|
|
1583
|
+
}
|
|
1584
|
+
type Variant = {
|
|
1585
|
+
name: string;
|
|
1586
|
+
weight: number;
|
|
1587
|
+
};
|
|
1588
|
+
declare function getAbTestingCookie({ slug, locale, cookieStore, }: {
|
|
1589
|
+
slug: string;
|
|
1590
|
+
locale: string;
|
|
1591
|
+
cookieStore: CookieReader;
|
|
1592
|
+
}): string | undefined;
|
|
1593
|
+
declare function getAbTestingCookie({ slug, locale, cookies, }: {
|
|
1594
|
+
slug: string;
|
|
1595
|
+
locale: string;
|
|
1596
|
+
cookies: Partial<{
|
|
1597
|
+
[key: string]: string;
|
|
1598
|
+
}>;
|
|
1599
|
+
}): string | undefined;
|
|
1600
|
+
declare function setAbTestingCookie({ slug, locale, variantName, cookieStore, variantUnpublishingDate, }: {
|
|
1601
|
+
slug: string;
|
|
1602
|
+
locale: string;
|
|
1603
|
+
variantName: string;
|
|
1604
|
+
cookieStore: CookieWriter;
|
|
1605
|
+
variantUnpublishingDate?: string;
|
|
1606
|
+
}): void;
|
|
1607
|
+
declare function removeAbTestingCookie({ slug, locale, cookieStore, }: {
|
|
1608
|
+
slug: string;
|
|
1609
|
+
locale: string;
|
|
1610
|
+
cookieStore: CookieWriter;
|
|
1611
|
+
}): void;
|
|
1612
|
+
declare function selectVariant<T extends Variant>(variants: T[]): T | null;
|
|
1613
|
+
|
|
1614
|
+
export { File, Icon, Image, JsonLd, Link, Meta, PageViewer, _default as Plain, Preview, ReactBricks, Repeater, CompatibleRichText as RichText, RichText as RichTextExt, Slot, Text, blockPluginConstructor, blockWithModalPluginConstructor, cleanPage, fetchForms, fetchPage, fetchPages, fetchTags, getAbTestingCookie, getPagePlainText, getSchemaOrgData, markPluginConstructor, index as plugins, removeAbTestingCookie, renderJsonLd, renderMeta, selectVariant, sendFormSubmission, setAbTestingCookie, types, useAdminContext, usePage$1 as usePage, usePage as usePagePublic, usePageValues, usePages, usePagesPublic, useReactBricksContext, useTagsPublic, useVisualEdit };
|