@measured/puck 0.21.0-canary.a3dabae1 → 0.21.0-canary.ace4c8b3
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-V2FU5KB6.mjs → chunk-AIFI2M23.mjs} +1932 -2737
- package/dist/{chunk-C24EBUN6.mjs → chunk-TC25DCTQ.mjs} +29 -35
- package/dist/index.css +272 -649
- package/dist/index.d.mts +4 -15
- package/dist/index.d.ts +4 -15
- package/dist/index.js +1922 -2730
- 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 +1919 -2727
- 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 +28 -35
- package/dist/rsc.mjs +1 -1
- package/dist/{walk-tree-Cvtjzg9C.d.mts → walk-tree-CkSoNBF7.d.mts} +63 -63
- package/dist/{walk-tree-Cvtjzg9C.d.ts → walk-tree-CkSoNBF7.d.ts} +63 -63
- 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 || !((_b = el.props) == null ? void 0 : _b.id)) {
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const fields2 = (_c = componentConfig.fields) != null ? _c : {};
|
|
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: {},
|
|
@@ -702,7 +695,7 @@ var getChanged = (newItem, oldItem) => {
|
|
|
702
695
|
// lib/resolve-component-data.ts
|
|
703
696
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
704
697
|
var cache = { lastChange: {} };
|
|
705
|
-
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") {
|
|
706
699
|
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
707
700
|
const resolvedItem = __spreadValues({}, item);
|
|
708
701
|
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
@@ -730,11 +723,11 @@ var resolveComponentData = (_0, _1, ..._2) => __async(void 0, [_0, _1, ..._2], f
|
|
|
730
723
|
let itemWithResolvedChildren = yield mapFields(
|
|
731
724
|
resolvedItem,
|
|
732
725
|
{
|
|
733
|
-
slot: (_02) => __async(
|
|
726
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
734
727
|
const content = value;
|
|
735
728
|
return yield Promise.all(
|
|
736
729
|
content.map(
|
|
737
|
-
(childItem) => __async(
|
|
730
|
+
(childItem) => __async(null, null, function* () {
|
|
738
731
|
return (yield resolveComponentData(
|
|
739
732
|
childItem,
|
|
740
733
|
config,
|
|
@@ -777,7 +770,7 @@ function resolveAllData(_0, _1) {
|
|
|
777
770
|
return __async(this, arguments, function* (data, config, metadata = {}, onResolveStart, onResolveEnd) {
|
|
778
771
|
var _a;
|
|
779
772
|
const defaultedData = defaultData(data);
|
|
780
|
-
const resolveNode = (_node) => __async(
|
|
773
|
+
const resolveNode = (_node) => __async(null, null, function* () {
|
|
781
774
|
const node = toComponent(_node);
|
|
782
775
|
onResolveStart == null ? void 0 : onResolveStart(node);
|
|
783
776
|
const resolved = (yield resolveComponentData(
|
|
@@ -798,13 +791,13 @@ function resolveAllData(_0, _1) {
|
|
|
798
791
|
onResolveEnd == null ? void 0 : onResolveEnd(toComponent(resolvedDeep));
|
|
799
792
|
return resolvedDeep;
|
|
800
793
|
});
|
|
801
|
-
const processContent = (content) => __async(
|
|
794
|
+
const processContent = (content) => __async(null, null, function* () {
|
|
802
795
|
return Promise.all(content.map(resolveNode));
|
|
803
796
|
});
|
|
804
|
-
const processZones = () => __async(
|
|
797
|
+
const processZones = () => __async(null, null, function* () {
|
|
805
798
|
var _a2;
|
|
806
799
|
const zones = (_a2 = data.zones) != null ? _a2 : {};
|
|
807
|
-
Object.entries(zones).forEach((_02) => __async(
|
|
800
|
+
Object.entries(zones).forEach((_02) => __async(null, [_02], function* ([zoneKey, content]) {
|
|
808
801
|
zones[zoneKey] = yield Promise.all(content.map(resolveNode));
|
|
809
802
|
}));
|
|
810
803
|
return zones;
|
|
@@ -814,7 +807,7 @@ function resolveAllData(_0, _1) {
|
|
|
814
807
|
content: yield processContent(defaultedData.content),
|
|
815
808
|
zones: yield processZones()
|
|
816
809
|
};
|
|
817
|
-
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(
|
|
810
|
+
Object.keys((_a = defaultedData.zones) != null ? _a : {}).forEach((zoneKey) => __async(null, null, function* () {
|
|
818
811
|
const content = defaultedData.zones[zoneKey];
|
|
819
812
|
dynamic.zones[zoneKey] = yield processContent(content);
|
|
820
813
|
}), {});
|
|
@@ -965,6 +958,7 @@ export {
|
|
|
965
958
|
useSlots,
|
|
966
959
|
SlotRenderPure,
|
|
967
960
|
SlotRender,
|
|
961
|
+
toComponent,
|
|
968
962
|
migrate,
|
|
969
963
|
transformProps,
|
|
970
964
|
resolveAllData
|