@chaibuilder/sdk 2.0.2 → 2.0.4

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
@@ -81,6 +81,10 @@ export declare const ChaiBuilderCanvas: default_2.FC;
81
81
  export declare const ChaiBuilderEditor: default_2.FC<ChaiBuilderEditorProps>;
82
82
 
83
83
  export declare interface ChaiBuilderEditorProps {
84
+ /**
85
+ * Permissions
86
+ */
87
+ permissions?: string[];
84
88
  /**
85
89
  * RJSF Fields and Widgets
86
90
  */
@@ -209,7 +213,7 @@ export declare interface ChaiBuilderEditorProps {
209
213
  * onSaveStateChange callback function
210
214
  * @param syncStatus
211
215
  */
212
- onSaveStateChange?: (syncStatus: "UNSAVED" | "SAVED" | "SAVING") => void;
216
+ onSaveStateChange?: (syncStatus: "SAVED" | "SAVING" | "UNSAVED") => void;
213
217
  /**
214
218
  * Preview component
215
219
  */
@@ -365,6 +369,17 @@ declare type PartialBlockList = Record<string, {
365
369
  type?: string;
366
370
  }>;
367
371
 
372
+ export declare const PERMISSIONS: {
373
+ ADD_BLOCK: string;
374
+ DELETE_BLOCK: string;
375
+ EDIT_BLOCK: string;
376
+ MOVE_BLOCK: string;
377
+ EDIT_THEME: string;
378
+ SAVE_PAGE: string;
379
+ EDIT_STYLES: string;
380
+ IMPORT_HTML: string;
381
+ };
382
+
368
383
  declare type ReactComponentType = default_2.ComponentType<any>;
369
384
 
370
385
  export { registerChaiBlock }
@@ -529,6 +544,10 @@ export declare const usePasteBlocks: () => {
529
544
  pasteBlocks: (newParentId: string | string[]) => Promise<void>;
530
545
  };
531
546
 
547
+ export declare const usePermissions: () => {
548
+ hasPermission: (permission: string) => any;
549
+ };
550
+
532
551
  /**
533
552
  *
534
553
  */
@@ -542,8 +561,8 @@ export declare const useRightPanel: () => ["theme" | "block" | "ai" | "settings"
542
561
 
543
562
  export declare const useSavePage: () => {
544
563
  savePage: ThrottledFunction<(autoSave?: boolean) => Promise<boolean>>;
545
- saveState: "UNSAVED" | "SAVED" | "SAVING";
546
- setSaveState: (args_0: "UNSAVED" | "SAVED" | "SAVING" | ((prev: "UNSAVED" | "SAVED" | "SAVING") => "UNSAVED" | "SAVED" | "SAVING")) => void;
564
+ saveState: "SAVED" | "SAVING" | "UNSAVED";
565
+ setSaveState: (args_0: "SAVED" | "SAVING" | "UNSAVED" | ((prev: "SAVED" | "SAVING" | "UNSAVED") => "SAVED" | "SAVING" | "UNSAVED")) => void;
547
566
  };
548
567
 
549
568
  /**