@prismicio/types-internal 4.0.0-pr.7.9dec8db → 4.0.0-pr.9.da3d99a

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.
Files changed (101) hide show
  1. package/dist/content/boolean.d.ts.map +1 -1
  2. package/dist/content/boolean.js.map +1 -1
  3. package/dist/content/codec/link.js.map +1 -1
  4. package/dist/content/codec/nestable.js +4 -4
  5. package/dist/content/field.d.ts.map +1 -1
  6. package/dist/content/field.js +1 -1
  7. package/dist/content/field.js.map +1 -1
  8. package/dist/content/group.d.ts.map +1 -1
  9. package/dist/content/group.js.map +1 -1
  10. package/dist/content/image.d.ts +3 -1
  11. package/dist/content/image.d.ts.map +1 -1
  12. package/dist/content/image.js +3 -3
  13. package/dist/content/image.js.map +1 -1
  14. package/dist/content/legacy/image.d.ts +28 -1
  15. package/dist/content/legacy/image.d.ts.map +1 -0
  16. package/dist/content/legacy/image.js +3 -3
  17. package/dist/content/legacy/image.js.map +1 -1
  18. package/dist/content/legacy/link.d.ts +10 -10
  19. package/dist/content/legacy/link.js +23 -23
  20. package/dist/content/legacy/link.js.map +1 -1
  21. package/dist/content/legacy/nestable.js +1 -1
  22. package/dist/content/legacy/richText.d.ts +9 -8
  23. package/dist/content/legacy/richText.d.ts.map +1 -1
  24. package/dist/content/legacy/richText.js +5 -5
  25. package/dist/content/legacy/richText.js.map +1 -1
  26. package/dist/content/link.d.ts +62 -85
  27. package/dist/content/link.d.ts.map +1 -1
  28. package/dist/content/link.js +30 -27
  29. package/dist/content/link.js.map +1 -1
  30. package/dist/content/nestable.d.ts.map +1 -1
  31. package/dist/content/nestable.js +4 -4
  32. package/dist/content/nestable.js.map +1 -1
  33. package/dist/content/repeatable.d.ts +4 -69
  34. package/dist/content/repeatable.d.ts.map +1 -1
  35. package/dist/content/richText.d.ts +13 -13
  36. package/dist/content/richText.d.ts.map +1 -1
  37. package/dist/content/richText.js +9 -9
  38. package/dist/content/richText.js.map +1 -1
  39. package/dist/helpers/imageContent.d.ts +33 -0
  40. package/dist/helpers/imageContent.d.ts.map +1 -0
  41. package/dist/helpers/imageContent.js +55 -0
  42. package/dist/helpers/imageContent.js.map +1 -0
  43. package/dist/helpers/traverseContent.d.ts +4 -4
  44. package/dist/helpers/traverseContent.d.ts.map +1 -1
  45. package/dist/helpers/traverseContent.js +5 -3
  46. package/dist/helpers/traverseContent.js.map +1 -1
  47. package/dist/helpers/traverseContentWithModel.d.ts +4 -4
  48. package/dist/helpers/traverseContentWithModel.js +1 -1
  49. package/dist/helpers/withDefaultContent.d.ts +21 -0
  50. package/dist/helpers/withDefaultContent.d.ts.map +1 -0
  51. package/dist/helpers/withDefaultContent.js +120 -0
  52. package/dist/helpers/withDefaultContent.js.map +1 -0
  53. package/dist/index.d.ts +25 -22
  54. package/dist/index.js +6 -1
  55. package/dist/io-ts.d.ts +1156 -727
  56. package/dist/io-ts.d.ts.map +1 -1
  57. package/dist/io-ts.js +11 -7
  58. package/dist/io-ts.js.map +1 -1
  59. package/dist/model/richText.d.ts +20 -1
  60. package/dist/model/richText.d.ts.map +1 -1
  61. package/dist/model/richText.js +3 -3
  62. package/dist/model/richText.js.map +1 -1
  63. package/dist/model/slice.d.ts +1251 -643
  64. package/dist/model/slice.d.ts.map +1 -1
  65. package/dist/model/slice.js +4 -4
  66. package/dist/model/slice.js.map +1 -1
  67. package/dist/model/table.js +5 -5
  68. package/dist/model/table.js.map +1 -1
  69. package/dist/model/widget.d.ts +1 -3
  70. package/dist/model/widget.d.ts.map +1 -1
  71. package/dist/model/widget.js +5 -2
  72. package/dist/model/widget.js.map +1 -1
  73. package/dist/zod4.d.ts +2392 -1873
  74. package/dist/zod4.d.ts.map +1 -1
  75. package/dist/zod4.js +11 -7
  76. package/dist/zod4.js.map +1 -1
  77. package/package.json +19 -12
  78. package/src/content/boolean.ts +0 -13
  79. package/src/content/codec/link.ts +12 -12
  80. package/src/content/field.ts +0 -14
  81. package/src/content/group.ts +1 -54
  82. package/src/content/image.ts +3 -91
  83. package/src/content/legacy/image.ts +4 -4
  84. package/src/content/legacy/link.ts +46 -46
  85. package/src/content/legacy/richText.ts +18 -16
  86. package/src/content/link.ts +100 -89
  87. package/src/content/nestable.ts +1 -20
  88. package/src/content/richText.ts +23 -17
  89. package/src/helpers/imageContent.ts +84 -0
  90. package/src/helpers/traverseContent.ts +4 -1
  91. package/src/helpers/withDefaultContent.ts +180 -0
  92. package/src/index.ts +18 -5
  93. package/src/io-ts.ts +14 -2
  94. package/src/model/diff/sharedSlice.ts +2 -2
  95. package/src/model/diff/variation.ts +7 -7
  96. package/src/model/richText.ts +5 -2
  97. package/src/model/slice.ts +6 -8
  98. package/src/model/table.ts +5 -5
  99. package/src/model/widget.ts +6 -2
  100. package/src/zod4.ts +14 -2
  101. package/src/content/withDefaultValues.ts +0 -114
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod/mini";
2
2
 
3
3
  //#region src/content/link.d.ts
4
- declare const FilledImageLinkValueContentSchema: z.ZodMiniObject<{
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>;
@@ -12,11 +12,11 @@ declare const FilledImageLinkValueContentSchema: z.ZodMiniObject<{
12
12
  date: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
13
13
  __TYPE__: z.ZodMiniLiteral<"ImageLink">;
14
14
  }, z.core.$strict>;
15
- declare const EmptyImageLinkValueContentSchema: z.ZodMiniObject<{
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 FilledFileLinkValueContentSchema: z.ZodMiniObject<{
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>;
@@ -25,24 +25,24 @@ declare const FilledFileLinkValueContentSchema: z.ZodMiniObject<{
25
25
  date: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
26
26
  __TYPE__: z.ZodMiniLiteral<"FileLink">;
27
27
  }, z.core.$strict>;
28
- declare const EmptyFileLinkValueContentSchema: z.ZodMiniObject<{
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 EmptyMediaLinkValueContentSchema: z.ZodMiniObject<{
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 FilledDocumentLinkValueContentSchema: z.ZodMiniObject<{
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
40
  }, z.core.$strict>;
41
- declare const EmptyDocumentLinkValueContentSchema: z.ZodMiniObject<{
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 FilledExternalLinkValueContentSchema: z.ZodMiniObject<{
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>>>;
@@ -51,28 +51,28 @@ declare const FilledExternalLinkValueContentSchema: z.ZodMiniObject<{
51
51
  }, z.core.$strict>>>;
52
52
  __TYPE__: z.ZodMiniLiteral<"ExternalLink">;
53
53
  }, z.core.$strict>;
54
- declare const EmptyExternalLinkValueContentSchema: z.ZodMiniObject<{
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 AnyLinkValueContentSchema: z.ZodMiniObject<{
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 FilledImageLinkValueContent = z.infer<typeof FilledImageLinkValueContentSchema>;
63
- type FilledFileLinkValueContent = z.infer<typeof FilledFileLinkValueContentSchema>;
64
- type FilledDocumentLinkValueContent = z.infer<typeof FilledDocumentLinkValueContentSchema>;
65
- type FilledExternalLinkValueContent = z.infer<typeof FilledExternalLinkValueContentSchema>;
66
- type FilledLinkValueContent = FilledImageLinkValueContent | FilledFileLinkValueContent | FilledDocumentLinkValueContent | FilledExternalLinkValueContent;
67
- type EmptyImageLinkValueContent = z.infer<typeof EmptyImageLinkValueContentSchema>;
68
- type EmptyFileLinkValueContent = z.infer<typeof EmptyFileLinkValueContentSchema>;
69
- type EmptyMediaLinkValueContent = z.infer<typeof EmptyMediaLinkValueContentSchema>;
70
- type EmptyDocumentLinkValueContent = z.infer<typeof EmptyDocumentLinkValueContentSchema>;
71
- type EmptyExternalLinkValueContent = z.infer<typeof EmptyExternalLinkValueContentSchema>;
72
- type AnyLinkValueContent = z.infer<typeof AnyLinkValueContentSchema>;
73
- type EmptyLinkValueContent = EmptyImageLinkValueContent | EmptyFileLinkValueContent | EmptyMediaLinkValueContent | EmptyDocumentLinkValueContent | EmptyExternalLinkValueContent | AnyLinkValueContent;
74
- type LinkValueContent = FilledLinkValueContent | EmptyLinkValueContent;
75
- declare const LinkContentSchema: z.ZodMiniObject<{
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<LinkValueContent, Record<string, unknown>>;
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
87
  variant?: string | undefined;
97
88
  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
- variant?: string | undefined;
89
+ } & FilledLinkContentValue, {
90
+ value: FilledLinkContentValue;
107
91
  text?: string | undefined;
108
- } | {
109
- kind: "document";
110
- id: string;
111
- __TYPE__: "DocumentLink";
112
92
  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;
123
- text?: string | undefined;
124
- } | {
125
- kind: "image";
126
- __TYPE__: "ImageLink";
127
- variant?: string | undefined;
128
- text?: string | undefined;
129
- } | {
130
- kind: "file";
131
- __TYPE__: "FileLink";
132
- variant?: string | undefined;
133
- text?: string | undefined;
134
- } | {
135
- kind: "media";
136
- __TYPE__: "MediaLink";
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
- kind: "document";
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
- text?: string | undefined;
149
- } | {
150
- kind: "any";
151
- __TYPE__: "AnyLink";
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: LinkValueContent;
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 { FilledLinkValueContent, LinkContent, LinkValueContent };
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,CAAA,CAAE,KAAA,QAAa,gCAAA;AAAA,KAC5C,8BAAA,GAAiC,CAAA,CAAE,KAAA,QAAa,oCAAA;AAAA,KAChD,8BAAA,GAAiC,CAAA,CAAE,KAAA,QAA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A,aAAA;;;;;;WA1BhB,MAAA;EAAA;;;;;;;;;;;;;KA4BF,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA"}
@@ -1,33 +1,33 @@
1
- import { AnyLinkLegacySchema, EmptyDocumentLinkValueLegacySchema, EmptyExternalLinkValueLegacySchema, EmptyFileLinkValueLegacySchema, EmptyImageLinkValueLegacySchema, EmptyMediaLinkValueLegacySchema, FilledDocumentLinkValueLegacySchema, FilledExternalLinkValueLegacySchema, FilledFileLinkValueLegacySchema, FilledImageLinkValueLegacySchema, LinkType } from "./legacy/link.js";
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 FilledImageLinkValueContentSchema = z.extend(FilledImageLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.Image) });
5
- const EmptyImageLinkValueContentSchema = z.extend(EmptyImageLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.Image) });
6
- const FilledFileLinkValueContentSchema = z.extend(FilledFileLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.File) });
7
- const EmptyFileLinkValueContentSchema = z.extend(EmptyFileLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.File) });
8
- const EmptyMediaLinkValueContentSchema = z.extend(EmptyMediaLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.Media) });
9
- const FilledDocumentLinkValueContentSchema = z.extend(FilledDocumentLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.Document) });
10
- const EmptyDocumentLinkValueContentSchema = z.extend(EmptyDocumentLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.Document) });
11
- const FilledExternalLinkValueContentSchema = z.extend(FilledExternalLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.External) });
12
- const EmptyExternalLinkValueContentSchema = z.extend(EmptyExternalLinkValueLegacySchema, { __TYPE__: z.literal(LinkType.External) });
13
- const AnyLinkValueContentSchema = z.extend(AnyLinkLegacySchema, { __TYPE__: z.literal(LinkType.Any) });
14
- const FilledLinkValueContentSchema = z.union([
15
- FilledImageLinkValueContentSchema,
16
- FilledFileLinkValueContentSchema,
17
- FilledDocumentLinkValueContentSchema,
18
- FilledExternalLinkValueContentSchema
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 EmptyLinkValueContentSchema = z.union([
21
- EmptyImageLinkValueContentSchema,
22
- EmptyFileLinkValueContentSchema,
23
- EmptyMediaLinkValueContentSchema,
24
- EmptyDocumentLinkValueContentSchema,
25
- EmptyExternalLinkValueContentSchema,
26
- AnyLinkValueContentSchema
20
+ const EmptyLinkContentValueSchema = z.union([
21
+ EmptyImageLinkContentValueSchema,
22
+ EmptyFileLinkContentValueSchema,
23
+ EmptyMediaLinkContentValueSchema,
24
+ EmptyDocumentLinkContentValueSchema,
25
+ EmptyExternalLinkContentValueSchema,
26
+ AnyLinkContentValueSchema
27
27
  ]);
28
- const LinkValueContentSchema = z.union([FilledLinkValueContentSchema, EmptyLinkValueContentSchema]);
28
+ const LinkContentValueSchema = z.union([FilledLinkContentValueSchema, EmptyLinkContentValueSchema]);
29
29
  const LinkContentType = "LinkContent";
30
- const LinkContentSchema = z.object({
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: LinkValueContentSchema
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 { FilledLinkValueContentSchema, LinkContentSchema, LinkContentType };
51
+ export { EmptyLinkContentSchema, FilledLinkContentSchema, FilledLinkContentValueSchema, LinkContentSchema, LinkContentType };
49
52
 
50
53
  //# sourceMappingURL=link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","names":[],"sources":["../../src/content/link.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport {\n\tEmptyDocumentLinkValueLegacySchema,\n\tEmptyImageLinkValueLegacySchema,\n\tFilledDocumentLinkValueLegacySchema,\n\tFilledFileLinkValueLegacySchema,\n\tFilledImageLinkValueLegacySchema,\n\tEmptyMediaLinkValueLegacySchema,\n\tFilledExternalLinkValueLegacySchema,\n\tEmptyExternalLinkValueLegacySchema,\n\tAnyLinkLegacySchema,\n\tLinkType,\n\tEmptyFileLinkValueLegacySchema,\n} from \"./legacy/link\"\n\n// Image\nconst FilledImageLinkValueContentSchema = z.extend(FilledImageLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Image),\n})\n\nconst EmptyImageLinkValueContentSchema = z.extend(EmptyImageLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Image),\n})\n\n// File\nconst FilledFileLinkValueContentSchema = z.extend(FilledFileLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.File),\n})\n\nconst EmptyFileLinkValueContentSchema = z.extend(EmptyFileLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.File),\n})\n\n// Media\nconst EmptyMediaLinkValueContentSchema = z.extend(EmptyMediaLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Media),\n})\n\n// Document\nconst FilledDocumentLinkValueContentSchema = z.extend(FilledDocumentLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Document),\n})\n\nconst EmptyDocumentLinkValueContentSchema = z.extend(EmptyDocumentLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Document),\n})\n\n// External\nconst FilledExternalLinkValueContentSchema = z.extend(FilledExternalLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.External),\n})\n\nconst EmptyExternalLinkValueContentSchema = z.extend(EmptyExternalLinkValueLegacySchema, {\n\t__TYPE__: z.literal(LinkType.External),\n})\n\n// Any\nconst AnyLinkValueContentSchema = z.extend(AnyLinkLegacySchema, {\n\t__TYPE__: z.literal(LinkType.Any),\n})\n\n// All\n\n// Used by content/richText\nexport const FilledLinkValueContentSchema: z.ZodMiniType<FilledLinkValueContent> = z.union([\n\tFilledImageLinkValueContentSchema,\n\tFilledFileLinkValueContentSchema,\n\tFilledDocumentLinkValueContentSchema,\n\tFilledExternalLinkValueContentSchema,\n])\n\n// Used by content/legacy/link\ntype FilledImageLinkValueContent = z.infer<typeof FilledImageLinkValueContentSchema>\ntype FilledFileLinkValueContent = z.infer<typeof FilledFileLinkValueContentSchema>\ntype FilledDocumentLinkValueContent = z.infer<typeof FilledDocumentLinkValueContentSchema>\ntype FilledExternalLinkValueContent = z.infer<typeof FilledExternalLinkValueContentSchema>\nexport type FilledLinkValueContent =\n\t| FilledImageLinkValueContent\n\t| FilledFileLinkValueContent\n\t| FilledDocumentLinkValueContent\n\t| FilledExternalLinkValueContent\n\nconst EmptyLinkValueContentSchema: z.ZodMiniType<EmptyLinkValueContent> = z.union([\n\tEmptyImageLinkValueContentSchema,\n\tEmptyFileLinkValueContentSchema,\n\tEmptyMediaLinkValueContentSchema,\n\tEmptyDocumentLinkValueContentSchema,\n\tEmptyExternalLinkValueContentSchema,\n\tAnyLinkValueContentSchema,\n])\n\n// Used by content/codec/link\ntype EmptyImageLinkValueContent = z.infer<typeof EmptyImageLinkValueContentSchema>\ntype EmptyFileLinkValueContent = z.infer<typeof EmptyFileLinkValueContentSchema>\ntype EmptyMediaLinkValueContent = z.infer<typeof EmptyMediaLinkValueContentSchema>\ntype EmptyDocumentLinkValueContent = z.infer<typeof EmptyDocumentLinkValueContentSchema>\ntype EmptyExternalLinkValueContent = z.infer<typeof EmptyExternalLinkValueContentSchema>\ntype AnyLinkValueContent = z.infer<typeof AnyLinkValueContentSchema>\nexport type EmptyLinkValueContent =\n\t| EmptyImageLinkValueContent\n\t| EmptyFileLinkValueContent\n\t| EmptyMediaLinkValueContent\n\t| EmptyDocumentLinkValueContent\n\t| EmptyExternalLinkValueContent\n\t| AnyLinkValueContent\n\nconst LinkValueContentSchema: z.ZodMiniType<LinkValueContent> = z.union([\n\tFilledLinkValueContentSchema,\n\tEmptyLinkValueContentSchema,\n])\n\n// Used by content/codec/link\nexport type LinkValueContent = FilledLinkValueContent | EmptyLinkValueContent\n\n// Content\nexport const LinkContentType = \"LinkContent\" as const\n\nexport const LinkContentSchema = z.object({\n\t__TYPE__: z.literal(LinkContentType),\n\tkey: z.transform((value) => z.uuidv4().safeParse(value).data || crypto.randomUUID()),\n\t// We cannot use z.extend here because we're working with unions.\n\t// z.intersection wouldn't work also for the same reason.\n\tvalue: z.pipe(\n\t\tz.pipe(\n\t\t\tz.pipe(\n\t\t\t\tz.record(z.string(), z.unknown()),\n\t\t\t\tz.transform(\n\t\t\t\t\t({\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\tvariant,\n\t\t\t\t\t\t...value\n\t\t\t\t\t}): {\n\t\t\t\t\t\ttext?: unknown\n\t\t\t\t\t\tvariant?: unknown\n\t\t\t\t\t\tvalue: Record<string, unknown>\n\t\t\t\t\t} => ({ text, variant, value }),\n\t\t\t\t),\n\t\t\t),\n\t\t\tz.object({\n\t\t\t\ttext: z.optional(z.string()),\n\t\t\t\tvariant: z.optional(z.string()),\n\t\t\t\tvalue: LinkValueContentSchema as z.ZodMiniType<LinkValueContent, Record<string, unknown>>,\n\t\t\t}),\n\t\t),\n\t\tz.transform(({ text, variant, value }) => ({\n\t\t\t...(text ? { text } : {}),\n\t\t\t...(variant ? { variant } : {}),\n\t\t\t...value,\n\t\t})),\n\t),\n})\n\nexport type LinkContent = z.infer<typeof LinkContentSchema>\n"],"mappings":";;;AAiBA,MAAM,oCAAoC,EAAE,OAAO,kCAAkC,EACpF,UAAU,EAAE,QAAQ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AAE,KACR,EAAE,KACD,EAAE,KACD,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,EACjC,EAAE,WACA,EACA,MACA,SACA,GAAG,aAKE;EAAE;EAAM;EAAS;EAAO,EAC9B,CACD,EACD,EAAE,OAAO;EACR,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC5B,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC/B,OAAO;EACP,CAAC,CACF,EACD,EAAE,WAAW,EAAE,MAAM,SAAS,aAAa;EAC1C,GAAI,OAAO,EAAE,MAAM,GAAG,EAAE;EACxB,GAAI,UAAU,EAAE,SAAS,GAAG,EAAE;EAC9B,GAAG;EACH,EAAE,CACH;CACD,CAAC"}
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,QAAQ,SAAS,MAAM,EACnC,CAAC;AAGF,MAAM,uCAAuC,EAAE,OAAO,qCAAqC,EAC1F,UAAU,EAAE,QAAQ,SAAS,SAAS,EACtC,CAAC;AAEF,MAAM,sCAAsC,EAAE,OAAO,oCAAoC,EACxF,UAAU,EAAE,QA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,MAAa,oBAAoB,qBAAqB,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"nestable.d.ts","names":[],"sources":["../../src/content/nestable.ts"],"mappings":";;;;;;;;;;;;;;;KAmEY,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"}
1
+ {"version":3,"file":"nestable.d.ts","names":[],"sources":["../../src/content/nestable.ts"],"mappings":";;;;;;;;;;;;;;;KAiEY,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"}
@@ -1,13 +1,13 @@
1
- import { BooleanContentSchema, BooleanContentType } from "./boolean.js";
2
1
  import { EmbedContentSchema, EmbedContentType } from "./embed.js";
2
+ import { ImageContentSchema, ImageContentType } from "./image.js";
3
+ import { LinkContentSchema, LinkContentType } from "./link.js";
4
+ import { RichTextContentSchema, RichTextContentType } from "./richText.js";
5
+ import { BooleanContentSchema, BooleanContentType } from "./boolean.js";
3
6
  import { EmptyContentSchema, EmptyContentType } from "./empty.js";
4
7
  import { ColorContentSchema, DateContentSchema, FieldContentType, NumberContentSchema, RangeContentSchema, SelectContentSchema, TextContentSchema, TimestampContentSchema } from "./field.js";
5
8
  import { GeoPointContentSchema, GeoPointContentType } from "./geopoint.js";
6
- import { ImageContentSchema, ImageContentType } from "./image.js";
7
9
  import { IntegrationFieldContentSchema, IntegrationFieldContentType } from "./integrationField.js";
8
- import { LinkContentSchema, LinkContentType } from "./link.js";
9
10
  import { RepeatableContentSchema, RepeatableContentType } from "./repeatable.js";
10
- import { RichTextContentSchema, RichTextContentType } from "./richText.js";
11
11
  import { SeparatorContentSchema, SeparatorContentType } from "./separator.js";
12
12
  import { TableContentSchema, TableContentType } from "./table.js";
13
13
  import { z } from "zod/mini";
@@ -1 +1 @@
1
- {"version":3,"file":"nestable.js","names":[],"sources":["../../src/content/nestable.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport type { NestableModel } from \"../model/nestable\"\nimport type { BooleanContent } from \"./boolean\"\nimport { BooleanContentDefaultValue, BooleanContentSchema, BooleanContentType } from \"./boolean\"\nimport type { EmbedContent } from \"./embed\"\nimport { EmbedContentSchema, EmbedContentType } from \"./embed\"\nimport type { EmptyContent } from \"./empty\"\nimport { EmptyContentSchema, EmptyContentType } from \"./empty\"\nimport type {\n\tColorContent,\n\tDateContent,\n\tNumberContent,\n\tRangeContent,\n\tSelectContent,\n\tTextContent,\n\tTimestampContent,\n} from \"./field\"\nimport {\n\tColorContentSchema,\n\tDateContentSchema,\n\tFieldContentType,\n\tNumberContentSchema,\n\tRangeContentSchema,\n\tSelectContentDefaultValue,\n\tSelectContentSchema,\n\tTextContentSchema,\n\tTimestampContentSchema,\n} from \"./field\"\nimport type { GeoPointContent } from \"./geopoint\"\nimport { GeoPointContentSchema, GeoPointContentType } from \"./geopoint\"\nimport type { ImageContent } from \"./image\"\nimport { ImageContentSchema, ImageContentType } from \"./image\"\nimport type { IntegrationFieldContent } from \"./integrationField\"\nimport { IntegrationFieldContentSchema, IntegrationFieldContentType } from \"./integrationField\"\nimport type { LinkContent } from \"./link\"\nimport { LinkContentSchema, LinkContentType } from \"./link\"\nimport type { RepeatableContent } from \"./repeatable\"\nimport { RepeatableContentSchema, RepeatableContentType } from \"./repeatable\"\nimport type { RichTextContent } from \"./richText\"\nimport { RichTextContentSchema, RichTextContentType } from \"./richText\"\nimport type { SeparatorContent } from \"./separator\"\nimport { SeparatorContentSchema, SeparatorContentType } from \"./separator\"\nimport type { TableContent } from \"./table\"\nimport { TableContentSchema, TableContentType } from \"./table\"\n\nexport const NestableContentSchema: z.ZodMiniType<NestableContent> = z.union([\n\tEmptyContentSchema,\n\tBooleanContentSchema,\n\tColorContentSchema,\n\tDateContentSchema,\n\tEmbedContentSchema,\n\tGeoPointContentSchema,\n\tImageContentSchema,\n\tIntegrationFieldContentSchema,\n\tLinkContentSchema,\n\tNumberContentSchema,\n\tRangeContentSchema,\n\tRepeatableContentSchema,\n\tRichTextContentSchema,\n\tSelectContentSchema,\n\tSeparatorContentSchema,\n\tTableContentSchema,\n\tTextContentSchema,\n\tTimestampContentSchema,\n])\n\nexport type NestableContent =\n\t| EmptyContent\n\t| BooleanContent\n\t| ColorContent\n\t| DateContent\n\t| EmbedContent\n\t| GeoPointContent\n\t| ImageContent\n\t| IntegrationFieldContent\n\t| LinkContent\n\t| NumberContent\n\t| RangeContent\n\t| RepeatableContent\n\t| RichTextContent\n\t| SelectContent\n\t| SeparatorContent\n\t| TableContent\n\t| TextContent\n\t| TimestampContent\n\nconst NestableContentTypes = [\n\tEmptyContentType,\n\tBooleanContentType,\n\tEmbedContentType,\n\tFieldContentType,\n\tGeoPointContentType,\n\tImageContentType,\n\tIntegrationFieldContentType,\n\tLinkContentType,\n\tRepeatableContentType,\n\tRichTextContentType,\n\tSeparatorContentType,\n\tTableContentType,\n]\ntype NestableContentType = (typeof NestableContentTypes)[number]\n\n/** @internal */\nexport function isNestableContent(content: {\n\t__TYPE__: string\n}): content is { __TYPE__: NestableContentType } {\n\treturn (NestableContentTypes as string[]).includes(content.__TYPE__)\n}\n\n/**\n * Returns the default value for a nestable widget based on its configuration.\n * Currently only Boolean and Select fields have default values.\n */\nexport const NestableContentDefaultValue = (\n\twidgetDef: NestableModel,\n): NestableContent | undefined => {\n\tswitch (widgetDef.type) {\n\t\tcase \"Boolean\":\n\t\t\treturn BooleanContentDefaultValue(widgetDef)\n\t\tcase \"Select\":\n\t\t\treturn SelectContentDefaultValue(widgetDef)\n\t\tdefault:\n\t\t\treturn undefined\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AA8CA,MAAa,wBAAwD,EAAE,MAAM;CAC5E;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAC;AAsBF,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAID,SAAgB,kBAAkB,SAEe;AAChD,QAAQ,qBAAkC,SAAS,QAAQ,SAAS"}
1
+ {"version":3,"file":"nestable.js","names":[],"sources":["../../src/content/nestable.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport type { BooleanContent } from \"./boolean\"\nimport { BooleanContentSchema, BooleanContentType } from \"./boolean\"\nimport type { EmbedContent } from \"./embed\"\nimport { EmbedContentSchema, EmbedContentType } from \"./embed\"\nimport type { EmptyContent } from \"./empty\"\nimport { EmptyContentSchema, EmptyContentType } from \"./empty\"\nimport type {\n\tColorContent,\n\tDateContent,\n\tNumberContent,\n\tRangeContent,\n\tSelectContent,\n\tTextContent,\n\tTimestampContent,\n} from \"./field\"\nimport {\n\tColorContentSchema,\n\tDateContentSchema,\n\tFieldContentType,\n\tNumberContentSchema,\n\tRangeContentSchema,\n\tSelectContentSchema,\n\tTextContentSchema,\n\tTimestampContentSchema,\n} from \"./field\"\nimport type { GeoPointContent } from \"./geopoint\"\nimport { GeoPointContentSchema, GeoPointContentType } from \"./geopoint\"\nimport type { ImageContent } from \"./image\"\nimport { ImageContentSchema, ImageContentType } from \"./image\"\nimport type { IntegrationFieldContent } from \"./integrationField\"\nimport { IntegrationFieldContentSchema, IntegrationFieldContentType } from \"./integrationField\"\nimport type { LinkContent } from \"./link\"\nimport { LinkContentSchema, LinkContentType } from \"./link\"\nimport type { RepeatableContent } from \"./repeatable\"\nimport { RepeatableContentSchema, RepeatableContentType } from \"./repeatable\"\nimport type { RichTextContent } from \"./richText\"\nimport { RichTextContentSchema, RichTextContentType } from \"./richText\"\nimport type { SeparatorContent } from \"./separator\"\nimport { SeparatorContentSchema, SeparatorContentType } from \"./separator\"\nimport type { TableContent } from \"./table\"\nimport { TableContentSchema, TableContentType } from \"./table\"\n\nexport const NestableContentSchema: z.ZodMiniType<NestableContent> = z.union([\n\tEmptyContentSchema,\n\tBooleanContentSchema,\n\tColorContentSchema,\n\tDateContentSchema,\n\tEmbedContentSchema,\n\tGeoPointContentSchema,\n\tImageContentSchema,\n\tIntegrationFieldContentSchema,\n\tLinkContentSchema,\n\tNumberContentSchema,\n\tRangeContentSchema,\n\tRepeatableContentSchema,\n\tRichTextContentSchema,\n\tSelectContentSchema,\n\tSeparatorContentSchema,\n\tTableContentSchema,\n\tTextContentSchema,\n\tTimestampContentSchema,\n])\n\nexport type NestableContent =\n\t| EmptyContent\n\t| BooleanContent\n\t| ColorContent\n\t| DateContent\n\t| EmbedContent\n\t| GeoPointContent\n\t| ImageContent\n\t| IntegrationFieldContent\n\t| LinkContent\n\t| NumberContent\n\t| RangeContent\n\t| RepeatableContent\n\t| RichTextContent\n\t| SelectContent\n\t| SeparatorContent\n\t| TableContent\n\t| TextContent\n\t| TimestampContent\n\nconst NestableContentTypes = [\n\tEmptyContentType,\n\tBooleanContentType,\n\tEmbedContentType,\n\tFieldContentType,\n\tGeoPointContentType,\n\tImageContentType,\n\tIntegrationFieldContentType,\n\tLinkContentType,\n\tRepeatableContentType,\n\tRichTextContentType,\n\tSeparatorContentType,\n\tTableContentType,\n]\ntype NestableContentType = (typeof NestableContentTypes)[number]\n\n/** @internal */\nexport function isNestableContent(content: {\n\t__TYPE__: string\n}): content is { __TYPE__: NestableContentType } {\n\treturn (NestableContentTypes as string[]).includes(content.__TYPE__)\n}\n"],"mappings":";;;;;;;;;;;;;;AA4CA,MAAa,wBAAwD,EAAE,MAAM;CAC5E;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAC;AAsBF,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAID,SAAgB,kBAAkB,SAEe;AAChD,QAAQ,qBAAkC,SAAS,QAAQ,SAAS"}
@@ -1,4 +1,4 @@
1
- import { LinkValueContent } from "./link.js";
1
+ import { LinkContentValue } from "./link.js";
2
2
  import { z } from "zod/mini";
3
3
 
4
4
  //#region src/content/repeatable.d.ts
@@ -15,77 +15,12 @@ declare const RepeatableContentSchema: z.ZodMiniObject<{
15
15
  }, Record<string, unknown>>>, z.ZodMiniObject<{
16
16
  text: z.ZodMiniOptional<z.ZodMiniString<string>>;
17
17
  variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
18
- value: z.ZodMiniType<LinkValueContent, Record<string, unknown>>;
18
+ value: z.ZodMiniType<LinkContentValue, Record<string, unknown>, z.core.$ZodTypeInternals<LinkContentValue, Record<string, unknown>>>;
19
19
  }, z.core.$strip>>, z.ZodMiniTransform<{
20
- kind: "image";
21
- id: string;
22
- url: string;
23
- height: string;
24
- width: string;
25
- size: string;
26
- name: string;
27
- __TYPE__: "ImageLink";
28
- date?: string | null | undefined;
29
20
  variant?: string | undefined;
30
21
  text?: string | undefined;
31
- } | {
32
- kind: "file";
33
- id: string;
34
- url: string;
35
- name: string;
36
- size: string;
37
- __TYPE__: "FileLink";
38
- date?: string | null | undefined;
39
- variant?: string | undefined;
40
- text?: string | undefined;
41
- } | {
42
- kind: "document";
43
- id: string;
44
- __TYPE__: "DocumentLink";
45
- variant?: string | undefined;
46
- text?: string | undefined;
47
- } | {
48
- kind: "web";
49
- url: string;
50
- __TYPE__: "ExternalLink";
51
- target?: string | null | undefined;
52
- preview?: {
53
- title?: string | undefined;
54
- } | null | undefined;
55
- variant?: string | undefined;
56
- text?: string | undefined;
57
- } | {
58
- kind: "image";
59
- __TYPE__: "ImageLink";
60
- variant?: string | undefined;
61
- text?: string | undefined;
62
- } | {
63
- kind: "file";
64
- __TYPE__: "FileLink";
65
- variant?: string | undefined;
66
- text?: string | undefined;
67
- } | {
68
- kind: "media";
69
- __TYPE__: "MediaLink";
70
- variant?: string | undefined;
71
- text?: string | undefined;
72
- } | {
73
- kind: "document";
74
- __TYPE__: "DocumentLink";
75
- variant?: string | undefined;
76
- text?: string | undefined;
77
- } | {
78
- kind: "web";
79
- __TYPE__: "ExternalLink";
80
- variant?: string | undefined;
81
- text?: string | undefined;
82
- } | {
83
- kind: "any";
84
- __TYPE__: "AnyLink";
85
- variant?: string | undefined;
86
- text?: string | undefined;
87
- }, {
88
- value: LinkValueContent;
22
+ } & LinkContentValue, {
23
+ value: LinkContentValue;
89
24
  text?: string | undefined;
90
25
  variant?: string | undefined;
91
26
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"repeatable.d.ts","names":[],"sources":["../../src/content/repeatable.ts"],"mappings":";;;;cAMa,uBAAA,EAAuB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA"}
1
+ {"version":3,"file":"repeatable.d.ts","names":[],"sources":["../../src/content/repeatable.ts"],"mappings":";;;;cAMa,uBAAA,EAAuB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;KAMxB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,uBAAA"}
@@ -1,10 +1,10 @@
1
- import { FilledLinkValueContent } from "./link.js";
2
- import { Span } from "./legacy/richText.js";
1
+ import { FilledLinkContentValue } from "./link.js";
2
+ import { RichTextNodeType, RichTextNodeTypes, Span } from "./legacy/richText.js";
3
3
  import { z } from "zod/mini";
4
4
 
5
5
  //#region src/content/richText.d.ts
6
- type RichTextContentSpan = Span<FilledLinkValueContent>;
7
- declare const TextBlockValueSchema: z.ZodMiniObject<{
6
+ type RichTextContentSpan = Span<FilledLinkContentValue>;
7
+ declare const RichTextContentTextBlockSchema: z.ZodMiniObject<{
8
8
  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">]>;
9
9
  content: z.ZodMiniObject<{
10
10
  text: z.ZodMiniString<string>;
@@ -21,14 +21,14 @@ declare const TextBlockValueSchema: z.ZodMiniObject<{
21
21
  type: "hyperlink";
22
22
  start: number;
23
23
  end: number;
24
- data: FilledLinkValueContent;
24
+ data: FilledLinkContentValue;
25
25
  })[], unknown[]>>>;
26
26
  }, z.core.$strip>;
27
27
  label: z.ZodMiniOptional<z.ZodMiniString<string>>;
28
28
  direction: z.ZodMiniOptional<z.ZodMiniString<string>>;
29
29
  }, z.core.$strip>;
30
- type TextBlockValue = z.infer<typeof TextBlockValueSchema>;
31
- declare const ImageBlockValueSchema: z.ZodMiniObject<{
30
+ type RichTextContentTextBlock = z.infer<typeof RichTextContentTextBlockSchema>;
31
+ declare const RichTextContentImageBlockSchema: z.ZodMiniObject<{
32
32
  type: z.ZodMiniLiteral<"image">;
33
33
  data: z.ZodMiniObject<{
34
34
  origin: z.ZodMiniObject<{
@@ -51,13 +51,13 @@ declare const ImageBlockValueSchema: z.ZodMiniObject<{
51
51
  credits: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>, z.ZodMiniTransform<string | null, string | null | undefined>>>;
52
52
  alt: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>, z.ZodMiniTransform<string | null, string | null | undefined>>>;
53
53
  provider: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
54
- linkTo: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniType<FilledLinkValueContent, unknown, z.core.$ZodTypeInternals<FilledLinkValueContent, unknown>>>>;
54
+ linkTo: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniType<FilledLinkContentValue, unknown, z.core.$ZodTypeInternals<FilledLinkContentValue, unknown>>>>;
55
55
  }, z.core.$strip>;
56
56
  label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
57
57
  direction: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
58
58
  }, z.core.$strip>;
59
- type ImageBlockValue = z.infer<typeof ImageBlockValueSchema>;
60
- declare const EmbedBlockValueSchema: z.ZodMiniObject<{
59
+ type RichTextContentImageBlock = z.infer<typeof RichTextContentImageBlockSchema>;
60
+ declare const RichTextContentEmbedBlockSchema: z.ZodMiniObject<{
61
61
  type: z.ZodMiniLiteral<"embed">;
62
62
  data: z.ZodMiniObject<{
63
63
  embed_url: z.ZodMiniString<string>;
@@ -79,13 +79,13 @@ declare const EmbedBlockValueSchema: z.ZodMiniObject<{
79
79
  label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
80
80
  direction: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
81
81
  }, z.core.$strip>;
82
- type EmbedBlockValue = z.infer<typeof EmbedBlockValueSchema>;
83
- type RichTextContentBlock = TextBlockValue | ImageBlockValue | EmbedBlockValue;
82
+ type RichTextContentEmbedBlock = z.infer<typeof RichTextContentEmbedBlockSchema>;
83
+ type RichTextContentBlock = RichTextContentTextBlock | RichTextContentImageBlock | RichTextContentEmbedBlock;
84
84
  declare const RichTextContentType: "StructuredTextContent";
85
85
  type RichTextContent = {
86
86
  __TYPE__: typeof RichTextContentType;
87
87
  value: RichTextContentBlock[];
88
88
  };
89
89
  //#endregion
90
- export { RichTextContent, RichTextContentBlock, RichTextContentSpan };
90
+ export { RichTextContent, RichTextContentBlock, RichTextContentEmbedBlock, RichTextContentImageBlock, RichTextContentSpan, RichTextContentTextBlock };
91
91
  //# sourceMappingURL=richText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"richText.d.ts","names":[],"sources":["../../src/content/richText.ts"],"mappings":";;;;;KAeY,mBAAA,GAAsB,IAAA,CAAK,sBAAA;AAAA,cAOjC,oBAAA,EAAoB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;KACrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,qBAAA,EAAqB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAItB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEhC,qBAAA,EAAqB,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;KACtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,KAS1B,oBAAA,GAAuB,cAAA,GAAiB,eAAA,GAAkB,eAAA;AAAA,cAEzD,mBAAA;AAAA,KAED,eAAA;EACX,QAAA,SAAiB,mBAAA;EACjB,KAAA,EAAO,oBAAA;AAAA"}
1
+ {"version":3,"file":"richText.d.ts","names":[],"sources":["../../src/content/richText.ts"],"mappings":";;;;;KAkBY,mBAAA,GAAsB,IAAA,CAAK,sBAAA;AAAA,cAOjC,8BAAA,EAA8B,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;KACxB,wBAAA,GAA2B,CAAA,CAAE,KAAA,QAAa,8BAAA;AAAA,cAEhD,+BAAA,EAA+B,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIzB,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,+BAAA;AAAA,cAEjD,+BAAA,EAA+B,CAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;KACzB,yBAAA,GAA4B,CAAA,CAAE,KAAA,QAAa,+BAAA;AAAA,KAS3C,oBAAA,GACT,wBAAA,GACA,yBAAA,GACA,yBAAA;AAAA,cAEU,mBAAA;AAAA,KAED,eAAA;EACX,QAAA,SAAiB,mBAAA;EACjB,KAAA,EAAO,oBAAA;AAAA"}
@@ -1,17 +1,17 @@
1
1
  import { EmbedContentSchema } from "./embed.js";
2
- import { ImageViewContentSchema } from "./image.js";
3
- import { FilledLinkValueContentSchema } from "./link.js";
2
+ import { ImageContentViewSchema } from "./image.js";
4
3
  import { getEmbedBlockSchema, getImageBlockSchema, getSpanSchema, getTextBlockSchema } from "./legacy/richText.js";
4
+ import { FilledLinkContentValueSchema } from "./link.js";
5
5
  import { z } from "zod/mini";
6
6
  //#region src/content/richText.ts
7
- const RichTextContentSpanSchema = getSpanSchema(FilledLinkValueContentSchema);
8
- const TextBlockValueSchema = getTextBlockSchema(FilledLinkValueContentSchema);
9
- const ImageBlockValueSchema = getImageBlockSchema(ImageViewContentSchema, FilledLinkValueContentSchema);
10
- const EmbedBlockValueSchema = getEmbedBlockSchema(EmbedContentSchema);
7
+ const RichTextContentSpanSchema = getSpanSchema(FilledLinkContentValueSchema);
8
+ const RichTextContentTextBlockSchema = getTextBlockSchema(FilledLinkContentValueSchema);
9
+ const RichTextContentImageBlockSchema = getImageBlockSchema(ImageContentViewSchema, FilledLinkContentValueSchema);
10
+ const RichTextContentEmbedBlockSchema = getEmbedBlockSchema(EmbedContentSchema);
11
11
  const RichTextContentBlockSchema = z.union([
12
- TextBlockValueSchema,
13
- ImageBlockValueSchema,
14
- EmbedBlockValueSchema
12
+ RichTextContentTextBlockSchema,
13
+ RichTextContentImageBlockSchema,
14
+ RichTextContentEmbedBlockSchema
15
15
  ]);
16
16
  const RichTextContentType = "StructuredTextContent";
17
17
  const RichTextContentSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"richText.js","names":[],"sources":["../../src/content/richText.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { EmbedContentSchema } from \"./embed\"\nimport { ImageViewContentSchema } from \"./image\"\nimport {\n\tgetEmbedBlockSchema,\n\tgetImageBlockSchema,\n\tgetSpanSchema,\n\tgetTextBlockSchema,\n} from \"./legacy/richText\"\nimport type { Span } from \"./legacy/richText\"\nimport type { FilledLinkValueContent } from \"./link\"\nimport { FilledLinkValueContentSchema } from \"./link\"\n\n// Spans\nexport type RichTextContentSpan = Span<FilledLinkValueContent>\n\nexport const RichTextContentSpanSchema: z.ZodMiniType<RichTextContentSpan> = getSpanSchema(\n\tFilledLinkValueContentSchema,\n)\n\n// Blocks\nconst TextBlockValueSchema = getTextBlockSchema(FilledLinkValueContentSchema)\ntype TextBlockValue = z.infer<typeof TextBlockValueSchema>\n\nconst ImageBlockValueSchema = getImageBlockSchema(\n\tImageViewContentSchema,\n\tFilledLinkValueContentSchema,\n)\ntype ImageBlockValue = z.infer<typeof ImageBlockValueSchema>\n\nconst EmbedBlockValueSchema = getEmbedBlockSchema(EmbedContentSchema)\ntype EmbedBlockValue = z.infer<typeof EmbedBlockValueSchema>\n\nexport const RichTextContentBlockSchema: z.ZodMiniType<RichTextContentBlock> = z.union([\n\tTextBlockValueSchema,\n\tImageBlockValueSchema,\n\tEmbedBlockValueSchema,\n])\n\n// Used by content/codec/richText\nexport type RichTextContentBlock = TextBlockValue | ImageBlockValue | EmbedBlockValue\n\nexport const RichTextContentType = \"StructuredTextContent\" as const\n\nexport type RichTextContent = {\n\t__TYPE__: typeof RichTextContentType\n\tvalue: RichTextContentBlock[]\n}\n\nexport const RichTextContentSchema: z.ZodMiniType<RichTextContent> = z.object({\n\t__TYPE__: z.literal(RichTextContentType),\n\tvalue: z.array(RichTextContentBlockSchema),\n})\n"],"mappings":";;;;;;AAiBA,MAAa,4BAAgE,cAC5E,6BACA;AAGD,MAAM,uBAAuB,mBAAmB,6BAA6B;AAG7E,MAAM,wBAAwB,oBAC7B,wBACA,6BACA;AAGD,MAAM,wBAAwB,oBAAoB,mBAAmB;AAGrE,MAAa,6BAAkE,EAAE,MAAM;CACtF;CACA;CACA;CACA,CAAC;AAKF,MAAa,sBAAsB;AAOnC,MAAa,wBAAwD,EAAE,OAAO;CAC7E,UAAU,EAAE,QAAQ,oBAAoB;CACxC,OAAO,EAAE,MAAM,2BAA2B;CAC1C,CAAC"}
1
+ {"version":3,"file":"richText.js","names":[],"sources":["../../src/content/richText.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { EmbedContentSchema } from \"./embed\"\nimport { ImageContentViewSchema } from \"./image\"\nimport {\n\tgetEmbedBlockSchema,\n\tgetImageBlockSchema,\n\tgetSpanSchema,\n\tgetTextBlockSchema,\n} from \"./legacy/richText\"\nimport type { Span } from \"./legacy/richText\"\nimport type { FilledLinkContentValue } from \"./link\"\nimport { FilledLinkContentValueSchema } from \"./link\"\n\nexport { RichTextNodeType } from \"./legacy/richText\"\nexport type { RichTextNodeTypes } from \"./legacy/richText\"\n\n// Spans\nexport type RichTextContentSpan = Span<FilledLinkContentValue>\n\nexport const RichTextContentSpanSchema: z.ZodMiniType<RichTextContentSpan> = getSpanSchema(\n\tFilledLinkContentValueSchema,\n)\n\n// Blocks\nconst RichTextContentTextBlockSchema = getTextBlockSchema(FilledLinkContentValueSchema)\nexport type RichTextContentTextBlock = z.infer<typeof RichTextContentTextBlockSchema>\n\nconst RichTextContentImageBlockSchema = getImageBlockSchema(\n\tImageContentViewSchema,\n\tFilledLinkContentValueSchema,\n)\nexport type RichTextContentImageBlock = z.infer<typeof RichTextContentImageBlockSchema>\n\nconst RichTextContentEmbedBlockSchema = getEmbedBlockSchema(EmbedContentSchema)\nexport type RichTextContentEmbedBlock = z.infer<typeof RichTextContentEmbedBlockSchema>\n\nexport const RichTextContentBlockSchema: z.ZodMiniType<RichTextContentBlock> = z.union([\n\tRichTextContentTextBlockSchema,\n\tRichTextContentImageBlockSchema,\n\tRichTextContentEmbedBlockSchema,\n])\n\n// Used by content/codec/richText\nexport type RichTextContentBlock =\n\t| RichTextContentTextBlock\n\t| RichTextContentImageBlock\n\t| RichTextContentEmbedBlock\n\nexport const RichTextContentType = \"StructuredTextContent\" as const\n\nexport type RichTextContent = {\n\t__TYPE__: typeof RichTextContentType\n\tvalue: RichTextContentBlock[]\n}\n\nexport const RichTextContentSchema: z.ZodMiniType<RichTextContent> = z.object({\n\t__TYPE__: z.literal(RichTextContentType),\n\tvalue: z.array(RichTextContentBlockSchema),\n})\n"],"mappings":";;;;;;AAoBA,MAAa,4BAAgE,cAC5E,6BACA;AAGD,MAAM,iCAAiC,mBAAmB,6BAA6B;AAGvF,MAAM,kCAAkC,oBACvC,wBACA,6BACA;AAGD,MAAM,kCAAkC,oBAAoB,mBAAmB;AAG/E,MAAa,6BAAkE,EAAE,MAAM;CACtF;CACA;CACA;CACA,CAAC;AAQF,MAAa,sBAAsB;AAOnC,MAAa,wBAAwD,EAAE,OAAO;CAC7E,UAAU,EAAE,QAAQ,oBAAoB;CACxC,OAAO,EAAE,MAAM,2BAA2B;CAC1C,CAAC"}