@prismicio/types-internal 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/customtypes/CustomType.d.ts +14 -14
- package/lib/customtypes/Section.d.ts +17 -17
- package/lib/customtypes/Section.js +1 -2
- package/lib/customtypes/widgets/Group.d.ts +1 -1
- package/lib/customtypes/widgets/Group.js +1 -2
- package/lib/customtypes/widgets/Widget.d.ts +13 -13
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +2 -2
- package/lib/customtypes/widgets/slices/CompositeSlice.js +2 -3
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +1 -1
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +4 -4
- package/lib/customtypes/widgets/slices/SharedSlice.js +2 -3
- package/lib/customtypes/widgets/slices/Slices.d.ts +24 -24
- package/lib/customtypes/widgets/slices/Slices.js +1 -2
- package/lib/documents/widgets/index.d.ts +2 -4
- package/lib/documents/widgets/index.js +1 -6
- package/package.json +1 -1
- package/src/customtypes/Section.ts +1 -2
- package/src/customtypes/widgets/Group.ts +1 -2
- package/src/customtypes/widgets/slices/CompositeSlice.ts +2 -3
- package/src/customtypes/widgets/slices/SharedSlice.ts +2 -3
- package/src/customtypes/widgets/slices/Slices.ts +1 -2
- package/src/documents/widgets/index.ts +5 -9
|
@@ -92,7 +92,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
92
92
|
label?: string | null | undefined;
|
|
93
93
|
useAsTitle?: boolean;
|
|
94
94
|
placeholder?: string;
|
|
95
|
-
select?: "
|
|
95
|
+
select?: "media" | "document" | "web" | null;
|
|
96
96
|
customtypes?: string[];
|
|
97
97
|
masks?: string[];
|
|
98
98
|
tags?: string[];
|
|
@@ -258,7 +258,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
258
258
|
label?: string | null | undefined;
|
|
259
259
|
useAsTitle?: boolean;
|
|
260
260
|
placeholder?: string;
|
|
261
|
-
select?: "
|
|
261
|
+
select?: "media" | "document" | "web" | null;
|
|
262
262
|
customtypes?: string[];
|
|
263
263
|
masks?: string[];
|
|
264
264
|
tags?: string[];
|
|
@@ -431,7 +431,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
431
431
|
label?: string | null | undefined;
|
|
432
432
|
useAsTitle?: boolean;
|
|
433
433
|
placeholder?: string;
|
|
434
|
-
select?: "
|
|
434
|
+
select?: "media" | "document" | "web" | null;
|
|
435
435
|
customtypes?: string[];
|
|
436
436
|
masks?: string[];
|
|
437
437
|
tags?: string[];
|
|
@@ -595,7 +595,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
595
595
|
label?: string | null | undefined;
|
|
596
596
|
useAsTitle?: boolean;
|
|
597
597
|
placeholder?: string;
|
|
598
|
-
select?: "
|
|
598
|
+
select?: "media" | "document" | "web" | null;
|
|
599
599
|
customtypes?: string[];
|
|
600
600
|
masks?: string[];
|
|
601
601
|
tags?: string[];
|
|
@@ -754,7 +754,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
754
754
|
label?: string | null | undefined;
|
|
755
755
|
useAsTitle?: boolean;
|
|
756
756
|
placeholder?: string;
|
|
757
|
-
select?: "
|
|
757
|
+
select?: "media" | "document" | "web" | null;
|
|
758
758
|
customtypes?: string[];
|
|
759
759
|
masks?: string[];
|
|
760
760
|
tags?: string[];
|
|
@@ -925,7 +925,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
925
925
|
label?: string | null | undefined;
|
|
926
926
|
useAsTitle?: boolean;
|
|
927
927
|
placeholder?: string;
|
|
928
|
-
select?: "
|
|
928
|
+
select?: "media" | "document" | "web" | null;
|
|
929
929
|
customtypes?: string[];
|
|
930
930
|
masks?: string[];
|
|
931
931
|
tags?: string[];
|
|
@@ -1098,7 +1098,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1098
1098
|
label?: string | null | undefined;
|
|
1099
1099
|
useAsTitle?: boolean;
|
|
1100
1100
|
placeholder?: string;
|
|
1101
|
-
select?: "
|
|
1101
|
+
select?: "media" | "document" | "web" | null;
|
|
1102
1102
|
customtypes?: string[];
|
|
1103
1103
|
masks?: string[];
|
|
1104
1104
|
tags?: string[];
|
|
@@ -1257,7 +1257,7 @@ export declare const StaticCustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1257
1257
|
label?: string | null | undefined;
|
|
1258
1258
|
useAsTitle?: boolean;
|
|
1259
1259
|
placeholder?: string;
|
|
1260
|
-
select?: "
|
|
1260
|
+
select?: "media" | "document" | "web" | null;
|
|
1261
1261
|
customtypes?: string[];
|
|
1262
1262
|
masks?: string[];
|
|
1263
1263
|
tags?: string[];
|
|
@@ -1442,7 +1442,7 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1442
1442
|
label?: string | null | undefined;
|
|
1443
1443
|
useAsTitle?: boolean;
|
|
1444
1444
|
placeholder?: string;
|
|
1445
|
-
select?: "
|
|
1445
|
+
select?: "media" | "document" | "web" | null;
|
|
1446
1446
|
customtypes?: string[];
|
|
1447
1447
|
masks?: string[];
|
|
1448
1448
|
tags?: string[];
|
|
@@ -1608,7 +1608,7 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1608
1608
|
label?: string | null | undefined;
|
|
1609
1609
|
useAsTitle?: boolean;
|
|
1610
1610
|
placeholder?: string;
|
|
1611
|
-
select?: "
|
|
1611
|
+
select?: "media" | "document" | "web" | null;
|
|
1612
1612
|
customtypes?: string[];
|
|
1613
1613
|
masks?: string[];
|
|
1614
1614
|
tags?: string[];
|
|
@@ -1781,7 +1781,7 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1781
1781
|
label?: string | null | undefined;
|
|
1782
1782
|
useAsTitle?: boolean;
|
|
1783
1783
|
placeholder?: string;
|
|
1784
|
-
select?: "
|
|
1784
|
+
select?: "media" | "document" | "web" | null;
|
|
1785
1785
|
customtypes?: string[];
|
|
1786
1786
|
masks?: string[];
|
|
1787
1787
|
tags?: string[];
|
|
@@ -1945,7 +1945,7 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1945
1945
|
label?: string | null | undefined;
|
|
1946
1946
|
useAsTitle?: boolean;
|
|
1947
1947
|
placeholder?: string;
|
|
1948
|
-
select?: "
|
|
1948
|
+
select?: "media" | "document" | "web" | null;
|
|
1949
1949
|
customtypes?: string[];
|
|
1950
1950
|
masks?: string[];
|
|
1951
1951
|
tags?: string[];
|
|
@@ -2104,7 +2104,7 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2104
2104
|
label?: string | null | undefined;
|
|
2105
2105
|
useAsTitle?: boolean;
|
|
2106
2106
|
placeholder?: string;
|
|
2107
|
-
select?: "
|
|
2107
|
+
select?: "media" | "document" | "web" | null;
|
|
2108
2108
|
customtypes?: string[];
|
|
2109
2109
|
masks?: string[];
|
|
2110
2110
|
tags?: string[];
|
|
@@ -2275,7 +2275,7 @@ export declare const CustomType: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2275
2275
|
label?: string | null | undefined;
|
|
2276
2276
|
useAsTitle?: boolean;
|
|
2277
2277
|
placeholder?: string;
|
|
2278
|
-
select?: "
|
|
2278
|
+
select?: "media" | "document" | "web" | null;
|
|
2279
2279
|
customtypes?: string[];
|
|
2280
2280
|
masks?: string[];
|
|
2281
2281
|
tags?: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import type { SharedSlice } from "./widgets/slices";
|
|
3
3
|
import { DynamicWidget, StaticWidget } from "./widgets/Widget";
|
|
4
|
-
export declare function sectionReader<T extends StaticWidget | DynamicWidget>(codec: t.Type<T, unknown>): t.RecordC<t.
|
|
5
|
-
export declare const StaticSection: t.RecordC<t.
|
|
4
|
+
export declare function sectionReader<T extends StaticWidget | DynamicWidget>(codec: t.Type<T, unknown>): t.RecordC<t.StringC, t.Type<T, unknown, unknown>>;
|
|
5
|
+
export declare const StaticSection: t.RecordC<t.StringC, t.Type<({
|
|
6
6
|
type: import("./widgets/WidgetTypes").default.BooleanField;
|
|
7
7
|
} & {
|
|
8
8
|
config?: {
|
|
@@ -79,7 +79,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
79
79
|
label?: string | null | undefined;
|
|
80
80
|
useAsTitle?: boolean;
|
|
81
81
|
placeholder?: string;
|
|
82
|
-
select?: "
|
|
82
|
+
select?: "media" | "document" | "web" | null;
|
|
83
83
|
customtypes?: string[];
|
|
84
84
|
masks?: string[];
|
|
85
85
|
tags?: string[];
|
|
@@ -245,7 +245,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
245
245
|
label?: string | null | undefined;
|
|
246
246
|
useAsTitle?: boolean;
|
|
247
247
|
placeholder?: string;
|
|
248
|
-
select?: "
|
|
248
|
+
select?: "media" | "document" | "web" | null;
|
|
249
249
|
customtypes?: string[];
|
|
250
250
|
masks?: string[];
|
|
251
251
|
tags?: string[];
|
|
@@ -418,7 +418,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
418
418
|
label?: string | null | undefined;
|
|
419
419
|
useAsTitle?: boolean;
|
|
420
420
|
placeholder?: string;
|
|
421
|
-
select?: "
|
|
421
|
+
select?: "media" | "document" | "web" | null;
|
|
422
422
|
customtypes?: string[];
|
|
423
423
|
masks?: string[];
|
|
424
424
|
tags?: string[];
|
|
@@ -582,7 +582,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
582
582
|
label?: string | null | undefined;
|
|
583
583
|
useAsTitle?: boolean;
|
|
584
584
|
placeholder?: string;
|
|
585
|
-
select?: "
|
|
585
|
+
select?: "media" | "document" | "web" | null;
|
|
586
586
|
customtypes?: string[];
|
|
587
587
|
masks?: string[];
|
|
588
588
|
tags?: string[];
|
|
@@ -741,7 +741,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
741
741
|
label?: string | null | undefined;
|
|
742
742
|
useAsTitle?: boolean;
|
|
743
743
|
placeholder?: string;
|
|
744
|
-
select?: "
|
|
744
|
+
select?: "media" | "document" | "web" | null;
|
|
745
745
|
customtypes?: string[];
|
|
746
746
|
masks?: string[];
|
|
747
747
|
tags?: string[];
|
|
@@ -912,7 +912,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
912
912
|
label?: string | null | undefined;
|
|
913
913
|
useAsTitle?: boolean;
|
|
914
914
|
placeholder?: string;
|
|
915
|
-
select?: "
|
|
915
|
+
select?: "media" | "document" | "web" | null;
|
|
916
916
|
customtypes?: string[];
|
|
917
917
|
masks?: string[];
|
|
918
918
|
tags?: string[];
|
|
@@ -1085,7 +1085,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
1085
1085
|
label?: string | null | undefined;
|
|
1086
1086
|
useAsTitle?: boolean;
|
|
1087
1087
|
placeholder?: string;
|
|
1088
|
-
select?: "
|
|
1088
|
+
select?: "media" | "document" | "web" | null;
|
|
1089
1089
|
customtypes?: string[];
|
|
1090
1090
|
masks?: string[];
|
|
1091
1091
|
tags?: string[];
|
|
@@ -1244,7 +1244,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
1244
1244
|
label?: string | null | undefined;
|
|
1245
1245
|
useAsTitle?: boolean;
|
|
1246
1246
|
placeholder?: string;
|
|
1247
|
-
select?: "
|
|
1247
|
+
select?: "media" | "document" | "web" | null;
|
|
1248
1248
|
customtypes?: string[];
|
|
1249
1249
|
masks?: string[];
|
|
1250
1250
|
tags?: string[];
|
|
@@ -1342,7 +1342,7 @@ export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t
|
|
|
1342
1342
|
};
|
|
1343
1343
|
}), unknown, unknown>>;
|
|
1344
1344
|
export declare type StaticSection = t.TypeOf<typeof StaticSection>;
|
|
1345
|
-
export declare const DynamicSection: t.RecordC<t.
|
|
1345
|
+
export declare const DynamicSection: t.RecordC<t.StringC, t.Type<({
|
|
1346
1346
|
type: import("./widgets/WidgetTypes").default.BooleanField;
|
|
1347
1347
|
} & {
|
|
1348
1348
|
config?: {
|
|
@@ -1419,7 +1419,7 @@ export declare const DynamicSection: t.RecordC<t.Type<string, string, unknown>,
|
|
|
1419
1419
|
label?: string | null | undefined;
|
|
1420
1420
|
useAsTitle?: boolean;
|
|
1421
1421
|
placeholder?: string;
|
|
1422
|
-
select?: "
|
|
1422
|
+
select?: "media" | "document" | "web" | null;
|
|
1423
1423
|
customtypes?: string[];
|
|
1424
1424
|
masks?: string[];
|
|
1425
1425
|
tags?: string[];
|
|
@@ -1585,7 +1585,7 @@ export declare const DynamicSection: t.RecordC<t.Type<string, string, unknown>,
|
|
|
1585
1585
|
label?: string | null | undefined;
|
|
1586
1586
|
useAsTitle?: boolean;
|
|
1587
1587
|
placeholder?: string;
|
|
1588
|
-
select?: "
|
|
1588
|
+
select?: "media" | "document" | "web" | null;
|
|
1589
1589
|
customtypes?: string[];
|
|
1590
1590
|
masks?: string[];
|
|
1591
1591
|
tags?: string[];
|
|
@@ -1758,7 +1758,7 @@ export declare const DynamicSection: t.RecordC<t.Type<string, string, unknown>,
|
|
|
1758
1758
|
label?: string | null | undefined;
|
|
1759
1759
|
useAsTitle?: boolean;
|
|
1760
1760
|
placeholder?: string;
|
|
1761
|
-
select?: "
|
|
1761
|
+
select?: "media" | "document" | "web" | null;
|
|
1762
1762
|
customtypes?: string[];
|
|
1763
1763
|
masks?: string[];
|
|
1764
1764
|
tags?: string[];
|
|
@@ -1922,7 +1922,7 @@ export declare const DynamicSection: t.RecordC<t.Type<string, string, unknown>,
|
|
|
1922
1922
|
label?: string | null | undefined;
|
|
1923
1923
|
useAsTitle?: boolean;
|
|
1924
1924
|
placeholder?: string;
|
|
1925
|
-
select?: "
|
|
1925
|
+
select?: "media" | "document" | "web" | null;
|
|
1926
1926
|
customtypes?: string[];
|
|
1927
1927
|
masks?: string[];
|
|
1928
1928
|
tags?: string[];
|
|
@@ -2081,7 +2081,7 @@ export declare const DynamicSection: t.RecordC<t.Type<string, string, unknown>,
|
|
|
2081
2081
|
label?: string | null | undefined;
|
|
2082
2082
|
useAsTitle?: boolean;
|
|
2083
2083
|
placeholder?: string;
|
|
2084
|
-
select?: "
|
|
2084
|
+
select?: "media" | "document" | "web" | null;
|
|
2085
2085
|
customtypes?: string[];
|
|
2086
2086
|
masks?: string[];
|
|
2087
2087
|
tags?: string[];
|
|
@@ -2252,7 +2252,7 @@ export declare const DynamicSection: t.RecordC<t.Type<string, string, unknown>,
|
|
|
2252
2252
|
label?: string | null | undefined;
|
|
2253
2253
|
useAsTitle?: boolean;
|
|
2254
2254
|
placeholder?: string;
|
|
2255
|
-
select?: "
|
|
2255
|
+
select?: "media" | "document" | "web" | null;
|
|
2256
2256
|
customtypes?: string[];
|
|
2257
2257
|
masks?: string[];
|
|
2258
2258
|
tags?: string[];
|
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Sections = exports.DynamicSection = exports.StaticSection = exports.sectionReader = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const widgets_1 = require("../documents/widgets");
|
|
7
6
|
const Widget_1 = require("./widgets/Widget");
|
|
8
7
|
function sectionReader(codec) {
|
|
9
|
-
return t.record(
|
|
8
|
+
return t.record(t.string, codec); // WidgetId -> Widget Data
|
|
10
9
|
}
|
|
11
10
|
exports.sectionReader = sectionReader;
|
|
12
11
|
exports.StaticSection = sectionReader(Widget_1.StaticWidget);
|
|
@@ -9,7 +9,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
9
9
|
config: t.ExactC<t.PartialC<{
|
|
10
10
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
11
11
|
repeat: t.BooleanC;
|
|
12
|
-
fields: t.RecordC<t.
|
|
12
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
13
13
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
14
14
|
}>, t.PartialC<{
|
|
15
15
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
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
|
-
const widgets_1 = require("../../documents/widgets");
|
|
6
5
|
const validators_1 = require("../../validators");
|
|
7
6
|
const NestableWidget_1 = (0, tslib_1.__importDefault)(require("./nestable/NestableWidget"));
|
|
8
7
|
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("./WidgetTypes"));
|
|
9
8
|
const GroupConfig = t.exact(t.partial({
|
|
10
9
|
label: validators_1.StringOrNull,
|
|
11
10
|
repeat: t.boolean,
|
|
12
|
-
fields: t.record(
|
|
11
|
+
fields: t.record(t.string, NestableWidget_1.default),
|
|
13
12
|
}));
|
|
14
13
|
const Group = t.exact(t.intersection([
|
|
15
14
|
t.type({
|
|
@@ -176,7 +176,7 @@ export declare function widgetReader<T extends StaticSlices | DynamicSlices>(cod
|
|
|
176
176
|
config: t.ExactC<t.PartialC<{
|
|
177
177
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
178
178
|
repeat: t.BooleanC;
|
|
179
|
-
fields: t.RecordC<t.
|
|
179
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
180
180
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
181
181
|
}>, t.PartialC<{
|
|
182
182
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -509,7 +509,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
509
509
|
config: t.ExactC<t.PartialC<{
|
|
510
510
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
511
511
|
repeat: t.BooleanC;
|
|
512
|
-
fields: t.RecordC<t.
|
|
512
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
513
513
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
514
514
|
}>, t.PartialC<{
|
|
515
515
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -758,7 +758,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
758
758
|
label?: string | null | undefined;
|
|
759
759
|
useAsTitle?: boolean;
|
|
760
760
|
placeholder?: string;
|
|
761
|
-
select?: "
|
|
761
|
+
select?: "media" | "document" | "web" | null;
|
|
762
762
|
customtypes?: string[];
|
|
763
763
|
masks?: string[];
|
|
764
764
|
tags?: string[];
|
|
@@ -922,7 +922,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
922
922
|
label?: string | null | undefined;
|
|
923
923
|
useAsTitle?: boolean;
|
|
924
924
|
placeholder?: string;
|
|
925
|
-
select?: "
|
|
925
|
+
select?: "media" | "document" | "web" | null;
|
|
926
926
|
customtypes?: string[];
|
|
927
927
|
masks?: string[];
|
|
928
928
|
tags?: string[];
|
|
@@ -1081,7 +1081,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1081
1081
|
label?: string | null | undefined;
|
|
1082
1082
|
useAsTitle?: boolean;
|
|
1083
1083
|
placeholder?: string;
|
|
1084
|
-
select?: "
|
|
1084
|
+
select?: "media" | "document" | "web" | null;
|
|
1085
1085
|
customtypes?: string[];
|
|
1086
1086
|
masks?: string[];
|
|
1087
1087
|
tags?: string[];
|
|
@@ -1252,7 +1252,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1252
1252
|
label?: string | null | undefined;
|
|
1253
1253
|
useAsTitle?: boolean;
|
|
1254
1254
|
placeholder?: string;
|
|
1255
|
-
select?: "
|
|
1255
|
+
select?: "media" | "document" | "web" | null;
|
|
1256
1256
|
customtypes?: string[];
|
|
1257
1257
|
masks?: string[];
|
|
1258
1258
|
tags?: string[];
|
|
@@ -1425,7 +1425,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1425
1425
|
label?: string | null | undefined;
|
|
1426
1426
|
useAsTitle?: boolean;
|
|
1427
1427
|
placeholder?: string;
|
|
1428
|
-
select?: "
|
|
1428
|
+
select?: "media" | "document" | "web" | null;
|
|
1429
1429
|
customtypes?: string[];
|
|
1430
1430
|
masks?: string[];
|
|
1431
1431
|
tags?: string[];
|
|
@@ -1584,7 +1584,7 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
1584
1584
|
label?: string | null | undefined;
|
|
1585
1585
|
useAsTitle?: boolean;
|
|
1586
1586
|
placeholder?: string;
|
|
1587
|
-
select?: "
|
|
1587
|
+
select?: "media" | "document" | "web" | null;
|
|
1588
1588
|
customtypes?: string[];
|
|
1589
1589
|
masks?: string[];
|
|
1590
1590
|
tags?: string[];
|
|
@@ -1847,7 +1847,7 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
|
|
|
1847
1847
|
config: t.ExactC<t.PartialC<{
|
|
1848
1848
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1849
1849
|
repeat: t.BooleanC;
|
|
1850
|
-
fields: t.RecordC<t.
|
|
1850
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1851
1851
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
1852
1852
|
}>, t.PartialC<{
|
|
1853
1853
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -2096,7 +2096,7 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
|
|
|
2096
2096
|
label?: string | null | undefined;
|
|
2097
2097
|
useAsTitle?: boolean;
|
|
2098
2098
|
placeholder?: string;
|
|
2099
|
-
select?: "
|
|
2099
|
+
select?: "media" | "document" | "web" | null;
|
|
2100
2100
|
customtypes?: string[];
|
|
2101
2101
|
masks?: string[];
|
|
2102
2102
|
tags?: string[];
|
|
@@ -2260,7 +2260,7 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
|
|
|
2260
2260
|
label?: string | null | undefined;
|
|
2261
2261
|
useAsTitle?: boolean;
|
|
2262
2262
|
placeholder?: string;
|
|
2263
|
-
select?: "
|
|
2263
|
+
select?: "media" | "document" | "web" | null;
|
|
2264
2264
|
customtypes?: string[];
|
|
2265
2265
|
masks?: string[];
|
|
2266
2266
|
tags?: string[];
|
|
@@ -2419,7 +2419,7 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
|
|
|
2419
2419
|
label?: string | null | undefined;
|
|
2420
2420
|
useAsTitle?: boolean;
|
|
2421
2421
|
placeholder?: string;
|
|
2422
|
-
select?: "
|
|
2422
|
+
select?: "media" | "document" | "web" | null;
|
|
2423
2423
|
customtypes?: string[];
|
|
2424
2424
|
masks?: string[];
|
|
2425
2425
|
tags?: string[];
|
|
@@ -2590,7 +2590,7 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
|
|
|
2590
2590
|
label?: string | null | undefined;
|
|
2591
2591
|
useAsTitle?: boolean;
|
|
2592
2592
|
placeholder?: string;
|
|
2593
|
-
select?: "
|
|
2593
|
+
select?: "media" | "document" | "web" | null;
|
|
2594
2594
|
customtypes?: string[];
|
|
2595
2595
|
masks?: string[];
|
|
2596
2596
|
tags?: string[];
|
|
@@ -7,7 +7,7 @@ declare const CompositeSlice: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
7
7
|
description: t.StringC;
|
|
8
8
|
icon: t.StringC;
|
|
9
9
|
display: t.StringC;
|
|
10
|
-
"non-repeat": t.RecordC<t.
|
|
10
|
+
"non-repeat": t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
11
11
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
12
12
|
}>, t.PartialC<{
|
|
13
13
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -164,7 +164,7 @@ declare const CompositeSlice: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
164
164
|
catalog: t.StringC;
|
|
165
165
|
}>>;
|
|
166
166
|
}>]>>]>>;
|
|
167
|
-
repeat: t.RecordC<t.
|
|
167
|
+
repeat: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
168
168
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
169
169
|
}>, t.PartialC<{
|
|
170
170
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
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
|
-
const widgets_1 = require("../../../documents/widgets");
|
|
6
5
|
const validators_1 = require("../../../validators");
|
|
7
6
|
const NestableWidget_1 = (0, tslib_1.__importDefault)(require("../nestable/NestableWidget"));
|
|
8
7
|
const SlicesTypes_1 = (0, tslib_1.__importDefault)(require("./SlicesTypes"));
|
|
@@ -18,8 +17,8 @@ const CompositeSlice = t.exact(t.intersection([
|
|
|
18
17
|
description: t.string,
|
|
19
18
|
icon: t.string,
|
|
20
19
|
display: t.string,
|
|
21
|
-
"non-repeat": t.record(
|
|
22
|
-
repeat: t.record(
|
|
20
|
+
"non-repeat": t.record(t.string, NestableWidget_1.default),
|
|
21
|
+
repeat: t.record(t.string, NestableWidget_1.default),
|
|
23
22
|
config: CompositeSliceConfig,
|
|
24
23
|
}),
|
|
25
24
|
]));
|
|
@@ -164,7 +164,7 @@ declare const LegacySlice: t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC
|
|
|
164
164
|
config: t.ExactC<t.PartialC<{
|
|
165
165
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
166
166
|
repeat: t.BooleanC;
|
|
167
|
-
fields: t.RecordC<t.
|
|
167
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
168
168
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
169
169
|
}>, t.PartialC<{
|
|
170
170
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -9,7 +9,7 @@ export declare const Variation: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
9
9
|
version: t.StringC;
|
|
10
10
|
}>, t.PartialC<{
|
|
11
11
|
display: t.StringC;
|
|
12
|
-
primary: t.RecordC<t.
|
|
12
|
+
primary: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
13
13
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
14
14
|
}>, t.PartialC<{
|
|
15
15
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -166,7 +166,7 @@ export declare const Variation: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
166
166
|
catalog: t.StringC;
|
|
167
167
|
}>>;
|
|
168
168
|
}>]>>]>>;
|
|
169
|
-
items: t.RecordC<t.
|
|
169
|
+
items: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
170
170
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
171
171
|
}>, t.PartialC<{
|
|
172
172
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -338,7 +338,7 @@ export declare const SharedSlice: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
338
338
|
version: t.StringC;
|
|
339
339
|
}>, t.PartialC<{
|
|
340
340
|
display: t.StringC;
|
|
341
|
-
primary: t.RecordC<t.
|
|
341
|
+
primary: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
342
342
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
343
343
|
}>, t.PartialC<{
|
|
344
344
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -495,7 +495,7 @@ export declare const SharedSlice: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
495
495
|
catalog: t.StringC;
|
|
496
496
|
}>>;
|
|
497
497
|
}>]>>]>>;
|
|
498
|
-
items: t.RecordC<t.
|
|
498
|
+
items: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
499
499
|
type: t.LiteralC<import("../WidgetTypes").default.Color>;
|
|
500
500
|
}>, t.PartialC<{
|
|
501
501
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -4,7 +4,6 @@ exports.SharedSlice = exports.Variation = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
6
|
const withFallback_1 = require("io-ts-types/lib/withFallback");
|
|
7
|
-
const widgets_1 = require("../../../documents/widgets");
|
|
8
7
|
const NestableWidget_1 = (0, tslib_1.__importDefault)(require("../nestable/NestableWidget"));
|
|
9
8
|
const SlicesTypes_1 = (0, tslib_1.__importDefault)(require("./SlicesTypes"));
|
|
10
9
|
const IMAGE_PLACEHOLDER_URL = "https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";
|
|
@@ -19,8 +18,8 @@ exports.Variation = t.exact(t.intersection([
|
|
|
19
18
|
}),
|
|
20
19
|
t.partial({
|
|
21
20
|
display: t.string,
|
|
22
|
-
primary: t.record(
|
|
23
|
-
items: t.record(
|
|
21
|
+
primary: t.record(t.string, NestableWidget_1.default),
|
|
22
|
+
items: t.record(t.string, NestableWidget_1.default),
|
|
24
23
|
}),
|
|
25
24
|
]));
|
|
26
25
|
exports.SharedSlice = t.exact(t.intersection([
|
|
@@ -16,7 +16,7 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
16
16
|
}>, t.PartialC<{
|
|
17
17
|
display: t.StringC;
|
|
18
18
|
}>]>>>>, t.NullC]>;
|
|
19
|
-
choices: t.RecordC<t.
|
|
19
|
+
choices: t.RecordC<t.StringC, t.UnionC<[t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
20
20
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
21
21
|
}>, t.PartialC<{
|
|
22
22
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -181,7 +181,7 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
181
181
|
config: t.ExactC<t.PartialC<{
|
|
182
182
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
183
183
|
repeat: t.BooleanC;
|
|
184
|
-
fields: t.RecordC<t.
|
|
184
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
185
185
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
186
186
|
}>, t.PartialC<{
|
|
187
187
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -346,7 +346,7 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
346
346
|
description: t.StringC;
|
|
347
347
|
icon: t.StringC;
|
|
348
348
|
display: t.StringC;
|
|
349
|
-
"non-repeat": t.RecordC<t.
|
|
349
|
+
"non-repeat": t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
350
350
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
351
351
|
}>, t.PartialC<{
|
|
352
352
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -503,7 +503,7 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
503
503
|
catalog: t.StringC;
|
|
504
504
|
}>>;
|
|
505
505
|
}>]>>]>>;
|
|
506
|
-
repeat: t.RecordC<t.
|
|
506
|
+
repeat: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
507
507
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
508
508
|
}>, t.PartialC<{
|
|
509
509
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -672,7 +672,7 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
672
672
|
}>, t.PartialC<{
|
|
673
673
|
display: t.StringC;
|
|
674
674
|
}>]>>>>, t.NullC]>;
|
|
675
|
-
choices: t.RecordC<t.
|
|
675
|
+
choices: t.RecordC<t.StringC, t.UnionC<[t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
676
676
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
677
677
|
}>, t.PartialC<{
|
|
678
678
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -837,7 +837,7 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
837
837
|
config: t.ExactC<t.PartialC<{
|
|
838
838
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
839
839
|
repeat: t.BooleanC;
|
|
840
|
-
fields: t.RecordC<t.
|
|
840
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
841
841
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
842
842
|
}>, t.PartialC<{
|
|
843
843
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1002,7 +1002,7 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1002
1002
|
description: t.StringC;
|
|
1003
1003
|
icon: t.StringC;
|
|
1004
1004
|
display: t.StringC;
|
|
1005
|
-
"non-repeat": t.RecordC<t.
|
|
1005
|
+
"non-repeat": t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1006
1006
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
1007
1007
|
}>, t.PartialC<{
|
|
1008
1008
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1159,7 +1159,7 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1159
1159
|
catalog: t.StringC;
|
|
1160
1160
|
}>>;
|
|
1161
1161
|
}>]>>]>>;
|
|
1162
|
-
repeat: t.RecordC<t.
|
|
1162
|
+
repeat: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1163
1163
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
1164
1164
|
}>, t.PartialC<{
|
|
1165
1165
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1410,7 +1410,7 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1410
1410
|
label?: string | null | undefined;
|
|
1411
1411
|
useAsTitle?: boolean;
|
|
1412
1412
|
placeholder?: string;
|
|
1413
|
-
select?: "
|
|
1413
|
+
select?: "media" | "document" | "web" | null;
|
|
1414
1414
|
customtypes?: string[];
|
|
1415
1415
|
masks?: string[];
|
|
1416
1416
|
tags?: string[];
|
|
@@ -1569,7 +1569,7 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1569
1569
|
label?: string | null | undefined;
|
|
1570
1570
|
useAsTitle?: boolean;
|
|
1571
1571
|
placeholder?: string;
|
|
1572
|
-
select?: "
|
|
1572
|
+
select?: "media" | "document" | "web" | null;
|
|
1573
1573
|
customtypes?: string[];
|
|
1574
1574
|
masks?: string[];
|
|
1575
1575
|
tags?: string[];
|
|
@@ -1663,7 +1663,7 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1663
1663
|
}>, t.PartialC<{
|
|
1664
1664
|
display: t.StringC;
|
|
1665
1665
|
}>]>>>>, t.NullC]>;
|
|
1666
|
-
choices: t.RecordC<t.
|
|
1666
|
+
choices: t.RecordC<t.StringC, t.UnionC<[t.UnionC<[t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1667
1667
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
1668
1668
|
}>, t.PartialC<{
|
|
1669
1669
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1828,7 +1828,7 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1828
1828
|
config: t.ExactC<t.PartialC<{
|
|
1829
1829
|
label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
1830
1830
|
repeat: t.BooleanC;
|
|
1831
|
-
fields: t.RecordC<t.
|
|
1831
|
+
fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1832
1832
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
1833
1833
|
}>, t.PartialC<{
|
|
1834
1834
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -1993,7 +1993,7 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1993
1993
|
description: t.StringC;
|
|
1994
1994
|
icon: t.StringC;
|
|
1995
1995
|
display: t.StringC;
|
|
1996
|
-
"non-repeat": t.RecordC<t.
|
|
1996
|
+
"non-repeat": t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1997
1997
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
1998
1998
|
}>, t.PartialC<{
|
|
1999
1999
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -2150,7 +2150,7 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
2150
2150
|
catalog: t.StringC;
|
|
2151
2151
|
}>>;
|
|
2152
2152
|
}>]>>]>>;
|
|
2153
|
-
repeat: t.RecordC<t.
|
|
2153
|
+
repeat: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
2154
2154
|
type: t.LiteralC<WidgetTypes.Color>;
|
|
2155
2155
|
}>, t.PartialC<{
|
|
2156
2156
|
fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
|
|
@@ -2412,7 +2412,7 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2412
2412
|
label?: string | null | undefined;
|
|
2413
2413
|
useAsTitle?: boolean;
|
|
2414
2414
|
placeholder?: string;
|
|
2415
|
-
select?: "
|
|
2415
|
+
select?: "media" | "document" | "web" | null;
|
|
2416
2416
|
customtypes?: string[];
|
|
2417
2417
|
masks?: string[];
|
|
2418
2418
|
tags?: string[];
|
|
@@ -2576,7 +2576,7 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2576
2576
|
label?: string | null | undefined;
|
|
2577
2577
|
useAsTitle?: boolean;
|
|
2578
2578
|
placeholder?: string;
|
|
2579
|
-
select?: "
|
|
2579
|
+
select?: "media" | "document" | "web" | null;
|
|
2580
2580
|
customtypes?: string[];
|
|
2581
2581
|
masks?: string[];
|
|
2582
2582
|
tags?: string[];
|
|
@@ -2735,7 +2735,7 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2735
2735
|
label?: string | null | undefined;
|
|
2736
2736
|
useAsTitle?: boolean;
|
|
2737
2737
|
placeholder?: string;
|
|
2738
|
-
select?: "
|
|
2738
|
+
select?: "media" | "document" | "web" | null;
|
|
2739
2739
|
customtypes?: string[];
|
|
2740
2740
|
masks?: string[];
|
|
2741
2741
|
tags?: string[];
|
|
@@ -2906,7 +2906,7 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2906
2906
|
label?: string | null | undefined;
|
|
2907
2907
|
useAsTitle?: boolean;
|
|
2908
2908
|
placeholder?: string;
|
|
2909
|
-
select?: "
|
|
2909
|
+
select?: "media" | "document" | "web" | null;
|
|
2910
2910
|
customtypes?: string[];
|
|
2911
2911
|
masks?: string[];
|
|
2912
2912
|
tags?: string[];
|
|
@@ -3079,7 +3079,7 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3079
3079
|
label?: string | null | undefined;
|
|
3080
3080
|
useAsTitle?: boolean;
|
|
3081
3081
|
placeholder?: string;
|
|
3082
|
-
select?: "
|
|
3082
|
+
select?: "media" | "document" | "web" | null;
|
|
3083
3083
|
customtypes?: string[];
|
|
3084
3084
|
masks?: string[];
|
|
3085
3085
|
tags?: string[];
|
|
@@ -3238,7 +3238,7 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3238
3238
|
label?: string | null | undefined;
|
|
3239
3239
|
useAsTitle?: boolean;
|
|
3240
3240
|
placeholder?: string;
|
|
3241
|
-
select?: "
|
|
3241
|
+
select?: "media" | "document" | "web" | null;
|
|
3242
3242
|
customtypes?: string[];
|
|
3243
3243
|
masks?: string[];
|
|
3244
3244
|
tags?: string[];
|
|
@@ -3418,7 +3418,7 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3418
3418
|
label?: string | null | undefined;
|
|
3419
3419
|
useAsTitle?: boolean;
|
|
3420
3420
|
placeholder?: string;
|
|
3421
|
-
select?: "
|
|
3421
|
+
select?: "media" | "document" | "web" | null;
|
|
3422
3422
|
customtypes?: string[];
|
|
3423
3423
|
masks?: string[];
|
|
3424
3424
|
tags?: string[];
|
|
@@ -3582,7 +3582,7 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3582
3582
|
label?: string | null | undefined;
|
|
3583
3583
|
useAsTitle?: boolean;
|
|
3584
3584
|
placeholder?: string;
|
|
3585
|
-
select?: "
|
|
3585
|
+
select?: "media" | "document" | "web" | null;
|
|
3586
3586
|
customtypes?: string[];
|
|
3587
3587
|
masks?: string[];
|
|
3588
3588
|
tags?: string[];
|
|
@@ -3741,7 +3741,7 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3741
3741
|
label?: string | null | undefined;
|
|
3742
3742
|
useAsTitle?: boolean;
|
|
3743
3743
|
placeholder?: string;
|
|
3744
|
-
select?: "
|
|
3744
|
+
select?: "media" | "document" | "web" | null;
|
|
3745
3745
|
customtypes?: string[];
|
|
3746
3746
|
masks?: string[];
|
|
3747
3747
|
tags?: string[];
|
|
@@ -3912,7 +3912,7 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3912
3912
|
label?: string | null | undefined;
|
|
3913
3913
|
useAsTitle?: boolean;
|
|
3914
3914
|
placeholder?: string;
|
|
3915
|
-
select?: "
|
|
3915
|
+
select?: "media" | "document" | "web" | null;
|
|
3916
3916
|
customtypes?: string[];
|
|
3917
3917
|
masks?: string[];
|
|
3918
3918
|
tags?: string[];
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Slices = exports.DynamicSlices = exports.StaticSlices = exports.slicesReader = exports.DynamicSlicesConfig = exports.StaticSlicesConfig = exports.slicesConfigReader = exports.SlicesLabels = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const widgets_1 = require("../../../documents/widgets");
|
|
7
6
|
const validators_1 = require("../../../validators");
|
|
8
7
|
const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
|
|
9
8
|
const CompositeSlice_1 = (0, tslib_1.__importDefault)(require("./CompositeSlice"));
|
|
@@ -26,7 +25,7 @@ function slicesConfigReader(codec) {
|
|
|
26
25
|
return t.exact(t.partial({
|
|
27
26
|
label: validators_1.StringOrNull,
|
|
28
27
|
labels: exports.SlicesLabels,
|
|
29
|
-
choices: t.record(
|
|
28
|
+
choices: t.record(t.string, t.union([LegacySlice_1.default, CompositeSlice_1.default, codec])),
|
|
30
29
|
}));
|
|
31
30
|
}
|
|
32
31
|
exports.slicesConfigReader = slicesConfigReader;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
1
|
import { SlicesContent } from "./slices";
|
|
3
2
|
import StaticWidgetContent from "./StaticWidgetContent";
|
|
4
3
|
export * from "./EmptyContent";
|
|
@@ -6,7 +5,7 @@ export * from "./GroupContent";
|
|
|
6
5
|
export * as Nestable from "./nestable";
|
|
7
6
|
export * from "./SimpleWidgetContent";
|
|
8
7
|
export * as Slices from "./slices";
|
|
9
|
-
export { type NonEmptyStaticWidgetContent
|
|
8
|
+
export { type NonEmptyStaticWidgetContent } from "./StaticWidgetContent";
|
|
10
9
|
export * from "./UIDContent";
|
|
11
10
|
export declare const WidgetTypes: {
|
|
12
11
|
readonly Empty: "EmptyContent";
|
|
@@ -29,8 +28,7 @@ export declare const WidgetTypes: {
|
|
|
29
28
|
readonly IntegrationFields: "IntegrationFieldsContent";
|
|
30
29
|
readonly Separator: "SeparatorContent";
|
|
31
30
|
};
|
|
32
|
-
export declare
|
|
33
|
-
export declare type WidgetKey = t.TypeOf<typeof WidgetKey>;
|
|
31
|
+
export declare type WidgetKey = string;
|
|
34
32
|
export declare type WidgetContent = SlicesContent | StaticWidgetContent;
|
|
35
33
|
export declare const Widget: {
|
|
36
34
|
fromJson(widgetKey: WidgetKey, widgetValue: unknown, widgetTypes: Map<WidgetKey, string>, widgetPositions: Map<WidgetKey, number>): import("fp-ts/lib/Option").None | import("fp-ts/lib/Option").Some<StaticWidgetContent> | import("fp-ts/lib/Option").Some<SlicesContent>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Widget = exports.
|
|
3
|
+
exports.Widget = exports.WidgetTypes = exports.Slices = exports.Nestable = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const t = (0, tslib_1.__importStar)(require("io-ts"));
|
|
6
|
-
const function_1 = require("../../validators/function");
|
|
7
5
|
const EmptyContent_1 = require("./EmptyContent");
|
|
8
6
|
const GroupContent_1 = require("./GroupContent");
|
|
9
7
|
const nestable_1 = require("./nestable");
|
|
@@ -16,7 +14,6 @@ exports.Nestable = (0, tslib_1.__importStar)(require("./nestable"));
|
|
|
16
14
|
(0, tslib_1.__exportStar)(require("./SimpleWidgetContent"), exports);
|
|
17
15
|
exports.Slices = (0, tslib_1.__importStar)(require("./slices"));
|
|
18
16
|
var StaticWidgetContent_2 = require("./StaticWidgetContent");
|
|
19
|
-
Object.defineProperty(exports, "StaticWidgetContent", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(StaticWidgetContent_2).default; } });
|
|
20
17
|
(0, tslib_1.__exportStar)(require("./UIDContent"), exports);
|
|
21
18
|
exports.WidgetTypes = {
|
|
22
19
|
...nestable_1.NestableTypes,
|
|
@@ -25,8 +22,6 @@ exports.WidgetTypes = {
|
|
|
25
22
|
Group: GroupContent_1.GroupContentType,
|
|
26
23
|
slices: slices_1.SlicesContentType,
|
|
27
24
|
};
|
|
28
|
-
const widgetKeyRegex = new RegExp("^[^<>]*$");
|
|
29
|
-
exports.WidgetKey = (0, function_1.refineType)(t.string, "WidgetKey", (s) => widgetKeyRegex.test(s));
|
|
30
25
|
exports.Widget = {
|
|
31
26
|
fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions) {
|
|
32
27
|
const fieldType = widgetTypes.get(widgetKey);
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import { WidgetKey } from "../documents/widgets"
|
|
4
3
|
import type { SharedSlice } from "./widgets/slices"
|
|
5
4
|
import { DynamicWidget, StaticWidget, Widgets } from "./widgets/Widget"
|
|
6
5
|
|
|
7
6
|
export function sectionReader<T extends StaticWidget | DynamicWidget>(
|
|
8
7
|
codec: t.Type<T, unknown>,
|
|
9
8
|
) {
|
|
10
|
-
return t.record(
|
|
9
|
+
return t.record(t.string, codec) // WidgetId -> Widget Data
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export const StaticSection = sectionReader(StaticWidget)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import { WidgetKey } from "../../documents/widgets"
|
|
4
3
|
import { StringOrNull } from "../../validators"
|
|
5
4
|
import NestableWidget from "./nestable/NestableWidget"
|
|
6
5
|
import WidgetTypes from "./WidgetTypes"
|
|
@@ -9,7 +8,7 @@ const GroupConfig = t.exact(
|
|
|
9
8
|
t.partial({
|
|
10
9
|
label: StringOrNull,
|
|
11
10
|
repeat: t.boolean,
|
|
12
|
-
fields: t.record(
|
|
11
|
+
fields: t.record(t.string, NestableWidget),
|
|
13
12
|
}),
|
|
14
13
|
)
|
|
15
14
|
type GroupConfig = t.TypeOf<typeof GroupConfig>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import { WidgetKey } from "../../../documents/widgets"
|
|
4
3
|
import { StringOrNull } from "../../../validators"
|
|
5
4
|
import NestableWidget from "../nestable/NestableWidget"
|
|
6
5
|
import SlicesTypes from "./SlicesTypes"
|
|
@@ -22,8 +21,8 @@ const CompositeSlice = t.exact(
|
|
|
22
21
|
description: t.string,
|
|
23
22
|
icon: t.string,
|
|
24
23
|
display: t.string,
|
|
25
|
-
"non-repeat": t.record(
|
|
26
|
-
repeat: t.record(
|
|
24
|
+
"non-repeat": t.record(t.string, NestableWidget),
|
|
25
|
+
repeat: t.record(t.string, NestableWidget),
|
|
27
26
|
config: CompositeSliceConfig,
|
|
28
27
|
}),
|
|
29
28
|
]),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
import { withFallback } from "io-ts-types/lib/withFallback"
|
|
3
3
|
|
|
4
|
-
import { WidgetKey } from "../../../documents/widgets"
|
|
5
4
|
import NestableWidget from "../nestable/NestableWidget"
|
|
6
5
|
import SlicesTypes from "./SlicesTypes"
|
|
7
6
|
|
|
@@ -20,8 +19,8 @@ export const Variation = t.exact(
|
|
|
20
19
|
}),
|
|
21
20
|
t.partial({
|
|
22
21
|
display: t.string,
|
|
23
|
-
primary: t.record(
|
|
24
|
-
items: t.record(
|
|
22
|
+
primary: t.record(t.string, NestableWidget),
|
|
23
|
+
items: t.record(t.string, NestableWidget),
|
|
25
24
|
}),
|
|
26
25
|
]),
|
|
27
26
|
)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import { WidgetKey } from "../../../documents/widgets"
|
|
4
3
|
import { StringOrNull } from "../../../validators"
|
|
5
4
|
import WidgetTypes from "../WidgetTypes"
|
|
6
5
|
import CompositeSlice from "./CompositeSlice"
|
|
@@ -37,7 +36,7 @@ export function slicesConfigReader<T extends SharedSlice | SharedSliceRef>(
|
|
|
37
36
|
label: StringOrNull,
|
|
38
37
|
labels: SlicesLabels,
|
|
39
38
|
choices: t.record(
|
|
40
|
-
|
|
39
|
+
t.string,
|
|
41
40
|
t.union([LegacySlice, CompositeSlice, codec]),
|
|
42
41
|
),
|
|
43
42
|
}),
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as t from "io-ts"
|
|
2
|
-
|
|
3
|
-
import { refineType } from "../../validators/function"
|
|
4
1
|
import { EmptyContentType } from "./EmptyContent"
|
|
5
2
|
import { GroupContentType } from "./GroupContent"
|
|
6
3
|
import { NestableTypes } from "./nestable"
|
|
@@ -13,10 +10,7 @@ export * from "./GroupContent"
|
|
|
13
10
|
export * as Nestable from "./nestable"
|
|
14
11
|
export * from "./SimpleWidgetContent"
|
|
15
12
|
export * as Slices from "./slices"
|
|
16
|
-
export {
|
|
17
|
-
type NonEmptyStaticWidgetContent,
|
|
18
|
-
default as StaticWidgetContent,
|
|
19
|
-
} from "./StaticWidgetContent"
|
|
13
|
+
export { type NonEmptyStaticWidgetContent } from "./StaticWidgetContent"
|
|
20
14
|
export * from "./UIDContent"
|
|
21
15
|
|
|
22
16
|
export const WidgetTypes = {
|
|
@@ -27,11 +21,13 @@ export const WidgetTypes = {
|
|
|
27
21
|
slices: SlicesContentType,
|
|
28
22
|
} as const
|
|
29
23
|
|
|
30
|
-
const widgetKeyRegex = new RegExp("^[^<>]*$")
|
|
24
|
+
/*const widgetKeyRegex = new RegExp("^[^<>]*$")
|
|
31
25
|
export const WidgetKey = refineType(t.string, "WidgetKey", (s: string) =>
|
|
32
26
|
widgetKeyRegex.test(s),
|
|
33
27
|
)
|
|
34
|
-
export type WidgetKey = t.TypeOf<typeof WidgetKey
|
|
28
|
+
export type WidgetKey = t.TypeOf<typeof WidgetKey>*/
|
|
29
|
+
|
|
30
|
+
export type WidgetKey = string
|
|
35
31
|
|
|
36
32
|
export type WidgetContent = SlicesContent | StaticWidgetContent
|
|
37
33
|
|