@prismicio/types-internal 0.1.1 → 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/README.md +13 -13
- package/{dist → lib}/customtypes/CustomType.d.ts +697 -715
- package/{dist → lib}/customtypes/CustomType.js +42 -52
- package/{dist → lib}/customtypes/Format.d.ts +0 -0
- package/{dist → lib}/customtypes/Format.js +0 -0
- package/{dist → lib}/customtypes/Section.d.ts +1035 -1062
- package/lib/customtypes/Section.js +21 -0
- package/lib/customtypes/index.d.ts +4 -0
- package/lib/customtypes/index.js +9 -0
- package/{dist → lib}/customtypes/widgets/Group.d.ts +45 -45
- package/lib/customtypes/widgets/Group.js +24 -0
- package/{dist → lib}/customtypes/widgets/UID.d.ts +4 -4
- package/lib/customtypes/widgets/UID.js +21 -0
- package/{dist → lib}/customtypes/widgets/Widget.d.ts +1036 -1063
- package/lib/customtypes/widgets/Widget.js +27 -0
- 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/lib/customtypes/widgets/index.js +14 -0
- package/{dist → lib}/customtypes/widgets/nestable/BooleanField.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/BooleanField.js +21 -0
- package/{dist → lib}/customtypes/widgets/nestable/Color.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Color.js +20 -0
- package/{dist → lib}/customtypes/widgets/nestable/Date.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Date.js +21 -0
- package/{dist → lib}/customtypes/widgets/nestable/Embed.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Embed.js +21 -0
- package/{dist → lib}/customtypes/widgets/nestable/GeoPoint.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/GeoPoint.js +19 -0
- package/lib/customtypes/widgets/nestable/Image.d.ts +23 -0
- package/lib/customtypes/widgets/nestable/Image.js +29 -0
- package/{dist → lib}/customtypes/widgets/nestable/IntegrationField.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/IntegrationField.js +21 -0
- package/{dist → lib}/customtypes/widgets/nestable/Link.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Link.js +54 -0
- package/{dist → lib}/customtypes/widgets/nestable/NestableWidget.d.ts +42 -42
- package/lib/customtypes/widgets/nestable/NestableWidget.js +37 -0
- package/{dist → lib}/customtypes/widgets/nestable/Number.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Number.js +24 -0
- package/{dist → lib}/customtypes/widgets/nestable/Range.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Range.js +24 -0
- package/{dist → lib}/customtypes/widgets/nestable/RichText.d.ts +6 -6
- package/lib/customtypes/widgets/nestable/RichText.js +111 -0
- package/lib/customtypes/widgets/nestable/Select.d.ts +15 -0
- package/lib/customtypes/widgets/nestable/Select.js +22 -0
- package/{dist → lib}/customtypes/widgets/nestable/Separator.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/Separator.js +18 -0
- package/{dist → lib}/customtypes/widgets/nestable/Text.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Text.js +21 -0
- package/{dist → lib}/customtypes/widgets/nestable/Timestamp.d.ts +4 -4
- package/lib/customtypes/widgets/nestable/Timestamp.js +21 -0
- 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/lib/customtypes/widgets/shared/ImageConstraint.js +31 -0
- 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/lib/customtypes/widgets/slices/CompositeSlice.js +25 -0
- package/{dist → lib}/customtypes/widgets/slices/LegacySlice.d.ts +86 -95
- package/lib/customtypes/widgets/slices/LegacySlice.js +8 -0
- package/{dist → lib}/customtypes/widgets/slices/SharedSlice.d.ts +84 -84
- package/lib/customtypes/widgets/slices/SharedSlice.js +35 -0
- package/{dist → lib}/customtypes/widgets/slices/SharedSliceRef.d.ts +2 -2
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +9 -0
- package/lib/customtypes/widgets/slices/Slice.d.ts +6 -0
- package/{dist → lib}/customtypes/widgets/slices/Slice.js +0 -0
- package/{dist → lib}/customtypes/widgets/slices/Slices.d.ts +1550 -1604
- package/lib/customtypes/widgets/slices/Slices.js +93 -0
- 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/lib/customtypes/widgets/slices/index.js +16 -0
- package/lib/documents/DocumentData.d.ts +8 -0
- package/lib/documents/DocumentData.js +28 -0
- package/lib/documents/index.d.ts +2 -0
- package/lib/documents/index.js +7 -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 +59 -0
- package/lib/documents/widgets/SimpleWidgetContent.d.ts +20 -0
- package/lib/documents/widgets/SimpleWidgetContent.js +75 -0
- package/lib/documents/widgets/StaticWidgetContent.d.ts +10 -0
- package/lib/documents/widgets/StaticWidgetContent.js +26 -0
- package/lib/documents/widgets/UIDContent.d.ts +7 -0
- package/lib/documents/widgets/UIDContent.js +10 -0
- package/lib/documents/widgets/index.d.ts +35 -0
- package/lib/documents/widgets/index.js +36 -0
- package/lib/documents/widgets/nestable/BooleanContent.d.ts +8 -0
- package/lib/documents/widgets/nestable/BooleanContent.js +11 -0
- package/lib/documents/widgets/nestable/EmbedContent.d.ts +40 -0
- package/lib/documents/widgets/nestable/EmbedContent.js +36 -0
- package/lib/documents/widgets/nestable/FieldContent.d.ts +12 -0
- package/lib/documents/widgets/nestable/FieldContent.js +37 -0
- package/lib/documents/widgets/nestable/GeoPointContent.d.ts +17 -0
- package/lib/documents/widgets/nestable/GeoPointContent.js +13 -0
- package/lib/documents/widgets/nestable/ImageContent.d.ts +127 -0
- package/lib/documents/widgets/nestable/ImageContent.js +41 -0
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +8 -0
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +16 -0
- package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +12 -0
- package/lib/documents/widgets/nestable/Link/DocumentLink.js +13 -0
- package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +24 -0
- package/lib/documents/widgets/nestable/Link/ExternalLink.js +24 -0
- package/lib/documents/widgets/nestable/Link/FileLink.d.ts +22 -0
- package/lib/documents/widgets/nestable/Link/FileLink.js +24 -0
- package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +28 -0
- package/lib/documents/widgets/nestable/Link/ImageLink.js +26 -0
- package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +36 -0
- package/lib/documents/widgets/nestable/Link/LinkContent.js +13 -0
- package/lib/documents/widgets/nestable/Link/index.d.ts +89 -0
- package/lib/documents/widgets/nestable/Link/index.js +35 -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 +97 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +9 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/index.js +14 -0
- package/lib/documents/widgets/nestable/index.d.ts +26 -0
- package/lib/documents/widgets/nestable/index.js +40 -0
- package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +14 -0
- package/lib/documents/widgets/slices/CompositeSliceContent.js +50 -0
- package/lib/documents/widgets/slices/SharedSliceContent.d.ts +15 -0
- package/lib/documents/widgets/slices/SharedSliceContent.js +62 -0
- package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +6 -0
- package/lib/documents/widgets/slices/SimpleSliceContent.js +6 -0
- package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +8 -0
- package/lib/documents/widgets/slices/SliceWidgetContent.js +26 -0
- package/lib/documents/widgets/slices/SlicesContent.d.ts +17 -0
- package/lib/documents/widgets/slices/SlicesContent.js +51 -0
- package/lib/documents/widgets/slices/index.d.ts +5 -0
- package/lib/documents/widgets/slices/index.js +8 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +7 -0
- package/lib/validators/DateFromString.d.ts +3 -0
- package/lib/validators/DateFromString.js +10 -0
- package/lib/validators/DateFromStringOrNumber.d.ts +3 -0
- package/lib/validators/DateFromStringOrNumber.js +10 -0
- package/lib/validators/DateFromTsMs.d.ts +3 -0
- package/lib/validators/DateFromTsMs.js +10 -0
- package/lib/validators/IntFromNumber.d.ts +5 -0
- package/lib/validators/IntFromNumber.js +14 -0
- package/lib/validators/IntFromPixels.d.ts +8 -0
- package/lib/validators/IntFromPixels.js +24 -0
- package/lib/validators/NonEmptyString.d.ts +3 -0
- package/lib/validators/NonEmptyString.js +6 -0
- package/lib/validators/NonEmptyStringOrNull.d.ts +3 -0
- package/lib/validators/NonEmptyStringOrNull.js +15 -0
- package/lib/validators/NumberOrNull.d.ts +3 -0
- package/lib/validators/NumberOrNull.js +6 -0
- package/lib/validators/StringFromBoolean.d.ts +5 -0
- package/lib/validators/StringFromBoolean.js +10 -0
- package/lib/validators/StringFromNumber.d.ts +5 -0
- package/lib/validators/StringFromNumber.js +10 -0
- package/lib/validators/StringOrNull.d.ts +3 -0
- package/lib/validators/StringOrNull.js +6 -0
- package/lib/validators/function.d.ts +14 -0
- package/lib/validators/function.js +60 -0
- package/lib/validators/index.d.ts +12 -0
- package/lib/validators/index.js +27 -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 +5 -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/Section.js +0 -40
- package/dist/customtypes/index.d.ts +0 -4
- package/dist/customtypes/index.js +0 -30
- package/dist/customtypes/widgets/Group.js +0 -45
- package/dist/customtypes/widgets/UID.js +0 -42
- package/dist/customtypes/widgets/Widget.js +0 -51
- package/dist/customtypes/widgets/index.d.ts +0 -7
- package/dist/customtypes/widgets/index.js +0 -35
- package/dist/customtypes/widgets/nestable/BooleanField.js +0 -42
- package/dist/customtypes/widgets/nestable/Color.js +0 -41
- package/dist/customtypes/widgets/nestable/Date.js +0 -42
- package/dist/customtypes/widgets/nestable/Embed.js +0 -42
- package/dist/customtypes/widgets/nestable/GeoPoint.js +0 -40
- package/dist/customtypes/widgets/nestable/Image.d.ts +0 -23
- package/dist/customtypes/widgets/nestable/Image.js +0 -50
- package/dist/customtypes/widgets/nestable/IntegrationField.js +0 -42
- package/dist/customtypes/widgets/nestable/Link.js +0 -78
- package/dist/customtypes/widgets/nestable/NestableWidget.js +0 -58
- package/dist/customtypes/widgets/nestable/Number.js +0 -45
- package/dist/customtypes/widgets/nestable/Range.js +0 -45
- package/dist/customtypes/widgets/nestable/RichText.js +0 -134
- package/dist/customtypes/widgets/nestable/Select.d.ts +0 -15
- package/dist/customtypes/widgets/nestable/Select.js +0 -45
- package/dist/customtypes/widgets/nestable/Separator.js +0 -39
- package/dist/customtypes/widgets/nestable/Text.js +0 -42
- package/dist/customtypes/widgets/nestable/Timestamp.js +0 -42
- package/dist/customtypes/widgets/nestable/index.d.ts +0 -15
- package/dist/customtypes/widgets/shared/ImageConstraint.js +0 -48
- package/dist/customtypes/widgets/shared/index.d.ts +0 -1
- package/dist/customtypes/widgets/slices/CompositeSlice.js +0 -46
- package/dist/customtypes/widgets/slices/LegacySlice.js +0 -34
- package/dist/customtypes/widgets/slices/SharedSlice.js +0 -56
- package/dist/customtypes/widgets/slices/SharedSliceRef.js +0 -30
- package/dist/customtypes/widgets/slices/Slice.d.ts +0 -6
- package/dist/customtypes/widgets/slices/Slices.js +0 -106
- package/dist/customtypes/widgets/slices/index.d.ts +0 -7
- package/dist/customtypes/widgets/slices/index.js +0 -37
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
- package/dist/validators/IntFromNumber.d.ts +0 -7
- package/dist/validators/IntFromNumber.js +0 -35
- package/dist/validators/IntFromPixels.d.ts +0 -7
- package/dist/validators/IntFromPixels.js +0 -43
- package/dist/validators/StringFromBoolean.d.ts +0 -7
- package/dist/validators/StringFromBoolean.js +0 -31
- package/dist/validators/StringFromNumber.d.ts +0 -7
- package/dist/validators/StringFromNumber.js +0 -31
- package/dist/validators/StringOrNull.d.ts +0 -2
- package/dist/validators/StringOrNull.js +0 -24
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sections = exports.DynamicSection = exports.StaticSection = exports.sectionReader = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const Format_1 = require("./Format");
|
|
7
|
+
const Widget_1 = require("./widgets/Widget");
|
|
8
|
+
function sectionReader(format) {
|
|
9
|
+
return t.record(t.string, (0, Widget_1.widgetReader)(format));
|
|
10
|
+
}
|
|
11
|
+
exports.sectionReader = sectionReader;
|
|
12
|
+
exports.StaticSection = sectionReader(Format_1.Format.Static);
|
|
13
|
+
exports.DynamicSection = sectionReader(Format_1.Format.Dynamic);
|
|
14
|
+
exports.Sections = {
|
|
15
|
+
toStatic(dynamic, sharedSlices) {
|
|
16
|
+
const section = Object.entries(dynamic).reduce((acc, [widgetKey, widget]) => {
|
|
17
|
+
return { ...acc, [widgetKey]: Widget_1.Widgets.toStatic(widget, sharedSlices) };
|
|
18
|
+
}, {});
|
|
19
|
+
return section;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Widgets = exports.Section = exports.Format = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./CustomType"), exports);
|
|
6
|
+
var Format_1 = require("./Format");
|
|
7
|
+
Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return Format_1.Format; } });
|
|
8
|
+
exports.Section = (0, tslib_1.__importStar)(require("./Section"));
|
|
9
|
+
exports.Widgets = (0, tslib_1.__importStar)(require("./widgets"));
|
|
@@ -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
|
}>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 WidgetTypes_1 = (0, tslib_1.__importDefault)(require("./WidgetTypes"));
|
|
8
|
+
const GroupConfig = t.exact(t.partial({
|
|
9
|
+
label: validators_1.StringOrNull,
|
|
10
|
+
repeat: t.boolean,
|
|
11
|
+
fields: t.record(t.string, NestableWidget_1.default),
|
|
12
|
+
}));
|
|
13
|
+
const Group = t.exact(t.intersection([
|
|
14
|
+
t.type({
|
|
15
|
+
type: t.literal(WidgetTypes_1.default.Group),
|
|
16
|
+
}),
|
|
17
|
+
t.partial({
|
|
18
|
+
fieldset: validators_1.StringOrNull,
|
|
19
|
+
icon: t.string,
|
|
20
|
+
description: t.string,
|
|
21
|
+
config: GroupConfig,
|
|
22
|
+
}),
|
|
23
|
+
]));
|
|
24
|
+
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
|
}>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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"));
|
|
7
|
+
const UIDConfig = t.exact(t.partial({
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
9
|
+
useAsTitle: t.boolean,
|
|
10
|
+
placeholder: t.string,
|
|
11
|
+
}));
|
|
12
|
+
const UID = t.exact(t.intersection([
|
|
13
|
+
t.type({
|
|
14
|
+
type: t.literal(WidgetTypes_1.default.UID),
|
|
15
|
+
}),
|
|
16
|
+
t.partial({
|
|
17
|
+
fieldset: validators_1.StringOrNull,
|
|
18
|
+
config: UIDConfig,
|
|
19
|
+
}),
|
|
20
|
+
]));
|
|
21
|
+
exports.default = UID;
|