@chaibuilder/sdk 2.2.3 → 2.2.5

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 (36) hide show
  1. package/dist/CodeEditor-B7r9YjDC.cjs +1 -0
  2. package/dist/CodeEditor-HKrlrH8b.js +71 -0
  3. package/dist/core.cjs +5 -5
  4. package/dist/core.d.ts +38 -39
  5. package/dist/core.js +4355 -4390
  6. package/dist/get-chai-builder-theme-ByeXCyGx.js +12 -0
  7. package/dist/get-chai-builder-theme-CeaKvOZ8.cjs +1 -0
  8. package/dist/mockServiceWorker.js +1 -1
  9. package/dist/plugin-C01tjI6V.cjs +22 -0
  10. package/dist/{chai-theme-helpers-CfZwxV6S.js → plugin-fnBB3TCm.js} +111 -99
  11. package/dist/render-chai-blocks-6SVNwoLW.js +201 -0
  12. package/dist/render-chai-blocks-Bvl2_fRE.cjs +1 -0
  13. package/dist/render.cjs +2 -2
  14. package/dist/render.d.ts +2 -2
  15. package/dist/render.js +38 -188
  16. package/dist/sooner-AJ7QkeLS.cjs +1 -0
  17. package/dist/sooner-DGhT8-JI.js +831 -0
  18. package/dist/tailwind.cjs +1 -1
  19. package/dist/tailwind.js +3 -2
  20. package/dist/ui.cjs +1 -1
  21. package/dist/ui.d.ts +37 -29
  22. package/dist/ui.js +232 -196
  23. package/dist/web-blocks.cjs +2 -2
  24. package/dist/web-blocks.js +1210 -1069
  25. package/package.json +3 -2
  26. package/dist/CodeEditor-CPR3N3wa.cjs +0 -1
  27. package/dist/CodeEditor-CuhsobXe.js +0 -65
  28. package/dist/chai-theme-helpers-utzv3TbX.cjs +0 -22
  29. package/dist/getSplitClasses-DodqA_KW.cjs +0 -1
  30. package/dist/getSplitClasses-DphwgQiE.js +0 -48
  31. package/dist/plugin-DW1HhfzA.js +0 -24
  32. package/dist/plugin-kqWzHDpF.cjs +0 -1
  33. package/dist/tooltip-BF2E5xPf.cjs +0 -1
  34. package/dist/tooltip-DGVZAvLU.js +0 -755
  35. /package/dist/{Functions-BGzDsf1z.js → common-functions-BGzDsf1z.js} +0 -0
  36. /package/dist/{Functions-BZmyleS1.cjs → common-functions-BZmyleS1.cjs} +0 -0
package/dist/core.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { ChaiBlock as ChaiBlock_2 } from '@chaibuilder/runtime';
2
1
  import { ClassValue } from 'clsx';
3
2
  import { ComponentType } from 'react';
4
3
  import { default as default_2 } from 'react';
@@ -105,7 +104,7 @@ export declare interface ChaiBuilderEditorProps {
105
104
  /**
106
105
  * Theme presets
107
106
  */
108
- themePresets?: Record<string, Partial<ChaiBuilderThemeValues>>[];
107
+ themePresets?: Record<string, Partial<ChaiThemeValues>>[];
109
108
  /**
110
109
  * Theme options
111
110
  */
@@ -113,11 +112,11 @@ export declare interface ChaiBuilderEditorProps {
113
112
  /**
114
113
  * Theme
115
114
  */
116
- theme?: Partial<ChaiBuilderThemeValues>;
115
+ theme?: Partial<ChaiThemeValues>;
117
116
  /**
118
117
  * Builder theme
119
118
  */
120
- builderTheme?: ChaiBuilderThemeValues;
119
+ builderTheme?: ChaiThemeValues;
121
120
  /**
122
121
  * Theme panel component
123
122
  * TODO: Move to registerChaiThemePanelComponent()
@@ -253,36 +252,6 @@ declare type ChaiBuilderThemeOptions = {
253
252
  }[];
254
253
  };
255
254
 
256
- declare type ChaiBuilderThemeValues = {
257
- fontFamily: {
258
- heading: string;
259
- body: string;
260
- };
261
- borderRadius: string;
262
- colors: {
263
- background: [HexColor, HexColor];
264
- foreground: [HexColor, HexColor];
265
- primary: [HexColor, HexColor];
266
- "primary-foreground": [HexColor, HexColor];
267
- secondary: [HexColor, HexColor];
268
- "secondary-foreground": [HexColor, HexColor];
269
- muted: [HexColor, HexColor];
270
- "muted-foreground": [HSLColor, HSLColor];
271
- accent: [HSLColor, HSLColor];
272
- "accent-foreground": [HSLColor, HSLColor];
273
- destructive: [HSLColor, HSLColor];
274
- "destructive-foreground": [HSLColor, HSLColor];
275
- border: [HSLColor, HSLColor];
276
- input: [HSLColor, HSLColor];
277
- ring: [HexColor, HexColor];
278
- card: [HexColor, HexColor];
279
- "card-foreground": [HexColor, HexColor];
280
- popover: [HexColor, HexColor];
281
- "popover-foreground": [HexColor, HexColor];
282
- [key: string]: [HexColor, HexColor];
283
- };
284
- };
285
-
286
255
  export declare function ChaiDarkModeSwitcher(): JSX_2.Element;
287
256
 
288
257
  export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, }: {
@@ -322,6 +291,36 @@ export declare interface ChaiSidebarPanel {
322
291
 
323
292
  export declare const ChaiThemeConfigPanel: React_2.FC<ThemeConfigProps>;
324
293
 
294
+ export declare type ChaiThemeValues = {
295
+ fontFamily: {
296
+ heading: string;
297
+ body: string;
298
+ };
299
+ borderRadius: string;
300
+ colors: {
301
+ background: [HexColor, HexColor];
302
+ foreground: [HexColor, HexColor];
303
+ primary: [HexColor, HexColor];
304
+ "primary-foreground": [HexColor, HexColor];
305
+ secondary: [HexColor, HexColor];
306
+ "secondary-foreground": [HexColor, HexColor];
307
+ muted: [HexColor, HexColor];
308
+ "muted-foreground": [HSLColor, HSLColor];
309
+ accent: [HSLColor, HSLColor];
310
+ "accent-foreground": [HSLColor, HSLColor];
311
+ destructive: [HSLColor, HSLColor];
312
+ "destructive-foreground": [HSLColor, HSLColor];
313
+ border: [HSLColor, HSLColor];
314
+ input: [HSLColor, HSLColor];
315
+ ring: [HexColor, HexColor];
316
+ card: [HexColor, HexColor];
317
+ "card-foreground": [HexColor, HexColor];
318
+ popover: [HexColor, HexColor];
319
+ "popover-foreground": [HexColor, HexColor];
320
+ [key: string]: [HexColor, HexColor];
321
+ };
322
+ };
323
+
325
324
  export declare const ChaiUILibrariesPanel: ({ parentId, position }: {
326
325
  parentId?: string;
327
326
  position?: number;
@@ -448,12 +447,12 @@ export declare const registerChaiTopBar: (component: React.ComponentType) => voi
448
447
  declare type SavePageData = {
449
448
  autoSave: boolean;
450
449
  blocks: ChaiBlock[];
451
- theme?: ChaiBuilderThemeValues;
450
+ theme?: ChaiThemeValues;
452
451
  };
453
452
 
454
453
  declare type SaveToLibraryProps = {
455
454
  blockId: string;
456
- blocks?: ChaiBlock[];
455
+ blocks: ChaiBlock[];
457
456
  close: () => void;
458
457
  };
459
458
 
@@ -596,7 +595,7 @@ export declare const useRemoveBlocks: () => (blockIds: Array<string>) => void;
596
595
 
597
596
  export declare const useRemoveClassesFromBlocks: () => Function;
598
597
 
599
- export declare const useRightPanel: () => ["theme" | "block" | "ai" | "settings", (args_0: "theme" | "block" | "ai" | "settings" | ((prev: "theme" | "block" | "ai" | "settings") => "theme" | "block" | "ai" | "settings")) => void];
598
+ export declare const useRightPanel: () => ["block" | "theme" | "ai" | "settings", (args_0: "block" | "theme" | "ai" | "settings" | ((prev: "block" | "theme" | "ai" | "settings") => "block" | "theme" | "ai" | "settings")) => void];
600
599
 
601
600
  export declare const useSavePage: () => {
602
601
  savePage: ThrottledFunction<(autoSave?: boolean) => Promise<boolean>>;
@@ -707,7 +706,7 @@ export declare const useTheme: () => readonly [{
707
706
  "popover-foreground": [string, string];
708
707
  [key: string]: [string, string];
709
708
  };
710
- }, (args_0: ChaiBuilderThemeValues | Partial<ChaiBuilderThemeValues> | ((prev: ChaiBuilderThemeValues | Partial<ChaiBuilderThemeValues>) => ChaiBuilderThemeValues | Partial<ChaiBuilderThemeValues>)) => void];
709
+ }, (args_0: ChaiThemeValues | Partial<ChaiThemeValues> | ((prev: ChaiThemeValues | Partial<ChaiThemeValues>) => ChaiThemeValues | Partial<ChaiThemeValues>)) => void];
711
710
 
712
711
  export declare const useThemeOptions: () => ChaiBuilderThemeOptions;
713
712
 
@@ -734,7 +733,7 @@ export declare const useUpdateBlocksProps: () => (blockIds: Array<string>, props
734
733
 
735
734
  export declare const useUpdateBlocksPropsRealtime: () => (blockIds: Array<string>, props: Record<string, any>) => void;
736
735
 
737
- export declare const useWrapperBlock: () => ChaiBlock_2;
736
+ export declare const useWrapperBlock: () => ChaiBlock;
738
737
 
739
738
  declare type VariableKey = string;
740
739