@prismicio/types-internal 3.0.0 → 3.1.0-alpha.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 +3 -2
- package/lib/content/Document.d.ts +1561 -361
- package/lib/content/Document.js +11 -0
- package/lib/content/LegacyContentCtx.d.ts +2 -2
- package/lib/content/LegacyContentCtx.js +4 -1
- package/lib/content/fields/GroupContent.js +13 -0
- package/lib/content/fields/RepeatableContent.d.ts +34 -40
- package/lib/content/fields/WidgetContent.d.ts +1558 -358
- package/lib/content/fields/index.d.ts +1 -0
- package/lib/content/fields/index.js +1 -0
- package/lib/content/fields/nestable/LinkContent.d.ts +122 -146
- package/lib/content/fields/nestable/LinkContent.js +19 -39
- package/lib/content/fields/nestable/NestableContent.d.ts +254 -54
- package/lib/content/fields/nestable/NestableContent.js +8 -1
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +66 -66
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +510 -110
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +86 -18
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +512 -112
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +20 -4
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +255 -55
- package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +255 -55
- package/lib/content/fields/slices/Slice/index.d.ts +855 -185
- package/lib/content/fields/slices/SliceItem.d.ts +854 -184
- package/lib/content/fields/slices/SlicesContent.d.ts +1278 -278
- package/lib/customtypes/CustomType.d.ts +18 -0
- package/lib/customtypes/Section.d.ts +18 -0
- package/lib/customtypes/diff/SharedSlice.d.ts +8 -0
- package/lib/customtypes/diff/Variation.d.ts +8 -0
- package/lib/customtypes/widgets/Group.d.ts +6 -0
- package/lib/customtypes/widgets/Widget.d.ts +21 -0
- package/lib/customtypes/widgets/nestable/Link.d.ts +10 -0
- package/lib/customtypes/widgets/nestable/Link.js +5 -0
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +1 -0
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +2 -0
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +2 -0
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +8 -0
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +6 -0
- package/lib/customtypes/widgets/slices/Slices.d.ts +28 -0
- package/package.json +2 -1
- package/src/_internal/utils.ts +3 -1
- package/src/content/Document.ts +12 -0
- package/src/content/LegacyContentCtx.ts +4 -1
- package/src/content/fields/GroupContent.ts +13 -0
- package/src/content/fields/RepeatableContent.ts +147 -0
- package/src/content/fields/index.ts +1 -0
- package/src/content/fields/nestable/LinkContent.ts +19 -39
- package/src/content/fields/nestable/NestableContent.ts +12 -1
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +18 -0
- package/src/customtypes/widgets/nestable/Link.ts +6 -0
- package/lib/content/fields/nestable/RichTextContent/TextBlock.d.ts +0 -727
- package/lib/content/fields/nestable/RichTextContent/TextBlock.js +0 -80
- package/lib/customtypes/widgets/slices/SliceWidget.d.ts +0 -327
- package/lib/customtypes/widgets/slices/SliceWidget.js +0 -8
|
@@ -68,15 +68,9 @@ exports.FilledImageLinkContent = t.intersection([
|
|
|
68
68
|
}),
|
|
69
69
|
filledImageLinkLegacyCodec,
|
|
70
70
|
]);
|
|
71
|
-
const imageLinkLegacyCodec = t.
|
|
72
|
-
t.
|
|
73
|
-
|
|
74
|
-
t.exact(t.partial({ text: t.string })),
|
|
75
|
-
]),
|
|
76
|
-
t.strict({
|
|
77
|
-
kind: t.literal("image"),
|
|
78
|
-
text: t.string,
|
|
79
|
-
}),
|
|
71
|
+
const imageLinkLegacyCodec = t.intersection([
|
|
72
|
+
t.union([filledImageLinkLegacyCodec, t.strict({ kind: t.literal("image") })]),
|
|
73
|
+
t.exact(t.partial({ text: t.string })),
|
|
80
74
|
]);
|
|
81
75
|
const ImageLinkLegacy = new t.Type("ImageLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.ImageLinkType, (image) => {
|
|
82
76
|
return (0, function_1.pipe)(imageLinkLegacyCodec.decode(image), fp_ts_1.either.map((parsedImage) => {
|
|
@@ -126,15 +120,9 @@ exports.FilledFileLinkContent = t.intersection([
|
|
|
126
120
|
}),
|
|
127
121
|
filledFileLinkLegacyCodec,
|
|
128
122
|
]);
|
|
129
|
-
const fileLinkLegacyCodec = t.
|
|
130
|
-
t.
|
|
131
|
-
|
|
132
|
-
t.exact(t.partial({ text: t.string })),
|
|
133
|
-
]),
|
|
134
|
-
t.strict({
|
|
135
|
-
kind: t.literal("file"),
|
|
136
|
-
text: t.string,
|
|
137
|
-
}),
|
|
123
|
+
const fileLinkLegacyCodec = t.intersection([
|
|
124
|
+
t.union([filledFileLinkLegacyCodec, t.strict({ kind: t.literal("file") })]),
|
|
125
|
+
t.exact(t.partial({ text: t.string })),
|
|
138
126
|
]);
|
|
139
127
|
const FileLinkLegacy = new t.Type("FileLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.FileLinkType, (file) => {
|
|
140
128
|
return (0, function_1.pipe)(fileLinkLegacyCodec.decode(file), fp_ts_1.either.map((parsedFile) => {
|
|
@@ -154,10 +142,10 @@ exports.FileLinkContent = t.intersection([
|
|
|
154
142
|
]);
|
|
155
143
|
// MediaLink.
|
|
156
144
|
exports.MediaLinkType = "MediaLink";
|
|
157
|
-
const mediaLinkLegacyCodec = t.
|
|
158
|
-
kind: t.literal("media"),
|
|
159
|
-
text: t.string,
|
|
160
|
-
|
|
145
|
+
const mediaLinkLegacyCodec = t.intersection([
|
|
146
|
+
t.strict({ kind: t.literal("media") }),
|
|
147
|
+
t.exact(t.partial({ text: t.string })),
|
|
148
|
+
]);
|
|
161
149
|
const MediaLinkLegacy = new t.Type("MediaLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.MediaLinkType, (mediaLink) => {
|
|
162
150
|
return (0, function_1.pipe)(mediaLinkLegacyCodec.decode(mediaLink), fp_ts_1.either.map((parsedMediaLink) => {
|
|
163
151
|
return exports.MediaLinkContent.encode({
|
|
@@ -195,15 +183,12 @@ exports.FilledDocumentLinkContent = t.intersection([
|
|
|
195
183
|
}),
|
|
196
184
|
filledDocumentLinkLegacyCodec,
|
|
197
185
|
]);
|
|
198
|
-
const documentLinkLegacyCodec = t.
|
|
199
|
-
t.
|
|
186
|
+
const documentLinkLegacyCodec = t.intersection([
|
|
187
|
+
t.union([
|
|
200
188
|
filledDocumentLinkLegacyCodec,
|
|
201
|
-
t.
|
|
189
|
+
t.strict({ kind: t.literal("document") }),
|
|
202
190
|
]),
|
|
203
|
-
t.
|
|
204
|
-
kind: t.literal("document"),
|
|
205
|
-
text: t.string,
|
|
206
|
-
}),
|
|
191
|
+
t.exact(t.partial({ text: t.string })),
|
|
207
192
|
]);
|
|
208
193
|
const DocumentLinkLegacy = new t.Type("DocumentLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.DocumentLinkType, (file) => {
|
|
209
194
|
return (0, function_1.pipe)(documentLinkLegacyCodec.decode(file), fp_ts_1.either.map((parsedDoc) => {
|
|
@@ -249,15 +234,12 @@ exports.FilledExternalLinkContent = t.intersection([
|
|
|
249
234
|
}),
|
|
250
235
|
filledExternalLinkLegacyCodec,
|
|
251
236
|
]);
|
|
252
|
-
const externalLinkLegacyCodec = t.
|
|
253
|
-
t.
|
|
237
|
+
const externalLinkLegacyCodec = t.intersection([
|
|
238
|
+
t.union([
|
|
254
239
|
filledExternalLinkLegacyCodec,
|
|
255
|
-
t.
|
|
240
|
+
t.strict({ kind: t.literal("web") }),
|
|
256
241
|
]),
|
|
257
|
-
t.
|
|
258
|
-
kind: t.literal("web"),
|
|
259
|
-
text: t.string,
|
|
260
|
-
}),
|
|
242
|
+
t.exact(t.partial({ text: t.string })),
|
|
261
243
|
]);
|
|
262
244
|
const ExternalLinkLegacy = new t.Type("ExternalLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.ExternalLinkType, (file) => {
|
|
263
245
|
return (0, function_1.pipe)(externalLinkLegacyCodec.decode(file), fp_ts_1.either.map((parsedLink) => {
|
|
@@ -277,9 +259,7 @@ exports.ExternalLinkContent = t.intersection([
|
|
|
277
259
|
]);
|
|
278
260
|
// AnyLink.
|
|
279
261
|
exports.AnyLinkType = "AnyLink";
|
|
280
|
-
const anyLinkLegacyCodec = t.
|
|
281
|
-
text: t.string,
|
|
282
|
-
});
|
|
262
|
+
const anyLinkLegacyCodec = t.exact(t.partial({ text: t.string }));
|
|
283
263
|
const AnyLinkLegacy = new t.Type("AnyLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.AnyLinkType, (anyLink) => {
|
|
284
264
|
return (0, function_1.pipe)(anyLinkLegacyCodec.decode(anyLink), fp_ts_1.either.map((parsedAnyLink) => {
|
|
285
265
|
return exports.AnyLinkContent.encode({
|
|
@@ -115,7 +115,7 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
115
115
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
116
116
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
117
117
|
__TYPE__: t.LiteralC<"ImageLink">;
|
|
118
|
-
}>>, t.
|
|
118
|
+
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
119
119
|
kind: t.Type<"image", "image", unknown>;
|
|
120
120
|
id: t.StringC;
|
|
121
121
|
url: t.StringC;
|
|
@@ -125,14 +125,13 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
125
125
|
name: t.StringC;
|
|
126
126
|
}>>, t.ExactC<t.PartialC<{
|
|
127
127
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
128
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
129
|
-
text: t.StringC;
|
|
130
128
|
}>>]>, t.ExactC<t.TypeC<{
|
|
131
129
|
kind: t.LiteralC<"image">;
|
|
130
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
132
131
|
text: t.StringC;
|
|
133
132
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
134
133
|
__TYPE__: t.LiteralC<"FileLink">;
|
|
135
|
-
}>>, t.
|
|
134
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
136
135
|
kind: t.Type<"file", "file", unknown>;
|
|
137
136
|
id: t.StringC;
|
|
138
137
|
url: t.StringC;
|
|
@@ -140,23 +139,21 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
140
139
|
size: t.StringC;
|
|
141
140
|
}>, t.PartialC<{
|
|
142
141
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
143
|
-
}>]>>, t.ExactC<t.
|
|
144
|
-
text: t.StringC;
|
|
145
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
142
|
+
}>]>>, t.ExactC<t.TypeC<{
|
|
146
143
|
kind: t.LiteralC<"file">;
|
|
144
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
147
145
|
text: t.StringC;
|
|
148
146
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
149
147
|
__TYPE__: t.LiteralC<"DocumentLink">;
|
|
150
|
-
}>>, t.
|
|
148
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{
|
|
151
149
|
id: t.Type<string, string, unknown>;
|
|
152
|
-
}>>, t.ExactC<t.
|
|
153
|
-
text: t.StringC;
|
|
154
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
150
|
+
}>>, t.ExactC<t.TypeC<{
|
|
155
151
|
kind: t.LiteralC<"document">;
|
|
152
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
156
153
|
text: t.StringC;
|
|
157
154
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
158
155
|
__TYPE__: t.LiteralC<"ExternalLink">;
|
|
159
|
-
}>>, t.
|
|
156
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
160
157
|
url: t.StringC;
|
|
161
158
|
}>, t.PartialC<{
|
|
162
159
|
kind: t.LiteralC<"web">;
|
|
@@ -166,19 +163,19 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
166
163
|
}, {
|
|
167
164
|
title?: string;
|
|
168
165
|
}, unknown>, t.NullC, t.UndefinedC]>;
|
|
169
|
-
}>]>>, t.ExactC<t.
|
|
170
|
-
text: t.StringC;
|
|
171
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
166
|
+
}>]>>, t.ExactC<t.TypeC<{
|
|
172
167
|
kind: t.LiteralC<"web">;
|
|
168
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
173
169
|
text: t.StringC;
|
|
174
170
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
175
171
|
__TYPE__: t.LiteralC<"MediaLink">;
|
|
176
|
-
}>>, t.ExactC<t.TypeC<{
|
|
172
|
+
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
177
173
|
kind: t.LiteralC<"media">;
|
|
174
|
+
}>>, t.ExactC<t.PartialC<{
|
|
178
175
|
text: t.StringC;
|
|
179
|
-
}>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
176
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
180
177
|
__TYPE__: t.LiteralC<"AnyLink">;
|
|
181
|
-
}>>, t.ExactC<t.
|
|
178
|
+
}>>, t.ExactC<t.PartialC<{
|
|
182
179
|
text: t.StringC;
|
|
183
180
|
}>>]>]>;
|
|
184
181
|
}>>, t.ExactC<t.TypeC<{
|
|
@@ -422,6 +419,77 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
422
419
|
}>]>>]>>;
|
|
423
420
|
}>>, t.ExactC<t.TypeC<{
|
|
424
421
|
__TYPE__: t.LiteralC<"SeparatorContent">;
|
|
422
|
+
}>>, t.ExactC<t.TypeC<{
|
|
423
|
+
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
424
|
+
type: t.LiteralC<"Link">;
|
|
425
|
+
value: t.ArrayC<t.ExactC<t.TypeC<{
|
|
426
|
+
__TYPE__: t.LiteralC<"LinkContent">;
|
|
427
|
+
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
428
|
+
__TYPE__: t.LiteralC<"ImageLink">;
|
|
429
|
+
}>>, t.IntersectionC<[t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
430
|
+
kind: t.Type<"image", "image", unknown>;
|
|
431
|
+
id: t.StringC;
|
|
432
|
+
url: t.StringC;
|
|
433
|
+
height: t.StringC;
|
|
434
|
+
width: t.StringC;
|
|
435
|
+
size: t.StringC;
|
|
436
|
+
name: t.StringC;
|
|
437
|
+
}>>, t.ExactC<t.PartialC<{
|
|
438
|
+
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
439
|
+
}>>]>, t.ExactC<t.TypeC<{
|
|
440
|
+
kind: t.LiteralC<"image">;
|
|
441
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
442
|
+
text: t.StringC;
|
|
443
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
444
|
+
__TYPE__: t.LiteralC<"FileLink">;
|
|
445
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
446
|
+
kind: t.Type<"file", "file", unknown>;
|
|
447
|
+
id: t.StringC;
|
|
448
|
+
url: t.StringC;
|
|
449
|
+
name: t.StringC;
|
|
450
|
+
size: t.StringC;
|
|
451
|
+
}>, t.PartialC<{
|
|
452
|
+
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
453
|
+
}>]>>, t.ExactC<t.TypeC<{
|
|
454
|
+
kind: t.LiteralC<"file">;
|
|
455
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
456
|
+
text: t.StringC;
|
|
457
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
458
|
+
__TYPE__: t.LiteralC<"DocumentLink">;
|
|
459
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.TypeC<{
|
|
460
|
+
id: t.Type<string, string, unknown>;
|
|
461
|
+
}>>, t.ExactC<t.TypeC<{
|
|
462
|
+
kind: t.LiteralC<"document">;
|
|
463
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
464
|
+
text: t.StringC;
|
|
465
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
466
|
+
__TYPE__: t.LiteralC<"ExternalLink">;
|
|
467
|
+
}>>, t.IntersectionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
468
|
+
url: t.StringC;
|
|
469
|
+
}>, t.PartialC<{
|
|
470
|
+
kind: t.LiteralC<"web">;
|
|
471
|
+
target: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
472
|
+
preview: t.UnionC<[t.Type<{
|
|
473
|
+
title?: string;
|
|
474
|
+
}, {
|
|
475
|
+
title?: string;
|
|
476
|
+
}, unknown>, t.NullC, t.UndefinedC]>;
|
|
477
|
+
}>]>>, t.ExactC<t.TypeC<{
|
|
478
|
+
kind: t.LiteralC<"web">;
|
|
479
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
480
|
+
text: t.StringC;
|
|
481
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
482
|
+
__TYPE__: t.LiteralC<"MediaLink">;
|
|
483
|
+
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
484
|
+
kind: t.LiteralC<"media">;
|
|
485
|
+
}>>, t.ExactC<t.PartialC<{
|
|
486
|
+
text: t.StringC;
|
|
487
|
+
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
488
|
+
__TYPE__: t.LiteralC<"AnyLink">;
|
|
489
|
+
}>>, t.ExactC<t.PartialC<{
|
|
490
|
+
text: t.StringC;
|
|
491
|
+
}>>]>]>;
|
|
492
|
+
}>>>;
|
|
425
493
|
}>>]>;
|
|
426
494
|
export declare type NestableContent = t.TypeOf<typeof NestableContent>;
|
|
427
495
|
export declare type NestableContentType = NestableContent["__TYPE__"];
|
|
@@ -542,7 +610,7 @@ export declare const isNestableContent: (u: unknown) => u is {
|
|
|
542
610
|
__TYPE__: "LinkContent";
|
|
543
611
|
value: ({
|
|
544
612
|
__TYPE__: "ImageLink";
|
|
545
|
-
} & (({
|
|
613
|
+
} & ((({
|
|
546
614
|
kind: "image";
|
|
547
615
|
id: string;
|
|
548
616
|
url: string;
|
|
@@ -552,14 +620,13 @@ export declare const isNestableContent: (u: unknown) => u is {
|
|
|
552
620
|
name: string;
|
|
553
621
|
} & {
|
|
554
622
|
date?: string | null | undefined;
|
|
555
|
-
} & {
|
|
556
|
-
text?: string;
|
|
557
623
|
}) | {
|
|
558
624
|
kind: "image";
|
|
559
|
-
|
|
625
|
+
}) & {
|
|
626
|
+
text?: string;
|
|
560
627
|
})) | ({
|
|
561
628
|
__TYPE__: "FileLink";
|
|
562
|
-
} & (({
|
|
629
|
+
} & ((({
|
|
563
630
|
kind: "file";
|
|
564
631
|
id: string;
|
|
565
632
|
url: string;
|
|
@@ -567,28 +634,27 @@ export declare const isNestableContent: (u: unknown) => u is {
|
|
|
567
634
|
size: string;
|
|
568
635
|
} & {
|
|
569
636
|
date?: string | null | undefined;
|
|
570
|
-
} & {
|
|
571
|
-
text?: string;
|
|
572
637
|
}) | {
|
|
573
638
|
kind: "file";
|
|
574
|
-
|
|
639
|
+
}) & {
|
|
640
|
+
text?: string;
|
|
575
641
|
})) | ({
|
|
576
642
|
__TYPE__: "MediaLink";
|
|
577
643
|
} & {
|
|
578
644
|
kind: "media";
|
|
579
|
-
|
|
645
|
+
} & {
|
|
646
|
+
text?: string;
|
|
580
647
|
}) | ({
|
|
581
648
|
__TYPE__: "DocumentLink";
|
|
582
649
|
} & (({
|
|
583
650
|
id: string;
|
|
584
|
-
}
|
|
585
|
-
text?: string;
|
|
586
|
-
}) | {
|
|
651
|
+
} | {
|
|
587
652
|
kind: "document";
|
|
588
|
-
|
|
653
|
+
}) & {
|
|
654
|
+
text?: string;
|
|
589
655
|
})) | ({
|
|
590
656
|
__TYPE__: "ExternalLink";
|
|
591
|
-
} & (({
|
|
657
|
+
} & ((({
|
|
592
658
|
url: string;
|
|
593
659
|
} & {
|
|
594
660
|
kind?: "web";
|
|
@@ -596,16 +662,84 @@ export declare const isNestableContent: (u: unknown) => u is {
|
|
|
596
662
|
preview?: {
|
|
597
663
|
title?: string;
|
|
598
664
|
} | null | undefined;
|
|
599
|
-
} & {
|
|
600
|
-
text?: string;
|
|
601
665
|
}) | {
|
|
602
666
|
kind: "web";
|
|
603
|
-
|
|
667
|
+
}) & {
|
|
668
|
+
text?: string;
|
|
604
669
|
})) | ({
|
|
605
670
|
__TYPE__: "AnyLink";
|
|
606
671
|
} & {
|
|
607
|
-
text
|
|
672
|
+
text?: string;
|
|
608
673
|
});
|
|
674
|
+
} | {
|
|
675
|
+
__TYPE__: "RepeatableContent";
|
|
676
|
+
type: "Link";
|
|
677
|
+
value: {
|
|
678
|
+
__TYPE__: "LinkContent";
|
|
679
|
+
value: ({
|
|
680
|
+
__TYPE__: "ImageLink";
|
|
681
|
+
} & ((({
|
|
682
|
+
kind: "image";
|
|
683
|
+
id: string;
|
|
684
|
+
url: string;
|
|
685
|
+
height: string;
|
|
686
|
+
width: string;
|
|
687
|
+
size: string;
|
|
688
|
+
name: string;
|
|
689
|
+
} & {
|
|
690
|
+
date?: string | null | undefined;
|
|
691
|
+
}) | {
|
|
692
|
+
kind: "image";
|
|
693
|
+
}) & {
|
|
694
|
+
text?: string;
|
|
695
|
+
})) | ({
|
|
696
|
+
__TYPE__: "FileLink";
|
|
697
|
+
} & ((({
|
|
698
|
+
kind: "file";
|
|
699
|
+
id: string;
|
|
700
|
+
url: string;
|
|
701
|
+
name: string;
|
|
702
|
+
size: string;
|
|
703
|
+
} & {
|
|
704
|
+
date?: string | null | undefined;
|
|
705
|
+
}) | {
|
|
706
|
+
kind: "file";
|
|
707
|
+
}) & {
|
|
708
|
+
text?: string;
|
|
709
|
+
})) | ({
|
|
710
|
+
__TYPE__: "MediaLink";
|
|
711
|
+
} & {
|
|
712
|
+
kind: "media";
|
|
713
|
+
} & {
|
|
714
|
+
text?: string;
|
|
715
|
+
}) | ({
|
|
716
|
+
__TYPE__: "DocumentLink";
|
|
717
|
+
} & (({
|
|
718
|
+
id: string;
|
|
719
|
+
} | {
|
|
720
|
+
kind: "document";
|
|
721
|
+
}) & {
|
|
722
|
+
text?: string;
|
|
723
|
+
})) | ({
|
|
724
|
+
__TYPE__: "ExternalLink";
|
|
725
|
+
} & ((({
|
|
726
|
+
url: string;
|
|
727
|
+
} & {
|
|
728
|
+
kind?: "web";
|
|
729
|
+
target?: string | null | undefined;
|
|
730
|
+
preview?: {
|
|
731
|
+
title?: string;
|
|
732
|
+
} | null | undefined;
|
|
733
|
+
}) | {
|
|
734
|
+
kind: "web";
|
|
735
|
+
}) & {
|
|
736
|
+
text?: string;
|
|
737
|
+
})) | ({
|
|
738
|
+
__TYPE__: "AnyLink";
|
|
739
|
+
} & {
|
|
740
|
+
text?: string;
|
|
741
|
+
});
|
|
742
|
+
}[];
|
|
609
743
|
} | {
|
|
610
744
|
__TYPE__: "StructuredTextContent";
|
|
611
745
|
value: (({
|
|
@@ -879,7 +1013,7 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
|
|
|
879
1013
|
__TYPE__: "LinkContent";
|
|
880
1014
|
value: ({
|
|
881
1015
|
__TYPE__: "ImageLink";
|
|
882
|
-
} & (({
|
|
1016
|
+
} & ((({
|
|
883
1017
|
kind: "image";
|
|
884
1018
|
id: string;
|
|
885
1019
|
url: string;
|
|
@@ -889,14 +1023,13 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
|
|
|
889
1023
|
name: string;
|
|
890
1024
|
} & {
|
|
891
1025
|
date?: string | null | undefined;
|
|
892
|
-
} & {
|
|
893
|
-
text?: string;
|
|
894
1026
|
}) | {
|
|
895
1027
|
kind: "image";
|
|
896
|
-
|
|
1028
|
+
}) & {
|
|
1029
|
+
text?: string;
|
|
897
1030
|
})) | ({
|
|
898
1031
|
__TYPE__: "FileLink";
|
|
899
|
-
} & (({
|
|
1032
|
+
} & ((({
|
|
900
1033
|
kind: "file";
|
|
901
1034
|
id: string;
|
|
902
1035
|
url: string;
|
|
@@ -904,28 +1037,27 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
|
|
|
904
1037
|
size: string;
|
|
905
1038
|
} & {
|
|
906
1039
|
date?: string | null | undefined;
|
|
907
|
-
} & {
|
|
908
|
-
text?: string;
|
|
909
1040
|
}) | {
|
|
910
1041
|
kind: "file";
|
|
911
|
-
|
|
1042
|
+
}) & {
|
|
1043
|
+
text?: string;
|
|
912
1044
|
})) | ({
|
|
913
1045
|
__TYPE__: "MediaLink";
|
|
914
1046
|
} & {
|
|
915
1047
|
kind: "media";
|
|
916
|
-
|
|
1048
|
+
} & {
|
|
1049
|
+
text?: string;
|
|
917
1050
|
}) | ({
|
|
918
1051
|
__TYPE__: "DocumentLink";
|
|
919
1052
|
} & (({
|
|
920
1053
|
id: string;
|
|
921
|
-
}
|
|
922
|
-
text?: string;
|
|
923
|
-
}) | {
|
|
1054
|
+
} | {
|
|
924
1055
|
kind: "document";
|
|
925
|
-
|
|
1056
|
+
}) & {
|
|
1057
|
+
text?: string;
|
|
926
1058
|
})) | ({
|
|
927
1059
|
__TYPE__: "ExternalLink";
|
|
928
|
-
} & (({
|
|
1060
|
+
} & ((({
|
|
929
1061
|
url: string;
|
|
930
1062
|
} & {
|
|
931
1063
|
kind?: "web";
|
|
@@ -933,16 +1065,84 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
|
|
|
933
1065
|
preview?: {
|
|
934
1066
|
title?: string;
|
|
935
1067
|
} | null | undefined;
|
|
936
|
-
} & {
|
|
937
|
-
text?: string;
|
|
938
1068
|
}) | {
|
|
939
1069
|
kind: "web";
|
|
940
|
-
|
|
1070
|
+
}) & {
|
|
1071
|
+
text?: string;
|
|
941
1072
|
})) | ({
|
|
942
1073
|
__TYPE__: "AnyLink";
|
|
943
1074
|
} & {
|
|
944
|
-
text
|
|
1075
|
+
text?: string;
|
|
945
1076
|
});
|
|
1077
|
+
}> | import("fp-ts/lib/Either").Right<{
|
|
1078
|
+
__TYPE__: "RepeatableContent";
|
|
1079
|
+
type: "Link";
|
|
1080
|
+
value: {
|
|
1081
|
+
__TYPE__: "LinkContent";
|
|
1082
|
+
value: ({
|
|
1083
|
+
__TYPE__: "ImageLink";
|
|
1084
|
+
} & ((({
|
|
1085
|
+
kind: "image";
|
|
1086
|
+
id: string;
|
|
1087
|
+
url: string;
|
|
1088
|
+
height: string;
|
|
1089
|
+
width: string;
|
|
1090
|
+
size: string;
|
|
1091
|
+
name: string;
|
|
1092
|
+
} & {
|
|
1093
|
+
date?: string | null | undefined;
|
|
1094
|
+
}) | {
|
|
1095
|
+
kind: "image";
|
|
1096
|
+
}) & {
|
|
1097
|
+
text?: string;
|
|
1098
|
+
})) | ({
|
|
1099
|
+
__TYPE__: "FileLink";
|
|
1100
|
+
} & ((({
|
|
1101
|
+
kind: "file";
|
|
1102
|
+
id: string;
|
|
1103
|
+
url: string;
|
|
1104
|
+
name: string;
|
|
1105
|
+
size: string;
|
|
1106
|
+
} & {
|
|
1107
|
+
date?: string | null | undefined;
|
|
1108
|
+
}) | {
|
|
1109
|
+
kind: "file";
|
|
1110
|
+
}) & {
|
|
1111
|
+
text?: string;
|
|
1112
|
+
})) | ({
|
|
1113
|
+
__TYPE__: "MediaLink";
|
|
1114
|
+
} & {
|
|
1115
|
+
kind: "media";
|
|
1116
|
+
} & {
|
|
1117
|
+
text?: string;
|
|
1118
|
+
}) | ({
|
|
1119
|
+
__TYPE__: "DocumentLink";
|
|
1120
|
+
} & (({
|
|
1121
|
+
id: string;
|
|
1122
|
+
} | {
|
|
1123
|
+
kind: "document";
|
|
1124
|
+
}) & {
|
|
1125
|
+
text?: string;
|
|
1126
|
+
})) | ({
|
|
1127
|
+
__TYPE__: "ExternalLink";
|
|
1128
|
+
} & ((({
|
|
1129
|
+
url: string;
|
|
1130
|
+
} & {
|
|
1131
|
+
kind?: "web";
|
|
1132
|
+
target?: string | null | undefined;
|
|
1133
|
+
preview?: {
|
|
1134
|
+
title?: string;
|
|
1135
|
+
} | null | undefined;
|
|
1136
|
+
}) | {
|
|
1137
|
+
kind: "web";
|
|
1138
|
+
}) & {
|
|
1139
|
+
text?: string;
|
|
1140
|
+
})) | ({
|
|
1141
|
+
__TYPE__: "AnyLink";
|
|
1142
|
+
} & {
|
|
1143
|
+
text?: string;
|
|
1144
|
+
});
|
|
1145
|
+
}[];
|
|
946
1146
|
}> | import("fp-ts/lib/Either").Right<{
|
|
947
1147
|
__TYPE__: "StructuredTextContent";
|
|
948
1148
|
value: (({
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const Either_1 = require("fp-ts/lib/Either");
|
|
6
6
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
7
7
|
const EmptyContent_1 = require("../EmptyContent");
|
|
8
|
+
const RepeatableContent_1 = require("../RepeatableContent");
|
|
8
9
|
const BooleanContent_1 = require("./BooleanContent");
|
|
9
10
|
const EmbedContent_1 = require("./EmbedContent");
|
|
10
11
|
const FieldContent_1 = require("./FieldContent");
|
|
@@ -32,6 +33,7 @@ exports.NestableContent = t.union([
|
|
|
32
33
|
LinkContent_1.LinkContent,
|
|
33
34
|
RichTextContent_1.RichTextContent,
|
|
34
35
|
SeparatorContent_1.SeparatorContent,
|
|
36
|
+
RepeatableContent_1.RepeatableContent,
|
|
35
37
|
]);
|
|
36
38
|
const NestableContentDefaultValue = (widgetDef) => {
|
|
37
39
|
switch (widgetDef.type) {
|
|
@@ -59,7 +61,8 @@ const isNestableContent = (u) => (0, FieldContent_1.isTextContent)(u) ||
|
|
|
59
61
|
(0, IntegrationFieldContent_1.isIntegrationFieldContent)(u) ||
|
|
60
62
|
(0, LinkContent_1.isLinkContent)(u) ||
|
|
61
63
|
(0, SeparatorContent_1.isSeparatorContent)(u) ||
|
|
62
|
-
(0, EmptyContent_1.isEmptyContent)(u)
|
|
64
|
+
(0, EmptyContent_1.isEmptyContent)(u) ||
|
|
65
|
+
(0, RepeatableContent_1.isRepeatableContent)(u);
|
|
63
66
|
exports.isNestableContent = isNestableContent;
|
|
64
67
|
const NestableLegacy = (ctx) => {
|
|
65
68
|
return {
|
|
@@ -101,6 +104,8 @@ const NestableLegacy = (ctx) => {
|
|
|
101
104
|
return (0, LinkContent_1.LinkContentLegacy)(ctx);
|
|
102
105
|
case "Separator":
|
|
103
106
|
return (0, SeparatorContent_1.SeparatorLegacy)(ctx);
|
|
107
|
+
case "Repeatable.Link":
|
|
108
|
+
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, "Link");
|
|
104
109
|
default:
|
|
105
110
|
return;
|
|
106
111
|
}
|
|
@@ -144,6 +149,8 @@ const NestableLegacy = (ctx) => {
|
|
|
144
149
|
return (0, LinkContent_1.LinkContentLegacy)(ctx).encode(value);
|
|
145
150
|
case SeparatorContent_1.SeparatorContentType:
|
|
146
151
|
return (0, SeparatorContent_1.SeparatorLegacy)(ctx).encode(value);
|
|
152
|
+
case "RepeatableContent":
|
|
153
|
+
return (0, RepeatableContent_1.RepeatableLegacy)(ctx, value.type).encode(value);
|
|
147
154
|
default:
|
|
148
155
|
return;
|
|
149
156
|
}
|