@measured/puck 0.21.0-canary.6dae6cb7 → 0.21.0-canary.8db6528d
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-NBNCSA43.mjs → chunk-6B7427RN.mjs} +2673 -1973
- package/dist/{chunk-OOLYDXKW.mjs → chunk-Z3QSQFNS.mjs} +32 -25
- package/dist/index.css +650 -272
- package/dist/index.d.mts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +2245 -1545
- package/dist/index.mjs +8 -2
- package/dist/no-external.css +650 -272
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +2245 -1545
- package/dist/no-external.mjs +8 -2
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +32 -25
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-Ctf3FZQI.d.mts → walk-tree-Cvtjzg9C.d.mts} +21 -8
- package/dist/{walk-tree-Ctf3FZQI.d.ts → walk-tree-Cvtjzg9C.d.ts} +21 -8
- package/package.json +2 -2
|
@@ -111,27 +111,32 @@ var walkField = ({
|
|
|
111
111
|
config,
|
|
112
112
|
recurseSlots = false
|
|
113
113
|
}) => {
|
|
114
|
-
var _a, _b, _c;
|
|
114
|
+
var _a, _b, _c, _d;
|
|
115
115
|
const fieldType = (_a = fields[propKey]) == null ? void 0 : _a.type;
|
|
116
116
|
const map = mappers[fieldType];
|
|
117
117
|
if (map && fieldType === "slot") {
|
|
118
118
|
const content = value || [];
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
let mappedContent = content;
|
|
120
|
+
if (recurseSlots) {
|
|
121
|
+
for (let i = 0; i < content.length; i++) {
|
|
122
|
+
const el = content[i];
|
|
123
|
+
const componentConfig = config.components[el.type];
|
|
124
|
+
if (!componentConfig || !el.props) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const fields2 = (_b = componentConfig.fields) != null ? _b : {};
|
|
128
|
+
mappedContent.push(
|
|
129
|
+
walkField({
|
|
130
|
+
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
131
|
+
fields: fields2,
|
|
132
|
+
mappers,
|
|
133
|
+
id: el.props.id,
|
|
134
|
+
config,
|
|
135
|
+
recurseSlots
|
|
136
|
+
})
|
|
137
|
+
);
|
|
124
138
|
}
|
|
125
|
-
|
|
126
|
-
return walkField({
|
|
127
|
-
value: __spreadProps(__spreadValues({}, el), { props: defaultSlots(el.props, fields2) }),
|
|
128
|
-
fields: fields2,
|
|
129
|
-
mappers,
|
|
130
|
-
id: el.props.id,
|
|
131
|
-
config,
|
|
132
|
-
recurseSlots
|
|
133
|
-
});
|
|
134
|
-
}) : content;
|
|
139
|
+
}
|
|
135
140
|
if (containsPromise(mappedContent)) {
|
|
136
141
|
return Promise.all(mappedContent);
|
|
137
142
|
}
|
|
@@ -153,7 +158,7 @@ var walkField = ({
|
|
|
153
158
|
}
|
|
154
159
|
if (value && typeof value === "object") {
|
|
155
160
|
if (Array.isArray(value)) {
|
|
156
|
-
const arrayFields = ((
|
|
161
|
+
const arrayFields = ((_c = fields[propKey]) == null ? void 0 : _c.type) === "array" ? fields[propKey].arrayFields : null;
|
|
157
162
|
if (!arrayFields) return value;
|
|
158
163
|
const newValue = value.map(
|
|
159
164
|
(el, idx) => walkField({
|
|
@@ -174,7 +179,7 @@ var walkField = ({
|
|
|
174
179
|
} else if ("$$typeof" in value) {
|
|
175
180
|
return value;
|
|
176
181
|
} else {
|
|
177
|
-
const objectFields = ((
|
|
182
|
+
const objectFields = ((_d = fields[propKey]) == null ? void 0 : _d.type) === "object" ? fields[propKey].objectFields : fields;
|
|
178
183
|
return walkObject({
|
|
179
184
|
value,
|
|
180
185
|
fields: objectFields,
|
|
@@ -295,7 +300,8 @@ init_react_import();
|
|
|
295
300
|
var defaultViewports = [
|
|
296
301
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
297
302
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
298
|
-
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
303
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" },
|
|
304
|
+
{ width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
|
|
299
305
|
];
|
|
300
306
|
|
|
301
307
|
// store/default-app-state.ts
|
|
@@ -317,7 +323,8 @@ var defaultAppState = {
|
|
|
317
323
|
options: [],
|
|
318
324
|
controlsVisible: true
|
|
319
325
|
},
|
|
320
|
-
field: { focus: null }
|
|
326
|
+
field: { focus: null },
|
|
327
|
+
plugin: { current: null }
|
|
321
328
|
},
|
|
322
329
|
indexes: {
|
|
323
330
|
nodes: {},
|
|
@@ -681,19 +688,19 @@ init_react_import();
|
|
|
681
688
|
|
|
682
689
|
// lib/get-changed.ts
|
|
683
690
|
init_react_import();
|
|
684
|
-
import
|
|
691
|
+
import { deepEqual } from "fast-equals";
|
|
685
692
|
var getChanged = (newItem, oldItem) => {
|
|
686
693
|
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
687
694
|
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
|
688
695
|
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
|
689
696
|
return __spreadProps(__spreadValues({}, acc), {
|
|
690
|
-
[item]: !
|
|
697
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
|
691
698
|
});
|
|
692
699
|
}, {}) : {};
|
|
693
700
|
};
|
|
694
701
|
|
|
695
702
|
// lib/resolve-component-data.ts
|
|
696
|
-
import
|
|
703
|
+
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
697
704
|
var cache = { lastChange: {} };
|
|
698
705
|
var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
699
706
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
@@ -702,7 +709,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
702
709
|
const id = "id" in item.props ? item.props.id : "root";
|
|
703
710
|
if (shouldRunResolver) {
|
|
704
711
|
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
|
705
|
-
if (trigger !== "force" && item &&
|
|
712
|
+
if (trigger !== "force" && item && deepEqual2(item, oldItem)) {
|
|
706
713
|
return { node: resolved, didChange: false };
|
|
707
714
|
}
|
|
708
715
|
const changed = getChanged(item, oldItem);
|
|
@@ -752,7 +759,7 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
752
759
|
};
|
|
753
760
|
return {
|
|
754
761
|
node: itemWithResolvedChildren,
|
|
755
|
-
didChange: !
|
|
762
|
+
didChange: !deepEqual2(item, itemWithResolvedChildren)
|
|
756
763
|
};
|
|
757
764
|
});
|
|
758
765
|
|