@chaibuilder/sdk 1.2.8 → 1.2.10-7.beta.1

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 (122) hide show
  1. package/README.md +26 -21
  2. package/dist/CodeEditor-3Vp79cuE.cjs +1 -0
  3. package/dist/CodeEditor-bUqM7eCa.js +129 -0
  4. package/dist/STRINGS-Xxstm-7I.js +7 -0
  5. package/dist/STRINGS-Yl7cSWDc.cjs +1 -0
  6. package/dist/Topbar-P7-9Rps1.js +124 -0
  7. package/dist/Topbar-xwQ4JUZD.cjs +1 -0
  8. package/dist/UnsplashImages-BxgbXGB6.cjs +1 -0
  9. package/dist/UnsplashImages-nQSvWPU0.js +244 -0
  10. package/dist/UploadImages-L9LlI-jl.cjs +1 -0
  11. package/dist/UploadImages-SVnIHigg.js +153 -0
  12. package/dist/context-menu-YGd09SE1.js +979 -0
  13. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  14. package/dist/{controls-XPXGHKht.js → controls-lEwMTdPQ.js} +96 -44
  15. package/dist/controls-p9IwFnPx.cjs +1 -0
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.d.ts +344 -119
  18. package/dist/core.js +111 -88
  19. package/dist/iconBase-Ief2hJUZ.js +130 -0
  20. package/dist/iconBase-aZzpqff_.cjs +1 -0
  21. package/dist/index-3NV_rst1.js +9051 -0
  22. package/dist/index-qTKBamQ6.cjs +63 -0
  23. package/dist/jsx-runtime-JYMCiFoE.cjs +27 -0
  24. package/dist/{jsx-runtime-WbnYoNE9.js → jsx-runtime-Sp0orL4X.js} +106 -109
  25. package/dist/mockServiceWorker.js +18 -10
  26. package/dist/plugin-UiUFs2fK.js +44 -0
  27. package/dist/plugin-f6SDZ_Or.js +108 -0
  28. package/dist/plugin-jum1MjXp.cjs +1 -0
  29. package/dist/plugin-xOpS-UNV.cjs +1 -0
  30. package/dist/render.cjs +3 -1
  31. package/dist/render.d.ts +21 -40
  32. package/dist/render.js +129 -85
  33. package/dist/runtime.cjs +1 -0
  34. package/dist/runtime.d.ts +5 -0
  35. package/dist/runtime.js +21 -0
  36. package/dist/style.css +2 -2
  37. package/dist/tailwind.cjs +1 -1
  38. package/dist/tailwind.d.ts +49 -8
  39. package/dist/tailwind.js +16 -20
  40. package/dist/ui.cjs +1 -1
  41. package/dist/ui.d.ts +3 -13
  42. package/dist/ui.js +363 -163
  43. package/dist/web-blocks.cjs +3 -9
  44. package/dist/web-blocks.d.ts +1 -1
  45. package/dist/web-blocks.js +725 -766
  46. package/package.json +66 -83
  47. package/dist/AddBlocks-tMxKPoen.js +0 -225
  48. package/dist/AddBlocks-x2LkOHSj.cjs +0 -1
  49. package/dist/BrandingOptions-EzT9UYd6.cjs +0 -1
  50. package/dist/BrandingOptions-QJJ1y5ez.js +0 -194
  51. package/dist/CanvasArea-EfZgx-gN.js +0 -1425
  52. package/dist/CanvasArea-rIDwPHl5.cjs +0 -60
  53. package/dist/CurrentPage-QNFPD078.cjs +0 -1
  54. package/dist/CurrentPage-ulHTz4MD.js +0 -111
  55. package/dist/Functions-7jnEwJyw.js +0 -15
  56. package/dist/Functions-N3yhPYKY.cjs +0 -1
  57. package/dist/Layers-rehZkz78.js +0 -404
  58. package/dist/Layers-v-7k3W2I.cjs +0 -1
  59. package/dist/MODIFIERS-2FeVfZQ9.cjs +0 -1
  60. package/dist/MODIFIERS-RiXS5Mn1.js +0 -67
  61. package/dist/MarkAsGlobalBlock-BjP-Rqlf.js +0 -88
  62. package/dist/MarkAsGlobalBlock-X5dNmZcb.cjs +0 -1
  63. package/dist/PagesPanel-acGVGJf-.js +0 -69
  64. package/dist/PagesPanel-x5ms_LOD.cjs +0 -1
  65. package/dist/ProjectPanel-5BHQ5ANP.cjs +0 -1
  66. package/dist/ProjectPanel-aLFJq49M.js +0 -90
  67. package/dist/Settings-iOjfw5NQ.cjs +0 -1
  68. package/dist/Settings-v-txwlII.js +0 -2193
  69. package/dist/SidePanels-Vdc-J5wK.js +0 -349
  70. package/dist/SidePanels-t0g9ZQFT.cjs +0 -1
  71. package/dist/Topbar-V8xCetWF.cjs +0 -1
  72. package/dist/Topbar-j4t4AgCq.js +0 -116
  73. package/dist/UnsplashImages-41Y3q5_Q.js +0 -200
  74. package/dist/UnsplashImages-DbHky6cj.cjs +0 -1
  75. package/dist/UploadImages-DnQ95_NW.cjs +0 -1
  76. package/dist/UploadImages-xBg-kbKv.js +0 -138
  77. package/dist/_commonjsHelpers-UyOWmZb0.js +0 -8
  78. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +0 -1
  79. package/dist/add-page-modal-0YAI9dXr.cjs +0 -1
  80. package/dist/add-page-modal-6DlGzdA4.js +0 -108
  81. package/dist/confirm-alert-U7-NcG7G.cjs +0 -1
  82. package/dist/confirm-alert-i4pM3mOt.js +0 -62
  83. package/dist/controls-Dy1qa8Dc.cjs +0 -1
  84. package/dist/delete-page-modal-T_rlQfNd.js +0 -88
  85. package/dist/delete-page-modal-qXpi_2xR.cjs +0 -1
  86. package/dist/email-blocks.cjs +0 -1
  87. package/dist/email-blocks.d.ts +0 -3
  88. package/dist/email-blocks.js +0 -274
  89. package/dist/form-OVmsLOrc.js +0 -125
  90. package/dist/form-VbouZlAW.cjs +0 -1
  91. package/dist/functions-Ox_svtKm.cjs +0 -1
  92. package/dist/functions-xIebp8Aw.js +0 -23
  93. package/dist/html-to-json-2PeOCVey.cjs +0 -1
  94. package/dist/html-to-json-57841sEK.js +0 -183
  95. package/dist/index-EGUphg4R.js +0 -41620
  96. package/dist/index-H6vIwGfD.cjs +0 -1
  97. package/dist/index-e0c8PmRQ.js +0 -205
  98. package/dist/index-gi1LIOCw.cjs +0 -1
  99. package/dist/index-jw8RxsTv.cjs +0 -206
  100. package/dist/index-niHREMmR.js +0 -2938
  101. package/dist/jsx-runtime-Z_BpKhVy.cjs +0 -27
  102. package/dist/lib.cjs +0 -4
  103. package/dist/lib.d.ts +0 -78
  104. package/dist/lib.js +0 -1322
  105. package/dist/page-viewer-EoYYnA56.js +0 -115
  106. package/dist/page-viewer-Ou8vDXGV.cjs +0 -1
  107. package/dist/project-general-setting-92q4oEYv.cjs +0 -1
  108. package/dist/project-general-setting-DC_nADG-.js +0 -83
  109. package/dist/project-seo-setting-Snn2nZgS.cjs +0 -1
  110. package/dist/project-seo-setting-wxAGEkd_.js +0 -85
  111. package/dist/server.cjs +0 -1
  112. package/dist/server.d.ts +0 -299
  113. package/dist/server.js +0 -216
  114. package/dist/single-page-detail-QmmhR_h2.cjs +0 -1
  115. package/dist/single-page-detail-xtNZ9YxX.js +0 -222
  116. package/dist/studio.cjs +0 -1
  117. package/dist/studio.d.ts +0 -13
  118. package/dist/studio.js +0 -58
  119. package/dist/useAddBlockByDrop-_nwI4W3q.js +0 -20
  120. package/dist/useAddBlockByDrop-inkD7Lck.cjs +0 -1
  121. package/dist/utils-AvyFzbPC.js +0 -1075
  122. package/dist/utils-PTxFk6qT.cjs +0 -1
package/dist/core.d.ts CHANGED
@@ -1,5 +1,11 @@
1
+ import { ClassValue } from 'clsx';
2
+ import { Emitter } from 'react-event-hook';
3
+ import i18n from 'i18next';
1
4
  import { JSX as JSX_2 } from 'react/jsx-runtime';
2
- import { default as React_2 } from 'react';
5
+ import * as React_2 from 'react';
6
+ import { default as React_3 } from 'react';
7
+ import { ReactNode } from 'react';
8
+ import { registerChaiBlock } from '@chaibuilder/runtime';
3
9
  import { RESET } from 'jotai/utils';
4
10
  import { ThrottledFunction } from '@react-hookz/web';
5
11
  import { useTranslation } from 'react-i18next';
@@ -9,26 +15,50 @@ declare type AddBlocks = {
9
15
  addPredefinedBlock: any;
10
16
  };
11
17
 
12
- declare interface Block {
13
- type: string;
14
- [key: string]: any;
15
- }
18
+ export declare const AddBlocksDialog: () => JSX_2.Element;
19
+
20
+ export declare const AddBlocksPanel: ({ className, showHeading, parentId, }: {
21
+ parentId?: string;
22
+ showHeading?: boolean;
23
+ className?: string;
24
+ }) => JSX_2.Element;
25
+
26
+ export declare const AISetContext: () => JSX_2.Element;
27
+
28
+ export declare const AIUserPrompt: ({ blockId }: {
29
+ blockId: string | undefined;
30
+ }) => JSX_2.Element;
31
+
32
+ declare type AskAiResponse = {
33
+ blocks?: Array<{
34
+ _id: string;
35
+ } & Partial<ChaiBlock>>;
36
+ usage?: Record<any, number>;
37
+ error?: any;
38
+ };
39
+
40
+ export declare const BlockAttributesEditor: React_2.MemoExoticComponent<() => JSX_2.Element>;
41
+
42
+ /**
43
+ *
44
+ * @returns Block Setting
45
+ */
46
+ export declare function BlockPropsEditor(): JSX_2.Element;
47
+
48
+ export declare function BlockStyleEditor(): JSX_2.Element;
16
49
 
17
50
  declare type Breakpoint = {
18
51
  title: string;
19
52
  content: string;
20
- breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
21
- icon: React_2.ReactNode | Element;
53
+ breakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | string;
54
+ icon: React_3.ReactNode | Element;
22
55
  width: number;
23
56
  };
24
57
 
25
- declare type CanvasHistory = {
26
- redoCount: number;
27
- undoCount: number;
28
- clear: Function;
29
- createSnapshot: Function;
30
- redo: Function;
31
- undo: Function;
58
+ export declare const CHAI_BUILDER_EVENTS: {
59
+ OPEN_ADD_BLOCK: string;
60
+ CLOSE_ADD_BLOCK: string;
61
+ SHOW_BLOCK_SETTINGS: string;
32
62
  };
33
63
 
34
64
  export declare type ChaiBlock = {
@@ -39,20 +69,85 @@ export declare type ChaiBlock = {
39
69
  _bindings?: Record<string, string>;
40
70
  } & Record<string, any>;
41
71
 
72
+ export declare const ChaiBuilderCanvas: React_3.FC;
73
+
42
74
  /**
43
75
  * ChaiBuilder is the main entry point for the Chai Builder Studio.
44
- * @param props
45
- * @constructor
46
76
  */
47
- export declare const ChaiBuilderEditor: (props: ChaiBuilderEditorProps) => JSX_2.Element;
77
+ export declare const ChaiBuilderEditor: React_3.FC<ChaiBuilderEditorProps>;
48
78
 
49
79
  export declare interface ChaiBuilderEditorProps {
80
+ /**
81
+ * onError callback function
82
+ * @param error
83
+ */
84
+ onError?: (error: Error) => void;
85
+ /**
86
+ * Translations object
87
+ */
88
+ translations?: Record<string, Record<string, any>>;
89
+ /**
90
+ * onLoad callback function
91
+ * @param editorInstance
92
+ */
93
+ onLoad?: (editorInstance: ChaiBuilderInstance) => void;
94
+ /**
95
+ * Custom layout component
96
+ */
97
+ layout?: React_3.ComponentType;
98
+ /**
99
+ * Layout variant. Not supported with custom layout
100
+ */
101
+ layoutVariant?: LayoutVariant;
102
+ /**
103
+ * Custom media Manager component
104
+ */
105
+ mediaManagerComponent?: React_3.ComponentType<{
106
+ onSelect: (url: string) => void;
107
+ }>;
108
+ /**
109
+ * HTML direction.
110
+ */
111
+ htmlDir?: "ltr" | "rtl";
112
+ /**
113
+ * Filter function for blocks to be shown in the builder
114
+ */
115
+ filterChaiBlock?: (block: any) => boolean;
116
+ /**
117
+ * Show debug logs
118
+ */
119
+ showDebugLogs?: boolean;
120
+ /**
121
+ * Auto save support
122
+ */
123
+ autoSaveSupport?: boolean;
124
+ /**
125
+ * Auto save interval in seconds
126
+ */
127
+ autoSaveInterval?: TimeInSeconds;
128
+ /**
129
+ * Breakpoints
130
+ */
50
131
  breakpoints?: Breakpoint[];
132
+ /**
133
+ * Editable
134
+ */
51
135
  editable?: boolean;
136
+ /**
137
+ * Loading state
138
+ */
52
139
  loading?: boolean;
140
+ /**
141
+ * Locale
142
+ */
53
143
  locale?: string;
144
+ /**
145
+ * Non editable component
146
+ */
54
147
  nonEditableComponent?: ReactComponentType;
55
- canvas?: React_2.FC<any>;
148
+ /**
149
+ * Canvas component. Not supported with custom layout
150
+ */
56
151
  canvasTopBarComponents?: {
57
152
  right?: ReactComponentType[];
58
153
  };
@@ -60,54 +155,92 @@ export declare interface ChaiBuilderEditorProps {
60
155
  dataBindingSupport?: boolean;
61
156
  dataProviders?: DataProvider[];
62
157
  darkMode?: boolean;
63
- dndOptions?: any;
64
158
  importHTMLSupport?: boolean;
65
159
  fetchMediaCallback?: (limit?: number, offset?: number) => Promise<any[]>;
66
160
  uploadMediaCallback?: (file: File) => Promise<{
67
161
  url: string;
68
162
  }>;
69
- getExternalPredefinedBlock?: (block: PredefinedBlock) => Promise<PredefinedBlock & {
70
- blocks: ChaiBlock[];
71
- html: string;
72
- }>;
73
- getUILibraryBlocks?: (libraryUuid: string) => Promise<PredefinedBlock[]>;
74
- uiLibraries?: UILibrary[];
75
- subPages?: Block[];
76
- subPagesSupport?: boolean;
163
+ askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[], lang: string) => Promise<AskAiResponse>;
164
+ saveAiContextCallback?: (content: string) => Promise<true | Error>;
165
+ aiContext?: string;
166
+ uiLibraries?: Omit<UILibrary, "blocks">[];
167
+ getUILibraryBlocks?: (library: UILibrary) => Promise<UiLibraryBlock[]>;
168
+ getUILibraryBlock?: (library: UILibrary, uiLibBlock: UiLibraryBlock) => Promise<ChaiBlock[]>;
169
+ getRSCBlock?: (block: ChaiBlock) => Promise<string>;
170
+ /**
171
+ * Get Global blocks
172
+ */
173
+ getGlobalBlocks?: () => Promise<Record<string, {
174
+ name?: string;
175
+ description?: string;
176
+ }>>;
177
+ /**
178
+ * Get all blocks of a global block
179
+ */
180
+ getGlobalBlockBlocks?: (globalBlockKey: string) => Promise<ChaiBlock[]>;
181
+ /**
182
+ * Blocks for the page
183
+ */
77
184
  blocks?: ChaiBlock[];
78
- onSaveBlocks?: ({ blocks, providers }: any) => Promise<any>;
79
- onSavePage?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
185
+ onSave?: ({ blocks, providers }: SavePageData) => Promise<boolean | Error>;
80
186
  brandingOptions?: Record<string, string>;
81
- onSaveBrandingOptions?: (brandingOptions: Record<string, any>) => Promise<boolean | Error>;
82
- container?: ChaiBlock | "Body" | "Container";
83
- onSaveContainer?: (container: ChaiBlock) => Promise<boolean | Error>;
84
- onSyncStatusChange?: (syncStatus: "UNSAVED" | "SAVED") => void;
187
+ theme?: Record<string, string>;
188
+ /**
189
+ * onSaveStateChange callback function
190
+ * @param syncStatus
191
+ */
192
+ onSaveStateChange?: (syncStatus: "UNSAVED" | "SAVED" | "SAVING") => void;
193
+ /**
194
+ * Preview component
195
+ */
85
196
  previewComponent?: ReactComponentType;
197
+ /**
198
+ * Sidebar components. Not supported with custom layout
199
+ */
86
200
  sideBarComponents?: {
87
201
  bottom?: ReactComponentType[];
88
202
  top?: {
89
- icon: ReactComponentType | string;
90
- name: string;
91
- panel: ReactComponentType;
203
+ icon: ReactNode;
204
+ label: string;
205
+ component: ReactComponentType;
92
206
  }[];
93
207
  };
208
+ /**
209
+ * Topbar components. Not supported with custom layout
210
+ */
94
211
  topBarComponents?: {
95
212
  center?: ReactComponentType[];
96
213
  left?: ReactComponentType[];
97
214
  right?: ReactComponentType[];
98
215
  };
216
+ /**
217
+ * Outline menu items
218
+ */
219
+ outlineMenuItems?: OutlineMenuItems;
220
+ /**
221
+ * getPages callback function
222
+ */
99
223
  getPages?: () => Promise<ChaiPage[]>;
224
+ /**
225
+ * Unsplash access key
226
+ */
100
227
  unsplashAccessKey?: string;
228
+ _flags?: Record<string, boolean>;
229
+ /**
230
+ * Content locale
231
+ */
232
+ fallbackLang?: string;
233
+ languages?: Array<string>;
101
234
  }
102
235
 
236
+ declare type ChaiBuilderInstance = {
237
+ setBlocks: (blocks: ChaiBlock[]) => void;
238
+ };
239
+
103
240
  declare type ChaiPage = {
104
- uuid?: string;
105
- page_name?: string;
106
- blocks: ChaiBlock[];
107
- custom_code: string;
108
- seo_data: Record<string, string>;
109
241
  slug: string;
110
- translations: Record<string, Record<string, string>>;
242
+ uuid?: string;
243
+ name?: string;
111
244
  };
112
245
 
113
246
  declare type ClassDerivedObject = {
@@ -119,29 +252,104 @@ declare type ClassDerivedObject = {
119
252
  property: string;
120
253
  };
121
254
 
255
+ declare type CodeEditorProps = {
256
+ blockId: string;
257
+ blockProp: string;
258
+ initialCode: string;
259
+ placeholder?: string;
260
+ };
261
+
262
+ declare type CopiedValue = string | null;
263
+
264
+ declare type CopyFn = (text: string) => Promise<boolean>;
265
+
266
+ export declare function DarkModeSwitcher(): JSX_2.Element;
267
+
122
268
  declare type DataProvider = {
123
269
  providerKey: string;
124
270
  args: Record<string, any>;
125
271
  };
126
272
 
127
- declare type PredefinedBlock = {
128
- uuid: string;
273
+ export declare const DefaultChaiBlocks: ({ parentId, gridCols }: {
274
+ parentId?: string;
275
+ gridCols?: string;
276
+ }) => JSX_2.Element;
277
+
278
+ export declare const emitChaiBuilderMsg: Emitter<{
129
279
  name: string;
130
- preview: string;
131
- blocks?: ChaiBlock[];
132
- html?: string;
280
+ data?: any;
281
+ }>;
282
+
283
+ declare type ExcludedBuilderProps = "blocks" | "subPages" | "brandingOptions" | "dataProviders";
284
+
285
+ /**
286
+ * Get the unique uuid
287
+ */
288
+ export declare function generateBlockId(length?: number, chars?: string): string;
289
+
290
+ /**
291
+ *
292
+ * @param html
293
+ * @returns Blocks JSON
294
+ */
295
+ export declare const getBlocksFromHTML: (html: string) => ChaiBlock[];
296
+
297
+ /**
298
+ * Get the value and unit for a tw class
299
+ * @param className
300
+ */
301
+ export declare const getClassValueAndUnit: (className: string) => {
302
+ unit: string;
303
+ value: string;
133
304
  };
134
305
 
135
- declare type ReactComponentType = React_2.ComponentType<any>;
306
+ declare type GlobalBlockList = Record<string, {
307
+ name?: string;
308
+ description?: string;
309
+ }>;
310
+
311
+ export { i18n }
312
+
313
+ export declare const ImportHTML: ({ parentId }: {
314
+ parentId?: string;
315
+ }) => JSX_2.Element;
316
+
317
+ declare type LayoutVariant = "SINGLE_SIDE_PANEL" | "DUAL_SIDE_PANEL" | "DUAL_SIDE_PANEL_ADVANCED";
318
+
319
+ export declare const mergeClasses: (...inputs: ClassValue[]) => string;
320
+
321
+ export declare const Outline: () => JSX_2.Element;
322
+
323
+ declare type OutlineMenuItem = {
324
+ item: React_3.ComponentType<{
325
+ blockId: string;
326
+ }>;
327
+ tooltip: string | ReactNode;
328
+ };
329
+
330
+ declare type OutlineMenuItems = OutlineMenuItem[];
331
+
332
+ declare type ReactComponentType = React_3.ComponentType<any>;
333
+
334
+ export { registerChaiBlock }
335
+
336
+ declare type RichText = string;
136
337
 
137
338
  declare type SavePageData = {
138
339
  blocks: ChaiBlock[];
139
340
  providers?: DataProvider[];
341
+ brandingOptions?: Record<string, any>;
342
+ themeConfiguration?: Record<string, any>;
140
343
  };
141
344
 
142
- declare type TBlockTranslation = {
143
- [_path: string]: any;
144
- };
345
+ export declare const ScreenSizes: () => JSX_2.Element;
346
+
347
+ export declare const ThemeOptions: ({ showHeading, className, }: {
348
+ className?: string;
349
+ showHeading?: boolean;
350
+ }) => React_2.JSX.Element;
351
+
352
+ declare type TimeInSeconds = number;
145
353
 
146
354
  declare type TStyleBlock = {
147
355
  blockId: string;
@@ -149,48 +357,63 @@ declare type TStyleBlock = {
149
357
  prop: string;
150
358
  };
151
359
 
360
+ export declare const UILibraries: ({ parentId }: {
361
+ parentId?: string;
362
+ }) => JSX_2.Element;
363
+
152
364
  declare interface UILibrary {
153
- name: string;
154
365
  uuid: string;
366
+ name: string;
367
+ url: string;
368
+ blocks?: UiLibraryBlock[];
369
+ link?: string;
370
+ description?: RichText;
155
371
  }
156
372
 
157
- export declare const useActiveModal: () => any;
373
+ declare type UiLibraryBlock = {
374
+ uuid: string;
375
+ group: string;
376
+ name?: string;
377
+ path: string;
378
+ preview?: string;
379
+ tags?: string[];
380
+ description?: string;
381
+ };
158
382
 
159
- /**
160
- *
161
- */
162
- export declare const useActivePanel: () => [string, (args_0: string | ((prev: string) => string)) => void];
383
+ export declare const UndoRedo: () => JSX_2.Element;
163
384
 
164
385
  export declare const useAddBlock: () => AddBlocks;
165
386
 
166
- /**
167
- *
168
- */
169
- export declare const useAddBlockParent: () => [string, never];
170
-
171
387
  export declare const useAddClassesToBlocks: () => Function;
172
388
 
173
- /**
174
- * useTreeData hook
175
- */
176
- export declare const useAllBlocks: () => ChaiBlock[];
389
+ export declare const useBlockHighlight: () => {
390
+ highlightBlock: (blockId: string) => void;
391
+ clearHighlight: () => void;
392
+ };
393
+
394
+ export declare const useBlocksStore: () => [any[], (args_0: any[] | ((prev: any[]) => any[])) => void];
395
+
396
+ export declare const useBlocksStoreUndoableActions: () => {
397
+ moveBlocks: (blockIds: string[], parent: string | undefined, position: number) => void;
398
+ addBlocks: (newBlocks: ChaiBlock[], parent?: string, position?: number) => void;
399
+ removeBlocks: (blocks: ChaiBlock[]) => void;
400
+ updateBlocks: (blockIds: string[], props: Partial<ChaiBlock>, oldPropsState?: Partial<ChaiBlock>) => void;
401
+ updateBlocksRuntime: (blockIds: string[], props: Record<string, any>) => void;
402
+ setNewBlocks: (newBlocks: ChaiBlock[]) => void;
403
+ updateMultipleBlocksProps: (blocks: Array<{
404
+ _id: string;
405
+ } & Partial<ChaiBlock>>) => void;
406
+ };
177
407
 
178
408
  /**
179
409
  * Wrapper around useAtom
180
410
  */
181
411
  export declare const useBrandingOptions: () => readonly [any, (args_0: any) => void];
182
412
 
183
- export declare const useBuilderProp: (propKey: string, defaultValue?: any) => any;
413
+ export declare const useBuilderProp: <T>(propKey: keyof Omit<ChaiBuilderEditorProps, ExcludedBuilderProps> | "sideBarComponents.top" | "sideBarComponents.bottom" | "topBarComponents.left" | "topBarComponents.right" | "topBarComponents.center" | "languages", defaultValue?: T) => T;
184
414
 
185
415
  export declare const useBuilderReset: () => () => void;
186
416
 
187
- export declare const useBuildingBlocks: () => [Array<any>, Array<any>, () => never, () => never];
188
-
189
- /**
190
- *
191
- */
192
- export declare const useCanvasHistory: () => CanvasHistory;
193
-
194
417
  /**
195
418
  *
196
419
  */
@@ -201,8 +424,22 @@ export declare const useCanvasWidth: () => [number, string, Function];
201
424
  */
202
425
  export declare const useCanvasZoom: () => [number, (args_0: number | typeof RESET | ((prev: number) => number | typeof RESET)) => void];
203
426
 
427
+ export declare const useChaiBuilderMsgListener: (handler: (payload: {
428
+ name: string;
429
+ data?: any;
430
+ }) => void) => void;
431
+
432
+ /**
433
+ * Custom hook to access the current state of the code editor.
434
+ * @category Hooks
435
+ * @returns The current state of the code editor from the `codeEditorAtom`.
436
+ */
437
+ export declare const useCodeEditor: () => [CodeEditorProps, never];
438
+
204
439
  export declare const useCopyBlockIds: () => [Array<string>, Function];
205
440
 
441
+ export declare const useCopyToClipboard: () => [CopiedValue, CopyFn];
442
+
206
443
  export declare const useCurrentPage: () => {
207
444
  currentPage: unknown;
208
445
  };
@@ -214,37 +451,40 @@ export declare const useCutBlockIds: () => [Array<string>, Function];
214
451
  */
215
452
  export declare const useDarkMode: () => [boolean, Function];
216
453
 
217
- /**
218
- * Wrapper hook around useAtom
219
- */
220
- export declare const useDeveloperPreviewMode: () => [boolean, Function];
221
-
222
454
  /**
223
455
  * useDuplicateBlock
224
456
  */
225
457
  export declare const useDuplicateBlocks: () => Function;
226
458
 
227
- export declare const useFeatureSupport: (feature: string, defaultValue: boolean) => any;
459
+ export declare const useGlobalBlocksList: () => {
460
+ data: GlobalBlockList;
461
+ isLoading: boolean;
462
+ refetch: () => Promise<void>;
463
+ };
228
464
 
229
- export declare const useGetPageData: () => () => {
230
- currentPage: unknown;
231
- blocks: any;
232
- globalBlocks: any;
465
+ export declare const useGlobalBlocksStore: () => {
466
+ getGlobalBlocks: (block: ChaiBlock) => any;
467
+ reset: () => void;
233
468
  };
234
469
 
235
- export declare const useHiddenBlockIds: () => (string[] | ((args_0: string[] | ((prev: string[]) => string[])) => void) | ((blockId: string) => void))[];
470
+ export declare const useHiddenBlockIds: () => readonly [string[], (args_0: string[] | ((prev: string[]) => string[])) => void, (blockId: string) => void];
236
471
 
237
472
  /**
238
473
  *
239
474
  */
240
475
  export declare const useHighlightBlockId: () => [string, Function];
241
476
 
242
- export declare const useMarkAsGlobalBlock: () => (blockId: string, name: string) => Promise<void>;
477
+ export declare const useLanguages: () => {
478
+ languages: any[];
479
+ fallbackLang: string;
480
+ selectedLang: string;
481
+ setSelectedLang: (lang: string) => void;
482
+ };
243
483
 
244
- export declare const useMoveBlocks: () => {};
484
+ export declare const useLayoutVariant: () => readonly [LayoutVariant, (args_0: LayoutVariant | typeof RESET | ((prev: LayoutVariant) => LayoutVariant | typeof RESET)) => void];
245
485
 
246
486
  export declare const usePasteBlocks: () => {
247
- canPaste: boolean;
487
+ canPaste: (newParentId: string) => boolean;
248
488
  pasteBlocks: Function;
249
489
  };
250
490
 
@@ -253,32 +493,20 @@ export declare const usePasteBlocks: () => {
253
493
  */
254
494
  export declare const usePreviewMode: () => [boolean, Function];
255
495
 
256
- export declare const useProject: () => {
257
- currentProject: unknown;
258
- createProject: () => void;
259
- deleteProject: () => void;
260
- updateProject: () => void;
261
- };
262
-
263
- export declare const useReadOnlyMode: () => unknown;
264
-
265
496
  export declare const useRemoveBlocks: () => (blockIds: Array<string>) => void;
266
497
 
267
498
  export declare const useRemoveClassesFromBlocks: () => Function;
268
499
 
269
500
  export declare const useSavePage: () => {
270
501
  savePage: ThrottledFunction<() => Promise<boolean>>;
271
- syncState: "UNSAVED" | "SAVED" | "SAVING";
272
- setSyncState: (args_0: "UNSAVED" | "SAVED" | "SAVING" | ((prev: "UNSAVED" | "SAVED" | "SAVING") => "UNSAVED" | "SAVED" | "SAVING")) => void;
502
+ saveState: "UNSAVED" | "SAVED" | "SAVING";
503
+ setSaveState: (args_0: "UNSAVED" | "SAVED" | "SAVING" | ((prev: "UNSAVED" | "SAVED" | "SAVING") => "UNSAVED" | "SAVED" | "SAVING")) => void;
273
504
  };
274
505
 
275
506
  /**
276
507
  * useSelectedBlock hook
277
508
  */
278
- export declare const useSelectedBlock: () => string | {
279
- type: string;
280
- id: any;
281
- };
509
+ export declare const useSelectedBlock: () => ChaiBlock;
282
510
 
283
511
  export declare const useSelectedBlockAllClasses: () => Array<ClassDerivedObject>;
284
512
 
@@ -300,39 +528,36 @@ export declare const useSelectedBlocksDisplayChild: () => {
300
528
  export declare const useSelectedBreakpoints: () => [string[], Function];
301
529
 
302
530
  /**
303
- *
531
+ * @group Hooks
532
+ * @returns {TStyleBlock[]} selected styling blocks
304
533
  */
305
534
  export declare const useSelectedStylingBlocks: () => [TStyleBlock[], (args_0: TStyleBlock[] | ((prev: TStyleBlock[]) => TStyleBlock[])) => void];
306
535
 
307
- export declare const useSetAllBlocks: () => [Function];
308
-
309
536
  export declare const useStylingBreakpoint: () => [string, (args_0: string | typeof RESET | ((prev: string) => string | typeof RESET)) => void];
310
537
 
311
538
  export declare const useStylingState: () => [unknown, (...args: unknown[]) => unknown];
312
539
 
313
540
  export { useTranslation }
314
541
 
315
- export declare const useTranslations: () => ({
316
- [key: string]: TBlockTranslation;
317
- } | ((lang: string, path: string, value: any) => void))[];
318
-
319
- /**
320
- * useTreeData hook
321
- */
322
- export declare const useTreeData: () => [Array<any>, Function];
323
-
324
542
  export declare const useUILibraryBlocks: () => {
325
543
  data: any[];
326
544
  isLoading: boolean;
327
545
  };
328
546
 
547
+ export declare const useUndoManager: () => {
548
+ add: any;
549
+ undo: any;
550
+ redo: any;
551
+ hasRedo: any;
552
+ hasUndo: any;
553
+ clear: any;
554
+ };
555
+
329
556
  /**
330
557
  *
331
558
  */
332
- export declare const useUpdateBlocksProps: () => (blockIds: Array<string>, props: Record<string, any>) => void;
559
+ export declare const useUpdateBlocksProps: () => (blockIds: Array<string>, props: Record<string, any>, prevPropsState?: Record<string, any>) => void;
333
560
 
334
- export declare const useUpdateBlocksPropsRealtime: () => (blockIds: Array<string>, props: {
335
- string: any;
336
- }) => void;
561
+ export declare const useUpdateBlocksPropsRealtime: () => (blockIds: Array<string>, props: Record<string, any>) => void;
337
562
 
338
563
  export { }