@prismicio/types-internal 3.2.0-alpha.1 → 3.2.0-alpha.2

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.
@@ -183,7 +183,7 @@ function traverseDocument({ document, customType, }) {
183
183
  key,
184
184
  apiId: key,
185
185
  model: (fieldModel === null || fieldModel === void 0 ? void 0 : fieldModel.type) === "Link" && ((_a = fieldModel.config) === null || _a === void 0 ? void 0 : _a.repeat)
186
- ? { ...fieldModel, config: { ...fieldModel.config, repeat: false } }
186
+ ? fieldModel
187
187
  : undefined,
188
188
  content,
189
189
  })(transformWidget);
@@ -62,11 +62,18 @@ function traverseRepeatableContent({ path, key, apiId, model, content, }) {
62
62
  const itemPath = path.concat([
63
63
  { key: index.toString(), type: "Widget" },
64
64
  ]);
65
+ // Content inside repeatable can't be repeatable.
66
+ const newModel = (model === null || model === void 0 ? void 0 : model.type) === "Link" && model.config
67
+ ? {
68
+ ...model,
69
+ config: { ...model.config, repeat: false },
70
+ }
71
+ : model;
65
72
  const transformedField = transform({
66
73
  path: itemPath,
67
74
  key: key,
68
75
  apiId: apiId,
69
- model,
76
+ model: newModel,
70
77
  content: fieldContent,
71
78
  });
72
79
  // Can happen if the transform function returns undefined to filter out a field
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "3.2.0-alpha.1",
3
+ "version": "3.2.0-alpha.2",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -301,7 +301,7 @@ export function traverseDocument({
301
301
  apiId: key,
302
302
  model:
303
303
  fieldModel?.type === "Link" && fieldModel.config?.repeat
304
- ? { ...fieldModel, config: { ...fieldModel.config, repeat: false } }
304
+ ? fieldModel
305
305
  : undefined,
306
306
  content,
307
307
  })(transformWidget)
@@ -113,11 +113,20 @@ export function traverseRepeatableContent({
113
113
  { key: index.toString(), type: "Widget" },
114
114
  ])
115
115
 
116
+ // Content inside repeatable can't be repeatable.
117
+ const newModel =
118
+ model?.type === "Link" && model.config
119
+ ? {
120
+ ...model,
121
+ config: { ...model.config, repeat: false },
122
+ }
123
+ : model
124
+
116
125
  const transformedField = transform({
117
126
  path: itemPath,
118
127
  key: key,
119
128
  apiId: apiId,
120
- model,
129
+ model: newModel,
121
130
  content: fieldContent,
122
131
  })
123
132