@chaibuilder/sdk 2.0.5 → 2.0.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
@@ -191,10 +191,9 @@ export declare interface ChaiBuilderEditorProps {
191
191
  askAiCallBack?: (type: "styles" | "content", prompt: string, blocks: ChaiBlock[], lang: string) => Promise<AskAiResponse>;
192
192
  saveAiContextCallback?: (content: string) => Promise<true | Error>;
193
193
  aiContext?: string;
194
- uiLibraries?: Omit<UILibrary, "blocks">[];
195
- getUILibraryBlocks?: (library: UILibrary) => Promise<UiLibraryBlock[]>;
196
- getUILibraryBlock?: (library: UILibrary, uiLibBlock: UiLibraryBlock) => Promise<ChaiBlock[]>;
197
- getBlockAsyncProps?: (block: ChaiBlock) => Promise<string>;
194
+ uiLibraries?: Omit<ChaiUILibrary, "blocks">[];
195
+ getUILibraryBlocks?: (library: ChaiUILibrary) => Promise<ChaiUILibraryBlock[]>;
196
+ getUILibraryBlock?: (library: ChaiUILibrary, uiLibBlock: ChaiUILibraryBlock) => Promise<ChaiBlock[]>;
198
197
  getPartialBlocks?: () => Promise<Record<string, {
199
198
  type: string;
200
199
  name: string;
@@ -273,6 +272,22 @@ declare type ChaiBuilderThemeValues = {
273
272
  colors: Record<string, string[]>;
274
273
  };
275
274
 
275
+ declare type ChaiUILibrary<T = Record<string, any>> = {
276
+ id: string;
277
+ name: string;
278
+ blocks?: ChaiUILibraryBlock[];
279
+ description?: string;
280
+ } & T;
281
+
282
+ declare type ChaiUILibraryBlock<T = Record<string, any>> = {
283
+ id: string;
284
+ group: string;
285
+ name: string;
286
+ preview?: string;
287
+ tags?: string[];
288
+ description?: string;
289
+ } & T;
290
+
276
291
  declare type ClassDerivedObject = {
277
292
  cls: string;
278
293
  dark: boolean;
@@ -384,8 +399,6 @@ declare type ReactComponentType = default_2.ComponentType<any>;
384
399
 
385
400
  export { registerChaiBlock }
386
401
 
387
- declare type RichText = string;
388
-
389
402
  declare type SavePageData = {
390
403
  autoSave: boolean;
391
404
  blocks: ChaiBlock[];
@@ -398,12 +411,12 @@ export declare const ScreenSizes: ({ openDelay, canvas, tooltip, }: {
398
411
  tooltip?: boolean;
399
412
  }) => JSX_2.Element;
400
413
 
414
+ export declare const ThemeConfigPanel: React_2.FC<ThemeConfigProps>;
415
+
401
416
  declare interface ThemeConfigProps {
402
417
  className?: string;
403
418
  }
404
419
 
405
- export declare const ThemeOptions: React_2.FC<ThemeConfigProps>;
406
-
407
420
  declare type TimeInSeconds = number;
408
421
 
409
422
  declare type TStyleBlock = {
@@ -412,30 +425,11 @@ declare type TStyleBlock = {
412
425
  prop: string;
413
426
  };
414
427
 
415
- export declare const UILibraries: ({ parentId, position }: {
428
+ export declare const UILibrariesPanel: ({ parentId, position }: {
416
429
  parentId?: string;
417
430
  position?: number;
418
431
  }) => JSX_2.Element;
419
432
 
420
- declare interface UILibrary {
421
- uuid: string;
422
- name: string;
423
- url: string;
424
- blocks?: UiLibraryBlock[];
425
- link?: string;
426
- description?: RichText;
427
- }
428
-
429
- declare type UiLibraryBlock = {
430
- uuid: string;
431
- group: string;
432
- name?: string;
433
- path: string;
434
- preview?: string;
435
- tags?: string[];
436
- description?: string;
437
- };
438
-
439
433
  export declare const UndoRedo: () => JSX_2.Element;
440
434
 
441
435
  export declare const useAddBlock: () => AddBlocks;
@@ -527,6 +521,14 @@ export declare const useLanguages: () => {
527
521
 
528
522
  export declare const useLayoutVariant: () => readonly [LayoutVariant, (args_0: RESET | LayoutVariant | ((prev: LayoutVariant) => RESET | LayoutVariant)) => void];
529
523
 
524
+ export declare const useLibraryBlocks: (library?: Partial<ChaiUILibrary> & {
525
+ id: string;
526
+ }) => {
527
+ data: any;
528
+ isLoading: boolean;
529
+ resetLibrary: () => void;
530
+ };
531
+
530
532
  export declare const usePartailBlocksStore: () => {
531
533
  getPartailBlocks: (partailBlock: string) => any;
532
534
  reset: () => void;