@prismicio/client 7.0.0-alpha.4 → 7.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/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.ts +4 -4
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/createClient.cjs +24 -24
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.d.ts +28 -28
- package/dist/createClient.js +24 -24
- package/dist/createClient.js.map +1 -1
- package/dist/filter.cjs +1 -1
- package/dist/filter.cjs.map +1 -1
- package/dist/filter.d.ts +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.js.map +1 -1
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.d.ts +2 -2
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs +5 -5
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.ts +21 -21
- package/dist/helpers/asHTML.js +5 -5
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +5 -5
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +3 -3
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +6 -6
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.ts +14 -14
- package/dist/helpers/asLink.js.map +1 -1
- package/dist/helpers/asLinkAttrs.cjs.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +5 -5
- package/dist/helpers/asLinkAttrs.js.map +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.ts +8 -8
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/documentToLinkField.cjs.map +1 -1
- package/dist/helpers/documentToLinkField.js.map +1 -1
- package/dist/helpers/isFilled.cjs +3 -1
- package/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/helpers/isFilled.d.ts +24 -20
- package/dist/helpers/isFilled.js +3 -1
- package/dist/helpers/isFilled.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/types/api/repository.d.ts +2 -2
- package/dist/types/model/boolean.d.ts +1 -1
- package/dist/types/model/color.d.ts +1 -1
- package/dist/types/model/contentRelationship.d.ts +1 -1
- package/dist/types/model/customType.d.ts +11 -11
- package/dist/types/model/date.d.ts +1 -1
- package/dist/types/model/embed.d.ts +1 -1
- package/dist/types/model/geoPoint.d.ts +1 -1
- package/dist/types/model/group.d.ts +1 -1
- package/dist/types/model/image.d.ts +3 -3
- package/dist/types/model/{integrationFields.d.ts → integration.d.ts} +3 -3
- package/dist/types/model/keyText.d.ts +1 -1
- package/dist/types/model/link.cjs.map +1 -1
- package/dist/types/model/link.d.ts +2 -2
- package/dist/types/model/link.js.map +1 -1
- package/dist/types/model/linkToMedia.d.ts +1 -1
- package/dist/types/model/number.d.ts +1 -1
- package/dist/types/model/richText.d.ts +3 -3
- package/dist/types/model/select.d.ts +1 -1
- package/dist/types/model/sharedSlice.d.ts +2 -2
- package/dist/types/model/sharedSliceVariation.d.ts +1 -1
- package/dist/types/model/slice.cjs.map +1 -1
- package/dist/types/model/slice.d.ts +1 -1
- package/dist/types/model/slice.js.map +1 -1
- package/dist/types/model/sliceZone.cjs.map +1 -1
- package/dist/types/model/sliceZone.d.ts +2 -2
- package/dist/types/model/sliceZone.js.map +1 -1
- package/dist/types/model/timestamp.d.ts +1 -1
- package/dist/types/model/title.d.ts +1 -1
- package/dist/types/model/types.cjs +5 -1
- package/dist/types/model/types.cjs.map +1 -1
- package/dist/types/model/types.d.ts +10 -6
- package/dist/types/model/types.js +5 -1
- package/dist/types/model/types.js.map +1 -1
- package/dist/types/model/uid.d.ts +1 -1
- package/dist/types/value/boolean.d.ts +1 -1
- package/dist/types/value/color.d.ts +1 -1
- package/dist/types/value/contentRelationship.d.ts +1 -1
- package/dist/types/value/date.d.ts +1 -1
- package/dist/types/value/document.d.ts +4 -4
- package/dist/types/value/embed.cjs.map +1 -1
- package/dist/types/value/embed.d.ts +1 -1
- package/dist/types/value/embed.js.map +1 -1
- package/dist/types/value/geoPoint.d.ts +1 -1
- package/dist/types/value/group.d.ts +1 -1
- package/dist/types/value/image.d.ts +3 -3
- package/dist/types/value/{integrationFields.d.ts → integration.d.ts} +2 -2
- package/dist/types/value/keyText.d.ts +1 -1
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.ts +2 -2
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/linkToMedia.d.ts +2 -2
- package/dist/types/value/number.d.ts +1 -1
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.d.ts +26 -26
- package/dist/types/value/richText.js.map +1 -1
- package/dist/types/value/select.d.ts +1 -1
- package/dist/types/value/sharedSlice.d.ts +1 -1
- package/dist/types/value/sharedSliceVariation.d.ts +3 -0
- package/dist/types/value/slice.d.ts +1 -1
- package/dist/types/value/timestamp.d.ts +1 -1
- package/dist/types/value/title.d.ts +1 -1
- package/dist/types/value/types.d.ts +2 -2
- package/dist/types/webhook/apiUpdate.d.ts +1 -1
- package/package.json +2 -2
- package/src/buildQueryURL.ts +4 -4
- package/src/createClient.ts +28 -28
- package/src/filter.ts +1 -1
- package/src/helpers/asDate.ts +2 -2
- package/src/helpers/asHTML.ts +28 -29
- package/src/helpers/asImagePixelDensitySrcSet.ts +5 -5
- package/src/helpers/asImageSrc.ts +3 -3
- package/src/helpers/asImageWidthSrcSet.ts +6 -6
- package/src/helpers/asLink.ts +18 -18
- package/src/helpers/asLinkAttrs.ts +5 -5
- package/src/helpers/asText.ts +8 -8
- package/src/helpers/documentToLinkField.ts +1 -1
- package/src/helpers/isFilled.ts +27 -22
- package/src/index.ts +19 -3
- package/src/types/api/repository.ts +2 -2
- package/src/types/model/boolean.ts +1 -1
- package/src/types/model/color.ts +1 -1
- package/src/types/model/contentRelationship.ts +1 -1
- package/src/types/model/customType.ts +11 -11
- package/src/types/model/date.ts +1 -1
- package/src/types/model/embed.ts +1 -1
- package/src/types/model/geoPoint.ts +1 -1
- package/src/types/model/group.ts +1 -1
- package/src/types/model/image.ts +3 -3
- package/src/types/model/{integrationFields.ts → integration.ts} +3 -3
- package/src/types/model/keyText.ts +1 -1
- package/src/types/model/link.ts +2 -2
- package/src/types/model/linkToMedia.ts +1 -1
- package/src/types/model/number.ts +1 -1
- package/src/types/model/richText.ts +3 -3
- package/src/types/model/select.ts +1 -1
- package/src/types/model/sharedSlice.ts +2 -2
- package/src/types/model/sharedSliceVariation.ts +1 -1
- package/src/types/model/slice.ts +1 -1
- package/src/types/model/sliceZone.ts +2 -2
- package/src/types/model/timestamp.ts +1 -1
- package/src/types/model/title.ts +1 -1
- package/src/types/model/types.ts +10 -6
- package/src/types/model/uid.ts +1 -1
- package/src/types/value/boolean.ts +1 -1
- package/src/types/value/color.ts +1 -1
- package/src/types/value/contentRelationship.ts +1 -1
- package/src/types/value/date.ts +1 -1
- package/src/types/value/document.ts +4 -4
- package/src/types/value/embed.ts +1 -1
- package/src/types/value/geoPoint.ts +1 -1
- package/src/types/value/group.ts +1 -1
- package/src/types/value/image.ts +4 -4
- package/src/types/value/{integrationFields.ts → integration.ts} +2 -2
- package/src/types/value/keyText.ts +1 -1
- package/src/types/value/link.ts +2 -2
- package/src/types/value/linkToMedia.ts +2 -2
- package/src/types/value/number.ts +1 -1
- package/src/types/value/richText.ts +26 -26
- package/src/types/value/select.ts +1 -1
- package/src/types/value/sharedSlice.ts +1 -1
- package/src/types/value/sharedSliceVariation.ts +3 -0
- package/src/types/value/slice.ts +1 -1
- package/src/types/value/timestamp.ts +1 -1
- package/src/types/value/title.ts +1 -1
- package/src/types/value/types.ts +2 -2
- package/src/types/webhook/apiUpdate.ts +1 -1
package/src/types/model/types.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { CustomTypeModelEmbedField } from "./embed";
|
|
|
6
6
|
import type { CustomTypeModelGeoPointField } from "./geoPoint";
|
|
7
7
|
import type { CustomTypeModelGroupField } from "./group";
|
|
8
8
|
import type { CustomTypeModelImageField } from "./image";
|
|
9
|
-
import type {
|
|
9
|
+
import type { CustomTypeModelIntegrationField } from "./integration";
|
|
10
10
|
import type { CustomTypeModelKeyTextField } from "./keyText";
|
|
11
11
|
import type { CustomTypeModelLinkField } from "./link";
|
|
12
12
|
import type { CustomTypeModelLinkToMediaField } from "./linkToMedia";
|
|
@@ -21,7 +21,7 @@ import type { CustomTypeModelTitleField } from "./title";
|
|
|
21
21
|
import type { CustomTypeModelUIDField } from "./uid";
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Type identifier for a
|
|
24
|
+
* Type identifier for a custom type field.
|
|
25
25
|
*/
|
|
26
26
|
export const CustomTypeModelFieldType = {
|
|
27
27
|
Boolean: "Boolean",
|
|
@@ -31,7 +31,7 @@ export const CustomTypeModelFieldType = {
|
|
|
31
31
|
GeoPoint: "GeoPoint",
|
|
32
32
|
Group: "Group",
|
|
33
33
|
Image: "Image",
|
|
34
|
-
|
|
34
|
+
Integration: "IntegrationFields",
|
|
35
35
|
Link: "Link",
|
|
36
36
|
Number: "Number",
|
|
37
37
|
Select: "Select",
|
|
@@ -40,6 +40,10 @@ export const CustomTypeModelFieldType = {
|
|
|
40
40
|
Text: "Text",
|
|
41
41
|
Timestamp: "Timestamp",
|
|
42
42
|
UID: "UID",
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated - Renamed to `Integration`.
|
|
45
|
+
*/
|
|
46
|
+
IntegrationFields: "IntegrationFields",
|
|
43
47
|
/**
|
|
44
48
|
* @deprecated - Legacy field type. Use `Number` instead.
|
|
45
49
|
*/
|
|
@@ -55,7 +59,7 @@ export const CustomTypeModelFieldType = {
|
|
|
55
59
|
} as const;
|
|
56
60
|
|
|
57
61
|
/**
|
|
58
|
-
* A
|
|
62
|
+
* A custom type field.
|
|
59
63
|
*/
|
|
60
64
|
export type CustomTypeModelField =
|
|
61
65
|
| CustomTypeModelUIDField
|
|
@@ -64,7 +68,7 @@ export type CustomTypeModelField =
|
|
|
64
68
|
| CustomTypeModelFieldForGroup;
|
|
65
69
|
|
|
66
70
|
/**
|
|
67
|
-
* Any
|
|
71
|
+
* Any custom type field that is valid for a group field.
|
|
68
72
|
*/
|
|
69
73
|
export type CustomTypeModelFieldForGroup =
|
|
70
74
|
| CustomTypeModelBooleanField
|
|
@@ -73,7 +77,7 @@ export type CustomTypeModelFieldForGroup =
|
|
|
73
77
|
| CustomTypeModelEmbedField
|
|
74
78
|
| CustomTypeModelGeoPointField
|
|
75
79
|
| CustomTypeModelImageField
|
|
76
|
-
|
|
|
80
|
+
| CustomTypeModelIntegrationField
|
|
77
81
|
| CustomTypeModelContentRelationshipField
|
|
78
82
|
| CustomTypeModelLinkField
|
|
79
83
|
| CustomTypeModelLinkToMediaField
|
package/src/types/model/uid.ts
CHANGED
package/src/types/value/color.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type ContentRelationshipField<
|
|
|
25
25
|
: FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface>;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Links that refer to
|
|
28
|
+
* Links that refer to documents
|
|
29
29
|
*/
|
|
30
30
|
export interface FilledContentRelationshipField<
|
|
31
31
|
TypeEnum = string,
|
package/src/types/value/date.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface AlternateLanguage<TypeEnum = string, LangEnum = string> {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* Metadata for Prismic
|
|
17
|
+
* Metadata for Prismic document
|
|
18
18
|
*/
|
|
19
19
|
export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
20
20
|
/**
|
|
@@ -76,7 +76,7 @@ export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
|
76
76
|
/**
|
|
77
77
|
* A Prismic document served through REST API v2.
|
|
78
78
|
*
|
|
79
|
-
* @see More details on
|
|
79
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
80
80
|
*/
|
|
81
81
|
export interface PrismicDocument<
|
|
82
82
|
DataInterface extends Record<
|
|
@@ -97,7 +97,7 @@ export interface PrismicDocument<
|
|
|
97
97
|
* A Prismic document served through REST API v2. Does not contain a UID (a
|
|
98
98
|
* unique identifier).
|
|
99
99
|
*
|
|
100
|
-
* @see More details on
|
|
100
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
101
101
|
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
102
102
|
*/
|
|
103
103
|
export interface PrismicDocumentWithoutUID<
|
|
@@ -123,7 +123,7 @@ export interface PrismicDocumentWithoutUID<
|
|
|
123
123
|
* A Prismic document served through REST API v2. Contains a UID (a unique
|
|
124
124
|
* identifier).
|
|
125
125
|
*
|
|
126
|
-
* @see More details on
|
|
126
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
127
127
|
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
128
128
|
*/
|
|
129
129
|
export interface PrismicDocumentWithUID<
|
package/src/types/value/embed.ts
CHANGED
|
@@ -179,7 +179,7 @@ export type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {
|
|
|
179
179
|
export type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* An
|
|
182
|
+
* An embed field.
|
|
183
183
|
*
|
|
184
184
|
* @typeParam Data - Data provided by the URL's oEmbed provider.
|
|
185
185
|
* @typeParam State - State of the field which determines its shape.
|
package/src/types/value/group.ts
CHANGED
package/src/types/value/image.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { FieldState, Simplify } from "./types";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* An individual image within an
|
|
4
|
+
* An individual image within an image field. The base image and each thumbnail
|
|
5
5
|
* uses this type.
|
|
6
6
|
*
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
-
* @see {@link ImageField} for a full
|
|
8
|
+
* @see {@link ImageField} for a full image field type.
|
|
9
9
|
*/
|
|
10
10
|
export type ImageFieldImage<State extends FieldState = FieldState> =
|
|
11
11
|
State extends "empty" ? EmptyImageFieldImage : FilledImageFieldImage;
|
|
@@ -28,7 +28,7 @@ export interface EmptyImageFieldImage {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* An image field.
|
|
32
32
|
*
|
|
33
33
|
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and
|
|
34
34
|
* will be removed in a future version. Use `never` instead.
|
|
@@ -45,7 +45,7 @@ export type ImageField<
|
|
|
45
45
|
ThumbnailNames extends string | null = never,
|
|
46
46
|
State extends FieldState = FieldState,
|
|
47
47
|
> =
|
|
48
|
-
// Simplify is necessary. Without it,
|
|
48
|
+
// Simplify is necessary. Without it, group and Slice types break for
|
|
49
49
|
// unknown reasons. If you know why, please update this comment with an
|
|
50
50
|
// explanation. :)
|
|
51
51
|
Simplify<
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { FieldState } from "./types";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* An integration field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Data - Data from the integrated API.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
8
|
* @see More details: {@link https://prismic.io/docs/integration-fields}
|
|
9
9
|
*/
|
|
10
|
-
export type
|
|
10
|
+
export type IntegrationField<
|
|
11
11
|
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
12
12
|
State extends FieldState = FieldState,
|
|
13
13
|
> = State extends "empty" ? null : Data;
|
package/src/types/value/link.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { LinkToMediaField } from "./linkToMedia";
|
|
|
6
6
|
import type { SliceZone } from "./sliceZone";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Link
|
|
9
|
+
* Link types
|
|
10
10
|
*/
|
|
11
11
|
export const LinkType = {
|
|
12
12
|
Any: "Any",
|
|
@@ -36,7 +36,7 @@ export interface FilledLinkToWebField {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* A link field.
|
|
40
40
|
*
|
|
41
41
|
* @typeParam TypeEnum - Type API ID of the document.
|
|
42
42
|
* @typeParam LangEnum - Language API ID of the document.
|
|
@@ -3,7 +3,7 @@ import type { FieldState } from "./types";
|
|
|
3
3
|
import type { EmptyLinkField, LinkType } from "./link";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* A link field that points to media.
|
|
7
7
|
*
|
|
8
8
|
* @typeParam State - State of the field which determines its shape.
|
|
9
9
|
*/
|
|
@@ -13,7 +13,7 @@ export type LinkToMediaField<State extends FieldState = FieldState> =
|
|
|
13
13
|
: FilledLinkToMediaField;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* A link that points to media.
|
|
17
17
|
*/
|
|
18
18
|
export interface FilledLinkToMediaField {
|
|
19
19
|
link_type: typeof LinkType.Media;
|
|
@@ -35,7 +35,7 @@ export const RichTextNodeType = {
|
|
|
35
35
|
// Text nodes
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Base to be extended by other
|
|
38
|
+
* Base to be extended by other rich text nodes.
|
|
39
39
|
*/
|
|
40
40
|
export interface RTTextNodeBase {
|
|
41
41
|
text: string;
|
|
@@ -43,70 +43,70 @@ export interface RTTextNodeBase {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Rich
|
|
46
|
+
* Rich text `heading1` node
|
|
47
47
|
*/
|
|
48
48
|
export interface RTHeading1Node extends RTTextNodeBase {
|
|
49
49
|
type: typeof RichTextNodeType.heading1;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Rich
|
|
53
|
+
* Rich text `heading2` node
|
|
54
54
|
*/
|
|
55
55
|
export interface RTHeading2Node extends RTTextNodeBase {
|
|
56
56
|
type: typeof RichTextNodeType.heading2;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Rich
|
|
60
|
+
* Rich text `heading3` node
|
|
61
61
|
*/
|
|
62
62
|
export interface RTHeading3Node extends RTTextNodeBase {
|
|
63
63
|
type: typeof RichTextNodeType.heading3;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
* Rich
|
|
67
|
+
* Rich text `heading4` node
|
|
68
68
|
*/
|
|
69
69
|
export interface RTHeading4Node extends RTTextNodeBase {
|
|
70
70
|
type: typeof RichTextNodeType.heading4;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* Rich
|
|
74
|
+
* Rich text `heading5` node
|
|
75
75
|
*/
|
|
76
76
|
export interface RTHeading5Node extends RTTextNodeBase {
|
|
77
77
|
type: typeof RichTextNodeType.heading5;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Rich
|
|
81
|
+
* Rich text `heading6` node
|
|
82
82
|
*/
|
|
83
83
|
export interface RTHeading6Node extends RTTextNodeBase {
|
|
84
84
|
type: typeof RichTextNodeType.heading6;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* Rich
|
|
88
|
+
* Rich text `paragraph` node
|
|
89
89
|
*/
|
|
90
90
|
export interface RTParagraphNode extends RTTextNodeBase {
|
|
91
91
|
type: typeof RichTextNodeType.paragraph;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
|
-
* Rich
|
|
95
|
+
* Rich text `preformatted` node
|
|
96
96
|
*/
|
|
97
97
|
export interface RTPreformattedNode extends RTTextNodeBase {
|
|
98
98
|
type: typeof RichTextNodeType.preformatted;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
* Rich
|
|
102
|
+
* Rich text `list-item` node
|
|
103
103
|
*/
|
|
104
104
|
export interface RTListItemNode extends RTTextNodeBase {
|
|
105
105
|
type: typeof RichTextNodeType.listItem;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Rich
|
|
109
|
+
* Rich text `o-list-item` node for ordered lists
|
|
110
110
|
*/
|
|
111
111
|
export interface RTOListItemNode extends RTTextNodeBase {
|
|
112
112
|
type: typeof RichTextNodeType.oListItem;
|
|
@@ -122,21 +122,21 @@ export interface RTSpanNodeBase {
|
|
|
122
122
|
end: number;
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
|
-
* Rich
|
|
125
|
+
* Rich text `strong` node
|
|
126
126
|
*/
|
|
127
127
|
export interface RTStrongNode extends RTSpanNodeBase {
|
|
128
128
|
type: typeof RichTextNodeType.strong;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
* Rich
|
|
132
|
+
* Rich text `embed` node
|
|
133
133
|
*/
|
|
134
134
|
export interface RTEmNode extends RTSpanNodeBase {
|
|
135
135
|
type: typeof RichTextNodeType.em;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* Rich
|
|
139
|
+
* Rich text `label` node
|
|
140
140
|
*/
|
|
141
141
|
export interface RTLabelNode extends RTSpanNodeBase {
|
|
142
142
|
type: typeof RichTextNodeType.label;
|
|
@@ -148,7 +148,7 @@ export interface RTLabelNode extends RTSpanNodeBase {
|
|
|
148
148
|
// Media nodes
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* Rich
|
|
151
|
+
* Rich text `image` nodes. They could link to other documents, external web
|
|
152
152
|
* links and media fields
|
|
153
153
|
*/
|
|
154
154
|
export type RTImageNode = {
|
|
@@ -167,7 +167,7 @@ export type RTImageNode = {
|
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
|
-
* Rich
|
|
170
|
+
* Rich text `embed` node
|
|
171
171
|
*/
|
|
172
172
|
export type RTEmbedNode = {
|
|
173
173
|
type: typeof RichTextNodeType.embed;
|
|
@@ -177,7 +177,7 @@ export type RTEmbedNode = {
|
|
|
177
177
|
// Link nodes
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
|
-
* Rich
|
|
180
|
+
* Rich text `a` node
|
|
181
181
|
*
|
|
182
182
|
* @see More details: {@link https://prismic.io/docs/rich-text-title#elements-and-styles}
|
|
183
183
|
*/
|
|
@@ -192,7 +192,7 @@ export interface RTLinkNode extends RTSpanNodeBase {
|
|
|
192
192
|
// Serialization related nodes
|
|
193
193
|
|
|
194
194
|
/**
|
|
195
|
-
* Rich
|
|
195
|
+
* Rich text `list` node
|
|
196
196
|
*/
|
|
197
197
|
export interface RTListNode {
|
|
198
198
|
type: typeof RichTextNodeType.list;
|
|
@@ -200,7 +200,7 @@ export interface RTListNode {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
* Rich
|
|
203
|
+
* Rich text o-lost node
|
|
204
204
|
*/
|
|
205
205
|
export interface RTOListNode {
|
|
206
206
|
type: typeof RichTextNodeType.oList;
|
|
@@ -209,7 +209,7 @@ export interface RTOListNode {
|
|
|
209
209
|
|
|
210
210
|
// This one is confusing but it's actually the inner content of a block
|
|
211
211
|
/**
|
|
212
|
-
* Rich
|
|
212
|
+
* Rich text `span` node
|
|
213
213
|
*/
|
|
214
214
|
export interface RTSpanNode extends RTTextNodeBase {
|
|
215
215
|
type: typeof RichTextNodeType.span;
|
|
@@ -218,7 +218,7 @@ export interface RTSpanNode extends RTTextNodeBase {
|
|
|
218
218
|
// Helpers
|
|
219
219
|
|
|
220
220
|
/**
|
|
221
|
-
* Nodes from a
|
|
221
|
+
* Nodes from a rich text field
|
|
222
222
|
*/
|
|
223
223
|
export type RTNode =
|
|
224
224
|
| RTHeading1Node
|
|
@@ -250,7 +250,7 @@ export type RTTextNode =
|
|
|
250
250
|
| RTOListItemNode;
|
|
251
251
|
|
|
252
252
|
/**
|
|
253
|
-
* Rich
|
|
253
|
+
* Rich text block nodes
|
|
254
254
|
*/
|
|
255
255
|
export type RTBlockNode =
|
|
256
256
|
| RTHeading1Node
|
|
@@ -269,19 +269,19 @@ export type RTBlockNode =
|
|
|
269
269
|
| RTEmbedNode;
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
|
-
* Inline
|
|
272
|
+
* Inline rich text nodes
|
|
273
273
|
*/
|
|
274
274
|
export type RTInlineNode = RTStrongNode | RTEmNode | RTLabelNode | RTLinkNode;
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
|
-
* All
|
|
277
|
+
* All rich text nodes
|
|
278
278
|
*/
|
|
279
279
|
export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode;
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
|
-
*
|
|
282
|
+
* A rich text field.
|
|
283
283
|
*
|
|
284
|
-
* @see Rich
|
|
284
|
+
* @see Rich text field documentation: {@link https://prismic.io/docs/rich-text-title}
|
|
285
285
|
*/
|
|
286
286
|
export type RichTextField<State extends FieldState = FieldState> =
|
|
287
287
|
State extends "empty" ? [] : [RTNode, ...RTNode[]];
|
package/src/types/value/slice.ts
CHANGED
package/src/types/value/title.ts
CHANGED
package/src/types/value/types.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { DateField } from "./date";
|
|
|
5
5
|
import type { EmbedField } from "./embed";
|
|
6
6
|
import type { GeoPointField } from "./geoPoint";
|
|
7
7
|
import type { ImageField } from "./image";
|
|
8
|
-
import type {
|
|
8
|
+
import type { IntegrationField } from "./integration";
|
|
9
9
|
import type { KeyTextField } from "./keyText";
|
|
10
10
|
import type { LinkField } from "./link";
|
|
11
11
|
import type { LinkToMediaField } from "./linkToMedia";
|
|
@@ -44,7 +44,7 @@ export type AnyRegularField =
|
|
|
44
44
|
| SelectField
|
|
45
45
|
| BooleanField
|
|
46
46
|
| GeoPointField
|
|
47
|
-
|
|
|
47
|
+
| IntegrationField;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Useful to flatten the type output to improve type hints shown in editors. And
|
|
@@ -25,7 +25,7 @@ interface WebhookBodyAPIUpdateOperations<T> {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Metadata representing a mask (also called a
|
|
28
|
+
* Metadata representing a mask (also called a custom type).
|
|
29
29
|
*
|
|
30
30
|
* @see More details: {@link https://prismic.io/docs/custom-types}
|
|
31
31
|
*/
|