@measured/puck 0.21.0-canary.a5160e5d → 0.21.0-canary.b818cb1f

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.
@@ -4180,12 +4180,14 @@ var DraggableComponent = ({
4180
4180
  }
4181
4181
  return cleanup;
4182
4182
  }, [permissions.drag, zoneCompound]);
4183
+ const [, setRerender] = useState10(0);
4183
4184
  const ref = useRef2(null);
4184
4185
  const refSetter = useCallback7(
4185
4186
  (el) => {
4186
4187
  sortableRef(el);
4187
- if (el) {
4188
+ if (ref.current !== el) {
4188
4189
  ref.current = el;
4190
+ setRerender((update) => update + 1);
4189
4191
  }
4190
4192
  },
4191
4193
  [sortableRef]
@@ -8705,7 +8707,7 @@ function PuckProvider({ children }) {
8705
8707
  });
8706
8708
  const previousData = useRef12(null);
8707
8709
  useEffect29(() => {
8708
- appStore.subscribe(
8710
+ return appStore.subscribe(
8709
8711
  (s) => s.state.data,
8710
8712
  (data) => {
8711
8713
  if (onChange) {
@@ -8715,7 +8717,7 @@ function PuckProvider({ children }) {
8715
8717
  }
8716
8718
  }
8717
8719
  );
8718
- }, []);
8720
+ }, [onChange]);
8719
8721
  useRegisterPermissionsSlice(appStore, permissions);
8720
8722
  const uPuckStore = useRegisterUsePuckStore(appStore);
8721
8723
  useEffect29(() => {
package/dist/index.js CHANGED
@@ -4806,12 +4806,14 @@ var DraggableComponent = ({
4806
4806
  }
4807
4807
  return cleanup;
4808
4808
  }, [permissions.drag, zoneCompound]);
4809
+ const [, setRerender] = (0, import_react24.useState)(0);
4809
4810
  const ref = (0, import_react24.useRef)(null);
4810
4811
  const refSetter = (0, import_react24.useCallback)(
4811
4812
  (el) => {
4812
4813
  sortableRef(el);
4813
- if (el) {
4814
+ if (ref.current !== el) {
4814
4815
  ref.current = el;
4816
+ setRerender((update) => update + 1);
4815
4817
  }
4816
4818
  },
4817
4819
  [sortableRef]
@@ -9405,7 +9407,7 @@ function PuckProvider({ children }) {
9405
9407
  });
9406
9408
  const previousData = (0, import_react60.useRef)(null);
9407
9409
  (0, import_react60.useEffect)(() => {
9408
- appStore.subscribe(
9410
+ return appStore.subscribe(
9409
9411
  (s) => s.state.data,
9410
9412
  (data) => {
9411
9413
  if (onChange) {
@@ -9415,7 +9417,7 @@ function PuckProvider({ children }) {
9415
9417
  }
9416
9418
  }
9417
9419
  );
9418
- }, []);
9420
+ }, [onChange]);
9419
9421
  useRegisterPermissionsSlice(appStore, permissions);
9420
9422
  const uPuckStore = useRegisterUsePuckStore(appStore);
9421
9423
  (0, import_react60.useEffect)(() => {
package/dist/index.mjs CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  setDeep,
19
19
  useGetPuck,
20
20
  usePuck
21
- } from "./chunk-LAV6OYHN.mjs";
21
+ } from "./chunk-CBXRJMRZ.mjs";
22
22
  import {
23
23
  init_react_import,
24
24
  migrate,
@@ -4806,12 +4806,14 @@ var DraggableComponent = ({
4806
4806
  }
4807
4807
  return cleanup;
4808
4808
  }, [permissions.drag, zoneCompound]);
4809
+ const [, setRerender] = (0, import_react24.useState)(0);
4809
4810
  const ref = (0, import_react24.useRef)(null);
4810
4811
  const refSetter = (0, import_react24.useCallback)(
4811
4812
  (el) => {
4812
4813
  sortableRef(el);
4813
- if (el) {
4814
+ if (ref.current !== el) {
4814
4815
  ref.current = el;
4816
+ setRerender((update) => update + 1);
4815
4817
  }
4816
4818
  },
4817
4819
  [sortableRef]
@@ -9405,7 +9407,7 @@ function PuckProvider({ children }) {
9405
9407
  });
9406
9408
  const previousData = (0, import_react60.useRef)(null);
9407
9409
  (0, import_react60.useEffect)(() => {
9408
- appStore.subscribe(
9410
+ return appStore.subscribe(
9409
9411
  (s) => s.state.data,
9410
9412
  (data) => {
9411
9413
  if (onChange) {
@@ -9415,7 +9417,7 @@ function PuckProvider({ children }) {
9415
9417
  }
9416
9418
  }
9417
9419
  );
9418
- }, []);
9420
+ }, [onChange]);
9419
9421
  useRegisterPermissionsSlice(appStore, permissions);
9420
9422
  const uPuckStore = useRegisterUsePuckStore(appStore);
9421
9423
  (0, import_react60.useEffect)(() => {
@@ -18,7 +18,7 @@ import {
18
18
  setDeep,
19
19
  useGetPuck,
20
20
  usePuck
21
- } from "./chunk-LAV6OYHN.mjs";
21
+ } from "./chunk-CBXRJMRZ.mjs";
22
22
  import {
23
23
  init_react_import,
24
24
  migrate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.21.0-canary.a5160e5d",
3
+ "version": "0.21.0-canary.b818cb1f",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Chris Villa <chris@puckeditor.com>",
6
6
  "repository": "measuredco/puck",