@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
|
@@ -24,19 +24,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.Widgets = exports.DynamicWidget = exports.StaticWidget = exports.widgetReader = void 0;
|
|
26
26
|
const t = __importStar(require("io-ts"));
|
|
27
|
-
const UID_1 = __importDefault(require("./UID"));
|
|
28
|
-
const NestableWidget_1 = __importDefault(require("./nestable/NestableWidget"));
|
|
29
|
-
const Slices_1 = require("./slices/Slices");
|
|
30
27
|
const Format_1 = require("../Format");
|
|
31
28
|
const Group_1 = __importDefault(require("./Group"));
|
|
29
|
+
const NestableWidget_1 = __importDefault(require("./nestable/NestableWidget"));
|
|
30
|
+
const Slices_1 = require("./slices/Slices");
|
|
31
|
+
const UID_1 = __importDefault(require("./UID"));
|
|
32
32
|
const WidgetTypes_1 = __importDefault(require("./WidgetTypes"));
|
|
33
33
|
function widgetReader(format) {
|
|
34
|
-
return t.union([
|
|
35
|
-
UID_1.default,
|
|
36
|
-
NestableWidget_1.default,
|
|
37
|
-
Group_1.default,
|
|
38
|
-
(0, Slices_1.slicesReader)(format)
|
|
39
|
-
]);
|
|
34
|
+
return t.union([UID_1.default, NestableWidget_1.default, Group_1.default, (0, Slices_1.slicesReader)(format)]);
|
|
40
35
|
}
|
|
41
36
|
exports.widgetReader = widgetReader;
|
|
42
37
|
exports.StaticWidget = widgetReader(Format_1.Format.Static);
|
|
@@ -44,8 +39,10 @@ exports.DynamicWidget = widgetReader(Format_1.Format.Dynamic);
|
|
|
44
39
|
exports.Widgets = {
|
|
45
40
|
toStatic(widget, sharedSlices) {
|
|
46
41
|
switch (widget.type) {
|
|
47
|
-
case WidgetTypes_1.default.Slices:
|
|
48
|
-
|
|
42
|
+
case WidgetTypes_1.default.Slices:
|
|
43
|
+
return Slices_1.Slices.toStatic(widget, sharedSlices);
|
|
44
|
+
default:
|
|
45
|
+
return widget;
|
|
49
46
|
}
|
|
50
|
-
}
|
|
47
|
+
},
|
|
51
48
|
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Group } from "./Group";
|
|
2
|
+
export * as Nestable from "./nestable";
|
|
3
|
+
export * as Shared from "./shared";
|
|
4
|
+
export * as Slices from "./slices";
|
|
5
|
+
export { default as UID } from "./UID";
|
|
6
|
+
export * as Widget from "./Widget";
|
|
7
|
+
export { default as WidgetTypes } from "./WidgetTypes";
|
|
@@ -22,14 +22,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.WidgetTypes = exports.
|
|
25
|
+
exports.WidgetTypes = exports.Widget = exports.UID = exports.Slices = exports.Shared = exports.Nestable = exports.Group = void 0;
|
|
26
|
+
var Group_1 = require("./Group");
|
|
27
|
+
Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return __importDefault(Group_1).default; } });
|
|
26
28
|
exports.Nestable = __importStar(require("./nestable"));
|
|
27
29
|
exports.Shared = __importStar(require("./shared"));
|
|
28
30
|
exports.Slices = __importStar(require("./slices"));
|
|
29
|
-
exports.Widget = __importStar(require("./Widget"));
|
|
30
|
-
var Group_1 = require("./Group");
|
|
31
|
-
Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return __importDefault(Group_1).default; } });
|
|
32
31
|
var UID_1 = require("./UID");
|
|
33
32
|
Object.defineProperty(exports, "UID", { enumerable: true, get: function () { return __importDefault(UID_1).default; } });
|
|
33
|
+
exports.Widget = __importStar(require("./Widget"));
|
|
34
34
|
var WidgetTypes_1 = require("./WidgetTypes");
|
|
35
35
|
Object.defineProperty(exports, "WidgetTypes", { enumerable: true, get: function () { return __importDefault(WidgetTypes_1).default; } });
|
|
@@ -1,10 +1,10 @@
|
|
|
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 BooleanField: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.BooleanField>;
|
|
5
5
|
}>, t.PartialC<{
|
|
6
6
|
config: t.ExactC<t.PartialC<{
|
|
7
|
-
label: t.UnionC<[t.
|
|
7
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
8
8
|
default_value: t.BooleanC;
|
|
9
9
|
placeholder_true: t.StringC;
|
|
10
10
|
placeholder_false: t.StringC;
|
|
@@ -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 BooleanConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
default_value: t.boolean,
|
|
31
31
|
placeholder_true: t.string,
|
|
32
|
-
placeholder_false: t.string
|
|
32
|
+
placeholder_false: t.string,
|
|
33
33
|
}));
|
|
34
34
|
const BooleanField = t.exact(t.intersection([
|
|
35
35
|
t.type({
|
|
36
|
-
type: t.literal(WidgetTypes_1.default.BooleanField)
|
|
36
|
+
type: t.literal(WidgetTypes_1.default.BooleanField),
|
|
37
37
|
}),
|
|
38
38
|
t.partial({
|
|
39
|
-
config: BooleanConfig
|
|
40
|
-
})
|
|
39
|
+
config: BooleanConfig,
|
|
40
|
+
}),
|
|
41
41
|
]));
|
|
42
42
|
exports.default = BooleanField;
|
|
@@ -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 Color: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
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
|
placeholder: t.StringC;
|
|
10
10
|
}>>;
|
|
11
11
|
}>]>>;
|
|
@@ -23,19 +23,19 @@ 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 ColorConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
placeholder: t.string,
|
|
31
31
|
}));
|
|
32
32
|
const Color = t.exact(t.intersection([
|
|
33
33
|
t.type({
|
|
34
|
-
type: t.literal(WidgetTypes_1.default.Color)
|
|
34
|
+
type: t.literal(WidgetTypes_1.default.Color),
|
|
35
35
|
}),
|
|
36
36
|
t.partial({
|
|
37
|
-
fieldset:
|
|
38
|
-
config: ColorConfig
|
|
39
|
-
})
|
|
37
|
+
fieldset: validators_1.StringOrNull,
|
|
38
|
+
config: ColorConfig,
|
|
39
|
+
}),
|
|
40
40
|
]));
|
|
41
41
|
exports.default = Color;
|
|
@@ -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 Date: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Date>;
|
|
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
|
placeholder: t.StringC;
|
|
10
10
|
default: 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 DateConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
placeholder: t.string,
|
|
31
|
-
default: t.string
|
|
31
|
+
default: t.string,
|
|
32
32
|
}));
|
|
33
33
|
const Date = t.exact(t.intersection([
|
|
34
34
|
t.type({
|
|
35
|
-
type: t.literal(WidgetTypes_1.default.Date)
|
|
35
|
+
type: t.literal(WidgetTypes_1.default.Date),
|
|
36
36
|
}),
|
|
37
37
|
t.partial({
|
|
38
|
-
fieldset:
|
|
39
|
-
config: DateConfig
|
|
40
|
-
})
|
|
38
|
+
fieldset: validators_1.StringOrNull,
|
|
39
|
+
config: DateConfig,
|
|
40
|
+
}),
|
|
41
41
|
]));
|
|
42
42
|
exports.default = Date;
|
|
@@ -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 Embed: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Embed>;
|
|
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
|
placeholder: t.StringC;
|
|
10
10
|
useAsTitle: t.BooleanC;
|
|
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 EmbedConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
placeholder: t.string,
|
|
31
|
-
useAsTitle: t.boolean
|
|
31
|
+
useAsTitle: t.boolean,
|
|
32
32
|
}));
|
|
33
33
|
const Embed = t.exact(t.intersection([
|
|
34
34
|
t.type({
|
|
35
|
-
type: t.literal(WidgetTypes_1.default.Embed)
|
|
35
|
+
type: t.literal(WidgetTypes_1.default.Embed),
|
|
36
36
|
}),
|
|
37
37
|
t.partial({
|
|
38
|
-
fieldset:
|
|
39
|
-
config: EmbedConfig
|
|
40
|
-
})
|
|
38
|
+
fieldset: validators_1.StringOrNull,
|
|
39
|
+
config: EmbedConfig,
|
|
40
|
+
}),
|
|
41
41
|
]));
|
|
42
42
|
exports.default = Embed;
|
|
@@ -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 GeoPoint: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.GeoPoint>;
|
|
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
|
}>>;
|
|
10
10
|
}>]>>;
|
|
11
11
|
declare type GeoPoint = t.TypeOf<typeof GeoPoint>;
|
|
@@ -23,18 +23,18 @@ 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 GeoPointConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
}));
|
|
31
31
|
const GeoPoint = t.exact(t.intersection([
|
|
32
32
|
t.type({
|
|
33
|
-
type: t.literal(WidgetTypes_1.default.GeoPoint)
|
|
33
|
+
type: t.literal(WidgetTypes_1.default.GeoPoint),
|
|
34
34
|
}),
|
|
35
35
|
t.partial({
|
|
36
|
-
fieldset:
|
|
37
|
-
config: GeoPointConfig
|
|
38
|
-
})
|
|
36
|
+
fieldset: validators_1.StringOrNull,
|
|
37
|
+
config: GeoPointConfig,
|
|
38
|
+
}),
|
|
39
39
|
]));
|
|
40
40
|
exports.default = GeoPoint;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import WidgetTypes from "../WidgetTypes";
|
|
3
|
+
declare const Image: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
+
type: t.LiteralC<WidgetTypes.Image>;
|
|
5
|
+
}>, t.PartialC<{
|
|
6
|
+
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
|
+
config: t.ExactC<t.PartialC<{
|
|
8
|
+
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
9
|
+
placeholder: t.StringC;
|
|
10
|
+
constraint: t.PartialC<{
|
|
11
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
12
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
13
|
+
}>;
|
|
14
|
+
thumbnails: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
15
|
+
name: t.StringC;
|
|
16
|
+
}>, t.PartialC<{
|
|
17
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
18
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
19
|
+
}>]>>>;
|
|
20
|
+
}>>;
|
|
21
|
+
}>]>>;
|
|
22
|
+
declare type Image = t.TypeOf<typeof Image>;
|
|
23
|
+
export default Image;
|
|
@@ -23,28 +23,28 @@ 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 ImageConstraint_1 = __importDefault(require("../shared/ImageConstraint"));
|
|
28
|
+
const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
|
|
29
29
|
const Thumbnail = t.exact(t.intersection([
|
|
30
30
|
t.type({
|
|
31
|
-
name: t.string
|
|
31
|
+
name: t.string,
|
|
32
32
|
}),
|
|
33
|
-
ImageConstraint_1.default
|
|
33
|
+
ImageConstraint_1.default,
|
|
34
34
|
]));
|
|
35
35
|
const ImageConfig = t.exact(t.partial({
|
|
36
|
-
label:
|
|
36
|
+
label: validators_1.StringOrNull,
|
|
37
37
|
placeholder: t.string,
|
|
38
38
|
constraint: ImageConstraint_1.default,
|
|
39
|
-
thumbnails: t.array(Thumbnail)
|
|
39
|
+
thumbnails: t.array(Thumbnail),
|
|
40
40
|
}));
|
|
41
41
|
const Image = t.exact(t.intersection([
|
|
42
42
|
t.type({
|
|
43
|
-
type: t.literal(WidgetTypes_1.default.Image)
|
|
43
|
+
type: t.literal(WidgetTypes_1.default.Image),
|
|
44
44
|
}),
|
|
45
45
|
t.partial({
|
|
46
|
-
fieldset:
|
|
47
|
-
config: ImageConfig
|
|
48
|
-
})
|
|
46
|
+
fieldset: validators_1.StringOrNull,
|
|
47
|
+
config: ImageConfig,
|
|
48
|
+
}),
|
|
49
49
|
]));
|
|
50
50
|
exports.default = Image;
|
|
@@ -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 IntegrationField: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.IntegrationField>;
|
|
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
|
placeholder: t.StringC;
|
|
10
10
|
catalog: 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 IntegrationFieldConfig = t.exact(t.partial({
|
|
29
|
-
label:
|
|
29
|
+
label: validators_1.StringOrNull,
|
|
30
30
|
placeholder: t.string,
|
|
31
|
-
catalog: t.string
|
|
31
|
+
catalog: t.string,
|
|
32
32
|
}));
|
|
33
33
|
const IntegrationField = t.exact(t.intersection([
|
|
34
34
|
t.type({
|
|
35
|
-
type: t.literal(WidgetTypes_1.default.IntegrationField)
|
|
35
|
+
type: t.literal(WidgetTypes_1.default.IntegrationField),
|
|
36
36
|
}),
|
|
37
37
|
t.partial({
|
|
38
|
-
fieldset:
|
|
39
|
-
config: IntegrationFieldConfig
|
|
40
|
-
})
|
|
38
|
+
fieldset: validators_1.StringOrNull,
|
|
39
|
+
config: IntegrationFieldConfig,
|
|
40
|
+
}),
|
|
41
41
|
]));
|
|
42
42
|
exports.default = IntegrationField;
|
|
@@ -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 Link: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Link>;
|
|
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
|
select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
|
|
@@ -22,57 +22,52 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
25
26
|
const t = __importStar(require("io-ts"));
|
|
26
27
|
const withFallback_1 = require("io-ts-types/lib/withFallback");
|
|
27
|
-
const
|
|
28
|
-
const StringOrNull_1 = require("../../../validators/StringOrNull");
|
|
28
|
+
const validators_1 = require("../../../validators");
|
|
29
29
|
const WidgetTypes_1 = __importDefault(require("../WidgetTypes"));
|
|
30
30
|
const arrayString = (entries) => {
|
|
31
31
|
if (entries instanceof Array) {
|
|
32
|
-
const isValidEntries = entries.reduce((acc, l) => acc && typeof l ===
|
|
32
|
+
const isValidEntries = entries.reduce((acc, l) => acc && typeof l === "string", true);
|
|
33
33
|
if (isValidEntries)
|
|
34
34
|
return t.success(entries);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
const plainString = (entries) => {
|
|
38
|
-
if (typeof entries ===
|
|
38
|
+
if (typeof entries === "string") {
|
|
39
39
|
return t.success([entries]);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
const MasksArrayString = new t.Type(
|
|
42
|
+
const MasksArrayString = new t.Type("MasksArrayString", (u) => {
|
|
43
43
|
return u instanceof Array;
|
|
44
44
|
}, (u, context) => {
|
|
45
|
-
return Either_1.either.chain(t.union([
|
|
46
|
-
t.
|
|
47
|
-
t.string,
|
|
48
|
-
]).validate(u, context), (masks) => {
|
|
49
|
-
return (arrayString(masks) ||
|
|
50
|
-
plainString(masks) ||
|
|
51
|
-
t.failure(u, context));
|
|
45
|
+
return Either_1.either.chain(t.union([t.array(t.string), t.string]).validate(u, context), (masks) => {
|
|
46
|
+
return arrayString(masks) || plainString(masks) || t.failure(u, context);
|
|
52
47
|
});
|
|
53
|
-
}, res => res);
|
|
48
|
+
}, (res) => res);
|
|
54
49
|
const LinkConfig = t.exact(t.partial({
|
|
55
|
-
label:
|
|
50
|
+
label: validators_1.StringOrNull,
|
|
56
51
|
useAsTitle: t.boolean,
|
|
57
52
|
placeholder: t.string,
|
|
58
53
|
select: (0, withFallback_1.withFallback)(t.union([
|
|
59
|
-
t.literal(
|
|
60
|
-
t.literal(
|
|
61
|
-
t.literal(
|
|
62
|
-
t.null
|
|
54
|
+
t.literal("media"),
|
|
55
|
+
t.literal("document"),
|
|
56
|
+
t.literal("web"),
|
|
57
|
+
t.null,
|
|
63
58
|
]), null),
|
|
64
59
|
customtypes: t.array(t.string),
|
|
65
60
|
masks: MasksArrayString,
|
|
66
61
|
tags: MasksArrayString,
|
|
67
|
-
allowTargetBlank: t.boolean
|
|
62
|
+
allowTargetBlank: t.boolean,
|
|
68
63
|
}));
|
|
69
64
|
const Link = t.exact(t.intersection([
|
|
70
65
|
t.type({
|
|
71
|
-
type: t.literal(WidgetTypes_1.default.Link)
|
|
66
|
+
type: t.literal(WidgetTypes_1.default.Link),
|
|
72
67
|
}),
|
|
73
68
|
t.partial({
|
|
74
|
-
fieldset:
|
|
75
|
-
config: LinkConfig
|
|
76
|
-
})
|
|
69
|
+
fieldset: validators_1.StringOrNull,
|
|
70
|
+
config: LinkConfig,
|
|
71
|
+
}),
|
|
77
72
|
]));
|
|
78
73
|
exports.default = Link;
|