@prismicio/types-internal 2.0.0-alpha.2 → 2.0.0-alpha.4
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/LegacyContentCtx.js +1 -1
- package/lib/content/fields/WidgetContent.d.ts +1 -1
- package/lib/customtypes/widgets/Group.d.ts +164 -3
- package/lib/customtypes/widgets/Group.js +4 -5
- package/lib/customtypes/widgets/UID.d.ts +8 -3
- package/lib/customtypes/widgets/UID.js +4 -5
- package/lib/customtypes/widgets/Widget.d.ts +2 -2
- package/lib/customtypes/widgets/Widget.js +5 -5
- package/lib/customtypes/widgets/nestable/Link.d.ts +0 -1
- package/lib/customtypes/widgets/nestable/Link.js +0 -1
- package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -1
- package/lib/customtypes/widgets/nestable/Text.d.ts +0 -1
- package/lib/customtypes/widgets/nestable/Text.js +0 -1
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +6 -3
- package/lib/customtypes/widgets/slices/CompositeSlice.js +4 -5
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +2 -3
- package/lib/customtypes/widgets/slices/LegacySlice.js +3 -3
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +2 -3
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
- package/lib/customtypes/widgets/slices/Slice.d.ts +3 -3
- package/lib/customtypes/widgets/slices/Slices.d.ts +1 -1
- package/lib/customtypes/widgets/slices/Slices.js +5 -5
- package/lib/customtypes/widgets/slices/index.d.ts +3 -3
- package/lib/customtypes/widgets/slices/index.js +3 -3
- package/package.json +1 -1
- package/src/content/LegacyContentCtx.ts +2 -2
- package/src/content/fields/WidgetContent.ts +1 -1
- package/src/customtypes/widgets/Group.ts +4 -6
- package/src/customtypes/widgets/UID.ts +4 -6
- package/src/customtypes/widgets/Widget.ts +5 -5
- package/src/customtypes/widgets/nestable/Link.ts +0 -2
- package/src/customtypes/widgets/nestable/RichText.ts +1 -1
- package/src/customtypes/widgets/nestable/Text.ts +0 -2
- package/src/customtypes/widgets/slices/CompositeSlice.ts +4 -6
- package/src/customtypes/widgets/slices/LegacySlice.ts +3 -5
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +2 -4
- package/src/customtypes/widgets/slices/Slice.ts +3 -3
- package/src/customtypes/widgets/slices/Slices.ts +3 -3
- package/src/customtypes/widgets/slices/index.ts +3 -3
- package/lib/content/CustomType.d.ts +0 -2972
- package/lib/content/CustomType.js +0 -15
- package/lib/content/fields/nestable/FieldContent.d.ts +0 -32
- package/lib/content/fields/nestable/FieldContent.js +0 -37
- package/lib/content/fields/nestable/Image.d.ts +0 -103
- package/lib/content/fields/nestable/Image.js +0 -13
- package/lib/content/fields/nestable/RichTextContent.d.ts +0 -376
- package/lib/content/fields/nestable/RichTextContent.js +0 -16
- package/lib/content/fields/slices/CompositeSliceContent.d.ts +0 -677
- package/lib/content/fields/slices/CompositeSliceContent.js +0 -14
- package/lib/content/fields/slices/RepeatableContent.d.ts +0 -338
- package/lib/content/fields/slices/RepeatableContent.js +0 -16
- package/lib/content/fields/slices/SharedSliceContent.d.ts +0 -678
- package/lib/content/fields/slices/SharedSliceContent.js +0 -15
- package/lib/content/fields/slices/SimpleSliceContent.d.ts +0 -675
- package/lib/content/fields/slices/SimpleSliceContent.js +0 -8
- package/lib/customtypes/Comparators/Changes.d.ts +0 -17
- package/lib/customtypes/Comparators/Changes.js +0 -9
- package/lib/customtypes/Comparators/SharedSlice.d.ts +0 -679
- package/lib/customtypes/Comparators/SharedSlice.js +0 -55
- package/lib/customtypes/Comparators/Variation.d.ts +0 -662
- package/lib/customtypes/Comparators/Variation.js +0 -75
- package/lib/customtypes/Comparators/index.d.ts +0 -3
- package/lib/customtypes/Comparators/index.js +0 -6
- package/lib/customtypes/Format.d.ts +0 -4
- package/lib/customtypes/Format.js +0 -8
- package/lib/customtypes/comp/Changes.d.ts +0 -17
- package/lib/customtypes/comp/Changes.js +0 -9
- package/lib/customtypes/comp/SharedSlice.d.ts +0 -679
- package/lib/customtypes/comp/SharedSlice.js +0 -55
- package/lib/customtypes/comp/Variation.d.ts +0 -662
- package/lib/customtypes/comp/Variation.js +0 -76
- package/lib/customtypes/comp/index.d.ts +0 -3
- package/lib/customtypes/comp/index.js +0 -6
- package/lib/customtypes/utils/Comparator.d.ts +0 -1353
- package/lib/customtypes/utils/Comparator.js +0 -59
- package/lib/customtypes/utils/index.d.ts +0 -1
- package/lib/customtypes/utils/index.js +0 -4
- package/lib/customtypes/widgets/WidgetTypes.d.ts +0 -22
- package/lib/customtypes/widgets/WidgetTypes.js +0 -25
- package/lib/documents/DocumentData.d.ts +0 -6
- package/lib/documents/DocumentData.js +0 -15
- package/lib/documents/index.d.ts +0 -2
- package/lib/documents/index.js +0 -7
- package/lib/documents/widgets/EmptyContent.d.ts +0 -8
- package/lib/documents/widgets/EmptyContent.js +0 -9
- package/lib/documents/widgets/GroupContent.d.ts +0 -16
- package/lib/documents/widgets/GroupContent.js +0 -60
- package/lib/documents/widgets/SimpleWidgetContent.d.ts +0 -20
- package/lib/documents/widgets/SimpleWidgetContent.js +0 -75
- package/lib/documents/widgets/StaticWidgetContent.d.ts +0 -10
- package/lib/documents/widgets/StaticWidgetContent.js +0 -26
- package/lib/documents/widgets/UIDContent.d.ts +0 -7
- package/lib/documents/widgets/UIDContent.js +0 -10
- package/lib/documents/widgets/index.d.ts +0 -38
- package/lib/documents/widgets/index.js +0 -40
- package/lib/documents/widgets/nestable/BooleanContent.d.ts +0 -8
- package/lib/documents/widgets/nestable/BooleanContent.js +0 -11
- package/lib/documents/widgets/nestable/EmbedContent.d.ts +0 -42
- package/lib/documents/widgets/nestable/EmbedContent.js +0 -35
- package/lib/documents/widgets/nestable/FieldContent.d.ts +0 -13
- package/lib/documents/widgets/nestable/FieldContent.js +0 -37
- package/lib/documents/widgets/nestable/GeoPointContent.d.ts +0 -17
- package/lib/documents/widgets/nestable/GeoPointContent.js +0 -13
- package/lib/documents/widgets/nestable/ImageContent.d.ts +0 -127
- package/lib/documents/widgets/nestable/ImageContent.js +0 -41
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +0 -8
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +0 -16
- package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +0 -12
- package/lib/documents/widgets/nestable/Link/DocumentLink.js +0 -13
- package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +0 -24
- package/lib/documents/widgets/nestable/Link/ExternalLink.js +0 -24
- package/lib/documents/widgets/nestable/Link/FileLink.d.ts +0 -22
- package/lib/documents/widgets/nestable/Link/FileLink.js +0 -25
- package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +0 -28
- package/lib/documents/widgets/nestable/Link/ImageLink.js +0 -26
- package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +0 -42
- package/lib/documents/widgets/nestable/Link/LinkContent.js +0 -17
- package/lib/documents/widgets/nestable/Link/index.d.ts +0 -90
- package/lib/documents/widgets/nestable/Link/index.js +0 -35
- package/lib/documents/widgets/nestable/SeparatorContent.d.ts +0 -11
- package/lib/documents/widgets/nestable/SeparatorContent.js +0 -15
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +0 -314
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +0 -98
- package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +0 -9
- package/lib/documents/widgets/nestable/StructuredTextContent/index.js +0 -14
- package/lib/documents/widgets/nestable/index.d.ts +0 -26
- package/lib/documents/widgets/nestable/index.js +0 -39
- package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +0 -14
- package/lib/documents/widgets/slices/CompositeSliceContent.js +0 -52
- package/lib/documents/widgets/slices/SharedSliceContent.d.ts +0 -15
- package/lib/documents/widgets/slices/SharedSliceContent.js +0 -63
- package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +0 -6
- package/lib/documents/widgets/slices/SimpleSliceContent.js +0 -6
- package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +0 -8
- package/lib/documents/widgets/slices/SliceWidgetContent.js +0 -26
- package/lib/documents/widgets/slices/SlicesContent.d.ts +0 -17
- package/lib/documents/widgets/slices/SlicesContent.js +0 -52
- package/lib/documents/widgets/slices/index.d.ts +0 -5
- package/lib/documents/widgets/slices/index.js +0 -8
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -7
|
@@ -4,7 +4,7 @@ exports.defaultCtx = exports.getFieldCtx = exports.LegacyContentCtx = exports.Fi
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
6
|
const widgets_1 = require("../customtypes/widgets");
|
|
7
|
-
exports.FieldOrSliceType = t.union([widgets_1.
|
|
7
|
+
exports.FieldOrSliceType = t.union([widgets_1.FieldType, widgets_1.SlicesTypes]);
|
|
8
8
|
class LegacyContentCtx {
|
|
9
9
|
constructor(fieldKey, fieldPath, allTypes) {
|
|
10
10
|
Object.defineProperty(this, "fieldKey", {
|
|
@@ -4659,7 +4659,7 @@ export declare const isWidgetContent: (u: unknown) => u is {
|
|
|
4659
4659
|
value: string;
|
|
4660
4660
|
};
|
|
4661
4661
|
export type WidgetContent = t.TypeOf<typeof WidgetContent>;
|
|
4662
|
-
export type
|
|
4662
|
+
export type ContentType = WidgetContent["__TYPE__"];
|
|
4663
4663
|
export declare const WidgetLegacy: (ctx: LegacyContentCtx) => {
|
|
4664
4664
|
decode(value: unknown): import("fp-ts/lib/Either").Left<t.Errors> | import("fp-ts/lib/Either").Right<{
|
|
4665
4665
|
__TYPE__: "BooleanContent";
|
|
@@ -1,6 +1,168 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
export declare const GroupFieldType = "Group";
|
|
3
|
-
declare const
|
|
3
|
+
export declare const GroupConfig: t.ExactC<t.PartialC<{
|
|
4
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
5
|
+
repeat: t.BooleanC;
|
|
6
|
+
fields: t.RecordC<t.Type<string, string, unknown>, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
7
|
+
type: t.LiteralC<"Color">;
|
|
8
|
+
}>, t.PartialC<{
|
|
9
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
10
|
+
config: t.ExactC<t.PartialC<{
|
|
11
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
12
|
+
placeholder: t.StringC;
|
|
13
|
+
}>>;
|
|
14
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
15
|
+
type: t.LiteralC<"Boolean">;
|
|
16
|
+
}>, t.PartialC<{
|
|
17
|
+
config: t.ExactC<t.PartialC<{
|
|
18
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
19
|
+
default_value: t.BooleanC;
|
|
20
|
+
placeholder_true: t.StringC;
|
|
21
|
+
placeholder_false: t.StringC;
|
|
22
|
+
}>>;
|
|
23
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
24
|
+
type: t.LiteralC<"Embed">;
|
|
25
|
+
}>, t.PartialC<{
|
|
26
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
27
|
+
config: t.ExactC<t.PartialC<{
|
|
28
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
29
|
+
placeholder: t.StringC;
|
|
30
|
+
useAsTitle: t.BooleanC;
|
|
31
|
+
}>>;
|
|
32
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
33
|
+
type: t.LiteralC<"GeoPoint">;
|
|
34
|
+
}>, t.PartialC<{
|
|
35
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
36
|
+
config: t.ExactC<t.PartialC<{
|
|
37
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
38
|
+
}>>;
|
|
39
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
40
|
+
type: t.LiteralC<"Date">;
|
|
41
|
+
}>, t.PartialC<{
|
|
42
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
43
|
+
config: t.ExactC<t.PartialC<{
|
|
44
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
45
|
+
placeholder: t.StringC;
|
|
46
|
+
default: t.StringC;
|
|
47
|
+
}>>;
|
|
48
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
49
|
+
type: t.LiteralC<"Number">;
|
|
50
|
+
}>, t.PartialC<{
|
|
51
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
52
|
+
config: t.ExactC<t.PartialC<{
|
|
53
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
54
|
+
placeholder: t.StringC;
|
|
55
|
+
min: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
56
|
+
max: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
57
|
+
step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
58
|
+
}>>;
|
|
59
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
60
|
+
type: t.LiteralC<"Range">;
|
|
61
|
+
}>, t.PartialC<{
|
|
62
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
63
|
+
config: t.ExactC<t.PartialC<{
|
|
64
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
65
|
+
placeholder: t.StringC;
|
|
66
|
+
min: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
67
|
+
max: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
68
|
+
step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
69
|
+
}>>;
|
|
70
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
71
|
+
type: t.LiteralC<"StructuredText">;
|
|
72
|
+
}>, t.PartialC<{
|
|
73
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
74
|
+
config: t.ExactC<t.PartialC<{
|
|
75
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
76
|
+
placeholder: t.StringC;
|
|
77
|
+
useAsTitle: t.BooleanC;
|
|
78
|
+
single: t.Type<string, string, unknown>;
|
|
79
|
+
multi: t.Type<string, string, unknown>;
|
|
80
|
+
imageConstraint: t.PartialC<{
|
|
81
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
82
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
83
|
+
}>;
|
|
84
|
+
labels: t.Type<readonly string[], object, unknown>;
|
|
85
|
+
allowTargetBlank: t.BooleanC;
|
|
86
|
+
}>>;
|
|
87
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
88
|
+
type: t.LiteralC<"Select">;
|
|
89
|
+
}>, t.PartialC<{
|
|
90
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
91
|
+
config: t.ExactC<t.PartialC<{
|
|
92
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
93
|
+
placeholder: t.StringC;
|
|
94
|
+
default_value: t.StringC;
|
|
95
|
+
options: t.ReadonlyArrayC<t.UnionC<[t.StringC, t.Type<string, string, unknown>, t.Type<string, string, unknown>]>>;
|
|
96
|
+
}>>;
|
|
97
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
98
|
+
type: t.LiteralC<"Separator">;
|
|
99
|
+
}>, t.PartialC<{
|
|
100
|
+
config: t.ExactC<t.PartialC<{
|
|
101
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
102
|
+
}>>;
|
|
103
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
104
|
+
type: t.LiteralC<"Text">;
|
|
105
|
+
}>, t.PartialC<{
|
|
106
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
107
|
+
config: t.ExactC<t.PartialC<{
|
|
108
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
109
|
+
useAsTitle: t.BooleanC;
|
|
110
|
+
placeholder: t.StringC;
|
|
111
|
+
}>>;
|
|
112
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
113
|
+
type: t.LiteralC<"Timestamp">;
|
|
114
|
+
}>, t.PartialC<{
|
|
115
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
116
|
+
config: t.ExactC<t.PartialC<{
|
|
117
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
118
|
+
placeholder: t.StringC;
|
|
119
|
+
default: t.StringC;
|
|
120
|
+
}>>;
|
|
121
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
122
|
+
type: t.LiteralC<"Link">;
|
|
123
|
+
}>, t.PartialC<{
|
|
124
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
125
|
+
config: t.ExactC<t.PartialC<{
|
|
126
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
127
|
+
useAsTitle: t.BooleanC;
|
|
128
|
+
placeholder: t.StringC;
|
|
129
|
+
select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
|
|
130
|
+
customtypes: t.ReadonlyArrayC<t.StringC>;
|
|
131
|
+
masks: t.Type<readonly string[], object, unknown>;
|
|
132
|
+
tags: t.Type<readonly string[], object, unknown>;
|
|
133
|
+
allowTargetBlank: t.BooleanC;
|
|
134
|
+
}>>;
|
|
135
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
136
|
+
type: t.LiteralC<"Image">;
|
|
137
|
+
}>, t.PartialC<{
|
|
138
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
139
|
+
config: t.ExactC<t.PartialC<{
|
|
140
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
141
|
+
placeholder: t.StringC;
|
|
142
|
+
constraint: t.PartialC<{
|
|
143
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
144
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
145
|
+
}>;
|
|
146
|
+
thumbnails: t.ReadonlyArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
147
|
+
name: t.StringC;
|
|
148
|
+
}>, t.PartialC<{
|
|
149
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
150
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
151
|
+
}>]>>>;
|
|
152
|
+
}>>;
|
|
153
|
+
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
154
|
+
type: t.LiteralC<"IntegrationFields">;
|
|
155
|
+
}>, t.PartialC<{
|
|
156
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
157
|
+
config: t.ExactC<t.PartialC<{
|
|
158
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
159
|
+
placeholder: t.StringC;
|
|
160
|
+
catalog: t.StringC;
|
|
161
|
+
}>>;
|
|
162
|
+
}>]>>]>>;
|
|
163
|
+
}>>;
|
|
164
|
+
export type GroupConfig = t.TypeOf<typeof GroupConfig>;
|
|
165
|
+
export declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
166
|
type: t.LiteralC<"Group">;
|
|
5
167
|
}>, t.PartialC<{
|
|
6
168
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -168,5 +330,4 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
168
330
|
}>]>>]>>;
|
|
169
331
|
}>>;
|
|
170
332
|
}>]>>;
|
|
171
|
-
type Group = t.TypeOf<typeof Group>;
|
|
172
|
-
export default Group;
|
|
333
|
+
export type Group = t.TypeOf<typeof Group>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GroupFieldType = void 0;
|
|
3
|
+
exports.Group = exports.GroupConfig = exports.GroupFieldType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const validators_1 = require("../../validators");
|
|
8
8
|
const NestableWidget_1 = require("./nestable/NestableWidget");
|
|
9
9
|
exports.GroupFieldType = "Group";
|
|
10
|
-
|
|
10
|
+
exports.GroupConfig = t.exact(t.partial({
|
|
11
11
|
label: validators_1.StringOrNull,
|
|
12
12
|
repeat: t.boolean,
|
|
13
13
|
fields: t.record(common_1.WidgetKey, NestableWidget_1.NestableWidget),
|
|
14
14
|
}));
|
|
15
|
-
|
|
15
|
+
exports.Group = t.exact(t.intersection([
|
|
16
16
|
t.type({
|
|
17
17
|
type: t.literal(exports.GroupFieldType),
|
|
18
18
|
}),
|
|
@@ -20,7 +20,6 @@ const Group = t.exact(t.intersection([
|
|
|
20
20
|
fieldset: validators_1.StringOrNull,
|
|
21
21
|
icon: t.string,
|
|
22
22
|
description: t.string,
|
|
23
|
-
config: GroupConfig,
|
|
23
|
+
config: exports.GroupConfig,
|
|
24
24
|
}),
|
|
25
25
|
]));
|
|
26
|
-
exports.default = Group;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
export declare const UIDFieldType = "UID";
|
|
3
|
-
declare const
|
|
3
|
+
export declare const UIDConfig: t.ExactC<t.PartialC<{
|
|
4
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
5
|
+
useAsTitle: t.BooleanC;
|
|
6
|
+
placeholder: t.StringC;
|
|
7
|
+
}>>;
|
|
8
|
+
export type UIDConfig = t.TypeOf<typeof UIDConfig>;
|
|
9
|
+
export declare const UID: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
10
|
type: t.LiteralC<"UID">;
|
|
5
11
|
}>, t.PartialC<{
|
|
6
12
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -10,5 +16,4 @@ declare const UID: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
10
16
|
placeholder: t.StringC;
|
|
11
17
|
}>>;
|
|
12
18
|
}>]>>;
|
|
13
|
-
type UID = t.TypeOf<typeof UID>;
|
|
14
|
-
export default UID;
|
|
19
|
+
export type UID = t.TypeOf<typeof UID>;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UIDFieldType = void 0;
|
|
3
|
+
exports.UID = exports.UIDConfig = exports.UIDFieldType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
6
|
const validators_1 = require("../../validators");
|
|
7
7
|
exports.UIDFieldType = "UID";
|
|
8
|
-
|
|
8
|
+
exports.UIDConfig = t.exact(t.partial({
|
|
9
9
|
label: validators_1.StringOrNull,
|
|
10
10
|
useAsTitle: t.boolean,
|
|
11
11
|
placeholder: t.string,
|
|
12
12
|
}));
|
|
13
|
-
|
|
13
|
+
exports.UID = t.exact(t.intersection([
|
|
14
14
|
t.type({
|
|
15
15
|
type: t.literal(exports.UIDFieldType),
|
|
16
16
|
}),
|
|
17
17
|
t.partial({
|
|
18
18
|
fieldset: validators_1.StringOrNull,
|
|
19
|
-
config: UIDConfig,
|
|
19
|
+
config: exports.UIDConfig,
|
|
20
20
|
}),
|
|
21
21
|
]));
|
|
22
|
-
exports.default = UID;
|
|
@@ -2678,7 +2678,7 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
|
|
|
2678
2678
|
};
|
|
2679
2679
|
}, unknown, unknown>]>;
|
|
2680
2680
|
export type DynamicWidget = t.TypeOf<typeof DynamicWidget>;
|
|
2681
|
-
export declare const
|
|
2681
|
+
export declare const FieldType: t.KeyofC<{
|
|
2682
2682
|
Color: null;
|
|
2683
2683
|
Boolean: null;
|
|
2684
2684
|
Number: null;
|
|
@@ -2699,7 +2699,7 @@ export declare const FieldTypes: t.KeyofC<{
|
|
|
2699
2699
|
Slices: null;
|
|
2700
2700
|
Choice: null;
|
|
2701
2701
|
}>;
|
|
2702
|
-
export type
|
|
2702
|
+
export type FieldType = t.TypeOf<typeof FieldType>;
|
|
2703
2703
|
export declare const Widgets: {
|
|
2704
2704
|
toStatic(widget: DynamicWidget, sharedSlices: Map<string, SharedSlice>): StaticWidget;
|
|
2705
2705
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Widgets = exports.
|
|
3
|
+
exports.Widgets = exports.FieldType = exports.DynamicWidget = exports.StaticWidget = exports.widgetReader = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
|
-
const Group_1 =
|
|
6
|
+
const Group_1 = require("./Group");
|
|
7
7
|
const nestable_1 = require("./nestable");
|
|
8
8
|
const NestableWidget_1 = require("./nestable/NestableWidget");
|
|
9
9
|
const Slices_1 = require("./slices/Slices");
|
|
10
|
-
const UID_1 =
|
|
10
|
+
const UID_1 = require("./UID");
|
|
11
11
|
function widgetReader(codec) {
|
|
12
|
-
return t.union([UID_1.
|
|
12
|
+
return t.union([UID_1.UID, NestableWidget_1.NestableWidget, Group_1.Group, codec]);
|
|
13
13
|
}
|
|
14
14
|
exports.widgetReader = widgetReader;
|
|
15
15
|
exports.StaticWidget = widgetReader(Slices_1.StaticSlices);
|
|
16
16
|
exports.DynamicWidget = widgetReader(Slices_1.DynamicSlices);
|
|
17
|
-
exports.
|
|
17
|
+
exports.FieldType = t.keyof({
|
|
18
18
|
[nestable_1.ColorFieldType]: null,
|
|
19
19
|
[nestable_1.BooleanFieldType]: null,
|
|
20
20
|
[nestable_1.NumberFieldType]: null,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
export declare const RichTextFieldType = "StructuredText";
|
|
3
3
|
export declare const DEFAULT_OPTION = "paragraph";
|
|
4
|
-
export type RichTextNodeType = typeof RichTextNodeType[keyof typeof RichTextNodeType];
|
|
4
|
+
export type RichTextNodeType = (typeof RichTextNodeType)[keyof typeof RichTextNodeType];
|
|
5
5
|
export declare const RichTextNodeType: {
|
|
6
6
|
readonly heading1: "heading1";
|
|
7
7
|
readonly heading2: "heading2";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
export declare const CompositeSliceType = "Slice";
|
|
3
|
-
declare const
|
|
3
|
+
export declare const CompositeSliceConfig: t.ExactC<t.PartialC<{
|
|
4
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
5
|
+
}>>;
|
|
6
|
+
export type CompositeSliceConfig = t.TypeOf<typeof CompositeSliceConfig>;
|
|
7
|
+
export declare const CompositeSlice: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
8
|
type: t.LiteralC<"Slice">;
|
|
5
9
|
}>, t.PartialC<{
|
|
6
10
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -325,5 +329,4 @@ declare const CompositeSlice: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
325
329
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
326
330
|
}>>;
|
|
327
331
|
}>]>>;
|
|
328
|
-
type CompositeSlice = t.TypeOf<typeof CompositeSlice>;
|
|
329
|
-
export default CompositeSlice;
|
|
332
|
+
export type CompositeSlice = t.TypeOf<typeof CompositeSlice>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompositeSliceType = void 0;
|
|
3
|
+
exports.CompositeSlice = exports.CompositeSliceConfig = exports.CompositeSliceType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
6
|
const common_1 = require("../../../common");
|
|
7
7
|
const validators_1 = require("../../../validators");
|
|
8
8
|
const NestableWidget_1 = require("../nestable/NestableWidget");
|
|
9
9
|
exports.CompositeSliceType = "Slice";
|
|
10
|
-
|
|
10
|
+
exports.CompositeSliceConfig = t.exact(t.partial({
|
|
11
11
|
label: validators_1.StringOrNull,
|
|
12
12
|
}));
|
|
13
|
-
|
|
13
|
+
exports.CompositeSlice = t.exact(t.intersection([
|
|
14
14
|
t.type({
|
|
15
15
|
type: t.literal(exports.CompositeSliceType),
|
|
16
16
|
}),
|
|
@@ -21,7 +21,6 @@ const CompositeSlice = t.exact(t.intersection([
|
|
|
21
21
|
display: t.string,
|
|
22
22
|
"non-repeat": t.record(common_1.WidgetKey, NestableWidget_1.NestableWidget),
|
|
23
23
|
repeat: t.record(common_1.WidgetKey, NestableWidget_1.NestableWidget),
|
|
24
|
-
config: CompositeSliceConfig,
|
|
24
|
+
config: exports.CompositeSliceConfig,
|
|
25
25
|
}),
|
|
26
26
|
]));
|
|
27
|
-
exports.default = CompositeSlice;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
declare const LegacySlice: t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
2
|
+
export declare const LegacySlice: t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
3
3
|
type: t.LiteralC<"Color">;
|
|
4
4
|
}>, t.PartialC<{
|
|
5
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -323,5 +323,4 @@ declare const LegacySlice: t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC
|
|
|
323
323
|
}>]>>]>>;
|
|
324
324
|
}>>;
|
|
325
325
|
}>]>>]>;
|
|
326
|
-
type LegacySlice = t.TypeOf<typeof LegacySlice>;
|
|
327
|
-
export default LegacySlice;
|
|
326
|
+
export type LegacySlice = t.TypeOf<typeof LegacySlice>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LegacySlice = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
5
|
-
const Group_1 =
|
|
6
|
+
const Group_1 = require("../Group");
|
|
6
7
|
const NestableWidget_1 = require("../nestable/NestableWidget");
|
|
7
|
-
|
|
8
|
-
exports.default = LegacySlice;
|
|
8
|
+
exports.LegacySlice = t.union([NestableWidget_1.NestableWidget, Group_1.Group]);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
declare const SharedSliceRef: t.ExactC<t.TypeC<{
|
|
2
|
+
export declare const SharedSliceRef: t.ExactC<t.TypeC<{
|
|
3
3
|
type: t.LiteralC<"SharedSlice">;
|
|
4
4
|
}>>;
|
|
5
|
-
type SharedSliceRef = t.TypeOf<typeof SharedSliceRef>;
|
|
6
|
-
export default SharedSliceRef;
|
|
5
|
+
export type SharedSliceRef = t.TypeOf<typeof SharedSliceRef>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedSliceRef = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
5
6
|
const SharedSlice_1 = require("./SharedSlice");
|
|
6
|
-
|
|
7
|
+
exports.SharedSliceRef = t.exact(t.type({
|
|
7
8
|
type: t.literal(SharedSlice_1.SharedSliceType),
|
|
8
9
|
}));
|
|
9
|
-
exports.default = SharedSliceRef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type CompositeSlice from "./CompositeSlice";
|
|
2
|
-
import type LegacySlice from "./LegacySlice";
|
|
1
|
+
import type { CompositeSlice } from "./CompositeSlice";
|
|
2
|
+
import type { LegacySlice } from "./LegacySlice";
|
|
3
3
|
import type { SharedSlice } from "./SharedSlice";
|
|
4
|
-
import type SharedSliceRef from "./SharedSliceRef";
|
|
4
|
+
import type { SharedSliceRef } from "./SharedSliceRef";
|
|
5
5
|
export type DynamicSlice = CompositeSlice | LegacySlice | SharedSliceRef;
|
|
6
6
|
export type StaticSlice = CompositeSlice | LegacySlice | SharedSlice;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import { SharedSlice } from "./SharedSlice";
|
|
3
|
-
import SharedSliceRef from "./SharedSliceRef";
|
|
3
|
+
import { SharedSliceRef } from "./SharedSliceRef";
|
|
4
4
|
export declare const LegacySlicesFieldType = "Choice";
|
|
5
5
|
export declare const SlicesFieldType = "Slices";
|
|
6
6
|
export declare const SlicesLabels: t.UnionC<[t.RecordC<t.StringC, t.ReadonlyArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
@@ -5,10 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
6
|
const common_1 = require("../../../common");
|
|
7
7
|
const validators_1 = require("../../../validators");
|
|
8
|
-
const CompositeSlice_1 =
|
|
9
|
-
const LegacySlice_1 =
|
|
8
|
+
const CompositeSlice_1 = require("./CompositeSlice");
|
|
9
|
+
const LegacySlice_1 = require("./LegacySlice");
|
|
10
10
|
const SharedSlice_1 = require("./SharedSlice");
|
|
11
|
-
const SharedSliceRef_1 =
|
|
11
|
+
const SharedSliceRef_1 = require("./SharedSliceRef");
|
|
12
12
|
exports.LegacySlicesFieldType = "Choice";
|
|
13
13
|
exports.SlicesFieldType = "Slices";
|
|
14
14
|
exports.SlicesLabels = t.union([
|
|
@@ -26,12 +26,12 @@ function slicesConfigReader(codec) {
|
|
|
26
26
|
return t.exact(t.partial({
|
|
27
27
|
label: validators_1.StringOrNull,
|
|
28
28
|
labels: exports.SlicesLabels,
|
|
29
|
-
choices: t.record(common_1.WidgetKey, t.union([LegacySlice_1.
|
|
29
|
+
choices: t.record(common_1.WidgetKey, t.union([LegacySlice_1.LegacySlice, CompositeSlice_1.CompositeSlice, codec])),
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
32
|
exports.slicesConfigReader = slicesConfigReader;
|
|
33
33
|
exports.StaticSlicesConfig = slicesConfigReader(SharedSlice_1.SharedSlice);
|
|
34
|
-
exports.DynamicSlicesConfig = slicesConfigReader(SharedSliceRef_1.
|
|
34
|
+
exports.DynamicSlicesConfig = slicesConfigReader(SharedSliceRef_1.SharedSliceRef);
|
|
35
35
|
const SlicesConfig = {
|
|
36
36
|
toStatic(config, sharedSlices) {
|
|
37
37
|
const choices = Object.entries(config.choices || {}).reduce((acc, [ref, slice]) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CompositeSlice } from "./CompositeSlice";
|
|
2
|
+
export { LegacySlice } from "./LegacySlice";
|
|
3
3
|
export * from "./SharedSlice";
|
|
4
|
-
export {
|
|
4
|
+
export { SharedSliceRef } from "./SharedSliceRef";
|
|
5
5
|
export * as Slice from "./Slice";
|
|
6
6
|
export * as SliceZone from "./Slices";
|
|
7
7
|
export { SlicesTypes } from "./SlicesTypes";
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SlicesTypes = exports.SliceZone = exports.Slice = exports.SharedSliceRef = exports.LegacySlice = exports.CompositeSlice = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var CompositeSlice_1 = require("./CompositeSlice");
|
|
6
|
-
Object.defineProperty(exports, "CompositeSlice", { enumerable: true, get: function () { return
|
|
6
|
+
Object.defineProperty(exports, "CompositeSlice", { enumerable: true, get: function () { return CompositeSlice_1.CompositeSlice; } });
|
|
7
7
|
var LegacySlice_1 = require("./LegacySlice");
|
|
8
|
-
Object.defineProperty(exports, "LegacySlice", { enumerable: true, get: function () { return
|
|
8
|
+
Object.defineProperty(exports, "LegacySlice", { enumerable: true, get: function () { return LegacySlice_1.LegacySlice; } });
|
|
9
9
|
tslib_1.__exportStar(require("./SharedSlice"), exports);
|
|
10
10
|
var SharedSliceRef_1 = require("./SharedSliceRef");
|
|
11
|
-
Object.defineProperty(exports, "SharedSliceRef", { enumerable: true, get: function () { return
|
|
11
|
+
Object.defineProperty(exports, "SharedSliceRef", { enumerable: true, get: function () { return SharedSliceRef_1.SharedSliceRef; } });
|
|
12
12
|
exports.Slice = tslib_1.__importStar(require("./Slice"));
|
|
13
13
|
exports.SliceZone = tslib_1.__importStar(require("./Slices"));
|
|
14
14
|
var SlicesTypes_1 = require("./SlicesTypes");
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { FieldType, SlicesTypes } from "../customtypes/widgets"
|
|
4
4
|
|
|
5
|
-
export const FieldOrSliceType = t.union([
|
|
5
|
+
export const FieldOrSliceType = t.union([FieldType, SlicesTypes])
|
|
6
6
|
export type FieldOrSliceType = t.TypeOf<typeof FieldOrSliceType>
|
|
7
7
|
export class LegacyContentCtx {
|
|
8
8
|
fieldKey: string
|
|
@@ -35,7 +35,7 @@ export const isWidgetContent = (u: unknown): u is WidgetContent =>
|
|
|
35
35
|
isSlicesContent(u)
|
|
36
36
|
|
|
37
37
|
export type WidgetContent = t.TypeOf<typeof WidgetContent>
|
|
38
|
-
export type
|
|
38
|
+
export type ContentType = WidgetContent["__TYPE__"]
|
|
39
39
|
|
|
40
40
|
export const WidgetLegacy = (ctx: LegacyContentCtx) => {
|
|
41
41
|
return {
|
|
@@ -5,16 +5,16 @@ import { StringOrNull } from "../../validators"
|
|
|
5
5
|
import { NestableWidget } from "./nestable/NestableWidget"
|
|
6
6
|
|
|
7
7
|
export const GroupFieldType = "Group"
|
|
8
|
-
const GroupConfig = t.exact(
|
|
8
|
+
export const GroupConfig = t.exact(
|
|
9
9
|
t.partial({
|
|
10
10
|
label: StringOrNull,
|
|
11
11
|
repeat: t.boolean,
|
|
12
12
|
fields: t.record(WidgetKey, NestableWidget),
|
|
13
13
|
}),
|
|
14
14
|
)
|
|
15
|
-
type GroupConfig = t.TypeOf<typeof GroupConfig>
|
|
15
|
+
export type GroupConfig = t.TypeOf<typeof GroupConfig>
|
|
16
16
|
|
|
17
|
-
const Group = t.exact(
|
|
17
|
+
export const Group = t.exact(
|
|
18
18
|
t.intersection([
|
|
19
19
|
t.type({
|
|
20
20
|
type: t.literal(GroupFieldType),
|
|
@@ -27,6 +27,4 @@ const Group = t.exact(
|
|
|
27
27
|
}),
|
|
28
28
|
]),
|
|
29
29
|
)
|
|
30
|
-
type Group = t.TypeOf<typeof Group>
|
|
31
|
-
|
|
32
|
-
export default Group
|
|
30
|
+
export type Group = t.TypeOf<typeof Group>
|
|
@@ -4,16 +4,16 @@ import { StringOrNull } from "../../validators"
|
|
|
4
4
|
|
|
5
5
|
export const UIDFieldType = "UID"
|
|
6
6
|
|
|
7
|
-
const UIDConfig = t.exact(
|
|
7
|
+
export const UIDConfig = t.exact(
|
|
8
8
|
t.partial({
|
|
9
9
|
label: StringOrNull,
|
|
10
10
|
useAsTitle: t.boolean,
|
|
11
11
|
placeholder: t.string,
|
|
12
12
|
}),
|
|
13
13
|
)
|
|
14
|
-
type UIDConfig = t.TypeOf<typeof UIDConfig>
|
|
14
|
+
export type UIDConfig = t.TypeOf<typeof UIDConfig>
|
|
15
15
|
|
|
16
|
-
const UID = t.exact(
|
|
16
|
+
export const UID = t.exact(
|
|
17
17
|
t.intersection([
|
|
18
18
|
t.type({
|
|
19
19
|
type: t.literal(UIDFieldType),
|
|
@@ -24,6 +24,4 @@ const UID = t.exact(
|
|
|
24
24
|
}),
|
|
25
25
|
]),
|
|
26
26
|
)
|
|
27
|
-
type UID = t.TypeOf<typeof UID>
|
|
28
|
-
|
|
29
|
-
export default UID
|
|
27
|
+
export type UID = t.TypeOf<typeof UID>
|