@chaibuilder/sdk 4.0.0-beta.1 → 4.0.0-beta.3
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/README.md +27 -20
- package/dist/2SSKDMRQ-BnsZi3K3.cjs +1 -0
- package/dist/2SSKDMRQ-CnSDkQcy.js +42 -0
- package/dist/AP7HFJJL-B31839PG.cjs +1228 -0
- package/dist/AP7HFJJL-CymCmW14.js +9214 -0
- package/dist/IconPicker-B1rWC-Ex.js +59 -0
- package/dist/IconPicker-DREyo007.cjs +1 -0
- package/dist/WDYDFRGG-BUVnbAci.js +33 -0
- package/dist/WDYDFRGG-BxhOCHc3.cjs +1 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/actions-registery-CZ1w0NKa.js +15545 -0
- package/dist/actions-registery-YnFmU21O.cjs +418 -0
- package/dist/actions.cjs +1 -0
- package/dist/actions.d.ts +3202 -0
- package/dist/actions.js +216 -0
- package/dist/active-in-another-tab-B47YjQGN.cjs +1 -0
- package/dist/active-in-another-tab-CyjngVA6.js +34 -0
- package/dist/add-new-language-page-88xzrUy8.cjs +1 -0
- package/dist/add-new-language-page-WmlCnytQ.js +401 -0
- package/dist/add-new-page-VW2wAYZp.js +31 -0
- package/dist/add-new-page-soZ8GAkN.cjs +1 -0
- package/dist/ai-panel-content-7zCil042.cjs +1 -0
- package/dist/ai-panel-content-D_o7Q_A-.js +61 -0
- package/dist/ai-panel-default-lang-COYaxNwn.cjs +3 -0
- package/dist/ai-panel-default-lang-DnElspF0.js +341 -0
- package/dist/ai-panel-other-lang-CkynNlAU.cjs +1 -0
- package/dist/ai-panel-other-lang-Dp0E9_Hx.js +162 -0
- package/dist/ai-prompt-input-Bhc0ds7X.js +655 -0
- package/dist/ai-prompt-input-CThbVp0_.cjs +1 -0
- package/dist/ai-translation-prompt-C2kJQFDX.cjs +1 -0
- package/dist/ai-translation-prompt-CZ55HQmo.js +28 -0
- package/dist/apply-binding-6iwlED02.js +833 -0
- package/dist/apply-binding-KKp5PnpZ.cjs +1 -0
- package/dist/code-display-BnqzqzoP.cjs +1 -0
- package/dist/{code-display-337R7Dev.js → code-display-DhD_RBcg.js} +1 -1
- package/dist/code-editor-DRIAnNbb.js +50 -0
- package/dist/code-editor-o3___nu2.cjs +1 -0
- package/dist/common-functions-B3a4xKt_.cjs +1 -0
- package/dist/common-functions-D2lMFR6K.js +13 -0
- package/dist/continue-editing-in-this-client-CS2aQ7yY.js +24 -0
- package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +1 -0
- package/dist/core-BoRDjj4h.cjs +1 -0
- package/dist/core-yvI6kCyw.js +56 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +51 -383
- package/dist/core.js +39 -106
- package/dist/{css-import-modal-DA2L6kwP.js → css-import-modal-Byg6wV0O.js} +36 -36
- package/dist/css-import-modal-CyqkXWCO.cjs +13 -0
- package/dist/delete-design-token-BRZZiWtQ.js +40 -0
- package/dist/delete-design-token-DkVs1oBf.cjs +1 -0
- package/dist/delete-page-BzyX9TN-.js +70 -0
- package/dist/delete-page-DxX7PFIE.cjs +1 -0
- package/dist/design-token-usage-CAHzEGgJ.cjs +1 -0
- package/dist/design-token-usage-xQs6SlaJ.js +113 -0
- package/dist/digital-asset-manager--uO8Agia.cjs +1 -0
- package/dist/digital-asset-manager-DbtwzxRz.js +876 -0
- package/dist/duplicate-page-BR7Dlo9d.js +133 -0
- package/dist/duplicate-page-CaNAbXwV.cjs +1 -0
- package/dist/dynamic-page-selector-Cb5r_W8s.js +85 -0
- package/dist/dynamic-page-selector-Cxk_gjni.cjs +1 -0
- package/dist/fonts-B-Xt29pe.cjs +1 -0
- package/dist/fonts-DRly3Wzd.js +78 -0
- package/dist/{get-chai-builder-tailwind-config-C6MHaUM0.cjs → get-chai-builder-tailwind-config-B9rCyiQo.cjs} +1 -1
- package/dist/{get-chai-builder-tailwind-config-BqaIvg8p.js → get-chai-builder-tailwind-config-DjoVOuAf.js} +13 -10
- package/dist/{get-chai-builder-theme-D0IsUvK4.js → get-chai-builder-theme-BYtp20KD.js} +4 -4
- package/dist/get-chai-builder-theme-Dl72X7cz.cjs +1 -0
- package/dist/get-seo-defaults-9zHebckY.js +65 -0
- package/dist/get-seo-defaults-Cw7vFt-B.cjs +1 -0
- package/dist/image-compression-DZ9WMmyn.cjs +1 -0
- package/dist/image-compression-DsZ1oqpb.js +37 -0
- package/dist/image-editor-DV8kUKhl.js +108 -0
- package/dist/image-editor-G-K28aTS.cjs +1 -0
- package/dist/index-B-rSiAp_.cjs +1 -0
- package/dist/index-Ct7ElCGK.js +19069 -0
- package/dist/index-DF5DEvqb.cjs +160 -0
- package/dist/index-Dxfyt4d4.js +39 -0
- package/dist/index-WQwzsC7A.cjs +5 -0
- package/dist/index-ZuacEL1j.js +4732 -0
- package/dist/json-diff-viewer-D7z4zNvv.cjs +8 -0
- package/dist/json-diff-viewer-krslPepD.js +258 -0
- package/dist/lang-panel-BwIewMyw.js +215 -0
- package/dist/lang-panel-DT96k1xg.cjs +1 -0
- package/dist/manage-design-tokens-Caz_20VK.js +240 -0
- package/dist/manage-design-tokens-CrmLe7UT.cjs +1 -0
- package/dist/mark-as-template-D295ZQtU.js +156 -0
- package/dist/mark-as-template-W3LmpiqN.cjs +1 -0
- package/dist/models-5gOsRC56.cjs +1 -0
- package/dist/models-D95ZYr_x.js +70 -0
- package/dist/nested-path-selector-content-CKYYK-C5.js +87 -0
- package/dist/nested-path-selector-content-CoS_d3dc.cjs +1 -0
- package/dist/no-language-page-content-BvqRBP6y.js +42 -0
- package/dist/no-language-page-content-DkfeMl90.cjs +1 -0
- package/dist/no-language-page-dialog-BcEoqyQB.cjs +1 -0
- package/dist/no-language-page-dialog-PjNqTUpl.js +10 -0
- package/dist/page-creator-C4gc5NSC.cjs +1 -0
- package/dist/page-creator-DiOITEMw.js +795 -0
- package/dist/page-lock-BdYmCks0.cjs +1 -0
- package/dist/page-lock-Bfbs6RgL.js +30 -0
- package/dist/page-locked-dialog-B1FAtK92.cjs +1 -0
- package/dist/page-locked-dialog-B6MKTRfY.js +133 -0
- package/dist/page-manager-new-CHDueBDk.cjs +1 -0
- package/dist/page-manager-new-CzX22g2n.js +394 -0
- package/dist/page-manager-search-and-filter-CM0UMb6U.js +201 -0
- package/dist/page-manager-search-and-filter-DkkRIH86.cjs +1 -0
- package/dist/page-revisions-content-ChY-4f2V.cjs +1 -0
- package/dist/page-revisions-content-NH9JK4Ey.js +445 -0
- package/dist/pages.cjs +1 -0
- package/dist/pages.d.ts +491 -0
- package/dist/pages.js +27 -0
- package/dist/plugin-3ZKK6RXm.js +245 -0
- package/dist/plugin-C6rgJDNQ.cjs +22 -0
- package/dist/publish-pages-content-D9aixMN5.js +178 -0
- package/dist/publish-pages-content-x-JuSFJ9.cjs +1 -0
- package/dist/register-partial-type-BjtdfKHE.js +36 -0
- package/dist/register-partial-type-ig9fUWIJ.cjs +1 -0
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +26 -13
- package/dist/render.js +130 -124
- package/dist/rte-widget-modal-BaHIuEjF.cjs +1 -0
- package/dist/rte-widget-modal-DOJEXLIf.js +38 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.ts +306 -7
- package/dist/runtime.js +44 -1
- package/dist/save-to-lib-Cgpxw8-g.cjs +1 -0
- package/dist/save-to-lib-eiOc_SSN.js +422 -0
- package/dist/sdk.css +1 -1
- package/dist/selected-block-display-BgRY82CT.cjs +16 -0
- package/dist/selected-block-display-CBFePS19.js +319 -0
- package/dist/seo-panel-C1-iMOR1.js +798 -0
- package/dist/seo-panel-DfAb8U7W.cjs +2 -0
- package/dist/shared-json-ld-B4PxAM_0.js +565 -0
- package/dist/shared-json-ld-DzG398hr.cjs +1 -0
- package/dist/slug-input-AwNJs9im.js +86 -0
- package/dist/slug-input-C_ijLQ_X.cjs +1 -0
- package/dist/supabase-actions.cjs +1 -0
- package/dist/supabase-actions.d.ts +284 -0
- package/dist/supabase-actions.js +524 -0
- package/dist/take-over-request-BNxcjY2j.cjs +1 -0
- package/dist/take-over-request-C4FeDtN_.js +63 -0
- package/dist/theme-panel-footer-Cq9pljro.cjs +1 -0
- package/dist/theme-panel-footer-uBQqSJXm.js +25 -0
- package/dist/translation-warning-modal-B64YqlbI.js +26 -0
- package/dist/translation-warning-modal-BZAcwM2_.cjs +1 -0
- package/dist/unmark-as-template-CZ9sQp_P.js +39 -0
- package/dist/unmark-as-template-EVvk0vmp.cjs +1 -0
- package/dist/unpublish-page-D4VwOlxc.js +27 -0
- package/dist/unpublish-page-bdSmwAVQ.cjs +1 -0
- package/dist/use-page-expand-manager-B6XTvk0E.cjs +1 -0
- package/dist/use-page-expand-manager-Cf4MUEJw.js +85 -0
- package/dist/{tailwind.cjs → utils.cjs} +1 -1
- package/dist/{tailwind.d.ts → utils.d.ts} +12 -11
- package/dist/utils.js +7 -0
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.d.ts +0 -6
- package/dist/web-blocks.js +248 -241
- package/dist/web-preview-Cio70gk5.cjs +1 -0
- package/dist/web-preview-Djy6WIyj.js +73 -0
- package/package.json +175 -105
- package/dist/IconPicker-CGWn9C4u.cjs +0 -1
- package/dist/IconPicker-QvxJ-4Ez.js +0 -64
- package/dist/apply-binding-DCno1xQL.js +0 -711
- package/dist/apply-binding-DvHNFLQD.cjs +0 -1
- package/dist/code-display-BZ1x7SqI.cjs +0 -1
- package/dist/code-editor-B28LoECM.cjs +0 -1
- package/dist/code-editor-CfG2FhJ-.js +0 -58
- package/dist/common-functions-BGzDsf1z.js +0 -14
- package/dist/common-functions-BZmyleS1.cjs +0 -1
- package/dist/css-import-modal-CENUYvcl.cjs +0 -13
- package/dist/get-chai-builder-theme-Ck_Z4Q-M.cjs +0 -1
- package/dist/index-CaGNHF7f.js +0 -12209
- package/dist/index-Gn6pJt2v.cjs +0 -166
- package/dist/mockServiceWorker.js +0 -307
- package/dist/plugin-B5627hMN.js +0 -195
- package/dist/plugin-UxTRfDum.cjs +0 -22
- package/dist/rte-widget-modal-DL739qeQ.cjs +0 -1
- package/dist/rte-widget-modal-Dte0od04.js +0 -41
- package/dist/tailwind.js +0 -7
- package/dist/tooltip-A4qGk781.cjs +0 -1
- package/dist/tooltip-tLiIOgjq.js +0 -1067
- package/dist/ui.cjs +0 -1
- package/dist/ui.d.ts +0 -415
- package/dist/ui.js +0 -129
- package/dist/vite.svg +0 -1
package/dist/core.d.ts
CHANGED
|
@@ -5,15 +5,6 @@ import { DragEvent as DragEvent_2 } from 'react';
|
|
|
5
5
|
import { default as i18n } from 'i18next';
|
|
6
6
|
import { JSX } from 'react/jsx-runtime';
|
|
7
7
|
import * as React_2 from 'react';
|
|
8
|
-
import { ReactNode } from 'react';
|
|
9
|
-
import { RESET } from 'jotai/utils';
|
|
10
|
-
import { ThrottledFunction } from '@react-hookz/web';
|
|
11
|
-
import { useTranslation } from 'react-i18next';
|
|
12
|
-
|
|
13
|
-
declare type AddBlocks = {
|
|
14
|
-
addCoreBlock: any;
|
|
15
|
-
addPredefinedBlock: any;
|
|
16
|
-
};
|
|
17
8
|
|
|
18
9
|
declare type AddBlockTab = {
|
|
19
10
|
id: string;
|
|
@@ -29,6 +20,8 @@ declare type AskAiResponse = {
|
|
|
29
20
|
error?: any;
|
|
30
21
|
};
|
|
31
22
|
|
|
23
|
+
declare type BlocksWithDesignTokens = Record<string, string>;
|
|
24
|
+
|
|
32
25
|
declare type BorderRadiusValue = false | string;
|
|
33
26
|
|
|
34
27
|
declare type Breakpoint = {
|
|
@@ -39,8 +32,6 @@ declare type Breakpoint = {
|
|
|
39
32
|
width: number;
|
|
40
33
|
};
|
|
41
34
|
|
|
42
|
-
export declare type BreakpointName = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
43
|
-
|
|
44
35
|
export declare const ChaiAddBlocksDialog: () => JSX.Element;
|
|
45
36
|
|
|
46
37
|
export declare const ChaiAddBlocksPanel: ({ className, showHeading, parentId, position, fromSidebar, }: {
|
|
@@ -68,7 +59,6 @@ export declare type ChaiBlock<T = Record<string, any>> = {
|
|
|
68
59
|
_id: string;
|
|
69
60
|
_name?: string;
|
|
70
61
|
_parent?: string | null | undefined;
|
|
71
|
-
_bindings?: Record<string, string>;
|
|
72
62
|
_type: string;
|
|
73
63
|
_libBlock?: string;
|
|
74
64
|
} & T;
|
|
@@ -76,11 +66,10 @@ export declare type ChaiBlock<T = Record<string, any>> = {
|
|
|
76
66
|
declare type ChaiBlock_2<T = Record<string, any>> = {
|
|
77
67
|
_id: string;
|
|
78
68
|
_name?: string;
|
|
79
|
-
_parent?: string
|
|
80
|
-
_bindings?: Record<string, string>;
|
|
69
|
+
_parent?: string;
|
|
81
70
|
_libBlock?: string;
|
|
82
71
|
_type: string;
|
|
83
|
-
|
|
72
|
+
partialBlockId?: string;
|
|
84
73
|
} & T;
|
|
85
74
|
|
|
86
75
|
export declare const ChaiBlockAttributesEditor: React_2.MemoExoticComponent<() => JSX.Element>;
|
|
@@ -181,7 +170,7 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
181
170
|
/**
|
|
182
171
|
* Auto save interval in seconds
|
|
183
172
|
*/
|
|
184
|
-
|
|
173
|
+
autoSaveActionsCount?: number;
|
|
185
174
|
/**
|
|
186
175
|
* Breakpoints
|
|
187
176
|
*/
|
|
@@ -271,7 +260,16 @@ export declare interface ChaiBuilderEditorProps {
|
|
|
271
260
|
importTheme?: boolean;
|
|
272
261
|
gotoSettings?: boolean;
|
|
273
262
|
dragAndDrop?: boolean;
|
|
263
|
+
validateStructure?: boolean;
|
|
264
|
+
designTokens?: boolean;
|
|
274
265
|
};
|
|
266
|
+
structureRules?: StructureRule[];
|
|
267
|
+
designTokens?: DesignTokens;
|
|
268
|
+
siteWideUsage?: SiteWideUsage;
|
|
269
|
+
/**
|
|
270
|
+
* Screen to small message component
|
|
271
|
+
*/
|
|
272
|
+
smallScreenComponent?: ReactComponentType;
|
|
275
273
|
}
|
|
276
274
|
|
|
277
275
|
declare type ChaiBuilderThemeOptions = {
|
|
@@ -324,8 +322,14 @@ export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, disable
|
|
|
324
322
|
* <ChaiDraggableBlock blocks={async () => await fetchBlocks()}>
|
|
325
323
|
* <div>Drag me</div>
|
|
326
324
|
* </ChaiDraggableBlock>
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* // With Image block
|
|
328
|
+
* <ChaiDraggableBlock type="Image" block={{ image: "https://example.com/image.jpg" }}>
|
|
329
|
+
* <img src="https://example.com/image.jpg" alt="Image" />
|
|
330
|
+
* </ChaiDraggableBlock>
|
|
327
331
|
*/
|
|
328
|
-
export declare const ChaiDraggableBlock: ({ block, html, blocks, children, onDragStart: customOnDragStart, onDragEnd: customOnDragEnd, draggable: customDraggable, className, }: ChaiDraggableBlockProps) => JSX.Element;
|
|
332
|
+
export declare const ChaiDraggableBlock: ({ block, html, blocks, children, onDragStart: customOnDragStart, onDragEnd: customOnDragEnd, draggable: customDraggable, className, type, }: ChaiDraggableBlockProps) => JSX.Element;
|
|
329
333
|
|
|
330
334
|
declare type ChaiDraggableBlockProps = {
|
|
331
335
|
html?: string | (() => Promise<string>);
|
|
@@ -336,16 +340,11 @@ declare type ChaiDraggableBlockProps = {
|
|
|
336
340
|
onDragEnd?: (e: DragEvent_2) => void;
|
|
337
341
|
draggable?: boolean;
|
|
338
342
|
className?: string;
|
|
343
|
+
type?: "Box" | "Image";
|
|
339
344
|
};
|
|
340
345
|
|
|
341
346
|
export declare const ChaiExportCodeModal: () => JSX.Element;
|
|
342
347
|
|
|
343
|
-
declare type ChaiFlagOptions = {
|
|
344
|
-
key: string;
|
|
345
|
-
value?: any;
|
|
346
|
-
description?: string;
|
|
347
|
-
};
|
|
348
|
-
|
|
349
348
|
export declare const ChaiImportHTML: ({ parentId, position, fromSidebar, }: {
|
|
350
349
|
parentId?: string;
|
|
351
350
|
position?: number;
|
|
@@ -446,27 +445,12 @@ export declare const ChaiUILibrariesPanel: ({ parentId, position, fromSidebar, }
|
|
|
446
445
|
|
|
447
446
|
export declare const ChaiUndoRedo: () => JSX.Element;
|
|
448
447
|
|
|
449
|
-
declare
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
property: string;
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
declare type CodeEditorProps = {
|
|
459
|
-
blockId: string;
|
|
460
|
-
blockProp: string;
|
|
461
|
-
initialCode: string;
|
|
462
|
-
placeholder?: string;
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
declare type CopiedValue = string | null;
|
|
466
|
-
|
|
467
|
-
declare type CopyFn = (text: string) => Promise<boolean>;
|
|
468
|
-
|
|
469
|
-
declare type ExcludedBuilderProps = "blocks" | "subPages" | "brandingOptions" | "dataProviders";
|
|
448
|
+
declare interface DesignTokens {
|
|
449
|
+
[uniqueId: string]: {
|
|
450
|
+
name: string;
|
|
451
|
+
value: string;
|
|
452
|
+
};
|
|
453
|
+
}
|
|
470
454
|
|
|
471
455
|
declare type FilterOptions = {
|
|
472
456
|
id: string;
|
|
@@ -477,7 +461,7 @@ declare type FilterOptions = {
|
|
|
477
461
|
/**
|
|
478
462
|
* Get the unique uuid
|
|
479
463
|
*/
|
|
480
|
-
export declare function generateBlockId(length?: number
|
|
464
|
+
export declare function generateBlockId(length?: number): string;
|
|
481
465
|
|
|
482
466
|
/**
|
|
483
467
|
*
|
|
@@ -505,11 +489,6 @@ declare type HTMLString = string;
|
|
|
505
489
|
|
|
506
490
|
export { i18n }
|
|
507
491
|
|
|
508
|
-
export declare const IfChaiFeatureFlag: ({ flagKey, children }: {
|
|
509
|
-
flagKey: string;
|
|
510
|
-
children: React.ReactNode;
|
|
511
|
-
}) => ReactNode;
|
|
512
|
-
|
|
513
492
|
declare type MediaManagerProps = {
|
|
514
493
|
assetId?: string;
|
|
515
494
|
close: () => void;
|
|
@@ -519,11 +498,6 @@ declare type MediaManagerProps = {
|
|
|
519
498
|
|
|
520
499
|
export declare const mergeClasses: (...inputs: ClassValue[]) => string;
|
|
521
500
|
|
|
522
|
-
declare type Options = {
|
|
523
|
-
blockId?: string;
|
|
524
|
-
additionalCoreBlocks?: string[];
|
|
525
|
-
};
|
|
526
|
-
|
|
527
501
|
declare type PageType = {
|
|
528
502
|
key: string;
|
|
529
503
|
name: string;
|
|
@@ -535,12 +509,6 @@ declare type PageTypeItem = {
|
|
|
535
509
|
slug?: string;
|
|
536
510
|
};
|
|
537
511
|
|
|
538
|
-
declare type PartialBlockList = Record<string, {
|
|
539
|
-
name?: string;
|
|
540
|
-
description?: string;
|
|
541
|
-
type?: string;
|
|
542
|
-
}>;
|
|
543
|
-
|
|
544
512
|
export declare const PERMISSIONS: {
|
|
545
513
|
ADD_BLOCK: string;
|
|
546
514
|
DELETE_BLOCK: string;
|
|
@@ -566,10 +534,6 @@ export declare const registerBlockSettingWidget: (id: string, component: React.C
|
|
|
566
534
|
|
|
567
535
|
export declare const registerChaiAddBlockTab: (id: string, tab: Omit<AddBlockTab, "id">) => void;
|
|
568
536
|
|
|
569
|
-
export declare const registerChaiFeatureFlag: (key: string, flagOptions: Omit<ChaiFlagOptions, "key">) => void;
|
|
570
|
-
|
|
571
|
-
export declare const registerChaiFeatureFlags: (flags: Record<string, Omit<ChaiFlagOptions, "key">>) => void;
|
|
572
|
-
|
|
573
537
|
export declare const registerChaiLibrary: <T extends Record<string, any> = Record<string, any>>(id: string, library: Omit<ChaiLibraryConfig<T>, "id">) => void;
|
|
574
538
|
|
|
575
539
|
export declare const registerChaiMediaManager: (component: React.ComponentType<MediaManagerProps>) => void;
|
|
@@ -587,6 +551,7 @@ declare type SavePageData = {
|
|
|
587
551
|
blocks: ChaiBlock[];
|
|
588
552
|
theme?: ChaiThemeValues;
|
|
589
553
|
needTranslations?: boolean;
|
|
554
|
+
designTokens: DesignTokens;
|
|
590
555
|
};
|
|
591
556
|
|
|
592
557
|
declare type SaveToLibraryProps = {
|
|
@@ -595,338 +560,41 @@ declare type SaveToLibraryProps = {
|
|
|
595
560
|
close: () => void;
|
|
596
561
|
};
|
|
597
562
|
|
|
563
|
+
declare interface SiteWideUsage {
|
|
564
|
+
[pageId: string]: {
|
|
565
|
+
name: string;
|
|
566
|
+
isPartial: boolean;
|
|
567
|
+
partialBlocks: string[];
|
|
568
|
+
links: string[];
|
|
569
|
+
designTokens: BlocksWithDesignTokens;
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
|
|
598
573
|
declare type SortOptions = {
|
|
599
574
|
id: string;
|
|
600
575
|
name: string;
|
|
601
576
|
description?: string;
|
|
602
577
|
};
|
|
603
578
|
|
|
604
|
-
declare
|
|
605
|
-
className?: string;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
declare type TimeInSeconds = number;
|
|
609
|
-
|
|
610
|
-
declare type TStyleBlock = {
|
|
611
|
-
blockId: string;
|
|
579
|
+
declare type StructureError = {
|
|
612
580
|
id: string;
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
export declare const useAddBlock: () => AddBlocks;
|
|
617
|
-
|
|
618
|
-
export declare const useAddClassesToBlocks: () => (blockIds: Array<string>, newClasses: Array<string>, undo?: boolean) => void;
|
|
619
|
-
|
|
620
|
-
export declare const useAskAi: () => {
|
|
621
|
-
askAi: (type: "styles" | "content", blockId: string, prompt: string, onComplete?: (response?: AskAiResponse) => void) => Promise<void>;
|
|
622
|
-
loading: boolean;
|
|
623
|
-
error: any;
|
|
624
|
-
};
|
|
625
|
-
|
|
626
|
-
export declare const useBlockHighlight: () => {
|
|
627
|
-
highlightBlock: (elementOrID: HTMLElement | string) => void;
|
|
628
|
-
clearHighlight: () => void;
|
|
629
|
-
lastHighlighted: HTMLElement;
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
export declare const useBlocksHtmlForAi: () => (options?: Options) => any;
|
|
633
|
-
|
|
634
|
-
export declare const useBlocksStore: () => [any[], (args_0: any[] | ((prev: any[]) => any[])) => void];
|
|
635
|
-
|
|
636
|
-
export declare const useBlocksStoreUndoableActions: () => {
|
|
637
|
-
moveBlocks: (blockIds: string[], parent: string | undefined, position: number) => void;
|
|
638
|
-
addBlocks: (newBlocks: ChaiBlock[], parent?: string, position?: number) => void;
|
|
639
|
-
removeBlocks: (blocks: ChaiBlock[]) => void;
|
|
640
|
-
updateBlocks: (blockIds: string[], props: Partial<ChaiBlock>, oldPropsState?: Partial<ChaiBlock>) => void;
|
|
641
|
-
updateBlocksRuntime: (blockIds: string[], props: Record<string, any>) => void;
|
|
642
|
-
setNewBlocks: (newBlocks: ChaiBlock[]) => void;
|
|
643
|
-
updateMultipleBlocksProps: (blocks: Array<{
|
|
644
|
-
_id: string;
|
|
645
|
-
} & Partial<ChaiBlock>>) => void;
|
|
646
|
-
};
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Wrapper around useAtom
|
|
650
|
-
*/
|
|
651
|
-
export declare const useBrandingOptions: () => readonly [any, (args_0: any) => void];
|
|
652
|
-
|
|
653
|
-
export declare const useBuilderProp: <T>(propKey: keyof Omit<ChaiBuilderEditorProps, ExcludedBuilderProps> | "languages" | string, defaultValue?: T) => T;
|
|
654
|
-
|
|
655
|
-
export declare const useBuilderReset: () => () => void;
|
|
656
|
-
|
|
657
|
-
export declare const useCanvasDisplayWidth: () => readonly [number, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
|
|
658
|
-
|
|
659
|
-
export declare const useCanvasWidth: () => readonly [number, BreakpointName];
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* Wrapper hook around useAtom
|
|
663
|
-
*/
|
|
664
|
-
export declare const useCanvasZoom: () => [number, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
|
|
665
|
-
|
|
666
|
-
export declare const useChaiFeatureFlag: (flagKey: string) => boolean;
|
|
667
|
-
|
|
668
|
-
export declare const useChaiFeatureFlags: () => Record<string, ChaiFlagOptions>;
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* Custom hook to access the current state of the code editor.
|
|
672
|
-
* @category Hooks
|
|
673
|
-
* @returns The current state of the code editor from the `codeEditorAtom`.
|
|
674
|
-
*/
|
|
675
|
-
export declare const useCodeEditor: () => [CodeEditorProps, never];
|
|
676
|
-
|
|
677
|
-
export declare const useCopyBlockIds: () => [Array<string>, (blockIds: Array<string>, clonePartialBlocks?: boolean) => void, (blockIds: Array<string>) => boolean];
|
|
678
|
-
|
|
679
|
-
export declare const useCopyToClipboard: () => [CopiedValue, CopyFn];
|
|
680
|
-
|
|
681
|
-
export declare const useCurrentPage: () => {
|
|
682
|
-
currentPage: unknown;
|
|
683
|
-
};
|
|
684
|
-
|
|
685
|
-
export declare const useCutBlockIds: () => [Array<string>, Function];
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* Wrapper hook around useAtom
|
|
689
|
-
*/
|
|
690
|
-
export declare const useDarkMode: () => [boolean, Function];
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* useDuplicateBlock
|
|
694
|
-
*/
|
|
695
|
-
export declare const useDuplicateBlocks: () => Function;
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
*
|
|
699
|
-
*/
|
|
700
|
-
export declare const useHighlightBlockId: () => [string, Function];
|
|
701
|
-
|
|
702
|
-
export declare const useHtmlToBlocks: () => (html: string) => ChaiBlock[];
|
|
703
|
-
|
|
704
|
-
export declare const useI18nBlocks: () => (lang?: string | "ALL") => any;
|
|
705
|
-
|
|
706
|
-
export declare const useInlineEditing: () => {
|
|
707
|
-
editingBlockId: string;
|
|
708
|
-
editingItemIndex: number;
|
|
709
|
-
setEditingBlockId: (args_0: string | ((prev: string) => string)) => void;
|
|
710
|
-
setEditingItemIndex: (args_0: number | ((prev: number) => number)) => void;
|
|
581
|
+
message: string;
|
|
582
|
+
severity: "error" | "warning";
|
|
583
|
+
blockId?: string;
|
|
711
584
|
};
|
|
712
585
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
fallbackLang: string;
|
|
718
|
-
selectedLang: string;
|
|
719
|
-
setSelectedLang: (lang: string) => void;
|
|
586
|
+
declare type StructureRule = {
|
|
587
|
+
name: string;
|
|
588
|
+
description: string;
|
|
589
|
+
validate: (blocks: ChaiBlock[], tree: any[]) => StructureError[];
|
|
720
590
|
};
|
|
721
591
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
data: any;
|
|
726
|
-
isLoading: boolean;
|
|
727
|
-
resetLibrary: (libraryId: string) => void;
|
|
728
|
-
};
|
|
592
|
+
declare interface ThemeConfigProps {
|
|
593
|
+
className?: string;
|
|
594
|
+
}
|
|
729
595
|
|
|
730
596
|
export declare const useMediaManagerComponent: () => ComponentType<MediaManagerProps>;
|
|
731
597
|
|
|
732
|
-
export declare const usePartailBlocksStore: () => {
|
|
733
|
-
getPartailBlocks: (partailBlock: string) => any;
|
|
734
|
-
reset: () => void;
|
|
735
|
-
};
|
|
736
|
-
|
|
737
|
-
export declare const usePartialBlocksList: () => {
|
|
738
|
-
data: PartialBlockList;
|
|
739
|
-
isLoading: boolean;
|
|
740
|
-
refetch: () => Promise<void>;
|
|
741
|
-
error: string;
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
export declare const usePasteBlocks: () => {
|
|
745
|
-
canPaste: (newParentId: string) => Promise<boolean>;
|
|
746
|
-
pasteBlocks: (newParentId: string | string[]) => Promise<void>;
|
|
747
|
-
};
|
|
748
|
-
|
|
749
|
-
export declare const usePermissions: () => {
|
|
750
|
-
hasPermission: (permission: string) => any;
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
*
|
|
755
|
-
*/
|
|
756
|
-
export declare const usePreviewMode: () => [boolean, Function];
|
|
757
|
-
|
|
758
|
-
export declare function usePubSub<T>(eventName: string, callback: (data?: T) => void): void;
|
|
759
|
-
|
|
760
|
-
export declare const useRemoveAllClassesForBlock: () => (block: ChaiBlock, undo?: boolean) => void;
|
|
761
|
-
|
|
762
|
-
export declare const useRemoveBlocks: () => (blockIds: Array<string>) => void;
|
|
763
|
-
|
|
764
|
-
export declare const useRemoveClassesFromBlocks: () => Function;
|
|
765
|
-
|
|
766
|
-
export declare const useReplaceBlock: () => (blockId: string | undefined, replacementBlocks: ChaiBlock[]) => void;
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* useResetBlockStyles
|
|
770
|
-
*
|
|
771
|
-
* Provides helper functions to reset style props of the currently selected block.
|
|
772
|
-
*
|
|
773
|
-
* resetAll(): resets every style prop of the current block back to its default value.
|
|
774
|
-
* reset(styleId): resets a single style prop back to its default value.
|
|
775
|
-
*/
|
|
776
|
-
export declare const useResetBlockStyles: () => {
|
|
777
|
-
readonly resetAll: () => void;
|
|
778
|
-
readonly reset: (styleId: string) => void;
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
export declare const useRightPanel: () => ["theme" | "block" | "ai" | "settings", (args_0: "theme" | "block" | "ai" | "settings" | ((prev: "theme" | "block" | "ai" | "settings") => "theme" | "block" | "ai" | "settings")) => void];
|
|
782
|
-
|
|
783
|
-
export declare const useSavePage: () => {
|
|
784
|
-
savePage: ThrottledFunction<(autoSave?: boolean, force?: boolean) => Promise<boolean>>;
|
|
785
|
-
savePageAsync: (force?: boolean) => Promise<boolean>;
|
|
786
|
-
saveState: "SAVED" | "SAVING" | "UNSAVED";
|
|
787
|
-
setSaveState: (args_0: "SAVED" | "SAVING" | "UNSAVED" | ((prev: "SAVED" | "SAVING" | "UNSAVED") => "SAVED" | "SAVING" | "UNSAVED")) => void;
|
|
788
|
-
needTranslations: () => boolean;
|
|
789
|
-
};
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
*
|
|
793
|
-
*/
|
|
794
|
-
export declare const useScreenSizeWidth: () => readonly [number, string, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
|
|
795
|
-
|
|
796
|
-
/**
|
|
797
|
-
* useSelectedBlock hook
|
|
798
|
-
*/
|
|
799
|
-
export declare const useSelectedBlock: () => ChaiBlock;
|
|
800
|
-
|
|
801
|
-
export declare const useSelectedBlockAllClasses: () => Array<ClassDerivedObject>;
|
|
802
|
-
|
|
803
|
-
export declare const useSelectedBlockCurrentClasses: () => Array<ClassDerivedObject>;
|
|
804
|
-
|
|
805
|
-
/**
|
|
806
|
-
*
|
|
807
|
-
*/
|
|
808
|
-
export declare const useSelectedBlockIds: () => readonly [string[], (args_0: string[] | ((prev: string[]) => string[])) => void, (blockId: string) => void];
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Hook to get selected block ids
|
|
812
|
-
*/
|
|
813
|
-
export declare const useSelectedBlocksDisplayChild: () => {
|
|
814
|
-
flexChild: boolean;
|
|
815
|
-
gridChild: boolean;
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
export declare const useSelectedBreakpoints: () => [string[], Function];
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* Hook to get and set the selected UI library
|
|
822
|
-
* @returns {[string, (library: string) => void]} A tuple containing the selected library ID and a function to set the selected library
|
|
823
|
-
*/
|
|
824
|
-
export declare const useSelectedLibrary: () => [string, (args_0: string | RESET | ((prev: string) => string | RESET)) => void];
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* @group Hooks
|
|
828
|
-
* @returns {TStyleBlock[]} selected styling blocks
|
|
829
|
-
*/
|
|
830
|
-
export declare const useSelectedStylingBlocks: () => [TStyleBlock[], (args_0: TStyleBlock[] | ((prev: TStyleBlock[]) => TStyleBlock[])) => void];
|
|
831
|
-
|
|
832
|
-
export declare const useSidebarActivePanel: () => [string, (args_0: string | ((prev: string) => string)) => void];
|
|
833
|
-
|
|
834
|
-
export declare const useStreamMultipleBlocksProps: () => (blocks: Array<{
|
|
835
|
-
_id: string;
|
|
836
|
-
} & Partial<ChaiBlock>>) => Promise<void>;
|
|
837
|
-
|
|
838
|
-
export declare const useStylingBreakpoint: () => [string, (args_0: string | RESET | ((prev: string) => string | RESET)) => void];
|
|
839
|
-
|
|
840
|
-
export declare const useStylingState: () => [unknown, (...args: unknown[]) => unknown];
|
|
841
|
-
|
|
842
|
-
export declare const useTheme: () => readonly [{
|
|
843
|
-
fontFamily: {
|
|
844
|
-
heading: string;
|
|
845
|
-
body: string;
|
|
846
|
-
};
|
|
847
|
-
borderRadius: string;
|
|
848
|
-
colors: {
|
|
849
|
-
background: [string, string];
|
|
850
|
-
foreground: [string, string];
|
|
851
|
-
primary: [string, string];
|
|
852
|
-
"primary-foreground": [string, string];
|
|
853
|
-
secondary: [string, string];
|
|
854
|
-
"secondary-foreground": [string, string];
|
|
855
|
-
muted: [string, string];
|
|
856
|
-
"muted-foreground": [string, string];
|
|
857
|
-
accent: [string, string];
|
|
858
|
-
"accent-foreground": [string, string];
|
|
859
|
-
destructive: [string, string];
|
|
860
|
-
"destructive-foreground": [string, string];
|
|
861
|
-
border: [string, string];
|
|
862
|
-
input: [string, string];
|
|
863
|
-
ring: [string, string];
|
|
864
|
-
card: [string, string];
|
|
865
|
-
"card-foreground": [string, string];
|
|
866
|
-
popover: [string, string];
|
|
867
|
-
"popover-foreground": [string, string];
|
|
868
|
-
[key: string]: [string, string];
|
|
869
|
-
};
|
|
870
|
-
} | {
|
|
871
|
-
fontFamily: {
|
|
872
|
-
heading: string;
|
|
873
|
-
body: string;
|
|
874
|
-
};
|
|
875
|
-
borderRadius: string;
|
|
876
|
-
colors: {
|
|
877
|
-
background: [string, string];
|
|
878
|
-
foreground: [string, string];
|
|
879
|
-
primary: [string, string];
|
|
880
|
-
"primary-foreground": [string, string];
|
|
881
|
-
secondary: [string, string];
|
|
882
|
-
"secondary-foreground": [string, string];
|
|
883
|
-
muted: [string, string];
|
|
884
|
-
"muted-foreground": [string, string];
|
|
885
|
-
accent: [string, string];
|
|
886
|
-
"accent-foreground": [string, string];
|
|
887
|
-
destructive: [string, string];
|
|
888
|
-
"destructive-foreground": [string, string];
|
|
889
|
-
border: [string, string];
|
|
890
|
-
input: [string, string];
|
|
891
|
-
ring: [string, string];
|
|
892
|
-
card: [string, string];
|
|
893
|
-
"card-foreground": [string, string];
|
|
894
|
-
popover: [string, string];
|
|
895
|
-
"popover-foreground": [string, string];
|
|
896
|
-
[key: string]: [string, string];
|
|
897
|
-
};
|
|
898
|
-
}, (args_0: ChaiThemeValues | Partial<ChaiThemeValues> | ((prev: ChaiThemeValues | Partial<ChaiThemeValues>) => ChaiThemeValues | Partial<ChaiThemeValues>)) => void];
|
|
899
|
-
|
|
900
|
-
export declare const useThemeOptions: () => ChaiBuilderThemeOptions;
|
|
901
|
-
|
|
902
|
-
export declare const useToggleChaiFeatureFlag: (flagKey: string) => () => void;
|
|
903
|
-
|
|
904
|
-
export { useTranslation }
|
|
905
|
-
|
|
906
|
-
export declare const useUndoManager: () => {
|
|
907
|
-
add: (action: any) => void;
|
|
908
|
-
undo: () => void;
|
|
909
|
-
redo: () => void;
|
|
910
|
-
hasUndo: () => boolean;
|
|
911
|
-
hasRedo: () => boolean;
|
|
912
|
-
clear: () => void;
|
|
913
|
-
};
|
|
914
|
-
|
|
915
|
-
/**
|
|
916
|
-
*
|
|
917
|
-
*/
|
|
918
|
-
export declare const useUpdateBlocksProps: () => (blockIds: Array<string>, props: Record<string, any>, prevPropsState?: Record<string, any>) => void;
|
|
919
|
-
|
|
920
|
-
export declare const useUpdateBlocksPropsRealtime: () => (blockIds: Array<string>, props: Record<string, any>) => void;
|
|
921
|
-
|
|
922
|
-
export declare const useWrapperBlock: () => ChaiBlock;
|
|
923
|
-
|
|
924
598
|
declare type VariableKey = string;
|
|
925
599
|
|
|
926
600
|
export { }
|
|
927
|
-
|
|
928
|
-
declare global {
|
|
929
|
-
interface Window {
|
|
930
|
-
clarity: any;
|
|
931
|
-
}
|
|
932
|
-
}
|