@prismicio/types-internal 2.5.0 → 2.6.0
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/lib/_internal/utils.d.ts +2 -2
- package/lib/content/Document.d.ts +588 -1632
- package/lib/content/fields/WidgetContent.d.ts +588 -1632
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +4 -4
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +2 -1
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +5 -2158
- package/lib/content/fields/slices/Slice/RepeatableContent.js +6 -148
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +4 -4
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +1 -1
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +6 -1049
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +7 -10
- package/lib/content/fields/slices/Slice/index.d.ts +27 -754
- package/lib/content/fields/slices/Slice/index.js +0 -1
- package/lib/content/fields/slices/SliceItem.d.ts +325 -1051
- package/lib/content/fields/slices/SlicesContent.d.ts +1771 -2815
- package/package.json +1 -1
- package/src/_internal/utils.ts +1 -2
- package/src/content/fields/slices/Slice/CompositeSliceContent.ts +4 -8
- package/src/content/fields/slices/Slice/RepeatableContent.ts +11 -242
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +7 -7
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +17 -21
- package/src/content/fields/slices/Slice/index.ts +0 -1
- package/src/content/fields/slices/SlicesContent.ts +2 -2
package/package.json
CHANGED
package/src/_internal/utils.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
WithTypes,
|
|
16
16
|
} from "../../../LegacyContentCtx"
|
|
17
17
|
import { hasContentType } from "../../../utils"
|
|
18
|
+
import { GroupItemContent, traverseGroupItemsContent } from "../../GroupContent"
|
|
18
19
|
import {
|
|
19
20
|
isNestableContent,
|
|
20
21
|
NestableContent,
|
|
@@ -28,12 +29,7 @@ import type {
|
|
|
28
29
|
CompositeSliceItemContent,
|
|
29
30
|
SharedSliceItemContent,
|
|
30
31
|
} from "../SliceItem"
|
|
31
|
-
import {
|
|
32
|
-
RepeatableWidgetItemContent,
|
|
33
|
-
RepeatableWidgets,
|
|
34
|
-
RepeatableWidgetsLegacy,
|
|
35
|
-
traverseRepeatableWidgetItemsContent,
|
|
36
|
-
} from "./RepeatableContent"
|
|
32
|
+
import { RepeatableWidgets, RepeatableWidgetsLegacy } from "./RepeatableContent"
|
|
37
33
|
|
|
38
34
|
export const CompositeSliceContentType = "CompositeSliceContent"
|
|
39
35
|
|
|
@@ -212,7 +208,7 @@ export function traverseCompositeSliceContent({
|
|
|
212
208
|
}
|
|
213
209
|
}, {})
|
|
214
210
|
|
|
215
|
-
const items =
|
|
211
|
+
const items = traverseGroupItemsContent({
|
|
216
212
|
path: path.concat([{ key: "repeat", type: "items" }]),
|
|
217
213
|
model:
|
|
218
214
|
model?.type === "SharedSlice" ? model?.fields.items : model?.repeat,
|
|
@@ -264,7 +260,7 @@ export function migrateCompositeSlice(
|
|
|
264
260
|
items: content.widget.repeat.map((groupItem) => {
|
|
265
261
|
return {
|
|
266
262
|
__TYPE__: "GroupItemContent",
|
|
267
|
-
value: groupItem.value.reduce<
|
|
263
|
+
value: groupItem.value.reduce<GroupItemContent["value"]>(
|
|
268
264
|
(acc, [fieldKey, fieldContent]) => {
|
|
269
265
|
if (!model.fields.items?.[fieldKey]) {
|
|
270
266
|
console.warn(
|
|
@@ -1,252 +1,21 @@
|
|
|
1
|
-
import { either } from "fp-ts"
|
|
2
|
-
import { isLeft } from "fp-ts/lib/Either"
|
|
3
|
-
import { pipe } from "fp-ts/lib/function"
|
|
4
1
|
import * as t from "io-ts"
|
|
5
2
|
|
|
6
|
-
import type {
|
|
7
|
-
ContentPath,
|
|
8
|
-
TraverseWidgetContentFn,
|
|
9
|
-
} from "../../../../_internal/utils"
|
|
10
|
-
import type { NestableWidget, NestedGroup } from "../../../../customtypes"
|
|
3
|
+
import type { LegacyContentCtx } from "../../../LegacyContentCtx"
|
|
11
4
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "
|
|
17
|
-
import { hasContentType } from "../../../utils"
|
|
18
|
-
import { GroupContentType, GroupItemContentType } from "../../GroupContent"
|
|
19
|
-
import {
|
|
20
|
-
isNestableContent,
|
|
21
|
-
NestableContent,
|
|
22
|
-
NestableLegacy,
|
|
23
|
-
} from "../../nestable"
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* This is essentially a copy of `GroupItemContent` that doesn't support
|
|
27
|
-
* nested groups to keep accurate content types for legacy slice.
|
|
28
|
-
*/
|
|
29
|
-
const RepeatableWidgetItemContent = t.strict({
|
|
30
|
-
__TYPE__: t.literal(GroupItemContentType),
|
|
31
|
-
value: t.array(t.tuple([t.string, NestableContent])),
|
|
32
|
-
})
|
|
33
|
-
export type RepeatableWidgetItemContent = t.TypeOf<
|
|
34
|
-
typeof RepeatableWidgetItemContent
|
|
35
|
-
>
|
|
36
|
-
|
|
37
|
-
const itemLegacyReader = t.record(t.string, t.unknown)
|
|
38
|
-
type RepeatableWidgetItemLegacy = t.TypeOf<typeof itemLegacyReader>
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* This is essentially a copy of `GroupItemLegacy` that doesn't support
|
|
42
|
-
* nested groups to keep accurate content types for legacy slice.
|
|
43
|
-
*/
|
|
44
|
-
const RepeatableWidgetItemLegacy = (ctx: LegacyContentCtx) => {
|
|
45
|
-
return new t.Type<
|
|
46
|
-
RepeatableWidgetItemContent,
|
|
47
|
-
WithTypes<RepeatableWidgetItemLegacy>
|
|
48
|
-
>(
|
|
49
|
-
"RepeatableWidgetItemLegacy",
|
|
50
|
-
(u): u is RepeatableWidgetItemContent =>
|
|
51
|
-
hasContentType(u) && u.__TYPE__ === GroupItemContentType,
|
|
52
|
-
(u) => {
|
|
53
|
-
const parsed = pipe(
|
|
54
|
-
itemLegacyReader.decode(u),
|
|
55
|
-
either.map((items) => {
|
|
56
|
-
const parsedItems = Object.entries(items).reduce<
|
|
57
|
-
Array<[string, NestableContent]>
|
|
58
|
-
>((acc, [itemKey, itemValue]) => {
|
|
59
|
-
const itemCtx = getFieldCtx(itemKey, ctx)
|
|
60
|
-
const result = NestableLegacy(itemCtx).decode(itemValue)
|
|
61
|
-
if (!result) return acc
|
|
62
|
-
|
|
63
|
-
if (isLeft(result)) return acc
|
|
64
|
-
return [...acc, [itemKey, result.right]]
|
|
65
|
-
}, [])
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
value: parsedItems,
|
|
69
|
-
__TYPE__: GroupItemContentType,
|
|
70
|
-
}
|
|
71
|
-
}),
|
|
72
|
-
)
|
|
73
|
-
return parsed
|
|
74
|
-
},
|
|
75
|
-
(item) => {
|
|
76
|
-
return item.value.reduce<WithTypes<RepeatableWidgetItemLegacy>>(
|
|
77
|
-
(acc, [key, value]) => {
|
|
78
|
-
const itemCtx = getFieldCtx(key, ctx)
|
|
79
|
-
const encoded = NestableLegacy(itemCtx).encode(value)
|
|
80
|
-
if (!encoded) return acc
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
content: { ...acc.content, [key]: encoded.content },
|
|
84
|
-
types: { ...acc.types, ...encoded.types },
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
{ content: {}, types: {} },
|
|
88
|
-
)
|
|
89
|
-
},
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* This is essentially a copy of `GroupLegacy` that doesn't support
|
|
95
|
-
* nested groups to keep accurate content types for legacy slice.
|
|
96
|
-
*/
|
|
97
|
-
type RepeatableWidgetLegacy = Array<RepeatableWidgetItemLegacy>
|
|
98
|
-
export const RepeatableWidgetLegacy = (ctx: LegacyContentCtx) => {
|
|
99
|
-
const codecDecode = t.array(
|
|
100
|
-
t.union([t.null, RepeatableWidgetItemLegacy(ctx)]),
|
|
101
|
-
)
|
|
102
|
-
const codecEncode = t.array(RepeatableWidgetItemLegacy(ctx))
|
|
103
|
-
|
|
104
|
-
return new t.Type<
|
|
105
|
-
RepeatableWidgetContent,
|
|
106
|
-
WithTypes<RepeatableWidgetLegacy>,
|
|
107
|
-
unknown
|
|
108
|
-
>(
|
|
109
|
-
"RepeatableWidgetLegacy",
|
|
110
|
-
isRepeatableWidgetContent,
|
|
111
|
-
(items) => {
|
|
112
|
-
return pipe(
|
|
113
|
-
codecDecode.decode(items),
|
|
114
|
-
either.map((parsedItems) => {
|
|
115
|
-
return {
|
|
116
|
-
value: parsedItems.map((i) => {
|
|
117
|
-
if (i === null) {
|
|
118
|
-
return { __TYPE__: GroupItemContentType, value: [] }
|
|
119
|
-
} else return i
|
|
120
|
-
}),
|
|
121
|
-
__TYPE__: GroupContentType,
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
)
|
|
125
|
-
},
|
|
126
|
-
(g: RepeatableWidgetContent) => {
|
|
127
|
-
const res = codecEncode.encode(g.value)
|
|
128
|
-
return {
|
|
129
|
-
content: res.map((block) => block.content),
|
|
130
|
-
types: res.reduce<Record<string, FieldOrSliceType>>(
|
|
131
|
-
(acc, block) => {
|
|
132
|
-
return { ...acc, ...block.types }
|
|
133
|
-
},
|
|
134
|
-
{ [ctx.keyOfType]: "Group" },
|
|
135
|
-
),
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* This is essentially a copy of `isGroupContent` that doesn't support
|
|
143
|
-
* nested groups to keep accurate content types for legacy slice.
|
|
144
|
-
*/
|
|
145
|
-
export const isRepeatableWidgetContent = (
|
|
146
|
-
u: unknown,
|
|
147
|
-
): u is RepeatableWidgetContent =>
|
|
148
|
-
hasContentType(u) && u.__TYPE__ === GroupContentType
|
|
149
|
-
|
|
150
|
-
export const RepeatableWidgetContent = t.strict({
|
|
151
|
-
__TYPE__: t.literal(GroupContentType),
|
|
152
|
-
value: t.array(RepeatableWidgetItemContent),
|
|
153
|
-
})
|
|
154
|
-
export type RepeatableWidgetContent = t.TypeOf<typeof RepeatableWidgetContent>
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* This is essentially a copy of `traverseGroupContent` that doesn't support
|
|
158
|
-
* nested groups to keep accurate content types for legacy slice.
|
|
159
|
-
*/
|
|
160
|
-
export function traverseRepeatableWidgetContent({
|
|
161
|
-
path,
|
|
162
|
-
key,
|
|
163
|
-
apiId,
|
|
164
|
-
model,
|
|
165
|
-
content,
|
|
166
|
-
}: {
|
|
167
|
-
path: ContentPath
|
|
168
|
-
key: string
|
|
169
|
-
apiId: string
|
|
170
|
-
content: RepeatableWidgetContent
|
|
171
|
-
model?: NestedGroup | undefined
|
|
172
|
-
}) {
|
|
173
|
-
return (
|
|
174
|
-
transform: TraverseWidgetContentFn,
|
|
175
|
-
): RepeatableWidgetContent | undefined => {
|
|
176
|
-
const repeatableWidgetItems = traverseRepeatableWidgetItemsContent({
|
|
177
|
-
path,
|
|
178
|
-
model: model?.config?.fields,
|
|
179
|
-
content: content.value,
|
|
180
|
-
})(transform)
|
|
181
|
-
|
|
182
|
-
return transform({
|
|
183
|
-
path,
|
|
184
|
-
key,
|
|
185
|
-
apiId,
|
|
186
|
-
model,
|
|
187
|
-
content: {
|
|
188
|
-
__TYPE__: content.__TYPE__,
|
|
189
|
-
value: repeatableWidgetItems,
|
|
190
|
-
},
|
|
191
|
-
})
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* This is essentially a copy of `traverseGroupItemContent` that doesn't support
|
|
197
|
-
* nested groups to keep accurate content types for legacy slice.
|
|
198
|
-
*/
|
|
199
|
-
export function traverseRepeatableWidgetItemsContent({
|
|
200
|
-
path,
|
|
201
|
-
model,
|
|
202
|
-
content,
|
|
203
|
-
}: {
|
|
204
|
-
path: ContentPath
|
|
205
|
-
content: Array<RepeatableWidgetItemContent>
|
|
206
|
-
model?: Record<string, NestableWidget> | undefined
|
|
207
|
-
}) {
|
|
208
|
-
return (
|
|
209
|
-
transform: TraverseWidgetContentFn,
|
|
210
|
-
): Array<RepeatableWidgetItemContent> => {
|
|
211
|
-
return content.map((repeatableWidgetItem, index) => {
|
|
212
|
-
const repeatableWidgetItemPath = path.concat([
|
|
213
|
-
{ key: index.toString(), type: "GroupItem" },
|
|
214
|
-
])
|
|
215
|
-
|
|
216
|
-
const repeatableWidgetItemFields = repeatableWidgetItem.value.reduce<
|
|
217
|
-
RepeatableWidgetItemContent["value"]
|
|
218
|
-
>((acc, [fieldKey, fieldContent]) => {
|
|
219
|
-
const fieldDef = model?.[fieldKey]
|
|
220
|
-
|
|
221
|
-
const transformedField = transform({
|
|
222
|
-
path: repeatableWidgetItemPath.concat([
|
|
223
|
-
{ key: fieldKey, type: "Widget" },
|
|
224
|
-
]),
|
|
225
|
-
key: fieldKey,
|
|
226
|
-
apiId: fieldKey,
|
|
227
|
-
model: fieldDef,
|
|
228
|
-
content: fieldContent,
|
|
229
|
-
})
|
|
230
|
-
// Can happen if the transform function returns undefined to filter out a field
|
|
231
|
-
if (!transformedField || !isNestableContent(transformedField))
|
|
232
|
-
return acc
|
|
233
|
-
|
|
234
|
-
return acc.concat([[fieldKey, transformedField]])
|
|
235
|
-
}, [])
|
|
236
|
-
|
|
237
|
-
return {
|
|
238
|
-
__TYPE__: repeatableWidgetItem.__TYPE__,
|
|
239
|
-
value: repeatableWidgetItemFields,
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
}
|
|
243
|
-
}
|
|
5
|
+
GroupContent,
|
|
6
|
+
GroupItemContentType,
|
|
7
|
+
GroupItemLegacy,
|
|
8
|
+
} from "../../GroupContent"
|
|
9
|
+
import { NestableContent } from "../../nestable"
|
|
244
10
|
|
|
245
11
|
export const RepeatableWidgetsLegacy = (ctx: LegacyContentCtx) => {
|
|
246
|
-
return t.array(
|
|
12
|
+
return t.array(GroupItemLegacy(ctx))
|
|
247
13
|
}
|
|
248
14
|
|
|
249
|
-
const RepeatableWidget = t.tuple([
|
|
15
|
+
const RepeatableWidget = t.tuple([
|
|
16
|
+
t.string,
|
|
17
|
+
t.union([NestableContent, GroupContent]),
|
|
18
|
+
])
|
|
250
19
|
const RepeatableWidgetsBlock = t.strict({
|
|
251
20
|
__TYPE__: t.literal(GroupItemContentType),
|
|
252
21
|
value: t.array(RepeatableWidget),
|
|
@@ -20,18 +20,18 @@ import {
|
|
|
20
20
|
WithTypes,
|
|
21
21
|
} from "../../../LegacyContentCtx"
|
|
22
22
|
import { hasContentType } from "../../../utils"
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
isGroupContent,
|
|
25
|
+
traverseGroupContent,
|
|
26
|
+
traverseGroupItemsContent,
|
|
27
|
+
} from "../../GroupContent"
|
|
24
28
|
import { isNestableContent } from "../../nestable"
|
|
25
29
|
import {
|
|
26
30
|
repeatableContentWithDefaultNestableContentValues,
|
|
27
31
|
withDefaultSlicePrimaryContentValues,
|
|
28
32
|
} from "../../withDefaultValues"
|
|
29
33
|
import type { SharedSliceItemContent } from "../SliceItem"
|
|
30
|
-
import {
|
|
31
|
-
RepeatableWidgets,
|
|
32
|
-
RepeatableWidgetsLegacy,
|
|
33
|
-
traverseRepeatableWidgetItemsContent,
|
|
34
|
-
} from "./RepeatableContent"
|
|
34
|
+
import { RepeatableWidgets, RepeatableWidgetsLegacy } from "./RepeatableContent"
|
|
35
35
|
import {
|
|
36
36
|
isSlicePrimaryContent,
|
|
37
37
|
SlicePrimaryContent,
|
|
@@ -245,7 +245,7 @@ export function traverseSharedSliceContent({
|
|
|
245
245
|
}
|
|
246
246
|
}, {})
|
|
247
247
|
|
|
248
|
-
const items =
|
|
248
|
+
const items = traverseGroupItemsContent({
|
|
249
249
|
path: path.concat([{ key: "items", type: "items" }]),
|
|
250
250
|
model: model?.fields.items,
|
|
251
251
|
content: content.widget.items,
|
|
@@ -6,11 +6,18 @@ import type {
|
|
|
6
6
|
TraverseWidgetContentFn,
|
|
7
7
|
} from "../../../../_internal/utils"
|
|
8
8
|
import type {
|
|
9
|
+
Group,
|
|
9
10
|
NestableWidget,
|
|
10
|
-
NestedGroup,
|
|
11
11
|
VariationFields,
|
|
12
12
|
} from "../../../../customtypes"
|
|
13
13
|
import type { LegacyContentCtx } from "../../../LegacyContentCtx"
|
|
14
|
+
import {
|
|
15
|
+
GroupContent,
|
|
16
|
+
GroupItemContent,
|
|
17
|
+
GroupLegacy,
|
|
18
|
+
isGroupContent,
|
|
19
|
+
traverseGroupContent,
|
|
20
|
+
} from "../../GroupContent"
|
|
14
21
|
import {
|
|
15
22
|
isNestableContent,
|
|
16
23
|
NestableContent,
|
|
@@ -20,35 +27,24 @@ import type {
|
|
|
20
27
|
SharedSliceItemContent,
|
|
21
28
|
SimpleSliceItemContent,
|
|
22
29
|
} from "../SliceItem"
|
|
23
|
-
import {
|
|
24
|
-
isRepeatableWidgetContent,
|
|
25
|
-
RepeatableWidgetContent,
|
|
26
|
-
RepeatableWidgetItemContent,
|
|
27
|
-
RepeatableWidgetLegacy,
|
|
28
|
-
traverseRepeatableWidgetContent,
|
|
29
|
-
} from "./RepeatableContent"
|
|
30
30
|
|
|
31
|
-
export const SimpleSliceContent = t.union([
|
|
32
|
-
NestableContent,
|
|
33
|
-
RepeatableWidgetContent,
|
|
34
|
-
])
|
|
31
|
+
export const SimpleSliceContent = t.union([NestableContent, GroupContent])
|
|
35
32
|
export type SimpleSliceContent = t.TypeOf<typeof SimpleSliceContent>
|
|
36
33
|
|
|
37
34
|
export const isSimpleSliceContent = (u: unknown): u is SimpleSliceContent =>
|
|
38
|
-
isNestableContent(u) ||
|
|
35
|
+
isNestableContent(u) || isGroupContent(u)
|
|
39
36
|
|
|
40
37
|
export const SimpleSliceLegacy = (ctx: LegacyContentCtx) => {
|
|
41
38
|
return {
|
|
42
39
|
decode: (() => {
|
|
43
|
-
if (ctx.fieldType === "Group")
|
|
44
|
-
return RepeatableWidgetLegacy(ctx).decode.bind(null)
|
|
40
|
+
if (ctx.fieldType === "Group") return GroupLegacy(ctx).decode.bind(null)
|
|
45
41
|
return NestableLegacy(ctx).decode.bind(null)
|
|
46
42
|
})(),
|
|
47
43
|
|
|
48
44
|
encode: (value: SimpleSliceContent) => {
|
|
49
45
|
switch (value.__TYPE__) {
|
|
50
46
|
case "GroupContentType":
|
|
51
|
-
return
|
|
47
|
+
return GroupLegacy(ctx).encode(value)
|
|
52
48
|
default:
|
|
53
49
|
return NestableLegacy(ctx).encode(value)
|
|
54
50
|
}
|
|
@@ -67,15 +63,15 @@ export function traverseSimpleSliceContent({
|
|
|
67
63
|
sliceKey: string
|
|
68
64
|
sliceName: string
|
|
69
65
|
content: SimpleSliceItemContent
|
|
70
|
-
model?: VariationFields |
|
|
66
|
+
model?: VariationFields | Group | NestableWidget | undefined
|
|
71
67
|
}) {
|
|
72
68
|
return (
|
|
73
69
|
transformWidget: TraverseWidgetContentFn,
|
|
74
70
|
transformSlice: TraverseSliceContentFn,
|
|
75
71
|
): SharedSliceItemContent | SimpleSliceItemContent | undefined => {
|
|
76
|
-
if (
|
|
77
|
-
const convertedGroupWidget:
|
|
78
|
-
|
|
72
|
+
if (isGroupContent(content.widget)) {
|
|
73
|
+
const convertedGroupWidget: GroupContent | undefined =
|
|
74
|
+
traverseGroupContent({
|
|
79
75
|
path,
|
|
80
76
|
key: content.key,
|
|
81
77
|
apiId: content.name,
|
|
@@ -154,7 +150,7 @@ export function migrateSimpleSlice(
|
|
|
154
150
|
items: content.widget.value.map((groupItem) => {
|
|
155
151
|
return {
|
|
156
152
|
__TYPE__: "GroupItemContent",
|
|
157
|
-
value: groupItem.value.reduce<
|
|
153
|
+
value: groupItem.value.reduce<GroupItemContent["value"]>(
|
|
158
154
|
(acc, [fieldKey, fieldContent]) => {
|
|
159
155
|
return model.fields.items?.[fieldKey]
|
|
160
156
|
? acc.concat([[fieldKey, fieldContent]])
|
|
@@ -47,7 +47,6 @@ export const SliceContent = t.union([
|
|
|
47
47
|
export type SliceContent = t.TypeOf<typeof SliceContent>
|
|
48
48
|
|
|
49
49
|
export * from "./CompositeSliceContent"
|
|
50
|
-
export * from "./RepeatableContent"
|
|
51
50
|
export * from "./SharedSliceContent"
|
|
52
51
|
export * from "./SimpleSliceContent"
|
|
53
52
|
export * from "./SlicePrimaryContent"
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
type StaticSlices,
|
|
13
13
|
CompositeSlice,
|
|
14
|
+
Group,
|
|
14
15
|
isCompositeSlice,
|
|
15
16
|
isLegacySlice,
|
|
16
17
|
isStaticSharedSlice,
|
|
17
18
|
NestableWidget,
|
|
18
|
-
NestedGroup,
|
|
19
19
|
SharedSlice,
|
|
20
20
|
VariationFields,
|
|
21
21
|
} from "../../../customtypes"
|
|
@@ -177,7 +177,7 @@ function findSliceModel(
|
|
|
177
177
|
const legacySliceModel = ():
|
|
178
178
|
| NestableWidget
|
|
179
179
|
| CompositeSlice
|
|
180
|
-
|
|
|
180
|
+
| Group
|
|
181
181
|
| undefined => {
|
|
182
182
|
if (!defaultModel) return
|
|
183
183
|
|