@prismicio/types-internal 2.0.0-alpha.2 → 2.0.0-alpha.4
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/LegacyContentCtx.js +1 -1
- package/lib/content/fields/WidgetContent.d.ts +1 -1
- package/lib/customtypes/widgets/Group.d.ts +164 -3
- package/lib/customtypes/widgets/Group.js +4 -5
- package/lib/customtypes/widgets/UID.d.ts +8 -3
- package/lib/customtypes/widgets/UID.js +4 -5
- package/lib/customtypes/widgets/Widget.d.ts +2 -2
- package/lib/customtypes/widgets/Widget.js +5 -5
- package/lib/customtypes/widgets/nestable/Link.d.ts +0 -1
- package/lib/customtypes/widgets/nestable/Link.js +0 -1
- package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -1
- package/lib/customtypes/widgets/nestable/Text.d.ts +0 -1
- package/lib/customtypes/widgets/nestable/Text.js +0 -1
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +6 -3
- package/lib/customtypes/widgets/slices/CompositeSlice.js +4 -5
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +2 -3
- package/lib/customtypes/widgets/slices/LegacySlice.js +3 -3
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +2 -3
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
- package/lib/customtypes/widgets/slices/Slice.d.ts +3 -3
- package/lib/customtypes/widgets/slices/Slices.d.ts +1 -1
- package/lib/customtypes/widgets/slices/Slices.js +5 -5
- package/lib/customtypes/widgets/slices/index.d.ts +3 -3
- package/lib/customtypes/widgets/slices/index.js +3 -3
- package/package.json +1 -1
- package/src/content/LegacyContentCtx.ts +2 -2
- package/src/content/fields/WidgetContent.ts +1 -1
- package/src/customtypes/widgets/Group.ts +4 -6
- package/src/customtypes/widgets/UID.ts +4 -6
- package/src/customtypes/widgets/Widget.ts +5 -5
- package/src/customtypes/widgets/nestable/Link.ts +0 -2
- package/src/customtypes/widgets/nestable/RichText.ts +1 -1
- package/src/customtypes/widgets/nestable/Text.ts +0 -2
- package/src/customtypes/widgets/slices/CompositeSlice.ts +4 -6
- package/src/customtypes/widgets/slices/LegacySlice.ts +3 -5
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +2 -4
- package/src/customtypes/widgets/slices/Slice.ts +3 -3
- package/src/customtypes/widgets/slices/Slices.ts +3 -3
- package/src/customtypes/widgets/slices/index.ts +3 -3
- package/lib/content/CustomType.d.ts +0 -2972
- package/lib/content/CustomType.js +0 -15
- package/lib/content/fields/nestable/FieldContent.d.ts +0 -32
- package/lib/content/fields/nestable/FieldContent.js +0 -37
- package/lib/content/fields/nestable/Image.d.ts +0 -103
- package/lib/content/fields/nestable/Image.js +0 -13
- package/lib/content/fields/nestable/RichTextContent.d.ts +0 -376
- package/lib/content/fields/nestable/RichTextContent.js +0 -16
- package/lib/content/fields/slices/CompositeSliceContent.d.ts +0 -677
- package/lib/content/fields/slices/CompositeSliceContent.js +0 -14
- package/lib/content/fields/slices/RepeatableContent.d.ts +0 -338
- package/lib/content/fields/slices/RepeatableContent.js +0 -16
- package/lib/content/fields/slices/SharedSliceContent.d.ts +0 -678
- package/lib/content/fields/slices/SharedSliceContent.js +0 -15
- package/lib/content/fields/slices/SimpleSliceContent.d.ts +0 -675
- package/lib/content/fields/slices/SimpleSliceContent.js +0 -8
- package/lib/customtypes/Comparators/Changes.d.ts +0 -17
- package/lib/customtypes/Comparators/Changes.js +0 -9
- package/lib/customtypes/Comparators/SharedSlice.d.ts +0 -679
- package/lib/customtypes/Comparators/SharedSlice.js +0 -55
- package/lib/customtypes/Comparators/Variation.d.ts +0 -662
- package/lib/customtypes/Comparators/Variation.js +0 -75
- package/lib/customtypes/Comparators/index.d.ts +0 -3
- package/lib/customtypes/Comparators/index.js +0 -6
- package/lib/customtypes/Format.d.ts +0 -4
- package/lib/customtypes/Format.js +0 -8
- package/lib/customtypes/comp/Changes.d.ts +0 -17
- package/lib/customtypes/comp/Changes.js +0 -9
- package/lib/customtypes/comp/SharedSlice.d.ts +0 -679
- package/lib/customtypes/comp/SharedSlice.js +0 -55
- package/lib/customtypes/comp/Variation.d.ts +0 -662
- package/lib/customtypes/comp/Variation.js +0 -76
- package/lib/customtypes/comp/index.d.ts +0 -3
- package/lib/customtypes/comp/index.js +0 -6
- package/lib/customtypes/utils/Comparator.d.ts +0 -1353
- package/lib/customtypes/utils/Comparator.js +0 -59
- package/lib/customtypes/utils/index.d.ts +0 -1
- package/lib/customtypes/utils/index.js +0 -4
- package/lib/customtypes/widgets/WidgetTypes.d.ts +0 -22
- package/lib/customtypes/widgets/WidgetTypes.js +0 -25
- package/lib/documents/DocumentData.d.ts +0 -6
- package/lib/documents/DocumentData.js +0 -15
- package/lib/documents/index.d.ts +0 -2
- package/lib/documents/index.js +0 -7
- package/lib/documents/widgets/EmptyContent.d.ts +0 -8
- package/lib/documents/widgets/EmptyContent.js +0 -9
- package/lib/documents/widgets/GroupContent.d.ts +0 -16
- package/lib/documents/widgets/GroupContent.js +0 -60
- package/lib/documents/widgets/SimpleWidgetContent.d.ts +0 -20
- package/lib/documents/widgets/SimpleWidgetContent.js +0 -75
- package/lib/documents/widgets/StaticWidgetContent.d.ts +0 -10
- package/lib/documents/widgets/StaticWidgetContent.js +0 -26
- package/lib/documents/widgets/UIDContent.d.ts +0 -7
- package/lib/documents/widgets/UIDContent.js +0 -10
- package/lib/documents/widgets/index.d.ts +0 -38
- package/lib/documents/widgets/index.js +0 -40
- package/lib/documents/widgets/nestable/BooleanContent.d.ts +0 -8
- package/lib/documents/widgets/nestable/BooleanContent.js +0 -11
- package/lib/documents/widgets/nestable/EmbedContent.d.ts +0 -42
- package/lib/documents/widgets/nestable/EmbedContent.js +0 -35
- package/lib/documents/widgets/nestable/FieldContent.d.ts +0 -13
- package/lib/documents/widgets/nestable/FieldContent.js +0 -37
- package/lib/documents/widgets/nestable/GeoPointContent.d.ts +0 -17
- package/lib/documents/widgets/nestable/GeoPointContent.js +0 -13
- package/lib/documents/widgets/nestable/ImageContent.d.ts +0 -127
- package/lib/documents/widgets/nestable/ImageContent.js +0 -41
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.d.ts +0 -8
- package/lib/documents/widgets/nestable/IntegrationFieldsContent.js +0 -16
- package/lib/documents/widgets/nestable/Link/DocumentLink.d.ts +0 -12
- package/lib/documents/widgets/nestable/Link/DocumentLink.js +0 -13
- package/lib/documents/widgets/nestable/Link/ExternalLink.d.ts +0 -24
- package/lib/documents/widgets/nestable/Link/ExternalLink.js +0 -24
- package/lib/documents/widgets/nestable/Link/FileLink.d.ts +0 -22
- package/lib/documents/widgets/nestable/Link/FileLink.js +0 -25
- package/lib/documents/widgets/nestable/Link/ImageLink.d.ts +0 -28
- package/lib/documents/widgets/nestable/Link/ImageLink.js +0 -26
- package/lib/documents/widgets/nestable/Link/LinkContent.d.ts +0 -42
- package/lib/documents/widgets/nestable/Link/LinkContent.js +0 -17
- package/lib/documents/widgets/nestable/Link/index.d.ts +0 -90
- package/lib/documents/widgets/nestable/Link/index.js +0 -35
- package/lib/documents/widgets/nestable/SeparatorContent.d.ts +0 -11
- package/lib/documents/widgets/nestable/SeparatorContent.js +0 -15
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +0 -314
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +0 -98
- package/lib/documents/widgets/nestable/StructuredTextContent/index.d.ts +0 -9
- package/lib/documents/widgets/nestable/StructuredTextContent/index.js +0 -14
- package/lib/documents/widgets/nestable/index.d.ts +0 -26
- package/lib/documents/widgets/nestable/index.js +0 -39
- package/lib/documents/widgets/slices/CompositeSliceContent.d.ts +0 -14
- package/lib/documents/widgets/slices/CompositeSliceContent.js +0 -52
- package/lib/documents/widgets/slices/SharedSliceContent.d.ts +0 -15
- package/lib/documents/widgets/slices/SharedSliceContent.js +0 -63
- package/lib/documents/widgets/slices/SimpleSliceContent.d.ts +0 -6
- package/lib/documents/widgets/slices/SimpleSliceContent.js +0 -6
- package/lib/documents/widgets/slices/SliceWidgetContent.d.ts +0 -8
- package/lib/documents/widgets/slices/SliceWidgetContent.js +0 -26
- package/lib/documents/widgets/slices/SlicesContent.d.ts +0 -17
- package/lib/documents/widgets/slices/SlicesContent.js +0 -52
- package/lib/documents/widgets/slices/index.d.ts +0 -5
- package/lib/documents/widgets/slices/index.js +0 -8
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import Group,
|
|
3
|
+
import { Group, GroupFieldType } from "./Group"
|
|
4
4
|
import {
|
|
5
5
|
BooleanFieldType,
|
|
6
6
|
ColorFieldType,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
SlicesFieldType,
|
|
28
28
|
StaticSlices,
|
|
29
29
|
} from "./slices/Slices"
|
|
30
|
-
import UID,
|
|
30
|
+
import { UID, UIDFieldType } from "./UID"
|
|
31
31
|
|
|
32
32
|
export function widgetReader<T extends StaticSlices | DynamicSlices>(
|
|
33
33
|
codec: t.Type<T, unknown>,
|
|
@@ -41,7 +41,7 @@ export type StaticWidget = t.TypeOf<typeof StaticWidget>
|
|
|
41
41
|
export const DynamicWidget = widgetReader(DynamicSlices)
|
|
42
42
|
export type DynamicWidget = t.TypeOf<typeof DynamicWidget>
|
|
43
43
|
|
|
44
|
-
export const
|
|
44
|
+
export const FieldType = t.keyof({
|
|
45
45
|
[ColorFieldType]: null,
|
|
46
46
|
[BooleanFieldType]: null,
|
|
47
47
|
[NumberFieldType]: null,
|
|
@@ -63,7 +63,7 @@ export const FieldTypes = t.keyof({
|
|
|
63
63
|
[LegacySlicesFieldType]: null,
|
|
64
64
|
})
|
|
65
65
|
|
|
66
|
-
export type
|
|
66
|
+
export type FieldType = t.TypeOf<typeof FieldType>
|
|
67
67
|
|
|
68
68
|
export const Widgets = {
|
|
69
69
|
toStatic(
|
|
@@ -75,7 +75,7 @@ export const Widgets = {
|
|
|
75
75
|
case "Slices":
|
|
76
76
|
return Slices.toStatic(widget, sharedSlices)
|
|
77
77
|
default:
|
|
78
|
-
return widget
|
|
78
|
+
return widget
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
}
|
|
@@ -9,7 +9,7 @@ export const RichTextFieldType = "StructuredText"
|
|
|
9
9
|
export const DEFAULT_OPTION = "paragraph"
|
|
10
10
|
|
|
11
11
|
export type RichTextNodeType =
|
|
12
|
-
typeof RichTextNodeType[keyof typeof RichTextNodeType]
|
|
12
|
+
(typeof RichTextNodeType)[keyof typeof RichTextNodeType]
|
|
13
13
|
export const RichTextNodeType = {
|
|
14
14
|
heading1: "heading1",
|
|
15
15
|
heading2: "heading2",
|
|
@@ -6,14 +6,14 @@ import { NestableWidget } from "../nestable/NestableWidget"
|
|
|
6
6
|
|
|
7
7
|
export const CompositeSliceType = "Slice"
|
|
8
8
|
|
|
9
|
-
const CompositeSliceConfig = t.exact(
|
|
9
|
+
export const CompositeSliceConfig = t.exact(
|
|
10
10
|
t.partial({
|
|
11
11
|
label: StringOrNull,
|
|
12
12
|
}),
|
|
13
13
|
)
|
|
14
|
-
type CompositeSliceConfig = t.TypeOf<typeof CompositeSliceConfig>
|
|
14
|
+
export type CompositeSliceConfig = t.TypeOf<typeof CompositeSliceConfig>
|
|
15
15
|
|
|
16
|
-
const CompositeSlice = t.exact(
|
|
16
|
+
export const CompositeSlice = t.exact(
|
|
17
17
|
t.intersection([
|
|
18
18
|
t.type({
|
|
19
19
|
type: t.literal(CompositeSliceType),
|
|
@@ -29,6 +29,4 @@ const CompositeSlice = t.exact(
|
|
|
29
29
|
}),
|
|
30
30
|
]),
|
|
31
31
|
)
|
|
32
|
-
type CompositeSlice = t.TypeOf<typeof CompositeSlice>
|
|
33
|
-
|
|
34
|
-
export default CompositeSlice
|
|
32
|
+
export type CompositeSlice = t.TypeOf<typeof CompositeSlice>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import Group from "../Group"
|
|
3
|
+
import { Group } from "../Group"
|
|
4
4
|
import { NestableWidget } from "../nestable/NestableWidget"
|
|
5
5
|
|
|
6
|
-
const LegacySlice = t.union([NestableWidget, Group])
|
|
6
|
+
export const LegacySlice = t.union([NestableWidget, Group])
|
|
7
7
|
|
|
8
|
-
type LegacySlice = t.TypeOf<typeof LegacySlice>
|
|
9
|
-
|
|
10
|
-
export default LegacySlice
|
|
8
|
+
export type LegacySlice = t.TypeOf<typeof LegacySlice>
|
|
@@ -2,11 +2,9 @@ import * as t from "io-ts"
|
|
|
2
2
|
|
|
3
3
|
import { SharedSliceType } from "./SharedSlice"
|
|
4
4
|
|
|
5
|
-
const SharedSliceRef = t.exact(
|
|
5
|
+
export const SharedSliceRef = t.exact(
|
|
6
6
|
t.type({
|
|
7
7
|
type: t.literal(SharedSliceType),
|
|
8
8
|
}),
|
|
9
9
|
)
|
|
10
|
-
type SharedSliceRef = t.TypeOf<typeof SharedSliceRef>
|
|
11
|
-
|
|
12
|
-
export default SharedSliceRef
|
|
10
|
+
export type SharedSliceRef = t.TypeOf<typeof SharedSliceRef>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type CompositeSlice from "./CompositeSlice"
|
|
2
|
-
import type LegacySlice from "./LegacySlice"
|
|
1
|
+
import type { CompositeSlice } from "./CompositeSlice"
|
|
2
|
+
import type { LegacySlice } from "./LegacySlice"
|
|
3
3
|
import type { SharedSlice } from "./SharedSlice"
|
|
4
|
-
import type SharedSliceRef from "./SharedSliceRef"
|
|
4
|
+
import type { SharedSliceRef } from "./SharedSliceRef"
|
|
5
5
|
|
|
6
6
|
export type DynamicSlice = CompositeSlice | LegacySlice | SharedSliceRef
|
|
7
7
|
export type StaticSlice = CompositeSlice | LegacySlice | SharedSlice
|
|
@@ -2,10 +2,10 @@ import * as t from "io-ts"
|
|
|
2
2
|
|
|
3
3
|
import { WidgetKey } from "../../../common"
|
|
4
4
|
import { StringOrNull } from "../../../validators"
|
|
5
|
-
import CompositeSlice from "./CompositeSlice"
|
|
6
|
-
import LegacySlice from "./LegacySlice"
|
|
5
|
+
import { CompositeSlice } from "./CompositeSlice"
|
|
6
|
+
import { LegacySlice } from "./LegacySlice"
|
|
7
7
|
import { SharedSlice } from "./SharedSlice"
|
|
8
|
-
import SharedSliceRef from "./SharedSliceRef"
|
|
8
|
+
import { SharedSliceRef } from "./SharedSliceRef"
|
|
9
9
|
|
|
10
10
|
export const LegacySlicesFieldType = "Choice"
|
|
11
11
|
export const SlicesFieldType = "Slices"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CompositeSlice } from "./CompositeSlice"
|
|
2
|
+
export { LegacySlice } from "./LegacySlice"
|
|
3
3
|
export * from "./SharedSlice"
|
|
4
|
-
export {
|
|
4
|
+
export { SharedSliceRef } from "./SharedSliceRef"
|
|
5
5
|
export * as Slice from "./Slice"
|
|
6
6
|
export * as SliceZone from "./Slices"
|
|
7
7
|
export { SlicesTypes } from "./SlicesTypes"
|