@measured/puck 0.21.0-canary.5333fc7e → 0.21.0-canary.56c45885
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-JB4ZAK5S.mjs} +54 -267
- 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 +72 -288
- 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 +69 -285
- 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-BMbIeiqs.d.mts} +55 -43
- package/dist/{walk-tree-Ctf3FZQI.d.ts → walk-tree-BMbIeiqs.d.ts} +55 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -190,8 +190,8 @@ var require_fast_deep_equal = __commonJS({
|
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
// bundle/index.ts
|
|
193
|
-
var
|
|
194
|
-
__export(
|
|
193
|
+
var index_exports = {};
|
|
194
|
+
__export(index_exports, {
|
|
195
195
|
Action: () => Action,
|
|
196
196
|
ActionBar: () => ActionBar,
|
|
197
197
|
AutoField: () => AutoField,
|
|
@@ -216,7 +216,7 @@ __export(bundle_exports, {
|
|
|
216
216
|
usePuck: () => usePuck,
|
|
217
217
|
walkTree: () => walkTree
|
|
218
218
|
});
|
|
219
|
-
module.exports = __toCommonJS(
|
|
219
|
+
module.exports = __toCommonJS(index_exports);
|
|
220
220
|
init_react_import();
|
|
221
221
|
|
|
222
222
|
// bundle/core.ts
|
|
@@ -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
|
);
|
|
@@ -4796,12 +4807,14 @@ var DraggableComponent = ({
|
|
|
4796
4807
|
}
|
|
4797
4808
|
return cleanup;
|
|
4798
4809
|
}, [permissions.drag, zoneCompound]);
|
|
4810
|
+
const [, setRerender] = (0, import_react24.useState)(0);
|
|
4799
4811
|
const ref = (0, import_react24.useRef)(null);
|
|
4800
4812
|
const refSetter = (0, import_react24.useCallback)(
|
|
4801
4813
|
(el) => {
|
|
4802
4814
|
sortableRef(el);
|
|
4803
|
-
if (el) {
|
|
4815
|
+
if (ref.current !== el) {
|
|
4804
4816
|
ref.current = el;
|
|
4817
|
+
setRerender((update) => update + 1);
|
|
4805
4818
|
}
|
|
4806
4819
|
},
|
|
4807
4820
|
[sortableRef]
|
|
@@ -5248,7 +5261,7 @@ var import_react27 = require("react");
|
|
|
5248
5261
|
function useRenderedCallback(callback, deps) {
|
|
5249
5262
|
const manager = (0, import_react26.useDragDropManager)();
|
|
5250
5263
|
return (0, import_react27.useCallback)(
|
|
5251
|
-
(...args) => __async(
|
|
5264
|
+
(...args) => __async(null, null, function* () {
|
|
5252
5265
|
yield manager == null ? void 0 : manager.renderer.rendering;
|
|
5253
5266
|
return callback(...args);
|
|
5254
5267
|
}),
|
|
@@ -5576,26 +5589,26 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
5576
5589
|
capture: true
|
|
5577
5590
|
});
|
|
5578
5591
|
};
|
|
5579
|
-
if (
|
|
5580
|
-
el.addEventListener("focus", onFocus, { capture: true });
|
|
5581
|
-
el.addEventListener("blur", onBlur, { capture: true });
|
|
5582
|
-
} else if (disableDrag) {
|
|
5592
|
+
if (disableDrag) {
|
|
5583
5593
|
el.addEventListener("pointerdown", stopPropagation, {
|
|
5584
5594
|
capture: true
|
|
5585
5595
|
});
|
|
5596
|
+
} else if (disableDragOnFocus) {
|
|
5597
|
+
el.addEventListener("focus", onFocus, { capture: true });
|
|
5598
|
+
el.addEventListener("blur", onBlur, { capture: true });
|
|
5586
5599
|
}
|
|
5587
5600
|
el.setAttribute("data-puck-overlay-portal", "true");
|
|
5588
5601
|
return () => {
|
|
5589
5602
|
el.removeEventListener("mouseover", stopPropagation, {
|
|
5590
5603
|
capture: true
|
|
5591
5604
|
});
|
|
5592
|
-
if (
|
|
5593
|
-
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5594
|
-
el.removeEventListener("blur", onFocus, { capture: true });
|
|
5595
|
-
} else if (disableDrag) {
|
|
5605
|
+
if (disableDrag) {
|
|
5596
5606
|
el.removeEventListener("pointerdown", stopPropagation, {
|
|
5597
5607
|
capture: true
|
|
5598
5608
|
});
|
|
5609
|
+
} else if (disableDragOnFocus) {
|
|
5610
|
+
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5611
|
+
el.removeEventListener("blur", onBlur, { capture: true });
|
|
5599
5612
|
}
|
|
5600
5613
|
el.removeAttribute("data-puck-overlay-portal");
|
|
5601
5614
|
};
|
|
@@ -5677,7 +5690,7 @@ var InlineTextFieldInternal = ({
|
|
|
5677
5690
|
ref.current.replaceChildren(value);
|
|
5678
5691
|
}
|
|
5679
5692
|
const cleanupPortal = registerOverlayPortal(ref.current);
|
|
5680
|
-
const handleInput = (e) => __async(
|
|
5693
|
+
const handleInput = (e) => __async(null, null, function* () {
|
|
5681
5694
|
var _a2;
|
|
5682
5695
|
const appStore2 = appStoreApi.getState();
|
|
5683
5696
|
const node = appStore2.state.indexes.nodes[componentId];
|
|
@@ -6501,7 +6514,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
|
6501
6514
|
|
|
6502
6515
|
// lib/insert-component.ts
|
|
6503
6516
|
init_react_import();
|
|
6504
|
-
var insertComponent = (componentType, zone, index, appStore) => __async(
|
|
6517
|
+
var insertComponent = (componentType, zone, index, appStore) => __async(null, null, function* () {
|
|
6505
6518
|
const id = generateId(componentType);
|
|
6506
6519
|
const insertActionData = {
|
|
6507
6520
|
type: "insert",
|
|
@@ -7209,7 +7222,7 @@ var DefaultFields = ({
|
|
|
7209
7222
|
}) => {
|
|
7210
7223
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children });
|
|
7211
7224
|
};
|
|
7212
|
-
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(
|
|
7225
|
+
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
|
|
7213
7226
|
let currentProps;
|
|
7214
7227
|
const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
|
|
7215
7228
|
const { data, ui } = state;
|
|
@@ -7578,7 +7591,7 @@ var CopyHostStyles = ({
|
|
|
7578
7591
|
let elements = [];
|
|
7579
7592
|
const hashes = {};
|
|
7580
7593
|
const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
|
|
7581
|
-
const mirrorEl = (el, inlineStyles = false) => __async(
|
|
7594
|
+
const mirrorEl = (el, inlineStyles = false) => __async(null, null, function* () {
|
|
7582
7595
|
let mirror;
|
|
7583
7596
|
if (el.nodeName === "LINK" && inlineStyles) {
|
|
7584
7597
|
mirror = document.createElement("style");
|
|
@@ -7610,7 +7623,7 @@ var CopyHostStyles = ({
|
|
|
7610
7623
|
}
|
|
7611
7624
|
return mirror;
|
|
7612
7625
|
});
|
|
7613
|
-
const addEl = (el) => __async(
|
|
7626
|
+
const addEl = (el) => __async(null, null, function* () {
|
|
7614
7627
|
const index = lookupEl(el);
|
|
7615
7628
|
if (index > -1) {
|
|
7616
7629
|
if (debug)
|
|
@@ -7683,7 +7696,7 @@ var CopyHostStyles = ({
|
|
|
7683
7696
|
const parentBody = parentDocument.getElementsByTagName("body")[0];
|
|
7684
7697
|
syncAttributes(parentBody, doc.body);
|
|
7685
7698
|
Promise.all(
|
|
7686
|
-
collectedStyles.map((styleNode, i) => __async(
|
|
7699
|
+
collectedStyles.map((styleNode, i) => __async(null, null, function* () {
|
|
7687
7700
|
if (styleNode.nodeName === "LINK") {
|
|
7688
7701
|
const linkHref = styleNode.href;
|
|
7689
7702
|
if (hrefs.indexOf(linkHref) > -1) {
|
|
@@ -8758,7 +8771,7 @@ function createUsePuck() {
|
|
|
8758
8771
|
}
|
|
8759
8772
|
const result = (0, import_zustand6.useStore)(
|
|
8760
8773
|
usePuckApi,
|
|
8761
|
-
selector != null ? selector : (s) => s
|
|
8774
|
+
selector != null ? selector : ((s) => s)
|
|
8762
8775
|
);
|
|
8763
8776
|
return result;
|
|
8764
8777
|
};
|
|
@@ -9208,6 +9221,15 @@ function useSidebarResize(position, dispatch) {
|
|
|
9208
9221
|
};
|
|
9209
9222
|
}
|
|
9210
9223
|
|
|
9224
|
+
// lib/data/to-component.ts
|
|
9225
|
+
init_react_import();
|
|
9226
|
+
var toComponent = (item) => {
|
|
9227
|
+
return "type" in item ? item : __spreadProps(__spreadValues({}, item), {
|
|
9228
|
+
props: __spreadProps(__spreadValues({}, item.props), { id: "root" }),
|
|
9229
|
+
type: "root"
|
|
9230
|
+
});
|
|
9231
|
+
};
|
|
9232
|
+
|
|
9211
9233
|
// components/Puck/index.tsx
|
|
9212
9234
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9213
9235
|
var getClassName31 = get_class_name_factory_default("Puck", styles_module_default15);
|
|
@@ -9284,9 +9306,13 @@ function PuckProvider({ children }) {
|
|
|
9284
9306
|
}
|
|
9285
9307
|
const rootProps = ((_h = initialData == null ? void 0 : initialData.root) == null ? void 0 : _h.props) || (initialData == null ? void 0 : initialData.root) || {};
|
|
9286
9308
|
const defaultedRootProps = __spreadValues(__spreadValues({}, (_i = config.root) == null ? void 0 : _i.defaultProps), rootProps);
|
|
9309
|
+
const root = populateIds(
|
|
9310
|
+
toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
|
|
9311
|
+
config
|
|
9312
|
+
);
|
|
9287
9313
|
const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
|
9288
9314
|
data: __spreadProps(__spreadValues({}, initialData), {
|
|
9289
|
-
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props:
|
|
9315
|
+
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
|
|
9290
9316
|
content: initialData.content || []
|
|
9291
9317
|
}),
|
|
9292
9318
|
ui: __spreadProps(__spreadValues(__spreadValues({}, initial), clientUiState), {
|
|
@@ -9382,7 +9408,7 @@ function PuckProvider({ children }) {
|
|
|
9382
9408
|
});
|
|
9383
9409
|
const previousData = (0, import_react60.useRef)(null);
|
|
9384
9410
|
(0, import_react60.useEffect)(() => {
|
|
9385
|
-
appStore.subscribe(
|
|
9411
|
+
return appStore.subscribe(
|
|
9386
9412
|
(s) => s.state.data,
|
|
9387
9413
|
(data) => {
|
|
9388
9414
|
if (onChange) {
|
|
@@ -9392,7 +9418,7 @@ function PuckProvider({ children }) {
|
|
|
9392
9418
|
}
|
|
9393
9419
|
}
|
|
9394
9420
|
);
|
|
9395
|
-
}, []);
|
|
9421
|
+
}, [onChange]);
|
|
9396
9422
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
9397
9423
|
const uPuckStore = useRegisterUsePuckStore(appStore);
|
|
9398
9424
|
(0, import_react60.useEffect)(() => {
|
|
@@ -9705,22 +9731,11 @@ function transformProps(data, propTransforms, config = { components: {} }) {
|
|
|
9705
9731
|
|
|
9706
9732
|
// lib/resolve-all-data.ts
|
|
9707
9733
|
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
9734
|
function resolveAllData(_0, _1) {
|
|
9720
9735
|
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
9721
9736
|
var _a;
|
|
9722
9737
|
const defaultedData = defaultData(data);
|
|
9723
|
-
const resolveNode = (_node) => __async(
|
|
9738
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
9724
9739
|
const node = toComponent(_node);
|
|
9725
9740
|
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
9726
9741
|
const resolved = (yield resolveComponentData(
|
|
@@ -9741,13 +9756,13 @@ function resolveAllData(_0, _1) {
|
|
|
9741
9756
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
9742
9757
|
return resolvedDeep;
|
|
9743
9758
|
});
|
|
9744
|
-
const processContent = (content) => __async(
|
|
9759
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
9745
9760
|
return Promise.all(content.map(resolveNode));
|
|
9746
9761
|
});
|
|
9747
|
-
const processZones = () => __async(
|
|
9762
|
+
const processZones = () => __async(null, null, function* () {
|
|
9748
9763
|
var _a2;
|
|
9749
9764
|
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
9750
|
-
Object.entries(zones).forEach((_02) => __async(
|
|
9765
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
9751
9766
|
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
9752
9767
|
}));
|
|
9753
9768
|
return zones;
|
|
@@ -9757,7 +9772,7 @@ function resolveAllData(_0, _1) {
|
|
|
9757
9772
|
content: yield processContent(defaultedData.content),
|
|
9758
9773
|
zones: yield processZones()
|
|
9759
9774
|
};
|
|
9760
|
-
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(
|
|
9775
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
9761
9776
|
const content = defaultedData.zones[zoneKey];
|
|
9762
9777
|
dynamic.zones[zoneKey] = yield processContent(content);
|
|
9763
9778
|
}), {});
|
|
@@ -9800,269 +9815,38 @@ classnames/index.js:
|
|
|
9800
9815
|
*)
|
|
9801
9816
|
|
|
9802
9817
|
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
9818
|
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
9819
|
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
9820
|
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
9821
|
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
9822
|
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
9823
|
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
9824
|
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
9825
|
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
9826
|
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
9827
|
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
9828
|
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
9829
|
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
9830
|
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
9831
|
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
9832
|
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
9833
|
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
9834
|
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
9835
|
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
9836
|
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
9837
|
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
9838
|
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
9839
|
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
9840
|
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
9841
|
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
9842
|
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
9843
|
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
9844
|
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
9845
|
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
9846
|
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
9847
|
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
9848
|
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
9849
|
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
9850
|
lucide-react/dist/esm/lucide-react.js:
|
|
10067
9851
|
(**
|
|
10068
9852
|
* @license lucide-react v0.468.0 - ISC
|
package/dist/index.mjs
CHANGED
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
setDeep,
|
|
19
19
|
useGetPuck,
|
|
20
20
|
usePuck
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JB4ZAK5S.mjs";
|
|
22
22
|
import {
|
|
23
23
|
init_react_import,
|
|
24
24
|
migrate,
|
|
25
25
|
resolveAllData,
|
|
26
26
|
transformProps,
|
|
27
27
|
walkTree
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-TC25DCTQ.mjs";
|
|
29
29
|
|
|
30
30
|
// bundle/index.ts
|
|
31
31
|
init_react_import();
|