@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,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
|
+
const BooleanField_1 = (0, tslib_1.__importDefault)(require("./BooleanField"));
|
|
6
|
+
const Color_1 = (0, tslib_1.__importDefault)(require("./Color"));
|
|
7
|
+
const Date_1 = (0, tslib_1.__importDefault)(require("./Date"));
|
|
8
|
+
const Embed_1 = (0, tslib_1.__importDefault)(require("./Embed"));
|
|
9
|
+
const GeoPoint_1 = (0, tslib_1.__importDefault)(require("./GeoPoint"));
|
|
10
|
+
const Image_1 = (0, tslib_1.__importDefault)(require("./Image"));
|
|
11
|
+
const IntegrationField_1 = (0, tslib_1.__importDefault)(require("./IntegrationField"));
|
|
12
|
+
const Link_1 = (0, tslib_1.__importDefault)(require("./Link"));
|
|
13
|
+
const Number_1 = (0, tslib_1.__importDefault)(require("./Number"));
|
|
14
|
+
const Range_1 = (0, tslib_1.__importDefault)(require("./Range"));
|
|
15
|
+
const RichText_1 = (0, tslib_1.__importDefault)(require("./RichText"));
|
|
16
|
+
const Select_1 = (0, tslib_1.__importDefault)(require("./Select"));
|
|
17
|
+
const Separator_1 = (0, tslib_1.__importDefault)(require("./Separator"));
|
|
18
|
+
const Text_1 = (0, tslib_1.__importDefault)(require("./Text"));
|
|
19
|
+
const Timestamp_1 = (0, tslib_1.__importDefault)(require("./Timestamp"));
|
|
20
|
+
const NestableWidget = t.union([
|
|
21
|
+
Color_1.default,
|
|
22
|
+
BooleanField_1.default,
|
|
23
|
+
Embed_1.default,
|
|
24
|
+
GeoPoint_1.default,
|
|
25
|
+
Date_1.default,
|
|
26
|
+
Number_1.default,
|
|
27
|
+
Range_1.default,
|
|
28
|
+
RichText_1.default,
|
|
29
|
+
Select_1.default,
|
|
30
|
+
Separator_1.default,
|
|
31
|
+
Text_1.default,
|
|
32
|
+
Timestamp_1.default,
|
|
33
|
+
Link_1.default,
|
|
34
|
+
Image_1.default,
|
|
35
|
+
IntegrationField_1.default,
|
|
36
|
+
]);
|
|
37
|
+
exports.default = NestableWidget;
|
|
@@ -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 Number: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Number>;
|
|
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
|
min: t.UnionC<[t.NumberC, import("io-ts-types/lib/NumberFromString").NumberFromStringC]>;
|
|
11
11
|
max: t.UnionC<[t.NumberC, import("io-ts-types/lib/NumberFromString").NumberFromStringC]>;
|
|
@@ -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 NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
|
|
6
|
+
const validators_1 = require("../../../validators");
|
|
7
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
8
|
+
const NumberConfig = t.exact(t.partial({
|
|
9
|
+
label: validators_1.StringOrNull,
|
|
10
|
+
placeholder: t.string,
|
|
11
|
+
min: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
12
|
+
max: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
13
|
+
step: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
14
|
+
}));
|
|
15
|
+
const Number = t.exact(t.intersection([
|
|
16
|
+
t.type({
|
|
17
|
+
type: t.literal(WidgetTypes_1.default.Number),
|
|
18
|
+
}),
|
|
19
|
+
t.partial({
|
|
20
|
+
fieldset: validators_1.StringOrNull,
|
|
21
|
+
config: NumberConfig,
|
|
22
|
+
}),
|
|
23
|
+
]));
|
|
24
|
+
exports.default = Number;
|
|
@@ -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 Range: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Range>;
|
|
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
|
min: t.UnionC<[t.NumberC, import("io-ts-types/lib/NumberFromString").NumberFromStringC]>;
|
|
11
11
|
max: t.UnionC<[t.NumberC, import("io-ts-types/lib/NumberFromString").NumberFromStringC]>;
|
|
@@ -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 NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
|
|
6
|
+
const validators_1 = require("../../../validators");
|
|
7
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
8
|
+
const RangeConfig = t.exact(t.partial({
|
|
9
|
+
label: validators_1.StringOrNull,
|
|
10
|
+
placeholder: t.string,
|
|
11
|
+
min: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
12
|
+
max: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
13
|
+
step: t.union([t.number, NumberFromString_1.NumberFromString]),
|
|
14
|
+
}));
|
|
15
|
+
const Range = t.exact(t.intersection([
|
|
16
|
+
t.type({
|
|
17
|
+
type: t.literal(WidgetTypes_1.default.Range),
|
|
18
|
+
}),
|
|
19
|
+
t.partial({
|
|
20
|
+
fieldset: validators_1.StringOrNull,
|
|
21
|
+
config: RangeConfig,
|
|
22
|
+
}),
|
|
23
|
+
]));
|
|
24
|
+
exports.default = Range;
|
|
@@ -1,18 +1,18 @@
|
|
|
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 RichText: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.RichText>;
|
|
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
|
single: t.Type<string, string, unknown>;
|
|
12
12
|
multi: t.Type<string, string, unknown>;
|
|
13
13
|
imageConstraint: t.PartialC<{
|
|
14
|
-
width: t.Type<number | null,
|
|
15
|
-
height: t.Type<number | null,
|
|
14
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
15
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
16
16
|
}>;
|
|
17
17
|
labels: t.Type<string[], object, unknown>;
|
|
18
18
|
allowTargetBlank: t.BooleanC;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const validators_1 = require("../../../validators");
|
|
7
|
+
const ImageConstraint_1 = (0, tslib_1.__importDefault)(require("../shared/ImageConstraint"));
|
|
8
|
+
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
9
|
+
const DEFAULT_OPTION = "paragraph";
|
|
10
|
+
const options = [
|
|
11
|
+
"heading1",
|
|
12
|
+
"heading2",
|
|
13
|
+
"heading3",
|
|
14
|
+
"heading4",
|
|
15
|
+
"heading5",
|
|
16
|
+
"heading6",
|
|
17
|
+
"paragraph",
|
|
18
|
+
"strong",
|
|
19
|
+
"em",
|
|
20
|
+
"preformatted",
|
|
21
|
+
"hyperlink",
|
|
22
|
+
"image",
|
|
23
|
+
"embed",
|
|
24
|
+
"list-item",
|
|
25
|
+
"o-list-item",
|
|
26
|
+
"rtl",
|
|
27
|
+
];
|
|
28
|
+
const RichTextOptions = new t.Type("RichTextOptions", (u) => typeof u === "string", (u, context) => {
|
|
29
|
+
return Either_1.either.chain(t.union([t.string, t.null]).validate(u, context), (s) => {
|
|
30
|
+
if (!s)
|
|
31
|
+
return t.success(DEFAULT_OPTION);
|
|
32
|
+
const entries = s.split(",").map((e) => e.trim());
|
|
33
|
+
const filtered = entries.filter((entry) => options.includes(entry));
|
|
34
|
+
if (!filtered.length)
|
|
35
|
+
return t.success(DEFAULT_OPTION);
|
|
36
|
+
return t.success(filtered.join(","));
|
|
37
|
+
});
|
|
38
|
+
}, (a) => a);
|
|
39
|
+
const NoLabels = (labels) => {
|
|
40
|
+
if (!labels)
|
|
41
|
+
return t.success([]);
|
|
42
|
+
return;
|
|
43
|
+
};
|
|
44
|
+
const LabelsAsObject = (labels) => {
|
|
45
|
+
if (labels instanceof Object) {
|
|
46
|
+
const labelsObj = labels;
|
|
47
|
+
// empty labels
|
|
48
|
+
if (!Object.entries(labelsObj).length)
|
|
49
|
+
return t.success([]);
|
|
50
|
+
// weird case labels with empty key as parent
|
|
51
|
+
if (labelsObj[""]) {
|
|
52
|
+
return t.success(labelsObj[""].map((l) => l.name));
|
|
53
|
+
}
|
|
54
|
+
const convertedObjectToArray = Object.entries(labelsObj)
|
|
55
|
+
.reduce((acc, [, labelsEntries]) => {
|
|
56
|
+
return acc.concat(labelsEntries.map((l) => l.name));
|
|
57
|
+
}, [])
|
|
58
|
+
.filter(Boolean);
|
|
59
|
+
return t.success(convertedObjectToArray);
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
};
|
|
63
|
+
const LabelsAsArray = (labels) => {
|
|
64
|
+
if (labels instanceof Array) {
|
|
65
|
+
const isValidLabels = labels.reduce((acc, l) => acc && typeof l === "string", true);
|
|
66
|
+
if (isValidLabels)
|
|
67
|
+
return t.success(labels);
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
};
|
|
71
|
+
const LabelsAsString = (labels) => {
|
|
72
|
+
if (typeof labels === "string") {
|
|
73
|
+
return t.success([labels]);
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
};
|
|
77
|
+
const RichTextLabels = new t.Type("RichTextLabels", (u) => {
|
|
78
|
+
return u instanceof Array;
|
|
79
|
+
}, (u, context) => {
|
|
80
|
+
const legacyValidator = t.record(t.string, t.array(t.record(t.literal("name"), t.string)));
|
|
81
|
+
const validator = t.array(t.string);
|
|
82
|
+
return Either_1.either.chain(t
|
|
83
|
+
.union([legacyValidator, validator, t.string, t.null])
|
|
84
|
+
.validate(u, context), (labels) => {
|
|
85
|
+
return (NoLabels(labels) ||
|
|
86
|
+
LabelsAsArray(labels) ||
|
|
87
|
+
LabelsAsObject(labels) ||
|
|
88
|
+
LabelsAsString(labels) ||
|
|
89
|
+
t.failure(u, context));
|
|
90
|
+
});
|
|
91
|
+
}, (res) => res);
|
|
92
|
+
const RichTextConfig = t.exact(t.partial({
|
|
93
|
+
label: validators_1.StringOrNull,
|
|
94
|
+
placeholder: t.string,
|
|
95
|
+
useAsTitle: t.boolean,
|
|
96
|
+
single: RichTextOptions,
|
|
97
|
+
multi: RichTextOptions,
|
|
98
|
+
imageConstraint: ImageConstraint_1.default,
|
|
99
|
+
labels: RichTextLabels,
|
|
100
|
+
allowTargetBlank: t.boolean,
|
|
101
|
+
}));
|
|
102
|
+
const RichText = t.exact(t.intersection([
|
|
103
|
+
t.type({
|
|
104
|
+
type: t.literal(WidgetTypes_1.default.RichText),
|
|
105
|
+
}),
|
|
106
|
+
t.partial({
|
|
107
|
+
fieldset: validators_1.StringOrNull,
|
|
108
|
+
config: RichTextConfig,
|
|
109
|
+
}),
|
|
110
|
+
]));
|
|
111
|
+
exports.default = RichText;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import WidgetTypes from "../WidgetTypes";
|
|
3
|
+
declare const Select: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
+
type: t.LiteralC<WidgetTypes.Select>;
|
|
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
|
+
default_value: t.StringC;
|
|
11
|
+
options: t.ArrayC<t.UnionC<[t.StringC, t.Type<string, string, unknown>, t.Type<string, string, unknown>]>>;
|
|
12
|
+
}>>;
|
|
13
|
+
}>]>>;
|
|
14
|
+
declare type Select = t.TypeOf<typeof Select>;
|
|
15
|
+
export default Select;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 SelectConfig = t.exact(t.partial({
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
9
|
+
placeholder: t.string,
|
|
10
|
+
default_value: t.string,
|
|
11
|
+
options: t.array(t.union([t.string, validators_1.StringFromNumber, validators_1.StringFromBoolean])),
|
|
12
|
+
}));
|
|
13
|
+
const Select = t.exact(t.intersection([
|
|
14
|
+
t.type({
|
|
15
|
+
type: t.literal(WidgetTypes_1.default.Select),
|
|
16
|
+
}),
|
|
17
|
+
t.partial({
|
|
18
|
+
fieldset: validators_1.StringOrNull,
|
|
19
|
+
config: SelectConfig,
|
|
20
|
+
}),
|
|
21
|
+
]));
|
|
22
|
+
exports.default = Select;
|
|
@@ -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 Separator: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Separator>;
|
|
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
|
}>>;
|
|
9
9
|
}>]>>;
|
|
10
10
|
declare type Separator = t.TypeOf<typeof Separator>;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 SeparatorConfig = t.exact(t.partial({
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
9
|
+
}));
|
|
10
|
+
const Separator = t.exact(t.intersection([
|
|
11
|
+
t.type({
|
|
12
|
+
type: t.literal(WidgetTypes_1.default.Separator),
|
|
13
|
+
}),
|
|
14
|
+
t.partial({
|
|
15
|
+
config: SeparatorConfig,
|
|
16
|
+
}),
|
|
17
|
+
]));
|
|
18
|
+
exports.default = Separator;
|
|
@@ -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 Text: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Text>;
|
|
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 TextConfig = t.exact(t.partial({
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
9
|
+
useAsTitle: t.boolean,
|
|
10
|
+
placeholder: t.string,
|
|
11
|
+
}));
|
|
12
|
+
const Text = t.exact(t.intersection([
|
|
13
|
+
t.type({
|
|
14
|
+
type: t.literal(WidgetTypes_1.default.Text),
|
|
15
|
+
}),
|
|
16
|
+
t.partial({
|
|
17
|
+
fieldset: validators_1.StringOrNull,
|
|
18
|
+
config: TextConfig,
|
|
19
|
+
}),
|
|
20
|
+
]));
|
|
21
|
+
exports.default = Text;
|
|
@@ -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 Timestamp: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
4
|
type: t.LiteralC<WidgetTypes.Timestamp>;
|
|
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
|
}>>;
|
|
@@ -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 TimestampConfig = t.exact(t.partial({
|
|
8
|
+
label: validators_1.StringOrNull,
|
|
9
|
+
placeholder: t.string,
|
|
10
|
+
default: t.string,
|
|
11
|
+
}));
|
|
12
|
+
const Timestamp = t.exact(t.intersection([
|
|
13
|
+
t.type({
|
|
14
|
+
type: t.literal(WidgetTypes_1.default.Timestamp),
|
|
15
|
+
}),
|
|
16
|
+
t.partial({
|
|
17
|
+
fieldset: validators_1.StringOrNull,
|
|
18
|
+
config: TimestampConfig,
|
|
19
|
+
}),
|
|
20
|
+
]));
|
|
21
|
+
exports.default = Timestamp;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as BooleanField } from "./BooleanField";
|
|
2
|
+
export { default as Color } from "./Color";
|
|
3
|
+
export { default as Date } from "./Date";
|
|
4
|
+
export { default as GeoPoint } from "./GeoPoint";
|
|
5
|
+
export { default as Image } from "./Image";
|
|
6
|
+
export { default as IntegrationField } from "./IntegrationField";
|
|
7
|
+
export { default as Link } from "./Link";
|
|
8
|
+
export { default as NestableWidget } from "./NestableWidget";
|
|
9
|
+
export { default as Number } from "./Number";
|
|
10
|
+
export { default as Range } from "./Range";
|
|
11
|
+
export { default as RichText } from "./RichText";
|
|
12
|
+
export { default as Select } from "./Select";
|
|
13
|
+
export { default as Separator } from "./Separator";
|
|
14
|
+
export { default as Text } from "./Text";
|
|
15
|
+
export { default as Timestamp } from "./Timestamp";
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as t from
|
|
1
|
+
import * as t from "io-ts";
|
|
2
2
|
declare const ImageConstraint: t.PartialC<{
|
|
3
|
-
width: t.Type<number | null,
|
|
4
|
-
height: t.Type<number | null,
|
|
3
|
+
width: t.Type<number | null, unknown, unknown>;
|
|
4
|
+
height: t.Type<number | null, unknown, unknown>;
|
|
5
5
|
}>;
|
|
6
6
|
declare type ImageConstraint = t.TypeOf<typeof ImageConstraint>;
|
|
7
7
|
export default ImageConstraint;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Either_1 = require("fp-ts/lib/Either");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const IntFromString_1 = require("io-ts-types/lib/IntFromString");
|
|
7
|
+
const validators_1 = require("../../../validators");
|
|
8
|
+
const SideConstraint = new t.Type("SideConstraints", (u) => {
|
|
9
|
+
return !u || typeof u === "number";
|
|
10
|
+
}, (u, context) => {
|
|
11
|
+
return Either_1.either.chain(t
|
|
12
|
+
.union([
|
|
13
|
+
t.literal("auto"),
|
|
14
|
+
t.literal(""),
|
|
15
|
+
t.Int,
|
|
16
|
+
IntFromString_1.IntFromString,
|
|
17
|
+
validators_1.IntFromNumber,
|
|
18
|
+
validators_1.IntFromPixels,
|
|
19
|
+
t.null,
|
|
20
|
+
])
|
|
21
|
+
.validate(u, context), (constraint) => {
|
|
22
|
+
if (constraint === "auto" || constraint === "")
|
|
23
|
+
return t.success(null);
|
|
24
|
+
return t.success(constraint);
|
|
25
|
+
});
|
|
26
|
+
}, (res) => res);
|
|
27
|
+
const ImageConstraint = t.partial({
|
|
28
|
+
width: SideConstraint,
|
|
29
|
+
height: SideConstraint,
|
|
30
|
+
});
|
|
31
|
+
exports.default = ImageConstraint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ImageConstraint } from "./ImageConstraint";
|
|
File without changes
|