@chaibuilder/sdk 2.0.0-beta.82 → 2.0.0-beta.84

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,3 +1,4 @@
1
+ import { Atom } from 'jotai';
1
2
  import { ChaiBlock as ChaiBlock_2 } from '@chaibuilder/runtime';
2
3
  import { ClassValue } from 'clsx';
3
4
  import { default as default_2 } from 'react';
@@ -72,6 +73,13 @@ export declare type ChaiBlock<T = Record<string, any>> = {
72
73
  _type: string;
73
74
  } & T;
74
75
 
76
+ declare type ChaiBuilderBlockWithAtom = {
77
+ _type: string;
78
+ _id: string;
79
+ _parent: string | null;
80
+ _atom: Atom<ChaiBlock>;
81
+ };
82
+
75
83
  export declare const ChaiBuilderCanvas: default_2.FC;
76
84
 
77
85
  /**
@@ -428,15 +436,15 @@ export declare const useBlockHighlight: () => {
428
436
  lastHighlighted: HTMLElement;
429
437
  };
430
438
 
431
- export declare const useBlocksStore: () => [any[], (args_0: any[] | ((prev: any[]) => any[])) => void];
439
+ export declare const useBlocksStore: () => [ChaiBuilderBlockWithAtom[], (args_0: ChaiBuilderBlockWithAtom[] | ((prev: ChaiBuilderBlockWithAtom[]) => ChaiBuilderBlockWithAtom[])) => void];
432
440
 
433
441
  export declare const useBlocksStoreUndoableActions: () => {
434
442
  moveBlocks: (blockIds: string[], parent: string | undefined, position: number) => void;
435
- addBlocks: (newBlocks: ChaiBlock[], parent?: string, position?: number) => void;
436
- removeBlocks: (blocks: ChaiBlock[]) => void;
443
+ addBlocks: (newBlocks: ChaiBuilderBlockWithAtom[], parent?: string, position?: number) => void;
444
+ removeBlocks: (blocks: ChaiBuilderBlockWithAtom[]) => void;
437
445
  updateBlocks: (blockIds: string[], props: Partial<ChaiBlock>, oldPropsState?: Partial<ChaiBlock>) => void;
438
446
  updateBlocksRuntime: (blockIds: string[], props: Record<string, any>) => void;
439
- setNewBlocks: (newBlocks: ChaiBlock[]) => void;
447
+ setNewBlocks: (newBlocks: ChaiBuilderBlockWithAtom[]) => void;
440
448
  updateMultipleBlocksProps: (blocks: Array<{
441
449
  _id: string;
442
450
  } & Partial<ChaiBlock>>) => void;
@@ -495,7 +503,7 @@ export declare const useGlobalBlocksList: () => {
495
503
  };
496
504
 
497
505
  export declare const useGlobalBlocksStore: () => {
498
- getGlobalBlocks: (block: ChaiBlock) => any;
506
+ getGlobalBlocks: (globalBlockId: string) => any;
499
507
  reset: () => void;
500
508
  };
501
509