@prismicio/types-internal 4.0.0 → 4.1.0-canary.51f7473
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/README.md +5 -5
- package/dist/content/boolean.d.ts.map +1 -1
- package/dist/content/boolean.js.map +1 -1
- package/dist/content/codec/link.js.map +1 -1
- package/dist/content/codec/nestable.js +4 -4
- package/dist/content/field.d.ts.map +1 -1
- package/dist/content/field.js +2 -2
- package/dist/content/field.js.map +1 -1
- package/dist/content/group.d.ts +1 -2
- package/dist/content/group.d.ts.map +1 -1
- package/dist/content/group.js +1 -1
- package/dist/content/group.js.map +1 -1
- package/dist/content/image.d.ts +3 -1
- package/dist/content/image.d.ts.map +1 -1
- package/dist/content/image.js +3 -3
- package/dist/content/image.js.map +1 -1
- package/dist/content/legacy/boolean.d.ts +1 -0
- package/dist/content/legacy/embed.d.ts +1 -0
- package/dist/content/legacy/empty.d.ts +1 -0
- package/dist/content/legacy/field.d.ts +1 -0
- package/dist/content/legacy/geopoint.d.ts +1 -0
- package/dist/content/legacy/image.d.ts +28 -0
- package/dist/content/legacy/image.d.ts.map +1 -0
- package/dist/content/legacy/image.js +3 -3
- package/dist/content/legacy/image.js.map +1 -1
- package/dist/content/legacy/integrationField.d.ts +1 -0
- package/dist/content/legacy/link.d.ts +14 -14
- package/dist/content/legacy/link.js +23 -23
- package/dist/content/legacy/link.js.map +1 -1
- package/dist/content/legacy/nestable.d.ts +1 -0
- package/dist/content/legacy/nestable.js +1 -1
- package/dist/content/legacy/repeatable.d.ts +1 -0
- package/dist/content/legacy/richText.d.ts +32 -20
- package/dist/content/legacy/richText.d.ts.map +1 -1
- package/dist/content/legacy/richText.js +7 -7
- package/dist/content/legacy/richText.js.map +1 -1
- package/dist/content/legacy/separator.d.ts +1 -0
- package/dist/content/legacy/table.d.ts +1 -0
- package/dist/content/link.d.ts +66 -89
- package/dist/content/link.d.ts.map +1 -1
- package/dist/content/link.js +30 -27
- package/dist/content/link.js.map +1 -1
- package/dist/content/nestable.d.ts +3 -3
- package/dist/content/nestable.d.ts.map +1 -1
- package/dist/content/nestable.js +7 -13
- package/dist/content/nestable.js.map +1 -1
- package/dist/content/repeatable.d.ts +4 -69
- package/dist/content/repeatable.d.ts.map +1 -1
- package/dist/content/richText.d.ts +14 -14
- package/dist/content/richText.d.ts.map +1 -1
- package/dist/content/richText.js +10 -10
- package/dist/content/richText.js.map +1 -1
- package/dist/content/slice.d.ts +507 -5
- package/dist/content/slice.d.ts.map +1 -1
- package/dist/content/slice.js +1 -1
- package/dist/content/slice.js.map +1 -1
- package/dist/content/slices.d.ts +507 -5
- package/dist/content/slices.d.ts.map +1 -1
- package/dist/content/table.d.ts +5 -2
- package/dist/content/table.d.ts.map +1 -1
- package/dist/content/widget.js +1 -1
- package/dist/content/widget.js.map +1 -1
- package/dist/helpers/customTypeModel.d.ts +5 -5
- package/dist/helpers/customTypeModel.d.ts.map +1 -1
- package/dist/helpers/customTypeModel.js +30 -0
- package/dist/helpers/customTypeModel.js.map +1 -1
- package/dist/helpers/imageContent.d.ts +33 -0
- package/dist/helpers/imageContent.d.ts.map +1 -0
- package/dist/helpers/imageContent.js +55 -0
- package/dist/helpers/imageContent.js.map +1 -0
- package/dist/helpers/traverseContent.d.ts +4 -4
- package/dist/helpers/traverseContent.d.ts.map +1 -1
- package/dist/helpers/traverseContent.js +5 -3
- package/dist/helpers/traverseContent.js.map +1 -1
- package/dist/helpers/traverseContentWithModel.d.ts +4 -4
- package/dist/helpers/traverseContentWithModel.js +1 -1
- package/dist/helpers/withDefaultContent.d.ts +21 -0
- package/dist/helpers/withDefaultContent.d.ts.map +1 -0
- package/dist/helpers/withDefaultContent.js +120 -0
- package/dist/helpers/withDefaultContent.js.map +1 -0
- package/dist/index.d.ts +26 -24
- package/dist/index.js +6 -1
- package/dist/io-ts.d.ts +6777 -3127
- package/dist/io-ts.d.ts.map +1 -1
- package/dist/io-ts.js +17 -12
- package/dist/io-ts.js.map +1 -1
- package/dist/model/customType.d.ts +9 -3
- package/dist/model/customType.d.ts.map +1 -1
- package/dist/model/customType.js +7 -4
- package/dist/model/customType.js.map +1 -1
- package/dist/model/group.d.ts +2 -2
- package/dist/model/group.js +1 -1
- package/dist/model/group.js.map +1 -1
- package/dist/model/nestable.js +1 -1
- package/dist/model/nestable.js.map +1 -1
- package/dist/model/richText.d.ts +20 -1
- package/dist/model/richText.d.ts.map +1 -1
- package/dist/model/richText.js +3 -3
- package/dist/model/richText.js.map +1 -1
- package/dist/model/slice.d.ts +1259 -651
- package/dist/model/slice.d.ts.map +1 -1
- package/dist/model/slice.js +9 -9
- package/dist/model/slice.js.map +1 -1
- package/dist/model/table.js +5 -5
- package/dist/model/table.js.map +1 -1
- package/dist/model/widget.d.ts +1 -3
- package/dist/model/widget.d.ts.map +1 -1
- package/dist/model/widget.js +7 -4
- package/dist/model/widget.js.map +1 -1
- package/dist/zod4.d.ts +3946 -1862
- package/dist/zod4.d.ts.map +1 -1
- package/dist/zod4.js +17 -12
- package/dist/zod4.js.map +1 -1
- package/package.json +22 -12
- package/src/content/boolean.ts +0 -13
- package/src/content/codec/link.ts +12 -12
- package/src/content/field.ts +1 -15
- package/src/content/group.ts +2 -55
- package/src/content/image.ts +3 -91
- package/src/content/legacy/image.ts +4 -4
- package/src/content/legacy/link.ts +46 -46
- package/src/content/legacy/richText.ts +32 -37
- package/src/content/link.ts +100 -89
- package/src/content/nestable.ts +4 -38
- package/src/content/richText.ts +31 -22
- package/src/content/slice.ts +1 -1
- package/src/content/widget.ts +1 -1
- package/src/helpers/customTypeModel.ts +51 -4
- package/src/helpers/imageContent.ts +84 -0
- package/src/helpers/traverseContent.ts +4 -1
- package/src/helpers/withDefaultContent.ts +180 -0
- package/src/index.ts +25 -7
- package/src/io-ts.ts +22 -10
- package/src/model/customType.ts +18 -7
- package/src/model/diff/sharedSlice.ts +2 -2
- package/src/model/diff/variation.ts +7 -7
- package/src/model/group.ts +1 -1
- package/src/model/nestable.ts +1 -1
- package/src/model/richText.ts +5 -2
- package/src/model/slice.ts +20 -23
- package/src/model/table.ts +5 -5
- package/src/model/widget.ts +14 -14
- package/src/zod4.ts +22 -10
- package/dist/model/section.d.ts +0 -11
- package/dist/model/section.d.ts.map +0 -1
- package/dist/model/section.js +0 -10
- package/dist/model/section.js.map +0 -1
- package/src/content/withDefaultValues.ts +0 -114
- package/src/model/section.ts +0 -12
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FilledLinkContentValue } from "../link.js";
|
|
2
|
+
import { FilledLinkLegacyValue } from "./link.js";
|
|
3
3
|
import { z } from "zod/mini";
|
|
4
4
|
|
|
5
5
|
//#region src/content/legacy/richText.d.ts
|
|
6
6
|
declare const RichTextNodeType: {
|
|
7
|
-
readonly paragraph: "paragraph";
|
|
8
7
|
readonly heading1: "heading1";
|
|
9
8
|
readonly heading2: "heading2";
|
|
10
9
|
readonly heading3: "heading3";
|
|
11
10
|
readonly heading4: "heading4";
|
|
12
11
|
readonly heading5: "heading5";
|
|
13
12
|
readonly heading6: "heading6";
|
|
13
|
+
readonly paragraph: "paragraph";
|
|
14
14
|
readonly preformatted: "preformatted";
|
|
15
15
|
readonly oListItem: "o-list-item";
|
|
16
16
|
readonly listItem: "list-item";
|
|
@@ -20,33 +20,45 @@ declare const RichTextNodeType: {
|
|
|
20
20
|
readonly strong: "strong";
|
|
21
21
|
readonly em: "em";
|
|
22
22
|
};
|
|
23
|
-
type
|
|
23
|
+
type RichTextNodeTypes = (typeof RichTextNodeType)[keyof typeof RichTextNodeType];
|
|
24
|
+
type HyperlinkSpan<TData extends FilledLinkLegacyValue | FilledLinkContentValue> = {
|
|
24
25
|
type: typeof RichTextNodeType.hyperlink;
|
|
25
26
|
start: number;
|
|
26
27
|
end: number;
|
|
27
28
|
data: TData;
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
type: "label"
|
|
31
|
-
start: number
|
|
32
|
-
end: number
|
|
33
|
-
data: string
|
|
34
|
-
}
|
|
35
|
-
type
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
declare const LabelSpanSchema: z.ZodMiniObject<{
|
|
31
|
+
type: z.ZodMiniLiteral<"label">;
|
|
32
|
+
start: z.ZodMiniNumber<number>;
|
|
33
|
+
end: z.ZodMiniNumber<number>;
|
|
34
|
+
data: z.ZodMiniPipe<z.ZodMiniUnknown, z.ZodMiniTransform<string, unknown>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type LabelSpan = z.infer<typeof LabelSpanSchema>;
|
|
37
|
+
declare const BasicSpanSchema: z.ZodMiniObject<{
|
|
38
|
+
type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"strong">, z.ZodMiniLiteral<"em">, z.ZodMiniLiteral<"list-item">]>;
|
|
39
|
+
start: z.ZodMiniNumber<number>;
|
|
40
|
+
end: z.ZodMiniNumber<number>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type BasicSpan = z.infer<typeof BasicSpanSchema>;
|
|
43
|
+
type Span<TLink extends FilledLinkLegacyValue | FilledLinkContentValue> = HyperlinkSpan<TLink> | LabelSpan | BasicSpan;
|
|
41
44
|
declare const TextBlockLegacySchema: z.ZodMiniObject<{
|
|
42
45
|
type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"paragraph">, z.ZodMiniLiteral<"heading1">, z.ZodMiniLiteral<"heading2">, z.ZodMiniLiteral<"heading3">, z.ZodMiniLiteral<"heading4">, z.ZodMiniLiteral<"heading5">, z.ZodMiniLiteral<"heading6">, z.ZodMiniLiteral<"preformatted">, z.ZodMiniLiteral<"o-list-item">, z.ZodMiniLiteral<"list-item">]>;
|
|
43
46
|
content: z.ZodMiniObject<{
|
|
44
47
|
text: z.ZodMiniString<string>;
|
|
45
|
-
spans: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniTransform<(
|
|
48
|
+
spans: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniArray<z.ZodMiniUnknown>, z.ZodMiniTransform<({
|
|
49
|
+
type: "label";
|
|
50
|
+
start: number;
|
|
51
|
+
end: number;
|
|
52
|
+
data: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: "list-item" | "strong" | "em";
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
} | {
|
|
46
58
|
type: "hyperlink";
|
|
47
59
|
start: number;
|
|
48
60
|
end: number;
|
|
49
|
-
data:
|
|
61
|
+
data: FilledLinkLegacyValue;
|
|
50
62
|
})[], unknown[]>>>;
|
|
51
63
|
}, z.core.$strip>;
|
|
52
64
|
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -76,7 +88,7 @@ declare const ImageBlockLegacySchema: z.ZodMiniObject<{
|
|
|
76
88
|
credits: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>, z.ZodMiniTransform<string | null, string | null | undefined>>>;
|
|
77
89
|
alt: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>, z.ZodMiniTransform<string | null, string | null | undefined>>>;
|
|
78
90
|
provider: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
79
|
-
linkTo: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniType<
|
|
91
|
+
linkTo: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniType<FilledLinkLegacyValue, unknown, z.core.$ZodTypeInternals<FilledLinkLegacyValue, unknown>>>>;
|
|
80
92
|
}, z.core.$strip>;
|
|
81
93
|
label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
82
94
|
direction: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
@@ -105,5 +117,5 @@ declare const EmbedBlockLegacySchema: z.ZodMiniObject<{
|
|
|
105
117
|
type EmbedBlockLegacy = z.infer<typeof EmbedBlockLegacySchema>;
|
|
106
118
|
type RichTextLegacyBlock = TextBlockLegacy | ImageBlockLegacy | EmbedBlockLegacy;
|
|
107
119
|
//#endregion
|
|
108
|
-
export { RichTextLegacyBlock, Span };
|
|
120
|
+
export { RichTextLegacyBlock, RichTextNodeType, RichTextNodeTypes, Span };
|
|
109
121
|
//# sourceMappingURL=richText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richText.d.ts","names":[],"sources":["../../../src/content/legacy/richText.ts"],"mappings":";;;;;cAYa,gBAAA;EAAA;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"richText.d.ts","names":[],"sources":["../../../src/content/legacy/richText.ts"],"mappings":";;;;;cAYa,gBAAA;EAAA;;;;;;;;;;;;;;;;KAkBD,iBAAA,WAA4B,gBAAA,eAA+B,gBAAA;AAAA,KAGlE,aAAA,eAA4B,qBAAA,GAAwB,sBAAA;EACxD,IAAA,SAAa,gBAAA,CAAiB,SAAA;EAC9B,KAAA;EACA,GAAA;EACA,IAAA,EAAM,KAAA;AAAA;AAAA,cAeD,eAAA,EAAe,CAAA,CAAA,aAAA;;;;;;KAShB,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,cAE1B,eAAA,EAAe,CAAA,CAAA,aAAA;;;;;KAShB,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,KAEpB,IAAA,eAAmB,qBAAA,GAAwB,sBAAA,IACpD,aAAA,CAAc,KAAA,IACd,SAAA,GACA,SAAA;AAAA,cA2DG,qBAAA,EAAqB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;KAEtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAmBhC,sBAAA,EAAsB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA;AAAA,cAgBjC,sBAAA,EAAsB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;KAEvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA;AAAA,KAQ3B,mBAAA,GAAsB,eAAA,GAAkB,gBAAA,GAAmB,gBAAA"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { EmbedLegacyLooseSchema } from "./embed.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ImageLegacyViewSchema } from "./image.js";
|
|
3
|
+
import { FilledLinkLegacyValueSchema } from "./link.js";
|
|
4
4
|
import { z } from "zod/mini";
|
|
5
5
|
//#region src/content/legacy/richText.ts
|
|
6
6
|
const RichTextNodeType = {
|
|
7
|
-
paragraph: "paragraph",
|
|
8
7
|
heading1: "heading1",
|
|
9
8
|
heading2: "heading2",
|
|
10
9
|
heading3: "heading3",
|
|
11
10
|
heading4: "heading4",
|
|
12
11
|
heading5: "heading5",
|
|
13
12
|
heading6: "heading6",
|
|
13
|
+
paragraph: "paragraph",
|
|
14
14
|
preformatted: "preformatted",
|
|
15
15
|
oListItem: "o-list-item",
|
|
16
16
|
listItem: "list-item",
|
|
@@ -41,7 +41,7 @@ const BasicSpanSchema = z.object({
|
|
|
41
41
|
start: z.number(),
|
|
42
42
|
end: z.number()
|
|
43
43
|
});
|
|
44
|
-
const getSpanSchema = (linkSchema) => z.
|
|
44
|
+
const getSpanSchema = (linkSchema) => z.discriminatedUnion("type", [
|
|
45
45
|
getHyperlinkSpanSchema(linkSchema),
|
|
46
46
|
LabelSpanSchema,
|
|
47
47
|
BasicSpanSchema
|
|
@@ -73,14 +73,14 @@ const getTextBlockSchema = (linkSchema) => z.object({
|
|
|
73
73
|
label: z.optional(z.string()),
|
|
74
74
|
direction: z.optional(z.string())
|
|
75
75
|
});
|
|
76
|
-
const TextBlockLegacySchema = getTextBlockSchema(
|
|
76
|
+
const TextBlockLegacySchema = getTextBlockSchema(FilledLinkLegacyValueSchema);
|
|
77
77
|
const getImageBlockSchema = (data, linkTo) => z.object({
|
|
78
78
|
type: z.literal(RichTextNodeType.image),
|
|
79
79
|
data: z.extend(data, { linkTo: z.nullish(linkTo) }),
|
|
80
80
|
label: z.nullish(z.string()),
|
|
81
81
|
direction: z.nullish(z.string())
|
|
82
82
|
});
|
|
83
|
-
const ImageBlockLegacySchema = getImageBlockSchema(
|
|
83
|
+
const ImageBlockLegacySchema = getImageBlockSchema(ImageLegacyViewSchema, FilledLinkLegacyValueSchema);
|
|
84
84
|
const getEmbedBlockSchema = (data) => z.object({
|
|
85
85
|
type: z.literal(RichTextNodeType.embed),
|
|
86
86
|
data,
|
|
@@ -88,7 +88,7 @@ const getEmbedBlockSchema = (data) => z.object({
|
|
|
88
88
|
direction: z.nullish(z.string())
|
|
89
89
|
});
|
|
90
90
|
const EmbedBlockLegacySchema = getEmbedBlockSchema(EmbedLegacyLooseSchema);
|
|
91
|
-
const RichTextLegacyBlockSchema = z.
|
|
91
|
+
const RichTextLegacyBlockSchema = z.discriminatedUnion("type", [
|
|
92
92
|
TextBlockLegacySchema,
|
|
93
93
|
ImageBlockLegacySchema,
|
|
94
94
|
EmbedBlockLegacySchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richText.js","names":[],"sources":["../../../src/content/legacy/richText.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n// It's important to only import the types here to\n// avoid runtime circular dependencies!\nimport type { EmbedContentSchema } from \"../embed\"\nimport type {
|
|
1
|
+
{"version":3,"file":"richText.js","names":[],"sources":["../../../src/content/legacy/richText.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n// It's important to only import the types here to\n// avoid runtime circular dependencies!\nimport type { EmbedContentSchema } from \"../embed\"\nimport type { ImageContentViewSchema } from \"../image\"\nimport type { FilledLinkContentValue, FilledLinkContentValueSchema } from \"../link\"\nimport { EmbedLegacyLooseSchema } from \"./embed\"\nimport { ImageLegacyViewSchema } from \"./image\"\nimport { FilledLinkLegacyValueSchema } from \"./link\"\nimport type { FilledLinkLegacyValue } from \"./link\"\n\nexport const RichTextNodeType = {\n\theading1: \"heading1\",\n\theading2: \"heading2\",\n\theading3: \"heading3\",\n\theading4: \"heading4\",\n\theading5: \"heading5\",\n\theading6: \"heading6\",\n\tparagraph: \"paragraph\",\n\tpreformatted: \"preformatted\",\n\toListItem: \"o-list-item\",\n\tlistItem: \"list-item\",\n\timage: \"image\",\n\tembed: \"embed\",\n\thyperlink: \"hyperlink\",\n\tstrong: \"strong\",\n\tem: \"em\",\n} as const\n\nexport type RichTextNodeTypes = (typeof RichTextNodeType)[keyof typeof RichTextNodeType]\n\n// Spans\ntype HyperlinkSpan<TData extends FilledLinkLegacyValue | FilledLinkContentValue> = {\n\ttype: typeof RichTextNodeType.hyperlink\n\tstart: number\n\tend: number\n\tdata: TData\n}\n\nconst getHyperlinkSpanSchema = <\n\tTData extends typeof FilledLinkLegacyValueSchema | typeof FilledLinkContentValueSchema,\n>(\n\tdata: TData,\n) =>\n\tz.object({\n\t\ttype: z.literal(RichTextNodeType.hyperlink),\n\t\tstart: z.number(),\n\t\tend: z.number(),\n\t\tdata,\n\t})\n\nconst LabelSpanSchema = z.object({\n\ttype: z.literal(\"label\"),\n\tstart: z.number(),\n\tend: z.number(),\n\tdata: z.pipe(\n\t\tz.unknown(),\n\t\tz.transform((value) => (typeof value === \"string\" && value.length > 0 ? value : \"\")),\n\t),\n})\ntype LabelSpan = z.infer<typeof LabelSpanSchema>\n\nconst BasicSpanSchema = z.object({\n\ttype: z.union([\n\t\tz.literal(RichTextNodeType.strong),\n\t\tz.literal(RichTextNodeType.em),\n\t\tz.literal(\"list-item\"), // legacy case\n\t]),\n\tstart: z.number(),\n\tend: z.number(),\n})\ntype BasicSpan = z.infer<typeof BasicSpanSchema>\n\nexport type Span<TLink extends FilledLinkLegacyValue | FilledLinkContentValue> =\n\t| HyperlinkSpan<TLink>\n\t| LabelSpan\n\t| BasicSpan\n\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const getSpanSchema = <\n\tTLinkSchema extends typeof FilledLinkLegacyValueSchema | typeof FilledLinkContentValueSchema,\n>(\n\tlinkSchema: TLinkSchema,\n) =>\n\tz.discriminatedUnion(\"type\", [\n\t\tgetHyperlinkSpanSchema(linkSchema),\n\t\tLabelSpanSchema,\n\t\tBasicSpanSchema,\n\t])\n\n// Text blocks\nconst TextBlockTypeSchema = z.union([\n\tz.literal(RichTextNodeType.paragraph),\n\tz.literal(RichTextNodeType.heading1),\n\tz.literal(RichTextNodeType.heading2),\n\tz.literal(RichTextNodeType.heading3),\n\tz.literal(RichTextNodeType.heading4),\n\tz.literal(RichTextNodeType.heading5),\n\tz.literal(RichTextNodeType.heading6),\n\tz.literal(RichTextNodeType.preformatted),\n\tz.literal(RichTextNodeType.oListItem),\n\tz.literal(RichTextNodeType.listItem),\n])\n\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const getTextBlockSchema = <\n\tTLinkSchema extends typeof FilledLinkLegacyValueSchema | typeof FilledLinkContentValueSchema,\n>(\n\tlinkSchema: TLinkSchema,\n) =>\n\tz.object({\n\t\ttype: TextBlockTypeSchema,\n\t\tcontent: z.object({\n\t\t\ttext: z.string(),\n\t\t\tspans: z.optional(\n\t\t\t\tz.pipe(\n\t\t\t\t\tz.array(z.unknown()),\n\t\t\t\t\tz.transform((spans) => {\n\t\t\t\t\t\tconst spanSchema = getSpanSchema(linkSchema)\n\n\t\t\t\t\t\t// Filter out invalid spans and order them by start position\n\t\t\t\t\t\treturn spans\n\t\t\t\t\t\t\t.flatMap((maybeSpan) => {\n\t\t\t\t\t\t\t\tconst parsed = spanSchema.safeParse(maybeSpan)\n\t\t\t\t\t\t\t\treturn parsed.success ? [parsed.data] : []\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.sort((a, b) => a.start - b.start)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t}),\n\t\tlabel: z.optional(z.string()),\n\t\tdirection: z.optional(z.string()),\n\t})\n\nconst TextBlockLegacySchema = getTextBlockSchema(FilledLinkLegacyValueSchema)\n\ntype TextBlockLegacy = z.infer<typeof TextBlockLegacySchema>\n\n// Image block\n\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const getImageBlockSchema = <\n\tTData extends typeof ImageLegacyViewSchema | typeof ImageContentViewSchema,\n\tTLinkTo extends typeof FilledLinkLegacyValueSchema | typeof FilledLinkContentValueSchema,\n>(\n\tdata: TData,\n\tlinkTo: TLinkTo,\n) =>\n\tz.object({\n\t\ttype: z.literal(RichTextNodeType.image),\n\t\tdata: z.extend(data, { linkTo: z.nullish(linkTo) }),\n\t\tlabel: z.nullish(z.string()),\n\t\tdirection: z.nullish(z.string()),\n\t})\n\nconst ImageBlockLegacySchema = getImageBlockSchema(\n\tImageLegacyViewSchema,\n\tFilledLinkLegacyValueSchema,\n)\n\ntype ImageBlockLegacy = z.infer<typeof ImageBlockLegacySchema>\n\n// Embed block\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const getEmbedBlockSchema = <\n\tTData extends typeof EmbedLegacyLooseSchema | typeof EmbedContentSchema,\n>(\n\tdata: TData,\n) =>\n\tz.object({\n\t\ttype: z.literal(RichTextNodeType.embed),\n\t\tdata,\n\t\tlabel: z.nullish(z.string()),\n\t\tdirection: z.nullish(z.string()),\n\t})\n\nconst EmbedBlockLegacySchema = getEmbedBlockSchema(EmbedLegacyLooseSchema)\n\ntype EmbedBlockLegacy = z.infer<typeof EmbedBlockLegacySchema>\n\n// Blocks\nexport const RichTextLegacyBlockSchema: z.ZodMiniType<RichTextLegacyBlock> = z.discriminatedUnion(\n\t\"type\",\n\t[TextBlockLegacySchema, ImageBlockLegacySchema, EmbedBlockLegacySchema],\n)\n\nexport type RichTextLegacyBlock = TextBlockLegacy | ImageBlockLegacy | EmbedBlockLegacy\n\nexport const RichTextLegacySchema = z.array(RichTextLegacyBlockSchema)\n\nexport type RichTextLegacy = z.infer<typeof RichTextL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E,MAAM,0BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod/mini";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod/mini";
|
package/dist/content/link.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
2
|
|
|
3
3
|
//#region src/content/link.d.ts
|
|
4
|
-
declare const
|
|
4
|
+
declare const FilledImageLinkContentValueSchema: z.ZodMiniObject<{
|
|
5
5
|
kind: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"image", string>>;
|
|
6
6
|
id: z.ZodMiniString<string>;
|
|
7
7
|
url: z.ZodMiniString<string>;
|
|
@@ -11,12 +11,12 @@ declare const FilledImageLinkValueContentSchema: z.ZodMiniObject<{
|
|
|
11
11
|
name: z.ZodMiniString<string>;
|
|
12
12
|
date: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
13
13
|
__TYPE__: z.ZodMiniLiteral<"ImageLink">;
|
|
14
|
-
}, z.core.$
|
|
15
|
-
declare const
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
declare const EmptyImageLinkContentValueSchema: z.ZodMiniObject<{
|
|
16
16
|
kind: z.ZodMiniLiteral<"image">;
|
|
17
17
|
__TYPE__: z.ZodMiniLiteral<"ImageLink">;
|
|
18
18
|
}, z.core.$strict>;
|
|
19
|
-
declare const
|
|
19
|
+
declare const FilledFileLinkContentValueSchema: z.ZodMiniObject<{
|
|
20
20
|
kind: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"file", string>>;
|
|
21
21
|
id: z.ZodMiniString<string>;
|
|
22
22
|
url: z.ZodMiniString<string>;
|
|
@@ -24,25 +24,25 @@ declare const FilledFileLinkValueContentSchema: z.ZodMiniObject<{
|
|
|
24
24
|
size: z.ZodMiniTransform<string, unknown>;
|
|
25
25
|
date: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
26
26
|
__TYPE__: z.ZodMiniLiteral<"FileLink">;
|
|
27
|
-
}, z.core.$
|
|
28
|
-
declare const
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
declare const EmptyFileLinkContentValueSchema: z.ZodMiniObject<{
|
|
29
29
|
kind: z.ZodMiniLiteral<"file">;
|
|
30
30
|
__TYPE__: z.ZodMiniLiteral<"FileLink">;
|
|
31
31
|
}, z.core.$strict>;
|
|
32
|
-
declare const
|
|
32
|
+
declare const EmptyMediaLinkContentValueSchema: z.ZodMiniObject<{
|
|
33
33
|
kind: z.ZodMiniLiteral<"media">;
|
|
34
34
|
__TYPE__: z.ZodMiniLiteral<"MediaLink">;
|
|
35
35
|
}, z.core.$strict>;
|
|
36
|
-
declare const
|
|
36
|
+
declare const FilledDocumentLinkContentValueSchema: z.ZodMiniObject<{
|
|
37
37
|
kind: z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniLiteral<"document">>, z.ZodMiniTransform<"document", "document" | undefined>>;
|
|
38
38
|
id: z.ZodMiniString<string>;
|
|
39
39
|
__TYPE__: z.ZodMiniLiteral<"DocumentLink">;
|
|
40
|
-
}, z.core.$
|
|
41
|
-
declare const
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
declare const EmptyDocumentLinkContentValueSchema: z.ZodMiniObject<{
|
|
42
42
|
kind: z.ZodMiniLiteral<"document">;
|
|
43
43
|
__TYPE__: z.ZodMiniLiteral<"DocumentLink">;
|
|
44
44
|
}, z.core.$strict>;
|
|
45
|
-
declare const
|
|
45
|
+
declare const FilledExternalLinkContentValueSchema: z.ZodMiniObject<{
|
|
46
46
|
kind: z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniLiteral<"web">>, z.ZodMiniTransform<"web", "web" | undefined>>;
|
|
47
47
|
url: z.ZodMiniString<string>;
|
|
48
48
|
target: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
@@ -50,29 +50,29 @@ declare const FilledExternalLinkValueContentSchema: z.ZodMiniObject<{
|
|
|
50
50
|
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
51
|
}, z.core.$strict>>>;
|
|
52
52
|
__TYPE__: z.ZodMiniLiteral<"ExternalLink">;
|
|
53
|
-
}, z.core.$
|
|
54
|
-
declare const
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
declare const EmptyExternalLinkContentValueSchema: z.ZodMiniObject<{
|
|
55
55
|
kind: z.ZodMiniLiteral<"web">;
|
|
56
56
|
__TYPE__: z.ZodMiniLiteral<"ExternalLink">;
|
|
57
57
|
}, z.core.$strict>;
|
|
58
|
-
declare const
|
|
58
|
+
declare const AnyLinkContentValueSchema: z.ZodMiniObject<{
|
|
59
59
|
kind: z.ZodMiniTransform<"any", unknown>;
|
|
60
60
|
__TYPE__: z.ZodMiniLiteral<"AnyLink">;
|
|
61
61
|
}, z.core.$strict>;
|
|
62
|
-
type
|
|
63
|
-
type
|
|
64
|
-
type
|
|
65
|
-
type
|
|
66
|
-
type
|
|
67
|
-
type
|
|
68
|
-
type
|
|
69
|
-
type
|
|
70
|
-
type
|
|
71
|
-
type
|
|
72
|
-
type
|
|
73
|
-
type
|
|
74
|
-
type
|
|
75
|
-
declare const
|
|
62
|
+
type FilledImageLinkContentValue = z.infer<typeof FilledImageLinkContentValueSchema>;
|
|
63
|
+
type FilledFileLinkContentValue = z.infer<typeof FilledFileLinkContentValueSchema>;
|
|
64
|
+
type FilledDocumentLinkContentValue = z.infer<typeof FilledDocumentLinkContentValueSchema>;
|
|
65
|
+
type FilledExternalLinkContentValue = z.infer<typeof FilledExternalLinkContentValueSchema>;
|
|
66
|
+
type FilledLinkContentValue = FilledImageLinkContentValue | FilledFileLinkContentValue | FilledDocumentLinkContentValue | FilledExternalLinkContentValue;
|
|
67
|
+
type EmptyImageLinkContentValue = z.infer<typeof EmptyImageLinkContentValueSchema>;
|
|
68
|
+
type EmptyFileLinkContentValue = z.infer<typeof EmptyFileLinkContentValueSchema>;
|
|
69
|
+
type EmptyMediaLinkContentValue = z.infer<typeof EmptyMediaLinkContentValueSchema>;
|
|
70
|
+
type EmptyDocumentLinkContentValue = z.infer<typeof EmptyDocumentLinkContentValueSchema>;
|
|
71
|
+
type EmptyExternalLinkContentValue = z.infer<typeof EmptyExternalLinkContentValueSchema>;
|
|
72
|
+
type AnyLinkContentValue = z.infer<typeof AnyLinkContentValueSchema>;
|
|
73
|
+
type EmptyLinkContentValue = EmptyImageLinkContentValue | EmptyFileLinkContentValue | EmptyMediaLinkContentValue | EmptyDocumentLinkContentValue | EmptyExternalLinkContentValue | AnyLinkContentValue;
|
|
74
|
+
type LinkContentValue = FilledLinkContentValue | EmptyLinkContentValue;
|
|
75
|
+
declare const FilledLinkContentSchema: z.ZodMiniObject<{
|
|
76
76
|
__TYPE__: z.ZodMiniLiteral<"LinkContent">;
|
|
77
77
|
key: z.ZodMiniTransform<string, unknown>;
|
|
78
78
|
value: z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>, z.ZodMiniTransform<{
|
|
@@ -82,82 +82,59 @@ declare const LinkContentSchema: z.ZodMiniObject<{
|
|
|
82
82
|
}, Record<string, unknown>>>, z.ZodMiniObject<{
|
|
83
83
|
text: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
84
84
|
variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
85
|
-
value: z.ZodMiniType<
|
|
85
|
+
value: z.ZodMiniType<FilledLinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<FilledLinkContentValue, Record<string, unknown>>>;
|
|
86
86
|
}, z.core.$strip>>, z.ZodMiniTransform<{
|
|
87
|
-
kind: "image";
|
|
88
|
-
id: string;
|
|
89
|
-
url: string;
|
|
90
|
-
height: string;
|
|
91
|
-
width: string;
|
|
92
|
-
size: string;
|
|
93
|
-
name: string;
|
|
94
|
-
__TYPE__: "ImageLink";
|
|
95
|
-
date?: string | null | undefined;
|
|
96
|
-
variant?: string | undefined;
|
|
97
|
-
text?: string | undefined;
|
|
98
|
-
} | {
|
|
99
|
-
kind: "file";
|
|
100
|
-
id: string;
|
|
101
|
-
url: string;
|
|
102
|
-
name: string;
|
|
103
|
-
size: string;
|
|
104
|
-
__TYPE__: "FileLink";
|
|
105
|
-
date?: string | null | undefined;
|
|
106
87
|
variant?: string | undefined;
|
|
107
88
|
text?: string | undefined;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
id: string;
|
|
111
|
-
__TYPE__: "DocumentLink";
|
|
112
|
-
variant?: string | undefined;
|
|
113
|
-
text?: string | undefined;
|
|
114
|
-
} | {
|
|
115
|
-
kind: "web";
|
|
116
|
-
url: string;
|
|
117
|
-
__TYPE__: "ExternalLink";
|
|
118
|
-
target?: string | null | undefined;
|
|
119
|
-
preview?: {
|
|
120
|
-
title?: string | undefined;
|
|
121
|
-
} | null | undefined;
|
|
122
|
-
variant?: string | undefined;
|
|
89
|
+
} & FilledLinkContentValue, {
|
|
90
|
+
value: FilledLinkContentValue;
|
|
123
91
|
text?: string | undefined;
|
|
124
|
-
} | {
|
|
125
|
-
kind: "image";
|
|
126
|
-
__TYPE__: "ImageLink";
|
|
127
92
|
variant?: string | undefined;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
93
|
+
}>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
type FilledLinkContent = z.infer<typeof FilledLinkContentSchema>;
|
|
96
|
+
declare const EmptyLinkContentSchema: z.ZodMiniObject<{
|
|
97
|
+
__TYPE__: z.ZodMiniLiteral<"LinkContent">;
|
|
98
|
+
key: z.ZodMiniTransform<string, unknown>;
|
|
99
|
+
value: z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>, z.ZodMiniTransform<{
|
|
100
|
+
text?: unknown;
|
|
101
|
+
variant?: unknown;
|
|
102
|
+
value: Record<string, unknown>;
|
|
103
|
+
}, Record<string, unknown>>>, z.ZodMiniObject<{
|
|
104
|
+
text: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
105
|
+
variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
106
|
+
value: z.ZodMiniType<EmptyLinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<EmptyLinkContentValue, Record<string, unknown>>>;
|
|
107
|
+
}, z.core.$strip>>, z.ZodMiniTransform<{
|
|
137
108
|
variant?: string | undefined;
|
|
138
109
|
text?: string | undefined;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
__TYPE__: "DocumentLink";
|
|
142
|
-
variant?: string | undefined;
|
|
110
|
+
} & EmptyLinkContentValue, {
|
|
111
|
+
value: EmptyLinkContentValue;
|
|
143
112
|
text?: string | undefined;
|
|
144
|
-
} | {
|
|
145
|
-
kind: "web";
|
|
146
|
-
__TYPE__: "ExternalLink";
|
|
147
113
|
variant?: string | undefined;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
114
|
+
}>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type EmptyLinkContent = z.infer<typeof EmptyLinkContentSchema>;
|
|
117
|
+
declare const LinkContentSchema: z.ZodMiniObject<{
|
|
118
|
+
__TYPE__: z.ZodMiniLiteral<"LinkContent">;
|
|
119
|
+
key: z.ZodMiniTransform<string, unknown>;
|
|
120
|
+
value: z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniPipe<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>, z.ZodMiniTransform<{
|
|
121
|
+
text?: unknown;
|
|
122
|
+
variant?: unknown;
|
|
123
|
+
value: Record<string, unknown>;
|
|
124
|
+
}, Record<string, unknown>>>, z.ZodMiniObject<{
|
|
125
|
+
text: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
126
|
+
variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
127
|
+
value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
|
|
128
|
+
}, z.core.$strip>>, z.ZodMiniTransform<{
|
|
152
129
|
variant?: string | undefined;
|
|
153
130
|
text?: string | undefined;
|
|
154
|
-
}, {
|
|
155
|
-
value:
|
|
131
|
+
} & LinkContentValue, {
|
|
132
|
+
value: LinkContentValue;
|
|
156
133
|
text?: string | undefined;
|
|
157
134
|
variant?: string | undefined;
|
|
158
135
|
}>>;
|
|
159
136
|
}, z.core.$strip>;
|
|
160
137
|
type LinkContent = z.infer<typeof LinkContentSchema>;
|
|
161
138
|
//#endregion
|
|
162
|
-
export {
|
|
139
|
+
export { EmptyLinkContent, EmptyLinkContentValue, FilledLinkContent, FilledLinkContentValue, LinkContent, LinkContentValue };
|
|
163
140
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","names":[],"sources":["../../src/content/link.ts"],"mappings":";;;cAiBM,iCAAA,EAAiC,CAAA,CAAA,aAAA;;;;;;;;;;;cAIjC,gCAAA,EAAgC,CAAA,CAAA,aAAA;;;;cAKhC,gCAAA,EAAgC,CAAA,CAAA,aAAA;;;;;;;;;cAIhC,+BAAA,EAA+B,CAAA,CAAA,aAAA;;;;cAK/B,gCAAA,EAAgC,CAAA,CAAA,aAAA;;;;cAKhC,oCAAA,EAAoC,CAAA,CAAA,aAAA;;;;;cAIpC,mCAAA,EAAmC,CAAA,CAAA,aAAA;;;;cAKnC,oCAAA,EAAoC,CAAA,CAAA,aAAA;;;;;;;;;cAIpC,mCAAA,EAAmC,CAAA,CAAA,aAAA;;;;cAKnC,yBAAA,EAAyB,CAAA,CAAA,aAAA;;;;KAe1B,2BAAA,GAA8B,CAAA,CAAE,KAAA,QAAa,iCAAA;AAAA,KAC7C,0BAAA,GAA6B,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ANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { AnyLinkLegacySchema,
|
|
1
|
+
import { AnyLinkLegacySchema, EmptyDocumentLinkLegacyValueSchema, EmptyExternalLinkLegacyValueSchema, EmptyFileLinkLegacyValueSchema, EmptyImageLinkLegacyValueSchema, EmptyMediaLinkLegacyValueSchema, FilledDocumentLinkLegacyValueSchema, FilledExternalLinkLegacyValueSchema, FilledFileLinkLegacyValueSchema, FilledImageLinkLegacyValueSchema, LinkType } from "./legacy/link.js";
|
|
2
2
|
import { z } from "zod/mini";
|
|
3
3
|
//#region src/content/link.ts
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
const FilledImageLinkContentValueSchema = z.extend(FilledImageLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.Image) });
|
|
5
|
+
const EmptyImageLinkContentValueSchema = z.extend(EmptyImageLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.Image) });
|
|
6
|
+
const FilledFileLinkContentValueSchema = z.extend(FilledFileLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.File) });
|
|
7
|
+
const EmptyFileLinkContentValueSchema = z.extend(EmptyFileLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.File) });
|
|
8
|
+
const EmptyMediaLinkContentValueSchema = z.extend(EmptyMediaLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.Media) });
|
|
9
|
+
const FilledDocumentLinkContentValueSchema = z.extend(FilledDocumentLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.Document) });
|
|
10
|
+
const EmptyDocumentLinkContentValueSchema = z.extend(EmptyDocumentLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.Document) });
|
|
11
|
+
const FilledExternalLinkContentValueSchema = z.extend(FilledExternalLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.External) });
|
|
12
|
+
const EmptyExternalLinkContentValueSchema = z.extend(EmptyExternalLinkLegacyValueSchema, { __TYPE__: z.literal(LinkType.External) });
|
|
13
|
+
const AnyLinkContentValueSchema = z.extend(AnyLinkLegacySchema, { __TYPE__: z.literal(LinkType.Any) });
|
|
14
|
+
const FilledLinkContentValueSchema = z.union([
|
|
15
|
+
FilledImageLinkContentValueSchema,
|
|
16
|
+
FilledFileLinkContentValueSchema,
|
|
17
|
+
FilledDocumentLinkContentValueSchema,
|
|
18
|
+
FilledExternalLinkContentValueSchema
|
|
19
19
|
]);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
const EmptyLinkContentValueSchema = z.union([
|
|
21
|
+
EmptyImageLinkContentValueSchema,
|
|
22
|
+
EmptyFileLinkContentValueSchema,
|
|
23
|
+
EmptyMediaLinkContentValueSchema,
|
|
24
|
+
EmptyDocumentLinkContentValueSchema,
|
|
25
|
+
EmptyExternalLinkContentValueSchema,
|
|
26
|
+
AnyLinkContentValueSchema
|
|
27
27
|
]);
|
|
28
|
-
const
|
|
28
|
+
const LinkContentValueSchema = z.union([FilledLinkContentValueSchema, EmptyLinkContentValueSchema]);
|
|
29
29
|
const LinkContentType = "LinkContent";
|
|
30
|
-
const
|
|
30
|
+
const getLinkContentSchema = (value) => z.object({
|
|
31
31
|
__TYPE__: z.literal(LinkContentType),
|
|
32
32
|
key: z.transform((value) => z.uuidv4().safeParse(value).data || crypto.randomUUID()),
|
|
33
33
|
value: z.pipe(z.pipe(z.pipe(z.record(z.string(), z.unknown()), z.transform(({ text, variant, ...value }) => ({
|
|
@@ -37,14 +37,17 @@ const LinkContentSchema = z.object({
|
|
|
37
37
|
}))), z.object({
|
|
38
38
|
text: z.optional(z.string()),
|
|
39
39
|
variant: z.optional(z.string()),
|
|
40
|
-
value
|
|
40
|
+
value
|
|
41
41
|
})), z.transform(({ text, variant, value }) => ({
|
|
42
42
|
...text ? { text } : {},
|
|
43
43
|
...variant ? { variant } : {},
|
|
44
44
|
...value
|
|
45
45
|
})))
|
|
46
46
|
});
|
|
47
|
+
const FilledLinkContentSchema = getLinkContentSchema(FilledLinkContentValueSchema);
|
|
48
|
+
const EmptyLinkContentSchema = getLinkContentSchema(EmptyLinkContentValueSchema);
|
|
49
|
+
const LinkContentSchema = getLinkContentSchema(LinkContentValueSchema);
|
|
47
50
|
//#endregion
|
|
48
|
-
export {
|
|
51
|
+
export { EmptyLinkContentSchema, FilledLinkContentSchema, FilledLinkContentValueSchema, LinkContentSchema, LinkContentType };
|
|
49
52
|
|
|
50
53
|
//# sourceMappingURL=link.js.map
|
package/dist/content/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":[],"sources":["../../src/content/link.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport {\n\
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../src/content/link.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport {\n\tEmptyDocumentLinkLegacyValueSchema,\n\tEmptyImageLinkLegacyValueSchema,\n\tFilledDocumentLinkLegacyValueSchema,\n\tFilledFileLinkLegacyValueSchema,\n\tFilledImageLinkLegacyValueSchema,\n\tEmptyMediaLinkLegacyValueSchema,\n\tFilledExternalLinkLegacyValueSchema,\n\tEmptyExternalLinkLegacyValueSchema,\n\tAnyLinkLegacySchema,\n\tLinkType,\n\tEmptyFileLinkLegacyValueSchema,\n} from \"./legacy/link\"\n\n// Image\nconst FilledImageLinkContentValueSchema = z.extend(FilledImageLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.Image),\n})\n\nconst EmptyImageLinkContentValueSchema = z.extend(EmptyImageLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.Image),\n})\n\n// File\nconst FilledFileLinkContentValueSchema = z.extend(FilledFileLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.File),\n})\n\nconst EmptyFileLinkContentValueSchema = z.extend(EmptyFileLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.File),\n})\n\n// Media\nconst EmptyMediaLinkContentValueSchema = z.extend(EmptyMediaLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.Media),\n})\n\n// Document\nconst FilledDocumentLinkContentValueSchema = z.extend(FilledDocumentLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.Document),\n})\n\nconst EmptyDocumentLinkContentValueSchema = z.extend(EmptyDocumentLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.Document),\n})\n\n// External\nconst FilledExternalLinkContentValueSchema = z.extend(FilledExternalLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.External),\n})\n\nconst EmptyExternalLinkContentValueSchema = z.extend(EmptyExternalLinkLegacyValueSchema, {\n\t__TYPE__: z.literal(LinkType.External),\n})\n\n// Any\nconst AnyLinkContentValueSchema = z.extend(AnyLinkLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Any),\n})\n\n// All\n\n// Used by content/richText\nexport const FilledLinkContentValueSchema: z.ZodMiniType<FilledLinkContentValue> = z.union([\n\tFilledImageLinkContentValueSchema,\n\tFilledFileLinkContentValueSchema,\n\tFilledDocumentLinkContentValueSchema,\n\tFilledExternalLinkContentValueSchema,\n])\n\n// Used by content/legacy/link\ntype FilledImageLinkContentValue = z.infer<typeof FilledImageLinkContentValueSchema>\ntype FilledFileLinkContentValue = z.infer<typeof FilledFileLinkContentValueSchema>\ntype FilledDocumentLinkContentValue = z.infer<typeof FilledDocumentLinkContentValueSchema>\ntype FilledExternalLinkContentValue = z.infer<typeof FilledExternalLinkContentValueSchema>\nexport type FilledLinkContentValue =\n\t| FilledImageLinkContentValue\n\t| FilledFileLinkContentValue\n\t| FilledDocumentLinkContentValue\n\t| FilledExternalLinkContentValue\n\nconst EmptyLinkContentValueSchema: z.ZodMiniType<EmptyLinkContentValue> = z.union([\n\tEmptyImageLinkContentValueSchema,\n\tEmptyFileLinkContentValueSchema,\n\tEmptyMediaLinkContentValueSchema,\n\tEmptyDocumentLinkContentValueSchema,\n\tEmptyExternalLinkContentValueSchema,\n\tAnyLinkContentValueSchema,\n])\n\n// Used by content/codec/link\ntype EmptyImageLinkContentValue = z.infer<typeof EmptyImageLinkContentValueSchema>\ntype EmptyFileLinkContentValue = z.infer<typeof EmptyFileLinkContentValueSchema>\ntype EmptyMediaLinkContentValue = z.infer<typeof EmptyMediaLinkContentValueSchema>\ntype EmptyDocumentLinkContentValue = z.infer<typeof EmptyDocumentLinkContentValueSchema>\ntype EmptyExternalLinkContentValue = z.infer<typeof EmptyExternalLinkContentValueSchema>\ntype AnyLinkContentValue = z.infer<typeof AnyLinkContentValueSchema>\nexport type EmptyLinkContentValue =\n\t| EmptyImageLinkContentValue\n\t| EmptyFileLinkContentValue\n\t| EmptyMediaLinkContentValue\n\t| EmptyDocumentLinkContentValue\n\t| EmptyExternalLinkContentValue\n\t| AnyLinkContentValue\n\nconst LinkContentValueSchema: z.ZodMiniType<LinkContentValue> = z.union([\n\tFilledLinkContentValueSchema,\n\tEmptyLinkContentValueSchema,\n])\n\n// Used by content/codec/link\nexport type LinkContentValue = FilledLinkContentValue | EmptyLinkContentValue\n\n// Content\nexport const LinkContentType = \"LinkContent\" as const\n\nconst getLinkContentSchema = <TValue extends LinkContentValue>(value: z.ZodMiniType<TValue>) =>\n\tz.object({\n\t\t__TYPE__: z.literal(LinkContentType),\n\t\tkey: z.transform((value) => z.uuidv4().safeParse(value).data || crypto.randomUUID()),\n\t\t// We cannot use z.extend here because we're working with unions.\n\t\t// z.intersection wouldn't work also for the same reason.\n\t\tvalue: z.pipe(\n\t\t\tz.pipe(\n\t\t\t\tz.pipe(\n\t\t\t\t\tz.record(z.string(), z.unknown()),\n\t\t\t\t\tz.transform(\n\t\t\t\t\t\t({\n\t\t\t\t\t\t\ttext,\n\t\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t\t...value\n\t\t\t\t\t\t}): {\n\t\t\t\t\t\t\ttext?: unknown\n\t\t\t\t\t\t\tvariant?: unknown\n\t\t\t\t\t\t\tvalue: Record<string, unknown>\n\t\t\t\t\t\t} => ({ text, variant, value }),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tz.object({\n\t\t\t\t\ttext: z.optional(z.string()),\n\t\t\t\t\tvariant: z.optional(z.string()),\n\t\t\t\t\tvalue: value as z.ZodMiniType<TValue, Record<string, unknown>>,\n\t\t\t\t}),\n\t\t\t),\n\t\t\tz.transform(({ text, variant, value }) => ({\n\t\t\t\t...(text ? { text } : {}),\n\t\t\t\t...(variant ? { variant } : {}),\n\t\t\t\t...value,\n\t\t\t})),\n\t\t),\n\t})\n\nexport const FilledLinkContentSchema = getLinkContentSchema(FilledLinkContentValueSchema)\n\nexport type FilledLinkContent = z.infer<typeof FilledLinkContentSchema>\n\nexport const EmptyLinkContentSchema = getLinkContentSchema(EmptyLinkContentValueSchema)\n\nexport type EmptyLinkContent = z.infer<typeof EmptyLinkContentSchema>\n\nexport const LinkContentSchema = getLinkContentSchema(LinkContentValueSchema)\n\nexport type LinkContent = z.infer<typeof LinkContentSchema>\n"],"mappings":";;;AAiBA,MAAM,oCAAoC,EAAE,OAAO,kCAAkC,EACpF,UAAU,EAAE,QAAQ,SAAS,MAAM,EACnC,CAAC;AAEF,MAAM,mCAAmC,EAAE,OAAO,iCAAiC,EAClF,UAAU,EAAE,QAAQ,SAAS,MAAM,EACnC,CAAC;AAGF,MAAM,mCAAmC,EAAE,OAAO,iCAAiC,EAClF,UAAU,EAAE,QAAQ,SAAS,KAAK,EAClC,CAAC;AAEF,MAAM,kCAAkC,EAAE,OAAO,gCAAgC,EAChF,UAAU,EAAE,QAAQ,SAAS,KAAK,EAClC,CAAC;AAGF,MAAM,mCAAmC,EAAE,OAAO,iCAAiC,EAClF,UAAU,EAAE,QAA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AAM,GAAG,EAAE;EACxB,GAAI,UAAU,EAAE,SAAS,GAAG,EAAE;EAC9B,GAAG;EACH,EAAE,CACH;CACD,CAAC;AAEH,MAAa,0BAA0B,qBAAqB,6BAA6B;AAIzF,MAAa,yBAAyB,qBAAqB,4BAA4B;AAIvF,MAAa,oBAAoB,qBAAqB,uBAAuB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BooleanContent } from "./boolean.js";
|
|
2
|
+
import { LinkContent } from "./link.js";
|
|
2
3
|
import { EmbedContent } from "./embed.js";
|
|
4
|
+
import { ImageContent } from "./image.js";
|
|
5
|
+
import { RichTextContent } from "./richText.js";
|
|
3
6
|
import { EmptyContent } from "./empty.js";
|
|
4
7
|
import { ColorContent, DateContent, NumberContent, RangeContent, SelectContent, TextContent, TimestampContent } from "./field.js";
|
|
5
8
|
import { GeoPointContent } from "./geopoint.js";
|
|
6
|
-
import { ImageContent } from "./image.js";
|
|
7
9
|
import { IntegrationFieldContent } from "./integrationField.js";
|
|
8
|
-
import { LinkContent } from "./link.js";
|
|
9
10
|
import { RepeatableContent } from "./repeatable.js";
|
|
10
|
-
import { RichTextContent } from "./richText.js";
|
|
11
11
|
import { SeparatorContent } from "./separator.js";
|
|
12
12
|
import { TableContent } from "./table.js";
|
|
13
13
|
import { z } from "zod/mini";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestable.d.ts","names":[],"sources":["../../src/content/nestable.ts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"nestable.d.ts","names":[],"sources":["../../src/content/nestable.ts"],"mappings":";;;;;;;;;;;;;;;KAkDY,eAAA,GACT,YAAA,GACA,cAAA,GACA,YAAA,GACA,WAAA,GACA,YAAA,GACA,eAAA,GACA,YAAA,GACA,uBAAA,GACA,WAAA,GACA,aAAA,GACA,YAAA,GACA,iBAAA,GACA,eAAA,GACA,aAAA,GACA,gBAAA,GACA,YAAA,GACA,WAAA,GACA,gBAAA"}
|