@prismicio/client 7.14.0-alpha.1 → 7.14.0-alpha.2
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/Migration.cjs +9 -6
- package/dist/Migration.cjs.map +1 -1
- package/dist/Migration.js +9 -6
- package/dist/Migration.js.map +1 -1
- package/dist/lib/getOptionalLinkProperties.cjs +14 -0
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
- package/dist/lib/getOptionalLinkProperties.d.ts +12 -0
- package/dist/lib/getOptionalLinkProperties.js +14 -0
- package/dist/lib/getOptionalLinkProperties.js.map +1 -0
- package/dist/lib/isMigrationValue.cjs.map +1 -1
- package/dist/lib/isMigrationValue.d.ts +11 -2
- package/dist/lib/isMigrationValue.js.map +1 -1
- package/dist/lib/isValue.cjs.map +1 -1
- package/dist/lib/isValue.d.ts +7 -1
- package/dist/lib/isValue.js.map +1 -1
- package/dist/lib/resolveMigrationDocumentData.cjs +22 -11
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -1
- package/dist/lib/resolveMigrationDocumentData.d.ts +4 -2
- package/dist/lib/resolveMigrationDocumentData.js +22 -11
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/types/migration/Asset.cjs.map +1 -1
- package/dist/types/migration/Asset.d.ts +2 -3
- package/dist/types/migration/Asset.js.map +1 -1
- package/dist/types/migration/ContentRelationship.d.ts +3 -4
- package/dist/types/migration/Link.d.ts +19 -0
- package/dist/types/model/contentRelationship.d.ts +0 -1
- package/dist/types/model/linkToMedia.d.ts +1 -0
- package/dist/types/value/contentRelationship.d.ts +5 -5
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.ts +39 -22
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/linkToMedia.d.ts +9 -7
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.d.ts +3 -5
- package/dist/types/value/richText.js.map +1 -1
- package/package.json +2 -2
- package/src/Migration.ts +8 -3
- package/src/lib/getOptionalLinkProperties.ts +27 -0
- package/src/lib/isMigrationValue.ts +11 -2
- package/src/lib/isValue.ts +7 -1
- package/src/lib/resolveMigrationDocumentData.ts +32 -13
- package/src/types/migration/Asset.ts +9 -11
- package/src/types/migration/ContentRelationship.ts +11 -9
- package/src/types/migration/Link.ts +19 -0
- package/src/types/model/contentRelationship.ts +0 -1
- package/src/types/model/linkToMedia.ts +1 -0
- package/src/types/value/contentRelationship.ts +6 -5
- package/src/types/value/link.ts +63 -33
- package/src/types/value/linkToMedia.ts +9 -9
- package/src/types/value/richText.ts +3 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FieldState } from "./types"
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { OptionalLinkProperties } from "./link"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A link field that points to media.
|
|
@@ -8,22 +8,22 @@ import type { EmptyLinkField, LinkType } from "./link"
|
|
|
8
8
|
* @typeParam State - State of the field which determines its shape.
|
|
9
9
|
*/
|
|
10
10
|
export type LinkToMediaField<State extends FieldState = FieldState> =
|
|
11
|
-
State extends "empty"
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
State extends "empty" ? EmptyLinkToMediaField : FilledLinkToMediaField
|
|
12
|
+
|
|
13
|
+
type EmptyLinkToMediaField = {
|
|
14
|
+
link_type: "Any"
|
|
15
|
+
} & OptionalLinkProperties
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* A link that points to media.
|
|
17
19
|
*/
|
|
18
|
-
export
|
|
20
|
+
export type FilledLinkToMediaField = {
|
|
19
21
|
id: string
|
|
20
|
-
link_type:
|
|
22
|
+
link_type: "Media"
|
|
21
23
|
name: string
|
|
22
24
|
kind: string
|
|
23
25
|
url: string
|
|
24
26
|
size: string
|
|
25
27
|
height?: string | null
|
|
26
28
|
width?: string | null
|
|
27
|
-
|
|
28
|
-
variant?: string
|
|
29
|
-
}
|
|
29
|
+
} & OptionalLinkProperties
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { FieldState } from "./types"
|
|
2
2
|
|
|
3
|
-
import type { FilledContentRelationshipField } from "./contentRelationship"
|
|
4
3
|
import type { EmbedField } from "./embed"
|
|
5
|
-
import type {
|
|
6
|
-
import type { FilledLinkToMediaField } from "./linkToMedia"
|
|
4
|
+
import type { FilledLinkField } from "./link"
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* Types enum for RichTextNodes
|
|
@@ -176,10 +174,7 @@ export type RTImageNode = {
|
|
|
176
174
|
zoom: number
|
|
177
175
|
background: string
|
|
178
176
|
}
|
|
179
|
-
linkTo?:
|
|
180
|
-
| FilledContentRelationshipField
|
|
181
|
-
| FilledLinkToWebField
|
|
182
|
-
| FilledLinkToMediaField
|
|
177
|
+
linkTo?: FilledLinkField
|
|
183
178
|
}
|
|
184
179
|
|
|
185
180
|
/**
|
|
@@ -199,10 +194,7 @@ export type RTEmbedNode = {
|
|
|
199
194
|
*/
|
|
200
195
|
export interface RTLinkNode extends RTSpanNodeBase {
|
|
201
196
|
type: typeof RichTextNodeType.hyperlink
|
|
202
|
-
data:
|
|
203
|
-
| FilledContentRelationshipField
|
|
204
|
-
| FilledLinkToWebField
|
|
205
|
-
| FilledLinkToMediaField
|
|
197
|
+
data: FilledLinkField
|
|
206
198
|
}
|
|
207
199
|
|
|
208
200
|
// Serialization related nodes
|