@prismicio/types-internal 3.10.0-alpha.0 → 3.10.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/content/fields/RepeatableContent.d.ts +51 -123
- package/lib/content/fields/RepeatableContent.js +10 -14
- package/lib/customtypes/Section.js +1 -17
- package/lib/customtypes/widgets/Group.js +1 -16
- package/lib/customtypes/widgets/slices/SharedSlice.js +1 -16
- package/lib/customtypes/widgets/slices/Slices.js +2 -16
- package/package.json +1 -1
- package/src/customtypes/Section.ts +1 -17
- package/src/customtypes/widgets/Group.ts +1 -16
- package/src/customtypes/widgets/slices/SharedSlice.ts +1 -16
- package/src/customtypes/widgets/slices/Slices.ts +2 -16
|
@@ -1,90 +1,18 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import type { ContentPath, TraverseWidgetContentFn } from "../../_internal/utils";
|
|
3
|
-
import {
|
|
3
|
+
import type { Link, NestableWidget } from "../../customtypes";
|
|
4
4
|
import type { LegacyContentCtx, WithTypes } from "../LegacyContentCtx";
|
|
5
|
-
export declare const RepeatableContentType: "RepeatableContent";
|
|
6
|
-
export declare const RepeatableFieldType: "Repeatable";
|
|
7
|
-
export declare const RepeatableItemContent: t.ExactC<t.TypeC<{
|
|
8
|
-
__TYPE__: t.LiteralC<"LinkContent">;
|
|
9
|
-
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
10
|
-
__TYPE__: t.LiteralC<"ImageLink">;
|
|
11
|
-
}>>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
12
|
-
kind: t.StringC;
|
|
13
|
-
id: t.StringC;
|
|
14
|
-
url: t.StringC;
|
|
15
|
-
height: t.StringC;
|
|
16
|
-
width: t.StringC;
|
|
17
|
-
size: t.StringC;
|
|
18
|
-
name: t.StringC;
|
|
19
|
-
}>>, t.ExactC<t.PartialC<{
|
|
20
|
-
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
21
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
22
|
-
text: t.StringC;
|
|
23
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
24
|
-
kind: t.LiteralC<"image">;
|
|
25
|
-
text: t.StringC;
|
|
26
|
-
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
27
|
-
__TYPE__: t.LiteralC<"FileLink">;
|
|
28
|
-
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
29
|
-
kind: t.StringC;
|
|
30
|
-
id: t.StringC;
|
|
31
|
-
url: t.StringC;
|
|
32
|
-
name: t.StringC;
|
|
33
|
-
size: t.StringC;
|
|
34
|
-
}>, t.PartialC<{
|
|
35
|
-
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
36
|
-
}>]>>, t.ExactC<t.PartialC<{
|
|
37
|
-
text: t.StringC;
|
|
38
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
39
|
-
kind: t.LiteralC<"file">;
|
|
40
|
-
text: t.StringC;
|
|
41
|
-
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
42
|
-
__TYPE__: t.LiteralC<"DocumentLink">;
|
|
43
|
-
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
44
|
-
id: t.Type<string, string, unknown>;
|
|
45
|
-
}>>, t.ExactC<t.PartialC<{
|
|
46
|
-
text: t.StringC;
|
|
47
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
48
|
-
kind: t.LiteralC<"document">;
|
|
49
|
-
text: t.StringC;
|
|
50
|
-
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
51
|
-
__TYPE__: t.LiteralC<"ExternalLink">;
|
|
52
|
-
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
53
|
-
url: t.StringC;
|
|
54
|
-
}>, t.PartialC<{
|
|
55
|
-
kind: t.LiteralC<"web">;
|
|
56
|
-
target: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
57
|
-
preview: t.UnionC<[t.Type<{
|
|
58
|
-
title?: string;
|
|
59
|
-
}, {
|
|
60
|
-
title?: string;
|
|
61
|
-
}, unknown>, t.NullC, t.UndefinedC]>;
|
|
62
|
-
}>]>>, t.ExactC<t.PartialC<{
|
|
63
|
-
text: t.StringC;
|
|
64
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
65
|
-
kind: t.LiteralC<"web">;
|
|
66
|
-
text: t.StringC;
|
|
67
|
-
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
68
|
-
__TYPE__: t.LiteralC<"MediaLink">;
|
|
69
|
-
}>>, t.ExactC<t.TypeC<{
|
|
70
|
-
kind: t.LiteralC<"media">;
|
|
71
|
-
text: t.StringC;
|
|
72
|
-
}>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
73
|
-
__TYPE__: t.LiteralC<"AnyLink">;
|
|
74
|
-
}>>, t.ExactC<t.TypeC<{
|
|
75
|
-
text: t.StringC;
|
|
76
|
-
}>>]>]>;
|
|
77
|
-
}>>;
|
|
78
|
-
export declare type RepeatableItemContent = t.TypeOf<typeof RepeatableItemContent>;
|
|
79
5
|
export declare const RepeatableContent: t.ExactC<t.TypeC<{
|
|
80
6
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
81
|
-
type: t.
|
|
82
|
-
value: t.ArrayC<t.ExactC<t.TypeC<{
|
|
7
|
+
type: t.LiteralC<"Link">;
|
|
8
|
+
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
9
|
+
key: t.Type<string, string, unknown>;
|
|
10
|
+
}>>, t.ExactC<t.TypeC<{
|
|
83
11
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
84
12
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
85
13
|
__TYPE__: t.LiteralC<"ImageLink">;
|
|
86
|
-
}>>, t.
|
|
87
|
-
kind: t.
|
|
14
|
+
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
15
|
+
kind: t.Type<"image", "image", unknown>;
|
|
88
16
|
id: t.StringC;
|
|
89
17
|
url: t.StringC;
|
|
90
18
|
height: t.StringC;
|
|
@@ -93,38 +21,35 @@ export declare const RepeatableContent: t.ExactC<t.TypeC<{
|
|
|
93
21
|
name: t.StringC;
|
|
94
22
|
}>>, t.ExactC<t.PartialC<{
|
|
95
23
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
96
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
97
|
-
text: t.StringC;
|
|
98
24
|
}>>]>, t.ExactC<t.TypeC<{
|
|
99
25
|
kind: t.LiteralC<"image">;
|
|
26
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
100
27
|
text: t.StringC;
|
|
101
28
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
102
29
|
__TYPE__: t.LiteralC<"FileLink">;
|
|
103
|
-
}>>, t.
|
|
104
|
-
kind: t.
|
|
30
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
31
|
+
kind: t.Type<"file", "file", unknown>;
|
|
105
32
|
id: t.StringC;
|
|
106
33
|
url: t.StringC;
|
|
107
34
|
name: t.StringC;
|
|
108
35
|
size: t.StringC;
|
|
109
36
|
}>, t.PartialC<{
|
|
110
37
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
111
|
-
}>]>>, t.ExactC<t.
|
|
112
|
-
text: t.StringC;
|
|
113
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
38
|
+
}>]>>, t.ExactC<t.TypeC<{
|
|
114
39
|
kind: t.LiteralC<"file">;
|
|
40
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
115
41
|
text: t.StringC;
|
|
116
42
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
117
43
|
__TYPE__: t.LiteralC<"DocumentLink">;
|
|
118
|
-
}>>, t.
|
|
44
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{
|
|
119
45
|
id: t.Type<string, string, unknown>;
|
|
120
|
-
}>>, t.ExactC<t.
|
|
121
|
-
text: t.StringC;
|
|
122
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
46
|
+
}>>, t.ExactC<t.TypeC<{
|
|
123
47
|
kind: t.LiteralC<"document">;
|
|
48
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
124
49
|
text: t.StringC;
|
|
125
50
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
126
51
|
__TYPE__: t.LiteralC<"ExternalLink">;
|
|
127
|
-
}>>, t.
|
|
52
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
128
53
|
url: t.StringC;
|
|
129
54
|
}>, t.PartialC<{
|
|
130
55
|
kind: t.LiteralC<"web">;
|
|
@@ -134,33 +59,37 @@ export declare const RepeatableContent: t.ExactC<t.TypeC<{
|
|
|
134
59
|
}, {
|
|
135
60
|
title?: string;
|
|
136
61
|
}, unknown>, t.NullC, t.UndefinedC]>;
|
|
137
|
-
}>]>>, t.ExactC<t.
|
|
138
|
-
text: t.StringC;
|
|
139
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
62
|
+
}>]>>, t.ExactC<t.TypeC<{
|
|
140
63
|
kind: t.LiteralC<"web">;
|
|
64
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
141
65
|
text: t.StringC;
|
|
142
66
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
143
67
|
__TYPE__: t.LiteralC<"MediaLink">;
|
|
144
|
-
}>>, t.ExactC<t.TypeC<{
|
|
68
|
+
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
145
69
|
kind: t.LiteralC<"media">;
|
|
70
|
+
}>>, t.ExactC<t.PartialC<{
|
|
146
71
|
text: t.StringC;
|
|
147
|
-
}>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
72
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
148
73
|
__TYPE__: t.LiteralC<"AnyLink">;
|
|
149
|
-
}>>, t.ExactC<t.TypeC<{
|
|
74
|
+
}>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
75
|
+
kind: t.LiteralC<"any">;
|
|
76
|
+
}>, t.PartialC<{
|
|
150
77
|
text: t.StringC;
|
|
151
|
-
}>>]>]>;
|
|
152
|
-
}
|
|
78
|
+
}>]>>]>]>;
|
|
79
|
+
}>>]>>;
|
|
153
80
|
}>>;
|
|
154
81
|
export declare type RepeatableContent = t.TypeOf<typeof RepeatableContent>;
|
|
155
82
|
export declare const isRepeatableContent: t.Is<{
|
|
156
83
|
__TYPE__: "RepeatableContent";
|
|
157
|
-
type: "
|
|
158
|
-
value: {
|
|
84
|
+
type: "Link";
|
|
85
|
+
value: ({
|
|
86
|
+
key: string;
|
|
87
|
+
} & {
|
|
159
88
|
__TYPE__: "LinkContent";
|
|
160
89
|
value: ({
|
|
161
90
|
__TYPE__: "ImageLink";
|
|
162
|
-
} & (({
|
|
163
|
-
kind:
|
|
91
|
+
} & ((({
|
|
92
|
+
kind: "image";
|
|
164
93
|
id: string;
|
|
165
94
|
url: string;
|
|
166
95
|
height: string;
|
|
@@ -169,43 +98,41 @@ export declare const isRepeatableContent: t.Is<{
|
|
|
169
98
|
name: string;
|
|
170
99
|
} & {
|
|
171
100
|
date?: string | null | undefined;
|
|
172
|
-
} & {
|
|
173
|
-
text?: string;
|
|
174
101
|
}) | {
|
|
175
102
|
kind: "image";
|
|
176
|
-
|
|
103
|
+
}) & {
|
|
104
|
+
text?: string;
|
|
177
105
|
})) | ({
|
|
178
106
|
__TYPE__: "FileLink";
|
|
179
|
-
} & (({
|
|
180
|
-
kind:
|
|
107
|
+
} & ((({
|
|
108
|
+
kind: "file";
|
|
181
109
|
id: string;
|
|
182
110
|
url: string;
|
|
183
111
|
name: string;
|
|
184
112
|
size: string;
|
|
185
113
|
} & {
|
|
186
114
|
date?: string | null | undefined;
|
|
187
|
-
} & {
|
|
188
|
-
text?: string;
|
|
189
115
|
}) | {
|
|
190
116
|
kind: "file";
|
|
191
|
-
|
|
117
|
+
}) & {
|
|
118
|
+
text?: string;
|
|
192
119
|
})) | ({
|
|
193
120
|
__TYPE__: "MediaLink";
|
|
194
121
|
} & {
|
|
195
122
|
kind: "media";
|
|
196
|
-
|
|
123
|
+
} & {
|
|
124
|
+
text?: string;
|
|
197
125
|
}) | ({
|
|
198
126
|
__TYPE__: "DocumentLink";
|
|
199
127
|
} & (({
|
|
200
128
|
id: string;
|
|
201
|
-
}
|
|
202
|
-
text?: string;
|
|
203
|
-
}) | {
|
|
129
|
+
} | {
|
|
204
130
|
kind: "document";
|
|
205
|
-
|
|
131
|
+
}) & {
|
|
132
|
+
text?: string;
|
|
206
133
|
})) | ({
|
|
207
134
|
__TYPE__: "ExternalLink";
|
|
208
|
-
} & (({
|
|
135
|
+
} & ((({
|
|
209
136
|
url: string;
|
|
210
137
|
} & {
|
|
211
138
|
kind?: "web";
|
|
@@ -213,19 +140,20 @@ export declare const isRepeatableContent: t.Is<{
|
|
|
213
140
|
preview?: {
|
|
214
141
|
title?: string;
|
|
215
142
|
} | null | undefined;
|
|
216
|
-
} & {
|
|
217
|
-
text?: string;
|
|
218
143
|
}) | {
|
|
219
144
|
kind: "web";
|
|
220
|
-
|
|
145
|
+
}) & {
|
|
146
|
+
text?: string;
|
|
221
147
|
})) | ({
|
|
222
148
|
__TYPE__: "AnyLink";
|
|
223
149
|
} & {
|
|
224
|
-
|
|
150
|
+
kind: "any";
|
|
151
|
+
} & {
|
|
152
|
+
text?: string;
|
|
225
153
|
});
|
|
226
|
-
}[];
|
|
154
|
+
})[];
|
|
227
155
|
}>;
|
|
228
|
-
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType:
|
|
156
|
+
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: "Link") => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>;
|
|
229
157
|
export declare type RepeatableCustomType = Link;
|
|
230
158
|
export declare function traverseRepeatableContent({ path, key, apiId, model, content, }: {
|
|
231
159
|
path: ContentPath;
|
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.traverseRepeatableContent = exports.RepeatableLegacy = exports.isRepeatableContent = exports.RepeatableContent =
|
|
3
|
+
exports.traverseRepeatableContent = exports.RepeatableLegacy = exports.isRepeatableContent = exports.RepeatableContent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fp_ts_1 = require("fp-ts");
|
|
6
6
|
const Either_1 = require("fp-ts/lib/Either");
|
|
7
7
|
const function_1 = require("fp-ts/lib/function");
|
|
8
8
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
9
|
-
const customtypes_1 = require("../../customtypes");
|
|
10
9
|
const nestable_1 = require("./nestable");
|
|
11
|
-
exports.RepeatableContentType = "RepeatableContent";
|
|
12
|
-
exports.RepeatableFieldType = "Repeatable";
|
|
13
|
-
exports.RepeatableItemContent = nestable_1.LinkContent;
|
|
14
10
|
exports.RepeatableContent = t.strict({
|
|
15
|
-
__TYPE__: t.literal(
|
|
16
|
-
type:
|
|
17
|
-
|
|
18
|
-
value: t.array(exports.RepeatableItemContent),
|
|
11
|
+
__TYPE__: t.literal("RepeatableContent"),
|
|
12
|
+
type: t.literal("Link"),
|
|
13
|
+
value: t.array(nestable_1.LinkContent),
|
|
19
14
|
});
|
|
20
15
|
exports.isRepeatableContent = exports.RepeatableContent.is;
|
|
21
16
|
const RepeatableLegacy = (ctx, fieldType) => {
|
|
22
|
-
const codecDecode = t.array(t.unknown);
|
|
23
|
-
const codecEncode = t.array(exports.RepeatableItemContent);
|
|
24
17
|
return new t.Type("RepeatableLegacy", exports.isRepeatableContent, (items) => {
|
|
25
|
-
const parsed = (0, function_1.pipe)(
|
|
18
|
+
const parsed = (0, function_1.pipe)(t.array(t.unknown).decode(items), fp_ts_1.either.map((items) => {
|
|
26
19
|
const parsedItems = items.reduce((acc, item) => {
|
|
27
20
|
let result;
|
|
28
21
|
switch (fieldType) {
|
|
@@ -39,12 +32,12 @@ const RepeatableLegacy = (ctx, fieldType) => {
|
|
|
39
32
|
return {
|
|
40
33
|
value: parsedItems,
|
|
41
34
|
type: fieldType,
|
|
42
|
-
__TYPE__:
|
|
35
|
+
__TYPE__: "RepeatableContent",
|
|
43
36
|
};
|
|
44
37
|
}));
|
|
45
38
|
return parsed;
|
|
46
39
|
}, (r) => {
|
|
47
|
-
const res =
|
|
40
|
+
const res = t.array(nestable_1.LinkContent).encode(r.value);
|
|
48
41
|
const encodedItems = res.reduce((acc, item) => {
|
|
49
42
|
let encoded;
|
|
50
43
|
switch (item.__TYPE__) {
|
|
@@ -79,6 +72,9 @@ function traverseRepeatableContent({ path, key, apiId, model, content, }) {
|
|
|
79
72
|
// Can happen if the transform function returns undefined to filter out a field
|
|
80
73
|
if (!transformedField)
|
|
81
74
|
return acc;
|
|
75
|
+
// If the transformed field is not a link content, we don't include it
|
|
76
|
+
if (!(0, nestable_1.isLinkContent)(transformedField))
|
|
77
|
+
return acc;
|
|
82
78
|
return acc.concat(transformedField);
|
|
83
79
|
}, []);
|
|
84
80
|
return transform({
|
|
@@ -45,23 +45,7 @@ function traverseSection(args) {
|
|
|
45
45
|
}),
|
|
46
46
|
});
|
|
47
47
|
break;
|
|
48
|
-
|
|
49
|
-
case "Color":
|
|
50
|
-
case "Date":
|
|
51
|
-
case "Embed":
|
|
52
|
-
case "GeoPoint":
|
|
53
|
-
case "Image":
|
|
54
|
-
case "IntegrationFields":
|
|
55
|
-
case "Link":
|
|
56
|
-
case "Number":
|
|
57
|
-
case "Range":
|
|
58
|
-
case "Select":
|
|
59
|
-
case "Separator":
|
|
60
|
-
case "StructuredText":
|
|
61
|
-
case "Table":
|
|
62
|
-
case "Text":
|
|
63
|
-
case "Timestamp":
|
|
64
|
-
case "UID":
|
|
48
|
+
default:
|
|
65
49
|
model = onField({
|
|
66
50
|
path,
|
|
67
51
|
key,
|
|
@@ -70,22 +70,7 @@ function traverseGroup(args) {
|
|
|
70
70
|
onField: onField,
|
|
71
71
|
});
|
|
72
72
|
break;
|
|
73
|
-
|
|
74
|
-
case "Color":
|
|
75
|
-
case "Date":
|
|
76
|
-
case "Embed":
|
|
77
|
-
case "GeoPoint":
|
|
78
|
-
case "Image":
|
|
79
|
-
case "IntegrationFields":
|
|
80
|
-
case "Link":
|
|
81
|
-
case "Number":
|
|
82
|
-
case "Range":
|
|
83
|
-
case "Select":
|
|
84
|
-
case "Separator":
|
|
85
|
-
case "StructuredText":
|
|
86
|
-
case "Table":
|
|
87
|
-
case "Text":
|
|
88
|
-
case "Timestamp":
|
|
73
|
+
default:
|
|
89
74
|
field = prevField;
|
|
90
75
|
break;
|
|
91
76
|
}
|
|
@@ -63,22 +63,7 @@ function traverseVariation(args) {
|
|
|
63
63
|
onField: onField,
|
|
64
64
|
});
|
|
65
65
|
break;
|
|
66
|
-
|
|
67
|
-
case "Color":
|
|
68
|
-
case "Date":
|
|
69
|
-
case "Embed":
|
|
70
|
-
case "GeoPoint":
|
|
71
|
-
case "Image":
|
|
72
|
-
case "IntegrationFields":
|
|
73
|
-
case "Link":
|
|
74
|
-
case "Number":
|
|
75
|
-
case "Range":
|
|
76
|
-
case "Select":
|
|
77
|
-
case "Separator":
|
|
78
|
-
case "StructuredText":
|
|
79
|
-
case "Table":
|
|
80
|
-
case "Text":
|
|
81
|
-
case "Timestamp":
|
|
66
|
+
default:
|
|
82
67
|
field = prevField;
|
|
83
68
|
break;
|
|
84
69
|
}
|
|
@@ -104,6 +104,7 @@ function traverseSlices(args) {
|
|
|
104
104
|
else
|
|
105
105
|
model = prevModel;
|
|
106
106
|
break;
|
|
107
|
+
// Group and other fields are technically possible because of legacy slices.
|
|
107
108
|
case "Group":
|
|
108
109
|
model = onField({
|
|
109
110
|
path,
|
|
@@ -115,22 +116,7 @@ function traverseSlices(args) {
|
|
|
115
116
|
}),
|
|
116
117
|
});
|
|
117
118
|
break;
|
|
118
|
-
|
|
119
|
-
case "Color":
|
|
120
|
-
case "Date":
|
|
121
|
-
case "Embed":
|
|
122
|
-
case "GeoPoint":
|
|
123
|
-
case "Image":
|
|
124
|
-
case "IntegrationFields":
|
|
125
|
-
case "Link":
|
|
126
|
-
case "Number":
|
|
127
|
-
case "Range":
|
|
128
|
-
case "Select":
|
|
129
|
-
case "Separator":
|
|
130
|
-
case "StructuredText":
|
|
131
|
-
case "Table":
|
|
132
|
-
case "Text":
|
|
133
|
-
case "Timestamp":
|
|
119
|
+
default:
|
|
134
120
|
model = onField({
|
|
135
121
|
path,
|
|
136
122
|
key,
|
package/package.json
CHANGED
|
@@ -74,23 +74,7 @@ export function traverseSection<
|
|
|
74
74
|
}),
|
|
75
75
|
})
|
|
76
76
|
break
|
|
77
|
-
|
|
78
|
-
case "Color":
|
|
79
|
-
case "Date":
|
|
80
|
-
case "Embed":
|
|
81
|
-
case "GeoPoint":
|
|
82
|
-
case "Image":
|
|
83
|
-
case "IntegrationFields":
|
|
84
|
-
case "Link":
|
|
85
|
-
case "Number":
|
|
86
|
-
case "Range":
|
|
87
|
-
case "Select":
|
|
88
|
-
case "Separator":
|
|
89
|
-
case "StructuredText":
|
|
90
|
-
case "Table":
|
|
91
|
-
case "Text":
|
|
92
|
-
case "Timestamp":
|
|
93
|
-
case "UID":
|
|
77
|
+
default:
|
|
94
78
|
model = onField({
|
|
95
79
|
path,
|
|
96
80
|
key,
|
|
@@ -101,22 +101,7 @@ export function traverseGroup(args: {
|
|
|
101
101
|
onField: onField as OnFieldFn<NestableWidget>,
|
|
102
102
|
})
|
|
103
103
|
break
|
|
104
|
-
|
|
105
|
-
case "Color":
|
|
106
|
-
case "Date":
|
|
107
|
-
case "Embed":
|
|
108
|
-
case "GeoPoint":
|
|
109
|
-
case "Image":
|
|
110
|
-
case "IntegrationFields":
|
|
111
|
-
case "Link":
|
|
112
|
-
case "Number":
|
|
113
|
-
case "Range":
|
|
114
|
-
case "Select":
|
|
115
|
-
case "Separator":
|
|
116
|
-
case "StructuredText":
|
|
117
|
-
case "Table":
|
|
118
|
-
case "Text":
|
|
119
|
-
case "Timestamp":
|
|
104
|
+
default:
|
|
120
105
|
field = prevField
|
|
121
106
|
break
|
|
122
107
|
}
|
|
@@ -94,22 +94,7 @@ export function traverseVariation(args: {
|
|
|
94
94
|
onField: onField as OnFieldFn<NestableWidget | NestedGroup>,
|
|
95
95
|
})
|
|
96
96
|
break
|
|
97
|
-
|
|
98
|
-
case "Color":
|
|
99
|
-
case "Date":
|
|
100
|
-
case "Embed":
|
|
101
|
-
case "GeoPoint":
|
|
102
|
-
case "Image":
|
|
103
|
-
case "IntegrationFields":
|
|
104
|
-
case "Link":
|
|
105
|
-
case "Number":
|
|
106
|
-
case "Range":
|
|
107
|
-
case "Select":
|
|
108
|
-
case "Separator":
|
|
109
|
-
case "StructuredText":
|
|
110
|
-
case "Table":
|
|
111
|
-
case "Text":
|
|
112
|
-
case "Timestamp":
|
|
97
|
+
default:
|
|
113
98
|
field = prevField
|
|
114
99
|
break
|
|
115
100
|
}
|
|
@@ -144,6 +144,7 @@ export function traverseSlices<T extends DynamicSlices | StaticSlices>(args: {
|
|
|
144
144
|
})
|
|
145
145
|
else model = prevModel
|
|
146
146
|
break
|
|
147
|
+
// Group and other fields are technically possible because of legacy slices.
|
|
147
148
|
case "Group":
|
|
148
149
|
model = onField({
|
|
149
150
|
path,
|
|
@@ -155,22 +156,7 @@ export function traverseSlices<T extends DynamicSlices | StaticSlices>(args: {
|
|
|
155
156
|
}),
|
|
156
157
|
})
|
|
157
158
|
break
|
|
158
|
-
|
|
159
|
-
case "Color":
|
|
160
|
-
case "Date":
|
|
161
|
-
case "Embed":
|
|
162
|
-
case "GeoPoint":
|
|
163
|
-
case "Image":
|
|
164
|
-
case "IntegrationFields":
|
|
165
|
-
case "Link":
|
|
166
|
-
case "Number":
|
|
167
|
-
case "Range":
|
|
168
|
-
case "Select":
|
|
169
|
-
case "Separator":
|
|
170
|
-
case "StructuredText":
|
|
171
|
-
case "Table":
|
|
172
|
-
case "Text":
|
|
173
|
-
case "Timestamp":
|
|
159
|
+
default:
|
|
174
160
|
model = onField({
|
|
175
161
|
path,
|
|
176
162
|
key,
|