@chaibuilder/sdk 2.0.1 → 2.0.3

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
@@ -1,6 +1,7 @@
1
1
  import { ChaiBlock as ChaiBlock_2 } from '@chaibuilder/runtime';
2
2
  import { ClassValue } from 'clsx';
3
3
  import { default as default_2 } from 'react';
4
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
4
5
  import { default as i18n } from 'i18next';
5
6
  import { JSX as JSX_2 } from 'react/jsx-runtime';
6
7
  import * as React_2 from 'react';
@@ -80,6 +81,10 @@ export declare const ChaiBuilderCanvas: default_2.FC;
80
81
  export declare const ChaiBuilderEditor: default_2.FC<ChaiBuilderEditorProps>;
81
82
 
82
83
  export declare interface ChaiBuilderEditorProps {
84
+ /**
85
+ * Permissions
86
+ */
87
+ permissions?: string[];
83
88
  /**
84
89
  * RJSF Fields and Widgets
85
90
  */
@@ -177,6 +182,9 @@ export declare interface ChaiBuilderEditorProps {
177
182
  canvasTopBarComponents?: {
178
183
  right?: ReactComponentType[];
179
184
  };
185
+ blockMoreOptions?: Array<(props: {
186
+ block: ChaiBlock;
187
+ }) => default_2.ReactElement<typeof DropdownMenuItem>>;
180
188
  previewLink?: string;
181
189
  darkMode?: boolean;
182
190
  importHTMLSupport?: boolean;
@@ -205,7 +213,7 @@ export declare interface ChaiBuilderEditorProps {
205
213
  * onSaveStateChange callback function
206
214
  * @param syncStatus
207
215
  */
208
- onSaveStateChange?: (syncStatus: "UNSAVED" | "SAVED" | "SAVING") => void;
216
+ onSaveStateChange?: (syncStatus: "SAVED" | "SAVING" | "UNSAVED") => void;
209
217
  /**
210
218
  * Preview component
211
219
  */
@@ -293,6 +301,10 @@ export declare const DefaultChaiBlocks: ({ parentId, position, gridCols, }: {
293
301
  gridCols?: string;
294
302
  }) => JSX_2.Element;
295
303
 
304
+ declare const DropdownMenuItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
305
+ inset?: boolean;
306
+ } & React_2.RefAttributes<HTMLDivElement>>;
307
+
296
308
  declare type ExcludedBuilderProps = "blocks" | "subPages" | "brandingOptions" | "dataProviders";
297
309
 
298
310
  /**
@@ -357,6 +369,17 @@ declare type PartialBlockList = Record<string, {
357
369
  type?: string;
358
370
  }>;
359
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
+
360
383
  declare type ReactComponentType = default_2.ComponentType<any>;
361
384
 
362
385
  export { registerChaiBlock }
@@ -521,6 +544,10 @@ export declare const usePasteBlocks: () => {
521
544
  pasteBlocks: (newParentId: string | string[]) => Promise<void>;
522
545
  };
523
546
 
547
+ export declare const usePermissions: () => {
548
+ hasPermission: (permission: string) => any;
549
+ };
550
+
524
551
  /**
525
552
  *
526
553
  */
@@ -534,8 +561,8 @@ export declare const useRightPanel: () => ["theme" | "block" | "ai" | "settings"
534
561
 
535
562
  export declare const useSavePage: () => {
536
563
  savePage: ThrottledFunction<(autoSave?: boolean) => Promise<boolean>>;
537
- saveState: "UNSAVED" | "SAVED" | "SAVING";
538
- 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;
539
566
  };
540
567
 
541
568
  /**