@measured/puck 0.21.0-canary.16a3eee1 → 0.21.0-canary.1cec93c4
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/{chunk-X7YZ3YE7.mjs → chunk-JA7SEUEH.mjs} +12 -10
- package/dist/{chunk-JZ2BPCUI.mjs → chunk-VL643U2B.mjs} +75 -274
- package/dist/index.css +4 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +96 -297
- package/dist/index.mjs +2 -2
- package/dist/no-external.css +4 -3
- package/dist/no-external.d.mts +1 -1
- package/dist/no-external.d.ts +1 -1
- package/dist/no-external.js +93 -294
- package/dist/no-external.mjs +2 -2
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +11 -10
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-Ctf3FZQI.d.mts → walk-tree-BqwnaCVe.d.mts} +58 -44
- package/dist/{walk-tree-Ctf3FZQI.d.ts → walk-tree-BqwnaCVe.d.ts} +58 -44
- package/package.json +1 -1
|
@@ -19,12 +19,13 @@ import {
|
|
|
19
19
|
rootDroppableId,
|
|
20
20
|
rootZone,
|
|
21
21
|
setupZone,
|
|
22
|
+
toComponent,
|
|
22
23
|
useFieldTransforms,
|
|
23
24
|
useSlots,
|
|
24
25
|
walkAppState,
|
|
25
26
|
walkField,
|
|
26
27
|
walkTree
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JA7SEUEH.mjs";
|
|
28
29
|
|
|
29
30
|
// ../../node_modules/classnames/index.js
|
|
30
31
|
var require_classnames = __commonJS({
|
|
@@ -856,6 +857,10 @@ var monitorHotkeys = (doc) => {
|
|
|
856
857
|
useHotkeyStore.getState().reset();
|
|
857
858
|
}
|
|
858
859
|
};
|
|
860
|
+
const onBlur = () => {
|
|
861
|
+
useHotkeyStore.getState().reset();
|
|
862
|
+
};
|
|
863
|
+
window.addEventListener("blur", onBlur);
|
|
859
864
|
doc.addEventListener("keydown", onKeyDown);
|
|
860
865
|
doc.addEventListener("keyup", onKeyUp);
|
|
861
866
|
doc.addEventListener("visibilitychange", onVisibilityChanged);
|
|
@@ -863,6 +868,7 @@ var monitorHotkeys = (doc) => {
|
|
|
863
868
|
doc.removeEventListener("keydown", onKeyDown);
|
|
864
869
|
doc.removeEventListener("keyup", onKeyUp);
|
|
865
870
|
doc.removeEventListener("visibilitychange", onVisibilityChanged);
|
|
871
|
+
window.removeEventListener("blur", onBlur);
|
|
866
872
|
};
|
|
867
873
|
};
|
|
868
874
|
var useMonitorHotkeys = () => {
|
|
@@ -1065,10 +1071,10 @@ var flattenData = (state, config) => {
|
|
|
1065
1071
|
|
|
1066
1072
|
// store/slices/permissions.ts
|
|
1067
1073
|
var createPermissionsSlice = (set, get) => {
|
|
1068
|
-
const resolvePermissions = (..._0) => __async(
|
|
1074
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
1069
1075
|
const { state, permissions, config } = get();
|
|
1070
1076
|
const { cache, globalPermissions } = permissions;
|
|
1071
|
-
const resolveDataForItem = (item2, force2 = false) => __async(
|
|
1077
|
+
const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
1072
1078
|
var _a, _b, _c;
|
|
1073
1079
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
1074
1080
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
@@ -1123,13 +1129,13 @@ var createPermissionsSlice = (set, get) => {
|
|
|
1123
1129
|
if (item) {
|
|
1124
1130
|
yield resolveDataForItem(item, force);
|
|
1125
1131
|
} else if (type) {
|
|
1126
|
-
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(
|
|
1132
|
+
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
|
|
1127
1133
|
yield resolveDataForItem(item2, force);
|
|
1128
1134
|
}));
|
|
1129
1135
|
} else if (root) {
|
|
1130
1136
|
resolveDataForRoot(force);
|
|
1131
1137
|
} else {
|
|
1132
|
-
flattenData(state, config).map((item2) => __async(
|
|
1138
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
1133
1139
|
yield resolveDataForItem(item2, force);
|
|
1134
1140
|
}));
|
|
1135
1141
|
}
|
|
@@ -1210,7 +1216,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
1210
1216
|
};
|
|
1211
1217
|
var useRegisterFieldsSlice = (appStore, id) => {
|
|
1212
1218
|
const resolveFields = useCallback(
|
|
1213
|
-
(reset) => __async(
|
|
1219
|
+
(reset) => __async(null, null, function* () {
|
|
1214
1220
|
var _a, _b;
|
|
1215
1221
|
const { fields, lastResolvedData } = appStore.getState().fields;
|
|
1216
1222
|
const metadata = appStore.getState().metadata;
|
|
@@ -1410,7 +1416,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1410
1416
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
1411
1417
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
1412
1418
|
}),
|
|
1413
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
1419
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
1414
1420
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
1415
1421
|
const timeouts = {};
|
|
1416
1422
|
return yield resolveComponentData(
|
|
@@ -1421,7 +1427,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1421
1427
|
const id = "id" in item.props ? item.props.id : "root";
|
|
1422
1428
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
1423
1429
|
},
|
|
1424
|
-
(item) => __async(
|
|
1430
|
+
(item) => __async(null, null, function* () {
|
|
1425
1431
|
const id = "id" in item.props ? item.props.id : "root";
|
|
1426
1432
|
if ("type" in item) {
|
|
1427
1433
|
yield permissions.refreshPermissions({ item });
|
|
@@ -1433,7 +1439,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1433
1439
|
trigger
|
|
1434
1440
|
);
|
|
1435
1441
|
}),
|
|
1436
|
-
resolveAndCommitData: () => __async(
|
|
1442
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
1437
1443
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
1438
1444
|
walkAppState(
|
|
1439
1445
|
state,
|
|
@@ -2454,7 +2460,7 @@ var collisionStore = createStore(() => ({
|
|
|
2454
2460
|
|
|
2455
2461
|
// lib/dnd/collision/dynamic/index.ts
|
|
2456
2462
|
var flushNext = "";
|
|
2457
|
-
var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input) => {
|
|
2463
|
+
var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((input) => {
|
|
2458
2464
|
var _a, _b, _c, _d, _e;
|
|
2459
2465
|
const { dragOperation, droppable } = input;
|
|
2460
2466
|
const { position } = dragOperation;
|
|
@@ -2547,7 +2553,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
|
|
|
2547
2553
|
}
|
|
2548
2554
|
collisionDebug(dragCenter, dropCenter, droppable.id.toString(), "hotpink");
|
|
2549
2555
|
return null;
|
|
2550
|
-
};
|
|
2556
|
+
});
|
|
2551
2557
|
|
|
2552
2558
|
// components/Sortable/index.tsx
|
|
2553
2559
|
import { useSortable } from "@dnd-kit/react/sortable";
|
|
@@ -2980,8 +2986,9 @@ var ArrayField = ({
|
|
|
2980
2986
|
var _a;
|
|
2981
2987
|
if (isDraggingAny) return;
|
|
2982
2988
|
const existingValue = value || [];
|
|
2989
|
+
const defaultProps = typeof field.defaultItemProps === "function" ? field.defaultItemProps(existingValue.length) : (_a = field.defaultItemProps) != null ? _a : {};
|
|
2983
2990
|
const newItem = defaultSlots(
|
|
2984
|
-
uniqifyItem(
|
|
2991
|
+
uniqifyItem(defaultProps),
|
|
2985
2992
|
field.arrayFields
|
|
2986
2993
|
);
|
|
2987
2994
|
const newValue = [...existingValue, newItem];
|
|
@@ -3156,11 +3163,13 @@ var ExternalInput = ({
|
|
|
3156
3163
|
id,
|
|
3157
3164
|
readOnly
|
|
3158
3165
|
}) => {
|
|
3166
|
+
var _a;
|
|
3159
3167
|
const {
|
|
3160
3168
|
mapProp = (val) => val,
|
|
3161
3169
|
mapRow = (val) => val,
|
|
3162
3170
|
filterFields
|
|
3163
3171
|
} = field || {};
|
|
3172
|
+
const { enabled: shouldCacheData } = (_a = field.cache) != null ? _a : { enabled: true };
|
|
3164
3173
|
const [data, setData] = useState6([]);
|
|
3165
3174
|
const [isOpen, setOpen] = useState6(false);
|
|
3166
3175
|
const [isLoading, setIsLoading] = useState6(true);
|
|
@@ -3183,14 +3192,21 @@ var ExternalInput = ({
|
|
|
3183
3192
|
}, [mappedData]);
|
|
3184
3193
|
const [searchQuery, setSearchQuery] = useState6(field.initialQuery || "");
|
|
3185
3194
|
const search = useCallback3(
|
|
3186
|
-
(query, filters2) => __async(
|
|
3195
|
+
(query, filters2) => __async(null, null, function* () {
|
|
3187
3196
|
setIsLoading(true);
|
|
3188
3197
|
const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
|
|
3189
|
-
|
|
3198
|
+
let listData;
|
|
3199
|
+
if (shouldCacheData && dataCache[cacheKey]) {
|
|
3200
|
+
listData = dataCache[cacheKey];
|
|
3201
|
+
} else {
|
|
3202
|
+
listData = yield field.fetchList({ query, filters: filters2 });
|
|
3203
|
+
}
|
|
3190
3204
|
if (listData) {
|
|
3191
3205
|
setData(listData);
|
|
3192
3206
|
setIsLoading(false);
|
|
3193
|
-
|
|
3207
|
+
if (shouldCacheData) {
|
|
3208
|
+
dataCache[cacheKey] = listData;
|
|
3209
|
+
}
|
|
3194
3210
|
}
|
|
3195
3211
|
}),
|
|
3196
3212
|
[id, field]
|
|
@@ -3254,6 +3270,7 @@ var ExternalInput = ({
|
|
|
3254
3270
|
}),
|
|
3255
3271
|
onSubmit: (e) => {
|
|
3256
3272
|
e.preventDefault();
|
|
3273
|
+
e.stopPropagation();
|
|
3257
3274
|
search(searchQuery, filters);
|
|
3258
3275
|
},
|
|
3259
3276
|
children: [
|
|
@@ -3401,7 +3418,7 @@ var ExternalField = ({
|
|
|
3401
3418
|
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
|
|
3402
3419
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
|
3403
3420
|
mapRow: validField.mapRow,
|
|
3404
|
-
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(
|
|
3421
|
+
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
|
|
3405
3422
|
return yield deprecatedField.adaptor.fetchList(
|
|
3406
3423
|
deprecatedField.adaptorParams
|
|
3407
3424
|
);
|
|
@@ -3777,6 +3794,7 @@ function AutoFieldInternal(props) {
|
|
|
3777
3794
|
}
|
|
3778
3795
|
return (_props) => null;
|
|
3779
3796
|
}, [field.type]);
|
|
3797
|
+
const fieldKey = field.type === "custom" ? field.key : void 0;
|
|
3780
3798
|
let FieldComponent = useMemo3(() => {
|
|
3781
3799
|
if (field.type === "custom") {
|
|
3782
3800
|
if (!field.render) {
|
|
@@ -3786,7 +3804,7 @@ function AutoFieldInternal(props) {
|
|
|
3786
3804
|
} else if (field.type !== "slot") {
|
|
3787
3805
|
return render[field.type];
|
|
3788
3806
|
}
|
|
3789
|
-
}, [field.type, render]);
|
|
3807
|
+
}, [field.type, fieldKey, render]);
|
|
3790
3808
|
const { visible = true } = props.field;
|
|
3791
3809
|
if (!visible) {
|
|
3792
3810
|
return null;
|
|
@@ -4164,12 +4182,14 @@ var DraggableComponent = ({
|
|
|
4164
4182
|
}
|
|
4165
4183
|
return cleanup;
|
|
4166
4184
|
}, [permissions.drag, zoneCompound]);
|
|
4185
|
+
const [, setRerender] = useState10(0);
|
|
4167
4186
|
const ref = useRef2(null);
|
|
4168
4187
|
const refSetter = useCallback7(
|
|
4169
4188
|
(el) => {
|
|
4170
4189
|
sortableRef(el);
|
|
4171
|
-
if (el) {
|
|
4190
|
+
if (ref.current !== el) {
|
|
4172
4191
|
ref.current = el;
|
|
4192
|
+
setRerender((update) => update + 1);
|
|
4173
4193
|
}
|
|
4174
4194
|
},
|
|
4175
4195
|
[sortableRef]
|
|
@@ -4824,7 +4844,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
|
4824
4844
|
|
|
4825
4845
|
// lib/insert-component.ts
|
|
4826
4846
|
init_react_import();
|
|
4827
|
-
var insertComponent = (componentType, zone, index, appStore) => __async(
|
|
4847
|
+
var insertComponent = (componentType, zone, index, appStore) => __async(null, null, function* () {
|
|
4828
4848
|
const id = generateId(componentType);
|
|
4829
4849
|
const insertActionData = {
|
|
4830
4850
|
type: "insert",
|
|
@@ -5508,7 +5528,7 @@ import { useCallback as useCallback9 } from "react";
|
|
|
5508
5528
|
function useRenderedCallback(callback, deps) {
|
|
5509
5529
|
const manager = useDragDropManager();
|
|
5510
5530
|
return useCallback9(
|
|
5511
|
-
(...args) => __async(
|
|
5531
|
+
(...args) => __async(null, null, function* () {
|
|
5512
5532
|
yield manager == null ? void 0 : manager.renderer.rendering;
|
|
5513
5533
|
return callback(...args);
|
|
5514
5534
|
}),
|
|
@@ -5674,26 +5694,26 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
5674
5694
|
capture: true
|
|
5675
5695
|
});
|
|
5676
5696
|
};
|
|
5677
|
-
if (
|
|
5678
|
-
el.addEventListener("focus", onFocus, { capture: true });
|
|
5679
|
-
el.addEventListener("blur", onBlur, { capture: true });
|
|
5680
|
-
} else if (disableDrag) {
|
|
5697
|
+
if (disableDrag) {
|
|
5681
5698
|
el.addEventListener("pointerdown", stopPropagation, {
|
|
5682
5699
|
capture: true
|
|
5683
5700
|
});
|
|
5701
|
+
} else if (disableDragOnFocus) {
|
|
5702
|
+
el.addEventListener("focus", onFocus, { capture: true });
|
|
5703
|
+
el.addEventListener("blur", onBlur, { capture: true });
|
|
5684
5704
|
}
|
|
5685
5705
|
el.setAttribute("data-puck-overlay-portal", "true");
|
|
5686
5706
|
return () => {
|
|
5687
5707
|
el.removeEventListener("mouseover", stopPropagation, {
|
|
5688
5708
|
capture: true
|
|
5689
5709
|
});
|
|
5690
|
-
if (
|
|
5691
|
-
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5692
|
-
el.removeEventListener("blur", onFocus, { capture: true });
|
|
5693
|
-
} else if (disableDrag) {
|
|
5710
|
+
if (disableDrag) {
|
|
5694
5711
|
el.removeEventListener("pointerdown", stopPropagation, {
|
|
5695
5712
|
capture: true
|
|
5696
5713
|
});
|
|
5714
|
+
} else if (disableDragOnFocus) {
|
|
5715
|
+
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5716
|
+
el.removeEventListener("blur", onBlur, { capture: true });
|
|
5697
5717
|
}
|
|
5698
5718
|
el.removeAttribute("data-puck-overlay-portal");
|
|
5699
5719
|
};
|
|
@@ -5701,7 +5721,7 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
5701
5721
|
|
|
5702
5722
|
// css-module:/home/runner/work/puck/puck/packages/core/components/InlineTextField/styles.module.css#css-module
|
|
5703
5723
|
init_react_import();
|
|
5704
|
-
var styles_module_default13 = { "InlineTextField": "
|
|
5724
|
+
var styles_module_default13 = { "InlineTextField": "_InlineTextField_104qp_1" };
|
|
5705
5725
|
|
|
5706
5726
|
// lib/data/set-deep.ts
|
|
5707
5727
|
init_react_import();
|
|
@@ -5775,7 +5795,7 @@ var InlineTextFieldInternal = ({
|
|
|
5775
5795
|
ref.current.replaceChildren(value);
|
|
5776
5796
|
}
|
|
5777
5797
|
const cleanupPortal = registerOverlayPortal(ref.current);
|
|
5778
|
-
const handleInput = (e) => __async(
|
|
5798
|
+
const handleInput = (e) => __async(null, null, function* () {
|
|
5779
5799
|
var _a2;
|
|
5780
5800
|
const appStore2 = appStoreApi.getState();
|
|
5781
5801
|
const node = appStore2.state.indexes.nodes[componentId];
|
|
@@ -6067,7 +6087,8 @@ var DropZoneEdit = forwardRef3(
|
|
|
6067
6087
|
style,
|
|
6068
6088
|
className,
|
|
6069
6089
|
minEmptyHeight: userMinEmptyHeight = 128,
|
|
6070
|
-
collisionAxis
|
|
6090
|
+
collisionAxis,
|
|
6091
|
+
as
|
|
6071
6092
|
}, userRef) {
|
|
6072
6093
|
const ctx = useContext8(dropZoneContext);
|
|
6073
6094
|
const appStoreApi = useAppStoreApi();
|
|
@@ -6210,8 +6231,9 @@ var DropZoneEdit = forwardRef3(
|
|
|
6210
6231
|
userMinEmptyHeight,
|
|
6211
6232
|
ref
|
|
6212
6233
|
});
|
|
6234
|
+
const El = as != null ? as : "div";
|
|
6213
6235
|
return /* @__PURE__ */ jsx26(
|
|
6214
|
-
|
|
6236
|
+
El,
|
|
6215
6237
|
{
|
|
6216
6238
|
className: `${getClassName19({
|
|
6217
6239
|
isRootZone,
|
|
@@ -6274,7 +6296,7 @@ var DropZoneRenderItem = ({
|
|
|
6274
6296
|
};
|
|
6275
6297
|
var DropZoneRenderPure = (props) => /* @__PURE__ */ jsx26(DropZoneRender, __spreadValues({}, props));
|
|
6276
6298
|
var DropZoneRender = forwardRef3(
|
|
6277
|
-
function DropZoneRenderInternal({ className, style, zone }, ref) {
|
|
6299
|
+
function DropZoneRenderInternal({ className, style, zone, as }, ref) {
|
|
6278
6300
|
const ctx = useContext8(dropZoneContext);
|
|
6279
6301
|
const { areaId = "root" } = ctx || {};
|
|
6280
6302
|
const { config, data, metadata } = useContext8(renderContext);
|
|
@@ -6287,13 +6309,14 @@ var DropZoneRender = forwardRef3(
|
|
|
6287
6309
|
}
|
|
6288
6310
|
}
|
|
6289
6311
|
}, [content]);
|
|
6312
|
+
const El = as != null ? as : "div";
|
|
6290
6313
|
if (!data || !config) {
|
|
6291
6314
|
return null;
|
|
6292
6315
|
}
|
|
6293
6316
|
if (zoneCompound !== rootDroppableId) {
|
|
6294
6317
|
content = setupZone(data, zoneCompound).zones[zoneCompound];
|
|
6295
6318
|
}
|
|
6296
|
-
return /* @__PURE__ */ jsx26(
|
|
6319
|
+
return /* @__PURE__ */ jsx26(El, { className, style, ref, children: content.map((item) => {
|
|
6297
6320
|
const Component = config.components[item.type];
|
|
6298
6321
|
if (Component) {
|
|
6299
6322
|
return /* @__PURE__ */ jsx26(
|
|
@@ -6436,7 +6459,7 @@ function createUsePuck() {
|
|
|
6436
6459
|
}
|
|
6437
6460
|
const result = useStore3(
|
|
6438
6461
|
usePuckApi,
|
|
6439
|
-
selector != null ? selector : (s) => s
|
|
6462
|
+
selector != null ? selector : ((s) => s)
|
|
6440
6463
|
);
|
|
6441
6464
|
return result;
|
|
6442
6465
|
};
|
|
@@ -6583,7 +6606,7 @@ var DefaultFields = ({
|
|
|
6583
6606
|
}) => {
|
|
6584
6607
|
return /* @__PURE__ */ jsx29(Fragment8, { children });
|
|
6585
6608
|
};
|
|
6586
|
-
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(
|
|
6609
|
+
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
|
|
6587
6610
|
let currentProps;
|
|
6588
6611
|
const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
|
|
6589
6612
|
const { data, ui } = state;
|
|
@@ -6957,7 +6980,7 @@ var CopyHostStyles = ({
|
|
|
6957
6980
|
let elements = [];
|
|
6958
6981
|
const hashes = {};
|
|
6959
6982
|
const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
|
|
6960
|
-
const mirrorEl = (el, inlineStyles = false) => __async(
|
|
6983
|
+
const mirrorEl = (el, inlineStyles = false) => __async(null, null, function* () {
|
|
6961
6984
|
let mirror;
|
|
6962
6985
|
if (el.nodeName === "LINK" && inlineStyles) {
|
|
6963
6986
|
mirror = document.createElement("style");
|
|
@@ -6989,7 +7012,7 @@ var CopyHostStyles = ({
|
|
|
6989
7012
|
}
|
|
6990
7013
|
return mirror;
|
|
6991
7014
|
});
|
|
6992
|
-
const addEl = (el) => __async(
|
|
7015
|
+
const addEl = (el) => __async(null, null, function* () {
|
|
6993
7016
|
const index = lookupEl(el);
|
|
6994
7017
|
if (index > -1) {
|
|
6995
7018
|
if (debug)
|
|
@@ -7062,7 +7085,7 @@ var CopyHostStyles = ({
|
|
|
7062
7085
|
const parentBody = parentDocument.getElementsByTagName("body")[0];
|
|
7063
7086
|
syncAttributes(parentBody, doc.body);
|
|
7064
7087
|
Promise.all(
|
|
7065
|
-
collectedStyles.map((styleNode, i) => __async(
|
|
7088
|
+
collectedStyles.map((styleNode, i) => __async(null, null, function* () {
|
|
7066
7089
|
if (styleNode.nodeName === "LINK") {
|
|
7067
7090
|
const linkHref = styleNode.href;
|
|
7068
7091
|
if (hrefs.indexOf(linkHref) > -1) {
|
|
@@ -8587,9 +8610,13 @@ function PuckProvider({ children }) {
|
|
|
8587
8610
|
}
|
|
8588
8611
|
const rootProps = ((_h = initialData == null ? void 0 : initialData.root) == null ? void 0 : _h.props) || (initialData == null ? void 0 : initialData.root) || {};
|
|
8589
8612
|
const defaultedRootProps = __spreadValues(__spreadValues({}, (_i = config.root) == null ? void 0 : _i.defaultProps), rootProps);
|
|
8613
|
+
const root = populateIds(
|
|
8614
|
+
toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
|
|
8615
|
+
config
|
|
8616
|
+
);
|
|
8590
8617
|
const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
|
8591
8618
|
data: __spreadProps(__spreadValues({}, initialData), {
|
|
8592
|
-
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props:
|
|
8619
|
+
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
|
|
8593
8620
|
content: initialData.content || []
|
|
8594
8621
|
}),
|
|
8595
8622
|
ui: __spreadProps(__spreadValues(__spreadValues({}, initial), clientUiState), {
|
|
@@ -8626,7 +8653,12 @@ function PuckProvider({ children }) {
|
|
|
8626
8653
|
});
|
|
8627
8654
|
})
|
|
8628
8655
|
);
|
|
8629
|
-
const initialHistoryIndex = (
|
|
8656
|
+
const initialHistoryIndex = useMemo20(() => {
|
|
8657
|
+
if ((_initialHistory == null ? void 0 : _initialHistory.index) !== void 0 && (_initialHistory == null ? void 0 : _initialHistory.index) >= 0 && (_initialHistory == null ? void 0 : _initialHistory.index) < blendedHistories.length) {
|
|
8658
|
+
return _initialHistory == null ? void 0 : _initialHistory.index;
|
|
8659
|
+
}
|
|
8660
|
+
return blendedHistories.length - 1;
|
|
8661
|
+
}, []);
|
|
8630
8662
|
const initialAppState = blendedHistories[initialHistoryIndex].state;
|
|
8631
8663
|
const loadedOverrides = useLoadedOverrides({
|
|
8632
8664
|
overrides,
|
|
@@ -8685,7 +8717,7 @@ function PuckProvider({ children }) {
|
|
|
8685
8717
|
});
|
|
8686
8718
|
const previousData = useRef12(null);
|
|
8687
8719
|
useEffect29(() => {
|
|
8688
|
-
appStore.subscribe(
|
|
8720
|
+
return appStore.subscribe(
|
|
8689
8721
|
(s) => s.state.data,
|
|
8690
8722
|
(data) => {
|
|
8691
8723
|
if (onChange) {
|
|
@@ -8695,7 +8727,7 @@ function PuckProvider({ children }) {
|
|
|
8695
8727
|
}
|
|
8696
8728
|
}
|
|
8697
8729
|
);
|
|
8698
|
-
}, []);
|
|
8730
|
+
}, [onChange]);
|
|
8699
8731
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
8700
8732
|
const uPuckStore = useRegisterUsePuckStore(appStore);
|
|
8701
8733
|
useEffect29(() => {
|
|
@@ -8911,269 +8943,38 @@ classnames/index.js:
|
|
|
8911
8943
|
*)
|
|
8912
8944
|
|
|
8913
8945
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
8914
|
-
(**
|
|
8915
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8916
|
-
*
|
|
8917
|
-
* This source code is licensed under the ISC license.
|
|
8918
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8919
|
-
*)
|
|
8920
|
-
|
|
8921
8946
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
8922
|
-
(**
|
|
8923
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8924
|
-
*
|
|
8925
|
-
* This source code is licensed under the ISC license.
|
|
8926
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8927
|
-
*)
|
|
8928
|
-
|
|
8929
8947
|
lucide-react/dist/esm/Icon.js:
|
|
8930
|
-
(**
|
|
8931
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8932
|
-
*
|
|
8933
|
-
* This source code is licensed under the ISC license.
|
|
8934
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8935
|
-
*)
|
|
8936
|
-
|
|
8937
8948
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
8938
|
-
(**
|
|
8939
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8940
|
-
*
|
|
8941
|
-
* This source code is licensed under the ISC license.
|
|
8942
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8943
|
-
*)
|
|
8944
|
-
|
|
8945
8949
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
8946
|
-
(**
|
|
8947
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8948
|
-
*
|
|
8949
|
-
* This source code is licensed under the ISC license.
|
|
8950
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8951
|
-
*)
|
|
8952
|
-
|
|
8953
8950
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
8954
|
-
(**
|
|
8955
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8956
|
-
*
|
|
8957
|
-
* This source code is licensed under the ISC license.
|
|
8958
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8959
|
-
*)
|
|
8960
|
-
|
|
8961
8951
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
8962
|
-
(**
|
|
8963
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8964
|
-
*
|
|
8965
|
-
* This source code is licensed under the ISC license.
|
|
8966
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8967
|
-
*)
|
|
8968
|
-
|
|
8969
8952
|
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
8970
|
-
(**
|
|
8971
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8972
|
-
*
|
|
8973
|
-
* This source code is licensed under the ISC license.
|
|
8974
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8975
|
-
*)
|
|
8976
|
-
|
|
8977
8953
|
lucide-react/dist/esm/icons/copy.js:
|
|
8978
|
-
(**
|
|
8979
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8980
|
-
*
|
|
8981
|
-
* This source code is licensed under the ISC license.
|
|
8982
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8983
|
-
*)
|
|
8984
|
-
|
|
8985
8954
|
lucide-react/dist/esm/icons/corner-left-up.js:
|
|
8986
|
-
(**
|
|
8987
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8988
|
-
*
|
|
8989
|
-
* This source code is licensed under the ISC license.
|
|
8990
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8991
|
-
*)
|
|
8992
|
-
|
|
8993
8955
|
lucide-react/dist/esm/icons/ellipsis-vertical.js:
|
|
8994
|
-
(**
|
|
8995
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8996
|
-
*
|
|
8997
|
-
* This source code is licensed under the ISC license.
|
|
8998
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8999
|
-
*)
|
|
9000
|
-
|
|
9001
8956
|
lucide-react/dist/esm/icons/globe.js:
|
|
9002
|
-
(**
|
|
9003
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9004
|
-
*
|
|
9005
|
-
* This source code is licensed under the ISC license.
|
|
9006
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9007
|
-
*)
|
|
9008
|
-
|
|
9009
8957
|
lucide-react/dist/esm/icons/hash.js:
|
|
9010
|
-
(**
|
|
9011
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9012
|
-
*
|
|
9013
|
-
* This source code is licensed under the ISC license.
|
|
9014
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9015
|
-
*)
|
|
9016
|
-
|
|
9017
8958
|
lucide-react/dist/esm/icons/layers.js:
|
|
9018
|
-
(**
|
|
9019
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9020
|
-
*
|
|
9021
|
-
* This source code is licensed under the ISC license.
|
|
9022
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9023
|
-
*)
|
|
9024
|
-
|
|
9025
8959
|
lucide-react/dist/esm/icons/layout-grid.js:
|
|
9026
|
-
(**
|
|
9027
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9028
|
-
*
|
|
9029
|
-
* This source code is licensed under the ISC license.
|
|
9030
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9031
|
-
*)
|
|
9032
|
-
|
|
9033
8960
|
lucide-react/dist/esm/icons/link.js:
|
|
9034
|
-
(**
|
|
9035
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9036
|
-
*
|
|
9037
|
-
* This source code is licensed under the ISC license.
|
|
9038
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9039
|
-
*)
|
|
9040
|
-
|
|
9041
8961
|
lucide-react/dist/esm/icons/list.js:
|
|
9042
|
-
(**
|
|
9043
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9044
|
-
*
|
|
9045
|
-
* This source code is licensed under the ISC license.
|
|
9046
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9047
|
-
*)
|
|
9048
|
-
|
|
9049
8962
|
lucide-react/dist/esm/icons/lock-open.js:
|
|
9050
|
-
(**
|
|
9051
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9052
|
-
*
|
|
9053
|
-
* This source code is licensed under the ISC license.
|
|
9054
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9055
|
-
*)
|
|
9056
|
-
|
|
9057
8963
|
lucide-react/dist/esm/icons/lock.js:
|
|
9058
|
-
(**
|
|
9059
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9060
|
-
*
|
|
9061
|
-
* This source code is licensed under the ISC license.
|
|
9062
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9063
|
-
*)
|
|
9064
|
-
|
|
9065
8964
|
lucide-react/dist/esm/icons/monitor.js:
|
|
9066
|
-
(**
|
|
9067
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9068
|
-
*
|
|
9069
|
-
* This source code is licensed under the ISC license.
|
|
9070
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9071
|
-
*)
|
|
9072
|
-
|
|
9073
8965
|
lucide-react/dist/esm/icons/panel-left.js:
|
|
9074
|
-
(**
|
|
9075
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9076
|
-
*
|
|
9077
|
-
* This source code is licensed under the ISC license.
|
|
9078
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9079
|
-
*)
|
|
9080
|
-
|
|
9081
8966
|
lucide-react/dist/esm/icons/panel-right.js:
|
|
9082
|
-
(**
|
|
9083
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9084
|
-
*
|
|
9085
|
-
* This source code is licensed under the ISC license.
|
|
9086
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9087
|
-
*)
|
|
9088
|
-
|
|
9089
8967
|
lucide-react/dist/esm/icons/plus.js:
|
|
9090
|
-
(**
|
|
9091
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9092
|
-
*
|
|
9093
|
-
* This source code is licensed under the ISC license.
|
|
9094
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9095
|
-
*)
|
|
9096
|
-
|
|
9097
8968
|
lucide-react/dist/esm/icons/redo-2.js:
|
|
9098
|
-
(**
|
|
9099
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9100
|
-
*
|
|
9101
|
-
* This source code is licensed under the ISC license.
|
|
9102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9103
|
-
*)
|
|
9104
|
-
|
|
9105
8969
|
lucide-react/dist/esm/icons/search.js:
|
|
9106
|
-
(**
|
|
9107
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9108
|
-
*
|
|
9109
|
-
* This source code is licensed under the ISC license.
|
|
9110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9111
|
-
*)
|
|
9112
|
-
|
|
9113
8970
|
lucide-react/dist/esm/icons/sliders-horizontal.js:
|
|
9114
|
-
(**
|
|
9115
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9116
|
-
*
|
|
9117
|
-
* This source code is licensed under the ISC license.
|
|
9118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9119
|
-
*)
|
|
9120
|
-
|
|
9121
8971
|
lucide-react/dist/esm/icons/smartphone.js:
|
|
9122
|
-
(**
|
|
9123
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9124
|
-
*
|
|
9125
|
-
* This source code is licensed under the ISC license.
|
|
9126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9127
|
-
*)
|
|
9128
|
-
|
|
9129
8972
|
lucide-react/dist/esm/icons/tablet.js:
|
|
9130
|
-
(**
|
|
9131
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9132
|
-
*
|
|
9133
|
-
* This source code is licensed under the ISC license.
|
|
9134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9135
|
-
*)
|
|
9136
|
-
|
|
9137
8973
|
lucide-react/dist/esm/icons/trash.js:
|
|
9138
|
-
(**
|
|
9139
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9140
|
-
*
|
|
9141
|
-
* This source code is licensed under the ISC license.
|
|
9142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9143
|
-
*)
|
|
9144
|
-
|
|
9145
8974
|
lucide-react/dist/esm/icons/type.js:
|
|
9146
|
-
(**
|
|
9147
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9148
|
-
*
|
|
9149
|
-
* This source code is licensed under the ISC license.
|
|
9150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9151
|
-
*)
|
|
9152
|
-
|
|
9153
8975
|
lucide-react/dist/esm/icons/undo-2.js:
|
|
9154
|
-
(**
|
|
9155
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9156
|
-
*
|
|
9157
|
-
* This source code is licensed under the ISC license.
|
|
9158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9159
|
-
*)
|
|
9160
|
-
|
|
9161
8976
|
lucide-react/dist/esm/icons/zoom-in.js:
|
|
9162
|
-
(**
|
|
9163
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9164
|
-
*
|
|
9165
|
-
* This source code is licensed under the ISC license.
|
|
9166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9167
|
-
*)
|
|
9168
|
-
|
|
9169
8977
|
lucide-react/dist/esm/icons/zoom-out.js:
|
|
9170
|
-
(**
|
|
9171
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9172
|
-
*
|
|
9173
|
-
* This source code is licensed under the ISC license.
|
|
9174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9175
|
-
*)
|
|
9176
|
-
|
|
9177
8978
|
lucide-react/dist/esm/lucide-react.js:
|
|
9178
8979
|
(**
|
|
9179
8980
|
* @license lucide-react v0.468.0 - ISC
|