@prismicio/types-internal 2.0.0-beta.0 → 2.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/common/WidgetKey.d.ts +1 -1
- package/lib/common/WidgetKey.js +1 -1
- package/lib/common/index.js +1 -1
- package/lib/content/Document.d.ts +20 -100
- package/lib/content/Document.js +1 -1
- package/lib/content/LegacyContentCtx.d.ts +2 -2
- package/lib/content/LegacyContentCtx.js +1 -1
- package/lib/content/fields/EmptyContent.d.ts +1 -1
- package/lib/content/fields/EmptyContent.js +1 -1
- package/lib/content/fields/GroupContent.d.ts +8 -28
- package/lib/content/fields/GroupContent.js +1 -1
- package/lib/content/fields/UIDContent.d.ts +1 -1
- package/lib/content/fields/UIDContent.js +1 -1
- package/lib/content/fields/WidgetContent.d.ts +18 -98
- package/lib/content/fields/WidgetContent.js +1 -1
- package/lib/content/fields/index.js +6 -6
- package/lib/content/fields/nestable/BooleanContent.d.ts +1 -1
- package/lib/content/fields/nestable/BooleanContent.js +1 -1
- package/lib/content/fields/nestable/EmbedContent.d.ts +2 -2
- package/lib/content/fields/nestable/EmbedContent.js +1 -1
- package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/ColorContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/DateContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/NumberContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/RangeContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/SelectContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/TextContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/TimestampContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/index.d.ts +2 -2
- package/lib/content/fields/nestable/FieldContent/index.js +9 -9
- package/lib/content/fields/nestable/GeoPointContent.d.ts +1 -1
- package/lib/content/fields/nestable/GeoPointContent.js +1 -1
- package/lib/content/fields/nestable/ImageContent.d.ts +2 -2
- package/lib/content/fields/nestable/ImageContent.js +1 -1
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +1 -1
- package/lib/content/fields/nestable/IntegrationFieldContent.js +1 -1
- package/lib/content/fields/nestable/LinkContent.d.ts +6 -6
- package/lib/content/fields/nestable/LinkContent.js +1 -1
- package/lib/content/fields/nestable/NestableContent.d.ts +4 -14
- package/lib/content/fields/nestable/NestableContent.js +1 -1
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +11 -31
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +15 -11
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +3 -13
- package/lib/content/fields/nestable/RichTextContent/index.js +3 -3
- package/lib/content/fields/nestable/SeparatorContent.d.ts +1 -1
- package/lib/content/fields/nestable/SeparatorContent.js +1 -1
- package/lib/content/fields/nestable/index.js +10 -10
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +5 -25
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +1 -1
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +2 -12
- package/lib/content/fields/slices/Slice/RepeatableContent.js +1 -1
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +5 -25
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +1 -1
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +279 -27
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +6 -2
- package/lib/content/fields/slices/Slice/index.d.ts +285 -73
- package/lib/content/fields/slices/Slice/index.js +4 -4
- package/lib/content/fields/slices/SliceItem.d.ts +13 -73
- package/lib/content/fields/slices/SliceItem.js +1 -1
- package/lib/content/fields/slices/SlicesContent.d.ts +14 -74
- package/lib/content/fields/slices/SlicesContent.js +1 -1
- package/lib/content/fields/slices/index.js +3 -3
- package/lib/content/index.js +3 -3
- package/lib/content/utils.d.ts +2 -2
- package/lib/content/utils.js +2 -1
- package/lib/customtypes/CustomType.d.ts +210 -16
- package/lib/customtypes/CustomType.js +7 -2
- package/lib/customtypes/Section.d.ts +198 -16
- package/lib/customtypes/Section.js +1 -1
- package/lib/customtypes/diff/Changes.d.ts +4 -4
- package/lib/customtypes/diff/SharedSlice.d.ts +723 -3
- package/lib/customtypes/diff/Variation.d.ts +709 -3
- package/lib/customtypes/diff/index.js +3 -3
- package/lib/customtypes/index.js +4 -4
- package/lib/customtypes/widgets/Group.d.ts +56 -4
- package/lib/customtypes/widgets/Group.js +1 -1
- package/lib/customtypes/widgets/UID.d.ts +2 -2
- package/lib/customtypes/widgets/UID.js +1 -1
- package/lib/customtypes/widgets/Widget.d.ts +305 -19
- package/lib/customtypes/widgets/Widget.js +1 -1
- package/lib/customtypes/widgets/index.js +6 -6
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/BooleanField.js +1 -1
- package/lib/customtypes/widgets/nestable/Color.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Color.js +1 -1
- package/lib/customtypes/widgets/nestable/Date.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Date.js +1 -1
- package/lib/customtypes/widgets/nestable/Embed.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Embed.js +1 -1
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/GeoPoint.js +1 -1
- package/lib/customtypes/widgets/nestable/Image.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/Image.js +2 -2
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/IntegrationField.js +1 -1
- package/lib/customtypes/widgets/nestable/Link/ContentRelationshipResolver.d.ts +29 -0
- package/lib/customtypes/widgets/nestable/Link/ContentRelationshipResolver.js +44 -0
- package/lib/customtypes/widgets/nestable/Link/index.d.ts +82 -0
- package/lib/customtypes/widgets/nestable/{Link.js → Link/index.js} +5 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +29 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.js +1 -1
- package/lib/customtypes/widgets/nestable/Number.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Number.js +1 -1
- package/lib/customtypes/widgets/nestable/Range.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Range.js +1 -1
- package/lib/customtypes/widgets/nestable/RichText.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/RichText.js +2 -2
- package/lib/customtypes/widgets/nestable/Select.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Select.js +1 -1
- package/lib/customtypes/widgets/nestable/Separator.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Separator.js +1 -1
- package/lib/customtypes/widgets/nestable/Text.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Text.js +1 -1
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Timestamp.js +1 -1
- package/lib/customtypes/widgets/nestable/index.js +16 -16
- package/lib/customtypes/widgets/shared/ImageConstraint.d.ts +1 -1
- package/lib/customtypes/widgets/shared/ImageConstraint.js +1 -1
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +56 -4
- package/lib/customtypes/widgets/slices/CompositeSlice.js +1 -1
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +55 -3
- package/lib/customtypes/widgets/slices/LegacySlice.js +1 -1
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +110 -6
- package/lib/customtypes/widgets/slices/SharedSlice.js +1 -1
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +1 -1
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +1 -1
- package/lib/customtypes/widgets/slices/Slice.d.ts +2 -2
- package/lib/customtypes/widgets/slices/Slices.d.ts +497 -29
- package/lib/customtypes/widgets/slices/Slices.js +1 -1
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +1 -1
- package/lib/customtypes/widgets/slices/SlicesTypes.js +1 -1
- package/lib/customtypes/widgets/slices/index.js +7 -7
- package/lib/utils/index.js +2 -2
- package/lib/validators/DateFromString.js +1 -1
- package/lib/validators/DateFromStringOrNumber.js +1 -1
- package/lib/validators/DateFromTsMs.js +1 -1
- package/lib/validators/IntFromNumber.d.ts +2 -2
- package/lib/validators/IntFromNumber.js +1 -1
- package/lib/validators/IntFromPixels.d.ts +2 -2
- package/lib/validators/IntFromPixels.js +1 -1
- package/lib/validators/NonEmptyString.js +1 -1
- package/lib/validators/NonEmptyStringOrNull.js +1 -1
- package/lib/validators/NumberOrNull.js +1 -1
- package/lib/validators/StringFromBoolean.d.ts +2 -2
- package/lib/validators/StringFromBoolean.js +1 -1
- package/lib/validators/StringFromNumber.d.ts +2 -2
- package/lib/validators/StringFromNumber.js +1 -1
- package/lib/validators/StringOrNull.js +1 -1
- package/lib/validators/TrimmedString.d.ts +2 -2
- package/lib/validators/TrimmedString.js +1 -1
- package/lib/validators/function.js +1 -1
- package/lib/validators/index.js +12 -12
- package/package.json +1 -1
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +31 -23
- package/src/content/fields/nestable/RichTextContent/index.ts +1 -3
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +4 -1
- package/src/customtypes/CustomType.ts +6 -0
- package/src/customtypes/widgets/nestable/Link/ContentRelationshipResolver.ts +69 -0
- package/src/customtypes/widgets/nestable/{Link.ts → Link/index.ts} +5 -2
- package/lib/customtypes/widgets/nestable/Link.d.ts +0 -29
|
@@ -219,8 +219,6 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
219
219
|
title?: string;
|
|
220
220
|
} | null | undefined;
|
|
221
221
|
}), ({
|
|
222
|
-
__TYPE__: "ImageLink";
|
|
223
|
-
} & {
|
|
224
222
|
id: string;
|
|
225
223
|
url: string;
|
|
226
224
|
height: string;
|
|
@@ -238,17 +236,9 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
238
236
|
size: string;
|
|
239
237
|
} & {
|
|
240
238
|
date?: string | null | undefined;
|
|
241
|
-
}
|
|
242
|
-
__TYPE__: "FileLink";
|
|
243
|
-
} & {
|
|
244
|
-
size?: string;
|
|
245
|
-
}) | ({
|
|
246
|
-
__TYPE__: "DocumentLink";
|
|
247
|
-
} & {
|
|
239
|
+
}) | {
|
|
248
240
|
id: string;
|
|
249
|
-
}
|
|
250
|
-
__TYPE__: "ExternalLink";
|
|
251
|
-
} & {
|
|
241
|
+
} | ({
|
|
252
242
|
url: string;
|
|
253
243
|
} & {
|
|
254
244
|
kind?: "web";
|
|
@@ -311,8 +301,8 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
311
301
|
}>>, t.ExactC<t.TypeC<{
|
|
312
302
|
__TYPE__: t.LiteralC<"SeparatorContent">;
|
|
313
303
|
}>>]>;
|
|
314
|
-
export type NestableContent = t.TypeOf<typeof NestableContent>;
|
|
315
|
-
export type NestableContentType = NestableContent["__TYPE__"];
|
|
304
|
+
export declare type NestableContent = t.TypeOf<typeof NestableContent>;
|
|
305
|
+
export declare type NestableContentType = NestableContent["__TYPE__"];
|
|
316
306
|
export declare const isNestableContent: (u: unknown) => u is {
|
|
317
307
|
type: string;
|
|
318
308
|
__TYPE__: "EmptyContent";
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NestableLegacy = exports.isNestableContent = exports.NestableContent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Either_1 = require("fp-ts/lib/Either");
|
|
6
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
7
7
|
const EmptyContent_1 = require("../EmptyContent");
|
|
8
8
|
const BooleanContent_1 = require("./BooleanContent");
|
|
9
9
|
const EmbedContent_1 = require("./EmbedContent");
|
|
@@ -24,7 +24,7 @@ export declare const Meta: t.ExactC<t.IntersectionC<[t.PartialC<{
|
|
|
24
24
|
rtl: null;
|
|
25
25
|
}>, t.LiteralC<"label">]>;
|
|
26
26
|
}>]>>;
|
|
27
|
-
export type Meta = t.TypeOf<typeof Meta>;
|
|
27
|
+
export declare type Meta = t.TypeOf<typeof Meta>;
|
|
28
28
|
export declare const Span: t.ExactC<t.IntersectionC<[t.PartialC<{
|
|
29
29
|
data: t.UnknownC;
|
|
30
30
|
}>, t.TypeC<{
|
|
@@ -49,7 +49,7 @@ export declare const Span: t.ExactC<t.IntersectionC<[t.PartialC<{
|
|
|
49
49
|
rtl: null;
|
|
50
50
|
}>, t.LiteralC<"label">]>;
|
|
51
51
|
}>]>>;
|
|
52
|
-
export type Span = Meta;
|
|
52
|
+
export declare type Span = Meta;
|
|
53
53
|
export declare const ValidatedMetas: (linkCodec: LinkCodec) => t.Type<({
|
|
54
54
|
data?: unknown;
|
|
55
55
|
} & {
|
|
@@ -127,8 +127,6 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
127
127
|
title?: string;
|
|
128
128
|
} | null | undefined;
|
|
129
129
|
}), ({
|
|
130
|
-
__TYPE__: "ImageLink";
|
|
131
|
-
} & {
|
|
132
130
|
id: string;
|
|
133
131
|
url: string;
|
|
134
132
|
height: string;
|
|
@@ -146,17 +144,9 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
146
144
|
size: string;
|
|
147
145
|
} & {
|
|
148
146
|
date?: string | null | undefined;
|
|
149
|
-
}
|
|
150
|
-
__TYPE__: "FileLink";
|
|
151
|
-
} & {
|
|
152
|
-
size?: string;
|
|
153
|
-
}) | ({
|
|
154
|
-
__TYPE__: "DocumentLink";
|
|
155
|
-
} & {
|
|
147
|
+
}) | {
|
|
156
148
|
id: string;
|
|
157
|
-
}
|
|
158
|
-
__TYPE__: "ExternalLink";
|
|
159
|
-
} & {
|
|
149
|
+
} | ({
|
|
160
150
|
url: string;
|
|
161
151
|
} & {
|
|
162
152
|
kind?: "web";
|
|
@@ -170,7 +160,7 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
170
160
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
171
161
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
172
162
|
}>]>>;
|
|
173
|
-
export type ImageBlock = t.TypeOf<typeof ImageBlock>;
|
|
163
|
+
export declare type ImageBlock = t.TypeOf<typeof ImageBlock>;
|
|
174
164
|
export declare function checkImageBlock(block: Block): block is ImageBlock;
|
|
175
165
|
export declare const EmbedBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
176
166
|
type: t.LiteralC<"embed">;
|
|
@@ -197,9 +187,9 @@ export declare const EmbedBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
197
187
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
198
188
|
direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
199
189
|
}>]>>;
|
|
200
|
-
export type EmbedBlock = t.TypeOf<typeof EmbedBlock>;
|
|
190
|
+
export declare type EmbedBlock = t.TypeOf<typeof EmbedBlock>;
|
|
201
191
|
export declare function checkEmbedBlock(block: Block): block is EmbedBlock;
|
|
202
|
-
type LinkCodec = typeof Link | typeof LinkLegacy;
|
|
192
|
+
declare type LinkCodec = typeof Link | typeof LinkLegacy;
|
|
203
193
|
export declare const TextBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
204
194
|
type: t.Type<"paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
|
|
205
195
|
content: t.IntersectionC<[t.TypeC<{
|
|
@@ -223,7 +213,7 @@ export declare const TextBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
223
213
|
label: t.StringC;
|
|
224
214
|
direction: t.StringC;
|
|
225
215
|
}>]>>;
|
|
226
|
-
export type TextBlock = t.TypeOf<typeof TextBlock>;
|
|
216
|
+
export declare type TextBlock = t.TypeOf<typeof TextBlock>;
|
|
227
217
|
export declare const BlockLegacy: t.Type<({
|
|
228
218
|
type: "image";
|
|
229
219
|
data: {
|
|
@@ -505,8 +495,6 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
505
495
|
title?: string;
|
|
506
496
|
} | null | undefined;
|
|
507
497
|
}), ({
|
|
508
|
-
__TYPE__: "ImageLink";
|
|
509
|
-
} & {
|
|
510
498
|
id: string;
|
|
511
499
|
url: string;
|
|
512
500
|
height: string;
|
|
@@ -524,17 +512,9 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
524
512
|
size: string;
|
|
525
513
|
} & {
|
|
526
514
|
date?: string | null | undefined;
|
|
527
|
-
}
|
|
528
|
-
__TYPE__: "FileLink";
|
|
529
|
-
} & {
|
|
530
|
-
size?: string;
|
|
531
|
-
}) | ({
|
|
532
|
-
__TYPE__: "DocumentLink";
|
|
533
|
-
} & {
|
|
515
|
+
}) | {
|
|
534
516
|
id: string;
|
|
535
|
-
}
|
|
536
|
-
__TYPE__: "ExternalLink";
|
|
537
|
-
} & {
|
|
517
|
+
} | ({
|
|
538
518
|
url: string;
|
|
539
519
|
} & {
|
|
540
520
|
kind?: "web";
|
|
@@ -594,5 +574,5 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
594
574
|
label: t.StringC;
|
|
595
575
|
direction: t.StringC;
|
|
596
576
|
}>]>>]>;
|
|
597
|
-
export type Block = t.TypeOf<typeof Block>;
|
|
577
|
+
export declare type Block = t.TypeOf<typeof Block>;
|
|
598
578
|
export {};
|
|
@@ -5,7 +5,7 @@ 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
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
8
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
9
9
|
const nestable_1 = require("../../../../customtypes/widgets/nestable");
|
|
10
10
|
const validators_1 = require("../../../../validators");
|
|
11
11
|
const function_2 = require("../../../../validators/function");
|
|
@@ -62,13 +62,13 @@ const ValidatedMetas = (linkCodec) => new t.Type("ValidatedMetas", (metas) => Ar
|
|
|
62
62
|
}, []);
|
|
63
63
|
});
|
|
64
64
|
exports.ValidatedMetas = ValidatedMetas;
|
|
65
|
-
|
|
65
|
+
const ImageBlockCodec = (linkCodec) => t.exact(t.intersection([
|
|
66
66
|
t.type({
|
|
67
67
|
type: t.literal(nestable_1.RichTextNodeType.image),
|
|
68
68
|
data: t.intersection([
|
|
69
69
|
ImageContent_1.ImageContentView,
|
|
70
70
|
t.partial({
|
|
71
|
-
linkTo: (0, function_2.nullable)(
|
|
71
|
+
linkTo: (0, function_2.nullable)(linkCodec),
|
|
72
72
|
}),
|
|
73
73
|
]),
|
|
74
74
|
}),
|
|
@@ -77,6 +77,8 @@ exports.ImageBlock = t.exact(t.intersection([
|
|
|
77
77
|
direction: validators_1.StringOrNull,
|
|
78
78
|
}),
|
|
79
79
|
]));
|
|
80
|
+
exports.ImageBlock = ImageBlockCodec(LinkContent_1.Link);
|
|
81
|
+
const ImageBlockLegacy = ImageBlockCodec(LinkContent_1.LinkLegacy);
|
|
80
82
|
function checkImageBlock(block) {
|
|
81
83
|
return block.type === nestable_1.RichTextNodeType.image;
|
|
82
84
|
}
|
|
@@ -145,15 +147,17 @@ exports.TextBlock = TextBlockCodec(LinkContent_1.Link);
|
|
|
145
147
|
const TextBlockLegacy = TextBlockCodec(LinkContent_1.LinkLegacy);
|
|
146
148
|
const legacyBlockCodec = t.union([
|
|
147
149
|
EmbedBlockLegacy,
|
|
148
|
-
|
|
150
|
+
ImageBlockLegacy,
|
|
149
151
|
TextBlockLegacy,
|
|
150
152
|
]);
|
|
151
|
-
exports.BlockLegacy = new t.Type("BlockLegacy", (u) => EmbedBlockLegacy.is(u) ||
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
exports.BlockLegacy = new t.Type("BlockLegacy", (u) => EmbedBlockLegacy.is(u) || ImageBlockLegacy.is(u) || TextBlockLegacy.is(u), (legacyBlock) => legacyBlockCodec.decode(legacyBlock), (block) => {
|
|
154
|
+
return (() => {
|
|
155
|
+
if (exports.ImageBlock.is(block))
|
|
156
|
+
return ImageBlockLegacy.encode(block);
|
|
157
|
+
else if (exports.EmbedBlock.is(block))
|
|
158
|
+
return EmbedBlockLegacy.encode(block);
|
|
159
|
+
else
|
|
160
|
+
return TextBlockLegacy.encode(block);
|
|
161
|
+
})();
|
|
158
162
|
});
|
|
159
163
|
exports.Block = t.union([exports.ImageBlock, exports.EmbedBlock, exports.TextBlock]);
|
|
@@ -179,8 +179,6 @@ export declare const RichTextContent: t.ExactC<t.TypeC<{
|
|
|
179
179
|
title?: string;
|
|
180
180
|
} | null | undefined;
|
|
181
181
|
}), ({
|
|
182
|
-
__TYPE__: "ImageLink";
|
|
183
|
-
} & {
|
|
184
182
|
id: string;
|
|
185
183
|
url: string;
|
|
186
184
|
height: string;
|
|
@@ -198,17 +196,9 @@ export declare const RichTextContent: t.ExactC<t.TypeC<{
|
|
|
198
196
|
size: string;
|
|
199
197
|
} & {
|
|
200
198
|
date?: string | null | undefined;
|
|
201
|
-
}
|
|
202
|
-
__TYPE__: "FileLink";
|
|
203
|
-
} & {
|
|
204
|
-
size?: string;
|
|
205
|
-
}) | ({
|
|
206
|
-
__TYPE__: "DocumentLink";
|
|
207
|
-
} & {
|
|
199
|
+
}) | {
|
|
208
200
|
id: string;
|
|
209
|
-
}
|
|
210
|
-
__TYPE__: "ExternalLink";
|
|
211
|
-
} & {
|
|
201
|
+
} | ({
|
|
212
202
|
url: string;
|
|
213
203
|
} & {
|
|
214
204
|
kind?: "web";
|
|
@@ -269,7 +259,7 @@ export declare const RichTextContent: t.ExactC<t.TypeC<{
|
|
|
269
259
|
direction: t.StringC;
|
|
270
260
|
}>]>>]>>;
|
|
271
261
|
}>>;
|
|
272
|
-
export type RichTextContent = t.TypeOf<typeof RichTextContent>;
|
|
262
|
+
export declare type RichTextContent = t.TypeOf<typeof RichTextContent>;
|
|
273
263
|
export * from "./Blocks";
|
|
274
264
|
export declare const RichTextLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
275
265
|
__TYPE__: "StructuredTextContent";
|
|
@@ -4,7 +4,7 @@ exports.RichTextLegacy = exports.RichTextContent = exports.isRichTextContent = e
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fp_ts_1 = require("fp-ts");
|
|
6
6
|
const function_1 = require("fp-ts/lib/function");
|
|
7
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
7
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
8
8
|
const utils_1 = require("../../../utils");
|
|
9
9
|
const Blocks_1 = require("./Blocks");
|
|
10
10
|
exports.RichTextContentType = "StructuredTextContent";
|
|
@@ -15,9 +15,9 @@ exports.RichTextContent = t.strict({
|
|
|
15
15
|
__TYPE__: t.literal(exports.RichTextContentType),
|
|
16
16
|
value: t.array(Blocks_1.Block),
|
|
17
17
|
});
|
|
18
|
-
tslib_1.__exportStar(require("./Blocks"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./Blocks"), exports);
|
|
19
19
|
const RichTextLegacy = (ctx) => new t.Type("RichTextLegacy", exports.isRichTextContent, (u) => {
|
|
20
|
-
return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((r) =>
|
|
20
|
+
return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((r) => ({ value: r, __TYPE__: exports.RichTextContentType })));
|
|
21
21
|
}, (r) => {
|
|
22
22
|
return {
|
|
23
23
|
content: legacyReader.encode(r.value),
|
|
@@ -10,4 +10,4 @@ export declare const SeparatorLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
|
10
10
|
export declare const SeparatorContent: t.ExactC<t.TypeC<{
|
|
11
11
|
__TYPE__: t.LiteralC<"SeparatorContent">;
|
|
12
12
|
}>>;
|
|
13
|
-
export type SeparatorContent = t.TypeOf<typeof SeparatorContent>;
|
|
13
|
+
export declare type SeparatorContent = t.TypeOf<typeof SeparatorContent>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SeparatorContent = exports.SeparatorLegacy = exports.isSeparatorContent = exports.SeparatorContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
exports.SeparatorContentType = "SeparatorContent";
|
|
8
8
|
const isSeparatorContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.SeparatorContentType;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./BooleanContent"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./EmbedContent"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./FieldContent"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./GeoPointContent"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./ImageContent"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./IntegrationFieldContent"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./LinkContent"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./NestableContent"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./RichTextContent"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./SeparatorContent"), exports);
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./BooleanContent"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./EmbedContent"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./FieldContent"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./GeoPointContent"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./ImageContent"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./IntegrationFieldContent"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./LinkContent"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./NestableContent"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./RichTextContent"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./SeparatorContent"), exports);
|
|
@@ -1311,8 +1311,6 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
|
|
|
1311
1311
|
title?: string;
|
|
1312
1312
|
} | null | undefined;
|
|
1313
1313
|
}), ({
|
|
1314
|
-
__TYPE__: "ImageLink";
|
|
1315
|
-
} & {
|
|
1316
1314
|
id: string;
|
|
1317
1315
|
url: string;
|
|
1318
1316
|
height: string;
|
|
@@ -1330,17 +1328,9 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
|
|
|
1330
1328
|
size: string;
|
|
1331
1329
|
} & {
|
|
1332
1330
|
date?: string | null | undefined;
|
|
1333
|
-
}
|
|
1334
|
-
__TYPE__: "FileLink";
|
|
1335
|
-
} & {
|
|
1336
|
-
size?: string;
|
|
1337
|
-
}) | ({
|
|
1338
|
-
__TYPE__: "DocumentLink";
|
|
1339
|
-
} & {
|
|
1331
|
+
}) | {
|
|
1340
1332
|
id: string;
|
|
1341
|
-
}
|
|
1342
|
-
__TYPE__: "ExternalLink";
|
|
1343
|
-
} & {
|
|
1333
|
+
} | ({
|
|
1344
1334
|
url: string;
|
|
1345
1335
|
} & {
|
|
1346
1336
|
kind?: "web";
|
|
@@ -1624,8 +1614,6 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
|
|
|
1624
1614
|
title?: string;
|
|
1625
1615
|
} | null | undefined;
|
|
1626
1616
|
}), ({
|
|
1627
|
-
__TYPE__: "ImageLink";
|
|
1628
|
-
} & {
|
|
1629
1617
|
id: string;
|
|
1630
1618
|
url: string;
|
|
1631
1619
|
height: string;
|
|
@@ -1643,17 +1631,9 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
|
|
|
1643
1631
|
size: string;
|
|
1644
1632
|
} & {
|
|
1645
1633
|
date?: string | null | undefined;
|
|
1646
|
-
}
|
|
1647
|
-
__TYPE__: "FileLink";
|
|
1648
|
-
} & {
|
|
1649
|
-
size?: string;
|
|
1650
|
-
}) | ({
|
|
1651
|
-
__TYPE__: "DocumentLink";
|
|
1652
|
-
} & {
|
|
1634
|
+
}) | {
|
|
1653
1635
|
id: string;
|
|
1654
|
-
}
|
|
1655
|
-
__TYPE__: "ExternalLink";
|
|
1656
|
-
} & {
|
|
1636
|
+
} | ({
|
|
1657
1637
|
url: string;
|
|
1658
1638
|
} & {
|
|
1659
1639
|
kind?: "web";
|
|
@@ -1718,4 +1698,4 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
|
|
|
1718
1698
|
}>>]>]>>;
|
|
1719
1699
|
}>>>;
|
|
1720
1700
|
}>>;
|
|
1721
|
-
export type CompositeSliceContent = t.TypeOf<typeof CompositeSliceContent>;
|
|
1701
|
+
export declare type CompositeSliceContent = t.TypeOf<typeof CompositeSliceContent>;
|
|
@@ -5,7 +5,7 @@ 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
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
8
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
9
9
|
const LegacyContentCtx_1 = require("../../../LegacyContentCtx");
|
|
10
10
|
const utils_1 = require("../../../utils");
|
|
11
11
|
const nestable_1 = require("../../nestable");
|
|
@@ -493,8 +493,6 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
493
493
|
title?: string;
|
|
494
494
|
} | null | undefined;
|
|
495
495
|
}), ({
|
|
496
|
-
__TYPE__: "ImageLink";
|
|
497
|
-
} & {
|
|
498
496
|
id: string;
|
|
499
497
|
url: string;
|
|
500
498
|
height: string;
|
|
@@ -512,17 +510,9 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
|
|
|
512
510
|
size: string;
|
|
513
511
|
} & {
|
|
514
512
|
date?: string | null | undefined;
|
|
515
|
-
}
|
|
516
|
-
__TYPE__: "FileLink";
|
|
517
|
-
} & {
|
|
518
|
-
size?: string;
|
|
519
|
-
}) | ({
|
|
520
|
-
__TYPE__: "DocumentLink";
|
|
521
|
-
} & {
|
|
513
|
+
}) | {
|
|
522
514
|
id: string;
|
|
523
|
-
}
|
|
524
|
-
__TYPE__: "ExternalLink";
|
|
525
|
-
} & {
|
|
515
|
+
} | ({
|
|
526
516
|
url: string;
|
|
527
517
|
} & {
|
|
528
518
|
kind?: "web";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RepeatableWidgets = exports.RepeatableWidgetsLegacy = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
6
|
const GroupContent_1 = require("../../GroupContent");
|
|
7
7
|
const nestable_1 = require("../../nestable");
|
|
8
8
|
const RepeatableWidgetsLegacy = (ctx) => {
|
|
@@ -1315,8 +1315,6 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1315
1315
|
title?: string;
|
|
1316
1316
|
} | null | undefined;
|
|
1317
1317
|
}), ({
|
|
1318
|
-
__TYPE__: "ImageLink";
|
|
1319
|
-
} & {
|
|
1320
1318
|
id: string;
|
|
1321
1319
|
url: string;
|
|
1322
1320
|
height: string;
|
|
@@ -1334,17 +1332,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1334
1332
|
size: string;
|
|
1335
1333
|
} & {
|
|
1336
1334
|
date?: string | null | undefined;
|
|
1337
|
-
}
|
|
1338
|
-
__TYPE__: "FileLink";
|
|
1339
|
-
} & {
|
|
1340
|
-
size?: string;
|
|
1341
|
-
}) | ({
|
|
1342
|
-
__TYPE__: "DocumentLink";
|
|
1343
|
-
} & {
|
|
1335
|
+
}) | {
|
|
1344
1336
|
id: string;
|
|
1345
|
-
}
|
|
1346
|
-
__TYPE__: "ExternalLink";
|
|
1347
|
-
} & {
|
|
1337
|
+
} | ({
|
|
1348
1338
|
url: string;
|
|
1349
1339
|
} & {
|
|
1350
1340
|
kind?: "web";
|
|
@@ -1628,8 +1618,6 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1628
1618
|
title?: string;
|
|
1629
1619
|
} | null | undefined;
|
|
1630
1620
|
}), ({
|
|
1631
|
-
__TYPE__: "ImageLink";
|
|
1632
|
-
} & {
|
|
1633
1621
|
id: string;
|
|
1634
1622
|
url: string;
|
|
1635
1623
|
height: string;
|
|
@@ -1647,17 +1635,9 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1647
1635
|
size: string;
|
|
1648
1636
|
} & {
|
|
1649
1637
|
date?: string | null | undefined;
|
|
1650
|
-
}
|
|
1651
|
-
__TYPE__: "FileLink";
|
|
1652
|
-
} & {
|
|
1653
|
-
size?: string;
|
|
1654
|
-
}) | ({
|
|
1655
|
-
__TYPE__: "DocumentLink";
|
|
1656
|
-
} & {
|
|
1638
|
+
}) | {
|
|
1657
1639
|
id: string;
|
|
1658
|
-
}
|
|
1659
|
-
__TYPE__: "ExternalLink";
|
|
1660
|
-
} & {
|
|
1640
|
+
} | ({
|
|
1661
1641
|
url: string;
|
|
1662
1642
|
} & {
|
|
1663
1643
|
kind?: "web";
|
|
@@ -1722,4 +1702,4 @@ export declare const SharedSliceContent: t.ExactC<t.TypeC<{
|
|
|
1722
1702
|
}>>]>]>>;
|
|
1723
1703
|
}>>>;
|
|
1724
1704
|
}>>;
|
|
1725
|
-
export type SharedSliceContent = t.TypeOf<typeof SharedSliceContent>;
|
|
1705
|
+
export declare type SharedSliceContent = t.TypeOf<typeof SharedSliceContent>;
|
|
@@ -5,7 +5,7 @@ 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
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
8
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
9
9
|
const io_ts_types_1 = require("io-ts-types");
|
|
10
10
|
const LegacyContentCtx_1 = require("../../../LegacyContentCtx");
|
|
11
11
|
const utils_1 = require("../../../utils");
|