@measured/puck 0.19.0-canary.e62832e → 0.19.0-canary.f96dc87b
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/README.md +1 -0
- package/dist/index.js +4 -2
- package/dist/index.mjs +5 -3
- package/package.json +3 -3
package/README.md
CHANGED
@@ -95,6 +95,7 @@ Available recipes include:
|
|
95
95
|
|
96
96
|
- [**next**](https://github.com/measuredco/puck/tree/main/recipes/next): Next.js example, using App Router and static page generation
|
97
97
|
- [**remix**](https://github.com/measuredco/puck/tree/main/recipes/remix): Remix Run v2 example, using dynamic routes at root-level
|
98
|
+
- [**react-router**](https://github.com/measuredco/puck/tree/main/recipes/react-router): React Router v7 app example, using dynamic routes to create pages at any level
|
98
99
|
|
99
100
|
## Community
|
100
101
|
|
package/dist/index.js
CHANGED
@@ -2968,6 +2968,7 @@ var ArrayField = ({
|
|
2968
2968
|
(s) => s.permissions.getPermissions({ item: s.selectedItem }).edit
|
2969
2969
|
);
|
2970
2970
|
const forceReadOnly = !canEdit;
|
2971
|
+
const valueRef = (0, import_react15.useRef)(value);
|
2971
2972
|
if (field.type !== "array" || !field.arrayFields) {
|
2972
2973
|
return null;
|
2973
2974
|
}
|
@@ -2985,7 +2986,7 @@ var ArrayField = ({
|
|
2985
2986
|
onDragStart: (id2) => setDraggedItem(id2),
|
2986
2987
|
onDragEnd: () => {
|
2987
2988
|
setDraggedItem("");
|
2988
|
-
onChange(
|
2989
|
+
onChange(valueRef.current);
|
2989
2990
|
},
|
2990
2991
|
onMove: (move) => {
|
2991
2992
|
if (arrayState.items[move.source]._arrayId !== draggedItem) {
|
@@ -3008,6 +3009,7 @@ var ArrayField = ({
|
|
3008
3009
|
value: newValue,
|
3009
3010
|
arrayState: __spreadProps(__spreadValues({}, arrayState), { items: newArrayStateItems })
|
3010
3011
|
});
|
3012
|
+
valueRef.current = newValue;
|
3011
3013
|
},
|
3012
3014
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
3013
3015
|
"div",
|
@@ -7983,7 +7985,7 @@ function PuckProvider({ children }) {
|
|
7983
7985
|
const { state, resolveData: resolveData2 } = appStore.getState();
|
7984
7986
|
resolveData2(state);
|
7985
7987
|
}, []);
|
7986
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UsePuckStoreContext, { value: uPuckStore, children }) });
|
7988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
|
7987
7989
|
}
|
7988
7990
|
function PuckLayout({ children }) {
|
7989
7991
|
const {
|
package/dist/index.mjs
CHANGED
@@ -676,7 +676,7 @@ var IconButton = ({
|
|
676
676
|
};
|
677
677
|
|
678
678
|
// components/AutoField/fields/ArrayField/index.tsx
|
679
|
-
import { useCallback as useCallback2, useEffect as useEffect6, useState as useState3 } from "react";
|
679
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useRef, useState as useState3 } from "react";
|
680
680
|
|
681
681
|
// components/DragIcon/index.tsx
|
682
682
|
init_react_import();
|
@@ -2776,6 +2776,7 @@ var ArrayField = ({
|
|
2776
2776
|
(s) => s.permissions.getPermissions({ item: s.selectedItem }).edit
|
2777
2777
|
);
|
2778
2778
|
const forceReadOnly = !canEdit;
|
2779
|
+
const valueRef = useRef(value);
|
2779
2780
|
if (field.type !== "array" || !field.arrayFields) {
|
2780
2781
|
return null;
|
2781
2782
|
}
|
@@ -2793,7 +2794,7 @@ var ArrayField = ({
|
|
2793
2794
|
onDragStart: (id2) => setDraggedItem(id2),
|
2794
2795
|
onDragEnd: () => {
|
2795
2796
|
setDraggedItem("");
|
2796
|
-
onChange(
|
2797
|
+
onChange(valueRef.current);
|
2797
2798
|
},
|
2798
2799
|
onMove: (move) => {
|
2799
2800
|
if (arrayState.items[move.source]._arrayId !== draggedItem) {
|
@@ -2816,6 +2817,7 @@ var ArrayField = ({
|
|
2816
2817
|
value: newValue,
|
2817
2818
|
arrayState: __spreadProps(__spreadValues({}, arrayState), { items: newArrayStateItems })
|
2818
2819
|
});
|
2820
|
+
valueRef.current = newValue;
|
2819
2821
|
},
|
2820
2822
|
children: /* @__PURE__ */ jsxs3(
|
2821
2823
|
"div",
|
@@ -7841,7 +7843,7 @@ function PuckProvider({ children }) {
|
|
7841
7843
|
const { state, resolveData: resolveData2 } = appStore.getState();
|
7842
7844
|
resolveData2(state);
|
7843
7845
|
}, []);
|
7844
|
-
return /* @__PURE__ */ jsx38(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx38(UsePuckStoreContext, { value: uPuckStore, children }) });
|
7846
|
+
return /* @__PURE__ */ jsx38(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx38(UsePuckStoreContext.Provider, { value: uPuckStore, children }) });
|
7845
7847
|
}
|
7846
7848
|
function PuckLayout({ children }) {
|
7847
7849
|
const {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck",
|
3
|
-
"version": "0.19.0-canary.
|
3
|
+
"version": "0.19.0-canary.f96dc87b",
|
4
4
|
"author": "Measured Corporation Ltd <hello@measured.co>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
@@ -77,9 +77,9 @@
|
|
77
77
|
"react-hotkeys-hook": "^4.6.1",
|
78
78
|
"use-debounce": "^9.0.4",
|
79
79
|
"uuid": "^9.0.1",
|
80
|
-
"zustand": "^
|
80
|
+
"zustand": "^5.0.3"
|
81
81
|
},
|
82
82
|
"peerDependencies": {
|
83
|
-
"react": "^
|
83
|
+
"react": "^18.0.0 || ^19.0.0"
|
84
84
|
}
|
85
85
|
}
|