@prismicio/types-internal 0.2.2 → 0.2.3
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/customtypes/CustomType.d.ts +2 -20
- package/lib/customtypes/CustomType.js +33 -25
- package/lib/customtypes/Format.js +5 -2
- package/lib/customtypes/Section.d.ts +3 -30
- package/lib/customtypes/Section.js +14 -9
- package/lib/customtypes/index.js +9 -4
- package/lib/customtypes/widgets/Group.js +12 -9
- package/lib/customtypes/widgets/UID.js +10 -7
- package/lib/customtypes/widgets/Widget.d.ts +3 -30
- package/lib/customtypes/widgets/Widget.js +19 -14
- package/lib/customtypes/widgets/WidgetTypes.js +3 -1
- package/lib/customtypes/widgets/index.js +14 -7
- package/lib/customtypes/widgets/nestable/BooleanField.js +9 -6
- package/lib/customtypes/widgets/nestable/Color.js +10 -7
- package/lib/customtypes/widgets/nestable/Date.js +10 -7
- package/lib/customtypes/widgets/nestable/Embed.js +10 -7
- package/lib/customtypes/widgets/nestable/GeoPoint.js +10 -7
- package/lib/customtypes/widgets/nestable/Image.js +13 -10
- package/lib/customtypes/widgets/nestable/IntegrationField.js +10 -7
- package/lib/customtypes/widgets/nestable/Link.js +14 -11
- package/lib/customtypes/widgets/nestable/NestableWidget.js +35 -32
- package/lib/customtypes/widgets/nestable/Number.js +14 -11
- package/lib/customtypes/widgets/nestable/Range.js +14 -11
- package/lib/customtypes/widgets/nestable/RichText.js +15 -12
- package/lib/customtypes/widgets/nestable/Select.js +11 -8
- package/lib/customtypes/widgets/nestable/Separator.js +9 -6
- package/lib/customtypes/widgets/nestable/Text.js +10 -7
- package/lib/customtypes/widgets/nestable/Timestamp.js +10 -7
- package/lib/customtypes/widgets/nestable/index.js +36 -15
- package/lib/customtypes/widgets/shared/ImageConstraint.js +12 -9
- package/lib/customtypes/widgets/shared/index.js +8 -1
- package/lib/customtypes/widgets/slices/CompositeSlice.js +13 -10
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +1 -10
- package/lib/customtypes/widgets/slices/LegacySlice.js +8 -6
- package/lib/customtypes/widgets/slices/SharedSlice.js +12 -9
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +7 -4
- package/lib/customtypes/widgets/slices/Slice.js +2 -1
- package/lib/customtypes/widgets/slices/Slices.d.ts +6 -60
- package/lib/customtypes/widgets/slices/Slices.js +33 -27
- package/lib/customtypes/widgets/slices/SlicesTypes.js +3 -1
- package/lib/customtypes/widgets/slices/index.js +16 -7
- package/lib/documents/DocumentData.js +7 -4
- package/lib/documents/index.js +7 -2
- package/lib/documents/widgets/EmptyContent.js +6 -3
- package/lib/documents/widgets/GroupContent.js +14 -10
- package/lib/documents/widgets/SimpleWidgetContent.js +32 -27
- package/lib/documents/widgets/StaticWidgetContent.js +11 -8
- package/lib/documents/widgets/UIDContent.js +8 -4
- package/lib/documents/widgets/index.js +27 -22
- package/lib/documents/widgets/nestable/BooleanContent.js +10 -6
- package/lib/documents/widgets/nestable/EmbedContent.js +24 -20
- package/lib/documents/widgets/nestable/FieldContent.js +10 -6
- package/lib/documents/widgets/nestable/GeoPointContent.js +9 -5
- package/lib/documents/widgets/nestable/ImageContent.js +16 -12
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +10 -6
- package/lib/documents/widgets/nestable/Link/DocumentLink.js +12 -7
- package/lib/documents/widgets/nestable/Link/ExternalLink.js +15 -10
- package/lib/documents/widgets/nestable/Link/FileLink.js +15 -10
- package/lib/documents/widgets/nestable/Link/ImageLink.js +14 -9
- package/lib/documents/widgets/nestable/Link/LinkContent.js +13 -9
- package/lib/documents/widgets/nestable/Link/index.js +33 -24
- package/lib/documents/widgets/nestable/SeparatorContent.js +5 -2
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +39 -33
- package/lib/documents/widgets/nestable/StructuredTextContent/index.js +11 -7
- package/lib/documents/widgets/nestable/index.js +39 -28
- package/lib/documents/widgets/slices/CompositeSliceContent.js +13 -9
- package/lib/documents/widgets/slices/SharedSliceContent.js +16 -12
- package/lib/documents/widgets/slices/SimpleSliceContent.js +6 -2
- package/lib/documents/widgets/slices/SliceWidgetContent.js +12 -8
- package/lib/documents/widgets/slices/SlicesContent.js +17 -13
- package/lib/documents/widgets/slices/index.js +8 -5
- package/lib/index.js +7 -3
- package/lib/validators/DateFromString.js +7 -4
- package/lib/validators/DateFromStringOrNumber.js +7 -4
- package/lib/validators/DateFromTsMs.js +7 -4
- package/lib/validators/IntFromNumber.js +7 -4
- package/lib/validators/IntFromPixels.js +7 -4
- package/lib/validators/NonEmptyString.js +6 -3
- package/lib/validators/NonEmptyStringOrNull.js +10 -7
- package/lib/validators/NumberOrNull.js +6 -3
- package/lib/validators/StringFromBoolean.js +7 -4
- package/lib/validators/StringFromNumber.js +7 -4
- package/lib/validators/StringOrNull.js +6 -3
- package/lib/validators/function.js +28 -15
- package/lib/validators/index.js +27 -12
- package/package.json +1 -1
- package/src/customtypes/widgets/slices/LegacySlice.ts +1 -2
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const ImageConstraint_1 = (0, tslib_1.__importDefault)(require("../shared/ImageConstraint"));
|
|
7
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
5
8
|
const Thumbnail = t.exact(t.intersection([
|
|
6
9
|
t.type({
|
|
7
10
|
name: t.string,
|
|
8
11
|
}),
|
|
9
|
-
|
|
12
|
+
ImageConstraint_1.default,
|
|
10
13
|
]));
|
|
11
14
|
const ImageConfig = t.exact(t.partial({
|
|
12
|
-
label: StringOrNull,
|
|
15
|
+
label: validators_1.StringOrNull,
|
|
13
16
|
placeholder: t.string,
|
|
14
|
-
constraint:
|
|
17
|
+
constraint: ImageConstraint_1.default,
|
|
15
18
|
thumbnails: t.array(Thumbnail),
|
|
16
19
|
}));
|
|
17
20
|
const Image = t.exact(t.intersection([
|
|
18
21
|
t.type({
|
|
19
|
-
type: t.literal(
|
|
22
|
+
type: t.literal(WidgetTypes_1.default.Image),
|
|
20
23
|
}),
|
|
21
24
|
t.partial({
|
|
22
|
-
fieldset: StringOrNull,
|
|
25
|
+
fieldset: validators_1.StringOrNull,
|
|
23
26
|
config: ImageConfig,
|
|
24
27
|
}),
|
|
25
28
|
]));
|
|
26
|
-
|
|
29
|
+
exports.default = Image;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
4
7
|
const IntegrationFieldConfig = t.exact(t.partial({
|
|
5
|
-
label: StringOrNull,
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
6
9
|
placeholder: t.string,
|
|
7
10
|
catalog: t.string,
|
|
8
11
|
}));
|
|
9
12
|
const IntegrationField = t.exact(t.intersection([
|
|
10
13
|
t.type({
|
|
11
|
-
type: t.literal(
|
|
14
|
+
type: t.literal(WidgetTypes_1.default.IntegrationField),
|
|
12
15
|
}),
|
|
13
16
|
t.partial({
|
|
14
|
-
fieldset: StringOrNull,
|
|
17
|
+
fieldset: validators_1.StringOrNull,
|
|
15
18
|
config: IntegrationFieldConfig,
|
|
16
19
|
}),
|
|
17
20
|
]));
|
|
18
|
-
|
|
21
|
+
exports.default = IntegrationField;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const withFallback_1 = require("io-ts-types/lib/withFallback");
|
|
7
|
+
const validators_1 = require("../../../validators");
|
|
8
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
6
9
|
const arrayString = (entries) => {
|
|
7
10
|
if (entries instanceof Array) {
|
|
8
11
|
const isValidEntries = entries.reduce((acc, l) => acc && typeof l === "string", true);
|
|
@@ -20,15 +23,15 @@ const plainString = (entries) => {
|
|
|
20
23
|
const MasksArrayString = new t.Type("MasksArrayString", (u) => {
|
|
21
24
|
return u instanceof Array;
|
|
22
25
|
}, (u, context) => {
|
|
23
|
-
return either.chain(t.union([t.array(t.string), t.string]).validate(u, context), (masks) => {
|
|
26
|
+
return Either_1.either.chain(t.union([t.array(t.string), t.string]).validate(u, context), (masks) => {
|
|
24
27
|
return arrayString(masks) || plainString(masks) || t.failure(u, context);
|
|
25
28
|
});
|
|
26
29
|
}, (res) => res);
|
|
27
30
|
const LinkConfig = t.exact(t.partial({
|
|
28
|
-
label: StringOrNull,
|
|
31
|
+
label: validators_1.StringOrNull,
|
|
29
32
|
useAsTitle: t.boolean,
|
|
30
33
|
placeholder: t.string,
|
|
31
|
-
select: withFallback(t.union([
|
|
34
|
+
select: (0, withFallback_1.withFallback)(t.union([
|
|
32
35
|
t.literal("media"),
|
|
33
36
|
t.literal("document"),
|
|
34
37
|
t.literal("web"),
|
|
@@ -41,11 +44,11 @@ const LinkConfig = t.exact(t.partial({
|
|
|
41
44
|
}));
|
|
42
45
|
const Link = t.exact(t.intersection([
|
|
43
46
|
t.type({
|
|
44
|
-
type: t.literal(
|
|
47
|
+
type: t.literal(WidgetTypes_1.default.Link),
|
|
45
48
|
}),
|
|
46
49
|
t.partial({
|
|
47
|
-
fieldset: StringOrNull,
|
|
50
|
+
fieldset: validators_1.StringOrNull,
|
|
48
51
|
config: LinkConfig,
|
|
49
52
|
}),
|
|
50
53
|
]));
|
|
51
|
-
|
|
54
|
+
exports.default = Link;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const BooleanField_1 = (0, tslib_1.__importDefault)(require("./BooleanField"));
|
|
6
|
+
const Color_1 = (0, tslib_1.__importDefault)(require("./Color"));
|
|
7
|
+
const Date_1 = (0, tslib_1.__importDefault)(require("./Date"));
|
|
8
|
+
const Embed_1 = (0, tslib_1.__importDefault)(require("./Embed"));
|
|
9
|
+
const GeoPoint_1 = (0, tslib_1.__importDefault)(require("./GeoPoint"));
|
|
10
|
+
const Image_1 = (0, tslib_1.__importDefault)(require("./Image"));
|
|
11
|
+
const IntegrationField_1 = (0, tslib_1.__importDefault)(require("./IntegrationField"));
|
|
12
|
+
const Link_1 = (0, tslib_1.__importDefault)(require("./Link"));
|
|
13
|
+
const Number_1 = (0, tslib_1.__importDefault)(require("./Number"));
|
|
14
|
+
const Range_1 = (0, tslib_1.__importDefault)(require("./Range"));
|
|
15
|
+
const RichText_1 = (0, tslib_1.__importDefault)(require("./RichText"));
|
|
16
|
+
const Select_1 = (0, tslib_1.__importDefault)(require("./Select"));
|
|
17
|
+
const Separator_1 = (0, tslib_1.__importDefault)(require("./Separator"));
|
|
18
|
+
const Text_1 = (0, tslib_1.__importDefault)(require("./Text"));
|
|
19
|
+
const Timestamp_1 = (0, tslib_1.__importDefault)(require("./Timestamp"));
|
|
17
20
|
const NestableWidget = t.union([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
Color_1.default,
|
|
22
|
+
BooleanField_1.default,
|
|
23
|
+
Embed_1.default,
|
|
24
|
+
GeoPoint_1.default,
|
|
25
|
+
Date_1.default,
|
|
26
|
+
Number_1.default,
|
|
27
|
+
Range_1.default,
|
|
28
|
+
RichText_1.default,
|
|
29
|
+
Select_1.default,
|
|
30
|
+
Separator_1.default,
|
|
31
|
+
Text_1.default,
|
|
32
|
+
Timestamp_1.default,
|
|
33
|
+
Link_1.default,
|
|
34
|
+
Image_1.default,
|
|
35
|
+
IntegrationField_1.default,
|
|
33
36
|
]);
|
|
34
|
-
|
|
37
|
+
exports.default = NestableWidget;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
|
|
6
|
+
const validators_1 = require("../../../validators");
|
|
7
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
5
8
|
const NumberConfig = t.exact(t.partial({
|
|
6
|
-
label: StringOrNull,
|
|
9
|
+
label: validators_1.StringOrNull,
|
|
7
10
|
placeholder: t.string,
|
|
8
|
-
min: t.union([t.number, NumberFromString]),
|
|
9
|
-
max: t.union([t.number, NumberFromString]),
|
|
10
|
-
step: t.union([t.number, NumberFromString]),
|
|
11
|
+
min: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
12
|
+
max: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
13
|
+
step: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
11
14
|
}));
|
|
12
15
|
const Number = t.exact(t.intersection([
|
|
13
16
|
t.type({
|
|
14
|
-
type: t.literal(
|
|
17
|
+
type: t.literal(WidgetTypes_1.default.Number),
|
|
15
18
|
}),
|
|
16
19
|
t.partial({
|
|
17
|
-
fieldset: StringOrNull,
|
|
20
|
+
fieldset: validators_1.StringOrNull,
|
|
18
21
|
config: NumberConfig,
|
|
19
22
|
}),
|
|
20
23
|
]));
|
|
21
|
-
|
|
24
|
+
exports.default = Number;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
|
|
6
|
+
const validators_1 = require("../../../validators");
|
|
7
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
5
8
|
const RangeConfig = t.exact(t.partial({
|
|
6
|
-
label: StringOrNull,
|
|
9
|
+
label: validators_1.StringOrNull,
|
|
7
10
|
placeholder: t.string,
|
|
8
|
-
min: t.union([t.number, NumberFromString]),
|
|
9
|
-
max: t.union([t.number, NumberFromString]),
|
|
10
|
-
step: t.union([t.number, NumberFromString]),
|
|
11
|
+
min: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
12
|
+
max: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
13
|
+
step: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
11
14
|
}));
|
|
12
15
|
const Range = t.exact(t.intersection([
|
|
13
16
|
t.type({
|
|
14
|
-
type: t.literal(
|
|
17
|
+
type: t.literal(WidgetTypes_1.default.Range),
|
|
15
18
|
}),
|
|
16
19
|
t.partial({
|
|
17
|
-
fieldset: StringOrNull,
|
|
20
|
+
fieldset: validators_1.StringOrNull,
|
|
18
21
|
config: RangeConfig,
|
|
19
22
|
}),
|
|
20
23
|
]));
|
|
21
|
-
|
|
24
|
+
exports.default = Range;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const validators_1 = require("../../../validators");
|
|
7
|
+
const ImageConstraint_1 = (0, tslib_1.__importDefault)(require("../shared/ImageConstraint"));
|
|
8
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
6
9
|
const DEFAULT_OPTION = "paragraph";
|
|
7
10
|
const options = [
|
|
8
11
|
"heading1",
|
|
@@ -23,7 +26,7 @@ const options = [
|
|
|
23
26
|
"rtl",
|
|
24
27
|
];
|
|
25
28
|
const RichTextOptions = new t.Type("RichTextOptions", (u) => typeof u === "string", (u, context) => {
|
|
26
|
-
return either.chain(t.union([t.string, t.null]).validate(u, context), (s) => {
|
|
29
|
+
return Either_1.either.chain(t.union([t.string, t.null]).validate(u, context), (s) => {
|
|
27
30
|
if (!s)
|
|
28
31
|
return t.success(DEFAULT_OPTION);
|
|
29
32
|
const entries = s.split(",").map((e) => e.trim());
|
|
@@ -76,7 +79,7 @@ const RichTextLabels = new t.Type("RichTextLabels", (u) => {
|
|
|
76
79
|
}, (u, context) => {
|
|
77
80
|
const legacyValidator = t.record(t.string, t.array(t.record(t.literal("name"), t.string)));
|
|
78
81
|
const validator = t.array(t.string);
|
|
79
|
-
return either.chain(t
|
|
82
|
+
return Either_1.either.chain(t
|
|
80
83
|
.union([legacyValidator, validator, t.string, t.null])
|
|
81
84
|
.validate(u, context), (labels) => {
|
|
82
85
|
return (NoLabels(labels) ||
|
|
@@ -87,22 +90,22 @@ const RichTextLabels = new t.Type("RichTextLabels", (u) => {
|
|
|
87
90
|
});
|
|
88
91
|
}, (res) => res);
|
|
89
92
|
const RichTextConfig = t.exact(t.partial({
|
|
90
|
-
label: StringOrNull,
|
|
93
|
+
label: validators_1.StringOrNull,
|
|
91
94
|
placeholder: t.string,
|
|
92
95
|
useAsTitle: t.boolean,
|
|
93
96
|
single: RichTextOptions,
|
|
94
97
|
multi: RichTextOptions,
|
|
95
|
-
imageConstraint:
|
|
98
|
+
imageConstraint: ImageConstraint_1.default,
|
|
96
99
|
labels: RichTextLabels,
|
|
97
100
|
allowTargetBlank: t.boolean,
|
|
98
101
|
}));
|
|
99
102
|
const RichText = t.exact(t.intersection([
|
|
100
103
|
t.type({
|
|
101
|
-
type: t.literal(
|
|
104
|
+
type: t.literal(WidgetTypes_1.default.RichText),
|
|
102
105
|
}),
|
|
103
106
|
t.partial({
|
|
104
|
-
fieldset: StringOrNull,
|
|
107
|
+
fieldset: validators_1.StringOrNull,
|
|
105
108
|
config: RichTextConfig,
|
|
106
109
|
}),
|
|
107
110
|
]));
|
|
108
|
-
|
|
111
|
+
exports.default = RichText;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
4
7
|
const SelectConfig = t.exact(t.partial({
|
|
5
|
-
label: StringOrNull,
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
6
9
|
placeholder: t.string,
|
|
7
10
|
default_value: t.string,
|
|
8
|
-
options: t.array(t.union([t.string, StringFromNumber, StringFromBoolean])),
|
|
11
|
+
options: t.array(t.union([t.string, validators_1.StringFromNumber, validators_1.StringFromBoolean])),
|
|
9
12
|
}));
|
|
10
13
|
const Select = t.exact(t.intersection([
|
|
11
14
|
t.type({
|
|
12
|
-
type: t.literal(
|
|
15
|
+
type: t.literal(WidgetTypes_1.default.Select),
|
|
13
16
|
}),
|
|
14
17
|
t.partial({
|
|
15
|
-
fieldset: StringOrNull,
|
|
18
|
+
fieldset: validators_1.StringOrNull,
|
|
16
19
|
config: SelectConfig,
|
|
17
20
|
}),
|
|
18
21
|
]));
|
|
19
|
-
|
|
22
|
+
exports.default = Select;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
4
7
|
const SeparatorConfig = t.exact(t.partial({
|
|
5
|
-
label: StringOrNull,
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
6
9
|
}));
|
|
7
10
|
const Separator = t.exact(t.intersection([
|
|
8
11
|
t.type({
|
|
9
|
-
type: t.literal(
|
|
12
|
+
type: t.literal(WidgetTypes_1.default.Separator),
|
|
10
13
|
}),
|
|
11
14
|
t.partial({
|
|
12
15
|
config: SeparatorConfig,
|
|
13
16
|
}),
|
|
14
17
|
]));
|
|
15
|
-
|
|
18
|
+
exports.default = Separator;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
4
7
|
const TextConfig = t.exact(t.partial({
|
|
5
|
-
label: StringOrNull,
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
6
9
|
useAsTitle: t.boolean,
|
|
7
10
|
placeholder: t.string,
|
|
8
11
|
}));
|
|
9
12
|
const Text = t.exact(t.intersection([
|
|
10
13
|
t.type({
|
|
11
|
-
type: t.literal(
|
|
14
|
+
type: t.literal(WidgetTypes_1.default.Text),
|
|
12
15
|
}),
|
|
13
16
|
t.partial({
|
|
14
|
-
fieldset: StringOrNull,
|
|
17
|
+
fieldset: validators_1.StringOrNull,
|
|
15
18
|
config: TextConfig,
|
|
16
19
|
}),
|
|
17
20
|
]));
|
|
18
|
-
|
|
21
|
+
exports.default = Text;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
4
7
|
const TimestampConfig = t.exact(t.partial({
|
|
5
|
-
label: StringOrNull,
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
6
9
|
placeholder: t.string,
|
|
7
10
|
default: t.string,
|
|
8
11
|
}));
|
|
9
12
|
const Timestamp = t.exact(t.intersection([
|
|
10
13
|
t.type({
|
|
11
|
-
type: t.literal(
|
|
14
|
+
type: t.literal(WidgetTypes_1.default.Timestamp),
|
|
12
15
|
}),
|
|
13
16
|
t.partial({
|
|
14
|
-
fieldset: StringOrNull,
|
|
17
|
+
fieldset: validators_1.StringOrNull,
|
|
15
18
|
config: TimestampConfig,
|
|
16
19
|
}),
|
|
17
20
|
]));
|
|
18
|
-
|
|
21
|
+
exports.default = Timestamp;
|
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Timestamp = exports.Text = exports.Separator = exports.Select = exports.RichText = exports.Range = exports.Number = exports.NestableWidget = exports.Link = exports.IntegrationField = exports.Image = exports.GeoPoint = exports.Date = exports.Color = exports.BooleanField = void 0;
|
|
7
|
+
var BooleanField_1 = require("./BooleanField");
|
|
8
|
+
Object.defineProperty(exports, "BooleanField", { enumerable: true, get: function () { return __importDefault(BooleanField_1).default; } });
|
|
9
|
+
var Color_1 = require("./Color");
|
|
10
|
+
Object.defineProperty(exports, "Color", { enumerable: true, get: function () { return __importDefault(Color_1).default; } });
|
|
11
|
+
var Date_1 = require("./Date");
|
|
12
|
+
Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return __importDefault(Date_1).default; } });
|
|
13
|
+
var GeoPoint_1 = require("./GeoPoint");
|
|
14
|
+
Object.defineProperty(exports, "GeoPoint", { enumerable: true, get: function () { return __importDefault(GeoPoint_1).default; } });
|
|
15
|
+
var Image_1 = require("./Image");
|
|
16
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return __importDefault(Image_1).default; } });
|
|
17
|
+
var IntegrationField_1 = require("./IntegrationField");
|
|
18
|
+
Object.defineProperty(exports, "IntegrationField", { enumerable: true, get: function () { return __importDefault(IntegrationField_1).default; } });
|
|
19
|
+
var Link_1 = require("./Link");
|
|
20
|
+
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return __importDefault(Link_1).default; } });
|
|
21
|
+
var NestableWidget_1 = require("./NestableWidget");
|
|
22
|
+
Object.defineProperty(exports, "NestableWidget", { enumerable: true, get: function () { return __importDefault(NestableWidget_1).default; } });
|
|
23
|
+
var Number_1 = require("./Number");
|
|
24
|
+
Object.defineProperty(exports, "Number", { enumerable: true, get: function () { return __importDefault(Number_1).default; } });
|
|
25
|
+
var Range_1 = require("./Range");
|
|
26
|
+
Object.defineProperty(exports, "Range", { enumerable: true, get: function () { return __importDefault(Range_1).default; } });
|
|
27
|
+
var RichText_1 = require("./RichText");
|
|
28
|
+
Object.defineProperty(exports, "RichText", { enumerable: true, get: function () { return __importDefault(RichText_1).default; } });
|
|
29
|
+
var Select_1 = require("./Select");
|
|
30
|
+
Object.defineProperty(exports, "Select", { enumerable: true, get: function () { return __importDefault(Select_1).default; } });
|
|
31
|
+
var Separator_1 = require("./Separator");
|
|
32
|
+
Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return __importDefault(Separator_1).default; } });
|
|
33
|
+
var Text_1 = require("./Text");
|
|
34
|
+
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return __importDefault(Text_1).default; } });
|
|
35
|
+
var Timestamp_1 = require("./Timestamp");
|
|
36
|
+
Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return __importDefault(Timestamp_1).default; } });
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const IntFromString_1 = require("io-ts-types/lib/IntFromString");
|
|
7
|
+
const validators_1 = require("../../../validators");
|
|
5
8
|
const SideConstraint = new t.Type("SideConstraints", (u) => {
|
|
6
9
|
return !u || typeof u === "number";
|
|
7
10
|
}, (u, context) => {
|
|
8
|
-
return either.chain(t
|
|
11
|
+
return Either_1.either.chain(t
|
|
9
12
|
.union([
|
|
10
13
|
t.literal("auto"),
|
|
11
14
|
t.literal(""),
|
|
12
15
|
t.Int,
|
|
13
|
-
IntFromString,
|
|
14
|
-
IntFromNumber,
|
|
15
|
-
IntFromPixels,
|
|
16
|
+
IntFromString_1.IntFromString,
|
|
17
|
+
validators_1.IntFromNumber,
|
|
18
|
+
validators_1.IntFromPixels,
|
|
16
19
|
t.null,
|
|
17
20
|
])
|
|
18
21
|
.validate(u, context), (constraint) => {
|
|
@@ -25,4 +28,4 @@ const ImageConstraint = t.partial({
|
|
|
25
28
|
width: SideConstraint,
|
|
26
29
|
height: SideConstraint,
|
|
27
30
|
});
|
|
28
|
-
|
|
31
|
+
exports.default = ImageConstraint;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ImageConstraint = void 0;
|
|
7
|
+
var ImageConstraint_1 = require("./ImageConstraint");
|
|
8
|
+
Object.defineProperty(exports, "ImageConstraint", { enumerable: true, get: function () { return __importDefault(ImageConstraint_1).default; } });
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const validators_1 = require("../../../validators");
|
|
6
|
+
const NestableWidget_1 = (0, tslib_1.__importDefault)(require("../nestable/NestableWidget"));
|
|
7
|
+
const SlicesTypes_1 = (0, tslib_1.__importDefault)(require("./SlicesTypes"));
|
|
5
8
|
const CompositeSliceConfig = t.exact(t.partial({
|
|
6
|
-
label: StringOrNull,
|
|
9
|
+
label: validators_1.StringOrNull,
|
|
7
10
|
}));
|
|
8
11
|
const CompositeSlice = t.exact(t.intersection([
|
|
9
12
|
t.type({
|
|
10
|
-
type: t.literal(
|
|
13
|
+
type: t.literal(SlicesTypes_1.default.Slice),
|
|
11
14
|
}),
|
|
12
15
|
t.partial({
|
|
13
|
-
fieldset: StringOrNull,
|
|
16
|
+
fieldset: validators_1.StringOrNull,
|
|
14
17
|
description: t.string,
|
|
15
18
|
icon: t.string,
|
|
16
19
|
display: t.string,
|
|
17
|
-
"non-repeat": t.record(t.string,
|
|
18
|
-
repeat: t.record(t.string,
|
|
20
|
+
"non-repeat": t.record(t.string, NestableWidget_1.default),
|
|
21
|
+
repeat: t.record(t.string, NestableWidget_1.default),
|
|
19
22
|
config: CompositeSliceConfig,
|
|
20
23
|
}),
|
|
21
24
|
]));
|
|
22
|
-
|
|
25
|
+
exports.default = CompositeSlice;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
declare const LegacySlice: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
3
|
-
type: t.LiteralC<import("../WidgetTypes").default.UID>;
|
|
4
|
-
}>, t.PartialC<{
|
|
5
|
-
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
6
|
-
config: t.ExactC<t.PartialC<{
|
|
7
|
-
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
8
|
-
useAsTitle: t.BooleanC;
|
|
9
|
-
placeholder: t.StringC;
|
|
10
|
-
}>>;
|
|
11
|
-
}>]>>, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
2
|
+
declare const LegacySlice: t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
12
3
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
13
4
|
}>, t.PartialC<{
|
|
14
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const Group_1 = (0, tslib_1.__importDefault)(require("../Group"));
|
|
6
|
+
const NestableWidget_1 = (0, tslib_1.__importDefault)(require("../nestable/NestableWidget"));
|
|
7
|
+
const LegacySlice = t.union([NestableWidget_1.default, Group_1.default]);
|
|
8
|
+
exports.default = LegacySlice;
|