@prismicio/types-internal 1.5.3 → 2.0.0-alpha.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/common/WidgetKey.d.ts +3 -0
- package/lib/common/WidgetKey.js +8 -0
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.js +4 -0
- package/lib/content/Document.d.ts +4285 -2573
- package/lib/content/Document.js +87 -10
- package/lib/content/LegacyContentCtx.d.ts +41 -0
- package/lib/content/LegacyContentCtx.js +65 -0
- package/lib/content/fields/EmptyContent.d.ts +16 -0
- package/lib/content/fields/EmptyContent.js +30 -0
- package/lib/content/fields/GroupContent.d.ts +1063 -364
- package/lib/content/fields/GroupContent.js +65 -6
- package/lib/content/fields/UIDContent.d.ts +10 -1
- package/lib/content/fields/UIDContent.js +17 -4
- package/lib/content/fields/WidgetContent.d.ts +6820 -0
- package/lib/content/fields/WidgetContent.js +57 -0
- package/lib/content/fields/index.d.ts +1 -2989
- package/lib/content/fields/index.js +1 -18
- package/lib/content/fields/nestable/BooleanContent.d.ts +10 -1
- package/lib/content/fields/nestable/BooleanContent.js +17 -4
- package/lib/content/fields/nestable/EmbedContent.d.ts +56 -5
- package/lib/content/fields/nestable/EmbedContent.js +57 -6
- package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/ColorContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/DateContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/NumberContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/RangeContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/SelectContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/TextContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/TimestampContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/common.d.ts +1 -0
- package/lib/content/fields/nestable/FieldContent/common.js +4 -0
- package/lib/content/fields/nestable/FieldContent/index.d.ts +49 -0
- package/lib/content/fields/nestable/FieldContent/index.js +38 -0
- package/lib/content/fields/nestable/FieldContent.d.ts +7 -1
- package/lib/content/fields/nestable/FieldContent.js +19 -4
- package/lib/content/fields/nestable/GeoPointContent.d.ts +19 -4
- package/lib/content/fields/nestable/GeoPointContent.js +22 -5
- package/lib/content/fields/nestable/ImageContent.d.ts +109 -11
- package/lib/content/fields/nestable/ImageContent.js +64 -6
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +10 -1
- package/lib/content/fields/nestable/IntegrationFieldContent.js +20 -4
- package/lib/content/fields/nestable/LinkContent.d.ts +240 -87
- package/lib/content/fields/nestable/LinkContent.js +133 -36
- package/lib/content/fields/nestable/NestableContent.d.ts +711 -251
- package/lib/content/fields/nestable/NestableContent.js +116 -13
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +594 -0
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +151 -0
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +489 -0
- package/lib/content/fields/nestable/RichTextContent/index.js +27 -0
- package/lib/content/fields/nestable/SeparatorContent.d.ts +8 -1
- package/lib/content/fields/nestable/SeparatorContent.js +15 -4
- package/lib/content/fields/slices/CompositeSliceContent.d.ts +296 -362
- package/lib/content/fields/slices/RepeatableContent.d.ts +148 -181
- package/lib/content/fields/slices/SharedSliceContent.d.ts +296 -362
- package/lib/content/fields/slices/SimpleSliceContent.d.ts +296 -362
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +1709 -0
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +81 -0
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +582 -0
- package/lib/content/fields/slices/Slice/RepeatableContent.js +18 -0
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +1713 -0
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +98 -0
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +1429 -0
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +24 -0
- package/lib/content/fields/slices/Slice/index.d.ts +3216 -0
- package/lib/content/fields/slices/Slice/index.js +41 -0
- package/lib/content/fields/slices/SliceItem.d.ts +3498 -0
- package/lib/content/fields/slices/SliceItem.js +61 -0
- package/lib/content/fields/slices/SlicesContent.d.ts +4243 -3576
- package/lib/content/fields/slices/SlicesContent.js +28 -18
- package/lib/content/fields/slices/index.d.ts +4 -3
- package/lib/content/fields/slices/index.js +4 -3
- package/lib/content/index.d.ts +1 -0
- package/lib/content/index.js +1 -0
- package/lib/content/utils.d.ts +10 -0
- package/lib/content/utils.js +19 -0
- package/lib/customtypes/CustomType.d.ts +366 -366
- package/lib/customtypes/CustomType.js +4 -7
- package/lib/customtypes/Section.d.ts +366 -366
- package/lib/customtypes/Section.js +2 -2
- package/lib/customtypes/diff/SharedSlice.d.ts +4 -4
- package/lib/customtypes/diff/Variation.d.ts +4 -4
- package/lib/customtypes/widgets/Group.d.ts +1 -0
- package/lib/customtypes/widgets/Group.js +6 -5
- package/lib/customtypes/widgets/UID.d.ts +1 -0
- package/lib/customtypes/widgets/UID.js +3 -2
- package/lib/customtypes/widgets/Widget.d.ts +384 -362
- package/lib/customtypes/widgets/Widget.js +29 -8
- package/lib/customtypes/widgets/index.d.ts +6 -7
- package/lib/customtypes/widgets/index.js +6 -11
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +10 -3
- package/lib/customtypes/widgets/nestable/BooleanField.js +6 -6
- package/lib/customtypes/widgets/nestable/Color.d.ts +8 -3
- package/lib/customtypes/widgets/nestable/Color.js +6 -6
- package/lib/customtypes/widgets/nestable/Date.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/Date.js +6 -6
- package/lib/customtypes/widgets/nestable/Embed.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/Embed.js +6 -6
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +7 -3
- package/lib/customtypes/widgets/nestable/GeoPoint.js +6 -6
- package/lib/customtypes/widgets/nestable/Image.d.ts +25 -3
- package/lib/customtypes/widgets/nestable/Image.js +8 -8
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/IntegrationField.js +6 -6
- package/lib/customtypes/widgets/nestable/Link.d.ts +14 -2
- package/lib/customtypes/widgets/nestable/Link.js +7 -6
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.js +30 -30
- package/lib/customtypes/widgets/nestable/Number.d.ts +11 -3
- package/lib/customtypes/widgets/nestable/Number.js +6 -6
- package/lib/customtypes/widgets/nestable/Range.d.ts +11 -3
- package/lib/customtypes/widgets/nestable/Range.js +6 -6
- package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -0
- package/lib/customtypes/widgets/nestable/RichText.js +3 -3
- package/lib/customtypes/widgets/nestable/Select.d.ts +10 -3
- package/lib/customtypes/widgets/nestable/Select.js +6 -6
- package/lib/customtypes/widgets/nestable/Separator.d.ts +7 -3
- package/lib/customtypes/widgets/nestable/Separator.js +6 -6
- package/lib/customtypes/widgets/nestable/Text.d.ts +9 -2
- package/lib/customtypes/widgets/nestable/Text.js +7 -6
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/Timestamp.js +6 -6
- package/lib/customtypes/widgets/nestable/index.d.ts +15 -15
- package/lib/customtypes/widgets/nestable/index.js +15 -31
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +1 -0
- package/lib/customtypes/widgets/slices/CompositeSlice.js +7 -6
- package/lib/customtypes/widgets/slices/LegacySlice.js +2 -2
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +1 -0
- package/lib/customtypes/widgets/slices/SharedSlice.js +7 -7
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
- package/lib/customtypes/widgets/slices/Slices.d.ts +364 -362
- package/lib/customtypes/widgets/slices/Slices.js +8 -8
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +6 -5
- package/lib/customtypes/widgets/slices/SlicesTypes.js +8 -4
- package/lib/documents/DocumentData.d.ts +3 -14
- package/lib/documents/DocumentData.js +5 -60
- package/lib/documents/widgets/nestable/ImageContent.d.ts +1 -1
- package/lib/documents/widgets/nestable/ImageContent.js +2 -2
- package/lib/utils/Objects.d.ts +1 -0
- package/lib/utils/Objects.js +10 -1
- package/package.json +1 -1
- package/src/common/WidgetKey.ts +13 -0
- package/src/common/index.ts +1 -0
- package/src/content/Document.ts +129 -16
- package/src/content/LegacyContentCtx.ts +57 -0
- package/src/content/fields/EmptyContent.ts +45 -0
- package/src/content/fields/GroupContent.ts +103 -8
- package/src/content/fields/UIDContent.ts +33 -3
- package/src/content/fields/WidgetContent.ts +76 -0
- package/src/content/fields/index.ts +1 -23
- package/src/content/fields/nestable/BooleanContent.ts +32 -3
- package/src/content/fields/nestable/EmbedContent.ts +79 -8
- package/src/content/fields/nestable/FieldContent/ColorContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/DateContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/NumberContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/RangeContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/SelectContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/TextContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/TimestampContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/common.ts +1 -0
- package/src/content/fields/nestable/FieldContent/index.ts +40 -0
- package/src/content/fields/nestable/GeoPointContent.ts +38 -7
- package/src/content/fields/nestable/ImageContent.ts +91 -11
- package/src/content/fields/nestable/IntegrationFieldContent.ts +42 -3
- package/src/content/fields/nestable/LinkContent.ts +208 -47
- package/src/content/fields/nestable/NestableContent.ts +180 -24
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +205 -0
- package/src/content/fields/nestable/RichTextContent/index.ts +43 -0
- package/src/content/fields/nestable/SeparatorContent.ts +26 -3
- package/src/content/fields/slices/Slice/CompositeSliceContent.ts +118 -0
- package/src/content/fields/slices/{RepeatableContent.ts → Slice/RepeatableContent.ts} +7 -4
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +129 -0
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +30 -0
- package/src/content/fields/slices/Slice/index.ts +47 -0
- package/src/content/fields/slices/SliceItem.ts +83 -0
- package/src/content/fields/slices/SlicesContent.ts +47 -19
- package/src/content/fields/slices/index.ts +4 -3
- package/src/content/index.ts +1 -0
- package/src/content/utils.ts +20 -0
- package/src/customtypes/CustomType.ts +4 -10
- package/src/customtypes/Section.ts +1 -1
- package/src/customtypes/widgets/Group.ts +4 -4
- package/src/customtypes/widgets/UID.ts +3 -2
- package/src/customtypes/widgets/Widget.ts +53 -7
- package/src/customtypes/widgets/index.ts +6 -7
- package/src/customtypes/widgets/nestable/BooleanField.ts +7 -8
- package/src/customtypes/widgets/nestable/Color.ts +6 -8
- package/src/customtypes/widgets/nestable/Date.ts +7 -8
- package/src/customtypes/widgets/nestable/Embed.ts +7 -8
- package/src/customtypes/widgets/nestable/GeoPoint.ts +7 -8
- package/src/customtypes/widgets/nestable/Image.ts +9 -10
- package/src/customtypes/widgets/nestable/IntegrationField.ts +6 -8
- package/src/customtypes/widgets/nestable/Link.ts +7 -6
- package/src/customtypes/widgets/nestable/NestableWidget.ts +17 -18
- package/src/customtypes/widgets/nestable/Number.ts +7 -8
- package/src/customtypes/widgets/nestable/Range.ts +7 -8
- package/src/customtypes/widgets/nestable/RichText.ts +3 -2
- package/src/customtypes/widgets/nestable/Select.ts +7 -8
- package/src/customtypes/widgets/nestable/Separator.ts +7 -8
- package/src/customtypes/widgets/nestable/Text.ts +7 -6
- package/src/customtypes/widgets/nestable/Timestamp.ts +7 -8
- package/src/customtypes/widgets/nestable/index.ts +15 -15
- package/src/customtypes/widgets/slices/CompositeSlice.ts +5 -4
- package/src/customtypes/widgets/slices/LegacySlice.ts +1 -1
- package/src/customtypes/widgets/slices/SharedSlice.ts +5 -4
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +2 -2
- package/src/customtypes/widgets/slices/Slices.ts +7 -6
- package/src/customtypes/widgets/slices/SlicesTypes.ts +10 -5
- package/src/utils/Objects.ts +12 -0
- package/src/content/fields/nestable/FieldContent.ts +0 -25
- package/src/content/fields/nestable/RichTextContent.ts +0 -32
- package/src/content/fields/slices/CompositeSliceContent.ts +0 -14
- package/src/content/fields/slices/SharedSliceContent.ts +0 -14
- package/src/content/fields/slices/SimpleSliceContent.ts +0 -7
- package/src/customtypes/widgets/WidgetTypes.ts +0 -24
- package/src/documents/DocumentData.ts +0 -112
- package/src/documents/index.ts +0 -2
- package/src/documents/widgets/EmptyContent.ts +0 -8
- package/src/documents/widgets/GroupContent.ts +0 -91
- package/src/documents/widgets/SimpleWidgetContent.ts +0 -96
- package/src/documents/widgets/StaticWidgetContent.ts +0 -46
- package/src/documents/widgets/UIDContent.ts +0 -18
- package/src/documents/widgets/index.ts +0 -70
- package/src/documents/widgets/nestable/BooleanContent.ts +0 -21
- package/src/documents/widgets/nestable/EmbedContent.ts +0 -56
- package/src/documents/widgets/nestable/FieldContent.ts +0 -53
- package/src/documents/widgets/nestable/GeoPointContent.ts +0 -18
- package/src/documents/widgets/nestable/ImageContent.ts +0 -51
- package/src/documents/widgets/nestable/IntegrationFieldsContent.ts +0 -26
- package/src/documents/widgets/nestable/Link/DocumentLink.ts +0 -18
- package/src/documents/widgets/nestable/Link/ExternalLink.ts +0 -31
- package/src/documents/widgets/nestable/Link/FileLink.ts +0 -30
- package/src/documents/widgets/nestable/Link/ImageLink.ts +0 -31
- package/src/documents/widgets/nestable/Link/LinkContent.ts +0 -25
- package/src/documents/widgets/nestable/Link/index.ts +0 -35
- package/src/documents/widgets/nestable/SeparatorContent.ts +0 -13
- package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +0 -126
- package/src/documents/widgets/nestable/StructuredTextContent/index.ts +0 -25
- package/src/documents/widgets/nestable/index.ts +0 -35
- package/src/documents/widgets/slices/CompositeSliceContent.ts +0 -77
- package/src/documents/widgets/slices/SharedSliceContent.ts +0 -94
- package/src/documents/widgets/slices/SimpleSliceContent.ts +0 -4
- package/src/documents/widgets/slices/SliceWidgetContent.ts +0 -51
- package/src/documents/widgets/slices/SlicesContent.ts +0 -91
- package/src/documents/widgets/slices/index.ts +0 -5
- package/src/index.ts +0 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
export declare const FieldType: t.KeyofC<{
|
|
3
|
+
Text: null;
|
|
4
|
+
Date: null;
|
|
5
|
+
Timestamp: null;
|
|
6
|
+
Color: null;
|
|
7
|
+
Number: null;
|
|
8
|
+
Range: null;
|
|
9
|
+
Select: null;
|
|
10
|
+
}>;
|
|
11
|
+
export declare type FieldType = t.TypeOf<typeof FieldType>;
|
|
12
|
+
export declare const FieldContent: t.UnionC<[t.ExactC<t.TypeC<{
|
|
13
|
+
type: t.LiteralC<"Date">;
|
|
14
|
+
value: t.Type<string, string, unknown>;
|
|
15
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
16
|
+
}>>, t.ExactC<t.TypeC<{
|
|
17
|
+
type: t.LiteralC<"Color">;
|
|
18
|
+
value: t.Type<string, string, unknown>;
|
|
19
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
20
|
+
}>>, t.ExactC<t.TypeC<{
|
|
21
|
+
type: t.LiteralC<"Number">;
|
|
22
|
+
value: t.Type<string, string, unknown>;
|
|
23
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
24
|
+
}>>, t.ExactC<t.TypeC<{
|
|
25
|
+
type: t.LiteralC<"Range">;
|
|
26
|
+
value: t.Type<string, string, unknown>;
|
|
27
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
28
|
+
}>>, t.ExactC<t.TypeC<{
|
|
29
|
+
type: t.LiteralC<"Select">;
|
|
30
|
+
value: t.Type<string, string, unknown>;
|
|
31
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
32
|
+
}>>, t.ExactC<t.TypeC<{
|
|
33
|
+
type: t.LiteralC<"Text">;
|
|
34
|
+
value: t.Type<string, string, unknown>;
|
|
35
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
36
|
+
}>>, t.ExactC<t.TypeC<{
|
|
37
|
+
type: t.LiteralC<"Timestamp">;
|
|
38
|
+
value: t.Type<string, string, unknown>;
|
|
39
|
+
__TYPE__: t.LiteralC<"FieldContent">;
|
|
40
|
+
}>>]>;
|
|
41
|
+
export declare type FieldContent = t.TypeOf<typeof FieldContent>;
|
|
42
|
+
export * from "./ColorContent";
|
|
43
|
+
export * from "./common";
|
|
44
|
+
export * from "./DateContent";
|
|
45
|
+
export * from "./NumberContent";
|
|
46
|
+
export * from "./RangeContent";
|
|
47
|
+
export * from "./SelectContent";
|
|
48
|
+
export * from "./TextContent";
|
|
49
|
+
export * from "./TimestampContent";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldContent = exports.FieldType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
+
const ColorContent_1 = require("./ColorContent");
|
|
7
|
+
const DateContent_1 = require("./DateContent");
|
|
8
|
+
const NumberContent_1 = require("./NumberContent");
|
|
9
|
+
const RangeContent_1 = require("./RangeContent");
|
|
10
|
+
const SelectContent_1 = require("./SelectContent");
|
|
11
|
+
const TextContent_1 = require("./TextContent");
|
|
12
|
+
const TimestampContent_1 = require("./TimestampContent");
|
|
13
|
+
exports.FieldType = t.keyof({
|
|
14
|
+
Text: null,
|
|
15
|
+
Date: null,
|
|
16
|
+
Timestamp: null,
|
|
17
|
+
Color: null,
|
|
18
|
+
Number: null,
|
|
19
|
+
Range: null,
|
|
20
|
+
Select: null,
|
|
21
|
+
});
|
|
22
|
+
exports.FieldContent = t.union([
|
|
23
|
+
DateContent_1.DateContent,
|
|
24
|
+
ColorContent_1.ColorContent,
|
|
25
|
+
NumberContent_1.NumberContent,
|
|
26
|
+
RangeContent_1.RangeContent,
|
|
27
|
+
SelectContent_1.SelectContent,
|
|
28
|
+
TextContent_1.TextContent,
|
|
29
|
+
TimestampContent_1.TimestampContent,
|
|
30
|
+
]);
|
|
31
|
+
(0, tslib_1.__exportStar)(require("./ColorContent"), exports);
|
|
32
|
+
(0, tslib_1.__exportStar)(require("./common"), exports);
|
|
33
|
+
(0, tslib_1.__exportStar)(require("./DateContent"), exports);
|
|
34
|
+
(0, tslib_1.__exportStar)(require("./NumberContent"), exports);
|
|
35
|
+
(0, tslib_1.__exportStar)(require("./RangeContent"), exports);
|
|
36
|
+
(0, tslib_1.__exportStar)(require("./SelectContent"), exports);
|
|
37
|
+
(0, tslib_1.__exportStar)(require("./TextContent"), exports);
|
|
38
|
+
(0, tslib_1.__exportStar)(require("./TimestampContent"), exports);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
+
import type { LegacyContentCtx, WithTypes } from "../../LegacyContentCtx";
|
|
3
|
+
export declare const FieldContentType = "FieldContent";
|
|
2
4
|
export declare const FieldType: t.KeyofC<{
|
|
3
5
|
Text: null;
|
|
4
6
|
Date: null;
|
|
@@ -9,6 +11,11 @@ export declare const FieldType: t.KeyofC<{
|
|
|
9
11
|
Select: null;
|
|
10
12
|
}>;
|
|
11
13
|
export declare type FieldType = t.TypeOf<typeof FieldType>;
|
|
14
|
+
export declare const FieldLegacy: (type: FieldType, ctx: LegacyContentCtx) => t.Type<{
|
|
15
|
+
type: "Color" | "Date" | "Number" | "Range" | "Select" | "Text" | "Timestamp";
|
|
16
|
+
value: string;
|
|
17
|
+
__TYPE__: "FieldContent";
|
|
18
|
+
}, WithTypes<string>, unknown>;
|
|
12
19
|
export declare const FieldContent: t.ExactC<t.TypeC<{
|
|
13
20
|
type: t.KeyofC<{
|
|
14
21
|
Text: null;
|
|
@@ -23,4 +30,3 @@ export declare const FieldContent: t.ExactC<t.TypeC<{
|
|
|
23
30
|
__TYPE__: t.LiteralC<"FieldContent">;
|
|
24
31
|
}>>;
|
|
25
32
|
export declare type FieldContent = t.TypeOf<typeof FieldContent>;
|
|
26
|
-
export declare const FieldContentType = "FieldContent";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FieldContent = exports.FieldLegacy = exports.FieldType = exports.FieldContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const fp_ts_1 = require("fp-ts");
|
|
6
|
+
const function_1 = require("fp-ts/lib/function");
|
|
5
7
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const FieldContent_1 = require("../../../documents/widgets/nestable/FieldContent");
|
|
7
8
|
const TrimmedString_1 = (0, tslib_1.__importDefault)(require("../../../validators/TrimmedString"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
exports.FieldContentType = "FieldContent";
|
|
8
11
|
exports.FieldType = t.keyof({
|
|
9
12
|
Text: null,
|
|
10
13
|
Date: null,
|
|
@@ -14,9 +17,21 @@ exports.FieldType = t.keyof({
|
|
|
14
17
|
Range: null,
|
|
15
18
|
Select: null,
|
|
16
19
|
});
|
|
20
|
+
const FieldLegacy = (type, ctx) => new t.Type("FieldLegacy", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.FieldContentType, (u) => {
|
|
21
|
+
return (0, function_1.pipe)(TrimmedString_1.default.decode(u), fp_ts_1.either.map((f) => exports.FieldContent.encode({
|
|
22
|
+
value: f,
|
|
23
|
+
type,
|
|
24
|
+
__TYPE__: exports.FieldContentType,
|
|
25
|
+
})));
|
|
26
|
+
}, (b) => {
|
|
27
|
+
return {
|
|
28
|
+
content: b.value,
|
|
29
|
+
types: { [ctx.keyOfType]: type },
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
exports.FieldLegacy = FieldLegacy;
|
|
17
33
|
exports.FieldContent = t.strict({
|
|
18
34
|
type: exports.FieldType,
|
|
19
35
|
value: TrimmedString_1.default,
|
|
20
|
-
__TYPE__: t.literal(
|
|
36
|
+
__TYPE__: t.literal(exports.FieldContentType),
|
|
21
37
|
});
|
|
22
|
-
exports.FieldContentType = FieldContent_1.FieldContentType;
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
|
|
2
|
+
import type { LegacyContentCtx, WithTypes } from "../../LegacyContentCtx";
|
|
3
|
+
export declare const GeoPointContentType = "GeoPointContent";
|
|
4
|
+
export declare const isGeoPointContent: (u: unknown) => u is {
|
|
3
5
|
position: {
|
|
4
6
|
lat: number;
|
|
5
7
|
lng: number;
|
|
6
8
|
};
|
|
7
|
-
}
|
|
9
|
+
} & {
|
|
10
|
+
__TYPE__: "GeoPointContent";
|
|
11
|
+
};
|
|
12
|
+
export declare const GeoPointLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
8
13
|
position: {
|
|
9
14
|
lat: number;
|
|
10
15
|
lng: number;
|
|
11
16
|
};
|
|
12
17
|
} & {
|
|
13
18
|
__TYPE__: "GeoPointContent";
|
|
14
|
-
},
|
|
19
|
+
}, WithTypes<{
|
|
20
|
+
position: {
|
|
21
|
+
lat: number;
|
|
22
|
+
lng: number;
|
|
23
|
+
};
|
|
24
|
+
}>, unknown>;
|
|
25
|
+
export declare const GeoPointContent: t.IntersectionC<[t.ExactC<t.TypeC<{
|
|
26
|
+
position: t.ExactC<t.TypeC<{
|
|
27
|
+
lat: t.NumberC;
|
|
28
|
+
lng: t.NumberC;
|
|
29
|
+
}>>;
|
|
30
|
+
}>>, t.ExactC<t.TypeC<{
|
|
15
31
|
__TYPE__: t.LiteralC<"GeoPointContent">;
|
|
16
32
|
}>>]>;
|
|
17
33
|
export declare type GeoPointContent = t.TypeOf<typeof GeoPointContent>;
|
|
18
|
-
export declare const GeoPointContentType = "GeoPointContent";
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GeoPointContent = exports.GeoPointLegacy = exports.isGeoPointContent = exports.GeoPointContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const fp_ts_1 = require("fp-ts");
|
|
6
|
+
const function_1 = require("fp-ts/function");
|
|
5
7
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
exports.GeoPointContentType = "GeoPointContent";
|
|
10
|
+
const isGeoPointContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.GeoPointContentType;
|
|
11
|
+
exports.isGeoPointContent = isGeoPointContent;
|
|
12
|
+
const legacyReader = t.strict({
|
|
13
|
+
position: t.strict({
|
|
14
|
+
lat: t.number,
|
|
15
|
+
lng: t.number,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
const GeoPointLegacy = (ctx) => new t.Type("GeoPointLegacy", exports.isGeoPointContent, (u) => {
|
|
19
|
+
return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((geo) => exports.GeoPointContent.encode({ ...geo, __TYPE__: exports.GeoPointContentType })));
|
|
20
|
+
}, (geo) => ({
|
|
21
|
+
content: { position: geo.position },
|
|
22
|
+
types: { [ctx.keyOfType]: "GeoPoint" },
|
|
23
|
+
}));
|
|
24
|
+
exports.GeoPointLegacy = GeoPointLegacy;
|
|
7
25
|
exports.GeoPointContent = t.intersection([
|
|
8
|
-
|
|
26
|
+
legacyReader,
|
|
9
27
|
t.strict({
|
|
10
|
-
__TYPE__: t.literal(
|
|
28
|
+
__TYPE__: t.literal(exports.GeoPointContentType),
|
|
11
29
|
}),
|
|
12
30
|
]);
|
|
13
|
-
exports.GeoPointContentType = GeoPointContent_1.GeoPointContentType;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
import {
|
|
3
|
-
export declare const ImageContent
|
|
2
|
+
import type { LegacyContentCtx, WithTypes } from "../../LegacyContentCtx";
|
|
3
|
+
export declare const ImageContentType = "ImageContent";
|
|
4
|
+
export declare const isImageContent: (u: unknown) => u is {
|
|
4
5
|
origin: {
|
|
5
6
|
id: string;
|
|
6
7
|
url: string;
|
|
@@ -48,7 +49,34 @@ export declare const ImageContent: t.IntersectionC<[t.Type<{
|
|
|
48
49
|
provider?: string | null | undefined;
|
|
49
50
|
};
|
|
50
51
|
};
|
|
51
|
-
}
|
|
52
|
+
} & {
|
|
53
|
+
__TYPE__: "ImageContent";
|
|
54
|
+
};
|
|
55
|
+
export declare const ImageContentView: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
56
|
+
origin: t.ExactC<t.TypeC<{
|
|
57
|
+
id: t.StringC;
|
|
58
|
+
url: t.StringC;
|
|
59
|
+
width: t.NumberC;
|
|
60
|
+
height: t.NumberC;
|
|
61
|
+
}>>;
|
|
62
|
+
width: t.NumberC;
|
|
63
|
+
height: t.NumberC;
|
|
64
|
+
edit: t.TypeC<{
|
|
65
|
+
zoom: t.NumberC;
|
|
66
|
+
crop: t.TypeC<{
|
|
67
|
+
x: t.NumberC;
|
|
68
|
+
y: t.NumberC;
|
|
69
|
+
}>;
|
|
70
|
+
background: t.StringC;
|
|
71
|
+
}>;
|
|
72
|
+
}>, t.PartialC<{
|
|
73
|
+
url: t.StringC;
|
|
74
|
+
credits: t.Type<string | null, string | null, unknown>;
|
|
75
|
+
alt: t.Type<string | null, string | null, unknown>;
|
|
76
|
+
provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
77
|
+
}>]>>;
|
|
78
|
+
export declare type ImageContentView = t.TypeOf<typeof ImageContentView>;
|
|
79
|
+
export declare const ImageLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
52
80
|
origin: {
|
|
53
81
|
id: string;
|
|
54
82
|
url: string;
|
|
@@ -98,12 +126,56 @@ export declare const ImageContent: t.IntersectionC<[t.Type<{
|
|
|
98
126
|
};
|
|
99
127
|
} & {
|
|
100
128
|
__TYPE__: "ImageContent";
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
129
|
+
}, WithTypes<{
|
|
130
|
+
origin: {
|
|
131
|
+
id: string;
|
|
132
|
+
url: string;
|
|
133
|
+
width: number;
|
|
134
|
+
height: number;
|
|
135
|
+
};
|
|
136
|
+
width: number;
|
|
137
|
+
height: number;
|
|
138
|
+
edit: {
|
|
139
|
+
zoom: number;
|
|
140
|
+
crop: {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
};
|
|
144
|
+
background: string;
|
|
145
|
+
};
|
|
146
|
+
} & {
|
|
147
|
+
url?: string;
|
|
148
|
+
credits?: string | null;
|
|
149
|
+
alt?: string | null;
|
|
150
|
+
provider?: string | null | undefined;
|
|
151
|
+
} & {
|
|
152
|
+
thumbnails?: {
|
|
153
|
+
[x: string]: {
|
|
154
|
+
origin: {
|
|
155
|
+
id: string;
|
|
156
|
+
url: string;
|
|
157
|
+
width: number;
|
|
158
|
+
height: number;
|
|
159
|
+
};
|
|
160
|
+
width: number;
|
|
161
|
+
height: number;
|
|
162
|
+
edit: {
|
|
163
|
+
zoom: number;
|
|
164
|
+
crop: {
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
};
|
|
168
|
+
background: string;
|
|
169
|
+
};
|
|
170
|
+
} & {
|
|
171
|
+
url?: string;
|
|
172
|
+
credits?: string | null;
|
|
173
|
+
alt?: string | null;
|
|
174
|
+
provider?: string | null | undefined;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
}>, unknown>;
|
|
178
|
+
export declare const ImageContent: t.IntersectionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
107
179
|
origin: t.ExactC<t.TypeC<{
|
|
108
180
|
id: t.StringC;
|
|
109
181
|
url: t.StringC;
|
|
@@ -125,5 +197,31 @@ export declare const ImageContentView: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
125
197
|
credits: t.Type<string | null, string | null, unknown>;
|
|
126
198
|
alt: t.Type<string | null, string | null, unknown>;
|
|
127
199
|
provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
128
|
-
}>]
|
|
129
|
-
|
|
200
|
+
}>]>>, t.PartialC<{
|
|
201
|
+
thumbnails: t.RecordC<t.StringC, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
202
|
+
origin: t.ExactC<t.TypeC<{
|
|
203
|
+
id: t.StringC;
|
|
204
|
+
url: t.StringC;
|
|
205
|
+
width: t.NumberC;
|
|
206
|
+
height: t.NumberC;
|
|
207
|
+
}>>;
|
|
208
|
+
width: t.NumberC;
|
|
209
|
+
height: t.NumberC;
|
|
210
|
+
edit: t.TypeC<{
|
|
211
|
+
zoom: t.NumberC;
|
|
212
|
+
crop: t.TypeC<{
|
|
213
|
+
x: t.NumberC;
|
|
214
|
+
y: t.NumberC;
|
|
215
|
+
}>;
|
|
216
|
+
background: t.StringC;
|
|
217
|
+
}>;
|
|
218
|
+
}>, t.PartialC<{
|
|
219
|
+
url: t.StringC;
|
|
220
|
+
credits: t.Type<string | null, string | null, unknown>;
|
|
221
|
+
alt: t.Type<string | null, string | null, unknown>;
|
|
222
|
+
provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
223
|
+
}>]>>>;
|
|
224
|
+
}>]>, t.ExactC<t.TypeC<{
|
|
225
|
+
__TYPE__: t.LiteralC<"ImageContent">;
|
|
226
|
+
}>>]>;
|
|
227
|
+
export declare type ImageContent = t.TypeOf<typeof ImageContent>;
|
|
@@ -1,14 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImageContentView = exports.
|
|
3
|
+
exports.ImageContent = exports.ImageLegacy = exports.ImageContentView = exports.isImageContent = exports.ImageContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const fp_ts_1 = require("fp-ts");
|
|
6
|
+
const function_1 = require("fp-ts/lib/function");
|
|
5
7
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const
|
|
8
|
+
const Objects_1 = require("../../../utils/Objects");
|
|
9
|
+
const validators_1 = require("../../../validators");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
exports.ImageContentType = "ImageContent";
|
|
12
|
+
const isImageContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.ImageContentType;
|
|
13
|
+
exports.isImageContent = isImageContent;
|
|
14
|
+
const originReader = t.exact(t.type({
|
|
15
|
+
id: t.string,
|
|
16
|
+
url: t.string,
|
|
17
|
+
width: t.number,
|
|
18
|
+
height: t.number,
|
|
19
|
+
}));
|
|
20
|
+
exports.ImageContentView = t.exact(t.intersection([
|
|
21
|
+
t.type({
|
|
22
|
+
origin: originReader,
|
|
23
|
+
width: t.number,
|
|
24
|
+
height: t.number,
|
|
25
|
+
edit: t.type({
|
|
26
|
+
zoom: t.number,
|
|
27
|
+
crop: t.type({
|
|
28
|
+
x: t.number,
|
|
29
|
+
y: t.number,
|
|
30
|
+
}),
|
|
31
|
+
background: t.string,
|
|
32
|
+
}),
|
|
33
|
+
}),
|
|
34
|
+
t.partial({
|
|
35
|
+
url: t.string,
|
|
36
|
+
credits: validators_1.NonEmptyStringOrNull,
|
|
37
|
+
alt: validators_1.NonEmptyStringOrNull,
|
|
38
|
+
provider: validators_1.StringOrNull,
|
|
39
|
+
}),
|
|
40
|
+
]));
|
|
41
|
+
const legacyReader = t.intersection([
|
|
42
|
+
exports.ImageContentView,
|
|
43
|
+
t.partial({
|
|
44
|
+
thumbnails: t.record(t.string, exports.ImageContentView),
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
47
|
+
const ImageLegacy = (ctx) => new t.Type("ImageLegacy", exports.isImageContent, (u) => {
|
|
48
|
+
return (0, function_1.pipe)(legacyReader.decode(u), fp_ts_1.either.map((i) => exports.ImageContent.encode({ ...i, __TYPE__: exports.ImageContentType })));
|
|
49
|
+
}, (i) => {
|
|
50
|
+
return {
|
|
51
|
+
content: (0, Objects_1.withOptionals)({
|
|
52
|
+
edit: i.edit,
|
|
53
|
+
height: i.height,
|
|
54
|
+
origin: i.origin,
|
|
55
|
+
width: i.width,
|
|
56
|
+
}, [
|
|
57
|
+
["alt", i.alt],
|
|
58
|
+
["credits", i.credits],
|
|
59
|
+
["provider", i.provider],
|
|
60
|
+
["thumbnails", i.thumbnails],
|
|
61
|
+
["url", i.url],
|
|
62
|
+
]),
|
|
63
|
+
types: { [ctx.keyOfType]: "Image" },
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
exports.ImageLegacy = ImageLegacy;
|
|
7
67
|
exports.ImageContent = t.intersection([
|
|
8
|
-
|
|
68
|
+
legacyReader,
|
|
9
69
|
t.strict({
|
|
10
|
-
__TYPE__: t.literal(
|
|
70
|
+
__TYPE__: t.literal(exports.ImageContentType),
|
|
11
71
|
}),
|
|
12
72
|
]);
|
|
13
|
-
exports.ImageContentType = ImageContent_1.ImageContentType;
|
|
14
|
-
exports.ImageContentView = ImageContent_1.ImageContentView;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
+
import type { LegacyContentCtx, WithTypes } from "../../LegacyContentCtx";
|
|
3
|
+
export declare const IntegrationFieldContentType = "IntegrationFieldsContent";
|
|
4
|
+
export declare const isIntegrationFieldContent: (u: unknown) => u is {
|
|
5
|
+
__TYPE__: "IntegrationFieldsContent";
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const IntegrationFieldLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
9
|
+
__TYPE__: "IntegrationFieldsContent";
|
|
10
|
+
value: string;
|
|
11
|
+
}, WithTypes<string>, unknown>;
|
|
2
12
|
export declare const IntegrationFieldContent: t.ExactC<t.TypeC<{
|
|
3
13
|
__TYPE__: t.LiteralC<"IntegrationFieldsContent">;
|
|
4
14
|
value: t.StringC;
|
|
5
15
|
}>>;
|
|
6
16
|
export declare type IntegrationFieldContent = t.TypeOf<typeof IntegrationFieldContent>;
|
|
7
|
-
export declare const IntegrationFieldsContentType = "IntegrationFieldsContent";
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.IntegrationFieldContent = exports.IntegrationFieldLegacy = exports.isIntegrationFieldContent = exports.IntegrationFieldContentType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const fp_ts_1 = require("fp-ts");
|
|
6
|
+
const function_1 = require("fp-ts/lib/function");
|
|
5
7
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
exports.IntegrationFieldContentType = "IntegrationFieldsContent";
|
|
10
|
+
const isIntegrationFieldContent = (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.IntegrationFieldContentType;
|
|
11
|
+
exports.isIntegrationFieldContent = isIntegrationFieldContent;
|
|
12
|
+
const IntegrationFieldLegacy = (ctx) => new t.Type("IntegrationFieldLegacy", exports.isIntegrationFieldContent, (u) => {
|
|
13
|
+
return (0, function_1.pipe)(t.string.decode(u), fp_ts_1.either.map((i) => exports.IntegrationFieldContent.encode({
|
|
14
|
+
value: i,
|
|
15
|
+
__TYPE__: exports.IntegrationFieldContentType,
|
|
16
|
+
})));
|
|
17
|
+
}, (i) => {
|
|
18
|
+
return {
|
|
19
|
+
content: i.value,
|
|
20
|
+
types: { [ctx.keyOfType]: "IntegrationFields" },
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
exports.IntegrationFieldLegacy = IntegrationFieldLegacy;
|
|
7
24
|
exports.IntegrationFieldContent = t.strict({
|
|
8
|
-
__TYPE__: t.literal(
|
|
25
|
+
__TYPE__: t.literal(exports.IntegrationFieldContentType),
|
|
9
26
|
value: t.string,
|
|
10
27
|
});
|
|
11
|
-
exports.IntegrationFieldsContentType = IntegrationFieldsContent_1.IntegrationFieldsContentType;
|