@measured/puck 0.21.0-canary.e4131567 → 0.21.0-canary.ec77dd9f
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-KNAV6QTS.mjs → chunk-NW2GGRCZ.mjs} +62 -269
- package/dist/{chunk-X7YZ3YE7.mjs → chunk-TC25DCTQ.mjs} +9 -8
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +80 -290
- package/dist/index.mjs +2 -2
- package/dist/no-external.d.mts +1 -1
- package/dist/no-external.d.ts +1 -1
- package/dist/no-external.js +77 -287
- 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 +8 -8
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-Ctf3FZQI.d.mts → walk-tree-CkSoNBF7.d.mts} +56 -43
- package/dist/{walk-tree-Ctf3FZQI.d.ts → walk-tree-CkSoNBF7.d.ts} +56 -43
- package/package.json +1 -1
package/dist/no-external.js
CHANGED
|
@@ -1976,10 +1976,10 @@ var getChanged = (newItem, oldItem) => {
|
|
|
1976
1976
|
|
|
1977
1977
|
// store/slices/permissions.ts
|
|
1978
1978
|
var createPermissionsSlice = (set, get) => {
|
|
1979
|
-
const resolvePermissions = (..._0) => __async(
|
|
1979
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
1980
1980
|
const { state, permissions, config } = get();
|
|
1981
1981
|
const { cache: cache2, globalPermissions } = permissions;
|
|
1982
|
-
const resolveDataForItem = (item2, force2 = false) => __async(
|
|
1982
|
+
const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
1983
1983
|
var _a, _b, _c;
|
|
1984
1984
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
1985
1985
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
@@ -2034,13 +2034,13 @@ var createPermissionsSlice = (set, get) => {
|
|
|
2034
2034
|
if (item) {
|
|
2035
2035
|
yield resolveDataForItem(item, force);
|
|
2036
2036
|
} else if (type) {
|
|
2037
|
-
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(
|
|
2037
|
+
flattenData(state, config).filter((item2) => item2.type === type).map((item2) => __async(null, null, function* () {
|
|
2038
2038
|
yield resolveDataForItem(item2, force);
|
|
2039
2039
|
}));
|
|
2040
2040
|
} else if (root) {
|
|
2041
2041
|
resolveDataForRoot(force);
|
|
2042
2042
|
} else {
|
|
2043
|
-
flattenData(state, config).map((item2) => __async(
|
|
2043
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
2044
2044
|
yield resolveDataForItem(item2, force);
|
|
2045
2045
|
}));
|
|
2046
2046
|
}
|
|
@@ -2121,7 +2121,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
2121
2121
|
};
|
|
2122
2122
|
var useRegisterFieldsSlice = (appStore, id) => {
|
|
2123
2123
|
const resolveFields = (0, import_react7.useCallback)(
|
|
2124
|
-
(reset) => __async(
|
|
2124
|
+
(reset) => __async(null, null, function* () {
|
|
2125
2125
|
var _a, _b;
|
|
2126
2126
|
const { fields, lastResolvedData } = appStore.getState().fields;
|
|
2127
2127
|
const metadata = appStore.getState().metadata;
|
|
@@ -2192,7 +2192,7 @@ var useRegisterFieldsSlice = (appStore, id) => {
|
|
|
2192
2192
|
init_react_import();
|
|
2193
2193
|
var import_fast_equals2 = require("fast-equals");
|
|
2194
2194
|
var cache = { lastChange: {} };
|
|
2195
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
2195
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
2196
2196
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
2197
2197
|
const resolvedItem = __spreadValues({}, item);
|
|
2198
2198
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -2220,11 +2220,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
2220
2220
|
let itemWithResolvedChildren = yield mapFields(
|
|
2221
2221
|
resolvedItem,
|
|
2222
2222
|
{
|
|
2223
|
-
slot: (_02) => __async(
|
|
2223
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
2224
2224
|
const content = value;
|
|
2225
2225
|
return yield Promise.all(
|
|
2226
2226
|
content.map(
|
|
2227
|
-
(childItem) => __async(
|
|
2227
|
+
(childItem) => __async(null, null, function* () {
|
|
2228
2228
|
return (yield resolveComponentData(
|
|
2229
2229
|
childItem,
|
|
2230
2230
|
config,
|
|
@@ -2414,7 +2414,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
|
|
|
2414
2414
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
2415
2415
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
2416
2416
|
}),
|
|
2417
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
2417
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
2418
2418
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
2419
2419
|
const timeouts = {};
|
|
2420
2420
|
return yield resolveComponentData(
|
|
@@ -2425,7 +2425,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
|
|
|
2425
2425
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2426
2426
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
2427
2427
|
},
|
|
2428
|
-
(item) => __async(
|
|
2428
|
+
(item) => __async(null, null, function* () {
|
|
2429
2429
|
const id = "id" in item.props ? item.props.id : "root";
|
|
2430
2430
|
if ("type" in item) {
|
|
2431
2431
|
yield permissions.refreshPermissions({ item });
|
|
@@ -2437,7 +2437,7 @@ var createAppStore = (initialAppStore) => (0, import_zustand2.create)()(
|
|
|
2437
2437
|
trigger
|
|
2438
2438
|
);
|
|
2439
2439
|
}),
|
|
2440
|
-
resolveAndCommitData: () => __async(
|
|
2440
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
2441
2441
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
2442
2442
|
walkAppState(
|
|
2443
2443
|
state,
|
|
@@ -3009,7 +3009,7 @@ var collisionStore = (0, import_vanilla.createStore)(() => ({
|
|
|
3009
3009
|
|
|
3010
3010
|
// lib/dnd/collision/dynamic/index.ts
|
|
3011
3011
|
var flushNext = "";
|
|
3012
|
-
var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input) => {
|
|
3012
|
+
var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((input) => {
|
|
3013
3013
|
var _a, _b, _c, _d, _e;
|
|
3014
3014
|
const { dragOperation, droppable } = input;
|
|
3015
3015
|
const { position } = dragOperation;
|
|
@@ -3102,7 +3102,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
|
|
|
3102
3102
|
}
|
|
3103
3103
|
collisionDebug(dragCenter, dropCenter, droppable.id.toString(), "hotpink");
|
|
3104
3104
|
return null;
|
|
3105
|
-
};
|
|
3105
|
+
});
|
|
3106
3106
|
|
|
3107
3107
|
// components/Sortable/index.tsx
|
|
3108
3108
|
var import_sortable = require("@dnd-kit/react/sortable");
|
|
@@ -3535,8 +3535,9 @@ var ArrayField = ({
|
|
|
3535
3535
|
var _a;
|
|
3536
3536
|
if (isDraggingAny) return;
|
|
3537
3537
|
const existingValue = value || [];
|
|
3538
|
+
const defaultProps = typeof field.defaultItemProps === "function" ? field.defaultItemProps(existingValue.length) : (_a = field.defaultItemProps) != null ? _a : {};
|
|
3538
3539
|
const newItem = defaultSlots(
|
|
3539
|
-
uniqifyItem(
|
|
3540
|
+
uniqifyItem(defaultProps),
|
|
3540
3541
|
field.arrayFields
|
|
3541
3542
|
);
|
|
3542
3543
|
const newValue = [...existingValue, newItem];
|
|
@@ -3795,11 +3796,13 @@ var ExternalInput = ({
|
|
|
3795
3796
|
id,
|
|
3796
3797
|
readOnly
|
|
3797
3798
|
}) => {
|
|
3799
|
+
var _a;
|
|
3798
3800
|
const {
|
|
3799
3801
|
mapProp = (val) => val,
|
|
3800
3802
|
mapRow = (val) => val,
|
|
3801
3803
|
filterFields
|
|
3802
3804
|
} = field || {};
|
|
3805
|
+
const { enabled: shouldCacheData } = (_a = field.cache) != null ? _a : { enabled: true };
|
|
3803
3806
|
const [data, setData] = (0, import_react17.useState)([]);
|
|
3804
3807
|
const [isOpen, setOpen] = (0, import_react17.useState)(false);
|
|
3805
3808
|
const [isLoading, setIsLoading] = (0, import_react17.useState)(true);
|
|
@@ -3822,14 +3825,21 @@ var ExternalInput = ({
|
|
|
3822
3825
|
}, [mappedData]);
|
|
3823
3826
|
const [searchQuery, setSearchQuery] = (0, import_react17.useState)(field.initialQuery || "");
|
|
3824
3827
|
const search = (0, import_react17.useCallback)(
|
|
3825
|
-
(query, filters2) => __async(
|
|
3828
|
+
(query, filters2) => __async(null, null, function* () {
|
|
3826
3829
|
setIsLoading(true);
|
|
3827
3830
|
const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
|
|
3828
|
-
|
|
3831
|
+
let listData;
|
|
3832
|
+
if (shouldCacheData && dataCache[cacheKey]) {
|
|
3833
|
+
listData = dataCache[cacheKey];
|
|
3834
|
+
} else {
|
|
3835
|
+
listData = yield field.fetchList({ query, filters: filters2 });
|
|
3836
|
+
}
|
|
3829
3837
|
if (listData) {
|
|
3830
3838
|
setData(listData);
|
|
3831
3839
|
setIsLoading(false);
|
|
3832
|
-
|
|
3840
|
+
if (shouldCacheData) {
|
|
3841
|
+
dataCache[cacheKey] = listData;
|
|
3842
|
+
}
|
|
3833
3843
|
}
|
|
3834
3844
|
}),
|
|
3835
3845
|
[id, field]
|
|
@@ -3893,6 +3903,7 @@ var ExternalInput = ({
|
|
|
3893
3903
|
}),
|
|
3894
3904
|
onSubmit: (e) => {
|
|
3895
3905
|
e.preventDefault();
|
|
3906
|
+
e.stopPropagation();
|
|
3896
3907
|
search(searchQuery, filters);
|
|
3897
3908
|
},
|
|
3898
3909
|
children: [
|
|
@@ -4040,7 +4051,7 @@ var ExternalField = ({
|
|
|
4040
4051
|
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
|
|
4041
4052
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
|
4042
4053
|
mapRow: validField.mapRow,
|
|
4043
|
-
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(
|
|
4054
|
+
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
|
|
4044
4055
|
return yield deprecatedField.adaptor.fetchList(
|
|
4045
4056
|
deprecatedField.adaptorParams
|
|
4046
4057
|
);
|
|
@@ -4416,6 +4427,7 @@ function AutoFieldInternal(props) {
|
|
|
4416
4427
|
}
|
|
4417
4428
|
return (_props) => null;
|
|
4418
4429
|
}, [field.type]);
|
|
4430
|
+
const fieldKey = field.type === "custom" ? field.key : void 0;
|
|
4419
4431
|
let FieldComponent = (0, import_react20.useMemo)(() => {
|
|
4420
4432
|
if (field.type === "custom") {
|
|
4421
4433
|
if (!field.render) {
|
|
@@ -4425,7 +4437,7 @@ function AutoFieldInternal(props) {
|
|
|
4425
4437
|
} else if (field.type !== "slot") {
|
|
4426
4438
|
return render[field.type];
|
|
4427
4439
|
}
|
|
4428
|
-
}, [field.type, render]);
|
|
4440
|
+
}, [field.type, fieldKey, render]);
|
|
4429
4441
|
const { visible = true } = props.field;
|
|
4430
4442
|
if (!visible) {
|
|
4431
4443
|
return null;
|
|
@@ -4796,12 +4808,14 @@ var DraggableComponent = ({
|
|
|
4796
4808
|
}
|
|
4797
4809
|
return cleanup;
|
|
4798
4810
|
}, [permissions.drag, zoneCompound]);
|
|
4811
|
+
const [, setRerender] = (0, import_react24.useState)(0);
|
|
4799
4812
|
const ref = (0, import_react24.useRef)(null);
|
|
4800
4813
|
const refSetter = (0, import_react24.useCallback)(
|
|
4801
4814
|
(el) => {
|
|
4802
4815
|
sortableRef(el);
|
|
4803
|
-
if (el) {
|
|
4816
|
+
if (ref.current !== el) {
|
|
4804
4817
|
ref.current = el;
|
|
4818
|
+
setRerender((update) => update + 1);
|
|
4805
4819
|
}
|
|
4806
4820
|
},
|
|
4807
4821
|
[sortableRef]
|
|
@@ -5248,7 +5262,7 @@ var import_react27 = require("react");
|
|
|
5248
5262
|
function useRenderedCallback(callback, deps) {
|
|
5249
5263
|
const manager = (0, import_react26.useDragDropManager)();
|
|
5250
5264
|
return (0, import_react27.useCallback)(
|
|
5251
|
-
(...args) => __async(
|
|
5265
|
+
(...args) => __async(null, null, function* () {
|
|
5252
5266
|
yield manager == null ? void 0 : manager.renderer.rendering;
|
|
5253
5267
|
return callback(...args);
|
|
5254
5268
|
}),
|
|
@@ -5576,26 +5590,26 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
5576
5590
|
capture: true
|
|
5577
5591
|
});
|
|
5578
5592
|
};
|
|
5579
|
-
if (
|
|
5580
|
-
el.addEventListener("focus", onFocus, { capture: true });
|
|
5581
|
-
el.addEventListener("blur", onBlur, { capture: true });
|
|
5582
|
-
} else if (disableDrag) {
|
|
5593
|
+
if (disableDrag) {
|
|
5583
5594
|
el.addEventListener("pointerdown", stopPropagation, {
|
|
5584
5595
|
capture: true
|
|
5585
5596
|
});
|
|
5597
|
+
} else if (disableDragOnFocus) {
|
|
5598
|
+
el.addEventListener("focus", onFocus, { capture: true });
|
|
5599
|
+
el.addEventListener("blur", onBlur, { capture: true });
|
|
5586
5600
|
}
|
|
5587
5601
|
el.setAttribute("data-puck-overlay-portal", "true");
|
|
5588
5602
|
return () => {
|
|
5589
5603
|
el.removeEventListener("mouseover", stopPropagation, {
|
|
5590
5604
|
capture: true
|
|
5591
5605
|
});
|
|
5592
|
-
if (
|
|
5593
|
-
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5594
|
-
el.removeEventListener("blur", onFocus, { capture: true });
|
|
5595
|
-
} else if (disableDrag) {
|
|
5606
|
+
if (disableDrag) {
|
|
5596
5607
|
el.removeEventListener("pointerdown", stopPropagation, {
|
|
5597
5608
|
capture: true
|
|
5598
5609
|
});
|
|
5610
|
+
} else if (disableDragOnFocus) {
|
|
5611
|
+
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5612
|
+
el.removeEventListener("blur", onBlur, { capture: true });
|
|
5599
5613
|
}
|
|
5600
5614
|
el.removeAttribute("data-puck-overlay-portal");
|
|
5601
5615
|
};
|
|
@@ -5677,7 +5691,7 @@ var InlineTextFieldInternal = ({
|
|
|
5677
5691
|
ref.current.replaceChildren(value);
|
|
5678
5692
|
}
|
|
5679
5693
|
const cleanupPortal = registerOverlayPortal(ref.current);
|
|
5680
|
-
const handleInput = (e) => __async(
|
|
5694
|
+
const handleInput = (e) => __async(null, null, function* () {
|
|
5681
5695
|
var _a2;
|
|
5682
5696
|
const appStore2 = appStoreApi.getState();
|
|
5683
5697
|
const node = appStore2.state.indexes.nodes[componentId];
|
|
@@ -6501,7 +6515,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
|
6501
6515
|
|
|
6502
6516
|
// lib/insert-component.ts
|
|
6503
6517
|
init_react_import();
|
|
6504
|
-
var insertComponent = (componentType, zone, index, appStore) => __async(
|
|
6518
|
+
var insertComponent = (componentType, zone, index, appStore) => __async(null, null, function* () {
|
|
6505
6519
|
const id = generateId(componentType);
|
|
6506
6520
|
const insertActionData = {
|
|
6507
6521
|
type: "insert",
|
|
@@ -7209,7 +7223,7 @@ var DefaultFields = ({
|
|
|
7209
7223
|
}) => {
|
|
7210
7224
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
|
|
7211
7225
|
};
|
|
7212
|
-
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(
|
|
7226
|
+
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
|
|
7213
7227
|
let currentProps;
|
|
7214
7228
|
const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
|
|
7215
7229
|
const { data, ui } = state;
|
|
@@ -7578,7 +7592,7 @@ var CopyHostStyles = ({
|
|
|
7578
7592
|
let elements = [];
|
|
7579
7593
|
const hashes = {};
|
|
7580
7594
|
const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
|
|
7581
|
-
const mirrorEl = (el, inlineStyles = false) => __async(
|
|
7595
|
+
const mirrorEl = (el, inlineStyles = false) => __async(null, null, function* () {
|
|
7582
7596
|
let mirror;
|
|
7583
7597
|
if (el.nodeName === "LINK" && inlineStyles) {
|
|
7584
7598
|
mirror = document.createElement("style");
|
|
@@ -7610,7 +7624,7 @@ var CopyHostStyles = ({
|
|
|
7610
7624
|
}
|
|
7611
7625
|
return mirror;
|
|
7612
7626
|
});
|
|
7613
|
-
const addEl = (el) => __async(
|
|
7627
|
+
const addEl = (el) => __async(null, null, function* () {
|
|
7614
7628
|
const index = lookupEl(el);
|
|
7615
7629
|
if (index > -1) {
|
|
7616
7630
|
if (debug)
|
|
@@ -7683,7 +7697,7 @@ var CopyHostStyles = ({
|
|
|
7683
7697
|
const parentBody = parentDocument.getElementsByTagName("body")[0];
|
|
7684
7698
|
syncAttributes(parentBody, doc.body);
|
|
7685
7699
|
Promise.all(
|
|
7686
|
-
collectedStyles.map((styleNode, i) => __async(
|
|
7700
|
+
collectedStyles.map((styleNode, i) => __async(null, null, function* () {
|
|
7687
7701
|
if (styleNode.nodeName === "LINK") {
|
|
7688
7702
|
const linkHref = styleNode.href;
|
|
7689
7703
|
if (hrefs.indexOf(linkHref) > -1) {
|
|
@@ -8758,7 +8772,7 @@ function createUsePuck() {
|
|
|
8758
8772
|
}
|
|
8759
8773
|
const result = (0, import_zustand6.useStore)(
|
|
8760
8774
|
usePuckApi,
|
|
8761
|
-
selector != null ? selector : (s) => s
|
|
8775
|
+
selector != null ? selector : ((s) => s)
|
|
8762
8776
|
);
|
|
8763
8777
|
return result;
|
|
8764
8778
|
};
|
|
@@ -9208,6 +9222,15 @@ function useSidebarResize(position, dispatch) {
|
|
|
9208
9222
|
};
|
|
9209
9223
|
}
|
|
9210
9224
|
|
|
9225
|
+
// lib/data/to-component.ts
|
|
9226
|
+
init_react_import();
|
|
9227
|
+
var toComponent = (item) => {
|
|
9228
|
+
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
9229
|
+
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
9230
|
+
type: "root"
|
|
9231
|
+
});
|
|
9232
|
+
};
|
|
9233
|
+
|
|
9211
9234
|
// components/Puck/index.tsx
|
|
9212
9235
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9213
9236
|
var getClassName31 = get_class_name_factory_default("Puck", styles_module_default15);
|
|
@@ -9284,9 +9307,13 @@ function PuckProvider({ children }) {
|
|
|
9284
9307
|
}
|
|
9285
9308
|
const rootProps = ((_h = initialData == null ? void 0 : initialData.root) == null ? void 0 : _h.props) || (initialData == null ? void 0 : initialData.root) || {};
|
|
9286
9309
|
const defaultedRootProps = __spreadValues(__spreadValues({}, (_i = config.root) == null ? void 0 : _i.defaultProps), rootProps);
|
|
9310
|
+
const root = populateIds(
|
|
9311
|
+
toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
|
|
9312
|
+
config
|
|
9313
|
+
);
|
|
9287
9314
|
const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
|
9288
9315
|
data: __spreadProps(__spreadValues({}, initialData), {
|
|
9289
|
-
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props:
|
|
9316
|
+
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
|
|
9290
9317
|
content: initialData.content || []
|
|
9291
9318
|
}),
|
|
9292
9319
|
ui: __spreadProps(__spreadValues(__spreadValues({}, initial), clientUiState), {
|
|
@@ -9323,7 +9350,12 @@ function PuckProvider({ children }) {
|
|
|
9323
9350
|
});
|
|
9324
9351
|
})
|
|
9325
9352
|
);
|
|
9326
|
-
const initialHistoryIndex = (
|
|
9353
|
+
const initialHistoryIndex = (0, import_react60.useMemo)(() => {
|
|
9354
|
+
if ((_initialHistory == null ? void 0 : _initialHistory.index) !== void 0 && (_initialHistory == null ? void 0 : _initialHistory.index) >= 0 && (_initialHistory == null ? void 0 : _initialHistory.index) < blendedHistories.length) {
|
|
9355
|
+
return _initialHistory == null ? void 0 : _initialHistory.index;
|
|
9356
|
+
}
|
|
9357
|
+
return blendedHistories.length - 1;
|
|
9358
|
+
}, []);
|
|
9327
9359
|
const initialAppState = blendedHistories[initialHistoryIndex].state;
|
|
9328
9360
|
const loadedOverrides = useLoadedOverrides({
|
|
9329
9361
|
overrides,
|
|
@@ -9382,7 +9414,7 @@ function PuckProvider({ children }) {
|
|
|
9382
9414
|
});
|
|
9383
9415
|
const previousData = (0, import_react60.useRef)(null);
|
|
9384
9416
|
(0, import_react60.useEffect)(() => {
|
|
9385
|
-
appStore.subscribe(
|
|
9417
|
+
return appStore.subscribe(
|
|
9386
9418
|
(s) => s.state.data,
|
|
9387
9419
|
(data) => {
|
|
9388
9420
|
if (onChange) {
|
|
@@ -9392,7 +9424,7 @@ function PuckProvider({ children }) {
|
|
|
9392
9424
|
}
|
|
9393
9425
|
}
|
|
9394
9426
|
);
|
|
9395
|
-
}, []);
|
|
9427
|
+
}, [onChange]);
|
|
9396
9428
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
9397
9429
|
const uPuckStore = useRegisterUsePuckStore(appStore);
|
|
9398
9430
|
(0, import_react60.useEffect)(() => {
|
|
@@ -9705,22 +9737,11 @@ function transformProps(data, propTransforms, config = { components: {} }) {
|
|
|
9705
9737
|
|
|
9706
9738
|
// lib/resolve-all-data.ts
|
|
9707
9739
|
init_react_import();
|
|
9708
|
-
|
|
9709
|
-
// lib/data/to-component.ts
|
|
9710
|
-
init_react_import();
|
|
9711
|
-
var toComponent = (item) => {
|
|
9712
|
-
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
9713
|
-
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
9714
|
-
type: "root"
|
|
9715
|
-
});
|
|
9716
|
-
};
|
|
9717
|
-
|
|
9718
|
-
// lib/resolve-all-data.ts
|
|
9719
9740
|
function resolveAllData(_0, _1) {
|
|
9720
9741
|
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
9721
9742
|
var _a;
|
|
9722
9743
|
const defaultedData = defaultData(data);
|
|
9723
|
-
const resolveNode = (_node) => __async(
|
|
9744
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
9724
9745
|
const node = toComponent(_node);
|
|
9725
9746
|
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
9726
9747
|
const resolved = (yield resolveComponentData(
|
|
@@ -9741,13 +9762,13 @@ function resolveAllData(_0, _1) {
|
|
|
9741
9762
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
9742
9763
|
return resolvedDeep;
|
|
9743
9764
|
});
|
|
9744
|
-
const processContent = (content) => __async(
|
|
9765
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
9745
9766
|
return Promise.all(content.map(resolveNode));
|
|
9746
9767
|
});
|
|
9747
|
-
const processZones = () => __async(
|
|
9768
|
+
const processZones = () => __async(null, null, function* () {
|
|
9748
9769
|
var _a2;
|
|
9749
9770
|
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
9750
|
-
Object.entries(zones).forEach((_02) => __async(
|
|
9771
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
9751
9772
|
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
9752
9773
|
}));
|
|
9753
9774
|
return zones;
|
|
@@ -9757,7 +9778,7 @@ function resolveAllData(_0, _1) {
|
|
|
9757
9778
|
content: yield processContent(defaultedData.content),
|
|
9758
9779
|
zones: yield processZones()
|
|
9759
9780
|
};
|
|
9760
|
-
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(
|
|
9781
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
9761
9782
|
const content = defaultedData.zones[zoneKey];
|
|
9762
9783
|
dynamic.zones[zoneKey] = yield processContent(content);
|
|
9763
9784
|
}), {});
|
|
@@ -9800,269 +9821,38 @@ classnames/index.js:
|
|
|
9800
9821
|
*)
|
|
9801
9822
|
|
|
9802
9823
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
9803
|
-
(**
|
|
9804
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9805
|
-
*
|
|
9806
|
-
* This source code is licensed under the ISC license.
|
|
9807
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9808
|
-
*)
|
|
9809
|
-
|
|
9810
9824
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
9811
|
-
(**
|
|
9812
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9813
|
-
*
|
|
9814
|
-
* This source code is licensed under the ISC license.
|
|
9815
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9816
|
-
*)
|
|
9817
|
-
|
|
9818
9825
|
lucide-react/dist/esm/Icon.js:
|
|
9819
|
-
(**
|
|
9820
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9821
|
-
*
|
|
9822
|
-
* This source code is licensed under the ISC license.
|
|
9823
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9824
|
-
*)
|
|
9825
|
-
|
|
9826
9826
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
9827
|
-
(**
|
|
9828
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9829
|
-
*
|
|
9830
|
-
* This source code is licensed under the ISC license.
|
|
9831
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9832
|
-
*)
|
|
9833
|
-
|
|
9834
9827
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
9835
|
-
(**
|
|
9836
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9837
|
-
*
|
|
9838
|
-
* This source code is licensed under the ISC license.
|
|
9839
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9840
|
-
*)
|
|
9841
|
-
|
|
9842
9828
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
9843
|
-
(**
|
|
9844
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9845
|
-
*
|
|
9846
|
-
* This source code is licensed under the ISC license.
|
|
9847
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9848
|
-
*)
|
|
9849
|
-
|
|
9850
9829
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
9851
|
-
(**
|
|
9852
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9853
|
-
*
|
|
9854
|
-
* This source code is licensed under the ISC license.
|
|
9855
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9856
|
-
*)
|
|
9857
|
-
|
|
9858
9830
|
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
9859
|
-
(**
|
|
9860
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9861
|
-
*
|
|
9862
|
-
* This source code is licensed under the ISC license.
|
|
9863
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9864
|
-
*)
|
|
9865
|
-
|
|
9866
9831
|
lucide-react/dist/esm/icons/copy.js:
|
|
9867
|
-
(**
|
|
9868
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9869
|
-
*
|
|
9870
|
-
* This source code is licensed under the ISC license.
|
|
9871
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9872
|
-
*)
|
|
9873
|
-
|
|
9874
9832
|
lucide-react/dist/esm/icons/corner-left-up.js:
|
|
9875
|
-
(**
|
|
9876
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9877
|
-
*
|
|
9878
|
-
* This source code is licensed under the ISC license.
|
|
9879
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9880
|
-
*)
|
|
9881
|
-
|
|
9882
9833
|
lucide-react/dist/esm/icons/ellipsis-vertical.js:
|
|
9883
|
-
(**
|
|
9884
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9885
|
-
*
|
|
9886
|
-
* This source code is licensed under the ISC license.
|
|
9887
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9888
|
-
*)
|
|
9889
|
-
|
|
9890
9834
|
lucide-react/dist/esm/icons/globe.js:
|
|
9891
|
-
(**
|
|
9892
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9893
|
-
*
|
|
9894
|
-
* This source code is licensed under the ISC license.
|
|
9895
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9896
|
-
*)
|
|
9897
|
-
|
|
9898
9835
|
lucide-react/dist/esm/icons/hash.js:
|
|
9899
|
-
(**
|
|
9900
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9901
|
-
*
|
|
9902
|
-
* This source code is licensed under the ISC license.
|
|
9903
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9904
|
-
*)
|
|
9905
|
-
|
|
9906
9836
|
lucide-react/dist/esm/icons/layers.js:
|
|
9907
|
-
(**
|
|
9908
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9909
|
-
*
|
|
9910
|
-
* This source code is licensed under the ISC license.
|
|
9911
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9912
|
-
*)
|
|
9913
|
-
|
|
9914
9837
|
lucide-react/dist/esm/icons/layout-grid.js:
|
|
9915
|
-
(**
|
|
9916
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9917
|
-
*
|
|
9918
|
-
* This source code is licensed under the ISC license.
|
|
9919
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9920
|
-
*)
|
|
9921
|
-
|
|
9922
9838
|
lucide-react/dist/esm/icons/link.js:
|
|
9923
|
-
(**
|
|
9924
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9925
|
-
*
|
|
9926
|
-
* This source code is licensed under the ISC license.
|
|
9927
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9928
|
-
*)
|
|
9929
|
-
|
|
9930
9839
|
lucide-react/dist/esm/icons/list.js:
|
|
9931
|
-
(**
|
|
9932
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9933
|
-
*
|
|
9934
|
-
* This source code is licensed under the ISC license.
|
|
9935
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9936
|
-
*)
|
|
9937
|
-
|
|
9938
9840
|
lucide-react/dist/esm/icons/lock-open.js:
|
|
9939
|
-
(**
|
|
9940
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9941
|
-
*
|
|
9942
|
-
* This source code is licensed under the ISC license.
|
|
9943
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9944
|
-
*)
|
|
9945
|
-
|
|
9946
9841
|
lucide-react/dist/esm/icons/lock.js:
|
|
9947
|
-
(**
|
|
9948
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9949
|
-
*
|
|
9950
|
-
* This source code is licensed under the ISC license.
|
|
9951
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9952
|
-
*)
|
|
9953
|
-
|
|
9954
9842
|
lucide-react/dist/esm/icons/monitor.js:
|
|
9955
|
-
(**
|
|
9956
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9957
|
-
*
|
|
9958
|
-
* This source code is licensed under the ISC license.
|
|
9959
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9960
|
-
*)
|
|
9961
|
-
|
|
9962
9843
|
lucide-react/dist/esm/icons/panel-left.js:
|
|
9963
|
-
(**
|
|
9964
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9965
|
-
*
|
|
9966
|
-
* This source code is licensed under the ISC license.
|
|
9967
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9968
|
-
*)
|
|
9969
|
-
|
|
9970
9844
|
lucide-react/dist/esm/icons/panel-right.js:
|
|
9971
|
-
(**
|
|
9972
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9973
|
-
*
|
|
9974
|
-
* This source code is licensed under the ISC license.
|
|
9975
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9976
|
-
*)
|
|
9977
|
-
|
|
9978
9845
|
lucide-react/dist/esm/icons/plus.js:
|
|
9979
|
-
(**
|
|
9980
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9981
|
-
*
|
|
9982
|
-
* This source code is licensed under the ISC license.
|
|
9983
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9984
|
-
*)
|
|
9985
|
-
|
|
9986
9846
|
lucide-react/dist/esm/icons/redo-2.js:
|
|
9987
|
-
(**
|
|
9988
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9989
|
-
*
|
|
9990
|
-
* This source code is licensed under the ISC license.
|
|
9991
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9992
|
-
*)
|
|
9993
|
-
|
|
9994
9847
|
lucide-react/dist/esm/icons/search.js:
|
|
9995
|
-
(**
|
|
9996
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9997
|
-
*
|
|
9998
|
-
* This source code is licensed under the ISC license.
|
|
9999
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10000
|
-
*)
|
|
10001
|
-
|
|
10002
9848
|
lucide-react/dist/esm/icons/sliders-horizontal.js:
|
|
10003
|
-
(**
|
|
10004
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10005
|
-
*
|
|
10006
|
-
* This source code is licensed under the ISC license.
|
|
10007
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10008
|
-
*)
|
|
10009
|
-
|
|
10010
9849
|
lucide-react/dist/esm/icons/smartphone.js:
|
|
10011
|
-
(**
|
|
10012
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10013
|
-
*
|
|
10014
|
-
* This source code is licensed under the ISC license.
|
|
10015
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10016
|
-
*)
|
|
10017
|
-
|
|
10018
9850
|
lucide-react/dist/esm/icons/tablet.js:
|
|
10019
|
-
(**
|
|
10020
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10021
|
-
*
|
|
10022
|
-
* This source code is licensed under the ISC license.
|
|
10023
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10024
|
-
*)
|
|
10025
|
-
|
|
10026
9851
|
lucide-react/dist/esm/icons/trash.js:
|
|
10027
|
-
(**
|
|
10028
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10029
|
-
*
|
|
10030
|
-
* This source code is licensed under the ISC license.
|
|
10031
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10032
|
-
*)
|
|
10033
|
-
|
|
10034
9852
|
lucide-react/dist/esm/icons/type.js:
|
|
10035
|
-
(**
|
|
10036
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10037
|
-
*
|
|
10038
|
-
* This source code is licensed under the ISC license.
|
|
10039
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10040
|
-
*)
|
|
10041
|
-
|
|
10042
9853
|
lucide-react/dist/esm/icons/undo-2.js:
|
|
10043
|
-
(**
|
|
10044
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10045
|
-
*
|
|
10046
|
-
* This source code is licensed under the ISC license.
|
|
10047
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10048
|
-
*)
|
|
10049
|
-
|
|
10050
9854
|
lucide-react/dist/esm/icons/zoom-in.js:
|
|
10051
|
-
(**
|
|
10052
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10053
|
-
*
|
|
10054
|
-
* This source code is licensed under the ISC license.
|
|
10055
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10056
|
-
*)
|
|
10057
|
-
|
|
10058
9855
|
lucide-react/dist/esm/icons/zoom-out.js:
|
|
10059
|
-
(**
|
|
10060
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10061
|
-
*
|
|
10062
|
-
* This source code is licensed under the ISC license.
|
|
10063
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
10064
|
-
*)
|
|
10065
|
-
|
|
10066
9856
|
lucide-react/dist/esm/lucide-react.js:
|
|
10067
9857
|
(**
|
|
10068
9858
|
* @license lucide-react v0.468.0 - ISC
|