@prismicio/types-internal 4.4.0 → 4.5.0-pr.21.8cf651a
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/content/codec/richText.js +24 -20
- package/dist/content/codec/richText.js.map +1 -1
- package/dist/content/legacy/richText.d.ts.map +1 -1
- package/dist/content/legacy/richText.js.map +1 -1
- package/dist/helpers/repository.js.map +1 -1
- package/dist/helpers/traverseContent.d.ts.map +1 -1
- package/dist/helpers/traverseContent.js +2 -0
- package/dist/helpers/traverseContent.js.map +1 -1
- package/dist/helpers/traverseContentWithModel.d.ts.map +1 -1
- package/dist/helpers/traverseContentWithModel.js +1 -0
- package/dist/helpers/traverseContentWithModel.js.map +1 -1
- package/dist/io-ts.d.ts +802 -0
- package/dist/io-ts.d.ts.map +1 -1
- package/dist/model/customType.d.ts +28 -4
- package/dist/model/customType.d.ts.map +1 -1
- package/dist/model/customType.js +37 -29
- package/dist/model/customType.js.map +1 -1
- package/dist/model/image.js +1 -1
- package/dist/model/image.js.map +1 -1
- package/dist/model/slice.d.ts +577 -2
- package/dist/model/slice.d.ts.map +1 -1
- package/dist/model/slice.js +8 -2
- package/dist/model/slice.js.map +1 -1
- package/dist/zod4.d.ts +619 -8
- package/dist/zod4.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/content/codec/richText.ts +29 -27
- package/src/content/legacy/richText.ts +2 -0
- package/src/helpers/repository.ts +1 -3
- package/src/helpers/traverseContent.ts +12 -0
- package/src/helpers/traverseContentWithModel.ts +6 -0
- package/src/model/customType.ts +19 -8
- package/src/model/image.ts +1 -1
- package/src/model/slice.ts +20 -7
package/dist/zod4.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod4.d.ts","names":[],"sources":["../src/zod4.ts"],"mappings":";;;;;;;;;;;;cA6Ga,WAAA,cAAW,aAAA;MAAyB,WAAA,CAAA,aAAA;;;;;;;;;;;;;;cACpC,WAAA,cAAW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,CAAA,cAAA;;;;;;;;;;;cAC5D,uBAAA,EAAuB,WAAA,CAAA,WAAA,CAAqC,iBAAA,WAArC,cAAA,CAAA,iBAAA,CAAA,iBAAA;AAAA,cACvB,wBAAA,EAAwB,WAAA,CAAA,WAAA,CAAsC,kBAAA,WAAtC,cAAA,CAAA,iBAAA,CAAA,kBAAA;AAAA,cACxB,8BAAA,EAA8B,WAAA,CAAA,aAAA,CAA4C,WAAA,CAA5C,aAAA,UAAA,WAAA,CAAA,WAAA,CAAA,iBAAA,WAAA,cAAA,CAAA,iBAAA,CAAA,iBAAA;AAAA,cAC9B,+BAAA,EAA+B,WAAA,CAAA,aAAA,CAA6C,WAAA,CAA7C,aAAA,UAAA,WAAA,CAAA,WAAA,CAAA,kBAAA,WAAA,cAAA,CAAA,iBAAA,CAAA,kBAAA;AAAA,cAC/B,2BAAA,cAA2B,yBAAA,cAAA,aAAA;MAAyC,WAAA,CAAA,aAAA;;;;;;;;;;;UAAzC,WAAA,CAAA,cAAA;;;;;;;;;;;cAC3B,4BAAA,cAA4B,yBAAA,cAAA,aAAA;MAA0C,WAAA,CAAA,aAAA;;;;;;;;;;;UAA1C,WAAA,CAAA,cAAA;;;;;;;;;;;;cAE5B,qBAAA,cAAqB,yBAAA,cAAA,aAAA;MAA+B,WAAA,CAAA,aAAA;;;;;;;;;;;UAA/B,WAAA,CAAA,cAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { RichTextLegacyBlock,
|
|
1
|
+
import type { RichTextLegacy, RichTextLegacyBlock, RichTextLegacySpan } from "../legacy/richText"
|
|
2
2
|
import {
|
|
3
3
|
RichTextLegacyBlockSchema,
|
|
4
4
|
RichTextLegacySchema,
|
|
5
5
|
RichTextNodeType,
|
|
6
6
|
} from "../legacy/richText"
|
|
7
|
-
import type { RichTextContentBlock,
|
|
7
|
+
import type { RichTextContent, RichTextContentBlock, RichTextContentSpan } from "../richText"
|
|
8
8
|
import { RichTextContentSchema, RichTextContentType } from "../richText"
|
|
9
|
-
import {
|
|
9
|
+
import { embedContentToLegacy, embedLegacyToContent } from "./embed"
|
|
10
10
|
import { imageLegacyToContent } from "./image"
|
|
11
11
|
import type { LegacyCodec, LegacyContentCtx } from "./legacyContentCtx"
|
|
12
12
|
import { linkLegacyToValue, linkValueToLegacy } from "./link"
|
|
@@ -30,19 +30,20 @@ export function blockLegacyToValue(block: RichTextLegacyBlock): RichTextContentB
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
33
|
+
const spans: RichTextContentSpan[] = []
|
|
34
|
+
for (const span of block.content.spans ?? []) {
|
|
35
|
+
if (span.type === RichTextNodeType.hyperlink) {
|
|
36
|
+
// Legacy documents can have hyperlink spans with null data. We
|
|
37
|
+
// drop them since a hyperlink without link data is meaningless.
|
|
38
|
+
if (span.data) {
|
|
39
|
+
spans.push({ ...span, data: linkLegacyToValue(span.data) })
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
spans.push(span)
|
|
43
|
+
}
|
|
45
44
|
}
|
|
45
|
+
|
|
46
|
+
return { ...block, content: { ...block.content, spans } }
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
// Also used by content/codec/table
|
|
@@ -65,19 +66,20 @@ export function blockValueToLegacy(block: RichTextContentBlock): RichTextLegacyB
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
if ("content" in block) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
69
|
+
const spans: RichTextLegacySpan[] = []
|
|
70
|
+
for (const span of block.content.spans ?? []) {
|
|
71
|
+
if (span.type === RichTextNodeType.hyperlink) {
|
|
72
|
+
// Legacy documents can have hyperlink spans with null data. We
|
|
73
|
+
// drop them since a hyperlink without link data is meaningless.
|
|
74
|
+
if (span.data) {
|
|
75
|
+
spans.push({ ...span, data: linkValueToLegacy(span.data) })
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
spans.push(span)
|
|
79
|
+
}
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
return { ...block, content: { ...block.content, spans } }
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
return RichTextLegacyBlockSchema.parse(block)
|
|
@@ -77,6 +77,8 @@ export type Span<TLink extends FilledLinkLegacyValue | FilledLinkContentValue> =
|
|
|
77
77
|
| LabelSpan
|
|
78
78
|
| BasicSpan
|
|
79
79
|
|
|
80
|
+
export type RichTextLegacySpan = Span<FilledLinkLegacyValue>
|
|
81
|
+
|
|
80
82
|
// oxlint-disable-next-line explicit-module-boundary-types
|
|
81
83
|
export const getSpanSchema = <
|
|
82
84
|
TLinkSchema extends typeof FilledLinkLegacyValueSchema | typeof FilledLinkContentValueSchema,
|
|
@@ -11,9 +11,7 @@ export function serializeID(input: string): string {
|
|
|
11
11
|
.replace(/^-+|-+$/g, "")
|
|
12
12
|
|
|
13
13
|
const truncated =
|
|
14
|
-
normalized.length > MAX_LENGTH
|
|
15
|
-
? normalized.slice(0, MAX_LENGTH).replace(/-+$/, "")
|
|
16
|
-
: normalized
|
|
14
|
+
normalized.length > MAX_LENGTH ? normalized.slice(0, MAX_LENGTH).replace(/-+$/, "") : normalized
|
|
17
15
|
|
|
18
16
|
if (truncated.length < MIN_LENGTH) {
|
|
19
17
|
throw new Error(
|
|
@@ -403,10 +403,22 @@ export function traverseGroupItemsContent(
|
|
|
403
403
|
|
|
404
404
|
const traversed: GroupItemContent[] = []
|
|
405
405
|
for (const groupItemContent of content) {
|
|
406
|
+
// Legacy v3 documents can have .value as a plain object or string
|
|
407
|
+
// instead of the expected [key, content][] tuples.
|
|
408
|
+
if (!Array.isArray(groupItemContent.value)) {
|
|
409
|
+
continue
|
|
410
|
+
}
|
|
411
|
+
|
|
406
412
|
const groupItemPath = path.concat({ key: groupItemContent.key, type: "GroupItem" })
|
|
407
413
|
|
|
408
414
|
const traversedValue: GroupItemContent["value"] = []
|
|
409
415
|
for (const [key, content] of groupItemContent.value) {
|
|
416
|
+
// In some edge cases v3 handled implicitly, content
|
|
417
|
+
// could be undefined, so we need to skip such cases.
|
|
418
|
+
if (!content) {
|
|
419
|
+
continue
|
|
420
|
+
}
|
|
421
|
+
|
|
410
422
|
const model = config.model?.[key]
|
|
411
423
|
const traversedContent = traverseWidgetContent(
|
|
412
424
|
groupItemPath.concat({ key, type: "Widget" }),
|
|
@@ -399,6 +399,12 @@ export function traverseGroupItemsContentWithModel(
|
|
|
399
399
|
|
|
400
400
|
const traversed: GroupItemContent[] = []
|
|
401
401
|
for (const groupItemContent of content) {
|
|
402
|
+
// Legacy v3 documents can have .value as a plain object or string
|
|
403
|
+
// instead of the expected [key, content][] tuples.
|
|
404
|
+
if (!Array.isArray(groupItemContent.value)) {
|
|
405
|
+
continue
|
|
406
|
+
}
|
|
407
|
+
|
|
402
408
|
const groupItemPath = path.concat({ key: groupItemContent.key, type: "GroupItem" })
|
|
403
409
|
const groupItemContentValue = Object.fromEntries(groupItemContent.value)
|
|
404
410
|
|
package/src/model/customType.ts
CHANGED
|
@@ -19,15 +19,23 @@ const createCustomTypeSchema = <
|
|
|
19
19
|
T extends typeof StaticCustomTypeModelTabSchema | typeof DynamicCustomTypeModelTabSchema,
|
|
20
20
|
>(
|
|
21
21
|
sectionSchema: T,
|
|
22
|
-
) =>
|
|
23
|
-
|
|
22
|
+
) => {
|
|
23
|
+
// 4.4.0 and earlier
|
|
24
|
+
const Schema_4_4_0 = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
label: z.nullish(z.string()),
|
|
27
|
+
repeatable: z._default(z.boolean(), true),
|
|
28
|
+
json: z.record(z.string(), sectionSchema),
|
|
29
|
+
status: z._default(z.boolean(), true),
|
|
30
|
+
format: z._default(CustomTypeFormatSchema, "custom"),
|
|
31
|
+
schema: z.optional(z.undefined()),
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// 4.5.0 and later
|
|
35
|
+
const Schema_4_5_0 = z
|
|
24
36
|
.object({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
repeatable: z._default(z.boolean(), true),
|
|
28
|
-
json: z.record(z.string(), sectionSchema),
|
|
29
|
-
status: z._default(z.boolean(), true),
|
|
30
|
-
format: z._default(CustomTypeFormatSchema, "custom"),
|
|
37
|
+
...Schema_4_4_0.shape,
|
|
38
|
+
schema: z.literal("@prismicio/types-internal@4.5.0"),
|
|
31
39
|
})
|
|
32
40
|
.check(
|
|
33
41
|
z.superRefine((model, ctx) => {
|
|
@@ -64,6 +72,9 @@ const createCustomTypeSchema = <
|
|
|
64
72
|
}),
|
|
65
73
|
)
|
|
66
74
|
|
|
75
|
+
return z.discriminatedUnion("schema", [Schema_4_4_0, Schema_4_5_0])
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
export const StaticCustomTypeModelSchema = createCustomTypeSchema(StaticCustomTypeModelTabSchema)
|
|
68
79
|
export type StaticCustomTypeModel = z.infer<typeof StaticCustomTypeModelSchema>
|
|
69
80
|
|
package/src/model/image.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const SideConstraintSchema: z.ZodMiniType<number | null> = z.union([
|
|
|
18
18
|
z.transform(() => null),
|
|
19
19
|
),
|
|
20
20
|
z.null(),
|
|
21
|
-
z.
|
|
21
|
+
z.pipe(z.number(), z.transform((n) => Math.round(n))),
|
|
22
22
|
z.pipe(
|
|
23
23
|
z.string(),
|
|
24
24
|
z.transform((s: string) => parseInt(s.replace("px", ""), 10)),
|
package/src/model/slice.ts
CHANGED
|
@@ -61,14 +61,22 @@ export const SharedSliceModelVariationSchema = z.object({
|
|
|
61
61
|
|
|
62
62
|
export type SharedSliceModelVariation = z.infer<typeof SharedSliceModelVariationSchema>
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
// 4.4.0 and earlier
|
|
65
|
+
const SharedSliceModelSchema_4_4_0 = z.object({
|
|
66
|
+
id: z.string(),
|
|
67
|
+
type: z.literal(SharedSliceType),
|
|
68
|
+
name: z.string(),
|
|
69
|
+
variations: z.array(SharedSliceModelVariationSchema),
|
|
70
|
+
description: z.optional(z.string()),
|
|
71
|
+
legacyPaths: z.optional(z.record(z.string(), z.string())),
|
|
72
|
+
schema: z.optional(z.undefined()),
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
// 4.5.0 and later
|
|
76
|
+
const SharedSliceModelSchema_4_5_0 = z
|
|
65
77
|
.object({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
name: z.string(),
|
|
69
|
-
variations: z.array(SharedSliceModelVariationSchema),
|
|
70
|
-
description: z.optional(z.string()),
|
|
71
|
-
legacyPaths: z.optional(z.record(z.string(), z.string())),
|
|
78
|
+
...SharedSliceModelSchema_4_4_0.shape,
|
|
79
|
+
schema: z.literal("@prismicio/types-internal@4.5.0"),
|
|
72
80
|
})
|
|
73
81
|
.check(
|
|
74
82
|
z.superRefine((model, ctx) => {
|
|
@@ -101,6 +109,11 @@ export const SharedSliceModelSchema = z
|
|
|
101
109
|
}),
|
|
102
110
|
)
|
|
103
111
|
|
|
112
|
+
export const SharedSliceModelSchema = z.discriminatedUnion("schema", [
|
|
113
|
+
SharedSliceModelSchema_4_4_0,
|
|
114
|
+
SharedSliceModelSchema_4_5_0,
|
|
115
|
+
])
|
|
116
|
+
|
|
104
117
|
export type SharedSliceModel = z.infer<typeof SharedSliceModelSchema>
|
|
105
118
|
|
|
106
119
|
export const SharedSliceRefModelSchema = z.object({
|