@prismicio/types-internal 2.0.0-alpha.4 → 2.0.0-alpha.6
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/Document.d.ts +72 -616
- package/lib/content/Document.js +4 -3
- package/lib/content/fields/GroupContent.d.ts +23 -193
- package/lib/content/fields/GroupContent.js +3 -3
- package/lib/content/fields/WidgetContent.d.ts +104 -920
- package/lib/content/fields/nestable/EmbedContent.d.ts +30 -45
- package/lib/content/fields/nestable/EmbedContent.js +25 -12
- package/lib/content/fields/nestable/LinkContent.d.ts +8 -8
- package/lib/content/fields/nestable/LinkContent.js +1 -1
- package/lib/content/fields/nestable/NestableContent.d.ts +14 -115
- package/lib/content/fields/nestable/NestableContent.js +2 -1
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +11 -78
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +5 -5
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +9 -77
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +26 -230
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +4 -4
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +9 -77
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +26 -230
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +4 -4
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +22 -192
- package/lib/content/fields/slices/Slice/index.d.ts +50 -424
- package/lib/content/fields/slices/SliceItem.d.ts +54 -462
- package/lib/content/fields/slices/SliceItem.js +2 -1
- package/lib/content/fields/slices/SlicesContent.d.ts +78 -690
- package/lib/content/utils.js +3 -3
- package/lib/customtypes/index.d.ts +2 -2
- package/lib/customtypes/index.js +2 -3
- package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -1
- package/lib/customtypes/widgets/nestable/RichText.js +10 -10
- package/lib/customtypes/widgets/slices/Slices.d.ts +12 -3
- package/lib/customtypes/widgets/slices/Slices.js +4 -4
- package/lib/customtypes/widgets/slices/index.d.ts +6 -6
- package/lib/customtypes/widgets/slices/index.js +6 -11
- package/package.json +1 -1
- package/src/content/Document.ts +4 -3
- package/src/content/fields/GroupContent.ts +4 -4
- package/src/content/fields/nestable/EmbedContent.ts +52 -28
- package/src/content/fields/nestable/LinkContent.ts +1 -1
- package/src/content/fields/nestable/NestableContent.ts +2 -1
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +6 -5
- package/src/content/fields/slices/Slice/CompositeSliceContent.ts +4 -3
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +4 -3
- package/src/content/fields/slices/SliceItem.ts +2 -2
- package/src/content/utils.ts +4 -5
- package/src/customtypes/index.ts +2 -2
- package/src/customtypes/widgets/nestable/RichText.ts +16 -16
- package/src/customtypes/widgets/slices/Slices.ts +4 -4
- package/src/customtypes/widgets/slices/index.ts +6 -6
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CompositeSliceContent = exports.CompositeSliceLegacy = exports.isCompositeSliceContent = exports.CompositeSliceContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fp_ts_1 = require("fp-ts");
|
|
6
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
6
7
|
const function_1 = require("fp-ts/lib/function");
|
|
7
8
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
8
9
|
const LegacyContentCtx_1 = require("../../../LegacyContentCtx");
|
|
@@ -22,7 +23,7 @@ const CompositeSliceLegacy = (ctx) => {
|
|
|
22
23
|
const repeat = (() => {
|
|
23
24
|
const itemsCtx = (0, LegacyContentCtx_1.getFieldCtx)("repeat", ctx);
|
|
24
25
|
const result = (0, RepeatableContent_1.RepeatableWidgetsLegacy)(itemsCtx).decode(parsedSlice.repeat);
|
|
25
|
-
if (!result ||
|
|
26
|
+
if (!result || (0, Either_1.isLeft)(result))
|
|
26
27
|
return;
|
|
27
28
|
return result.right;
|
|
28
29
|
})() || [];
|
|
@@ -33,10 +34,9 @@ const CompositeSliceLegacy = (ctx) => {
|
|
|
33
34
|
const result = (0, nestable_1.NestableLegacy)(fieldCtx).decode(value);
|
|
34
35
|
if (!result)
|
|
35
36
|
return acc;
|
|
36
|
-
if (
|
|
37
|
-
return { ...acc, [key]: result.right };
|
|
38
|
-
else
|
|
37
|
+
if ((0, Either_1.isLeft)(result))
|
|
39
38
|
return acc;
|
|
39
|
+
return { ...acc, [key]: result.right };
|
|
40
40
|
}, {});
|
|
41
41
|
return {
|
|
42
42
|
nonRepeat,
|
|
@@ -5,24 +5,7 @@ export declare const RepeatableWidgetsLegacy: (ctx: LegacyContentCtx) => t.Array
|
|
|
5
5
|
value: [string, {
|
|
6
6
|
__TYPE__: "BooleanContent";
|
|
7
7
|
value: boolean;
|
|
8
|
-
} | ({
|
|
9
|
-
embed_url: string;
|
|
10
|
-
type: string;
|
|
11
|
-
} & {
|
|
12
|
-
version?: string | number | null;
|
|
13
|
-
title?: string | null | undefined;
|
|
14
|
-
author_name?: string | null | undefined;
|
|
15
|
-
author_url?: string | null | undefined;
|
|
16
|
-
provider_name?: string | null | undefined;
|
|
17
|
-
provider_url?: string | null | undefined;
|
|
18
|
-
cache_age?: string | number | null;
|
|
19
|
-
thumbnail_url?: string | null | undefined;
|
|
20
|
-
thumbnail_width?: number | null | undefined;
|
|
21
|
-
thumbnail_height?: number | null | undefined;
|
|
22
|
-
html?: string | null | undefined;
|
|
23
|
-
} & {
|
|
24
|
-
__TYPE__: "EmbedContent";
|
|
25
|
-
}) | {
|
|
8
|
+
} | import("../../nestable").EmbedContent | {
|
|
26
9
|
type: "Color";
|
|
27
10
|
value: string;
|
|
28
11
|
__TYPE__: "FieldContent";
|
|
@@ -129,9 +112,9 @@ export declare const RepeatableWidgetsLegacy: (ctx: LegacyContentCtx) => t.Array
|
|
|
129
112
|
url: string;
|
|
130
113
|
name: string;
|
|
131
114
|
kind: string;
|
|
115
|
+
size: string;
|
|
132
116
|
} & {
|
|
133
117
|
date?: string | null | undefined;
|
|
134
|
-
size?: string;
|
|
135
118
|
} & {
|
|
136
119
|
__TYPE__: "FileLink";
|
|
137
120
|
} & {
|
|
@@ -198,9 +181,9 @@ export declare const RepeatableWidgetsLegacy: (ctx: LegacyContentCtx) => t.Array
|
|
|
198
181
|
url: string;
|
|
199
182
|
name: string;
|
|
200
183
|
kind: string;
|
|
184
|
+
size: string;
|
|
201
185
|
} & {
|
|
202
186
|
date?: string | null | undefined;
|
|
203
|
-
size?: string;
|
|
204
187
|
} & {
|
|
205
188
|
__TYPE__: "FileLink";
|
|
206
189
|
} & {
|
|
@@ -226,24 +209,7 @@ export declare const RepeatableWidgetsLegacy: (ctx: LegacyContentCtx) => t.Array
|
|
|
226
209
|
direction?: string | null | undefined;
|
|
227
210
|
}) | ({
|
|
228
211
|
type: "embed";
|
|
229
|
-
data:
|
|
230
|
-
embed_url: string;
|
|
231
|
-
type: string;
|
|
232
|
-
} & {
|
|
233
|
-
version?: string | number | null;
|
|
234
|
-
title?: string | null | undefined;
|
|
235
|
-
author_name?: string | null | undefined;
|
|
236
|
-
author_url?: string | null | undefined;
|
|
237
|
-
provider_name?: string | null | undefined;
|
|
238
|
-
provider_url?: string | null | undefined;
|
|
239
|
-
cache_age?: string | number | null;
|
|
240
|
-
thumbnail_url?: string | null | undefined;
|
|
241
|
-
thumbnail_width?: number | null | undefined;
|
|
242
|
-
thumbnail_height?: number | null | undefined;
|
|
243
|
-
html?: string | null | undefined;
|
|
244
|
-
} & {
|
|
245
|
-
__TYPE__: "EmbedContent";
|
|
246
|
-
};
|
|
212
|
+
data: import("../../nestable").EmbedContent;
|
|
247
213
|
} & {
|
|
248
214
|
label?: string | null | undefined;
|
|
249
215
|
direction?: string | null | undefined;
|
|
@@ -276,24 +242,7 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
276
242
|
}>>, t.ExactC<t.TypeC<{
|
|
277
243
|
__TYPE__: t.LiteralC<"BooleanContent">;
|
|
278
244
|
value: t.BooleanC;
|
|
279
|
-
}>>, t.
|
|
280
|
-
embed_url: t.StringC;
|
|
281
|
-
type: t.StringC;
|
|
282
|
-
}>, t.PartialC<{
|
|
283
|
-
version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
284
|
-
title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
285
|
-
author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
286
|
-
author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
287
|
-
provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
288
|
-
provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
289
|
-
cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
290
|
-
thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
291
|
-
thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
292
|
-
thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
293
|
-
html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
294
|
-
}>]>>, t.ExactC<t.TypeC<{
|
|
295
|
-
__TYPE__: t.LiteralC<"EmbedContent">;
|
|
296
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
245
|
+
}>>, t.Type<import("../../nestable").EmbedContent, import("../../nestable").EmbedContent, unknown>, t.ExactC<t.TypeC<{
|
|
297
246
|
type: t.LiteralC<"Text">;
|
|
298
247
|
value: t.Type<string, string, unknown>;
|
|
299
248
|
__TYPE__: t.LiteralC<"FieldContent">;
|
|
@@ -398,9 +347,9 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
398
347
|
url: t.StringC;
|
|
399
348
|
name: t.StringC;
|
|
400
349
|
kind: t.StringC;
|
|
350
|
+
size: t.StringC;
|
|
401
351
|
}>, t.PartialC<{
|
|
402
352
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
403
|
-
size: t.StringC;
|
|
404
353
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
405
354
|
__TYPE__: t.LiteralC<"FileLink">;
|
|
406
355
|
}>, t.PartialC<{
|
|
@@ -466,9 +415,9 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
466
415
|
url: string;
|
|
467
416
|
name: string;
|
|
468
417
|
kind: string;
|
|
418
|
+
size: string;
|
|
469
419
|
} & {
|
|
470
420
|
date?: string | null | undefined;
|
|
471
|
-
size?: string;
|
|
472
421
|
} & {
|
|
473
422
|
__TYPE__: "FileLink";
|
|
474
423
|
} & {
|
|
@@ -504,9 +453,9 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
504
453
|
url: string;
|
|
505
454
|
name: string;
|
|
506
455
|
kind: string;
|
|
456
|
+
size: string;
|
|
507
457
|
} & {
|
|
508
458
|
date?: string | null | undefined;
|
|
509
|
-
size?: string;
|
|
510
459
|
} & {
|
|
511
460
|
__TYPE__: "FileLink";
|
|
512
461
|
} & {
|
|
@@ -532,24 +481,7 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
532
481
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
533
482
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
534
483
|
type: t.LiteralC<"embed">;
|
|
535
|
-
data: t.
|
|
536
|
-
embed_url: t.StringC;
|
|
537
|
-
type: t.StringC;
|
|
538
|
-
}>, t.PartialC<{
|
|
539
|
-
version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
540
|
-
title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
541
|
-
author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
542
|
-
author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
543
|
-
provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
544
|
-
provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
545
|
-
cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
546
|
-
thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
547
|
-
thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
548
|
-
thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
549
|
-
html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
550
|
-
}>]>>, t.ExactC<t.TypeC<{
|
|
551
|
-
__TYPE__: t.LiteralC<"EmbedContent">;
|
|
552
|
-
}>>]>;
|
|
484
|
+
data: t.Type<import("../../nestable").EmbedContent, import("../../nestable").EmbedContent, unknown>;
|
|
553
485
|
}>, t.PartialC<{
|
|
554
486
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
555
487
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -8,24 +8,7 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
8
8
|
[x: string]: {
|
|
9
9
|
__TYPE__: "BooleanContent";
|
|
10
10
|
value: boolean;
|
|
11
|
-
} | ({
|
|
12
|
-
embed_url: string;
|
|
13
|
-
type: string;
|
|
14
|
-
} & {
|
|
15
|
-
version?: string | number | null;
|
|
16
|
-
title?: string | null | undefined;
|
|
17
|
-
author_name?: string | null | undefined;
|
|
18
|
-
author_url?: string | null | undefined;
|
|
19
|
-
provider_name?: string | null | undefined;
|
|
20
|
-
provider_url?: string | null | undefined;
|
|
21
|
-
cache_age?: string | number | null;
|
|
22
|
-
thumbnail_url?: string | null | undefined;
|
|
23
|
-
thumbnail_width?: number | null | undefined;
|
|
24
|
-
thumbnail_height?: number | null | undefined;
|
|
25
|
-
html?: string | null | undefined;
|
|
26
|
-
} & {
|
|
27
|
-
__TYPE__: "EmbedContent";
|
|
28
|
-
}) | {
|
|
11
|
+
} | import("../../nestable").EmbedContent | {
|
|
29
12
|
type: "Color";
|
|
30
13
|
value: string;
|
|
31
14
|
__TYPE__: "FieldContent";
|
|
@@ -132,9 +115,9 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
132
115
|
url: string;
|
|
133
116
|
name: string;
|
|
134
117
|
kind: string;
|
|
118
|
+
size: string;
|
|
135
119
|
} & {
|
|
136
120
|
date?: string | null | undefined;
|
|
137
|
-
size?: string;
|
|
138
121
|
} & {
|
|
139
122
|
__TYPE__: "FileLink";
|
|
140
123
|
} & {
|
|
@@ -201,9 +184,9 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
201
184
|
url: string;
|
|
202
185
|
name: string;
|
|
203
186
|
kind: string;
|
|
187
|
+
size: string;
|
|
204
188
|
} & {
|
|
205
189
|
date?: string | null | undefined;
|
|
206
|
-
size?: string;
|
|
207
190
|
} & {
|
|
208
191
|
__TYPE__: "FileLink";
|
|
209
192
|
} & {
|
|
@@ -229,24 +212,7 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
229
212
|
direction?: string | null | undefined;
|
|
230
213
|
}) | ({
|
|
231
214
|
type: "embed";
|
|
232
|
-
data:
|
|
233
|
-
embed_url: string;
|
|
234
|
-
type: string;
|
|
235
|
-
} & {
|
|
236
|
-
version?: string | number | null;
|
|
237
|
-
title?: string | null | undefined;
|
|
238
|
-
author_name?: string | null | undefined;
|
|
239
|
-
author_url?: string | null | undefined;
|
|
240
|
-
provider_name?: string | null | undefined;
|
|
241
|
-
provider_url?: string | null | undefined;
|
|
242
|
-
cache_age?: string | number | null;
|
|
243
|
-
thumbnail_url?: string | null | undefined;
|
|
244
|
-
thumbnail_width?: number | null | undefined;
|
|
245
|
-
thumbnail_height?: number | null | undefined;
|
|
246
|
-
html?: string | null | undefined;
|
|
247
|
-
} & {
|
|
248
|
-
__TYPE__: "EmbedContent";
|
|
249
|
-
};
|
|
215
|
+
data: import("../../nestable").EmbedContent;
|
|
250
216
|
} & {
|
|
251
217
|
label?: string | null | undefined;
|
|
252
218
|
direction?: string | null | undefined;
|
|
@@ -276,24 +242,7 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
276
242
|
value: [string, {
|
|
277
243
|
__TYPE__: "BooleanContent";
|
|
278
244
|
value: boolean;
|
|
279
|
-
} | ({
|
|
280
|
-
embed_url: string;
|
|
281
|
-
type: string;
|
|
282
|
-
} & {
|
|
283
|
-
version?: string | number | null;
|
|
284
|
-
title?: string | null | undefined;
|
|
285
|
-
author_name?: string | null | undefined;
|
|
286
|
-
author_url?: string | null | undefined;
|
|
287
|
-
provider_name?: string | null | undefined;
|
|
288
|
-
provider_url?: string | null | undefined;
|
|
289
|
-
cache_age?: string | number | null;
|
|
290
|
-
thumbnail_url?: string | null | undefined;
|
|
291
|
-
thumbnail_width?: number | null | undefined;
|
|
292
|
-
thumbnail_height?: number | null | undefined;
|
|
293
|
-
html?: string | null | undefined;
|
|
294
|
-
} & {
|
|
295
|
-
__TYPE__: "EmbedContent";
|
|
296
|
-
}) | {
|
|
245
|
+
} | import("../../nestable").EmbedContent | {
|
|
297
246
|
type: "Color";
|
|
298
247
|
value: string;
|
|
299
248
|
__TYPE__: "FieldContent";
|
|
@@ -400,9 +349,9 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
400
349
|
url: string;
|
|
401
350
|
name: string;
|
|
402
351
|
kind: string;
|
|
352
|
+
size: string;
|
|
403
353
|
} & {
|
|
404
354
|
date?: string | null | undefined;
|
|
405
|
-
size?: string;
|
|
406
355
|
} & {
|
|
407
356
|
__TYPE__: "FileLink";
|
|
408
357
|
} & {
|
|
@@ -469,9 +418,9 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
469
418
|
url: string;
|
|
470
419
|
name: string;
|
|
471
420
|
kind: string;
|
|
421
|
+
size: string;
|
|
472
422
|
} & {
|
|
473
423
|
date?: string | null | undefined;
|
|
474
|
-
size?: string;
|
|
475
424
|
} & {
|
|
476
425
|
__TYPE__: "FileLink";
|
|
477
426
|
} & {
|
|
@@ -497,24 +446,7 @@ export declare const isSharedSliceContent: (u: unknown) => u is {
|
|
|
497
446
|
direction?: string | null | undefined;
|
|
498
447
|
}) | ({
|
|
499
448
|
type: "embed";
|
|
500
|
-
data:
|
|
501
|
-
embed_url: string;
|
|
502
|
-
type: string;
|
|
503
|
-
} & {
|
|
504
|
-
version?: string | number | null;
|
|
505
|
-
title?: string | null | undefined;
|
|
506
|
-
author_name?: string | null | undefined;
|
|
507
|
-
author_url?: string | null | undefined;
|
|
508
|
-
provider_name?: string | null | undefined;
|
|
509
|
-
provider_url?: string | null | undefined;
|
|
510
|
-
cache_age?: string | number | null;
|
|
511
|
-
thumbnail_url?: string | null | undefined;
|
|
512
|
-
thumbnail_width?: number | null | undefined;
|
|
513
|
-
thumbnail_height?: number | null | undefined;
|
|
514
|
-
html?: string | null | undefined;
|
|
515
|
-
} & {
|
|
516
|
-
__TYPE__: "EmbedContent";
|
|
517
|
-
};
|
|
449
|
+
data: import("../../nestable").EmbedContent;
|
|
518
450
|
} & {
|
|
519
451
|
label?: string | null | undefined;
|
|
520
452
|
direction?: string | null | undefined;
|
|
@@ -547,24 +479,7 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
547
479
|
[x: string]: {
|
|
548
480
|
__TYPE__: "BooleanContent";
|
|
549
481
|
value: boolean;
|
|
550
|
-
} | ({
|
|
551
|
-
embed_url: string;
|
|
552
|
-
type: string;
|
|
553
|
-
} & {
|
|
554
|
-
version?: string | number | null;
|
|
555
|
-
title?: string | null | undefined;
|
|
556
|
-
author_name?: string | null | undefined;
|
|
557
|
-
author_url?: string | null | undefined;
|
|
558
|
-
provider_name?: string | null | undefined;
|
|
559
|
-
provider_url?: string | null | undefined;
|
|
560
|
-
cache_age?: string | number | null;
|
|
561
|
-
thumbnail_url?: string | null | undefined;
|
|
562
|
-
thumbnail_width?: number | null | undefined;
|
|
563
|
-
thumbnail_height?: number | null | undefined;
|
|
564
|
-
html?: string | null | undefined;
|
|
565
|
-
} & {
|
|
566
|
-
__TYPE__: "EmbedContent";
|
|
567
|
-
}) | {
|
|
482
|
+
} | import("../../nestable").EmbedContent | {
|
|
568
483
|
type: "Color";
|
|
569
484
|
value: string;
|
|
570
485
|
__TYPE__: "FieldContent";
|
|
@@ -671,9 +586,9 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
671
586
|
url: string;
|
|
672
587
|
name: string;
|
|
673
588
|
kind: string;
|
|
589
|
+
size: string;
|
|
674
590
|
} & {
|
|
675
591
|
date?: string | null | undefined;
|
|
676
|
-
size?: string;
|
|
677
592
|
} & {
|
|
678
593
|
__TYPE__: "FileLink";
|
|
679
594
|
} & {
|
|
@@ -740,9 +655,9 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
740
655
|
url: string;
|
|
741
656
|
name: string;
|
|
742
657
|
kind: string;
|
|
658
|
+
size: string;
|
|
743
659
|
} & {
|
|
744
660
|
date?: string | null | undefined;
|
|
745
|
-
size?: string;
|
|
746
661
|
} & {
|
|
747
662
|
__TYPE__: "FileLink";
|
|
748
663
|
} & {
|
|
@@ -768,24 +683,7 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
768
683
|
direction?: string | null | undefined;
|
|
769
684
|
}) | ({
|
|
770
685
|
type: "embed";
|
|
771
|
-
data:
|
|
772
|
-
embed_url: string;
|
|
773
|
-
type: string;
|
|
774
|
-
} & {
|
|
775
|
-
version?: string | number | null;
|
|
776
|
-
title?: string | null | undefined;
|
|
777
|
-
author_name?: string | null | undefined;
|
|
778
|
-
author_url?: string | null | undefined;
|
|
779
|
-
provider_name?: string | null | undefined;
|
|
780
|
-
provider_url?: string | null | undefined;
|
|
781
|
-
cache_age?: string | number | null;
|
|
782
|
-
thumbnail_url?: string | null | undefined;
|
|
783
|
-
thumbnail_width?: number | null | undefined;
|
|
784
|
-
thumbnail_height?: number | null | undefined;
|
|
785
|
-
html?: string | null | undefined;
|
|
786
|
-
} & {
|
|
787
|
-
__TYPE__: "EmbedContent";
|
|
788
|
-
};
|
|
686
|
+
data: import("../../nestable").EmbedContent;
|
|
789
687
|
} & {
|
|
790
688
|
label?: string | null | undefined;
|
|
791
689
|
direction?: string | null | undefined;
|
|
@@ -815,24 +713,7 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
815
713
|
value: [string, {
|
|
816
714
|
__TYPE__: "BooleanContent";
|
|
817
715
|
value: boolean;
|
|
818
|
-
} | ({
|
|
819
|
-
embed_url: string;
|
|
820
|
-
type: string;
|
|
821
|
-
} & {
|
|
822
|
-
version?: string | number | null;
|
|
823
|
-
title?: string | null | undefined;
|
|
824
|
-
author_name?: string | null | undefined;
|
|
825
|
-
author_url?: string | null | undefined;
|
|
826
|
-
provider_name?: string | null | undefined;
|
|
827
|
-
provider_url?: string | null | undefined;
|
|
828
|
-
cache_age?: string | number | null;
|
|
829
|
-
thumbnail_url?: string | null | undefined;
|
|
830
|
-
thumbnail_width?: number | null | undefined;
|
|
831
|
-
thumbnail_height?: number | null | undefined;
|
|
832
|
-
html?: string | null | undefined;
|
|
833
|
-
} & {
|
|
834
|
-
__TYPE__: "EmbedContent";
|
|
835
|
-
}) | {
|
|
716
|
+
} | import("../../nestable").EmbedContent | {
|
|
836
717
|
type: "Color";
|
|
837
718
|
value: string;
|
|
838
719
|
__TYPE__: "FieldContent";
|
|
@@ -939,9 +820,9 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
939
820
|
url: string;
|
|
940
821
|
name: string;
|
|
941
822
|
kind: string;
|
|
823
|
+
size: string;
|
|
942
824
|
} & {
|
|
943
825
|
date?: string | null | undefined;
|
|
944
|
-
size?: string;
|
|
945
826
|
} & {
|
|
946
827
|
__TYPE__: "FileLink";
|
|
947
828
|
} & {
|
|
@@ -1008,9 +889,9 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
1008
889
|
url: string;
|
|
1009
890
|
name: string;
|
|
1010
891
|
kind: string;
|
|
892
|
+
size: string;
|
|
1011
893
|
} & {
|
|
1012
894
|
date?: string | null | undefined;
|
|
1013
|
-
size?: string;
|
|
1014
895
|
} & {
|
|
1015
896
|
__TYPE__: "FileLink";
|
|
1016
897
|
} & {
|
|
@@ -1036,24 +917,7 @@ export declare const SharedSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
1036
917
|
direction?: string | null | undefined;
|
|
1037
918
|
}) | ({
|
|
1038
919
|
type: "embed";
|
|
1039
|
-
data:
|
|
1040
|
-
embed_url: string;
|
|
1041
|
-
type: string;
|
|
1042
|
-
} & {
|
|
1043
|
-
version?: string | number | null;
|
|
1044
|
-
title?: string | null | undefined;
|
|
1045
|
-
author_name?: string | null | undefined;
|
|
1046
|
-
author_url?: string | null | undefined;
|
|
1047
|
-
provider_name?: string | null | undefined;
|
|
1048
|
-
provider_url?: string | null | undefined;
|
|
1049
|
-
cache_age?: string | number | null;
|
|
1050
|
-
thumbnail_url?: string | null | undefined;
|
|
1051
|
-
thumbnail_width?: number | null | undefined;
|
|
1052
|
-
thumbnail_height?: number | null | undefined;
|
|
1053
|
-
html?: string | null | undefined;
|
|
1054
|
-
} & {
|
|
1055
|
-
__TYPE__: "EmbedContent";
|
|
1056
|
-
};
|
|
920
|
+
data: import("../../nestable").EmbedContent;
|
|
1057
921
|
} & {
|
|
1058
922
|
label?: string | null | undefined;
|
|
1059
923
|
direction?: string | null | undefined;
|
|
@@ -1094,24 +958,7 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1094
958
|
}>>, t.ExactC<t.TypeC<{
|
|
1095
959
|
__TYPE__: t.LiteralC<"BooleanContent">;
|
|
1096
960
|
value: t.BooleanC;
|
|
1097
|
-
}>>, t.
|
|
1098
|
-
embed_url: t.StringC;
|
|
1099
|
-
type: t.StringC;
|
|
1100
|
-
}>, t.PartialC<{
|
|
1101
|
-
version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1102
|
-
title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1103
|
-
author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1104
|
-
author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1105
|
-
provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1106
|
-
provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1107
|
-
cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1108
|
-
thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1109
|
-
thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1110
|
-
thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1111
|
-
html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1112
|
-
}>]>>, t.ExactC<t.TypeC<{
|
|
1113
|
-
__TYPE__: t.LiteralC<"EmbedContent">;
|
|
1114
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
961
|
+
}>>, t.Type<import("../../nestable").EmbedContent, import("../../nestable").EmbedContent, unknown>, t.ExactC<t.TypeC<{
|
|
1115
962
|
type: t.LiteralC<"Text">;
|
|
1116
963
|
value: t.Type<string, string, unknown>;
|
|
1117
964
|
__TYPE__: t.LiteralC<"FieldContent">;
|
|
@@ -1216,9 +1063,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1216
1063
|
url: t.StringC;
|
|
1217
1064
|
name: t.StringC;
|
|
1218
1065
|
kind: t.StringC;
|
|
1066
|
+
size: t.StringC;
|
|
1219
1067
|
}>, t.PartialC<{
|
|
1220
1068
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1221
|
-
size: t.StringC;
|
|
1222
1069
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1223
1070
|
__TYPE__: t.LiteralC<"FileLink">;
|
|
1224
1071
|
}>, t.PartialC<{
|
|
@@ -1284,9 +1131,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1284
1131
|
url: string;
|
|
1285
1132
|
name: string;
|
|
1286
1133
|
kind: string;
|
|
1134
|
+
size: string;
|
|
1287
1135
|
} & {
|
|
1288
1136
|
date?: string | null | undefined;
|
|
1289
|
-
size?: string;
|
|
1290
1137
|
} & {
|
|
1291
1138
|
__TYPE__: "FileLink";
|
|
1292
1139
|
} & {
|
|
@@ -1322,9 +1169,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1322
1169
|
url: string;
|
|
1323
1170
|
name: string;
|
|
1324
1171
|
kind: string;
|
|
1172
|
+
size: string;
|
|
1325
1173
|
} & {
|
|
1326
1174
|
date?: string | null | undefined;
|
|
1327
|
-
size?: string;
|
|
1328
1175
|
} & {
|
|
1329
1176
|
__TYPE__: "FileLink";
|
|
1330
1177
|
} & {
|
|
@@ -1350,24 +1197,7 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1350
1197
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1351
1198
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1352
1199
|
type: t.LiteralC<"embed">;
|
|
1353
|
-
data: t.
|
|
1354
|
-
embed_url: t.StringC;
|
|
1355
|
-
type: t.StringC;
|
|
1356
|
-
}>, t.PartialC<{
|
|
1357
|
-
version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1358
|
-
title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1359
|
-
author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1360
|
-
author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1361
|
-
provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1362
|
-
provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1363
|
-
cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1364
|
-
thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1365
|
-
thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1366
|
-
thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1367
|
-
html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1368
|
-
}>]>>, t.ExactC<t.TypeC<{
|
|
1369
|
-
__TYPE__: t.LiteralC<"EmbedContent">;
|
|
1370
|
-
}>>]>;
|
|
1200
|
+
data: t.Type<import("../../nestable").EmbedContent, import("../../nestable").EmbedContent, unknown>;
|
|
1371
1201
|
}>, t.PartialC<{
|
|
1372
1202
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1373
1203
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1405,24 +1235,7 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1405
1235
|
}>>, t.ExactC<t.TypeC<{
|
|
1406
1236
|
__TYPE__: t.LiteralC<"BooleanContent">;
|
|
1407
1237
|
value: t.BooleanC;
|
|
1408
|
-
}>>, t.
|
|
1409
|
-
embed_url: t.StringC;
|
|
1410
|
-
type: t.StringC;
|
|
1411
|
-
}>, t.PartialC<{
|
|
1412
|
-
version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1413
|
-
title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1414
|
-
author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1415
|
-
author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1416
|
-
provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1417
|
-
provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1418
|
-
cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1419
|
-
thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1420
|
-
thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1421
|
-
thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1422
|
-
html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1423
|
-
}>]>>, t.ExactC<t.TypeC<{
|
|
1424
|
-
__TYPE__: t.LiteralC<"EmbedContent">;
|
|
1425
|
-
}>>]>, t.ExactC<t.TypeC<{
|
|
1238
|
+
}>>, t.Type<import("../../nestable").EmbedContent, import("../../nestable").EmbedContent, unknown>, t.ExactC<t.TypeC<{
|
|
1426
1239
|
type: t.LiteralC<"Text">;
|
|
1427
1240
|
value: t.Type<string, string, unknown>;
|
|
1428
1241
|
__TYPE__: t.LiteralC<"FieldContent">;
|
|
@@ -1527,9 +1340,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1527
1340
|
url: t.StringC;
|
|
1528
1341
|
name: t.StringC;
|
|
1529
1342
|
kind: t.StringC;
|
|
1343
|
+
size: t.StringC;
|
|
1530
1344
|
}>, t.PartialC<{
|
|
1531
1345
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1532
|
-
size: t.StringC;
|
|
1533
1346
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1534
1347
|
__TYPE__: t.LiteralC<"FileLink">;
|
|
1535
1348
|
}>, t.PartialC<{
|
|
@@ -1595,9 +1408,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1595
1408
|
url: string;
|
|
1596
1409
|
name: string;
|
|
1597
1410
|
kind: string;
|
|
1411
|
+
size: string;
|
|
1598
1412
|
} & {
|
|
1599
1413
|
date?: string | null | undefined;
|
|
1600
|
-
size?: string;
|
|
1601
1414
|
} & {
|
|
1602
1415
|
__TYPE__: "FileLink";
|
|
1603
1416
|
} & {
|
|
@@ -1633,9 +1446,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1633
1446
|
url: string;
|
|
1634
1447
|
name: string;
|
|
1635
1448
|
kind: string;
|
|
1449
|
+
size: string;
|
|
1636
1450
|
} & {
|
|
1637
1451
|
date?: string | null | undefined;
|
|
1638
|
-
size?: string;
|
|
1639
1452
|
} & {
|
|
1640
1453
|
__TYPE__: "FileLink";
|
|
1641
1454
|
} & {
|
|
@@ -1661,24 +1474,7 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1661
1474
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1662
1475
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1663
1476
|
type: t.LiteralC<"embed">;
|
|
1664
|
-
data: t.
|
|
1665
|
-
embed_url: t.StringC;
|
|
1666
|
-
type: t.StringC;
|
|
1667
|
-
}>, t.PartialC<{
|
|
1668
|
-
version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1669
|
-
title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1670
|
-
author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1671
|
-
author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1672
|
-
provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1673
|
-
provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1674
|
-
cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
|
|
1675
|
-
thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1676
|
-
thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1677
|
-
thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
|
|
1678
|
-
html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1679
|
-
}>]>>, t.ExactC<t.TypeC<{
|
|
1680
|
-
__TYPE__: t.LiteralC<"EmbedContent">;
|
|
1681
|
-
}>>]>;
|
|
1477
|
+
data: t.Type<import("../../nestable").EmbedContent, import("../../nestable").EmbedContent, unknown>;
|
|
1682
1478
|
}>, t.PartialC<{
|
|
1683
1479
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1684
1480
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SharedSliceContent = exports.SharedSliceLegacy = exports.isSharedSliceContent = exports.SharedSliceContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fp_ts_1 = require("fp-ts");
|
|
6
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
6
7
|
const function_1 = require("fp-ts/lib/function");
|
|
7
8
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
8
9
|
const io_ts_types_1 = require("io-ts-types");
|
|
@@ -27,7 +28,7 @@ const SharedSliceLegacy = (ctx) => {
|
|
|
27
28
|
parsedSlice.variation,
|
|
28
29
|
]);
|
|
29
30
|
const result = (0, RepeatableContent_1.RepeatableWidgetsLegacy)(itemsCtx).decode(parsedSlice.items);
|
|
30
|
-
if (!result ||
|
|
31
|
+
if (!result || (0, Either_1.isLeft)(result))
|
|
31
32
|
return;
|
|
32
33
|
return result.right;
|
|
33
34
|
})() || [];
|
|
@@ -40,10 +41,9 @@ const SharedSliceLegacy = (ctx) => {
|
|
|
40
41
|
const result = (0, nestable_1.NestableLegacy)(FieldCtx).decode(value);
|
|
41
42
|
if (!result)
|
|
42
43
|
return acc;
|
|
43
|
-
if (
|
|
44
|
-
return { ...acc, [key]: result.right };
|
|
45
|
-
else
|
|
44
|
+
if ((0, Either_1.isLeft)(result))
|
|
46
45
|
return acc;
|
|
46
|
+
return { ...acc, [key]: result.right };
|
|
47
47
|
}, {});
|
|
48
48
|
return {
|
|
49
49
|
variation: parsedSlice.variation,
|