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

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.cjs CHANGED
@@ -1249,16 +1249,22 @@ const useRemoveBlocks = () => {
1249
1249
  );
1250
1250
  };
1251
1251
  const useUpdateBlockAtom = () => {
1252
+ const [blocks] = useBlocksStore();
1253
+ console.log("Default Blocks: ", blocks);
1252
1254
  return useAtomCallback(
1253
- React.useCallback((get, set, { id, props }) => {
1254
- const blockAsAtoms = get(pageBlocksAtom);
1255
- const blockAtom = lodashEs.find(blockAsAtoms, (b) => b._id === id);
1256
- if (!blockAtom) {
1257
- console.warn(`Block with id ${id} not found`);
1258
- return;
1259
- }
1260
- return set(blockAtom._atom, { ...get(blockAtom._atom), ...props });
1261
- }, [])
1255
+ React.useCallback(
1256
+ (get, set, { id, props }) => {
1257
+ const blockAsAtoms = get(pageBlocksAtom);
1258
+ console.log("From Atom callback", blocks);
1259
+ const blockAtom = lodashEs.find(blockAsAtoms, (b) => b._id === id);
1260
+ if (!blockAtom) {
1261
+ console.warn(`Block with id ${id} not found`);
1262
+ return;
1263
+ }
1264
+ return set(blockAtom._atom, { ...get(blockAtom._atom), ...props });
1265
+ },
1266
+ [pageBlocksAtom]
1267
+ )
1262
1268
  );
1263
1269
  };
1264
1270
  const useGetBlockAtomValue = () => {
package/dist/core.js CHANGED
@@ -1234,16 +1234,22 @@ const useRemoveBlocks = () => {
1234
1234
  );
1235
1235
  };
1236
1236
  const useUpdateBlockAtom = () => {
1237
+ const [blocks] = useBlocksStore();
1238
+ console.log("Default Blocks: ", blocks);
1237
1239
  return useAtomCallback(
1238
- useCallback((get2, set2, { id, props }) => {
1239
- const blockAsAtoms = get2(pageBlocksAtom);
1240
- const blockAtom = find(blockAsAtoms, (b) => b._id === id);
1241
- if (!blockAtom) {
1242
- console.warn(`Block with id ${id} not found`);
1243
- return;
1244
- }
1245
- return set2(blockAtom._atom, { ...get2(blockAtom._atom), ...props });
1246
- }, [])
1240
+ useCallback(
1241
+ (get2, set2, { id, props }) => {
1242
+ const blockAsAtoms = get2(pageBlocksAtom);
1243
+ console.log("From Atom callback", blocks);
1244
+ const blockAtom = find(blockAsAtoms, (b) => b._id === id);
1245
+ if (!blockAtom) {
1246
+ console.warn(`Block with id ${id} not found`);
1247
+ return;
1248
+ }
1249
+ return set2(blockAtom._atom, { ...get2(blockAtom._atom), ...props });
1250
+ },
1251
+ [pageBlocksAtom]
1252
+ )
1247
1253
  );
1248
1254
  };
1249
1255
  const useGetBlockAtomValue = () => {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Suraj Air",
6
6
  "license": "BSD-3-Clause",
7
7
  "homepage": "https://chaibuilder.com",
8
- "version": "2.0.0-beta.84",
8
+ "version": "2.0.0-beta.90",
9
9
  "type": "module",
10
10
  "repository": {
11
11
  "type": "git",