@prismicio/types-internal 4.4.0 → 4.5.0-pr.21.ef982a9
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 -14
- package/dist/content/codec/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 +1250 -448
- 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/model/widget.d.ts +6 -6
- 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 +46 -17
- package/src/helpers/repository.ts +1 -3
- package/src/helpers/traverseContent.ts +10 -0
- package/src/helpers/traverseContentWithModel.ts +4 -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,aAAA;QAAyB,WAAA,CAAA,aAAA;;;;;;;;;;;;;cACpC,mBAAA,E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AA,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,16 +1,57 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FilledLinkLegacyValue } from "../legacy/link"
|
|
2
|
+
import type { RichTextLegacy, RichTextLegacyBlock, Span } from "../legacy/richText"
|
|
2
3
|
import {
|
|
3
4
|
RichTextLegacyBlockSchema,
|
|
4
5
|
RichTextLegacySchema,
|
|
5
6
|
RichTextNodeType,
|
|
6
7
|
} from "../legacy/richText"
|
|
7
|
-
import type { RichTextContentBlock,
|
|
8
|
+
import type { RichTextContent, RichTextContentBlock, RichTextContentSpan } from "../richText"
|
|
8
9
|
import { RichTextContentSchema, RichTextContentType } from "../richText"
|
|
9
|
-
import {
|
|
10
|
+
import { embedContentToLegacy, embedLegacyToContent } from "./embed"
|
|
10
11
|
import { imageLegacyToContent } from "./image"
|
|
11
12
|
import type { LegacyCodec, LegacyContentCtx } from "./legacyContentCtx"
|
|
12
13
|
import { linkLegacyToValue, linkValueToLegacy } from "./link"
|
|
13
14
|
|
|
15
|
+
type RichTextLegacySpan = Span<FilledLinkLegacyValue>
|
|
16
|
+
|
|
17
|
+
function convertSpansLegacyToContent(
|
|
18
|
+
spans: RichTextLegacySpan[] | undefined,
|
|
19
|
+
): RichTextContentSpan[] | undefined {
|
|
20
|
+
if (!spans) return undefined
|
|
21
|
+
|
|
22
|
+
const result: RichTextContentSpan[] = []
|
|
23
|
+
for (const span of spans) {
|
|
24
|
+
if (span.type === RichTextNodeType.hyperlink) {
|
|
25
|
+
if (span.data) {
|
|
26
|
+
result.push({ ...span, data: linkLegacyToValue(span.data) })
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
result.push(span)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return result
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function convertSpansContentToLegacy(
|
|
37
|
+
spans: RichTextContentSpan[] | undefined,
|
|
38
|
+
): RichTextLegacySpan[] | undefined {
|
|
39
|
+
if (!spans) return undefined
|
|
40
|
+
|
|
41
|
+
const result: RichTextLegacySpan[] = []
|
|
42
|
+
for (const span of spans) {
|
|
43
|
+
if (span.type === RichTextNodeType.hyperlink) {
|
|
44
|
+
if (span.data) {
|
|
45
|
+
result.push({ ...span, data: linkValueToLegacy(span.data) })
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
result.push(span)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return result
|
|
53
|
+
}
|
|
54
|
+
|
|
14
55
|
// Also used by content/codec/table
|
|
15
56
|
export function blockLegacyToValue(block: RichTextLegacyBlock): RichTextContentBlock {
|
|
16
57
|
if (block.type === RichTextNodeType.embed) {
|
|
@@ -34,13 +75,7 @@ export function blockLegacyToValue(block: RichTextLegacyBlock): RichTextContentB
|
|
|
34
75
|
...block,
|
|
35
76
|
content: {
|
|
36
77
|
...block.content,
|
|
37
|
-
spans: block.content.spans
|
|
38
|
-
if (span.type === RichTextNodeType.hyperlink) {
|
|
39
|
-
return { ...span, data: linkLegacyToValue(span.data) }
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return span
|
|
43
|
-
}),
|
|
78
|
+
spans: convertSpansLegacyToContent(block.content.spans),
|
|
44
79
|
},
|
|
45
80
|
}
|
|
46
81
|
}
|
|
@@ -69,13 +104,7 @@ export function blockValueToLegacy(block: RichTextContentBlock): RichTextLegacyB
|
|
|
69
104
|
...block,
|
|
70
105
|
content: {
|
|
71
106
|
...block.content,
|
|
72
|
-
spans: block.content.spans
|
|
73
|
-
if (span.type === RichTextNodeType.hyperlink) {
|
|
74
|
-
return { ...span, data: linkValueToLegacy(span.data) }
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return span
|
|
78
|
-
}),
|
|
107
|
+
spans: convertSpansContentToLegacy(block.content.spans),
|
|
79
108
|
},
|
|
80
109
|
}
|
|
81
110
|
}
|
|
@@ -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,20 @@ export function traverseGroupItemsContent(
|
|
|
403
403
|
|
|
404
404
|
const traversed: GroupItemContent[] = []
|
|
405
405
|
for (const groupItemContent of content) {
|
|
406
|
+
if (!Array.isArray(groupItemContent.value)) {
|
|
407
|
+
continue
|
|
408
|
+
}
|
|
409
|
+
|
|
406
410
|
const groupItemPath = path.concat({ key: groupItemContent.key, type: "GroupItem" })
|
|
407
411
|
|
|
408
412
|
const traversedValue: GroupItemContent["value"] = []
|
|
409
413
|
for (const [key, content] of groupItemContent.value) {
|
|
414
|
+
// In some edge cases v3 handled implicitly, content
|
|
415
|
+
// could be undefined, so we need to skip such cases.
|
|
416
|
+
if (!content) {
|
|
417
|
+
continue
|
|
418
|
+
}
|
|
419
|
+
|
|
410
420
|
const model = config.model?.[key]
|
|
411
421
|
const traversedContent = traverseWidgetContent(
|
|
412
422
|
groupItemPath.concat({ key, type: "Widget" }),
|
|
@@ -399,6 +399,10 @@ export function traverseGroupItemsContentWithModel(
|
|
|
399
399
|
|
|
400
400
|
const traversed: GroupItemContent[] = []
|
|
401
401
|
for (const groupItemContent of content) {
|
|
402
|
+
if (!Array.isArray(groupItemContent.value)) {
|
|
403
|
+
continue
|
|
404
|
+
}
|
|
405
|
+
|
|
402
406
|
const groupItemPath = path.concat({ key: groupItemContent.key, type: "GroupItem" })
|
|
403
407
|
const groupItemContentValue = Object.fromEntries(groupItemContent.value)
|
|
404
408
|
|
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({
|