@chaibuilder/sdk 2.0.0-beta.99 → 2.0.0

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
@@ -92,7 +92,7 @@ export declare interface ChaiBuilderEditorProps {
92
92
  pageId?: string;
93
93
  pageExternalData?: Record<string, any>;
94
94
  themePresets?: Record<string, Partial<ChaiBuilderThemeValues>>[];
95
- themeOptions?: ChaiBuilderThemeOptions | ((defaultThemeOptions: ChaiBuilderThemeOptions) => ChaiBuilderThemeOptions);
95
+ themeOptions?: (defaultThemeOptions: ChaiBuilderThemeOptions) => ChaiBuilderThemeOptions;
96
96
  theme?: Partial<ChaiBuilderThemeValues>;
97
97
  themePanelComponent?: ReactComponentType;
98
98
  /**
@@ -187,17 +187,15 @@ export declare interface ChaiBuilderEditorProps {
187
187
  getUILibraryBlocks?: (library: UILibrary) => Promise<UiLibraryBlock[]>;
188
188
  getUILibraryBlock?: (library: UILibrary, uiLibBlock: UiLibraryBlock) => Promise<ChaiBlock[]>;
189
189
  getBlockAsyncProps?: (block: ChaiBlock) => Promise<string>;
190
- /**
191
- * Get Global blocks
192
- */
193
- getGlobalBlocks?: () => Promise<Record<string, {
194
- name?: string;
190
+ getPartialBlocks?: () => Promise<Record<string, {
191
+ type: string;
192
+ name: string;
195
193
  description?: string;
196
194
  }>>;
197
195
  /**
198
- * Get all blocks of a global block
196
+ * Get all blocks of a partial block
199
197
  */
200
- getGlobalBlockBlocks?: (globalBlockKey: string) => Promise<ChaiBlock[]>;
198
+ getPartialBlockBlocks?: (partialBlockKey: string) => Promise<ChaiBlock[]>;
201
199
  /**
202
200
  * Blocks for the page
203
201
  */
@@ -318,11 +316,6 @@ export declare const getClassValueAndUnit: (className: string) => {
318
316
  value: string;
319
317
  };
320
318
 
321
- declare type GlobalBlockList = Record<string, {
322
- name?: string;
323
- description?: string;
324
- }>;
325
-
326
319
  declare type HSLColor = string;
327
320
 
328
321
  export { i18n }
@@ -358,6 +351,12 @@ declare type PageTypeItem = {
358
351
  slug?: string;
359
352
  };
360
353
 
354
+ declare type PartialBlockList = Record<string, {
355
+ name?: string;
356
+ description?: string;
357
+ type?: string;
358
+ }>;
359
+
361
360
  declare type ReactComponentType = default_2.ComponentType<any>;
362
361
 
363
362
  export { registerChaiBlock }
@@ -367,10 +366,14 @@ declare type RichText = string;
367
366
  declare type SavePageData = {
368
367
  autoSave: boolean;
369
368
  blocks: ChaiBlock[];
370
- theme?: Record<string, any>;
369
+ theme?: ChaiBuilderThemeValues;
371
370
  };
372
371
 
373
- export declare const ScreenSizes: () => JSX_2.Element;
372
+ export declare const ScreenSizes: ({ openDelay, canvas, tooltip, }: {
373
+ openDelay?: number;
374
+ canvas?: boolean;
375
+ tooltip?: boolean;
376
+ }) => JSX_2.Element;
374
377
 
375
378
  declare interface ThemeConfigProps {
376
379
  className?: string;
@@ -451,10 +454,7 @@ export declare const useBuilderProp: <T>(propKey: keyof Omit<ChaiBuilderEditorPr
451
454
 
452
455
  export declare const useBuilderReset: () => () => void;
453
456
 
454
- /**
455
- *
456
- */
457
- export declare const useCanvasWidth: () => [number, string, Function];
457
+ export declare const useCanvasDisplayWidth: () => readonly [number, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
458
458
 
459
459
  /**
460
460
  * Wrapper hook around useAtom
@@ -488,17 +488,6 @@ export declare const useDarkMode: () => [boolean, Function];
488
488
  */
489
489
  export declare const useDuplicateBlocks: () => Function;
490
490
 
491
- export declare const useGlobalBlocksList: () => {
492
- data: GlobalBlockList;
493
- isLoading: boolean;
494
- refetch: () => Promise<void>;
495
- };
496
-
497
- export declare const useGlobalBlocksStore: () => {
498
- getGlobalBlocks: (globalBlock: string) => any;
499
- reset: () => void;
500
- };
501
-
502
491
  export declare const useHiddenBlockIds: () => readonly [string[], (args_0: string[] | ((prev: string[]) => string[])) => void, (blockId: string) => void];
503
492
 
504
493
  /**
@@ -515,6 +504,18 @@ export declare const useLanguages: () => {
515
504
 
516
505
  export declare const useLayoutVariant: () => readonly [LayoutVariant, (args_0: RESET | LayoutVariant | ((prev: LayoutVariant) => RESET | LayoutVariant)) => void];
517
506
 
507
+ export declare const usePartailBlocksStore: () => {
508
+ getPartailBlocks: (partailBlock: string) => any;
509
+ reset: () => void;
510
+ };
511
+
512
+ export declare const usePartialBlocksList: () => {
513
+ data: PartialBlockList;
514
+ isLoading: boolean;
515
+ refetch: () => Promise<void>;
516
+ error: string;
517
+ };
518
+
518
519
  export declare const usePasteBlocks: () => {
519
520
  canPaste: (newParentId: string) => Promise<boolean>;
520
521
  pasteBlocks: (newParentId: string | string[]) => Promise<void>;
@@ -537,6 +538,11 @@ export declare const useSavePage: () => {
537
538
  setSaveState: (args_0: "UNSAVED" | "SAVED" | "SAVING" | ((prev: "UNSAVED" | "SAVED" | "SAVING") => "UNSAVED" | "SAVED" | "SAVING")) => void;
538
539
  };
539
540
 
541
+ /**
542
+ *
543
+ */
544
+ export declare const useScreenSizeWidth: () => readonly [number, string, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
545
+
540
546
  /**
541
547
  * useSelectedBlock hook
542
548
  */