@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.
@@ -111,32 +111,27 @@ var walkField = ({
111
111
  config,
112
112
  recurseSlots = false
113
113
  }) => {
114
- var _a, _b, _c, _d;
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
- 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
- );
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 = ((_c = fields[propKey]) == null ? void 0 : _c.type) === "array" ? fields[propKey].arrayFields : null;
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 = ((_d = fields[propKey]) == null ? void 0 : _d.type) === "object" ? fields[propKey].objectFields : fields;
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: {},