@prismicio/types-internal 3.1.0-alpha.4 → 3.1.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 +1 -2
- package/lib/content/Document.d.ts +12 -12
- package/lib/content/fields/GroupContent.js +1 -2
- package/lib/content/fields/RepeatableContent.d.ts +45 -47
- package/lib/content/fields/WidgetContent.d.ts +12 -12
- package/lib/content/fields/index.d.ts +0 -1
- package/lib/content/fields/index.js +0 -1
- package/lib/content/fields/nestable/LinkContent.d.ts +3 -3
- package/lib/content/fields/nestable/LinkContent.js +9 -4
- package/lib/content/fields/nestable/NestableContent.d.ts +2 -2
- package/lib/content/fields/nestable/NestableContent.js +1 -1
- package/lib/content/fields/nestable/RepeatableContent.d.ts +164 -0
- package/lib/content/fields/nestable/RepeatableContent.js +93 -0
- package/lib/content/fields/nestable/RichTextContent/TextBlock.d.ts +727 -0
- package/lib/content/fields/nestable/RichTextContent/TextBlock.js +80 -0
- package/lib/content/fields/nestable/index.d.ts +1 -0
- package/lib/content/fields/nestable/index.js +1 -0
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +4 -4
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +2 -2
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +4 -4
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +6 -7
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +2 -2
- package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +2 -2
- package/lib/content/fields/slices/Slice/index.d.ts +10 -10
- package/lib/content/fields/slices/SliceItem.d.ts +10 -10
- package/lib/content/fields/slices/SlicesContent.d.ts +10 -10
- package/lib/customtypes/widgets/slices/SliceWidget.d.ts +327 -0
- package/lib/customtypes/widgets/slices/SliceWidget.js +8 -0
- package/package.json +1 -1
- package/src/_internal/utils.ts +1 -1
- package/src/content/fields/GroupContent.ts +6 -2
- package/src/content/fields/index.ts +0 -1
- package/src/content/fields/nestable/LinkContent.ts +16 -5
- package/src/content/fields/nestable/NestableContent.ts +5 -5
- package/src/content/fields/{RepeatableContent.ts → nestable/RepeatableContent.ts} +4 -4
- package/src/content/fields/nestable/index.ts +1 -0
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +2 -2
package/lib/_internal/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { SharedSliceItemContent, SliceItemContent, WidgetContent } from "../content";
|
|
2
|
-
import type { RepeatableContent } from "../content/fields/RepeatableContent";
|
|
1
|
+
import type { RepeatableContent, SharedSliceItemContent, SliceItemContent, WidgetContent } from "../content";
|
|
3
2
|
import type { CompositeSlice, Group, NestableWidget, StaticSlices, UID, VariationFields } from "../customtypes";
|
|
4
3
|
export declare type TraverseSliceContentFn = <S extends SliceItemContent | SharedSliceItemContent, D extends VariationFields | CompositeSlice | Group | NestableWidget>({ path, key, apiId, model, content, }: {
|
|
5
4
|
path: ContentPath;
|
|
@@ -115,7 +115,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
115
115
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
116
116
|
value: t.StringC;
|
|
117
117
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
118
|
-
key: t.
|
|
118
|
+
key: t.Type<string, string, unknown>;
|
|
119
119
|
}>>, t.ExactC<t.TypeC<{
|
|
120
120
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
121
121
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -430,7 +430,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
430
430
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
431
431
|
type: t.LiteralC<"Link">;
|
|
432
432
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
433
|
-
key: t.
|
|
433
|
+
key: t.Type<string, string, unknown>;
|
|
434
434
|
}>>, t.ExactC<t.TypeC<{
|
|
435
435
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
436
436
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -623,7 +623,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
623
623
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
624
624
|
value: t.StringC;
|
|
625
625
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
626
|
-
key: t.
|
|
626
|
+
key: t.Type<string, string, unknown>;
|
|
627
627
|
}>>, t.ExactC<t.TypeC<{
|
|
628
628
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
629
629
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -938,7 +938,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
938
938
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
939
939
|
type: t.LiteralC<"Link">;
|
|
940
940
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
941
|
-
key: t.
|
|
941
|
+
key: t.Type<string, string, unknown>;
|
|
942
942
|
}>>, t.ExactC<t.TypeC<{
|
|
943
943
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
944
944
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1123,7 +1123,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
1123
1123
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
1124
1124
|
value: t.StringC;
|
|
1125
1125
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1126
|
-
key: t.
|
|
1126
|
+
key: t.Type<string, string, unknown>;
|
|
1127
1127
|
}>>, t.ExactC<t.TypeC<{
|
|
1128
1128
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1129
1129
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1438,7 +1438,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
1438
1438
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
1439
1439
|
type: t.LiteralC<"Link">;
|
|
1440
1440
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1441
|
-
key: t.
|
|
1441
|
+
key: t.Type<string, string, unknown>;
|
|
1442
1442
|
}>>, t.ExactC<t.TypeC<{
|
|
1443
1443
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1444
1444
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1625,7 +1625,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
1625
1625
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
1626
1626
|
value: t.StringC;
|
|
1627
1627
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1628
|
-
key: t.
|
|
1628
|
+
key: t.Type<string, string, unknown>;
|
|
1629
1629
|
}>>, t.ExactC<t.TypeC<{
|
|
1630
1630
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1631
1631
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1940,7 +1940,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
1940
1940
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
1941
1941
|
type: t.LiteralC<"Link">;
|
|
1942
1942
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1943
|
-
key: t.
|
|
1943
|
+
key: t.Type<string, string, unknown>;
|
|
1944
1944
|
}>>, t.ExactC<t.TypeC<{
|
|
1945
1945
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1946
1946
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2125,7 +2125,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
2125
2125
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
2126
2126
|
value: t.StringC;
|
|
2127
2127
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2128
|
-
key: t.
|
|
2128
|
+
key: t.Type<string, string, unknown>;
|
|
2129
2129
|
}>>, t.ExactC<t.TypeC<{
|
|
2130
2130
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2131
2131
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2440,7 +2440,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
2440
2440
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
2441
2441
|
type: t.LiteralC<"Link">;
|
|
2442
2442
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2443
|
-
key: t.
|
|
2443
|
+
key: t.Type<string, string, unknown>;
|
|
2444
2444
|
}>>, t.ExactC<t.TypeC<{
|
|
2445
2445
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2446
2446
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2624,7 +2624,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
2624
2624
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
2625
2625
|
value: t.StringC;
|
|
2626
2626
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2627
|
-
key: t.
|
|
2627
|
+
key: t.Type<string, string, unknown>;
|
|
2628
2628
|
}>>, t.ExactC<t.TypeC<{
|
|
2629
2629
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2630
2630
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2939,7 +2939,7 @@ export declare const Document: t.RecordC<t.Type<string, string, unknown>, t.Unio
|
|
|
2939
2939
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
2940
2940
|
type: t.LiteralC<"Link">;
|
|
2941
2941
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2942
|
-
key: t.
|
|
2942
|
+
key: t.Type<string, string, unknown>;
|
|
2943
2943
|
}>>, t.ExactC<t.TypeC<{
|
|
2944
2944
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2945
2945
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -10,7 +10,6 @@ const customtypes_1 = require("../../customtypes");
|
|
|
10
10
|
const LegacyContentCtx_1 = require("../LegacyContentCtx");
|
|
11
11
|
const utils_1 = require("../utils");
|
|
12
12
|
const nestable_1 = require("./nestable");
|
|
13
|
-
const RepeatableContent_1 = require("./RepeatableContent");
|
|
14
13
|
const withDefaultValues_1 = require("./withDefaultValues");
|
|
15
14
|
exports.GroupItemContentType = "GroupItemContent";
|
|
16
15
|
exports.GroupContentType = "GroupContentType";
|
|
@@ -146,7 +145,7 @@ function traverseGroupItemsContent({ path, model, content, }) {
|
|
|
146
145
|
else if ((!fieldDef ||
|
|
147
146
|
((fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.type) === "Link" && ((_a = fieldDef.config) === null || _a === void 0 ? void 0 : _a.repeat))) &&
|
|
148
147
|
fieldContent.__TYPE__ === "RepeatableContent") {
|
|
149
|
-
transformedField = (0,
|
|
148
|
+
transformedField = (0, nestable_1.traverseRepeatableContent)({
|
|
150
149
|
path: groupItemPath.concat([{ key: fieldKey, type: "Widget" }]),
|
|
151
150
|
key: fieldKey,
|
|
152
151
|
apiId: fieldKey,
|
|
@@ -5,14 +5,12 @@ import type { LegacyContentCtx, WithTypes } from "../LegacyContentCtx";
|
|
|
5
5
|
export declare const RepeatableContent: t.ExactC<t.TypeC<{
|
|
6
6
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
7
7
|
type: t.LiteralC<"Link">;
|
|
8
|
-
value: t.ArrayC<t.
|
|
9
|
-
key: t.StringC;
|
|
10
|
-
}>>, t.ExactC<t.TypeC<{
|
|
8
|
+
value: t.ArrayC<t.ExactC<t.TypeC<{
|
|
11
9
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
12
10
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
13
11
|
__TYPE__: t.LiteralC<"ImageLink">;
|
|
14
|
-
}>>, t.
|
|
15
|
-
kind: t.
|
|
12
|
+
}>>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
13
|
+
kind: t.StringC;
|
|
16
14
|
id: t.StringC;
|
|
17
15
|
url: t.StringC;
|
|
18
16
|
height: t.StringC;
|
|
@@ -21,35 +19,38 @@ export declare const RepeatableContent: t.ExactC<t.TypeC<{
|
|
|
21
19
|
name: t.StringC;
|
|
22
20
|
}>>, t.ExactC<t.PartialC<{
|
|
23
21
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
22
|
+
}>>]>, t.ExactC<t.PartialC<{
|
|
23
|
+
text: t.StringC;
|
|
24
24
|
}>>]>, t.ExactC<t.TypeC<{
|
|
25
25
|
kind: t.LiteralC<"image">;
|
|
26
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
27
26
|
text: t.StringC;
|
|
28
27
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
29
28
|
__TYPE__: t.LiteralC<"FileLink">;
|
|
30
|
-
}>>, t.
|
|
31
|
-
kind: t.
|
|
29
|
+
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
30
|
+
kind: t.StringC;
|
|
32
31
|
id: t.StringC;
|
|
33
32
|
url: t.StringC;
|
|
34
33
|
name: t.StringC;
|
|
35
34
|
size: t.StringC;
|
|
36
35
|
}>, t.PartialC<{
|
|
37
36
|
date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
38
|
-
}>]>>, t.ExactC<t.
|
|
37
|
+
}>]>>, t.ExactC<t.PartialC<{
|
|
38
|
+
text: t.StringC;
|
|
39
|
+
}>>]>, t.ExactC<t.TypeC<{
|
|
39
40
|
kind: t.LiteralC<"file">;
|
|
40
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
41
41
|
text: t.StringC;
|
|
42
42
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
43
43
|
__TYPE__: t.LiteralC<"DocumentLink">;
|
|
44
|
-
}>>, t.
|
|
44
|
+
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
45
45
|
id: t.Type<string, string, unknown>;
|
|
46
|
-
}>>, t.ExactC<t.
|
|
46
|
+
}>>, t.ExactC<t.PartialC<{
|
|
47
|
+
text: t.StringC;
|
|
48
|
+
}>>]>, t.ExactC<t.TypeC<{
|
|
47
49
|
kind: t.LiteralC<"document">;
|
|
48
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
49
50
|
text: t.StringC;
|
|
50
51
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
51
52
|
__TYPE__: t.LiteralC<"ExternalLink">;
|
|
52
|
-
}>>, t.
|
|
53
|
+
}>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
53
54
|
url: t.StringC;
|
|
54
55
|
}>, t.PartialC<{
|
|
55
56
|
kind: t.LiteralC<"web">;
|
|
@@ -59,37 +60,33 @@ export declare const RepeatableContent: t.ExactC<t.TypeC<{
|
|
|
59
60
|
}, {
|
|
60
61
|
title?: string;
|
|
61
62
|
}, unknown>, t.NullC, t.UndefinedC]>;
|
|
62
|
-
}>]>>, t.ExactC<t.
|
|
63
|
+
}>]>>, t.ExactC<t.PartialC<{
|
|
64
|
+
text: t.StringC;
|
|
65
|
+
}>>]>, t.ExactC<t.TypeC<{
|
|
63
66
|
kind: t.LiteralC<"web">;
|
|
64
|
-
}>>]>, t.ExactC<t.PartialC<{
|
|
65
67
|
text: t.StringC;
|
|
66
68
|
}>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
67
69
|
__TYPE__: t.LiteralC<"MediaLink">;
|
|
68
|
-
}>>, t.
|
|
70
|
+
}>>, t.ExactC<t.TypeC<{
|
|
69
71
|
kind: t.LiteralC<"media">;
|
|
70
|
-
}>>, t.ExactC<t.PartialC<{
|
|
71
72
|
text: t.StringC;
|
|
72
|
-
}>>]
|
|
73
|
+
}>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
73
74
|
__TYPE__: t.LiteralC<"AnyLink">;
|
|
74
|
-
}>>, t.ExactC<t.
|
|
75
|
-
kind: t.LiteralC<"any">;
|
|
76
|
-
}>, t.PartialC<{
|
|
75
|
+
}>>, t.ExactC<t.TypeC<{
|
|
77
76
|
text: t.StringC;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
77
|
+
}>>]>]>;
|
|
78
|
+
}>>>;
|
|
80
79
|
}>>;
|
|
81
80
|
export declare type RepeatableContent = t.TypeOf<typeof RepeatableContent>;
|
|
82
81
|
export declare const isRepeatableContent: t.Is<{
|
|
83
82
|
__TYPE__: "RepeatableContent";
|
|
84
83
|
type: "Link";
|
|
85
|
-
value:
|
|
86
|
-
key: string;
|
|
87
|
-
} & {
|
|
84
|
+
value: {
|
|
88
85
|
__TYPE__: "LinkContent";
|
|
89
86
|
value: ({
|
|
90
87
|
__TYPE__: "ImageLink";
|
|
91
|
-
} & ((
|
|
92
|
-
kind:
|
|
88
|
+
} & (({
|
|
89
|
+
kind: string;
|
|
93
90
|
id: string;
|
|
94
91
|
url: string;
|
|
95
92
|
height: string;
|
|
@@ -98,41 +95,43 @@ export declare const isRepeatableContent: t.Is<{
|
|
|
98
95
|
name: string;
|
|
99
96
|
} & {
|
|
100
97
|
date?: string | null | undefined;
|
|
98
|
+
} & {
|
|
99
|
+
text?: string;
|
|
101
100
|
}) | {
|
|
102
101
|
kind: "image";
|
|
103
|
-
|
|
104
|
-
text?: string;
|
|
102
|
+
text: string;
|
|
105
103
|
})) | ({
|
|
106
104
|
__TYPE__: "FileLink";
|
|
107
|
-
} & ((
|
|
108
|
-
kind:
|
|
105
|
+
} & (({
|
|
106
|
+
kind: string;
|
|
109
107
|
id: string;
|
|
110
108
|
url: string;
|
|
111
109
|
name: string;
|
|
112
110
|
size: string;
|
|
113
111
|
} & {
|
|
114
112
|
date?: string | null | undefined;
|
|
113
|
+
} & {
|
|
114
|
+
text?: string;
|
|
115
115
|
}) | {
|
|
116
116
|
kind: "file";
|
|
117
|
-
|
|
118
|
-
text?: string;
|
|
117
|
+
text: string;
|
|
119
118
|
})) | ({
|
|
120
119
|
__TYPE__: "MediaLink";
|
|
121
120
|
} & {
|
|
122
121
|
kind: "media";
|
|
123
|
-
|
|
124
|
-
text?: string;
|
|
122
|
+
text: string;
|
|
125
123
|
}) | ({
|
|
126
124
|
__TYPE__: "DocumentLink";
|
|
127
125
|
} & (({
|
|
128
126
|
id: string;
|
|
129
|
-
}
|
|
130
|
-
kind: "document";
|
|
131
|
-
}) & {
|
|
127
|
+
} & {
|
|
132
128
|
text?: string;
|
|
129
|
+
}) | {
|
|
130
|
+
kind: "document";
|
|
131
|
+
text: string;
|
|
133
132
|
})) | ({
|
|
134
133
|
__TYPE__: "ExternalLink";
|
|
135
|
-
} & ((
|
|
134
|
+
} & (({
|
|
136
135
|
url: string;
|
|
137
136
|
} & {
|
|
138
137
|
kind?: "web";
|
|
@@ -140,18 +139,17 @@ export declare const isRepeatableContent: t.Is<{
|
|
|
140
139
|
preview?: {
|
|
141
140
|
title?: string;
|
|
142
141
|
} | null | undefined;
|
|
142
|
+
} & {
|
|
143
|
+
text?: string;
|
|
143
144
|
}) | {
|
|
144
145
|
kind: "web";
|
|
145
|
-
|
|
146
|
-
text?: string;
|
|
146
|
+
text: string;
|
|
147
147
|
})) | ({
|
|
148
148
|
__TYPE__: "AnyLink";
|
|
149
149
|
} & {
|
|
150
|
-
|
|
151
|
-
} & {
|
|
152
|
-
text?: string;
|
|
150
|
+
text: string;
|
|
153
151
|
});
|
|
154
|
-
}
|
|
152
|
+
}[];
|
|
155
153
|
}>;
|
|
156
154
|
export declare const RepeatableLegacy: (ctx: LegacyContentCtx, fieldType: "Link") => t.Type<RepeatableContent, WithTypes<Array<unknown>>, unknown>;
|
|
157
155
|
export declare type RepeatableCustomType = Link;
|
|
@@ -112,7 +112,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
112
112
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
113
113
|
value: t.StringC;
|
|
114
114
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
115
|
-
key: t.
|
|
115
|
+
key: t.Type<string, string, unknown>;
|
|
116
116
|
}>>, t.ExactC<t.TypeC<{
|
|
117
117
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
118
118
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -427,7 +427,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
427
427
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
428
428
|
type: t.LiteralC<"Link">;
|
|
429
429
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
430
|
-
key: t.
|
|
430
|
+
key: t.Type<string, string, unknown>;
|
|
431
431
|
}>>, t.ExactC<t.TypeC<{
|
|
432
432
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
433
433
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -620,7 +620,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
620
620
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
621
621
|
value: t.StringC;
|
|
622
622
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
623
|
-
key: t.
|
|
623
|
+
key: t.Type<string, string, unknown>;
|
|
624
624
|
}>>, t.ExactC<t.TypeC<{
|
|
625
625
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
626
626
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -935,7 +935,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
935
935
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
936
936
|
type: t.LiteralC<"Link">;
|
|
937
937
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
938
|
-
key: t.
|
|
938
|
+
key: t.Type<string, string, unknown>;
|
|
939
939
|
}>>, t.ExactC<t.TypeC<{
|
|
940
940
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
941
941
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1120,7 +1120,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
1120
1120
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
1121
1121
|
value: t.StringC;
|
|
1122
1122
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1123
|
-
key: t.
|
|
1123
|
+
key: t.Type<string, string, unknown>;
|
|
1124
1124
|
}>>, t.ExactC<t.TypeC<{
|
|
1125
1125
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1126
1126
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1435,7 +1435,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
1435
1435
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
1436
1436
|
type: t.LiteralC<"Link">;
|
|
1437
1437
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1438
|
-
key: t.
|
|
1438
|
+
key: t.Type<string, string, unknown>;
|
|
1439
1439
|
}>>, t.ExactC<t.TypeC<{
|
|
1440
1440
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1441
1441
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1622,7 +1622,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
1622
1622
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
1623
1623
|
value: t.StringC;
|
|
1624
1624
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1625
|
-
key: t.
|
|
1625
|
+
key: t.Type<string, string, unknown>;
|
|
1626
1626
|
}>>, t.ExactC<t.TypeC<{
|
|
1627
1627
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1628
1628
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -1937,7 +1937,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
1937
1937
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
1938
1938
|
type: t.LiteralC<"Link">;
|
|
1939
1939
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
1940
|
-
key: t.
|
|
1940
|
+
key: t.Type<string, string, unknown>;
|
|
1941
1941
|
}>>, t.ExactC<t.TypeC<{
|
|
1942
1942
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
1943
1943
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2122,7 +2122,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
2122
2122
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
2123
2123
|
value: t.StringC;
|
|
2124
2124
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2125
|
-
key: t.
|
|
2125
|
+
key: t.Type<string, string, unknown>;
|
|
2126
2126
|
}>>, t.ExactC<t.TypeC<{
|
|
2127
2127
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2128
2128
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2437,7 +2437,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
2437
2437
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
2438
2438
|
type: t.LiteralC<"Link">;
|
|
2439
2439
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2440
|
-
key: t.
|
|
2440
|
+
key: t.Type<string, string, unknown>;
|
|
2441
2441
|
}>>, t.ExactC<t.TypeC<{
|
|
2442
2442
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2443
2443
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2621,7 +2621,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
2621
2621
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
2622
2622
|
value: t.StringC;
|
|
2623
2623
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2624
|
-
key: t.
|
|
2624
|
+
key: t.Type<string, string, unknown>;
|
|
2625
2625
|
}>>, t.ExactC<t.TypeC<{
|
|
2626
2626
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2627
2627
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -2936,7 +2936,7 @@ export declare const WidgetContent: t.UnionC<[t.Type<GroupContent, GroupContent,
|
|
|
2936
2936
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
2937
2937
|
type: t.LiteralC<"Link">;
|
|
2938
2938
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
2939
|
-
key: t.
|
|
2939
|
+
key: t.Type<string, string, unknown>;
|
|
2940
2940
|
}>>, t.ExactC<t.TypeC<{
|
|
2941
2941
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
2942
2942
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
(0, tslib_1.__exportStar)(require("./EmptyContent"), exports);
|
|
5
5
|
(0, tslib_1.__exportStar)(require("./GroupContent"), exports);
|
|
6
6
|
(0, tslib_1.__exportStar)(require("./nestable"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./RepeatableContent"), exports);
|
|
8
7
|
(0, tslib_1.__exportStar)(require("./slices"), exports);
|
|
9
8
|
(0, tslib_1.__exportStar)(require("./UIDContent"), exports);
|
|
10
9
|
(0, tslib_1.__exportStar)(require("./WidgetContent"), exports);
|
|
@@ -225,7 +225,7 @@ export declare const isLinkContent: (u: unknown) => u is {
|
|
|
225
225
|
});
|
|
226
226
|
};
|
|
227
227
|
export declare const LinkLegacy: t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
228
|
-
key: t.
|
|
228
|
+
key: t.Type<string, string, unknown>;
|
|
229
229
|
}>>, t.UnionC<[t.Type<{
|
|
230
230
|
__TYPE__: "ImageLink";
|
|
231
231
|
} & ((({
|
|
@@ -535,7 +535,7 @@ export declare const Link: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
|
535
535
|
text: t.StringC;
|
|
536
536
|
}>]>>]>]>;
|
|
537
537
|
export declare const LinkContent: t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
538
|
-
key: t.
|
|
538
|
+
key: t.Type<string, string, unknown>;
|
|
539
539
|
}>>, t.ExactC<t.TypeC<{
|
|
540
540
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
541
541
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -825,7 +825,7 @@ export declare const FilledLink: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
|
825
825
|
}, unknown>, t.NullC, t.UndefinedC]>;
|
|
826
826
|
}>]>>]>]>;
|
|
827
827
|
export declare const FilledLinkContent: t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
828
|
-
key: t.
|
|
828
|
+
key: t.Type<string, string, unknown>;
|
|
829
829
|
}>>, t.ExactC<t.TypeC<{
|
|
830
830
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
831
831
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -33,11 +33,16 @@ const uuid_1 = require("uuid");
|
|
|
33
33
|
const validators_1 = require("../../../validators");
|
|
34
34
|
const function_2 = require("../../../validators/function");
|
|
35
35
|
const utils_1 = require("../../utils");
|
|
36
|
+
const isUuid = (input) => typeof input === "string" && (0, uuid_1.validate)(input);
|
|
37
|
+
const uuidWithFallback = new t.Type("UUID", isUuid, (u, c) => {
|
|
38
|
+
if (typeof u === "undefined")
|
|
39
|
+
return t.success((0, uuid_1.v4)());
|
|
40
|
+
if (isUuid(u))
|
|
41
|
+
return t.success(u);
|
|
42
|
+
return t.failure(u, c);
|
|
43
|
+
}, t.identity);
|
|
36
44
|
function withKey(codec) {
|
|
37
|
-
return t.intersection([
|
|
38
|
-
t.strict({ key: (0, io_ts_types_1.withFallback)(t.string, (0, uuid_1.v4)()) }),
|
|
39
|
-
codec,
|
|
40
|
-
]);
|
|
45
|
+
return t.intersection([t.strict({ key: uuidWithFallback }), codec]);
|
|
41
46
|
}
|
|
42
47
|
// ImageLink.
|
|
43
48
|
exports.ImageLinkType = "ImageLink";
|
|
@@ -112,7 +112,7 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
112
112
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
113
113
|
value: t.StringC;
|
|
114
114
|
}>>, t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
115
|
-
key: t.
|
|
115
|
+
key: t.Type<string, string, unknown>;
|
|
116
116
|
}>>, t.ExactC<t.TypeC<{
|
|
117
117
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
118
118
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -427,7 +427,7 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
|
427
427
|
__TYPE__: t.LiteralC<"RepeatableContent">;
|
|
428
428
|
type: t.LiteralC<"Link">;
|
|
429
429
|
value: t.ArrayC<t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
430
|
-
key: t.
|
|
430
|
+
key: t.Type<string, string, unknown>;
|
|
431
431
|
}>>, t.ExactC<t.TypeC<{
|
|
432
432
|
__TYPE__: t.LiteralC<"LinkContent">;
|
|
433
433
|
value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
@@ -5,7 +5,6 @@ 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");
|
|
9
8
|
const BooleanContent_1 = require("./BooleanContent");
|
|
10
9
|
const EmbedContent_1 = require("./EmbedContent");
|
|
11
10
|
const FieldContent_1 = require("./FieldContent");
|
|
@@ -14,6 +13,7 @@ const GeoPointContent_1 = require("./GeoPointContent");
|
|
|
14
13
|
const ImageContent_1 = require("./ImageContent");
|
|
15
14
|
const IntegrationFieldContent_1 = require("./IntegrationFieldContent");
|
|
16
15
|
const LinkContent_1 = require("./LinkContent");
|
|
16
|
+
const RepeatableContent_1 = require("./RepeatableContent");
|
|
17
17
|
const RichTextContent_1 = require("./RichTextContent");
|
|
18
18
|
const SeparatorContent_1 = require("./SeparatorContent");
|
|
19
19
|
exports.NestableContent = t.union([
|