@prismicio/types-internal 2.4.0-alpha.1 → 2.4.0-alpha.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/content/Document.d.ts +0 -72
- package/lib/content/fields/GroupContent.d.ts +0 -15
- package/lib/content/fields/WidgetContent.d.ts +0 -72
- package/lib/content/fields/nestable/ImageContent.d.ts +0 -9
- package/lib/content/fields/nestable/ImageContent.js +0 -1
- package/lib/content/fields/nestable/NestableContent.d.ts +0 -9
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +0 -4
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +0 -4
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +0 -18
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +0 -6
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +0 -18
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +3 -1
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +0 -18
- package/lib/content/fields/slices/Slice/index.d.ts +0 -36
- package/lib/content/fields/slices/SliceItem.d.ts +0 -36
- package/lib/content/fields/slices/SlicesContent.d.ts +0 -54
- package/lib/customtypes/CustomType.d.ts +169 -14
- package/lib/customtypes/Section.d.ts +169 -14
- package/lib/customtypes/diff/SharedSlice.d.ts +338 -4
- package/lib/customtypes/diff/Variation.d.ts +340 -5
- package/lib/customtypes/widgets/Group.d.ts +0 -2
- package/lib/customtypes/widgets/Widget.d.ts +169 -16
- package/lib/customtypes/widgets/nestable/Image.d.ts +0 -2
- package/lib/customtypes/widgets/nestable/Image.js +0 -1
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +0 -1
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +0 -2
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +0 -2
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +336 -6
- package/lib/customtypes/widgets/slices/SharedSlice.js +2 -1
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +327 -0
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.js +8 -0
- package/lib/customtypes/widgets/slices/SliceWidget.d.ts +327 -0
- package/lib/customtypes/widgets/slices/SliceWidget.js +8 -0
- package/lib/customtypes/widgets/slices/Slices.d.ts +338 -24
- package/lib/customtypes/widgets/slices/index.d.ts +1 -0
- package/lib/customtypes/widgets/slices/index.js +1 -0
- package/package.json +1 -1
- package/src/content/fields/nestable/ImageContent.ts +0 -1
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +12 -2
- package/src/customtypes/diff/Variation.ts +6 -5
- package/src/customtypes/widgets/nestable/Image.ts +0 -1
- package/src/customtypes/widgets/slices/SharedSlice.ts +2 -1
- package/src/customtypes/widgets/slices/SlicePrimaryWidget.ts +9 -0
- package/src/customtypes/widgets/slices/index.ts +1 -0
|
@@ -162,7 +162,6 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
162
162
|
width: t.Type<number | null, unknown, unknown>;
|
|
163
163
|
height: t.Type<number | null, unknown, unknown>;
|
|
164
164
|
}>]>>>;
|
|
165
|
-
allowCaption: t.BooleanC;
|
|
166
165
|
}>>;
|
|
167
166
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
168
167
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -328,7 +327,6 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
328
327
|
width: t.Type<number | null, unknown, unknown>;
|
|
329
328
|
height: t.Type<number | null, unknown, unknown>;
|
|
330
329
|
}>]>>>;
|
|
331
|
-
allowCaption: t.BooleanC;
|
|
332
330
|
}>>;
|
|
333
331
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
334
332
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -494,7 +492,6 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
494
492
|
width: t.Type<number | null, unknown, unknown>;
|
|
495
493
|
height: t.Type<number | null, unknown, unknown>;
|
|
496
494
|
}>]>>>;
|
|
497
|
-
allowCaption: t.BooleanC;
|
|
498
495
|
}>>;
|
|
499
496
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
500
497
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -652,7 +649,6 @@ export declare function slicesConfigReader<T extends SharedSlice | SharedSliceRe
|
|
|
652
649
|
width: t.Type<number | null, unknown, unknown>;
|
|
653
650
|
height: t.Type<number | null, unknown, unknown>;
|
|
654
651
|
}>]>>>;
|
|
655
|
-
allowCaption: t.BooleanC;
|
|
656
652
|
}>>;
|
|
657
653
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
658
654
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -822,7 +818,6 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
822
818
|
width: t.Type<number | null, unknown, unknown>;
|
|
823
819
|
height: t.Type<number | null, unknown, unknown>;
|
|
824
820
|
}>]>>>;
|
|
825
|
-
allowCaption: t.BooleanC;
|
|
826
821
|
}>>;
|
|
827
822
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
828
823
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -988,7 +983,6 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
988
983
|
width: t.Type<number | null, unknown, unknown>;
|
|
989
984
|
height: t.Type<number | null, unknown, unknown>;
|
|
990
985
|
}>]>>>;
|
|
991
|
-
allowCaption: t.BooleanC;
|
|
992
986
|
}>>;
|
|
993
987
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
994
988
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -1154,7 +1148,6 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1154
1148
|
width: t.Type<number | null, unknown, unknown>;
|
|
1155
1149
|
height: t.Type<number | null, unknown, unknown>;
|
|
1156
1150
|
}>]>>>;
|
|
1157
|
-
allowCaption: t.BooleanC;
|
|
1158
1151
|
}>>;
|
|
1159
1152
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1160
1153
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -1312,7 +1305,6 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1312
1305
|
width: t.Type<number | null, unknown, unknown>;
|
|
1313
1306
|
height: t.Type<number | null, unknown, unknown>;
|
|
1314
1307
|
}>]>>>;
|
|
1315
|
-
allowCaption: t.BooleanC;
|
|
1316
1308
|
}>>;
|
|
1317
1309
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1318
1310
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -1400,7 +1392,6 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1400
1392
|
width?: number | null;
|
|
1401
1393
|
height?: number | null;
|
|
1402
1394
|
})[];
|
|
1403
|
-
allowCaption?: boolean;
|
|
1404
1395
|
};
|
|
1405
1396
|
}) | ({
|
|
1406
1397
|
type: "IntegrationFields";
|
|
@@ -1498,6 +1489,175 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1498
1489
|
placeholder?: string;
|
|
1499
1490
|
default?: string;
|
|
1500
1491
|
};
|
|
1492
|
+
}) | ({
|
|
1493
|
+
type: "Group";
|
|
1494
|
+
} & {
|
|
1495
|
+
fieldset?: string | null | undefined;
|
|
1496
|
+
icon?: string;
|
|
1497
|
+
description?: string;
|
|
1498
|
+
config?: {
|
|
1499
|
+
label?: string | null | undefined;
|
|
1500
|
+
repeat?: boolean;
|
|
1501
|
+
fields?: {
|
|
1502
|
+
[x: string]: ({
|
|
1503
|
+
type: "Boolean";
|
|
1504
|
+
} & {
|
|
1505
|
+
config?: {
|
|
1506
|
+
label?: string | null | undefined;
|
|
1507
|
+
default_value?: boolean;
|
|
1508
|
+
placeholder_true?: string;
|
|
1509
|
+
placeholder_false?: string;
|
|
1510
|
+
};
|
|
1511
|
+
}) | ({
|
|
1512
|
+
type: "Color";
|
|
1513
|
+
} & {
|
|
1514
|
+
fieldset?: string | null | undefined;
|
|
1515
|
+
config?: {
|
|
1516
|
+
label?: string | null | undefined;
|
|
1517
|
+
placeholder?: string;
|
|
1518
|
+
};
|
|
1519
|
+
}) | ({
|
|
1520
|
+
type: "Date";
|
|
1521
|
+
} & {
|
|
1522
|
+
fieldset?: string | null | undefined;
|
|
1523
|
+
config?: {
|
|
1524
|
+
label?: string | null | undefined;
|
|
1525
|
+
placeholder?: string;
|
|
1526
|
+
default?: string;
|
|
1527
|
+
};
|
|
1528
|
+
}) | ({
|
|
1529
|
+
type: "Embed";
|
|
1530
|
+
} & {
|
|
1531
|
+
fieldset?: string | null | undefined;
|
|
1532
|
+
config?: {
|
|
1533
|
+
label?: string | null | undefined;
|
|
1534
|
+
placeholder?: string;
|
|
1535
|
+
useAsTitle?: boolean;
|
|
1536
|
+
};
|
|
1537
|
+
}) | ({
|
|
1538
|
+
type: "GeoPoint";
|
|
1539
|
+
} & {
|
|
1540
|
+
fieldset?: string | null | undefined;
|
|
1541
|
+
config?: {
|
|
1542
|
+
label?: string | null | undefined;
|
|
1543
|
+
};
|
|
1544
|
+
}) | ({
|
|
1545
|
+
type: "Image";
|
|
1546
|
+
} & {
|
|
1547
|
+
fieldset?: string | null | undefined;
|
|
1548
|
+
config?: {
|
|
1549
|
+
label?: string | null | undefined;
|
|
1550
|
+
placeholder?: string;
|
|
1551
|
+
constraint?: {
|
|
1552
|
+
width?: number | null;
|
|
1553
|
+
height?: number | null;
|
|
1554
|
+
};
|
|
1555
|
+
thumbnails?: readonly ({
|
|
1556
|
+
name: string;
|
|
1557
|
+
} & {
|
|
1558
|
+
width?: number | null;
|
|
1559
|
+
height?: number | null;
|
|
1560
|
+
})[];
|
|
1561
|
+
};
|
|
1562
|
+
}) | ({
|
|
1563
|
+
type: "IntegrationFields";
|
|
1564
|
+
} & {
|
|
1565
|
+
fieldset?: string | null | undefined;
|
|
1566
|
+
config?: {
|
|
1567
|
+
label?: string | null | undefined;
|
|
1568
|
+
placeholder?: string;
|
|
1569
|
+
catalog?: string;
|
|
1570
|
+
};
|
|
1571
|
+
}) | ({
|
|
1572
|
+
type: "Link";
|
|
1573
|
+
} & {
|
|
1574
|
+
fieldset?: string | null | undefined;
|
|
1575
|
+
config?: {
|
|
1576
|
+
label?: string | null | undefined;
|
|
1577
|
+
useAsTitle?: boolean;
|
|
1578
|
+
placeholder?: string;
|
|
1579
|
+
select?: "media" | "document" | "web" | null;
|
|
1580
|
+
customtypes?: readonly string[];
|
|
1581
|
+
masks?: readonly string[];
|
|
1582
|
+
tags?: readonly string[];
|
|
1583
|
+
allowTargetBlank?: boolean;
|
|
1584
|
+
};
|
|
1585
|
+
}) | ({
|
|
1586
|
+
type: "Number";
|
|
1587
|
+
} & {
|
|
1588
|
+
fieldset?: string | null | undefined;
|
|
1589
|
+
config?: {
|
|
1590
|
+
label?: string | null | undefined;
|
|
1591
|
+
placeholder?: string;
|
|
1592
|
+
min?: number;
|
|
1593
|
+
max?: number;
|
|
1594
|
+
step?: number;
|
|
1595
|
+
};
|
|
1596
|
+
}) | ({
|
|
1597
|
+
type: "Range";
|
|
1598
|
+
} & {
|
|
1599
|
+
fieldset?: string | null | undefined;
|
|
1600
|
+
config?: {
|
|
1601
|
+
label?: string | null | undefined;
|
|
1602
|
+
placeholder?: string;
|
|
1603
|
+
min?: number;
|
|
1604
|
+
max?: number;
|
|
1605
|
+
step?: number;
|
|
1606
|
+
};
|
|
1607
|
+
}) | ({
|
|
1608
|
+
type: "StructuredText";
|
|
1609
|
+
} & {
|
|
1610
|
+
fieldset?: string | null | undefined;
|
|
1611
|
+
config?: {
|
|
1612
|
+
label?: string | null | undefined;
|
|
1613
|
+
placeholder?: string;
|
|
1614
|
+
useAsTitle?: boolean;
|
|
1615
|
+
single?: string;
|
|
1616
|
+
multi?: string;
|
|
1617
|
+
imageConstraint?: {
|
|
1618
|
+
width?: number | null;
|
|
1619
|
+
height?: number | null;
|
|
1620
|
+
};
|
|
1621
|
+
labels?: readonly string[];
|
|
1622
|
+
allowTargetBlank?: boolean;
|
|
1623
|
+
};
|
|
1624
|
+
}) | ({
|
|
1625
|
+
type: "Select";
|
|
1626
|
+
} & {
|
|
1627
|
+
fieldset?: string | null | undefined;
|
|
1628
|
+
config?: {
|
|
1629
|
+
label?: string | null | undefined;
|
|
1630
|
+
placeholder?: string;
|
|
1631
|
+
default_value?: string;
|
|
1632
|
+
options?: readonly string[];
|
|
1633
|
+
};
|
|
1634
|
+
}) | ({
|
|
1635
|
+
type: "Separator";
|
|
1636
|
+
} & {
|
|
1637
|
+
config?: {
|
|
1638
|
+
label?: string | null | undefined;
|
|
1639
|
+
};
|
|
1640
|
+
}) | ({
|
|
1641
|
+
type: "Text";
|
|
1642
|
+
} & {
|
|
1643
|
+
fieldset?: string | null | undefined;
|
|
1644
|
+
config?: {
|
|
1645
|
+
label?: string | null | undefined;
|
|
1646
|
+
useAsTitle?: boolean;
|
|
1647
|
+
placeholder?: string;
|
|
1648
|
+
};
|
|
1649
|
+
}) | ({
|
|
1650
|
+
type: "Timestamp";
|
|
1651
|
+
} & {
|
|
1652
|
+
fieldset?: string | null | undefined;
|
|
1653
|
+
config?: {
|
|
1654
|
+
label?: string | null | undefined;
|
|
1655
|
+
placeholder?: string;
|
|
1656
|
+
default?: string;
|
|
1657
|
+
};
|
|
1658
|
+
});
|
|
1659
|
+
};
|
|
1660
|
+
};
|
|
1501
1661
|
});
|
|
1502
1662
|
};
|
|
1503
1663
|
items?: {
|
|
@@ -1560,7 +1720,6 @@ export declare const StaticSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1560
1720
|
width?: number | null;
|
|
1561
1721
|
height?: number | null;
|
|
1562
1722
|
})[];
|
|
1563
|
-
allowCaption?: boolean;
|
|
1564
1723
|
};
|
|
1565
1724
|
}) | ({
|
|
1566
1725
|
type: "IntegrationFields";
|
|
@@ -1822,7 +1981,6 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1822
1981
|
width: t.Type<number | null, unknown, unknown>;
|
|
1823
1982
|
height: t.Type<number | null, unknown, unknown>;
|
|
1824
1983
|
}>]>>>;
|
|
1825
|
-
allowCaption: t.BooleanC;
|
|
1826
1984
|
}>>;
|
|
1827
1985
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1828
1986
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -1988,7 +2146,6 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
1988
2146
|
width: t.Type<number | null, unknown, unknown>;
|
|
1989
2147
|
height: t.Type<number | null, unknown, unknown>;
|
|
1990
2148
|
}>]>>>;
|
|
1991
|
-
allowCaption: t.BooleanC;
|
|
1992
2149
|
}>>;
|
|
1993
2150
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
1994
2151
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -2154,7 +2311,6 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
2154
2311
|
width: t.Type<number | null, unknown, unknown>;
|
|
2155
2312
|
height: t.Type<number | null, unknown, unknown>;
|
|
2156
2313
|
}>]>>>;
|
|
2157
|
-
allowCaption: t.BooleanC;
|
|
2158
2314
|
}>>;
|
|
2159
2315
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
2160
2316
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -2312,7 +2468,6 @@ export declare const DynamicSlicesConfig: t.ExactC<t.PartialC<{
|
|
|
2312
2468
|
width: t.Type<number | null, unknown, unknown>;
|
|
2313
2469
|
height: t.Type<number | null, unknown, unknown>;
|
|
2314
2470
|
}>]>>>;
|
|
2315
|
-
allowCaption: t.BooleanC;
|
|
2316
2471
|
}>>;
|
|
2317
2472
|
}>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
2318
2473
|
type: t.LiteralC<"IntegrationFields">;
|
|
@@ -2417,7 +2572,6 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2417
2572
|
width?: number | null;
|
|
2418
2573
|
height?: number | null;
|
|
2419
2574
|
})[];
|
|
2420
|
-
allowCaption?: boolean;
|
|
2421
2575
|
};
|
|
2422
2576
|
}) | ({
|
|
2423
2577
|
type: "IntegrationFields";
|
|
@@ -2584,7 +2738,6 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2584
2738
|
width?: number | null;
|
|
2585
2739
|
height?: number | null;
|
|
2586
2740
|
})[];
|
|
2587
|
-
allowCaption?: boolean;
|
|
2588
2741
|
};
|
|
2589
2742
|
}) | ({
|
|
2590
2743
|
type: "IntegrationFields";
|
|
@@ -2752,7 +2905,6 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2752
2905
|
width?: number | null;
|
|
2753
2906
|
height?: number | null;
|
|
2754
2907
|
})[];
|
|
2755
|
-
allowCaption?: boolean;
|
|
2756
2908
|
};
|
|
2757
2909
|
}) | ({
|
|
2758
2910
|
type: "IntegrationFields";
|
|
@@ -2912,7 +3064,6 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
2912
3064
|
width?: number | null;
|
|
2913
3065
|
height?: number | null;
|
|
2914
3066
|
})[];
|
|
2915
|
-
allowCaption?: boolean;
|
|
2916
3067
|
};
|
|
2917
3068
|
}) | ({
|
|
2918
3069
|
type: "IntegrationFields";
|
|
@@ -3088,7 +3239,6 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3088
3239
|
width?: number | null;
|
|
3089
3240
|
height?: number | null;
|
|
3090
3241
|
})[];
|
|
3091
|
-
allowCaption?: boolean;
|
|
3092
3242
|
};
|
|
3093
3243
|
}) | ({
|
|
3094
3244
|
type: "IntegrationFields";
|
|
@@ -3186,6 +3336,175 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3186
3336
|
placeholder?: string;
|
|
3187
3337
|
default?: string;
|
|
3188
3338
|
};
|
|
3339
|
+
}) | ({
|
|
3340
|
+
type: "Group";
|
|
3341
|
+
} & {
|
|
3342
|
+
fieldset?: string | null | undefined;
|
|
3343
|
+
icon?: string;
|
|
3344
|
+
description?: string;
|
|
3345
|
+
config?: {
|
|
3346
|
+
label?: string | null | undefined;
|
|
3347
|
+
repeat?: boolean;
|
|
3348
|
+
fields?: {
|
|
3349
|
+
[x: string]: ({
|
|
3350
|
+
type: "Boolean";
|
|
3351
|
+
} & {
|
|
3352
|
+
config?: {
|
|
3353
|
+
label?: string | null | undefined;
|
|
3354
|
+
default_value?: boolean;
|
|
3355
|
+
placeholder_true?: string;
|
|
3356
|
+
placeholder_false?: string;
|
|
3357
|
+
};
|
|
3358
|
+
}) | ({
|
|
3359
|
+
type: "Color";
|
|
3360
|
+
} & {
|
|
3361
|
+
fieldset?: string | null | undefined;
|
|
3362
|
+
config?: {
|
|
3363
|
+
label?: string | null | undefined;
|
|
3364
|
+
placeholder?: string;
|
|
3365
|
+
};
|
|
3366
|
+
}) | ({
|
|
3367
|
+
type: "Date";
|
|
3368
|
+
} & {
|
|
3369
|
+
fieldset?: string | null | undefined;
|
|
3370
|
+
config?: {
|
|
3371
|
+
label?: string | null | undefined;
|
|
3372
|
+
placeholder?: string;
|
|
3373
|
+
default?: string;
|
|
3374
|
+
};
|
|
3375
|
+
}) | ({
|
|
3376
|
+
type: "Embed";
|
|
3377
|
+
} & {
|
|
3378
|
+
fieldset?: string | null | undefined;
|
|
3379
|
+
config?: {
|
|
3380
|
+
label?: string | null | undefined;
|
|
3381
|
+
placeholder?: string;
|
|
3382
|
+
useAsTitle?: boolean;
|
|
3383
|
+
};
|
|
3384
|
+
}) | ({
|
|
3385
|
+
type: "GeoPoint";
|
|
3386
|
+
} & {
|
|
3387
|
+
fieldset?: string | null | undefined;
|
|
3388
|
+
config?: {
|
|
3389
|
+
label?: string | null | undefined;
|
|
3390
|
+
};
|
|
3391
|
+
}) | ({
|
|
3392
|
+
type: "Image";
|
|
3393
|
+
} & {
|
|
3394
|
+
fieldset?: string | null | undefined;
|
|
3395
|
+
config?: {
|
|
3396
|
+
label?: string | null | undefined;
|
|
3397
|
+
placeholder?: string;
|
|
3398
|
+
constraint?: {
|
|
3399
|
+
width?: number | null;
|
|
3400
|
+
height?: number | null;
|
|
3401
|
+
};
|
|
3402
|
+
thumbnails?: readonly ({
|
|
3403
|
+
name: string;
|
|
3404
|
+
} & {
|
|
3405
|
+
width?: number | null;
|
|
3406
|
+
height?: number | null;
|
|
3407
|
+
})[];
|
|
3408
|
+
};
|
|
3409
|
+
}) | ({
|
|
3410
|
+
type: "IntegrationFields";
|
|
3411
|
+
} & {
|
|
3412
|
+
fieldset?: string | null | undefined;
|
|
3413
|
+
config?: {
|
|
3414
|
+
label?: string | null | undefined;
|
|
3415
|
+
placeholder?: string;
|
|
3416
|
+
catalog?: string;
|
|
3417
|
+
};
|
|
3418
|
+
}) | ({
|
|
3419
|
+
type: "Link";
|
|
3420
|
+
} & {
|
|
3421
|
+
fieldset?: string | null | undefined;
|
|
3422
|
+
config?: {
|
|
3423
|
+
label?: string | null | undefined;
|
|
3424
|
+
useAsTitle?: boolean;
|
|
3425
|
+
placeholder?: string;
|
|
3426
|
+
select?: "media" | "document" | "web" | null;
|
|
3427
|
+
customtypes?: readonly string[];
|
|
3428
|
+
masks?: readonly string[];
|
|
3429
|
+
tags?: readonly string[];
|
|
3430
|
+
allowTargetBlank?: boolean;
|
|
3431
|
+
};
|
|
3432
|
+
}) | ({
|
|
3433
|
+
type: "Number";
|
|
3434
|
+
} & {
|
|
3435
|
+
fieldset?: string | null | undefined;
|
|
3436
|
+
config?: {
|
|
3437
|
+
label?: string | null | undefined;
|
|
3438
|
+
placeholder?: string;
|
|
3439
|
+
min?: number;
|
|
3440
|
+
max?: number;
|
|
3441
|
+
step?: number;
|
|
3442
|
+
};
|
|
3443
|
+
}) | ({
|
|
3444
|
+
type: "Range";
|
|
3445
|
+
} & {
|
|
3446
|
+
fieldset?: string | null | undefined;
|
|
3447
|
+
config?: {
|
|
3448
|
+
label?: string | null | undefined;
|
|
3449
|
+
placeholder?: string;
|
|
3450
|
+
min?: number;
|
|
3451
|
+
max?: number;
|
|
3452
|
+
step?: number;
|
|
3453
|
+
};
|
|
3454
|
+
}) | ({
|
|
3455
|
+
type: "StructuredText";
|
|
3456
|
+
} & {
|
|
3457
|
+
fieldset?: string | null | undefined;
|
|
3458
|
+
config?: {
|
|
3459
|
+
label?: string | null | undefined;
|
|
3460
|
+
placeholder?: string;
|
|
3461
|
+
useAsTitle?: boolean;
|
|
3462
|
+
single?: string;
|
|
3463
|
+
multi?: string;
|
|
3464
|
+
imageConstraint?: {
|
|
3465
|
+
width?: number | null;
|
|
3466
|
+
height?: number | null;
|
|
3467
|
+
};
|
|
3468
|
+
labels?: readonly string[];
|
|
3469
|
+
allowTargetBlank?: boolean;
|
|
3470
|
+
};
|
|
3471
|
+
}) | ({
|
|
3472
|
+
type: "Select";
|
|
3473
|
+
} & {
|
|
3474
|
+
fieldset?: string | null | undefined;
|
|
3475
|
+
config?: {
|
|
3476
|
+
label?: string | null | undefined;
|
|
3477
|
+
placeholder?: string;
|
|
3478
|
+
default_value?: string;
|
|
3479
|
+
options?: readonly string[];
|
|
3480
|
+
};
|
|
3481
|
+
}) | ({
|
|
3482
|
+
type: "Separator";
|
|
3483
|
+
} & {
|
|
3484
|
+
config?: {
|
|
3485
|
+
label?: string | null | undefined;
|
|
3486
|
+
};
|
|
3487
|
+
}) | ({
|
|
3488
|
+
type: "Text";
|
|
3489
|
+
} & {
|
|
3490
|
+
fieldset?: string | null | undefined;
|
|
3491
|
+
config?: {
|
|
3492
|
+
label?: string | null | undefined;
|
|
3493
|
+
useAsTitle?: boolean;
|
|
3494
|
+
placeholder?: string;
|
|
3495
|
+
};
|
|
3496
|
+
}) | ({
|
|
3497
|
+
type: "Timestamp";
|
|
3498
|
+
} & {
|
|
3499
|
+
fieldset?: string | null | undefined;
|
|
3500
|
+
config?: {
|
|
3501
|
+
label?: string | null | undefined;
|
|
3502
|
+
placeholder?: string;
|
|
3503
|
+
default?: string;
|
|
3504
|
+
};
|
|
3505
|
+
});
|
|
3506
|
+
};
|
|
3507
|
+
};
|
|
3189
3508
|
});
|
|
3190
3509
|
};
|
|
3191
3510
|
items?: {
|
|
@@ -3248,7 +3567,6 @@ export declare const StaticSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3248
3567
|
width?: number | null;
|
|
3249
3568
|
height?: number | null;
|
|
3250
3569
|
})[];
|
|
3251
|
-
allowCaption?: boolean;
|
|
3252
3570
|
};
|
|
3253
3571
|
}) | ({
|
|
3254
3572
|
type: "IntegrationFields";
|
|
@@ -3435,7 +3753,6 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3435
3753
|
width?: number | null;
|
|
3436
3754
|
height?: number | null;
|
|
3437
3755
|
})[];
|
|
3438
|
-
allowCaption?: boolean;
|
|
3439
3756
|
};
|
|
3440
3757
|
}) | ({
|
|
3441
3758
|
type: "IntegrationFields";
|
|
@@ -3602,7 +3919,6 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3602
3919
|
width?: number | null;
|
|
3603
3920
|
height?: number | null;
|
|
3604
3921
|
})[];
|
|
3605
|
-
allowCaption?: boolean;
|
|
3606
3922
|
};
|
|
3607
3923
|
}) | ({
|
|
3608
3924
|
type: "IntegrationFields";
|
|
@@ -3770,7 +4086,6 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3770
4086
|
width?: number | null;
|
|
3771
4087
|
height?: number | null;
|
|
3772
4088
|
})[];
|
|
3773
|
-
allowCaption?: boolean;
|
|
3774
4089
|
};
|
|
3775
4090
|
}) | ({
|
|
3776
4091
|
type: "IntegrationFields";
|
|
@@ -3930,7 +4245,6 @@ export declare const DynamicSlices: t.ExactC<t.IntersectionC<[t.TypeC<{
|
|
|
3930
4245
|
width?: number | null;
|
|
3931
4246
|
height?: number | null;
|
|
3932
4247
|
})[];
|
|
3933
|
-
allowCaption?: boolean;
|
|
3934
4248
|
};
|
|
3935
4249
|
}) | ({
|
|
3936
4250
|
type: "IntegrationFields";
|
|
@@ -6,5 +6,6 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
(0, tslib_1.__exportStar)(require("./SharedSlice"), exports);
|
|
7
7
|
(0, tslib_1.__exportStar)(require("./SharedSliceRef"), exports);
|
|
8
8
|
(0, tslib_1.__exportStar)(require("./Slice"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./SlicePrimaryWidget"), exports);
|
|
9
10
|
(0, tslib_1.__exportStar)(require("./Slices"), exports);
|
|
10
11
|
(0, tslib_1.__exportStar)(require("./SlicesTypes"), exports);
|
package/package.json
CHANGED
|
@@ -9,7 +9,11 @@ import type {
|
|
|
9
9
|
TraverseSliceContentFn,
|
|
10
10
|
TraverseWidgetContentFn,
|
|
11
11
|
} from "../../../../_internal/utils"
|
|
12
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
NestableWidget,
|
|
14
|
+
SharedSlice,
|
|
15
|
+
VariationFields,
|
|
16
|
+
} from "../../../../customtypes"
|
|
13
17
|
import {
|
|
14
18
|
getFieldCtx,
|
|
15
19
|
LegacyContentCtx,
|
|
@@ -153,7 +157,13 @@ export function sharedSliceContentWithDefaultValues(
|
|
|
153
157
|
(v) => v.id === content.variation,
|
|
154
158
|
)
|
|
155
159
|
|
|
156
|
-
|
|
160
|
+
// Temporarily filtering out group fields and casting to NestableWidget until
|
|
161
|
+
// we support group fields in primary
|
|
162
|
+
const primaryConfig = Object.fromEntries(
|
|
163
|
+
Object.entries(variationConfig?.primary ?? {}).filter(
|
|
164
|
+
([_, value]) => value.type !== "Group",
|
|
165
|
+
),
|
|
166
|
+
) as Record<string, NestableWidget>
|
|
157
167
|
const itemsConfig = variationConfig?.items ?? {}
|
|
158
168
|
|
|
159
169
|
const updatedPrimaryContent = withDefaultNestableContentValues(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Objects } from "../../utils"
|
|
2
2
|
import type { NestableWidget } from "../widgets/nestable"
|
|
3
|
+
import type { SlicePrimaryWidget } from "../widgets/slices"
|
|
3
4
|
import type { Variation } from "../widgets/slices"
|
|
4
5
|
import { type DiffChange, DiffOperation } from "./Changes"
|
|
5
6
|
|
|
@@ -7,7 +8,7 @@ export type VariationMetadata = Omit<Variation, "primary" | "items">
|
|
|
7
8
|
export type VariationDiff = DiffChange<
|
|
8
9
|
Variation,
|
|
9
10
|
Partial<VariationMetadata> & {
|
|
10
|
-
primary?: Record<string, DiffChange<
|
|
11
|
+
primary?: Record<string, DiffChange<SlicePrimaryWidget, SlicePrimaryWidget>>
|
|
11
12
|
items?: Record<string, DiffChange<NestableWidget, NestableWidget>>
|
|
12
13
|
}
|
|
13
14
|
>
|
|
@@ -26,10 +27,10 @@ function compareVariationMeta(
|
|
|
26
27
|
}, {})
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
function compareWidgets(
|
|
30
|
-
widgetsA?: { [key: string]:
|
|
31
|
-
widgetsB?: { [key: string]:
|
|
32
|
-
): Record<string, DiffChange<
|
|
30
|
+
function compareWidgets<TWidget extends NestableWidget | SlicePrimaryWidget>(
|
|
31
|
+
widgetsA?: { [key: string]: TWidget },
|
|
32
|
+
widgetsB?: { [key: string]: TWidget },
|
|
33
|
+
): Record<string, DiffChange<TWidget, TWidget>> | undefined {
|
|
33
34
|
const zippedWidgets = Objects.zipObjects(widgetsA, widgetsB)
|
|
34
35
|
|
|
35
36
|
const diffWidgets = Object.entries(zippedWidgets).reduce(
|
|
@@ -5,6 +5,7 @@ import { WidgetKey } from "../../../common"
|
|
|
5
5
|
import { NestableWidget } from "../nestable/NestableWidget"
|
|
6
6
|
import type { SharedSliceRef } from "./SharedSliceRef"
|
|
7
7
|
import type { DynamicSlice, StaticSlice } from "./Slice"
|
|
8
|
+
import { SlicePrimaryWidget } from "./SlicePrimaryWidget"
|
|
8
9
|
|
|
9
10
|
const IMAGE_PLACEHOLDER_URL =
|
|
10
11
|
"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
|
|
@@ -21,7 +22,7 @@ export const Variation = t.exact(
|
|
|
21
22
|
}),
|
|
22
23
|
t.partial({
|
|
23
24
|
display: t.string,
|
|
24
|
-
primary: t.record(WidgetKey,
|
|
25
|
+
primary: t.record(WidgetKey, SlicePrimaryWidget),
|
|
25
26
|
items: t.record(WidgetKey, NestableWidget),
|
|
26
27
|
}),
|
|
27
28
|
]),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as t from "io-ts"
|
|
2
|
+
|
|
3
|
+
import { Group } from "../Group"
|
|
4
|
+
import { NestableWidget } from "../nestable"
|
|
5
|
+
|
|
6
|
+
export const SlicePrimaryWidget = t.union([NestableWidget, Group])
|
|
7
|
+
|
|
8
|
+
export type SlicePrimaryWidget = t.TypeOf<typeof SlicePrimaryWidget>
|
|
9
|
+
export type SlicePrimaryFieldTypes = SlicePrimaryWidget["type"]
|