@prismicio/types-internal 2.0.0-beta.0 → 2.1.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 +1 -1
- package/lib/common/WidgetKey.js +1 -1
- package/lib/common/index.js +1 -1
- package/lib/content/Document.d.ts +20 -100
- package/lib/content/Document.js +1 -1
- package/lib/content/LegacyContentCtx.d.ts +2 -2
- package/lib/content/LegacyContentCtx.js +1 -1
- package/lib/content/fields/EmptyContent.d.ts +1 -1
- package/lib/content/fields/EmptyContent.js +1 -1
- package/lib/content/fields/GroupContent.d.ts +8 -28
- package/lib/content/fields/GroupContent.js +1 -1
- package/lib/content/fields/UIDContent.d.ts +1 -1
- package/lib/content/fields/UIDContent.js +1 -1
- package/lib/content/fields/WidgetContent.d.ts +18 -98
- package/lib/content/fields/WidgetContent.js +1 -1
- package/lib/content/fields/index.js +6 -6
- package/lib/content/fields/nestable/BooleanContent.d.ts +1 -1
- package/lib/content/fields/nestable/BooleanContent.js +1 -1
- package/lib/content/fields/nestable/EmbedContent.d.ts +2 -2
- package/lib/content/fields/nestable/EmbedContent.js +1 -1
- package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/ColorContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/DateContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/NumberContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/RangeContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/SelectContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/TextContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +1 -1
- package/lib/content/fields/nestable/FieldContent/TimestampContent.js +2 -2
- package/lib/content/fields/nestable/FieldContent/index.d.ts +2 -2
- package/lib/content/fields/nestable/FieldContent/index.js +9 -9
- package/lib/content/fields/nestable/GeoPointContent.d.ts +1 -1
- package/lib/content/fields/nestable/GeoPointContent.js +1 -1
- package/lib/content/fields/nestable/ImageContent.d.ts +2 -2
- package/lib/content/fields/nestable/ImageContent.js +1 -1
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +1 -1
- package/lib/content/fields/nestable/IntegrationFieldContent.js +1 -1
- package/lib/content/fields/nestable/LinkContent.d.ts +6 -6
- package/lib/content/fields/nestable/LinkContent.js +1 -1
- package/lib/content/fields/nestable/NestableContent.d.ts +4 -14
- package/lib/content/fields/nestable/NestableContent.js +1 -1
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +11 -31
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +15 -11
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +3 -13
- package/lib/content/fields/nestable/RichTextContent/index.js +3 -3
- package/lib/content/fields/nestable/SeparatorContent.d.ts +1 -1
- package/lib/content/fields/nestable/SeparatorContent.js +1 -1
- package/lib/content/fields/nestable/index.js +10 -10
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +5 -25
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +1 -1
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +2 -12
- package/lib/content/fields/slices/Slice/RepeatableContent.js +1 -1
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +5 -25
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +1 -1
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +279 -27
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +6 -2
- package/lib/content/fields/slices/Slice/index.d.ts +285 -73
- package/lib/content/fields/slices/Slice/index.js +4 -4
- package/lib/content/fields/slices/SliceItem.d.ts +13 -73
- package/lib/content/fields/slices/SliceItem.js +1 -1
- package/lib/content/fields/slices/SlicesContent.d.ts +14 -74
- package/lib/content/fields/slices/SlicesContent.js +1 -1
- package/lib/content/fields/slices/index.js +3 -3
- package/lib/content/index.js +3 -3
- package/lib/content/utils.d.ts +2 -2
- package/lib/content/utils.js +2 -1
- package/lib/customtypes/CustomType.d.ts +210 -16
- package/lib/customtypes/CustomType.js +7 -2
- package/lib/customtypes/Section.d.ts +198 -16
- package/lib/customtypes/Section.js +1 -1
- package/lib/customtypes/diff/Changes.d.ts +4 -4
- package/lib/customtypes/diff/SharedSlice.d.ts +723 -3
- package/lib/customtypes/diff/Variation.d.ts +709 -3
- package/lib/customtypes/diff/index.js +3 -3
- package/lib/customtypes/index.js +4 -4
- package/lib/customtypes/widgets/Group.d.ts +56 -4
- package/lib/customtypes/widgets/Group.js +1 -1
- package/lib/customtypes/widgets/UID.d.ts +2 -2
- package/lib/customtypes/widgets/UID.js +1 -1
- package/lib/customtypes/widgets/Widget.d.ts +305 -19
- package/lib/customtypes/widgets/Widget.js +1 -1
- package/lib/customtypes/widgets/index.js +6 -6
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/BooleanField.js +1 -1
- package/lib/customtypes/widgets/nestable/Color.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Color.js +1 -1
- package/lib/customtypes/widgets/nestable/Date.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Date.js +1 -1
- package/lib/customtypes/widgets/nestable/Embed.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Embed.js +1 -1
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/GeoPoint.js +1 -1
- package/lib/customtypes/widgets/nestable/Image.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/Image.js +2 -2
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/IntegrationField.js +1 -1
- package/lib/customtypes/widgets/nestable/Link/ContentRelationshipResolver.d.ts +29 -0
- package/lib/customtypes/widgets/nestable/Link/ContentRelationshipResolver.js +44 -0
- package/lib/customtypes/widgets/nestable/Link/index.d.ts +82 -0
- package/lib/customtypes/widgets/nestable/{Link.js → Link/index.js} +5 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +29 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.js +1 -1
- package/lib/customtypes/widgets/nestable/Number.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Number.js +1 -1
- package/lib/customtypes/widgets/nestable/Range.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Range.js +1 -1
- package/lib/customtypes/widgets/nestable/RichText.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/RichText.js +2 -2
- package/lib/customtypes/widgets/nestable/Select.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Select.js +1 -1
- package/lib/customtypes/widgets/nestable/Separator.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Separator.js +1 -1
- package/lib/customtypes/widgets/nestable/Text.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Text.js +1 -1
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +2 -2
- package/lib/customtypes/widgets/nestable/Timestamp.js +1 -1
- package/lib/customtypes/widgets/nestable/index.js +16 -16
- package/lib/customtypes/widgets/shared/ImageConstraint.d.ts +1 -1
- package/lib/customtypes/widgets/shared/ImageConstraint.js +1 -1
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +56 -4
- package/lib/customtypes/widgets/slices/CompositeSlice.js +1 -1
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +55 -3
- package/lib/customtypes/widgets/slices/LegacySlice.js +1 -1
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +110 -6
- package/lib/customtypes/widgets/slices/SharedSlice.js +1 -1
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +1 -1
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +1 -1
- package/lib/customtypes/widgets/slices/Slice.d.ts +2 -2
- package/lib/customtypes/widgets/slices/Slices.d.ts +497 -29
- package/lib/customtypes/widgets/slices/Slices.js +1 -1
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +1 -1
- package/lib/customtypes/widgets/slices/SlicesTypes.js +1 -1
- package/lib/customtypes/widgets/slices/index.js +7 -7
- package/lib/utils/index.js +2 -2
- package/lib/validators/DateFromString.js +1 -1
- package/lib/validators/DateFromStringOrNumber.js +1 -1
- package/lib/validators/DateFromTsMs.js +1 -1
- package/lib/validators/IntFromNumber.d.ts +2 -2
- package/lib/validators/IntFromNumber.js +1 -1
- package/lib/validators/IntFromPixels.d.ts +2 -2
- package/lib/validators/IntFromPixels.js +1 -1
- package/lib/validators/NonEmptyString.js +1 -1
- package/lib/validators/NonEmptyStringOrNull.js +1 -1
- package/lib/validators/NumberOrNull.js +1 -1
- package/lib/validators/StringFromBoolean.d.ts +2 -2
- package/lib/validators/StringFromBoolean.js +1 -1
- package/lib/validators/StringFromNumber.d.ts +2 -2
- package/lib/validators/StringFromNumber.js +1 -1
- package/lib/validators/StringOrNull.js +1 -1
- package/lib/validators/TrimmedString.d.ts +2 -2
- package/lib/validators/TrimmedString.js +1 -1
- package/lib/validators/function.js +1 -1
- package/lib/validators/index.js +12 -12
- package/package.json +1 -1
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +31 -23
- package/src/content/fields/nestable/RichTextContent/index.ts +1 -3
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +4 -1
- package/src/customtypes/CustomType.ts +6 -0
- package/src/customtypes/widgets/nestable/Link/ContentRelationshipResolver.ts +69 -0
- package/src/customtypes/widgets/nestable/{Link.ts → Link/index.ts} +5 -2
- package/lib/customtypes/widgets/nestable/Link.d.ts +0 -29
|
@@ -1631,7 +1631,7 @@ export declare const isSlicesContent: (u: unknown) => u is {
|
|
|
1631
1631
|
};
|
|
1632
1632
|
}[];
|
|
1633
1633
|
};
|
|
1634
|
-
type SlicesLegacy = Array<unknown>;
|
|
1634
|
+
declare type SlicesLegacy = Array<unknown>;
|
|
1635
1635
|
export declare const SlicesLegacy: (ctx: LegacyContentCtx) => t.Type<{
|
|
1636
1636
|
__TYPE__: "SliceContentType";
|
|
1637
1637
|
value: {
|
|
@@ -3489,8 +3489,6 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
3489
3489
|
title?: string;
|
|
3490
3490
|
} | null | undefined;
|
|
3491
3491
|
}), ({
|
|
3492
|
-
__TYPE__: "ImageLink";
|
|
3493
|
-
} & {
|
|
3494
3492
|
id: string;
|
|
3495
3493
|
url: string;
|
|
3496
3494
|
height: string;
|
|
@@ -3508,17 +3506,9 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
3508
3506
|
size: string;
|
|
3509
3507
|
} & {
|
|
3510
3508
|
date?: string | null | undefined;
|
|
3511
|
-
}
|
|
3512
|
-
__TYPE__: "FileLink";
|
|
3513
|
-
} & {
|
|
3514
|
-
size?: string;
|
|
3515
|
-
}) | ({
|
|
3516
|
-
__TYPE__: "DocumentLink";
|
|
3517
|
-
} & {
|
|
3509
|
+
}) | {
|
|
3518
3510
|
id: string;
|
|
3519
|
-
}
|
|
3520
|
-
__TYPE__: "ExternalLink";
|
|
3521
|
-
} & {
|
|
3511
|
+
} | ({
|
|
3522
3512
|
url: string;
|
|
3523
3513
|
} & {
|
|
3524
3514
|
kind?: "web";
|
|
@@ -3802,8 +3792,6 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
3802
3792
|
title?: string;
|
|
3803
3793
|
} | null | undefined;
|
|
3804
3794
|
}), ({
|
|
3805
|
-
__TYPE__: "ImageLink";
|
|
3806
|
-
} & {
|
|
3807
3795
|
id: string;
|
|
3808
3796
|
url: string;
|
|
3809
3797
|
height: string;
|
|
@@ -3821,17 +3809,9 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
3821
3809
|
size: string;
|
|
3822
3810
|
} & {
|
|
3823
3811
|
date?: string | null | undefined;
|
|
3824
|
-
}
|
|
3825
|
-
__TYPE__: "FileLink";
|
|
3826
|
-
} & {
|
|
3827
|
-
size?: string;
|
|
3828
|
-
}) | ({
|
|
3829
|
-
__TYPE__: "DocumentLink";
|
|
3830
|
-
} & {
|
|
3812
|
+
}) | {
|
|
3831
3813
|
id: string;
|
|
3832
|
-
}
|
|
3833
|
-
__TYPE__: "ExternalLink";
|
|
3834
|
-
} & {
|
|
3814
|
+
} | ({
|
|
3835
3815
|
url: string;
|
|
3836
3816
|
} & {
|
|
3837
3817
|
kind?: "web";
|
|
@@ -4117,8 +4097,6 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
4117
4097
|
title?: string;
|
|
4118
4098
|
} | null | undefined;
|
|
4119
4099
|
}), ({
|
|
4120
|
-
__TYPE__: "ImageLink";
|
|
4121
|
-
} & {
|
|
4122
4100
|
id: string;
|
|
4123
4101
|
url: string;
|
|
4124
4102
|
height: string;
|
|
@@ -4136,17 +4114,9 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
4136
4114
|
size: string;
|
|
4137
4115
|
} & {
|
|
4138
4116
|
date?: string | null | undefined;
|
|
4139
|
-
}
|
|
4140
|
-
__TYPE__: "FileLink";
|
|
4141
|
-
} & {
|
|
4142
|
-
size?: string;
|
|
4143
|
-
}) | ({
|
|
4144
|
-
__TYPE__: "DocumentLink";
|
|
4145
|
-
} & {
|
|
4117
|
+
}) | {
|
|
4146
4118
|
id: string;
|
|
4147
|
-
}
|
|
4148
|
-
__TYPE__: "ExternalLink";
|
|
4149
|
-
} & {
|
|
4119
|
+
} | ({
|
|
4150
4120
|
url: string;
|
|
4151
4121
|
} & {
|
|
4152
4122
|
kind?: "web";
|
|
@@ -4430,8 +4400,6 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
4430
4400
|
title?: string;
|
|
4431
4401
|
} | null | undefined;
|
|
4432
4402
|
}), ({
|
|
4433
|
-
__TYPE__: "ImageLink";
|
|
4434
|
-
} & {
|
|
4435
4403
|
id: string;
|
|
4436
4404
|
url: string;
|
|
4437
4405
|
height: string;
|
|
@@ -4449,17 +4417,9 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
4449
4417
|
size: string;
|
|
4450
4418
|
} & {
|
|
4451
4419
|
date?: string | null | undefined;
|
|
4452
|
-
}
|
|
4453
|
-
__TYPE__: "FileLink";
|
|
4454
|
-
} & {
|
|
4455
|
-
size?: string;
|
|
4456
|
-
}) | ({
|
|
4457
|
-
__TYPE__: "DocumentLink";
|
|
4458
|
-
} & {
|
|
4420
|
+
}) | {
|
|
4459
4421
|
id: string;
|
|
4460
|
-
}
|
|
4461
|
-
__TYPE__: "ExternalLink";
|
|
4462
|
-
} & {
|
|
4422
|
+
} | ({
|
|
4463
4423
|
url: string;
|
|
4464
4424
|
} & {
|
|
4465
4425
|
kind?: "web";
|
|
@@ -4742,8 +4702,6 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
4742
4702
|
title?: string;
|
|
4743
4703
|
} | null | undefined;
|
|
4744
4704
|
}), ({
|
|
4745
|
-
__TYPE__: "ImageLink";
|
|
4746
|
-
} & {
|
|
4747
4705
|
id: string;
|
|
4748
4706
|
url: string;
|
|
4749
4707
|
height: string;
|
|
@@ -4761,17 +4719,9 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
4761
4719
|
size: string;
|
|
4762
4720
|
} & {
|
|
4763
4721
|
date?: string | null | undefined;
|
|
4764
|
-
}
|
|
4765
|
-
__TYPE__: "FileLink";
|
|
4766
|
-
} & {
|
|
4767
|
-
size?: string;
|
|
4768
|
-
}) | ({
|
|
4769
|
-
__TYPE__: "DocumentLink";
|
|
4770
|
-
} & {
|
|
4722
|
+
}) | {
|
|
4771
4723
|
id: string;
|
|
4772
|
-
}
|
|
4773
|
-
__TYPE__: "ExternalLink";
|
|
4774
|
-
} & {
|
|
4724
|
+
} | ({
|
|
4775
4725
|
url: string;
|
|
4776
4726
|
} & {
|
|
4777
4727
|
kind?: "web";
|
|
@@ -5056,8 +5006,6 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
5056
5006
|
title?: string;
|
|
5057
5007
|
} | null | undefined;
|
|
5058
5008
|
}), ({
|
|
5059
|
-
__TYPE__: "ImageLink";
|
|
5060
|
-
} & {
|
|
5061
5009
|
id: string;
|
|
5062
5010
|
url: string;
|
|
5063
5011
|
height: string;
|
|
@@ -5075,17 +5023,9 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
5075
5023
|
size: string;
|
|
5076
5024
|
} & {
|
|
5077
5025
|
date?: string | null | undefined;
|
|
5078
|
-
}
|
|
5079
|
-
__TYPE__: "FileLink";
|
|
5080
|
-
} & {
|
|
5081
|
-
size?: string;
|
|
5082
|
-
}) | ({
|
|
5083
|
-
__TYPE__: "DocumentLink";
|
|
5084
|
-
} & {
|
|
5026
|
+
}) | {
|
|
5085
5027
|
id: string;
|
|
5086
|
-
}
|
|
5087
|
-
__TYPE__: "ExternalLink";
|
|
5088
|
-
} & {
|
|
5028
|
+
} | ({
|
|
5089
5029
|
url: string;
|
|
5090
5030
|
} & {
|
|
5091
5031
|
kind?: "web";
|
|
@@ -5152,5 +5092,5 @@ export declare const SlicesContent: t.TypeC<{
|
|
|
5152
5092
|
}>>]>]>;
|
|
5153
5093
|
}>>;
|
|
5154
5094
|
}>;
|
|
5155
|
-
export type SlicesContent = t.TypeOf<typeof SlicesContent>;
|
|
5095
|
+
export declare type SlicesContent = t.TypeOf<typeof SlicesContent>;
|
|
5156
5096
|
export {};
|
|
@@ -4,7 +4,7 @@ exports.SlicesContent = exports.SlicesLegacy = exports.isSlicesContent = exports
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fp_ts_1 = require("fp-ts");
|
|
6
6
|
const function_1 = require("fp-ts/lib/function");
|
|
7
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
7
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const SliceItem_1 = require("./SliceItem");
|
|
10
10
|
exports.SlicesContentType = "SliceContentType";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./Slice"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./SliceItem"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./SlicesContent"), exports);
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./Slice"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./SliceItem"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./SlicesContent"), exports);
|
package/lib/content/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./Document"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./fields"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./LegacyContentCtx"), exports);
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./Document"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./fields"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./LegacyContentCtx"), exports);
|
package/lib/content/utils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FieldType } from "./fields";
|
|
2
|
-
type WithFieldType = WithContentType & {
|
|
2
|
+
declare type WithFieldType = WithContentType & {
|
|
3
3
|
type: FieldType;
|
|
4
4
|
};
|
|
5
5
|
export declare function hasFieldContentType(obj: unknown): obj is WithFieldType;
|
|
6
|
-
type WithContentType = {
|
|
6
|
+
declare type WithContentType = {
|
|
7
7
|
__TYPE__: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function hasContentType(obj: unknown): obj is WithContentType;
|
package/lib/content/utils.js
CHANGED
|
@@ -4,9 +4,10 @@ exports.hasContentType = exports.hasFieldContentType = void 0;
|
|
|
4
4
|
const Either_1 = require("fp-ts/lib/Either");
|
|
5
5
|
const fields_1 = require("./fields");
|
|
6
6
|
function hasFieldContentType(obj) {
|
|
7
|
+
var _a;
|
|
7
8
|
return (hasContentType(obj) &&
|
|
8
9
|
obj.__TYPE__ === fields_1.FieldContentType &&
|
|
9
|
-
(obj === null ||
|
|
10
|
+
((_a = obj) === null || _a === void 0 ? void 0 : _a.type) !== undefined &&
|
|
10
11
|
typeof obj.type === "string" &&
|
|
11
12
|
(0, Either_1.isRight)(fields_1.FieldType.decode(obj.type)));
|
|
12
13
|
}
|
|
@@ -2,6 +2,10 @@ import { Either } from "fp-ts/lib/Either";
|
|
|
2
2
|
import * as t from "io-ts";
|
|
3
3
|
import type { SharedSlice } from "./widgets/slices/SharedSlice";
|
|
4
4
|
import type { DynamicWidget } from "./widgets/Widget";
|
|
5
|
+
export declare const CustomTypeFormat: {
|
|
6
|
+
page: string;
|
|
7
|
+
custom: string;
|
|
8
|
+
};
|
|
5
9
|
declare class CustomTypeSlicesError extends Error {
|
|
6
10
|
slices: Array<string>;
|
|
7
11
|
message: string;
|
|
@@ -91,7 +95,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
91
95
|
useAsTitle?: boolean;
|
|
92
96
|
placeholder?: string;
|
|
93
97
|
select?: "media" | "document" | "web" | null;
|
|
94
|
-
customtypes?: readonly
|
|
98
|
+
customtypes?: readonly ({
|
|
99
|
+
customTypeId: string;
|
|
100
|
+
} & {
|
|
101
|
+
fields?: readonly ({
|
|
102
|
+
fieldId: string;
|
|
103
|
+
} & {
|
|
104
|
+
customTypes?: readonly {
|
|
105
|
+
customTypeId: string;
|
|
106
|
+
fields: readonly {
|
|
107
|
+
fieldId: string;
|
|
108
|
+
}[];
|
|
109
|
+
}[];
|
|
110
|
+
})[];
|
|
111
|
+
})[];
|
|
95
112
|
masks?: readonly string[];
|
|
96
113
|
tags?: readonly string[];
|
|
97
114
|
allowTargetBlank?: boolean;
|
|
@@ -257,7 +274,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
257
274
|
useAsTitle?: boolean;
|
|
258
275
|
placeholder?: string;
|
|
259
276
|
select?: "media" | "document" | "web" | null;
|
|
260
|
-
customtypes?: readonly
|
|
277
|
+
customtypes?: readonly ({
|
|
278
|
+
customTypeId: string;
|
|
279
|
+
} & {
|
|
280
|
+
fields?: readonly ({
|
|
281
|
+
fieldId: string;
|
|
282
|
+
} & {
|
|
283
|
+
customTypes?: readonly {
|
|
284
|
+
customTypeId: string;
|
|
285
|
+
fields: readonly {
|
|
286
|
+
fieldId: string;
|
|
287
|
+
}[];
|
|
288
|
+
}[];
|
|
289
|
+
})[];
|
|
290
|
+
})[];
|
|
261
291
|
masks?: readonly string[];
|
|
262
292
|
tags?: readonly string[];
|
|
263
293
|
allowTargetBlank?: boolean;
|
|
@@ -430,7 +460,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
430
460
|
useAsTitle?: boolean;
|
|
431
461
|
placeholder?: string;
|
|
432
462
|
select?: "media" | "document" | "web" | null;
|
|
433
|
-
customtypes?: readonly
|
|
463
|
+
customtypes?: readonly ({
|
|
464
|
+
customTypeId: string;
|
|
465
|
+
} & {
|
|
466
|
+
fields?: readonly ({
|
|
467
|
+
fieldId: string;
|
|
468
|
+
} & {
|
|
469
|
+
customTypes?: readonly {
|
|
470
|
+
customTypeId: string;
|
|
471
|
+
fields: readonly {
|
|
472
|
+
fieldId: string;
|
|
473
|
+
}[];
|
|
474
|
+
}[];
|
|
475
|
+
})[];
|
|
476
|
+
})[];
|
|
434
477
|
masks?: readonly string[];
|
|
435
478
|
tags?: readonly string[];
|
|
436
479
|
allowTargetBlank?: boolean;
|
|
@@ -596,7 +639,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
596
639
|
useAsTitle?: boolean;
|
|
597
640
|
placeholder?: string;
|
|
598
641
|
select?: "media" | "document" | "web" | null;
|
|
599
|
-
customtypes?: readonly
|
|
642
|
+
customtypes?: readonly ({
|
|
643
|
+
customTypeId: string;
|
|
644
|
+
} & {
|
|
645
|
+
fields?: readonly ({
|
|
646
|
+
fieldId: string;
|
|
647
|
+
} & {
|
|
648
|
+
customTypes?: readonly {
|
|
649
|
+
customTypeId: string;
|
|
650
|
+
fields: readonly {
|
|
651
|
+
fieldId: string;
|
|
652
|
+
}[];
|
|
653
|
+
}[];
|
|
654
|
+
})[];
|
|
655
|
+
})[];
|
|
600
656
|
masks?: readonly string[];
|
|
601
657
|
tags?: readonly string[];
|
|
602
658
|
allowTargetBlank?: boolean;
|
|
@@ -763,7 +819,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
763
819
|
useAsTitle?: boolean;
|
|
764
820
|
placeholder?: string;
|
|
765
821
|
select?: "media" | "document" | "web" | null;
|
|
766
|
-
customtypes?: readonly
|
|
822
|
+
customtypes?: readonly ({
|
|
823
|
+
customTypeId: string;
|
|
824
|
+
} & {
|
|
825
|
+
fields?: readonly ({
|
|
826
|
+
fieldId: string;
|
|
827
|
+
} & {
|
|
828
|
+
customTypes?: readonly {
|
|
829
|
+
customTypeId: string;
|
|
830
|
+
fields: readonly {
|
|
831
|
+
fieldId: string;
|
|
832
|
+
}[];
|
|
833
|
+
}[];
|
|
834
|
+
})[];
|
|
835
|
+
})[];
|
|
767
836
|
masks?: readonly string[];
|
|
768
837
|
tags?: readonly string[];
|
|
769
838
|
allowTargetBlank?: boolean;
|
|
@@ -922,7 +991,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
922
991
|
useAsTitle?: boolean;
|
|
923
992
|
placeholder?: string;
|
|
924
993
|
select?: "media" | "document" | "web" | null;
|
|
925
|
-
customtypes?: readonly
|
|
994
|
+
customtypes?: readonly ({
|
|
995
|
+
customTypeId: string;
|
|
996
|
+
} & {
|
|
997
|
+
fields?: readonly ({
|
|
998
|
+
fieldId: string;
|
|
999
|
+
} & {
|
|
1000
|
+
customTypes?: readonly {
|
|
1001
|
+
customTypeId: string;
|
|
1002
|
+
fields: readonly {
|
|
1003
|
+
fieldId: string;
|
|
1004
|
+
}[];
|
|
1005
|
+
}[];
|
|
1006
|
+
})[];
|
|
1007
|
+
})[];
|
|
926
1008
|
masks?: readonly string[];
|
|
927
1009
|
tags?: readonly string[];
|
|
928
1010
|
allowTargetBlank?: boolean;
|
|
@@ -1097,7 +1179,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1097
1179
|
useAsTitle?: boolean;
|
|
1098
1180
|
placeholder?: string;
|
|
1099
1181
|
select?: "media" | "document" | "web" | null;
|
|
1100
|
-
customtypes?: readonly
|
|
1182
|
+
customtypes?: readonly ({
|
|
1183
|
+
customTypeId: string;
|
|
1184
|
+
} & {
|
|
1185
|
+
fields?: readonly ({
|
|
1186
|
+
fieldId: string;
|
|
1187
|
+
} & {
|
|
1188
|
+
customTypes?: readonly {
|
|
1189
|
+
customTypeId: string;
|
|
1190
|
+
fields: readonly {
|
|
1191
|
+
fieldId: string;
|
|
1192
|
+
}[];
|
|
1193
|
+
}[];
|
|
1194
|
+
})[];
|
|
1195
|
+
})[];
|
|
1101
1196
|
masks?: readonly string[];
|
|
1102
1197
|
tags?: readonly string[];
|
|
1103
1198
|
allowTargetBlank?: boolean;
|
|
@@ -1256,7 +1351,20 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1256
1351
|
useAsTitle?: boolean;
|
|
1257
1352
|
placeholder?: string;
|
|
1258
1353
|
select?: "media" | "document" | "web" | null;
|
|
1259
|
-
customtypes?: readonly
|
|
1354
|
+
customtypes?: readonly ({
|
|
1355
|
+
customTypeId: string;
|
|
1356
|
+
} & {
|
|
1357
|
+
fields?: readonly ({
|
|
1358
|
+
fieldId: string;
|
|
1359
|
+
} & {
|
|
1360
|
+
customTypes?: readonly {
|
|
1361
|
+
customTypeId: string;
|
|
1362
|
+
fields: readonly {
|
|
1363
|
+
fieldId: string;
|
|
1364
|
+
}[];
|
|
1365
|
+
}[];
|
|
1366
|
+
})[];
|
|
1367
|
+
})[];
|
|
1260
1368
|
masks?: readonly string[];
|
|
1261
1369
|
tags?: readonly string[];
|
|
1262
1370
|
allowTargetBlank?: boolean;
|
|
@@ -1356,8 +1464,12 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1356
1464
|
status: t.BooleanC;
|
|
1357
1465
|
}>, t.PartialC<{
|
|
1358
1466
|
hash: t.StringC;
|
|
1467
|
+
format: t.KeyofC<{
|
|
1468
|
+
page: string;
|
|
1469
|
+
custom: string;
|
|
1470
|
+
}>;
|
|
1359
1471
|
}>]>>;
|
|
1360
|
-
export type StaticCustomType = t.TypeOf<typeof StaticCustomType>;
|
|
1472
|
+
export declare type StaticCustomType = t.TypeOf<typeof StaticCustomType>;
|
|
1361
1473
|
export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1362
1474
|
id: t.StringC;
|
|
1363
1475
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1441,7 +1553,20 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1441
1553
|
useAsTitle?: boolean;
|
|
1442
1554
|
placeholder?: string;
|
|
1443
1555
|
select?: "media" | "document" | "web" | null;
|
|
1444
|
-
customtypes?: readonly
|
|
1556
|
+
customtypes?: readonly ({
|
|
1557
|
+
customTypeId: string;
|
|
1558
|
+
} & {
|
|
1559
|
+
fields?: readonly ({
|
|
1560
|
+
fieldId: string;
|
|
1561
|
+
} & {
|
|
1562
|
+
customTypes?: readonly {
|
|
1563
|
+
customTypeId: string;
|
|
1564
|
+
fields: readonly {
|
|
1565
|
+
fieldId: string;
|
|
1566
|
+
}[];
|
|
1567
|
+
}[];
|
|
1568
|
+
})[];
|
|
1569
|
+
})[];
|
|
1445
1570
|
masks?: readonly string[];
|
|
1446
1571
|
tags?: readonly string[];
|
|
1447
1572
|
allowTargetBlank?: boolean;
|
|
@@ -1607,7 +1732,20 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1607
1732
|
useAsTitle?: boolean;
|
|
1608
1733
|
placeholder?: string;
|
|
1609
1734
|
select?: "media" | "document" | "web" | null;
|
|
1610
|
-
customtypes?: readonly
|
|
1735
|
+
customtypes?: readonly ({
|
|
1736
|
+
customTypeId: string;
|
|
1737
|
+
} & {
|
|
1738
|
+
fields?: readonly ({
|
|
1739
|
+
fieldId: string;
|
|
1740
|
+
} & {
|
|
1741
|
+
customTypes?: readonly {
|
|
1742
|
+
customTypeId: string;
|
|
1743
|
+
fields: readonly {
|
|
1744
|
+
fieldId: string;
|
|
1745
|
+
}[];
|
|
1746
|
+
}[];
|
|
1747
|
+
})[];
|
|
1748
|
+
})[];
|
|
1611
1749
|
masks?: readonly string[];
|
|
1612
1750
|
tags?: readonly string[];
|
|
1613
1751
|
allowTargetBlank?: boolean;
|
|
@@ -1780,7 +1918,20 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1780
1918
|
useAsTitle?: boolean;
|
|
1781
1919
|
placeholder?: string;
|
|
1782
1920
|
select?: "media" | "document" | "web" | null;
|
|
1783
|
-
customtypes?: readonly
|
|
1921
|
+
customtypes?: readonly ({
|
|
1922
|
+
customTypeId: string;
|
|
1923
|
+
} & {
|
|
1924
|
+
fields?: readonly ({
|
|
1925
|
+
fieldId: string;
|
|
1926
|
+
} & {
|
|
1927
|
+
customTypes?: readonly {
|
|
1928
|
+
customTypeId: string;
|
|
1929
|
+
fields: readonly {
|
|
1930
|
+
fieldId: string;
|
|
1931
|
+
}[];
|
|
1932
|
+
}[];
|
|
1933
|
+
})[];
|
|
1934
|
+
})[];
|
|
1784
1935
|
masks?: readonly string[];
|
|
1785
1936
|
tags?: readonly string[];
|
|
1786
1937
|
allowTargetBlank?: boolean;
|
|
@@ -1946,7 +2097,20 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1946
2097
|
useAsTitle?: boolean;
|
|
1947
2098
|
placeholder?: string;
|
|
1948
2099
|
select?: "media" | "document" | "web" | null;
|
|
1949
|
-
customtypes?: readonly
|
|
2100
|
+
customtypes?: readonly ({
|
|
2101
|
+
customTypeId: string;
|
|
2102
|
+
} & {
|
|
2103
|
+
fields?: readonly ({
|
|
2104
|
+
fieldId: string;
|
|
2105
|
+
} & {
|
|
2106
|
+
customTypes?: readonly {
|
|
2107
|
+
customTypeId: string;
|
|
2108
|
+
fields: readonly {
|
|
2109
|
+
fieldId: string;
|
|
2110
|
+
}[];
|
|
2111
|
+
}[];
|
|
2112
|
+
})[];
|
|
2113
|
+
})[];
|
|
1950
2114
|
masks?: readonly string[];
|
|
1951
2115
|
tags?: readonly string[];
|
|
1952
2116
|
allowTargetBlank?: boolean;
|
|
@@ -2113,7 +2277,20 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2113
2277
|
useAsTitle?: boolean;
|
|
2114
2278
|
placeholder?: string;
|
|
2115
2279
|
select?: "media" | "document" | "web" | null;
|
|
2116
|
-
customtypes?: readonly
|
|
2280
|
+
customtypes?: readonly ({
|
|
2281
|
+
customTypeId: string;
|
|
2282
|
+
} & {
|
|
2283
|
+
fields?: readonly ({
|
|
2284
|
+
fieldId: string;
|
|
2285
|
+
} & {
|
|
2286
|
+
customTypes?: readonly {
|
|
2287
|
+
customTypeId: string;
|
|
2288
|
+
fields: readonly {
|
|
2289
|
+
fieldId: string;
|
|
2290
|
+
}[];
|
|
2291
|
+
}[];
|
|
2292
|
+
})[];
|
|
2293
|
+
})[];
|
|
2117
2294
|
masks?: readonly string[];
|
|
2118
2295
|
tags?: readonly string[];
|
|
2119
2296
|
allowTargetBlank?: boolean;
|
|
@@ -2272,7 +2449,20 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2272
2449
|
useAsTitle?: boolean;
|
|
2273
2450
|
placeholder?: string;
|
|
2274
2451
|
select?: "media" | "document" | "web" | null;
|
|
2275
|
-
customtypes?: readonly
|
|
2452
|
+
customtypes?: readonly ({
|
|
2453
|
+
customTypeId: string;
|
|
2454
|
+
} & {
|
|
2455
|
+
fields?: readonly ({
|
|
2456
|
+
fieldId: string;
|
|
2457
|
+
} & {
|
|
2458
|
+
customTypes?: readonly {
|
|
2459
|
+
customTypeId: string;
|
|
2460
|
+
fields: readonly {
|
|
2461
|
+
fieldId: string;
|
|
2462
|
+
}[];
|
|
2463
|
+
}[];
|
|
2464
|
+
})[];
|
|
2465
|
+
})[];
|
|
2276
2466
|
masks?: readonly string[];
|
|
2277
2467
|
tags?: readonly string[];
|
|
2278
2468
|
allowTargetBlank?: boolean;
|
|
@@ -2374,8 +2564,12 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2374
2564
|
status: t.BooleanC;
|
|
2375
2565
|
}>, t.PartialC<{
|
|
2376
2566
|
hash: t.StringC;
|
|
2567
|
+
format: t.KeyofC<{
|
|
2568
|
+
page: string;
|
|
2569
|
+
custom: string;
|
|
2570
|
+
}>;
|
|
2377
2571
|
}>]>>;
|
|
2378
|
-
export type CustomType = t.TypeOf<typeof CustomType>;
|
|
2572
|
+
export declare type CustomType = t.TypeOf<typeof CustomType>;
|
|
2379
2573
|
export declare function flattenWidgets(customType: CustomType): Array<[string, DynamicWidget]>;
|
|
2380
2574
|
export declare function toStatic(customType: CustomType, sharedSlices: Map<string, SharedSlice>): StaticCustomType;
|
|
2381
2575
|
export declare function validateSlices(customType: CustomType, sharedSlices: Map<string, SharedSlice>): Either<CustomTypeSlicesError, CustomType>;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterMissingSharedSlices = exports.collectWidgets = exports.validateSlices = exports.toStatic = exports.flattenWidgets = exports.CustomType = exports.StaticCustomType = void 0;
|
|
3
|
+
exports.filterMissingSharedSlices = exports.collectWidgets = exports.validateSlices = exports.toStatic = exports.flattenWidgets = exports.CustomType = exports.StaticCustomType = exports.CustomTypeFormat = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Either_1 = require("fp-ts/lib/Either");
|
|
6
|
-
const t = tslib_1.__importStar(require("io-ts"));
|
|
6
|
+
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
7
7
|
const withFallback_1 = require("io-ts-types/lib/withFallback");
|
|
8
8
|
const validators_1 = require("../validators");
|
|
9
9
|
const Section_1 = require("./Section");
|
|
10
|
+
exports.CustomTypeFormat = {
|
|
11
|
+
page: "page",
|
|
12
|
+
custom: "custom",
|
|
13
|
+
};
|
|
10
14
|
class CustomTypeSlicesError extends Error {
|
|
11
15
|
constructor(slices) {
|
|
12
16
|
super();
|
|
@@ -43,6 +47,7 @@ function customTypeReader(codec) {
|
|
|
43
47
|
}),
|
|
44
48
|
t.partial({
|
|
45
49
|
hash: t.string,
|
|
50
|
+
format: (0, withFallback_1.withFallback)(t.keyof(exports.CustomTypeFormat), "custom"),
|
|
46
51
|
}),
|
|
47
52
|
]));
|
|
48
53
|
}
|