@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
|
@@ -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-TC25DCTQ.mjs";
|
|
28
29
|
|
|
29
30
|
// ../../node_modules/classnames/index.js
|
|
30
31
|
var require_classnames = __commonJS({
|
|
@@ -1070,10 +1071,10 @@ var flattenData = (state, config) => {
|
|
|
1070
1071
|
|
|
1071
1072
|
// store/slices/permissions.ts
|
|
1072
1073
|
var createPermissionsSlice = (set, get) => {
|
|
1073
|
-
const resolvePermissions = (..._0) => __async(
|
|
1074
|
+
const resolvePermissions = (..._0) => __async(null, [..._0], function* (params = {}, force) {
|
|
1074
1075
|
const { state, permissions, config } = get();
|
|
1075
1076
|
const { cache, globalPermissions } = permissions;
|
|
1076
|
-
const resolveDataForItem = (item2, force2 = false) => __async(
|
|
1077
|
+
const resolveDataForItem = (item2, force2 = false) => __async(null, null, function* () {
|
|
1077
1078
|
var _a, _b, _c;
|
|
1078
1079
|
const { config: config2, state: appState, setComponentLoading } = get();
|
|
1079
1080
|
const componentConfig = item2.type === "root" ? config2.root : config2.components[item2.type];
|
|
@@ -1128,13 +1129,13 @@ var createPermissionsSlice = (set, get) => {
|
|
|
1128
1129
|
if (item) {
|
|
1129
1130
|
yield resolveDataForItem(item, force);
|
|
1130
1131
|
} else if (type) {
|
|
1131
|
-
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* () {
|
|
1132
1133
|
yield resolveDataForItem(item2, force);
|
|
1133
1134
|
}));
|
|
1134
1135
|
} else if (root) {
|
|
1135
1136
|
resolveDataForRoot(force);
|
|
1136
1137
|
} else {
|
|
1137
|
-
flattenData(state, config).map((item2) => __async(
|
|
1138
|
+
flattenData(state, config).map((item2) => __async(null, null, function* () {
|
|
1138
1139
|
yield resolveDataForItem(item2, force);
|
|
1139
1140
|
}));
|
|
1140
1141
|
}
|
|
@@ -1215,7 +1216,7 @@ var createFieldsSlice = (_set, _get) => {
|
|
|
1215
1216
|
};
|
|
1216
1217
|
var useRegisterFieldsSlice = (appStore, id) => {
|
|
1217
1218
|
const resolveFields = useCallback(
|
|
1218
|
-
(reset) => __async(
|
|
1219
|
+
(reset) => __async(null, null, function* () {
|
|
1219
1220
|
var _a, _b;
|
|
1220
1221
|
const { fields, lastResolvedData } = appStore.getState().fields;
|
|
1221
1222
|
const metadata = appStore.getState().metadata;
|
|
@@ -1415,7 +1416,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1415
1416
|
const selectedItem = state.ui.itemSelector ? getItem(state.ui.itemSelector, state) : null;
|
|
1416
1417
|
return __spreadProps(__spreadValues({}, s), { state, selectedItem });
|
|
1417
1418
|
}),
|
|
1418
|
-
resolveComponentData: (componentData, trigger) => __async(
|
|
1419
|
+
resolveComponentData: (componentData, trigger) => __async(null, null, function* () {
|
|
1419
1420
|
const { config, metadata, setComponentLoading, permissions } = get();
|
|
1420
1421
|
const timeouts = {};
|
|
1421
1422
|
return yield resolveComponentData(
|
|
@@ -1426,7 +1427,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1426
1427
|
const id = "id" in item.props ? item.props.id : "root";
|
|
1427
1428
|
timeouts[id] = setComponentLoading(id, true, 50);
|
|
1428
1429
|
},
|
|
1429
|
-
(item) => __async(
|
|
1430
|
+
(item) => __async(null, null, function* () {
|
|
1430
1431
|
const id = "id" in item.props ? item.props.id : "root";
|
|
1431
1432
|
if ("type" in item) {
|
|
1432
1433
|
yield permissions.refreshPermissions({ item });
|
|
@@ -1438,7 +1439,7 @@ var createAppStore = (initialAppStore) => create2()(
|
|
|
1438
1439
|
trigger
|
|
1439
1440
|
);
|
|
1440
1441
|
}),
|
|
1441
|
-
resolveAndCommitData: () => __async(
|
|
1442
|
+
resolveAndCommitData: () => __async(null, null, function* () {
|
|
1442
1443
|
const { config, state, dispatch, resolveComponentData: resolveComponentData2 } = get();
|
|
1443
1444
|
walkAppState(
|
|
1444
1445
|
state,
|
|
@@ -2459,7 +2460,7 @@ var collisionStore = createStore(() => ({
|
|
|
2459
2460
|
|
|
2460
2461
|
// lib/dnd/collision/dynamic/index.ts
|
|
2461
2462
|
var flushNext = "";
|
|
2462
|
-
var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input) => {
|
|
2463
|
+
var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => ((input) => {
|
|
2463
2464
|
var _a, _b, _c, _d, _e;
|
|
2464
2465
|
const { dragOperation, droppable } = input;
|
|
2465
2466
|
const { position } = dragOperation;
|
|
@@ -2552,7 +2553,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
|
|
|
2552
2553
|
}
|
|
2553
2554
|
collisionDebug(dragCenter, dropCenter, droppable.id.toString(), "hotpink");
|
|
2554
2555
|
return null;
|
|
2555
|
-
};
|
|
2556
|
+
});
|
|
2556
2557
|
|
|
2557
2558
|
// components/Sortable/index.tsx
|
|
2558
2559
|
import { useSortable } from "@dnd-kit/react/sortable";
|
|
@@ -2985,8 +2986,9 @@ var ArrayField = ({
|
|
|
2985
2986
|
var _a;
|
|
2986
2987
|
if (isDraggingAny) return;
|
|
2987
2988
|
const existingValue = value || [];
|
|
2989
|
+
const defaultProps = typeof field.defaultItemProps === "function" ? field.defaultItemProps(existingValue.length) : (_a = field.defaultItemProps) != null ? _a : {};
|
|
2988
2990
|
const newItem = defaultSlots(
|
|
2989
|
-
uniqifyItem(
|
|
2991
|
+
uniqifyItem(defaultProps),
|
|
2990
2992
|
field.arrayFields
|
|
2991
2993
|
);
|
|
2992
2994
|
const newValue = [...existingValue, newItem];
|
|
@@ -3161,11 +3163,13 @@ var ExternalInput = ({
|
|
|
3161
3163
|
id,
|
|
3162
3164
|
readOnly
|
|
3163
3165
|
}) => {
|
|
3166
|
+
var _a;
|
|
3164
3167
|
const {
|
|
3165
3168
|
mapProp = (val) => val,
|
|
3166
3169
|
mapRow = (val) => val,
|
|
3167
3170
|
filterFields
|
|
3168
3171
|
} = field || {};
|
|
3172
|
+
const { enabled: shouldCacheData } = (_a = field.cache) != null ? _a : { enabled: true };
|
|
3169
3173
|
const [data, setData] = useState6([]);
|
|
3170
3174
|
const [isOpen, setOpen] = useState6(false);
|
|
3171
3175
|
const [isLoading, setIsLoading] = useState6(true);
|
|
@@ -3188,14 +3192,21 @@ var ExternalInput = ({
|
|
|
3188
3192
|
}, [mappedData]);
|
|
3189
3193
|
const [searchQuery, setSearchQuery] = useState6(field.initialQuery || "");
|
|
3190
3194
|
const search = useCallback3(
|
|
3191
|
-
(query, filters2) => __async(
|
|
3195
|
+
(query, filters2) => __async(null, null, function* () {
|
|
3192
3196
|
setIsLoading(true);
|
|
3193
3197
|
const cacheKey = `${id}-${query}-${JSON.stringify(filters2)}`;
|
|
3194
|
-
|
|
3198
|
+
let listData;
|
|
3199
|
+
if (shouldCacheData && dataCache[cacheKey]) {
|
|
3200
|
+
listData = dataCache[cacheKey];
|
|
3201
|
+
} else {
|
|
3202
|
+
listData = yield field.fetchList({ query, filters: filters2 });
|
|
3203
|
+
}
|
|
3195
3204
|
if (listData) {
|
|
3196
3205
|
setData(listData);
|
|
3197
3206
|
setIsLoading(false);
|
|
3198
|
-
|
|
3207
|
+
if (shouldCacheData) {
|
|
3208
|
+
dataCache[cacheKey] = listData;
|
|
3209
|
+
}
|
|
3199
3210
|
}
|
|
3200
3211
|
}),
|
|
3201
3212
|
[id, field]
|
|
@@ -3259,6 +3270,7 @@ var ExternalInput = ({
|
|
|
3259
3270
|
}),
|
|
3260
3271
|
onSubmit: (e) => {
|
|
3261
3272
|
e.preventDefault();
|
|
3273
|
+
e.stopPropagation();
|
|
3262
3274
|
search(searchQuery, filters);
|
|
3263
3275
|
},
|
|
3264
3276
|
children: [
|
|
@@ -3406,7 +3418,7 @@ var ExternalField = ({
|
|
|
3406
3418
|
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
|
|
3407
3419
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
|
3408
3420
|
mapRow: validField.mapRow,
|
|
3409
|
-
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(
|
|
3421
|
+
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(null, null, function* () {
|
|
3410
3422
|
return yield deprecatedField.adaptor.fetchList(
|
|
3411
3423
|
deprecatedField.adaptorParams
|
|
3412
3424
|
);
|
|
@@ -4169,12 +4181,14 @@ var DraggableComponent = ({
|
|
|
4169
4181
|
}
|
|
4170
4182
|
return cleanup;
|
|
4171
4183
|
}, [permissions.drag, zoneCompound]);
|
|
4184
|
+
const [, setRerender] = useState10(0);
|
|
4172
4185
|
const ref = useRef2(null);
|
|
4173
4186
|
const refSetter = useCallback7(
|
|
4174
4187
|
(el) => {
|
|
4175
4188
|
sortableRef(el);
|
|
4176
|
-
if (el) {
|
|
4189
|
+
if (ref.current !== el) {
|
|
4177
4190
|
ref.current = el;
|
|
4191
|
+
setRerender((update) => update + 1);
|
|
4178
4192
|
}
|
|
4179
4193
|
},
|
|
4180
4194
|
[sortableRef]
|
|
@@ -4829,7 +4843,7 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
|
4829
4843
|
|
|
4830
4844
|
// lib/insert-component.ts
|
|
4831
4845
|
init_react_import();
|
|
4832
|
-
var insertComponent = (componentType, zone, index, appStore) => __async(
|
|
4846
|
+
var insertComponent = (componentType, zone, index, appStore) => __async(null, null, function* () {
|
|
4833
4847
|
const id = generateId(componentType);
|
|
4834
4848
|
const insertActionData = {
|
|
4835
4849
|
type: "insert",
|
|
@@ -5513,7 +5527,7 @@ import { useCallback as useCallback9 } from "react";
|
|
|
5513
5527
|
function useRenderedCallback(callback, deps) {
|
|
5514
5528
|
const manager = useDragDropManager();
|
|
5515
5529
|
return useCallback9(
|
|
5516
|
-
(...args) => __async(
|
|
5530
|
+
(...args) => __async(null, null, function* () {
|
|
5517
5531
|
yield manager == null ? void 0 : manager.renderer.rendering;
|
|
5518
5532
|
return callback(...args);
|
|
5519
5533
|
}),
|
|
@@ -5679,26 +5693,26 @@ var registerOverlayPortal = (el, opts = {}) => {
|
|
|
5679
5693
|
capture: true
|
|
5680
5694
|
});
|
|
5681
5695
|
};
|
|
5682
|
-
if (
|
|
5683
|
-
el.addEventListener("focus", onFocus, { capture: true });
|
|
5684
|
-
el.addEventListener("blur", onBlur, { capture: true });
|
|
5685
|
-
} else if (disableDrag) {
|
|
5696
|
+
if (disableDrag) {
|
|
5686
5697
|
el.addEventListener("pointerdown", stopPropagation, {
|
|
5687
5698
|
capture: true
|
|
5688
5699
|
});
|
|
5700
|
+
} else if (disableDragOnFocus) {
|
|
5701
|
+
el.addEventListener("focus", onFocus, { capture: true });
|
|
5702
|
+
el.addEventListener("blur", onBlur, { capture: true });
|
|
5689
5703
|
}
|
|
5690
5704
|
el.setAttribute("data-puck-overlay-portal", "true");
|
|
5691
5705
|
return () => {
|
|
5692
5706
|
el.removeEventListener("mouseover", stopPropagation, {
|
|
5693
5707
|
capture: true
|
|
5694
5708
|
});
|
|
5695
|
-
if (
|
|
5696
|
-
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5697
|
-
el.removeEventListener("blur", onFocus, { capture: true });
|
|
5698
|
-
} else if (disableDrag) {
|
|
5709
|
+
if (disableDrag) {
|
|
5699
5710
|
el.removeEventListener("pointerdown", stopPropagation, {
|
|
5700
5711
|
capture: true
|
|
5701
5712
|
});
|
|
5713
|
+
} else if (disableDragOnFocus) {
|
|
5714
|
+
el.removeEventListener("focus", onFocus, { capture: true });
|
|
5715
|
+
el.removeEventListener("blur", onBlur, { capture: true });
|
|
5702
5716
|
}
|
|
5703
5717
|
el.removeAttribute("data-puck-overlay-portal");
|
|
5704
5718
|
};
|
|
@@ -5780,7 +5794,7 @@ var InlineTextFieldInternal = ({
|
|
|
5780
5794
|
ref.current.replaceChildren(value);
|
|
5781
5795
|
}
|
|
5782
5796
|
const cleanupPortal = registerOverlayPortal(ref.current);
|
|
5783
|
-
const handleInput = (e) => __async(
|
|
5797
|
+
const handleInput = (e) => __async(null, null, function* () {
|
|
5784
5798
|
var _a2;
|
|
5785
5799
|
const appStore2 = appStoreApi.getState();
|
|
5786
5800
|
const node = appStore2.state.indexes.nodes[componentId];
|
|
@@ -6441,7 +6455,7 @@ function createUsePuck() {
|
|
|
6441
6455
|
}
|
|
6442
6456
|
const result = useStore3(
|
|
6443
6457
|
usePuckApi,
|
|
6444
|
-
selector != null ? selector : (s) => s
|
|
6458
|
+
selector != null ? selector : ((s) => s)
|
|
6445
6459
|
);
|
|
6446
6460
|
return result;
|
|
6447
6461
|
};
|
|
@@ -6588,7 +6602,7 @@ var DefaultFields = ({
|
|
|
6588
6602
|
}) => {
|
|
6589
6603
|
return /* @__PURE__ */ jsx29(Fragment8, { children });
|
|
6590
6604
|
};
|
|
6591
|
-
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(
|
|
6605
|
+
var createOnChange = (fieldName, appStore) => (value, updatedUi) => __async(null, null, function* () {
|
|
6592
6606
|
let currentProps;
|
|
6593
6607
|
const { dispatch, state, selectedItem, resolveComponentData: resolveComponentData2 } = appStore.getState();
|
|
6594
6608
|
const { data, ui } = state;
|
|
@@ -6962,7 +6976,7 @@ var CopyHostStyles = ({
|
|
|
6962
6976
|
let elements = [];
|
|
6963
6977
|
const hashes = {};
|
|
6964
6978
|
const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
|
|
6965
|
-
const mirrorEl = (el, inlineStyles = false) => __async(
|
|
6979
|
+
const mirrorEl = (el, inlineStyles = false) => __async(null, null, function* () {
|
|
6966
6980
|
let mirror;
|
|
6967
6981
|
if (el.nodeName === "LINK" && inlineStyles) {
|
|
6968
6982
|
mirror = document.createElement("style");
|
|
@@ -6994,7 +7008,7 @@ var CopyHostStyles = ({
|
|
|
6994
7008
|
}
|
|
6995
7009
|
return mirror;
|
|
6996
7010
|
});
|
|
6997
|
-
const addEl = (el) => __async(
|
|
7011
|
+
const addEl = (el) => __async(null, null, function* () {
|
|
6998
7012
|
const index = lookupEl(el);
|
|
6999
7013
|
if (index > -1) {
|
|
7000
7014
|
if (debug)
|
|
@@ -7067,7 +7081,7 @@ var CopyHostStyles = ({
|
|
|
7067
7081
|
const parentBody = parentDocument.getElementsByTagName("body")[0];
|
|
7068
7082
|
syncAttributes(parentBody, doc.body);
|
|
7069
7083
|
Promise.all(
|
|
7070
|
-
collectedStyles.map((styleNode, i) => __async(
|
|
7084
|
+
collectedStyles.map((styleNode, i) => __async(null, null, function* () {
|
|
7071
7085
|
if (styleNode.nodeName === "LINK") {
|
|
7072
7086
|
const linkHref = styleNode.href;
|
|
7073
7087
|
if (hrefs.indexOf(linkHref) > -1) {
|
|
@@ -8592,9 +8606,13 @@ function PuckProvider({ children }) {
|
|
|
8592
8606
|
}
|
|
8593
8607
|
const rootProps = ((_h = initialData == null ? void 0 : initialData.root) == null ? void 0 : _h.props) || (initialData == null ? void 0 : initialData.root) || {};
|
|
8594
8608
|
const defaultedRootProps = __spreadValues(__spreadValues({}, (_i = config.root) == null ? void 0 : _i.defaultProps), rootProps);
|
|
8609
|
+
const root = populateIds(
|
|
8610
|
+
toComponent(__spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: defaultedRootProps })),
|
|
8611
|
+
config
|
|
8612
|
+
);
|
|
8595
8613
|
const newAppState = __spreadProps(__spreadValues({}, defaultAppState), {
|
|
8596
8614
|
data: __spreadProps(__spreadValues({}, initialData), {
|
|
8597
|
-
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props:
|
|
8615
|
+
root: __spreadProps(__spreadValues({}, initialData == null ? void 0 : initialData.root), { props: root.props }),
|
|
8598
8616
|
content: initialData.content || []
|
|
8599
8617
|
}),
|
|
8600
8618
|
ui: __spreadProps(__spreadValues(__spreadValues({}, initial), clientUiState), {
|
|
@@ -8690,7 +8708,7 @@ function PuckProvider({ children }) {
|
|
|
8690
8708
|
});
|
|
8691
8709
|
const previousData = useRef12(null);
|
|
8692
8710
|
useEffect29(() => {
|
|
8693
|
-
appStore.subscribe(
|
|
8711
|
+
return appStore.subscribe(
|
|
8694
8712
|
(s) => s.state.data,
|
|
8695
8713
|
(data) => {
|
|
8696
8714
|
if (onChange) {
|
|
@@ -8700,7 +8718,7 @@ function PuckProvider({ children }) {
|
|
|
8700
8718
|
}
|
|
8701
8719
|
}
|
|
8702
8720
|
);
|
|
8703
|
-
}, []);
|
|
8721
|
+
}, [onChange]);
|
|
8704
8722
|
useRegisterPermissionsSlice(appStore, permissions);
|
|
8705
8723
|
const uPuckStore = useRegisterUsePuckStore(appStore);
|
|
8706
8724
|
useEffect29(() => {
|
|
@@ -8916,269 +8934,38 @@ classnames/index.js:
|
|
|
8916
8934
|
*)
|
|
8917
8935
|
|
|
8918
8936
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
8919
|
-
(**
|
|
8920
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8921
|
-
*
|
|
8922
|
-
* This source code is licensed under the ISC license.
|
|
8923
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8924
|
-
*)
|
|
8925
|
-
|
|
8926
8937
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
8927
|
-
(**
|
|
8928
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8929
|
-
*
|
|
8930
|
-
* This source code is licensed under the ISC license.
|
|
8931
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8932
|
-
*)
|
|
8933
|
-
|
|
8934
8938
|
lucide-react/dist/esm/Icon.js:
|
|
8935
|
-
(**
|
|
8936
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8937
|
-
*
|
|
8938
|
-
* This source code is licensed under the ISC license.
|
|
8939
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8940
|
-
*)
|
|
8941
|
-
|
|
8942
8939
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
8943
|
-
(**
|
|
8944
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8945
|
-
*
|
|
8946
|
-
* This source code is licensed under the ISC license.
|
|
8947
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8948
|
-
*)
|
|
8949
|
-
|
|
8950
8940
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
8951
|
-
(**
|
|
8952
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8953
|
-
*
|
|
8954
|
-
* This source code is licensed under the ISC license.
|
|
8955
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8956
|
-
*)
|
|
8957
|
-
|
|
8958
8941
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
8959
|
-
(**
|
|
8960
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8961
|
-
*
|
|
8962
|
-
* This source code is licensed under the ISC license.
|
|
8963
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8964
|
-
*)
|
|
8965
|
-
|
|
8966
8942
|
lucide-react/dist/esm/icons/chevron-up.js:
|
|
8967
|
-
(**
|
|
8968
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8969
|
-
*
|
|
8970
|
-
* This source code is licensed under the ISC license.
|
|
8971
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8972
|
-
*)
|
|
8973
|
-
|
|
8974
8943
|
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
8975
|
-
(**
|
|
8976
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8977
|
-
*
|
|
8978
|
-
* This source code is licensed under the ISC license.
|
|
8979
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8980
|
-
*)
|
|
8981
|
-
|
|
8982
8944
|
lucide-react/dist/esm/icons/copy.js:
|
|
8983
|
-
(**
|
|
8984
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8985
|
-
*
|
|
8986
|
-
* This source code is licensed under the ISC license.
|
|
8987
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8988
|
-
*)
|
|
8989
|
-
|
|
8990
8945
|
lucide-react/dist/esm/icons/corner-left-up.js:
|
|
8991
|
-
(**
|
|
8992
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8993
|
-
*
|
|
8994
|
-
* This source code is licensed under the ISC license.
|
|
8995
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8996
|
-
*)
|
|
8997
|
-
|
|
8998
8946
|
lucide-react/dist/esm/icons/ellipsis-vertical.js:
|
|
8999
|
-
(**
|
|
9000
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9001
|
-
*
|
|
9002
|
-
* This source code is licensed under the ISC license.
|
|
9003
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9004
|
-
*)
|
|
9005
|
-
|
|
9006
8947
|
lucide-react/dist/esm/icons/globe.js:
|
|
9007
|
-
(**
|
|
9008
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9009
|
-
*
|
|
9010
|
-
* This source code is licensed under the ISC license.
|
|
9011
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9012
|
-
*)
|
|
9013
|
-
|
|
9014
8948
|
lucide-react/dist/esm/icons/hash.js:
|
|
9015
|
-
(**
|
|
9016
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9017
|
-
*
|
|
9018
|
-
* This source code is licensed under the ISC license.
|
|
9019
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9020
|
-
*)
|
|
9021
|
-
|
|
9022
8949
|
lucide-react/dist/esm/icons/layers.js:
|
|
9023
|
-
(**
|
|
9024
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9025
|
-
*
|
|
9026
|
-
* This source code is licensed under the ISC license.
|
|
9027
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9028
|
-
*)
|
|
9029
|
-
|
|
9030
8950
|
lucide-react/dist/esm/icons/layout-grid.js:
|
|
9031
|
-
(**
|
|
9032
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9033
|
-
*
|
|
9034
|
-
* This source code is licensed under the ISC license.
|
|
9035
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9036
|
-
*)
|
|
9037
|
-
|
|
9038
8951
|
lucide-react/dist/esm/icons/link.js:
|
|
9039
|
-
(**
|
|
9040
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9041
|
-
*
|
|
9042
|
-
* This source code is licensed under the ISC license.
|
|
9043
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9044
|
-
*)
|
|
9045
|
-
|
|
9046
8952
|
lucide-react/dist/esm/icons/list.js:
|
|
9047
|
-
(**
|
|
9048
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9049
|
-
*
|
|
9050
|
-
* This source code is licensed under the ISC license.
|
|
9051
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9052
|
-
*)
|
|
9053
|
-
|
|
9054
8953
|
lucide-react/dist/esm/icons/lock-open.js:
|
|
9055
|
-
(**
|
|
9056
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9057
|
-
*
|
|
9058
|
-
* This source code is licensed under the ISC license.
|
|
9059
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9060
|
-
*)
|
|
9061
|
-
|
|
9062
8954
|
lucide-react/dist/esm/icons/lock.js:
|
|
9063
|
-
(**
|
|
9064
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9065
|
-
*
|
|
9066
|
-
* This source code is licensed under the ISC license.
|
|
9067
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9068
|
-
*)
|
|
9069
|
-
|
|
9070
8955
|
lucide-react/dist/esm/icons/monitor.js:
|
|
9071
|
-
(**
|
|
9072
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9073
|
-
*
|
|
9074
|
-
* This source code is licensed under the ISC license.
|
|
9075
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9076
|
-
*)
|
|
9077
|
-
|
|
9078
8956
|
lucide-react/dist/esm/icons/panel-left.js:
|
|
9079
|
-
(**
|
|
9080
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9081
|
-
*
|
|
9082
|
-
* This source code is licensed under the ISC license.
|
|
9083
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9084
|
-
*)
|
|
9085
|
-
|
|
9086
8957
|
lucide-react/dist/esm/icons/panel-right.js:
|
|
9087
|
-
(**
|
|
9088
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9089
|
-
*
|
|
9090
|
-
* This source code is licensed under the ISC license.
|
|
9091
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9092
|
-
*)
|
|
9093
|
-
|
|
9094
8958
|
lucide-react/dist/esm/icons/plus.js:
|
|
9095
|
-
(**
|
|
9096
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9097
|
-
*
|
|
9098
|
-
* This source code is licensed under the ISC license.
|
|
9099
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9100
|
-
*)
|
|
9101
|
-
|
|
9102
8959
|
lucide-react/dist/esm/icons/redo-2.js:
|
|
9103
|
-
(**
|
|
9104
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9105
|
-
*
|
|
9106
|
-
* This source code is licensed under the ISC license.
|
|
9107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9108
|
-
*)
|
|
9109
|
-
|
|
9110
8960
|
lucide-react/dist/esm/icons/search.js:
|
|
9111
|
-
(**
|
|
9112
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9113
|
-
*
|
|
9114
|
-
* This source code is licensed under the ISC license.
|
|
9115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9116
|
-
*)
|
|
9117
|
-
|
|
9118
8961
|
lucide-react/dist/esm/icons/sliders-horizontal.js:
|
|
9119
|
-
(**
|
|
9120
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9121
|
-
*
|
|
9122
|
-
* This source code is licensed under the ISC license.
|
|
9123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9124
|
-
*)
|
|
9125
|
-
|
|
9126
8962
|
lucide-react/dist/esm/icons/smartphone.js:
|
|
9127
|
-
(**
|
|
9128
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9129
|
-
*
|
|
9130
|
-
* This source code is licensed under the ISC license.
|
|
9131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9132
|
-
*)
|
|
9133
|
-
|
|
9134
8963
|
lucide-react/dist/esm/icons/tablet.js:
|
|
9135
|
-
(**
|
|
9136
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9137
|
-
*
|
|
9138
|
-
* This source code is licensed under the ISC license.
|
|
9139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9140
|
-
*)
|
|
9141
|
-
|
|
9142
8964
|
lucide-react/dist/esm/icons/trash.js:
|
|
9143
|
-
(**
|
|
9144
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9145
|
-
*
|
|
9146
|
-
* This source code is licensed under the ISC license.
|
|
9147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9148
|
-
*)
|
|
9149
|
-
|
|
9150
8965
|
lucide-react/dist/esm/icons/type.js:
|
|
9151
|
-
(**
|
|
9152
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9153
|
-
*
|
|
9154
|
-
* This source code is licensed under the ISC license.
|
|
9155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9156
|
-
*)
|
|
9157
|
-
|
|
9158
8966
|
lucide-react/dist/esm/icons/undo-2.js:
|
|
9159
|
-
(**
|
|
9160
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9161
|
-
*
|
|
9162
|
-
* This source code is licensed under the ISC license.
|
|
9163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9164
|
-
*)
|
|
9165
|
-
|
|
9166
8967
|
lucide-react/dist/esm/icons/zoom-in.js:
|
|
9167
|
-
(**
|
|
9168
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9169
|
-
*
|
|
9170
|
-
* This source code is licensed under the ISC license.
|
|
9171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9172
|
-
*)
|
|
9173
|
-
|
|
9174
8968
|
lucide-react/dist/esm/icons/zoom-out.js:
|
|
9175
|
-
(**
|
|
9176
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9177
|
-
*
|
|
9178
|
-
* This source code is licensed under the ISC license.
|
|
9179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9180
|
-
*)
|
|
9181
|
-
|
|
9182
8969
|
lucide-react/dist/esm/lucide-react.js:
|
|
9183
8970
|
(**
|
|
9184
8971
|
* @license lucide-react v0.468.0 - ISC
|
|
@@ -695,7 +695,7 @@ var getChanged = (newItem, oldItem) => {
|
|
|
695
695
|
// lib/resolve-component-data.ts
|
|
696
696
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
697
697
|
var cache = { lastChange: {} };
|
|
698
|
-
var resolveComponentData = (_0, _1, ..._2) => __async(
|
|
698
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
699
699
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
700
700
|
const resolvedItem = __spreadValues({}, item);
|
|
701
701
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -723,11 +723,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
723
723
|
let itemWithResolvedChildren = yield mapFields(
|
|
724
724
|
resolvedItem,
|
|
725
725
|
{
|
|
726
|
-
slot: (_02) => __async(
|
|
726
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
727
727
|
const content = value;
|
|
728
728
|
return yield Promise.all(
|
|
729
729
|
content.map(
|
|
730
|
-
(childItem) => __async(
|
|
730
|
+
(childItem) => __async(null, null, function* () {
|
|
731
731
|
return (yield resolveComponentData(
|
|
732
732
|
childItem,
|
|
733
733
|
config,
|
|
@@ -770,7 +770,7 @@ function resolveAllData(_0, _1) {
|
|
|
770
770
|
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
771
771
|
var _a;
|
|
772
772
|
const defaultedData = defaultData(data);
|
|
773
|
-
const resolveNode = (_node) => __async(
|
|
773
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
774
774
|
const node = toComponent(_node);
|
|
775
775
|
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
776
776
|
const resolved = (yield resolveComponentData(
|
|
@@ -791,13 +791,13 @@ function resolveAllData(_0, _1) {
|
|
|
791
791
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
792
792
|
return resolvedDeep;
|
|
793
793
|
});
|
|
794
|
-
const processContent = (content) => __async(
|
|
794
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
795
795
|
return Promise.all(content.map(resolveNode));
|
|
796
796
|
});
|
|
797
|
-
const processZones = () => __async(
|
|
797
|
+
const processZones = () => __async(null, null, function* () {
|
|
798
798
|
var _a2;
|
|
799
799
|
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
800
|
-
Object.entries(zones).forEach((_02) => __async(
|
|
800
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
801
801
|
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
802
802
|
}));
|
|
803
803
|
return zones;
|
|
@@ -807,7 +807,7 @@ function resolveAllData(_0, _1) {
|
|
|
807
807
|
content: yield processContent(defaultedData.content),
|
|
808
808
|
zones: yield processZones()
|
|
809
809
|
};
|
|
810
|
-
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(
|
|
810
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
811
811
|
const content = defaultedData.zones[zoneKey];
|
|
812
812
|
dynamic.zones[zoneKey] = yield processContent(content);
|
|
813
813
|
}), {});
|
|
@@ -958,6 +958,7 @@ export {
|
|
|
958
958
|
useSlots,
|
|
959
959
|
SlotRenderPure,
|
|
960
960
|
SlotRender,
|
|
961
|
+
toComponent,
|
|
961
962
|
migrate,
|
|
962
963
|
transformProps,
|
|
963
964
|
resolveAllData
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-
|
|
2
|
-
export {
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-BMbIeiqs.mjs';
|
|
2
|
+
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BMbIeiqs.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-
|
|
2
|
-
export {
|
|
1
|
+
import { H as History, P as Permissions, a as ComponentData, C as Config, U as UserGenerics, F as Fields, b as PuckAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, O as Overrides, V as Viewports, I as IframeConfig, e as UiState, f as ComponentConfig, A as AppState, M as Metadata, g as FieldTransforms, h as Field, i as FieldProps, D as DropZoneProps, j as Data, k as OnAction, l as InitialHistory, n as ItemSelector } from './walk-tree-BMbIeiqs.js';
|
|
2
|
+
export { ad as Adaptor, ab as ArrayField, B as ArrayState, ar as AsFieldProps, X as BaseData, a5 as BaseField, af as CacheOpts, J as ComponentConfigExtensions, T as ComponentConfigParams, a0 as ComponentDataMap, _ as ComponentDataOptionalId, a3 as ComponentMetadata, Q as ConfigParams, a1 as Content, ai as CustomField, ah as CustomFieldRender, ao as DefaultComponentProps, L as DefaultComponents, al as DefaultRootFieldProps, an as DefaultRootProps, am as DefaultRootRenderProps, o as Direction, p as DragAxis, ag as ExternalField, ae as ExternalFieldWithAdaptor, N as ExtractConfigParams, at as ExtractField, a4 as FieldMetadata, y as FieldRenderFunctions, u as FieldTransformFn, s as FieldTransformFnParams, z as ItemWithId, $ as MappedItem, a7 as NumberField, ac as ObjectField, x as OverrideKey, G as PuckComponent, ak as PuckContext, a2 as PuckMetadata, aa as RadioField, K as RootConfig, Z as RootData, Y as RootDataWithoutProps, a9 as SelectField, S as Slot, E as SlotComponent, aj as SlotField, a6 as TextField, a8 as TextareaField, q as Viewport, as as WithChildren, ap as WithId, aq as WithPuckProps, W as WithSlotProps, m as migrate, v as overrideKeys, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-BMbIeiqs.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|