@measured/puck 0.21.0-canary.d32e582b → 0.21.0-canary.dfecd012
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-VVS2EUKT.mjs → chunk-5MWIJTZQ.mjs} +2189 -2853
- package/dist/{chunk-XYKLHT4R.mjs → chunk-JA7SEUEH.mjs} +20 -20
- package/dist/index.css +273 -649
- package/dist/index.d.mts +4 -15
- package/dist/index.d.ts +4 -15
- package/dist/index.js +1923 -2586
- package/dist/index.mjs +2 -8
- package/dist/no-external.css +273 -649
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +1920 -2583
- package/dist/no-external.mjs +2 -8
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +19 -20
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-DiatHoF-.d.mts → walk-tree-BqwnaCVe.d.mts} +68 -66
- package/dist/{walk-tree-DiatHoF-.d.ts → walk-tree-BqwnaCVe.d.ts} +68 -66
- package/package.json +21 -2
|
@@ -138,7 +138,7 @@ var walkField = ({
|
|
|
138
138
|
return map({
|
|
139
139
|
value: mappedContent,
|
|
140
140
|
parentId: id,
|
|
141
|
-
propName:
|
|
141
|
+
propName: propPath,
|
|
142
142
|
field: fields[propKey],
|
|
143
143
|
propPath
|
|
144
144
|
});
|
|
@@ -295,8 +295,7 @@ init_react_import();
|
|
|
295
295
|
var defaultViewports = [
|
|
296
296
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
297
297
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
298
|
-
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
299
|
-
{ width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
|
|
298
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
300
299
|
];
|
|
301
300
|
|
|
302
301
|
// store/default-app-state.ts
|
|
@@ -318,8 +317,7 @@ var defaultAppState = {
|
|
|
318
317
|
options: [],
|
|
319
318
|
controlsVisible: true
|
|
320
319
|
},
|
|
321
|
-
field: { focus: null }
|
|
322
|
-
plugin: { current: null }
|
|
320
|
+
field: { focus: null }
|
|
323
321
|
},
|
|
324
322
|
indexes: {
|
|
325
323
|
nodes: {},
|
|
@@ -683,28 +681,28 @@ init_react_import();
|
|
|
683
681
|
|
|
684
682
|
// lib/get-changed.ts
|
|
685
683
|
init_react_import();
|
|
686
|
-
import
|
|
684
|
+
import { deepEqual } from "fast-equals";
|
|
687
685
|
var getChanged = (newItem, oldItem) => {
|
|
688
686
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
689
687
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
|
690
688
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
|
691
689
|
return __spreadProps(__spreadValues({}, acc), {
|
|
692
|
-
[item]: !
|
|
690
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
|
693
691
|
});
|
|
694
692
|
}, {}) : {};
|
|
695
693
|
};
|
|
696
694
|
|
|
697
695
|
// lib/resolve-component-data.ts
|
|
698
|
-
import
|
|
696
|
+
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
699
697
|
var cache = { lastChange: {} };
|
|
700
|
-
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") {
|
|
701
699
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
702
700
|
const resolvedItem = __spreadValues({}, item);
|
|
703
701
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
704
702
|
const id = "id" in item.props ? item.props.id : "root";
|
|
705
703
|
if (shouldRunResolver) {
|
|
706
704
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
|
707
|
-
if (item &&
|
|
705
|
+
if (trigger !== "force" && item && deepEqual2(item, oldItem)) {
|
|
708
706
|
return { node: resolved, didChange: false };
|
|
709
707
|
}
|
|
710
708
|
const changed = getChanged(item, oldItem);
|
|
@@ -725,11 +723,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
725
723
|
let itemWithResolvedChildren = yield mapFields(
|
|
726
724
|
resolvedItem,
|
|
727
725
|
{
|
|
728
|
-
slot: (_02) => __async(
|
|
726
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
729
727
|
const content = value;
|
|
730
728
|
return yield Promise.all(
|
|
731
729
|
content.map(
|
|
732
|
-
(childItem) => __async(
|
|
730
|
+
(childItem) => __async(null, null, function* () {
|
|
733
731
|
return (yield resolveComponentData(
|
|
734
732
|
childItem,
|
|
735
733
|
config,
|
|
@@ -754,7 +752,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
754
752
|
};
|
|
755
753
|
return {
|
|
756
754
|
node: itemWithResolvedChildren,
|
|
757
|
-
didChange: !
|
|
755
|
+
didChange: !deepEqual2(item, itemWithResolvedChildren)
|
|
758
756
|
};
|
|
759
757
|
});
|
|
760
758
|
|
|
@@ -772,7 +770,7 @@ function resolveAllData(_0, _1) {
|
|
|
772
770
|
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
773
771
|
var _a;
|
|
774
772
|
const defaultedData = defaultData(data);
|
|
775
|
-
const resolveNode = (_node) => __async(
|
|
773
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
776
774
|
const node = toComponent(_node);
|
|
777
775
|
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
778
776
|
const resolved = (yield resolveComponentData(
|
|
@@ -793,13 +791,13 @@ function resolveAllData(_0, _1) {
|
|
|
793
791
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
794
792
|
return resolvedDeep;
|
|
795
793
|
});
|
|
796
|
-
const processContent = (content) => __async(
|
|
794
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
797
795
|
return Promise.all(content.map(resolveNode));
|
|
798
796
|
});
|
|
799
|
-
const processZones = () => __async(
|
|
797
|
+
const processZones = () => __async(null, null, function* () {
|
|
800
798
|
var _a2;
|
|
801
799
|
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
802
|
-
Object.entries(zones).forEach((_02) => __async(
|
|
800
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
803
801
|
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
804
802
|
}));
|
|
805
803
|
return zones;
|
|
@@ -809,7 +807,7 @@ function resolveAllData(_0, _1) {
|
|
|
809
807
|
content: yield processContent(defaultedData.content),
|
|
810
808
|
zones: yield processZones()
|
|
811
809
|
};
|
|
812
|
-
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(
|
|
810
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
813
811
|
const content = defaultedData.zones[zoneKey];
|
|
814
812
|
dynamic.zones[zoneKey] = yield processContent(content);
|
|
815
813
|
}), {});
|
|
@@ -916,8 +914,9 @@ var Item = ({
|
|
|
916
914
|
);
|
|
917
915
|
};
|
|
918
916
|
var SlotRender = forwardRef(
|
|
919
|
-
function SlotRenderInternal({ className, style, content, config, metadata }, ref) {
|
|
920
|
-
|
|
917
|
+
function SlotRenderInternal({ className, style, content, config, metadata, as }, ref) {
|
|
918
|
+
const El = as != null ? as : "div";
|
|
919
|
+
return /* @__PURE__ */ jsx(El, { className, style, ref, children: content.map((item) => {
|
|
921
920
|
if (!config.components[item.type]) {
|
|
922
921
|
return null;
|
|
923
922
|
}
|
|
@@ -960,6 +959,7 @@ export {
|
|
|
960
959
|
useSlots,
|
|
961
960
|
SlotRenderPure,
|
|
962
961
|
SlotRender,
|
|
962
|
+
toComponent,
|
|
963
963
|
migrate,
|
|
964
964
|
transformProps,
|
|
965
965
|
resolveAllData
|