@prismicio/types-internal 0.3.3 → 1.0.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/lib/customtypes/CustomType.d.ts +309 -311
- package/lib/customtypes/CustomType.js +6 -6
- package/lib/customtypes/Format.d.ts +4 -0
- package/lib/customtypes/Format.js +8 -0
- package/lib/customtypes/Section.d.ts +309 -309
- package/lib/customtypes/widgets/Group.d.ts +22 -23
- package/lib/customtypes/widgets/Group.js +2 -2
- package/lib/customtypes/widgets/UID.d.ts +1 -2
- package/lib/customtypes/widgets/UID.js +2 -2
- package/lib/customtypes/widgets/Widget.d.ts +353 -354
- package/lib/customtypes/widgets/Widget.js +3 -3
- package/lib/customtypes/widgets/WidgetTypes.d.ts +22 -22
- package/lib/customtypes/widgets/WidgetTypes.js +22 -23
- package/lib/customtypes/widgets/index.d.ts +1 -1
- package/lib/customtypes/widgets/index.js +1 -1
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/BooleanField.js +2 -2
- package/lib/customtypes/widgets/nestable/Color.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Color.js +2 -2
- package/lib/customtypes/widgets/nestable/Date.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Date.js +2 -2
- package/lib/customtypes/widgets/nestable/Embed.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Embed.js +2 -2
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/GeoPoint.js +2 -2
- package/lib/customtypes/widgets/nestable/Image.d.ts +2 -3
- package/lib/customtypes/widgets/nestable/Image.js +3 -3
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/IntegrationField.js +2 -2
- package/lib/customtypes/widgets/nestable/Link.d.ts +4 -5
- package/lib/customtypes/widgets/nestable/Link.js +3 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +21 -21
- package/lib/customtypes/widgets/nestable/Number.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Number.js +2 -2
- package/lib/customtypes/widgets/nestable/Range.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Range.js +2 -2
- package/lib/customtypes/widgets/nestable/RichText.d.ts +22 -22
- package/lib/customtypes/widgets/nestable/RichText.js +38 -39
- package/lib/customtypes/widgets/nestable/Select.d.ts +2 -3
- package/lib/customtypes/widgets/nestable/Select.js +3 -3
- package/lib/customtypes/widgets/nestable/Separator.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Separator.js +2 -2
- package/lib/customtypes/widgets/nestable/Text.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Text.js +2 -2
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Timestamp.js +2 -2
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +43 -44
- package/lib/customtypes/widgets/slices/CompositeSlice.js +2 -2
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +43 -43
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +86 -87
- package/lib/customtypes/widgets/slices/SharedSlice.js +3 -3
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +1 -2
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
- package/lib/customtypes/widgets/slices/Slices.d.ts +529 -531
- package/lib/customtypes/widgets/slices/Slices.js +6 -6
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +5 -5
- package/lib/customtypes/widgets/slices/SlicesTypes.js +5 -6
- package/lib/customtypes/widgets/slices/index.d.ts +1 -1
- package/lib/customtypes/widgets/slices/index.js +1 -1
- package/lib/documents/widgets/index.d.ts +1 -0
- package/lib/documents/widgets/nestable/Link/index.d.ts +1 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +16 -17
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +1 -1
- package/package.json +1 -1
- package/src/customtypes/CustomType.ts +2 -2
- package/src/customtypes/widgets/Group.ts +1 -1
- package/src/customtypes/widgets/UID.ts +1 -1
- package/src/customtypes/widgets/Widget.ts +1 -1
- package/src/customtypes/widgets/WidgetTypes.ts +22 -22
- package/src/customtypes/widgets/index.ts +1 -1
- package/src/customtypes/widgets/nestable/BooleanField.ts +1 -1
- package/src/customtypes/widgets/nestable/Color.ts +1 -1
- package/src/customtypes/widgets/nestable/Date.ts +1 -1
- package/src/customtypes/widgets/nestable/Embed.ts +1 -1
- package/src/customtypes/widgets/nestable/GeoPoint.ts +1 -1
- package/src/customtypes/widgets/nestable/Image.ts +2 -2
- package/src/customtypes/widgets/nestable/IntegrationField.ts +1 -1
- package/src/customtypes/widgets/nestable/Link.ts +4 -4
- package/src/customtypes/widgets/nestable/Number.ts +1 -1
- package/src/customtypes/widgets/nestable/Range.ts +1 -1
- package/src/customtypes/widgets/nestable/RichText.ts +37 -35
- package/src/customtypes/widgets/nestable/Select.ts +4 -2
- package/src/customtypes/widgets/nestable/Separator.ts +1 -1
- package/src/customtypes/widgets/nestable/Text.ts +1 -1
- package/src/customtypes/widgets/nestable/Timestamp.ts +1 -1
- package/src/customtypes/widgets/slices/CompositeSlice.ts +1 -1
- package/src/customtypes/widgets/slices/SharedSlice.ts +2 -2
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +1 -1
- package/src/customtypes/widgets/slices/Slices.ts +3 -3
- package/src/customtypes/widgets/slices/SlicesTypes.ts +5 -5
- package/src/customtypes/widgets/slices/index.ts +1 -1
- package/src/documents/widgets/index.ts +1 -5
- package/src/documents/widgets/nestable/Link/index.ts +2 -0
- package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +1 -1
|
@@ -7,7 +7,7 @@ const Group_1 = (0, tslib_1.__importDefault)(require("./Group"));
|
|
|
7
7
|
const NestableWidget_1 = (0, tslib_1.__importDefault)(require("./nestable/NestableWidget"));
|
|
8
8
|
const Slices_1 = require("./slices/Slices");
|
|
9
9
|
const UID_1 = (0, tslib_1.__importDefault)(require("./UID"));
|
|
10
|
-
const WidgetTypes_1 =
|
|
10
|
+
const WidgetTypes_1 = require("./WidgetTypes");
|
|
11
11
|
function widgetReader(codec) {
|
|
12
12
|
return t.union([UID_1.default, NestableWidget_1.default, Group_1.default, codec]);
|
|
13
13
|
}
|
|
@@ -17,8 +17,8 @@ exports.DynamicWidget = widgetReader(Slices_1.DynamicSlices);
|
|
|
17
17
|
exports.Widgets = {
|
|
18
18
|
toStatic(widget, sharedSlices) {
|
|
19
19
|
switch (widget.type) {
|
|
20
|
-
case WidgetTypes_1.
|
|
21
|
-
case WidgetTypes_1.
|
|
20
|
+
case WidgetTypes_1.WidgetTypes.LegacySlices:
|
|
21
|
+
case WidgetTypes_1.WidgetTypes.Slices:
|
|
22
22
|
return Slices_1.Slices.toStatic(widget, sharedSlices);
|
|
23
23
|
default:
|
|
24
24
|
return widget;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
declare
|
|
2
|
-
Text
|
|
3
|
-
RichText
|
|
4
|
-
Color
|
|
5
|
-
Image
|
|
6
|
-
Date
|
|
7
|
-
Timestamp
|
|
8
|
-
Number
|
|
9
|
-
Range
|
|
10
|
-
Select
|
|
11
|
-
Link
|
|
12
|
-
Embed
|
|
13
|
-
GeoPoint
|
|
14
|
-
Separator
|
|
15
|
-
UID
|
|
16
|
-
BooleanField
|
|
17
|
-
IntegrationField
|
|
18
|
-
Group
|
|
19
|
-
Slices
|
|
20
|
-
LegacySlices
|
|
21
|
-
}
|
|
22
|
-
export
|
|
1
|
+
export declare const WidgetTypes: {
|
|
2
|
+
readonly Text: "Text";
|
|
3
|
+
readonly RichText: "StructuredText";
|
|
4
|
+
readonly Color: "Color";
|
|
5
|
+
readonly Image: "Image";
|
|
6
|
+
readonly Date: "Date";
|
|
7
|
+
readonly Timestamp: "Timestamp";
|
|
8
|
+
readonly Number: "Number";
|
|
9
|
+
readonly Range: "Range";
|
|
10
|
+
readonly Select: "Select";
|
|
11
|
+
readonly Link: "Link";
|
|
12
|
+
readonly Embed: "Embed";
|
|
13
|
+
readonly GeoPoint: "GeoPoint";
|
|
14
|
+
readonly Separator: "Separator";
|
|
15
|
+
readonly UID: "UID";
|
|
16
|
+
readonly BooleanField: "Boolean";
|
|
17
|
+
readonly IntegrationField: "IntegrationFields";
|
|
18
|
+
readonly Group: "Group";
|
|
19
|
+
readonly Slices: "Slices";
|
|
20
|
+
readonly LegacySlices: "Choice";
|
|
21
|
+
};
|
|
22
|
+
export declare type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes];
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
exports.WidgetTypes = void 0;
|
|
4
|
+
exports.WidgetTypes = {
|
|
5
|
+
Text: "Text",
|
|
6
|
+
RichText: "StructuredText",
|
|
7
|
+
Color: "Color",
|
|
8
|
+
Image: "Image",
|
|
9
|
+
Date: "Date",
|
|
10
|
+
Timestamp: "Timestamp",
|
|
11
|
+
Number: "Number",
|
|
12
|
+
Range: "Range",
|
|
13
|
+
Select: "Select",
|
|
14
|
+
Link: "Link",
|
|
15
|
+
Embed: "Embed",
|
|
16
|
+
GeoPoint: "GeoPoint",
|
|
17
|
+
Separator: "Separator",
|
|
18
|
+
UID: "UID",
|
|
19
|
+
BooleanField: "Boolean",
|
|
20
|
+
IntegrationField: "IntegrationFields",
|
|
21
|
+
Group: "Group",
|
|
22
|
+
Slices: "Slices",
|
|
23
23
|
// Legacy type for slices
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
exports.default = WidgetTypes;
|
|
24
|
+
LegacySlices: "Choice",
|
|
25
|
+
};
|
|
@@ -11,4 +11,4 @@ var UID_1 = require("./UID");
|
|
|
11
11
|
Object.defineProperty(exports, "UID", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(UID_1).default; } });
|
|
12
12
|
exports.Widget = (0, tslib_1.__importStar)(require("./Widget"));
|
|
13
13
|
var WidgetTypes_1 = require("./WidgetTypes");
|
|
14
|
-
Object.defineProperty(exports, "WidgetTypes", { enumerable: true, get: function () { return
|
|
14
|
+
Object.defineProperty(exports, "WidgetTypes", { enumerable: true, get: function () { return WidgetTypes_1.WidgetTypes; } });
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const BooleanField: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Boolean">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
config: t.ExactC<t.PartialC<{
|
|
7
6
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
|
-
const WidgetTypes_1 =
|
|
6
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
7
7
|
const BooleanConfig = t.exact(t.partial({
|
|
8
8
|
label: validators_1.StringOrNull,
|
|
9
9
|
default_value: t.boolean,
|
|
@@ -12,7 +12,7 @@ const BooleanConfig = t.exact(t.partial({
|
|
|
12
12
|
}));
|
|
13
13
|
const BooleanField = t.exact(t.intersection([
|
|
14
14
|
t.type({
|
|
15
|
-
type: t.literal(WidgetTypes_1.
|
|
15
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.BooleanField),
|
|
16
16
|
}),
|
|
17
17
|
t.partial({
|
|
18
18
|
config: BooleanConfig,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Color: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Color">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
|
-
const WidgetTypes_1 =
|
|
6
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
7
7
|
const ColorConfig = t.exact(t.partial({
|
|
8
8
|
label: validators_1.StringOrNull,
|
|
9
9
|
placeholder: t.string,
|
|
10
10
|
}));
|
|
11
11
|
const Color = t.exact(t.intersection([
|
|
12
12
|
t.type({
|
|
13
|
-
type: t.literal(WidgetTypes_1.
|
|
13
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Color),
|
|
14
14
|
}),
|
|
15
15
|
t.partial({
|
|
16
16
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Date: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Date">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
|
-
const WidgetTypes_1 =
|
|
6
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
7
7
|
const DateConfig = t.exact(t.partial({
|
|
8
8
|
label: validators_1.StringOrNull,
|
|
9
9
|
placeholder: t.string,
|
|
@@ -11,7 +11,7 @@ const DateConfig = t.exact(t.partial({
|
|
|
11
11
|
}));
|
|
12
12
|
const Date = t.exact(t.intersection([
|
|
13
13
|
t.type({
|
|
14
|
-
type: t.literal(WidgetTypes_1.
|
|
14
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Date),
|
|
15
15
|
}),
|
|
16
16
|
t.partial({
|
|
17
17
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Embed: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Embed">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
|
-
const WidgetTypes_1 =
|
|
6
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
7
7
|
const EmbedConfig = t.exact(t.partial({
|
|
8
8
|
label: validators_1.StringOrNull,
|
|
9
9
|
placeholder: t.string,
|
|
@@ -11,7 +11,7 @@ const EmbedConfig = t.exact(t.partial({
|
|
|
11
11
|
}));
|
|
12
12
|
const Embed = t.exact(t.intersection([
|
|
13
13
|
t.type({
|
|
14
|
-
type: t.literal(WidgetTypes_1.
|
|
14
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Embed),
|
|
15
15
|
}),
|
|
16
16
|
t.partial({
|
|
17
17
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const GeoPoint: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"GeoPoint">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
|
-
const WidgetTypes_1 =
|
|
6
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
7
7
|
const GeoPointConfig = t.exact(t.partial({
|
|
8
8
|
label: validators_1.StringOrNull,
|
|
9
9
|
}));
|
|
10
10
|
const GeoPoint = t.exact(t.intersection([
|
|
11
11
|
t.type({
|
|
12
|
-
type: t.literal(WidgetTypes_1.
|
|
12
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.GeoPoint),
|
|
13
13
|
}),
|
|
14
14
|
t.partial({
|
|
15
15
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Image: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Image">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -11,7 +10,7 @@ declare const Image: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
11
10
|
width: t.Type<number | null, unknown, unknown>;
|
|
12
11
|
height: t.Type<number | null, unknown, unknown>;
|
|
13
12
|
}>;
|
|
14
|
-
thumbnails: t.
|
|
13
|
+
thumbnails: t.ReadonlyArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
15
14
|
name: t.StringC;
|
|
16
15
|
}>, t.PartialC<{
|
|
17
16
|
width: t.Type<number | null, unknown, unknown>;
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
6
|
const ImageConstraint_1 = (0, tslib_1.__importDefault)(require("../shared/ImageConstraint"));
|
|
7
|
-
const WidgetTypes_1 =
|
|
7
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
8
8
|
const Thumbnail = t.exact(t.intersection([
|
|
9
9
|
t.type({
|
|
10
10
|
name: t.string,
|
|
@@ -15,11 +15,11 @@ const ImageConfig = t.exact(t.partial({
|
|
|
15
15
|
label: validators_1.StringOrNull,
|
|
16
16
|
placeholder: t.string,
|
|
17
17
|
constraint: ImageConstraint_1.default,
|
|
18
|
-
thumbnails: t.
|
|
18
|
+
thumbnails: t.readonlyArray(Thumbnail),
|
|
19
19
|
}));
|
|
20
20
|
const Image = t.exact(t.intersection([
|
|
21
21
|
t.type({
|
|
22
|
-
type: t.literal(WidgetTypes_1.
|
|
22
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Image),
|
|
23
23
|
}),
|
|
24
24
|
t.partial({
|
|
25
25
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const IntegrationField: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"IntegrationFields">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const validators_1 = require("../../../validators");
|
|
6
|
-
const WidgetTypes_1 =
|
|
6
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
7
7
|
const IntegrationFieldConfig = t.exact(t.partial({
|
|
8
8
|
label: validators_1.StringOrNull,
|
|
9
9
|
placeholder: t.string,
|
|
@@ -11,7 +11,7 @@ const IntegrationFieldConfig = t.exact(t.partial({
|
|
|
11
11
|
}));
|
|
12
12
|
const IntegrationField = t.exact(t.intersection([
|
|
13
13
|
t.type({
|
|
14
|
-
type: t.literal(WidgetTypes_1.
|
|
14
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.IntegrationField),
|
|
15
15
|
}),
|
|
16
16
|
t.partial({
|
|
17
17
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Link: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Link">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -9,9 +8,9 @@ declare const Link: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
9
8
|
useAsTitle: t.BooleanC;
|
|
10
9
|
placeholder: t.StringC;
|
|
11
10
|
select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
|
|
12
|
-
customtypes: t.
|
|
13
|
-
masks: t.Type<string[], object, unknown>;
|
|
14
|
-
tags: t.Type<string[], object, unknown>;
|
|
11
|
+
customtypes: t.ReadonlyArrayC<t.StringC>;
|
|
12
|
+
masks: t.Type<readonly string[], object, unknown>;
|
|
13
|
+
tags: t.Type<readonly string[], object, unknown>;
|
|
15
14
|
allowTargetBlank: t.BooleanC;
|
|
16
15
|
}>>;
|
|
17
16
|
}>]>>;
|
|
@@ -5,7 +5,7 @@ const Either_1 = require("fp-ts/lib/Either");
|
|
|
5
5
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
6
|
const withFallback_1 = require("io-ts-types/lib/withFallback");
|
|
7
7
|
const validators_1 = require("../../../validators");
|
|
8
|
-
const WidgetTypes_1 =
|
|
8
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
9
9
|
const arrayString = (entries) => {
|
|
10
10
|
if (entries instanceof Array) {
|
|
11
11
|
const isValidEntries = entries.reduce((acc, l) => acc && typeof l === "string", true);
|
|
@@ -37,14 +37,14 @@ const LinkConfig = t.exact(t.partial({
|
|
|
37
37
|
t.literal("web"),
|
|
38
38
|
t.null,
|
|
39
39
|
]), null),
|
|
40
|
-
customtypes: t.
|
|
40
|
+
customtypes: t.readonlyArray(t.string),
|
|
41
41
|
masks: MasksArrayString,
|
|
42
42
|
tags: MasksArrayString,
|
|
43
43
|
allowTargetBlank: t.boolean,
|
|
44
44
|
}));
|
|
45
45
|
const Link = t.exact(t.intersection([
|
|
46
46
|
t.type({
|
|
47
|
-
type: t.literal(WidgetTypes_1.
|
|
47
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Link),
|
|
48
48
|
}),
|
|
49
49
|
t.partial({
|
|
50
50
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
3
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Color">;
|
|
4
4
|
}>, t.PartialC<{
|
|
5
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
6
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -8,7 +8,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
8
8
|
placeholder: t.StringC;
|
|
9
9
|
}>>;
|
|
10
10
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
11
|
-
type: t.LiteralC<
|
|
11
|
+
type: t.LiteralC<"Boolean">;
|
|
12
12
|
}>, t.PartialC<{
|
|
13
13
|
config: t.ExactC<t.PartialC<{
|
|
14
14
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -17,7 +17,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
17
17
|
placeholder_false: t.StringC;
|
|
18
18
|
}>>;
|
|
19
19
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
20
|
-
type: t.LiteralC<
|
|
20
|
+
type: t.LiteralC<"Embed">;
|
|
21
21
|
}>, t.PartialC<{
|
|
22
22
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
23
23
|
config: t.ExactC<t.PartialC<{
|
|
@@ -26,14 +26,14 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
26
26
|
useAsTitle: t.BooleanC;
|
|
27
27
|
}>>;
|
|
28
28
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
29
|
-
type: t.LiteralC<
|
|
29
|
+
type: t.LiteralC<"GeoPoint">;
|
|
30
30
|
}>, t.PartialC<{
|
|
31
31
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
32
32
|
config: t.ExactC<t.PartialC<{
|
|
33
33
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
34
34
|
}>>;
|
|
35
35
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
36
|
-
type: t.LiteralC<
|
|
36
|
+
type: t.LiteralC<"Date">;
|
|
37
37
|
}>, t.PartialC<{
|
|
38
38
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
39
39
|
config: t.ExactC<t.PartialC<{
|
|
@@ -42,7 +42,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
42
42
|
default: t.StringC;
|
|
43
43
|
}>>;
|
|
44
44
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
45
|
-
type: t.LiteralC<
|
|
45
|
+
type: t.LiteralC<"Number">;
|
|
46
46
|
}>, t.PartialC<{
|
|
47
47
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
48
48
|
config: t.ExactC<t.PartialC<{
|
|
@@ -53,7 +53,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
53
53
|
step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
54
54
|
}>>;
|
|
55
55
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
56
|
-
type: t.LiteralC<
|
|
56
|
+
type: t.LiteralC<"Range">;
|
|
57
57
|
}>, t.PartialC<{
|
|
58
58
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
59
59
|
config: t.ExactC<t.PartialC<{
|
|
@@ -64,7 +64,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
64
64
|
step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
|
|
65
65
|
}>>;
|
|
66
66
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
67
|
-
type: t.LiteralC<
|
|
67
|
+
type: t.LiteralC<"StructuredText">;
|
|
68
68
|
}>, t.PartialC<{
|
|
69
69
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
70
70
|
config: t.ExactC<t.PartialC<{
|
|
@@ -77,27 +77,27 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
77
77
|
width: t.Type<number | null, unknown, unknown>;
|
|
78
78
|
height: t.Type<number | null, unknown, unknown>;
|
|
79
79
|
}>;
|
|
80
|
-
labels: t.Type<string[], object, unknown>;
|
|
80
|
+
labels: t.Type<readonly string[], object, unknown>;
|
|
81
81
|
allowTargetBlank: t.BooleanC;
|
|
82
82
|
}>>;
|
|
83
83
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
84
|
-
type: t.LiteralC<
|
|
84
|
+
type: t.LiteralC<"Select">;
|
|
85
85
|
}>, t.PartialC<{
|
|
86
86
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
87
87
|
config: t.ExactC<t.PartialC<{
|
|
88
88
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
89
89
|
placeholder: t.StringC;
|
|
90
90
|
default_value: t.StringC;
|
|
91
|
-
options: t.
|
|
91
|
+
options: t.ReadonlyArrayC<t.UnionC<[t.StringC, t.Type<string, string, unknown>, t.Type<string, string, unknown>]>>;
|
|
92
92
|
}>>;
|
|
93
93
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
94
|
-
type: t.LiteralC<
|
|
94
|
+
type: t.LiteralC<"Separator">;
|
|
95
95
|
}>, t.PartialC<{
|
|
96
96
|
config: t.ExactC<t.PartialC<{
|
|
97
97
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
98
98
|
}>>;
|
|
99
99
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
100
|
-
type: t.LiteralC<
|
|
100
|
+
type: t.LiteralC<"Text">;
|
|
101
101
|
}>, t.PartialC<{
|
|
102
102
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
103
103
|
config: t.ExactC<t.PartialC<{
|
|
@@ -106,7 +106,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
106
106
|
placeholder: t.StringC;
|
|
107
107
|
}>>;
|
|
108
108
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
109
|
-
type: t.LiteralC<
|
|
109
|
+
type: t.LiteralC<"Timestamp">;
|
|
110
110
|
}>, t.PartialC<{
|
|
111
111
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
112
112
|
config: t.ExactC<t.PartialC<{
|
|
@@ -115,7 +115,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
115
115
|
default: t.StringC;
|
|
116
116
|
}>>;
|
|
117
117
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
118
|
-
type: t.LiteralC<
|
|
118
|
+
type: t.LiteralC<"Link">;
|
|
119
119
|
}>, t.PartialC<{
|
|
120
120
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
121
121
|
config: t.ExactC<t.PartialC<{
|
|
@@ -123,13 +123,13 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
123
123
|
useAsTitle: t.BooleanC;
|
|
124
124
|
placeholder: t.StringC;
|
|
125
125
|
select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
|
|
126
|
-
customtypes: t.
|
|
127
|
-
masks: t.Type<string[], object, unknown>;
|
|
128
|
-
tags: t.Type<string[], object, unknown>;
|
|
126
|
+
customtypes: t.ReadonlyArrayC<t.StringC>;
|
|
127
|
+
masks: t.Type<readonly string[], object, unknown>;
|
|
128
|
+
tags: t.Type<readonly string[], object, unknown>;
|
|
129
129
|
allowTargetBlank: t.BooleanC;
|
|
130
130
|
}>>;
|
|
131
131
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
132
|
-
type: t.LiteralC<
|
|
132
|
+
type: t.LiteralC<"Image">;
|
|
133
133
|
}>, t.PartialC<{
|
|
134
134
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
135
135
|
config: t.ExactC<t.PartialC<{
|
|
@@ -139,7 +139,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
139
139
|
width: t.Type<number | null, unknown, unknown>;
|
|
140
140
|
height: t.Type<number | null, unknown, unknown>;
|
|
141
141
|
}>;
|
|
142
|
-
thumbnails: t.
|
|
142
|
+
thumbnails: t.ReadonlyArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
143
143
|
name: t.StringC;
|
|
144
144
|
}>, t.PartialC<{
|
|
145
145
|
width: t.Type<number | null, unknown, unknown>;
|
|
@@ -147,7 +147,7 @@ declare const NestableWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
147
147
|
}>]>>>;
|
|
148
148
|
}>>;
|
|
149
149
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
150
|
-
type: t.LiteralC<
|
|
150
|
+
type: t.LiteralC<"IntegrationFields">;
|
|
151
151
|
}>, t.PartialC<{
|
|
152
152
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
153
153
|
config: t.ExactC<t.PartialC<{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Number: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Number">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
|
|
6
6
|
const validators_1 = require("../../../validators");
|
|
7
|
-
const WidgetTypes_1 =
|
|
7
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
8
8
|
const NumberConfig = t.exact(t.partial({
|
|
9
9
|
label: validators_1.StringOrNull,
|
|
10
10
|
placeholder: t.string,
|
|
@@ -14,7 +14,7 @@ const NumberConfig = t.exact(t.partial({
|
|
|
14
14
|
}));
|
|
15
15
|
const Number = t.exact(t.intersection([
|
|
16
16
|
t.type({
|
|
17
|
-
type: t.literal(WidgetTypes_1.
|
|
17
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Number),
|
|
18
18
|
}),
|
|
19
19
|
t.partial({
|
|
20
20
|
fieldset: validators_1.StringOrNull,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import WidgetTypes from "../WidgetTypes";
|
|
3
2
|
declare const Range: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
4
|
-
type: t.LiteralC<
|
|
3
|
+
type: t.LiteralC<"Range">;
|
|
5
4
|
}>, t.PartialC<{
|
|
6
5
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
7
6
|
config: t.ExactC<t.PartialC<{
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
5
5
|
const NumberFromString_1 = require("io-ts-types/lib/NumberFromString");
|
|
6
6
|
const validators_1 = require("../../../validators");
|
|
7
|
-
const WidgetTypes_1 =
|
|
7
|
+
const WidgetTypes_1 = require("../WidgetTypes");
|
|
8
8
|
const RangeConfig = t.exact(t.partial({
|
|
9
9
|
label: validators_1.StringOrNull,
|
|
10
10
|
placeholder: t.string,
|
|
@@ -14,7 +14,7 @@ const RangeConfig = t.exact(t.partial({
|
|
|
14
14
|
}));
|
|
15
15
|
const Range = t.exact(t.intersection([
|
|
16
16
|
t.type({
|
|
17
|
-
type: t.literal(WidgetTypes_1.
|
|
17
|
+
type: t.literal(WidgetTypes_1.WidgetTypes.Range),
|
|
18
18
|
}),
|
|
19
19
|
t.partial({
|
|
20
20
|
fieldset: validators_1.StringOrNull,
|