@chaibuilder/sdk 2.2.4 → 2.2.6

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/dist/core.d.ts CHANGED
@@ -52,6 +52,14 @@ export declare const ChaiAskAiUserPrompt: ({ blockId }: {
52
52
  blockId: string | undefined;
53
53
  }) => JSX_2.Element;
54
54
 
55
+ declare type ChaiAsset = {
56
+ url: string;
57
+ thumbnailUrl?: string;
58
+ description?: string;
59
+ width?: number;
60
+ height?: number;
61
+ };
62
+
55
63
  export declare type ChaiBlock<T = Record<string, any>> = {
56
64
  _id: string;
57
65
  _name?: string;
@@ -104,7 +112,7 @@ export declare interface ChaiBuilderEditorProps {
104
112
  /**
105
113
  * Theme presets
106
114
  */
107
- themePresets?: Record<string, Partial<ChaiBuilderThemeValues>>[];
115
+ themePresets?: Record<string, Partial<ChaiThemeValues>>[];
108
116
  /**
109
117
  * Theme options
110
118
  */
@@ -112,11 +120,11 @@ export declare interface ChaiBuilderEditorProps {
112
120
  /**
113
121
  * Theme
114
122
  */
115
- theme?: Partial<ChaiBuilderThemeValues>;
123
+ theme?: Partial<ChaiThemeValues>;
116
124
  /**
117
125
  * Builder theme
118
126
  */
119
- builderTheme?: ChaiBuilderThemeValues;
127
+ builderTheme?: ChaiThemeValues;
120
128
  /**
121
129
  * Theme panel component
122
130
  * TODO: Move to registerChaiThemePanelComponent()
@@ -252,36 +260,6 @@ declare type ChaiBuilderThemeOptions = {
252
260
  }[];
253
261
  };
254
262
 
255
- declare type ChaiBuilderThemeValues = {
256
- fontFamily: {
257
- heading: string;
258
- body: string;
259
- };
260
- borderRadius: string;
261
- colors: {
262
- background: [HexColor, HexColor];
263
- foreground: [HexColor, HexColor];
264
- primary: [HexColor, HexColor];
265
- "primary-foreground": [HexColor, HexColor];
266
- secondary: [HexColor, HexColor];
267
- "secondary-foreground": [HexColor, HexColor];
268
- muted: [HexColor, HexColor];
269
- "muted-foreground": [HSLColor, HSLColor];
270
- accent: [HSLColor, HSLColor];
271
- "accent-foreground": [HSLColor, HSLColor];
272
- destructive: [HSLColor, HSLColor];
273
- "destructive-foreground": [HSLColor, HSLColor];
274
- border: [HSLColor, HSLColor];
275
- input: [HSLColor, HSLColor];
276
- ring: [HexColor, HexColor];
277
- card: [HexColor, HexColor];
278
- "card-foreground": [HexColor, HexColor];
279
- popover: [HexColor, HexColor];
280
- "popover-foreground": [HexColor, HexColor];
281
- [key: string]: [HexColor, HexColor];
282
- };
283
- };
284
-
285
263
  export declare function ChaiDarkModeSwitcher(): JSX_2.Element;
286
264
 
287
265
  export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, }: {
@@ -321,6 +299,36 @@ export declare interface ChaiSidebarPanel {
321
299
 
322
300
  export declare const ChaiThemeConfigPanel: React_2.FC<ThemeConfigProps>;
323
301
 
302
+ export declare type ChaiThemeValues = {
303
+ fontFamily: {
304
+ heading: string;
305
+ body: string;
306
+ };
307
+ borderRadius: string;
308
+ colors: {
309
+ background: [HexColor, HexColor];
310
+ foreground: [HexColor, HexColor];
311
+ primary: [HexColor, HexColor];
312
+ "primary-foreground": [HexColor, HexColor];
313
+ secondary: [HexColor, HexColor];
314
+ "secondary-foreground": [HexColor, HexColor];
315
+ muted: [HexColor, HexColor];
316
+ "muted-foreground": [HSLColor, HSLColor];
317
+ accent: [HSLColor, HSLColor];
318
+ "accent-foreground": [HSLColor, HSLColor];
319
+ destructive: [HSLColor, HSLColor];
320
+ "destructive-foreground": [HSLColor, HSLColor];
321
+ border: [HSLColor, HSLColor];
322
+ input: [HSLColor, HSLColor];
323
+ ring: [HexColor, HexColor];
324
+ card: [HexColor, HexColor];
325
+ "card-foreground": [HexColor, HexColor];
326
+ popover: [HexColor, HexColor];
327
+ "popover-foreground": [HexColor, HexColor];
328
+ [key: string]: [HexColor, HexColor];
329
+ };
330
+ };
331
+
324
332
  export declare const ChaiUILibrariesPanel: ({ parentId, position }: {
325
333
  parentId?: string;
326
334
  position?: number;
@@ -388,7 +396,7 @@ export { i18n }
388
396
 
389
397
  declare type MediaManagerProps = {
390
398
  close: () => void;
391
- onSelect: (urls: string[]) => void;
399
+ onSelect: (assets: ChaiAsset | ChaiAsset[]) => void;
392
400
  mode?: "image" | "video" | "audio";
393
401
  };
394
402
 
@@ -447,7 +455,7 @@ export declare const registerChaiTopBar: (component: React.ComponentType) => voi
447
455
  declare type SavePageData = {
448
456
  autoSave: boolean;
449
457
  blocks: ChaiBlock[];
450
- theme?: ChaiBuilderThemeValues;
458
+ theme?: ChaiThemeValues;
451
459
  };
452
460
 
453
461
  declare type SaveToLibraryProps = {
@@ -706,7 +714,7 @@ export declare const useTheme: () => readonly [{
706
714
  "popover-foreground": [string, string];
707
715
  [key: string]: [string, string];
708
716
  };
709
- }, (args_0: ChaiBuilderThemeValues | Partial<ChaiBuilderThemeValues> | ((prev: ChaiBuilderThemeValues | Partial<ChaiBuilderThemeValues>) => ChaiBuilderThemeValues | Partial<ChaiBuilderThemeValues>)) => void];
717
+ }, (args_0: ChaiThemeValues | Partial<ChaiThemeValues> | ((prev: ChaiThemeValues | Partial<ChaiThemeValues>) => ChaiThemeValues | Partial<ChaiThemeValues>)) => void];
710
718
 
711
719
  export declare const useThemeOptions: () => ChaiBuilderThemeOptions;
712
720