@prismicio/types-internal 0.1.1 → 0.2.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/README.md +13 -13
- package/{dist → lib}/customtypes/CustomType.d.ts +699 -699
- package/{dist → lib}/customtypes/CustomType.js +28 -28
- package/{dist → lib}/customtypes/Format.d.ts +0 -0
- package/{dist → lib}/customtypes/Format.js +0 -0
- package/{dist → lib}/customtypes/Section.d.ts +1038 -1038
- package/{dist → lib}/customtypes/Section.js +2 -3
- package/lib/customtypes/index.d.ts +4 -0
- package/{dist → lib}/customtypes/index.js +4 -4
- package/{dist → lib}/customtypes/widgets/Group.d.ts +45 -45
- package/{dist → lib}/customtypes/widgets/Group.js +8 -8
- package/{dist → lib}/customtypes/widgets/UID.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/UID.js +7 -7
- package/{dist → lib}/customtypes/widgets/Widget.d.ts +1039 -1039
- package/{dist → lib}/customtypes/widgets/Widget.js +9 -12
- package/{dist → lib}/customtypes/widgets/WidgetTypes.d.ts +0 -0
- package/{dist → lib}/customtypes/widgets/WidgetTypes.js +0 -0
- package/lib/customtypes/widgets/index.d.ts +7 -0
- package/{dist → lib}/customtypes/widgets/index.js +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/BooleanField.d.ts +3 -3
- package/{dist → lib}/customtypes/widgets/nestable/BooleanField.js +6 -6
- package/{dist → lib}/customtypes/widgets/nestable/Color.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Color.js +6 -6
- package/{dist → lib}/customtypes/widgets/nestable/Date.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Date.js +7 -7
- package/{dist → lib}/customtypes/widgets/nestable/Embed.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Embed.js +7 -7
- package/{dist → lib}/customtypes/widgets/nestable/GeoPoint.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/GeoPoint.js +6 -6
- package/lib/customtypes/widgets/nestable/Image.d.ts +23 -0
- package/{dist → lib}/customtypes/widgets/nestable/Image.js +10 -10
- package/{dist → lib}/customtypes/widgets/nestable/IntegrationField.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/IntegrationField.js +7 -7
- package/{dist → lib}/customtypes/widgets/nestable/Link.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Link.js +18 -23
- package/{dist → lib}/customtypes/widgets/nestable/NestableWidget.d.ts +42 -42
- package/{dist → lib}/customtypes/widgets/nestable/NestableWidget.js +5 -5
- package/{dist → lib}/customtypes/widgets/nestable/Number.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Number.js +8 -8
- package/{dist → lib}/customtypes/widgets/nestable/Range.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Range.js +7 -7
- package/{dist → lib}/customtypes/widgets/nestable/RichText.d.ts +6 -6
- package/{dist → lib}/customtypes/widgets/nestable/RichText.js +42 -48
- package/lib/customtypes/widgets/nestable/Select.d.ts +15 -0
- package/{dist → lib}/customtypes/widgets/nestable/Select.js +7 -9
- package/{dist → lib}/customtypes/widgets/nestable/Separator.d.ts +3 -3
- package/{dist → lib}/customtypes/widgets/nestable/Separator.js +5 -5
- package/{dist → lib}/customtypes/widgets/nestable/Text.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Text.js +7 -7
- package/{dist → lib}/customtypes/widgets/nestable/Timestamp.d.ts +4 -4
- package/{dist → lib}/customtypes/widgets/nestable/Timestamp.js +7 -7
- package/lib/customtypes/widgets/nestable/index.d.ts +15 -0
- package/{dist → lib}/customtypes/widgets/nestable/index.js +0 -0
- package/{dist → lib}/customtypes/widgets/shared/ImageConstraint.d.ts +3 -3
- package/{dist → lib}/customtypes/widgets/shared/ImageConstraint.js +16 -15
- package/lib/customtypes/widgets/shared/index.d.ts +1 -0
- package/{dist → lib}/customtypes/widgets/shared/index.js +0 -0
- package/{dist → lib}/customtypes/widgets/slices/CompositeSlice.d.ts +87 -87
- package/{dist → lib}/customtypes/widgets/slices/CompositeSlice.js +8 -8
- package/{dist → lib}/customtypes/widgets/slices/LegacySlice.d.ts +87 -87
- package/{dist → lib}/customtypes/widgets/slices/LegacySlice.js +3 -7
- package/{dist → lib}/customtypes/widgets/slices/SharedSlice.d.ts +84 -84
- package/{dist → lib}/customtypes/widgets/slices/SharedSlice.js +7 -7
- package/{dist → lib}/customtypes/widgets/slices/SharedSliceRef.d.ts +2 -2
- package/{dist → lib}/customtypes/widgets/slices/SharedSliceRef.js +1 -1
- package/{dist → lib}/customtypes/widgets/slices/Slice.d.ts +1 -1
- package/{dist → lib}/customtypes/widgets/slices/Slice.js +0 -0
- package/{dist → lib}/customtypes/widgets/slices/Slices.d.ts +1556 -1556
- package/{dist → lib}/customtypes/widgets/slices/Slices.js +31 -23
- package/{dist → lib}/customtypes/widgets/slices/SlicesTypes.d.ts +0 -0
- package/{dist → lib}/customtypes/widgets/slices/SlicesTypes.js +0 -0
- package/lib/customtypes/widgets/slices/index.d.ts +7 -0
- package/{dist → lib}/customtypes/widgets/slices/index.js +3 -3
- package/lib/documents/DocumentData.d.ts +8 -0
- package/lib/documents/DocumentData.js +46 -0
- package/lib/documents/index.d.ts +2 -0
- package/lib/documents/index.js +28 -0
- package/lib/documents/widgets/EmptyContent.d.ts +8 -0
- package/lib/documents/widgets/EmptyContent.js +9 -0
- package/lib/documents/widgets/GroupContent.d.ts +16 -0
- package/lib/documents/widgets/GroupContent.js +77 -0
- package/lib/documents/widgets/SimpleWidgetContent.d.ts +20 -0
- package/lib/documents/widgets/SimpleWidgetContent.js +96 -0
- package/lib/documents/widgets/StaticWidgetContent.d.ts +10 -0
- package/lib/documents/widgets/StaticWidgetContent.js +44 -0
- package/lib/documents/widgets/UIDContent.d.ts +7 -0
- package/lib/documents/widgets/UIDContent.js +28 -0
- package/lib/documents/widgets/Widget.d.ts +0 -0
- package/lib/documents/widgets/Widget.js +1 -0
- package/lib/documents/widgets/index.d.ts +35 -0
- package/lib/documents/widgets/index.js +60 -0
- package/lib/documents/widgets/nestable/BooleanContent.d.ts +8 -0
- package/lib/documents/widgets/nestable/BooleanContent.js +29 -0
- package/lib/documents/widgets/nestable/EmbedContent.d.ts +40 -0
- package/lib/documents/widgets/nestable/EmbedContent.js +54 -0
- package/lib/documents/widgets/nestable/FieldContent.d.ts +12 -0
- package/lib/documents/widgets/nestable/FieldContent.js +53 -0
- package/lib/documents/widgets/nestable/GeoPointContent.d.ts +17 -0
- package/lib/documents/widgets/nestable/GeoPointContent.js +31 -0
- package/lib/documents/widgets/nestable/ImageContent.d.ts +127 -0
- package/lib/documents/widgets/nestable/ImageContent.js +59 -0
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +8 -0
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +34 -0
- package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +12 -0
- package/lib/documents/widgets/nestable/Link/DocumentLink.js +31 -0
- package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +24 -0
- package/lib/documents/widgets/nestable/Link/ExternalLink.js +42 -0
- package/lib/documents/widgets/nestable/Link/FileLink.d.ts +22 -0
- package/lib/documents/widgets/nestable/Link/FileLink.js +42 -0
- package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +28 -0
- package/lib/documents/widgets/nestable/Link/ImageLink.js +44 -0
- package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +36 -0
- package/lib/documents/widgets/nestable/Link/LinkContent.js +31 -0
- package/lib/documents/widgets/nestable/Link/index.d.ts +89 -0
- package/lib/documents/widgets/nestable/Link/index.js +53 -0
- package/lib/documents/widgets/nestable/SeparatorContent.d.ts +7 -0
- package/lib/documents/widgets/nestable/SeparatorContent.js +10 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +274 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +118 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +9 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/index.js +32 -0
- package/lib/documents/widgets/nestable/index.d.ts +26 -0
- package/lib/documents/widgets/nestable/index.js +64 -0
- package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +14 -0
- package/lib/documents/widgets/slices/CompositeSliceContent.js +68 -0
- package/lib/documents/widgets/slices/SharedSliceContent.d.ts +15 -0
- package/lib/documents/widgets/slices/SharedSliceContent.js +80 -0
- package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +6 -0
- package/lib/documents/widgets/slices/SimpleSliceContent.js +8 -0
- package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +8 -0
- package/lib/documents/widgets/slices/SliceWidgetContent.js +47 -0
- package/lib/documents/widgets/slices/SlicesContent.d.ts +17 -0
- package/lib/documents/widgets/slices/SlicesContent.js +69 -0
- package/lib/documents/widgets/slices/index.d.ts +5 -0
- package/lib/documents/widgets/slices/index.js +17 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +25 -0
- package/lib/validators/DateFromString.d.ts +3 -0
- package/lib/validators/DateFromString.js +28 -0
- package/lib/validators/DateFromStringOrNumber.d.ts +3 -0
- package/lib/validators/DateFromStringOrNumber.js +28 -0
- package/lib/validators/DateFromTsMs.d.ts +3 -0
- package/lib/validators/DateFromTsMs.js +28 -0
- package/lib/validators/IntFromNumber.d.ts +5 -0
- package/{dist → lib}/validators/IntFromNumber.js +4 -7
- package/lib/validators/IntFromPixels.d.ts +8 -0
- package/{dist → lib}/validators/IntFromPixels.js +5 -5
- package/lib/validators/NonEmptyString.d.ts +3 -0
- package/lib/validators/NonEmptyString.js +24 -0
- package/lib/validators/NonEmptyStringOrNull.d.ts +3 -0
- package/lib/validators/NonEmptyStringOrNull.js +17 -0
- package/lib/validators/NumberOrNull.d.ts +3 -0
- package/{dist/index.js → lib/validators/NumberOrNull.js} +3 -2
- package/lib/validators/StringFromBoolean.d.ts +5 -0
- package/{dist → lib}/validators/StringFromBoolean.js +5 -8
- package/lib/validators/StringFromNumber.d.ts +5 -0
- package/{dist → lib}/validators/StringFromNumber.js +5 -8
- package/lib/validators/StringOrNull.d.ts +3 -0
- package/{dist → lib}/validators/StringOrNull.js +2 -2
- package/lib/validators/function.d.ts +14 -0
- package/lib/validators/function.js +77 -0
- package/lib/validators/index.d.ts +12 -0
- package/lib/validators/index.js +48 -0
- package/package.json +30 -18
- package/src/customtypes/CustomType.ts +173 -116
- package/src/customtypes/Format.ts +3 -3
- package/src/customtypes/Section.ts +26 -13
- package/src/customtypes/index.ts +4 -4
- package/src/customtypes/widgets/Group.ts +21 -20
- package/src/customtypes/widgets/UID.ts +18 -17
- package/src/customtypes/widgets/Widget.ts +22 -23
- package/src/customtypes/widgets/WidgetTypes.ts +21 -21
- package/src/customtypes/widgets/index.ts +7 -7
- package/src/customtypes/widgets/nestable/BooleanField.ts +19 -19
- package/src/customtypes/widgets/nestable/Color.ts +17 -16
- package/src/customtypes/widgets/nestable/Date.ts +19 -18
- package/src/customtypes/widgets/nestable/Embed.ts +19 -18
- package/src/customtypes/widgets/nestable/GeoPoint.ts +17 -16
- package/src/customtypes/widgets/nestable/Image.ts +26 -26
- package/src/customtypes/widgets/nestable/IntegrationField.ts +18 -17
- package/src/customtypes/widgets/nestable/Link.ts +80 -68
- package/src/customtypes/widgets/nestable/NestableWidget.ts +32 -32
- package/src/customtypes/widgets/nestable/Number.ts +22 -21
- package/src/customtypes/widgets/nestable/Range.ts +22 -21
- package/src/customtypes/widgets/nestable/RichText.ts +164 -134
- package/src/customtypes/widgets/nestable/Select.ts +22 -21
- package/src/customtypes/widgets/nestable/Separator.ts +15 -14
- package/src/customtypes/widgets/nestable/Text.ts +18 -17
- package/src/customtypes/widgets/nestable/Timestamp.ts +19 -18
- package/src/customtypes/widgets/nestable/index.ts +15 -15
- package/src/customtypes/widgets/shared/ImageConstraint.ts +31 -29
- package/src/customtypes/widgets/shared/index.ts +1 -1
- package/src/customtypes/widgets/slices/CompositeSlice.ts +21 -21
- package/src/customtypes/widgets/slices/LegacySlice.ts +6 -10
- package/src/customtypes/widgets/slices/SharedSlice.ts +33 -31
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +6 -6
- package/src/customtypes/widgets/slices/Slice.ts +4 -4
- package/src/customtypes/widgets/slices/Slices.ts +95 -73
- package/src/customtypes/widgets/slices/SlicesTypes.ts +3 -3
- package/src/customtypes/widgets/slices/index.ts +7 -7
- package/src/documents/DocumentData.ts +54 -0
- package/src/documents/index.ts +2 -0
- package/src/documents/widgets/EmptyContent.ts +8 -0
- package/src/documents/widgets/GroupContent.ts +91 -0
- package/src/documents/widgets/SimpleWidgetContent.ts +96 -0
- package/src/documents/widgets/StaticWidgetContent.ts +46 -0
- package/src/documents/widgets/UIDContent.ts +18 -0
- package/src/documents/widgets/index.ts +56 -0
- package/src/documents/widgets/nestable/BooleanContent.ts +21 -0
- package/src/documents/widgets/nestable/EmbedContent.ts +54 -0
- package/src/documents/widgets/nestable/FieldContent.ts +45 -0
- package/src/documents/widgets/nestable/GeoPointContent.ts +18 -0
- package/src/documents/widgets/nestable/ImageContent.ts +51 -0
- package/src/documents/widgets/nestable/IntegrationFieldsContent.ts +26 -0
- package/src/documents/widgets/nestable/Link/DocumentLink.ts +18 -0
- package/src/documents/widgets/nestable/Link/ExternalLink.ts +31 -0
- package/src/documents/widgets/nestable/Link/FileLink.ts +29 -0
- package/src/documents/widgets/nestable/Link/ImageLink.ts +31 -0
- package/src/documents/widgets/nestable/Link/LinkContent.ts +22 -0
- package/src/documents/widgets/nestable/Link/index.ts +33 -0
- package/src/documents/widgets/nestable/SeparatorContent.ts +8 -0
- package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +122 -0
- package/src/documents/widgets/nestable/StructuredTextContent/index.ts +25 -0
- package/src/documents/widgets/nestable/index.ts +35 -0
- package/src/documents/widgets/slices/CompositeSliceContent.ts +77 -0
- package/src/documents/widgets/slices/SharedSliceContent.ts +94 -0
- package/src/documents/widgets/slices/SimpleSliceContent.ts +4 -0
- package/src/documents/widgets/slices/SliceWidgetContent.ts +51 -0
- package/src/documents/widgets/slices/SlicesContent.ts +91 -0
- package/src/documents/widgets/slices/index.ts +5 -0
- package/src/index.ts +3 -1
- package/src/validators/DateFromString.ts +17 -0
- package/src/validators/DateFromStringOrNumber.ts +17 -0
- package/src/validators/DateFromTsMs.ts +17 -0
- package/src/validators/IntFromNumber.ts +22 -24
- package/src/validators/IntFromPixels.ts +27 -26
- package/src/validators/NonEmptyString.ts +9 -0
- package/src/validators/NonEmptyStringOrNull.ts +22 -0
- package/src/validators/NumberOrNull.ts +5 -0
- package/src/validators/StringFromBoolean.ts +17 -19
- package/src/validators/StringFromNumber.ts +17 -19
- package/src/validators/StringOrNull.ts +4 -2
- package/src/validators/function.ts +71 -0
- package/src/validators/index.ts +12 -0
- package/dist/customtypes/index.d.ts +0 -4
- package/dist/customtypes/widgets/index.d.ts +0 -7
- package/dist/customtypes/widgets/nestable/Image.d.ts +0 -23
- package/dist/customtypes/widgets/nestable/Select.d.ts +0 -15
- package/dist/customtypes/widgets/nestable/index.d.ts +0 -15
- package/dist/customtypes/widgets/shared/index.d.ts +0 -1
- package/dist/customtypes/widgets/slices/index.d.ts +0 -7
- package/dist/index.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/validators/IntFromNumber.d.ts +0 -7
- package/dist/validators/IntFromPixels.d.ts +0 -7
- package/dist/validators/StringFromBoolean.d.ts +0 -7
- package/dist/validators/StringFromNumber.d.ts +0 -7
- package/dist/validators/StringOrNull.d.ts +0 -2
|
@@ -31,10 +31,9 @@ exports.StaticSection = sectionReader(Format_1.Format.Static);
|
|
|
31
31
|
exports.DynamicSection = sectionReader(Format_1.Format.Dynamic);
|
|
32
32
|
exports.Sections = {
|
|
33
33
|
toStatic(dynamic, sharedSlices) {
|
|
34
|
-
const section = Object.entries(dynamic)
|
|
35
|
-
.reduce((acc, [widgetKey, widget]) => {
|
|
34
|
+
const section = Object.entries(dynamic).reduce((acc, [widgetKey, widget]) => {
|
|
36
35
|
return { ...acc, [widgetKey]: Widget_1.Widgets.toStatic(widget, sharedSlices) };
|
|
37
36
|
}, {});
|
|
38
37
|
return section;
|
|
39
|
-
}
|
|
38
|
+
},
|
|
40
39
|
};
|
|
@@ -11,6 +11,9 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
11
|
}) : function(o, v) {
|
|
12
12
|
o["default"] = v;
|
|
13
13
|
});
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
14
17
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
18
|
if (mod && mod.__esModule) return mod;
|
|
16
19
|
var result = {};
|
|
@@ -18,13 +21,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
21
|
__setModuleDefault(result, mod);
|
|
19
22
|
return result;
|
|
20
23
|
};
|
|
21
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
-
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.Widgets = exports.Section = exports.Format = void 0;
|
|
26
|
+
__exportStar(require("./CustomType"), exports);
|
|
26
27
|
var Format_1 = require("./Format");
|
|
27
28
|
Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return Format_1.Format; } });
|
|
28
29
|
exports.Section = __importStar(require("./Section"));
|
|
29
30
|
exports.Widgets = __importStar(require("./widgets"));
|
|
30
|
-
__exportStar(require("./CustomType"), exports);
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import * as t from
|
|
2
|
-
import WidgetTypes from
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import WidgetTypes from "./WidgetTypes";
|
|
3
3
|
declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Group>;
|
|
5
5
|
}>, t.PartialC<{
|
|
6
|
-
fieldset: t.UnionC<[t.
|
|
6
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
7
|
icon: t.StringC;
|
|
8
8
|
description: t.StringC;
|
|
9
9
|
config: t.ExactC<t.PartialC<{
|
|
10
|
-
label: t.UnionC<[t.
|
|
10
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
11
11
|
repeat: t.BooleanC;
|
|
12
12
|
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
13
13
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
14
14
|
}>, t.PartialC<{
|
|
15
|
-
fieldset: t.UnionC<[t.
|
|
15
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
16
16
|
config: t.ExactC<t.PartialC<{
|
|
17
|
-
label: t.UnionC<[t.
|
|
17
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
18
18
|
placeholder: t.StringC;
|
|
19
19
|
}>>;
|
|
20
20
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
21
21
|
type: t.LiteralC<WidgetTypes.BooleanField>;
|
|
22
22
|
}>, t.PartialC<{
|
|
23
23
|
config: t.ExactC<t.PartialC<{
|
|
24
|
-
label: t.UnionC<[t.
|
|
24
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
25
25
|
default_value: t.BooleanC;
|
|
26
26
|
placeholder_true: t.StringC;
|
|
27
27
|
placeholder_false: t.StringC;
|
|
@@ -29,63 +29,63 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
29
29
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
30
30
|
type: t.LiteralC<WidgetTypes.Embed>;
|
|
31
31
|
}>, t.PartialC<{
|
|
32
|
-
fieldset: t.UnionC<[t.
|
|
32
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
33
33
|
config: t.ExactC<t.PartialC<{
|
|
34
|
-
label: t.UnionC<[t.
|
|
34
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
35
35
|
placeholder: t.StringC;
|
|
36
36
|
useAsTitle: t.BooleanC;
|
|
37
37
|
}>>;
|
|
38
38
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
39
39
|
type: t.LiteralC<WidgetTypes.GeoPoint>;
|
|
40
40
|
}>, t.PartialC<{
|
|
41
|
-
fieldset: t.UnionC<[t.
|
|
41
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
42
42
|
config: t.ExactC<t.PartialC<{
|
|
43
|
-
label: t.UnionC<[t.
|
|
43
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
44
44
|
}>>;
|
|
45
45
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
46
46
|
type: t.LiteralC<WidgetTypes.Date>;
|
|
47
47
|
}>, t.PartialC<{
|
|
48
|
-
fieldset: t.UnionC<[t.
|
|
48
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
49
49
|
config: t.ExactC<t.PartialC<{
|
|
50
|
-
label: t.UnionC<[t.
|
|
50
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
51
51
|
placeholder: t.StringC;
|
|
52
52
|
default: t.StringC;
|
|
53
53
|
}>>;
|
|
54
54
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
55
55
|
type: t.LiteralC<WidgetTypes.Number>;
|
|
56
56
|
}>, t.PartialC<{
|
|
57
|
-
fieldset: t.UnionC<[t.
|
|
57
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
58
58
|
config: t.ExactC<t.PartialC<{
|
|
59
|
-
label: t.UnionC<[t.
|
|
59
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
60
60
|
placeholder: t.StringC;
|
|
61
|
-
min: t.UnionC<[t.NumberC, import("io-ts-types
|
|
62
|
-
max: t.UnionC<[t.NumberC, import("io-ts-types
|
|
63
|
-
step: t.UnionC<[t.NumberC, import("io-ts-types
|
|
61
|
+
min: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
62
|
+
max: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
63
|
+
step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
64
64
|
}>>;
|
|
65
65
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
66
66
|
type: t.LiteralC<WidgetTypes.Range>;
|
|
67
67
|
}>, t.PartialC<{
|
|
68
|
-
fieldset: t.UnionC<[t.
|
|
68
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
69
69
|
config: t.ExactC<t.PartialC<{
|
|
70
|
-
label: t.UnionC<[t.
|
|
70
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
71
71
|
placeholder: t.StringC;
|
|
72
|
-
min: t.UnionC<[t.NumberC, import("io-ts-types
|
|
73
|
-
max: t.UnionC<[t.NumberC, import("io-ts-types
|
|
74
|
-
step: t.UnionC<[t.NumberC, import("io-ts-types
|
|
72
|
+
min: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
73
|
+
max: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
74
|
+
step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
75
75
|
}>>;
|
|
76
76
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
77
77
|
type: t.LiteralC<WidgetTypes.RichText>;
|
|
78
78
|
}>, t.PartialC<{
|
|
79
|
-
fieldset: t.UnionC<[t.
|
|
79
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
80
80
|
config: t.ExactC<t.PartialC<{
|
|
81
|
-
label: t.UnionC<[t.
|
|
81
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
82
82
|
placeholder: t.StringC;
|
|
83
83
|
useAsTitle: t.BooleanC;
|
|
84
84
|
single: t.Type<string, string, unknown>;
|
|
85
85
|
multi: t.Type<string, string, unknown>;
|
|
86
86
|
imageConstraint: t.PartialC<{
|
|
87
|
-
width: t.Type<number | null,
|
|
88
|
-
height: t.Type<number | null,
|
|
87
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
88
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
89
89
|
}>;
|
|
90
90
|
labels: t.Type<string[], object, unknown>;
|
|
91
91
|
allowTargetBlank: t.BooleanC;
|
|
@@ -93,43 +93,43 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
93
93
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
94
94
|
type: t.LiteralC<WidgetTypes.Select>;
|
|
95
95
|
}>, t.PartialC<{
|
|
96
|
-
fieldset: t.UnionC<[t.
|
|
96
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
97
97
|
config: t.ExactC<t.PartialC<{
|
|
98
|
-
label: t.UnionC<[t.
|
|
98
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
99
99
|
placeholder: t.StringC;
|
|
100
100
|
default_value: t.StringC;
|
|
101
|
-
options: t.ArrayC<t.UnionC<[t.StringC,
|
|
101
|
+
options: t.ArrayC<t.UnionC<[t.StringC, t.Type<string, string, unknown>, t.Type<string, string, unknown>]>>;
|
|
102
102
|
}>>;
|
|
103
103
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
104
104
|
type: t.LiteralC<WidgetTypes.Separator>;
|
|
105
105
|
}>, t.PartialC<{
|
|
106
106
|
config: t.ExactC<t.PartialC<{
|
|
107
|
-
label: t.UnionC<[t.
|
|
107
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
108
108
|
}>>;
|
|
109
109
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
110
110
|
type: t.LiteralC<WidgetTypes.Text>;
|
|
111
111
|
}>, t.PartialC<{
|
|
112
|
-
fieldset: t.UnionC<[t.
|
|
112
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
113
113
|
config: t.ExactC<t.PartialC<{
|
|
114
|
-
label: t.UnionC<[t.
|
|
114
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
115
115
|
useAsTitle: t.BooleanC;
|
|
116
116
|
placeholder: t.StringC;
|
|
117
117
|
}>>;
|
|
118
118
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
119
119
|
type: t.LiteralC<WidgetTypes.Timestamp>;
|
|
120
120
|
}>, t.PartialC<{
|
|
121
|
-
fieldset: t.UnionC<[t.
|
|
121
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
122
122
|
config: t.ExactC<t.PartialC<{
|
|
123
|
-
label: t.UnionC<[t.
|
|
123
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
124
124
|
placeholder: t.StringC;
|
|
125
125
|
default: t.StringC;
|
|
126
126
|
}>>;
|
|
127
127
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
128
128
|
type: t.LiteralC<WidgetTypes.Link>;
|
|
129
129
|
}>, t.PartialC<{
|
|
130
|
-
fieldset: t.UnionC<[t.
|
|
130
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
131
131
|
config: t.ExactC<t.PartialC<{
|
|
132
|
-
label: t.UnionC<[t.
|
|
132
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
133
133
|
useAsTitle: t.BooleanC;
|
|
134
134
|
placeholder: t.StringC;
|
|
135
135
|
select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
|
|
@@ -141,27 +141,27 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
141
141
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
142
142
|
type: t.LiteralC<WidgetTypes.Image>;
|
|
143
143
|
}>, t.PartialC<{
|
|
144
|
-
fieldset: t.UnionC<[t.
|
|
144
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
145
145
|
config: t.ExactC<t.PartialC<{
|
|
146
|
-
label: t.UnionC<[t.
|
|
146
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
147
147
|
placeholder: t.StringC;
|
|
148
148
|
constraint: t.PartialC<{
|
|
149
|
-
width: t.Type<number | null,
|
|
150
|
-
height: t.Type<number | null,
|
|
149
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
150
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
151
151
|
}>;
|
|
152
152
|
thumbnails: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
153
153
|
name: t.StringC;
|
|
154
154
|
}>, t.PartialC<{
|
|
155
|
-
width: t.Type<number | null,
|
|
156
|
-
height: t.Type<number | null,
|
|
155
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
156
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
157
157
|
}>]>>>;
|
|
158
158
|
}>>;
|
|
159
159
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
160
160
|
type: t.LiteralC<WidgetTypes.IntegrationField>;
|
|
161
161
|
}>, t.PartialC<{
|
|
162
|
-
fieldset: t.UnionC<[t.
|
|
162
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
163
163
|
config: t.ExactC<t.PartialC<{
|
|
164
|
-
label: t.UnionC<[t.
|
|
164
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
165
165
|
placeholder: t.StringC;
|
|
166
166
|
catalog: t.StringC;
|
|
167
167
|
}>>;
|
|
@@ -23,23 +23,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
const t = __importStar(require("io-ts"));
|
|
26
|
-
const
|
|
27
|
-
const WidgetTypes_1 = __importDefault(require("./WidgetTypes"));
|
|
26
|
+
const validators_1 = require("../../validators");
|
|
28
27
|
const NestableWidget_1 = __importDefault(require("./nestable/NestableWidget"));
|
|
28
|
+
const WidgetTypes_1 = __importDefault(require("./WidgetTypes"));
|
|
29
29
|
const GroupConfig = t.exact(t.partial({
|
|
30
|
-
label:
|
|
30
|
+
label: validators_1.StringOrNull,
|
|
31
31
|
repeat: t.boolean,
|
|
32
|
-
fields: t.record(t.string, NestableWidget_1.default)
|
|
32
|
+
fields: t.record(t.string, NestableWidget_1.default),
|
|
33
33
|
}));
|
|
34
34
|
const Group = t.exact(t.intersection([
|
|
35
35
|
t.type({
|
|
36
|
-
type: t.literal(WidgetTypes_1.default.Group)
|
|
36
|
+
type: t.literal(WidgetTypes_1.default.Group),
|
|
37
37
|
}),
|
|
38
38
|
t.partial({
|
|
39
|
-
fieldset:
|
|
39
|
+
fieldset: validators_1.StringOrNull,
|
|
40
40
|
icon: t.string,
|
|
41
41
|
description: t.string,
|
|
42
|
-
config: GroupConfig
|
|
43
|
-
})
|
|
42
|
+
config: GroupConfig,
|
|
43
|
+
}),
|
|
44
44
|
]));
|
|
45
45
|
exports.default = Group;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as t from
|
|
2
|
-
import WidgetTypes from
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import WidgetTypes from "./WidgetTypes";
|
|
3
3
|
declare const UID: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.UID>;
|
|
5
5
|
}>, t.PartialC<{
|
|
6
|
-
fieldset: t.UnionC<[t.
|
|
6
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
7
|
config: t.ExactC<t.PartialC<{
|
|
8
|
-
label: t.UnionC<[t.
|
|
8
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
9
9
|
useAsTitle: t.BooleanC;
|
|
10
10
|
placeholder: t.StringC;
|
|
11
11
|
}>>;
|
|
@@ -23,20 +23,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
const t = __importStar(require("io-ts"));
|
|
26
|
-
const
|
|
26
|
+
const validators_1 = require("../../validators");
|
|
27
27
|
const WidgetTypes_1 = __importDefault(require("./WidgetTypes"));
|
|
28
28
|
const UIDConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
useAsTitle: t.boolean,
|
|
31
|
-
placeholder: t.string
|
|
31
|
+
placeholder: t.string,
|
|
32
32
|
}));
|
|
33
33
|
const UID = t.exact(t.intersection([
|
|
34
34
|
t.type({
|
|
35
|
-
type: t.literal(WidgetTypes_1.default.UID)
|
|
35
|
+
type: t.literal(WidgetTypes_1.default.UID),
|
|
36
36
|
}),
|
|
37
37
|
t.partial({
|
|
38
|
-
fieldset:
|
|
39
|
-
config: UIDConfig
|
|
40
|
-
})
|
|
38
|
+
fieldset: validators_1.StringOrNull,
|
|
39
|
+
config: UIDConfig,
|
|
40
|
+
}),
|
|
41
41
|
]));
|
|
42
42
|
exports.default = UID;
|