@measured/puck 0.21.0-canary.8db6528d → 0.21.0-canary.9c2c8fe9
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-6B7427RN.mjs → chunk-KNAV6QTS.mjs} +1866 -2459
- package/dist/{chunk-Z3QSQFNS.mjs → chunk-X7YZ3YE7.mjs} +20 -27
- package/dist/index.css +272 -649
- package/dist/index.d.mts +4 -15
- package/dist/index.d.ts +4 -15
- package/dist/index.js +1846 -2439
- package/dist/index.mjs +2 -8
- package/dist/no-external.css +272 -649
- package/dist/no-external.d.mts +2 -2
- package/dist/no-external.d.ts +2 -2
- package/dist/no-external.js +1846 -2439
- 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 +20 -27
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-Cvtjzg9C.d.mts → walk-tree-Ctf3FZQI.d.mts} +8 -21
- package/dist/{walk-tree-Cvtjzg9C.d.ts → walk-tree-Ctf3FZQI.d.ts} +8 -21
- package/package.json +1 -1
|
@@ -111,32 +111,27 @@ var walkField = ({
|
|
|
111
111
|
config,
|
|
112
112
|
recurseSlots = false
|
|
113
113
|
}) => {
|
|
114
|
-
var _a, _b, _c
|
|
114
|
+
var _a, _b, _c;
|
|
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
|
-
|
|
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
|
-
);
|
|
119
|
+
const mappedContent = recurseSlots ? content.map((el) => {
|
|
120
|
+
var _a2;
|
|
121
|
+
const componentConfig = config.components[el.type];
|
|
122
|
+
if (!componentConfig) {
|
|
123
|
+
throw new Error(`Could not find component config for ${el.type}`);
|
|
138
124
|
}
|
|
139
|
-
|
|
125
|
+
const fields2 = (_a2 = componentConfig.fields) != null ? _a2 : {};
|
|
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;
|
|
140
135
|
if (containsPromise(mappedContent)) {
|
|
141
136
|
return Promise.all(mappedContent);
|
|
142
137
|
}
|
|
@@ -158,7 +153,7 @@ var walkField = ({
|
|
|
158
153
|
}
|
|
159
154
|
if (value && typeof value === "object") {
|
|
160
155
|
if (Array.isArray(value)) {
|
|
161
|
-
const arrayFields = ((
|
|
156
|
+
const arrayFields = ((_b = fields[propKey]) == null ? void 0 : _b.type) === "array" ? fields[propKey].arrayFields : null;
|
|
162
157
|
if (!arrayFields) return value;
|
|
163
158
|
const newValue = value.map(
|
|
164
159
|
(el, idx) => walkField({
|
|
@@ -179,7 +174,7 @@ var walkField = ({
|
|
|
179
174
|
} else if ("$$typeof" in value) {
|
|
180
175
|
return value;
|
|
181
176
|
} else {
|
|
182
|
-
const objectFields = ((
|
|
177
|
+
const objectFields = ((_c = fields[propKey]) == null ? void 0 : _c.type) === "object" ? fields[propKey].objectFields : fields;
|
|
183
178
|
return walkObject({
|
|
184
179
|
value,
|
|
185
180
|
fields: objectFields,
|
|
@@ -300,8 +295,7 @@ init_react_import();
|
|
|
300
295
|
var defaultViewports = [
|
|
301
296
|
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
302
297
|
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
303
|
-
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
304
|
-
{ width: "100%", height: "auto", icon: "FullWidth", label: "Full-width" }
|
|
298
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
305
299
|
];
|
|
306
300
|
|
|
307
301
|
// store/default-app-state.ts
|
|
@@ -323,8 +317,7 @@ var defaultAppState = {
|
|
|
323
317
|
options: [],
|
|
324
318
|
controlsVisible: true
|
|
325
319
|
},
|
|
326
|
-
field: { focus: null }
|
|
327
|
-
plugin: { current: null }
|
|
320
|
+
field: { focus: null }
|
|
328
321
|
},
|
|
329
322
|
indexes: {
|
|
330
323
|
nodes: {},
|