@prismicio/types-internal 0.3.3 → 1.0.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/customtypes/CustomType.d.ts +309 -311
- package/lib/customtypes/CustomType.js +6 -6
- package/lib/customtypes/Format.d.ts +4 -0
- package/lib/customtypes/Format.js +8 -0
- package/lib/customtypes/Section.d.ts +309 -309
- package/lib/customtypes/widgets/Group.d.ts +22 -23
- package/lib/customtypes/widgets/Group.js +2 -2
- package/lib/customtypes/widgets/UID.d.ts +1 -2
- package/lib/customtypes/widgets/UID.js +2 -2
- package/lib/customtypes/widgets/Widget.d.ts +353 -354
- package/lib/customtypes/widgets/Widget.js +3 -3
- package/lib/customtypes/widgets/WidgetTypes.d.ts +22 -22
- package/lib/customtypes/widgets/WidgetTypes.js +22 -23
- package/lib/customtypes/widgets/index.d.ts +1 -1
- package/lib/customtypes/widgets/index.js +1 -1
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/BooleanField.js +2 -2
- package/lib/customtypes/widgets/nestable/Color.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Color.js +2 -2
- package/lib/customtypes/widgets/nestable/Date.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Date.js +2 -2
- package/lib/customtypes/widgets/nestable/Embed.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Embed.js +2 -2
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/GeoPoint.js +2 -2
- package/lib/customtypes/widgets/nestable/Image.d.ts +2 -3
- package/lib/customtypes/widgets/nestable/Image.js +3 -3
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/IntegrationField.js +2 -2
- package/lib/customtypes/widgets/nestable/Link.d.ts +4 -5
- package/lib/customtypes/widgets/nestable/Link.js +3 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +21 -21
- package/lib/customtypes/widgets/nestable/Number.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Number.js +2 -2
- package/lib/customtypes/widgets/nestable/Range.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Range.js +2 -2
- package/lib/customtypes/widgets/nestable/RichText.d.ts +22 -22
- package/lib/customtypes/widgets/nestable/RichText.js +38 -39
- package/lib/customtypes/widgets/nestable/Select.d.ts +2 -3
- package/lib/customtypes/widgets/nestable/Select.js +3 -3
- package/lib/customtypes/widgets/nestable/Separator.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Separator.js +2 -2
- package/lib/customtypes/widgets/nestable/Text.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Text.js +2 -2
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +1 -2
- package/lib/customtypes/widgets/nestable/Timestamp.js +2 -2
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +43 -44
- package/lib/customtypes/widgets/slices/CompositeSlice.js +2 -2
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +43 -43
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +86 -87
- package/lib/customtypes/widgets/slices/SharedSlice.js +3 -3
- package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +1 -2
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
- package/lib/customtypes/widgets/slices/Slices.d.ts +529 -531
- package/lib/customtypes/widgets/slices/Slices.js +6 -6
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +5 -5
- package/lib/customtypes/widgets/slices/SlicesTypes.js +5 -6
- package/lib/customtypes/widgets/slices/index.d.ts +1 -1
- package/lib/customtypes/widgets/slices/index.js +1 -1
- package/lib/documents/widgets/index.d.ts +1 -0
- package/lib/documents/widgets/nestable/Link/index.d.ts +1 -0
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +16 -17
- package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +1 -1
- package/package.json +1 -1
- package/src/customtypes/CustomType.ts +2 -2
- package/src/customtypes/widgets/Group.ts +1 -1
- package/src/customtypes/widgets/UID.ts +1 -1
- package/src/customtypes/widgets/Widget.ts +1 -1
- package/src/customtypes/widgets/WidgetTypes.ts +22 -22
- package/src/customtypes/widgets/index.ts +1 -1
- package/src/customtypes/widgets/nestable/BooleanField.ts +1 -1
- package/src/customtypes/widgets/nestable/Color.ts +1 -1
- package/src/customtypes/widgets/nestable/Date.ts +1 -1
- package/src/customtypes/widgets/nestable/Embed.ts +1 -1
- package/src/customtypes/widgets/nestable/GeoPoint.ts +1 -1
- package/src/customtypes/widgets/nestable/Image.ts +2 -2
- package/src/customtypes/widgets/nestable/IntegrationField.ts +1 -1
- package/src/customtypes/widgets/nestable/Link.ts +4 -4
- package/src/customtypes/widgets/nestable/Number.ts +1 -1
- package/src/customtypes/widgets/nestable/Range.ts +1 -1
- package/src/customtypes/widgets/nestable/RichText.ts +37 -35
- package/src/customtypes/widgets/nestable/Select.ts +4 -2
- package/src/customtypes/widgets/nestable/Separator.ts +1 -1
- package/src/customtypes/widgets/nestable/Text.ts +1 -1
- package/src/customtypes/widgets/nestable/Timestamp.ts +1 -1
- package/src/customtypes/widgets/slices/CompositeSlice.ts +1 -1
- package/src/customtypes/widgets/slices/SharedSlice.ts +2 -2
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +1 -1
- package/src/customtypes/widgets/slices/Slices.ts +3 -3
- package/src/customtypes/widgets/slices/SlicesTypes.ts +5 -5
- package/src/customtypes/widgets/slices/index.ts +1 -1
- package/src/documents/widgets/index.ts +1 -5
- package/src/documents/widgets/nestable/Link/index.ts +2 -0
- package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +1 -1
|
@@ -2,7 +2,7 @@ import * as t from "io-ts"
|
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
4
|
import NestableWidget from "../nestable/NestableWidget"
|
|
5
|
-
import SlicesTypes from "./SlicesTypes"
|
|
5
|
+
import { SlicesTypes } from "./SlicesTypes"
|
|
6
6
|
|
|
7
7
|
const CompositeSliceConfig = t.exact(
|
|
8
8
|
t.partial({
|
|
@@ -2,7 +2,7 @@ import * as t from "io-ts"
|
|
|
2
2
|
import { withFallback } from "io-ts-types/lib/withFallback"
|
|
3
3
|
|
|
4
4
|
import NestableWidget from "../nestable/NestableWidget"
|
|
5
|
-
import SlicesTypes from "./SlicesTypes"
|
|
5
|
+
import { SlicesTypes } from "./SlicesTypes"
|
|
6
6
|
|
|
7
7
|
const IMAGE_PLACEHOLDER_URL =
|
|
8
8
|
"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
|
|
@@ -33,7 +33,7 @@ export const SharedSlice = t.exact(
|
|
|
33
33
|
id: t.string,
|
|
34
34
|
type: t.literal(SlicesTypes.SharedSlice),
|
|
35
35
|
name: t.string,
|
|
36
|
-
variations: t.
|
|
36
|
+
variations: t.readonlyArray(Variation),
|
|
37
37
|
}),
|
|
38
38
|
t.partial({
|
|
39
39
|
description: t.string,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import WidgetTypes from "../WidgetTypes"
|
|
4
|
+
import { WidgetTypes } from "../WidgetTypes"
|
|
5
5
|
import CompositeSlice from "./CompositeSlice"
|
|
6
6
|
import LegacySlice from "./LegacySlice"
|
|
7
7
|
import { SharedSlice } from "./SharedSlice"
|
|
8
8
|
import SharedSliceRef from "./SharedSliceRef"
|
|
9
|
-
import SlicesTypes from "./SlicesTypes"
|
|
9
|
+
import { SlicesTypes } from "./SlicesTypes"
|
|
10
10
|
|
|
11
11
|
export const SlicesLabels = t.union([
|
|
12
12
|
t.record(
|
|
13
13
|
t.string,
|
|
14
|
-
t.
|
|
14
|
+
t.readonlyArray(
|
|
15
15
|
t.exact(
|
|
16
16
|
t.intersection([
|
|
17
17
|
t.type({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Slice
|
|
3
|
-
SharedSlice
|
|
4
|
-
}
|
|
1
|
+
export const SlicesTypes = {
|
|
2
|
+
Slice: "Slice",
|
|
3
|
+
SharedSlice: "SharedSlice",
|
|
4
|
+
} as const
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export type SlicesTypes = typeof SlicesTypes[keyof typeof SlicesTypes]
|
|
@@ -21,11 +21,7 @@ export const WidgetTypes = {
|
|
|
21
21
|
slices: SlicesContentType,
|
|
22
22
|
} as const
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
export const WidgetKey = refineType(t.string, "WidgetKey", (s: string) =>
|
|
26
|
-
widgetKeyRegex.test(s),
|
|
27
|
-
)
|
|
28
|
-
export type WidgetKey = t.TypeOf<typeof WidgetKey>*/
|
|
24
|
+
export type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes]
|
|
29
25
|
|
|
30
26
|
export type WidgetKey = string
|
|
31
27
|
|