@measured/puck 0.10.1-canary.5dabebb → 0.10.1-canary.68afd09
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -3219,7 +3219,7 @@ var ArrayField = ({
|
|
3219
3219
|
const [arrayFieldId] = (0, import_react25.useState)(generateId("ArrayField"));
|
3220
3220
|
const { state, setUi } = useAppContext();
|
3221
3221
|
const arrayState = state.ui.arrayState[arrayFieldId] || {
|
3222
|
-
items: Array.from(value).map((v) => ({
|
3222
|
+
items: Array.from(value || []).map((v) => ({
|
3223
3223
|
_arrayId: generateId("ArrayItem"),
|
3224
3224
|
data: v
|
3225
3225
|
})),
|
@@ -3239,7 +3239,7 @@ var ArrayField = ({
|
|
3239
3239
|
[arrayState]
|
3240
3240
|
);
|
3241
3241
|
(0, import_react25.useEffect)(() => {
|
3242
|
-
const newItems = Array.from(value).map((item, idx) => {
|
3242
|
+
const newItems = Array.from(value || []).map((item, idx) => {
|
3243
3243
|
var _a;
|
3244
3244
|
return {
|
3245
3245
|
_arrayId: ((_a = arrayState.items[idx]) == null ? void 0 : _a._arrayId) || generateId("ArrayItem"),
|
@@ -3278,7 +3278,7 @@ var ArrayField = ({
|
|
3278
3278
|
ref: provided.innerRef,
|
3279
3279
|
className: getClassName6({
|
3280
3280
|
isDraggingFrom: !!snapshot.draggingFromThisWith,
|
3281
|
-
hasItems: value.length > 0
|
3281
|
+
hasItems: Array.isArray(value) && value.length > 0
|
3282
3282
|
}),
|
3283
3283
|
children: [
|
3284
3284
|
Array.isArray(value) && value.length > 0 ? arrayState.items.map(({ _arrayId, data }, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|