@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.
Files changed (184) hide show
  1. package/README.md +27 -20
  2. package/dist/2SSKDMRQ-BnsZi3K3.cjs +1 -0
  3. package/dist/2SSKDMRQ-CnSDkQcy.js +42 -0
  4. package/dist/AP7HFJJL-B31839PG.cjs +1228 -0
  5. package/dist/AP7HFJJL-CymCmW14.js +9214 -0
  6. package/dist/IconPicker-B1rWC-Ex.js +59 -0
  7. package/dist/IconPicker-DREyo007.cjs +1 -0
  8. package/dist/WDYDFRGG-BUVnbAci.js +33 -0
  9. package/dist/WDYDFRGG-BxhOCHc3.cjs +1 -0
  10. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  11. package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
  12. package/dist/actions-registery-CZ1w0NKa.js +15545 -0
  13. package/dist/actions-registery-YnFmU21O.cjs +418 -0
  14. package/dist/actions.cjs +1 -0
  15. package/dist/actions.d.ts +3202 -0
  16. package/dist/actions.js +216 -0
  17. package/dist/active-in-another-tab-B47YjQGN.cjs +1 -0
  18. package/dist/active-in-another-tab-CyjngVA6.js +34 -0
  19. package/dist/add-new-language-page-88xzrUy8.cjs +1 -0
  20. package/dist/add-new-language-page-WmlCnytQ.js +401 -0
  21. package/dist/add-new-page-VW2wAYZp.js +31 -0
  22. package/dist/add-new-page-soZ8GAkN.cjs +1 -0
  23. package/dist/ai-panel-content-7zCil042.cjs +1 -0
  24. package/dist/ai-panel-content-D_o7Q_A-.js +61 -0
  25. package/dist/ai-panel-default-lang-COYaxNwn.cjs +3 -0
  26. package/dist/ai-panel-default-lang-DnElspF0.js +341 -0
  27. package/dist/ai-panel-other-lang-CkynNlAU.cjs +1 -0
  28. package/dist/ai-panel-other-lang-Dp0E9_Hx.js +162 -0
  29. package/dist/ai-prompt-input-Bhc0ds7X.js +655 -0
  30. package/dist/ai-prompt-input-CThbVp0_.cjs +1 -0
  31. package/dist/ai-translation-prompt-C2kJQFDX.cjs +1 -0
  32. package/dist/ai-translation-prompt-CZ55HQmo.js +28 -0
  33. package/dist/apply-binding-6iwlED02.js +833 -0
  34. package/dist/apply-binding-KKp5PnpZ.cjs +1 -0
  35. package/dist/code-display-BnqzqzoP.cjs +1 -0
  36. package/dist/{code-display-337R7Dev.js → code-display-DhD_RBcg.js} +1 -1
  37. package/dist/code-editor-DRIAnNbb.js +50 -0
  38. package/dist/code-editor-o3___nu2.cjs +1 -0
  39. package/dist/common-functions-B3a4xKt_.cjs +1 -0
  40. package/dist/common-functions-D2lMFR6K.js +13 -0
  41. package/dist/continue-editing-in-this-client-CS2aQ7yY.js +24 -0
  42. package/dist/continue-editing-in-this-client-CtMYsk-A.cjs +1 -0
  43. package/dist/core-BoRDjj4h.cjs +1 -0
  44. package/dist/core-yvI6kCyw.js +56 -0
  45. package/dist/core.cjs +1 -1
  46. package/dist/core.d.ts +51 -383
  47. package/dist/core.js +39 -106
  48. package/dist/{css-import-modal-DA2L6kwP.js → css-import-modal-Byg6wV0O.js} +36 -36
  49. package/dist/css-import-modal-CyqkXWCO.cjs +13 -0
  50. package/dist/delete-design-token-BRZZiWtQ.js +40 -0
  51. package/dist/delete-design-token-DkVs1oBf.cjs +1 -0
  52. package/dist/delete-page-BzyX9TN-.js +70 -0
  53. package/dist/delete-page-DxX7PFIE.cjs +1 -0
  54. package/dist/design-token-usage-CAHzEGgJ.cjs +1 -0
  55. package/dist/design-token-usage-xQs6SlaJ.js +113 -0
  56. package/dist/digital-asset-manager--uO8Agia.cjs +1 -0
  57. package/dist/digital-asset-manager-DbtwzxRz.js +876 -0
  58. package/dist/duplicate-page-BR7Dlo9d.js +133 -0
  59. package/dist/duplicate-page-CaNAbXwV.cjs +1 -0
  60. package/dist/dynamic-page-selector-Cb5r_W8s.js +85 -0
  61. package/dist/dynamic-page-selector-Cxk_gjni.cjs +1 -0
  62. package/dist/fonts-B-Xt29pe.cjs +1 -0
  63. package/dist/fonts-DRly3Wzd.js +78 -0
  64. package/dist/{get-chai-builder-tailwind-config-C6MHaUM0.cjs → get-chai-builder-tailwind-config-B9rCyiQo.cjs} +1 -1
  65. package/dist/{get-chai-builder-tailwind-config-BqaIvg8p.js → get-chai-builder-tailwind-config-DjoVOuAf.js} +13 -10
  66. package/dist/{get-chai-builder-theme-D0IsUvK4.js → get-chai-builder-theme-BYtp20KD.js} +4 -4
  67. package/dist/get-chai-builder-theme-Dl72X7cz.cjs +1 -0
  68. package/dist/get-seo-defaults-9zHebckY.js +65 -0
  69. package/dist/get-seo-defaults-Cw7vFt-B.cjs +1 -0
  70. package/dist/image-compression-DZ9WMmyn.cjs +1 -0
  71. package/dist/image-compression-DsZ1oqpb.js +37 -0
  72. package/dist/image-editor-DV8kUKhl.js +108 -0
  73. package/dist/image-editor-G-K28aTS.cjs +1 -0
  74. package/dist/index-B-rSiAp_.cjs +1 -0
  75. package/dist/index-Ct7ElCGK.js +19069 -0
  76. package/dist/index-DF5DEvqb.cjs +160 -0
  77. package/dist/index-Dxfyt4d4.js +39 -0
  78. package/dist/index-WQwzsC7A.cjs +5 -0
  79. package/dist/index-ZuacEL1j.js +4732 -0
  80. package/dist/json-diff-viewer-D7z4zNvv.cjs +8 -0
  81. package/dist/json-diff-viewer-krslPepD.js +258 -0
  82. package/dist/lang-panel-BwIewMyw.js +215 -0
  83. package/dist/lang-panel-DT96k1xg.cjs +1 -0
  84. package/dist/manage-design-tokens-Caz_20VK.js +240 -0
  85. package/dist/manage-design-tokens-CrmLe7UT.cjs +1 -0
  86. package/dist/mark-as-template-D295ZQtU.js +156 -0
  87. package/dist/mark-as-template-W3LmpiqN.cjs +1 -0
  88. package/dist/models-5gOsRC56.cjs +1 -0
  89. package/dist/models-D95ZYr_x.js +70 -0
  90. package/dist/nested-path-selector-content-CKYYK-C5.js +87 -0
  91. package/dist/nested-path-selector-content-CoS_d3dc.cjs +1 -0
  92. package/dist/no-language-page-content-BvqRBP6y.js +42 -0
  93. package/dist/no-language-page-content-DkfeMl90.cjs +1 -0
  94. package/dist/no-language-page-dialog-BcEoqyQB.cjs +1 -0
  95. package/dist/no-language-page-dialog-PjNqTUpl.js +10 -0
  96. package/dist/page-creator-C4gc5NSC.cjs +1 -0
  97. package/dist/page-creator-DiOITEMw.js +795 -0
  98. package/dist/page-lock-BdYmCks0.cjs +1 -0
  99. package/dist/page-lock-Bfbs6RgL.js +30 -0
  100. package/dist/page-locked-dialog-B1FAtK92.cjs +1 -0
  101. package/dist/page-locked-dialog-B6MKTRfY.js +133 -0
  102. package/dist/page-manager-new-CHDueBDk.cjs +1 -0
  103. package/dist/page-manager-new-CzX22g2n.js +394 -0
  104. package/dist/page-manager-search-and-filter-CM0UMb6U.js +201 -0
  105. package/dist/page-manager-search-and-filter-DkkRIH86.cjs +1 -0
  106. package/dist/page-revisions-content-ChY-4f2V.cjs +1 -0
  107. package/dist/page-revisions-content-NH9JK4Ey.js +445 -0
  108. package/dist/pages.cjs +1 -0
  109. package/dist/pages.d.ts +491 -0
  110. package/dist/pages.js +27 -0
  111. package/dist/plugin-3ZKK6RXm.js +245 -0
  112. package/dist/plugin-C6rgJDNQ.cjs +22 -0
  113. package/dist/publish-pages-content-D9aixMN5.js +178 -0
  114. package/dist/publish-pages-content-x-JuSFJ9.cjs +1 -0
  115. package/dist/register-partial-type-BjtdfKHE.js +36 -0
  116. package/dist/register-partial-type-ig9fUWIJ.cjs +1 -0
  117. package/dist/render.cjs +2 -2
  118. package/dist/render.d.ts +26 -13
  119. package/dist/render.js +130 -124
  120. package/dist/rte-widget-modal-BaHIuEjF.cjs +1 -0
  121. package/dist/rte-widget-modal-DOJEXLIf.js +38 -0
  122. package/dist/runtime.cjs +1 -1
  123. package/dist/runtime.d.ts +306 -7
  124. package/dist/runtime.js +44 -1
  125. package/dist/save-to-lib-Cgpxw8-g.cjs +1 -0
  126. package/dist/save-to-lib-eiOc_SSN.js +422 -0
  127. package/dist/sdk.css +1 -1
  128. package/dist/selected-block-display-BgRY82CT.cjs +16 -0
  129. package/dist/selected-block-display-CBFePS19.js +319 -0
  130. package/dist/seo-panel-C1-iMOR1.js +798 -0
  131. package/dist/seo-panel-DfAb8U7W.cjs +2 -0
  132. package/dist/shared-json-ld-B4PxAM_0.js +565 -0
  133. package/dist/shared-json-ld-DzG398hr.cjs +1 -0
  134. package/dist/slug-input-AwNJs9im.js +86 -0
  135. package/dist/slug-input-C_ijLQ_X.cjs +1 -0
  136. package/dist/supabase-actions.cjs +1 -0
  137. package/dist/supabase-actions.d.ts +284 -0
  138. package/dist/supabase-actions.js +524 -0
  139. package/dist/take-over-request-BNxcjY2j.cjs +1 -0
  140. package/dist/take-over-request-C4FeDtN_.js +63 -0
  141. package/dist/theme-panel-footer-Cq9pljro.cjs +1 -0
  142. package/dist/theme-panel-footer-uBQqSJXm.js +25 -0
  143. package/dist/translation-warning-modal-B64YqlbI.js +26 -0
  144. package/dist/translation-warning-modal-BZAcwM2_.cjs +1 -0
  145. package/dist/unmark-as-template-CZ9sQp_P.js +39 -0
  146. package/dist/unmark-as-template-EVvk0vmp.cjs +1 -0
  147. package/dist/unpublish-page-D4VwOlxc.js +27 -0
  148. package/dist/unpublish-page-bdSmwAVQ.cjs +1 -0
  149. package/dist/use-page-expand-manager-B6XTvk0E.cjs +1 -0
  150. package/dist/use-page-expand-manager-Cf4MUEJw.js +85 -0
  151. package/dist/{tailwind.cjs → utils.cjs} +1 -1
  152. package/dist/{tailwind.d.ts → utils.d.ts} +12 -11
  153. package/dist/utils.js +7 -0
  154. package/dist/web-blocks.cjs +1 -1
  155. package/dist/web-blocks.d.ts +0 -6
  156. package/dist/web-blocks.js +248 -241
  157. package/dist/web-preview-Cio70gk5.cjs +1 -0
  158. package/dist/web-preview-Djy6WIyj.js +73 -0
  159. package/package.json +175 -105
  160. package/dist/IconPicker-CGWn9C4u.cjs +0 -1
  161. package/dist/IconPicker-QvxJ-4Ez.js +0 -64
  162. package/dist/apply-binding-DCno1xQL.js +0 -711
  163. package/dist/apply-binding-DvHNFLQD.cjs +0 -1
  164. package/dist/code-display-BZ1x7SqI.cjs +0 -1
  165. package/dist/code-editor-B28LoECM.cjs +0 -1
  166. package/dist/code-editor-CfG2FhJ-.js +0 -58
  167. package/dist/common-functions-BGzDsf1z.js +0 -14
  168. package/dist/common-functions-BZmyleS1.cjs +0 -1
  169. package/dist/css-import-modal-CENUYvcl.cjs +0 -13
  170. package/dist/get-chai-builder-theme-Ck_Z4Q-M.cjs +0 -1
  171. package/dist/index-CaGNHF7f.js +0 -12209
  172. package/dist/index-Gn6pJt2v.cjs +0 -166
  173. package/dist/mockServiceWorker.js +0 -307
  174. package/dist/plugin-B5627hMN.js +0 -195
  175. package/dist/plugin-UxTRfDum.cjs +0 -22
  176. package/dist/rte-widget-modal-DL739qeQ.cjs +0 -1
  177. package/dist/rte-widget-modal-Dte0od04.js +0 -41
  178. package/dist/tailwind.js +0 -7
  179. package/dist/tooltip-A4qGk781.cjs +0 -1
  180. package/dist/tooltip-tLiIOgjq.js +0 -1067
  181. package/dist/ui.cjs +0 -1
  182. package/dist/ui.d.ts +0 -415
  183. package/dist/ui.js +0 -129
  184. 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 | null | undefined;
80
- _bindings?: Record<string, string>;
69
+ _parent?: string;
81
70
  _libBlock?: string;
82
71
  _type: string;
83
- _partialBlockId?: string;
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
- autoSaveInterval?: TimeInSeconds;
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 type ClassDerivedObject = {
450
- cls: string;
451
- dark: boolean;
452
- fullCls: string;
453
- mod: string;
454
- mq: string;
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, chars?: string): string;
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 interface ThemeConfigProps {
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
- prop: string;
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
- export declare const useIsPageLoaded: () => [boolean, (args_0: boolean | ((prev: boolean) => boolean)) => void];
714
-
715
- export declare const useLanguages: () => {
716
- languages: any[];
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
- export declare const useLibraryBlocks: (library?: Partial<ChaiLibrary> & {
723
- id: string;
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
- }