@prismicio/types-internal 4.6.0-pr.25.41a8b18 → 4.6.0-pr.26.1d3a478
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/asset.d.ts +1 -2
- package/dist/common/asset.d.ts.map +1 -1
- package/dist/common/asset.js.map +1 -1
- package/dist/common/embed.d.ts +1 -2
- package/dist/common/embed.d.ts.map +1 -1
- package/dist/common/embed.js.map +1 -1
- package/dist/common/hexaColorCode.d.ts +1 -2
- package/dist/common/hexaColorCode.d.ts.map +1 -1
- package/dist/common/hexaColorCode.js.map +1 -1
- package/dist/common/nonEmptyString.d.ts +1 -2
- package/dist/common/nonEmptyString.d.ts.map +1 -1
- package/dist/common/nonEmptyString.js.map +1 -1
- package/dist/common/widgetKey.d.ts +1 -2
- package/dist/common/widgetKey.d.ts.map +1 -1
- package/dist/common/widgetKey.js.map +1 -1
- package/dist/content/boolean.d.ts +1 -2
- package/dist/content/boolean.d.ts.map +1 -1
- package/dist/content/boolean.js.map +1 -1
- package/dist/content/codec/boolean.js.map +1 -1
- package/dist/content/codec/document.js.map +1 -1
- package/dist/content/codec/embed.js.map +1 -1
- package/dist/content/codec/empty.js.map +1 -1
- package/dist/content/codec/field.js.map +1 -1
- package/dist/content/codec/geopoint.js.map +1 -1
- package/dist/content/codec/group.js +6 -4
- package/dist/content/codec/group.js.map +1 -1
- package/dist/content/codec/image.js.map +1 -1
- package/dist/content/codec/integrationField.js.map +1 -1
- package/dist/content/codec/legacyContentCtx.d.ts +2 -15
- package/dist/content/codec/legacyContentCtx.d.ts.map +1 -1
- package/dist/content/codec/legacyContentCtx.js.map +1 -1
- package/dist/content/codec/link.js.map +1 -1
- package/dist/content/codec/nestable.js.map +1 -1
- package/dist/content/codec/repeatable.js.map +1 -1
- package/dist/content/codec/richText.js.map +1 -1
- package/dist/content/codec/separator.js.map +1 -1
- package/dist/content/codec/slice.js.map +1 -1
- package/dist/content/codec/slices.js.map +1 -1
- package/dist/content/codec/table.js.map +1 -1
- package/dist/content/codec/uid.js.map +1 -1
- package/dist/content/codec/widget.js.map +1 -1
- package/dist/content/document.d.ts +1 -2
- package/dist/content/document.d.ts.map +1 -1
- package/dist/content/document.js.map +1 -1
- package/dist/content/embed.d.ts +1 -2
- package/dist/content/embed.d.ts.map +1 -1
- package/dist/content/embed.js.map +1 -1
- package/dist/content/empty.d.ts +1 -2
- package/dist/content/empty.d.ts.map +1 -1
- package/dist/content/empty.js.map +1 -1
- package/dist/content/field.d.ts +1 -2
- package/dist/content/field.d.ts.map +1 -1
- package/dist/content/field.js.map +1 -1
- package/dist/content/geopoint.d.ts +1 -2
- package/dist/content/geopoint.d.ts.map +1 -1
- package/dist/content/geopoint.js.map +1 -1
- package/dist/content/group.d.ts +3 -2
- package/dist/content/group.d.ts.map +1 -1
- package/dist/content/group.js.map +1 -1
- package/dist/content/image.d.ts +1 -2
- package/dist/content/image.d.ts.map +1 -1
- package/dist/content/image.js.map +1 -1
- package/dist/content/integrationField.d.ts +1 -2
- package/dist/content/integrationField.d.ts.map +1 -1
- package/dist/content/integrationField.js.map +1 -1
- package/dist/content/legacy/boolean.js.map +1 -1
- package/dist/content/legacy/document.d.ts +1 -2
- package/dist/content/legacy/document.d.ts.map +1 -1
- package/dist/content/legacy/document.js.map +1 -1
- package/dist/content/legacy/embed.js.map +1 -1
- package/dist/content/legacy/empty.js.map +1 -1
- package/dist/content/legacy/field.js.map +1 -1
- package/dist/content/legacy/geopoint.js.map +1 -1
- package/dist/content/legacy/group.d.ts +2 -2
- package/dist/content/legacy/group.d.ts.map +1 -1
- package/dist/content/legacy/group.js.map +1 -1
- package/dist/content/legacy/image.d.ts +0 -1
- package/dist/content/legacy/image.d.ts.map +1 -1
- package/dist/content/legacy/image.js.map +1 -1
- package/dist/content/legacy/integrationField.js.map +1 -1
- package/dist/content/legacy/link.d.ts +1 -2
- package/dist/content/legacy/link.d.ts.map +1 -1
- package/dist/content/legacy/link.js.map +1 -1
- package/dist/content/legacy/nestable.d.ts +12 -0
- package/dist/content/legacy/nestable.js.map +1 -1
- package/dist/content/legacy/repeatable.js.map +1 -1
- package/dist/content/legacy/richText.d.ts +5 -2
- package/dist/content/legacy/richText.d.ts.map +1 -1
- package/dist/content/legacy/richText.js.map +1 -1
- package/dist/content/legacy/separator.js.map +1 -1
- package/dist/content/legacy/slice.js +1 -1
- package/dist/content/legacy/slice.js.map +1 -1
- package/dist/content/legacy/slices.js.map +1 -1
- package/dist/content/legacy/table.d.ts +2 -0
- package/dist/content/legacy/table.js.map +1 -1
- package/dist/content/legacy/uid.js.map +1 -1
- package/dist/content/link.d.ts +7 -8
- package/dist/content/link.d.ts.map +1 -1
- package/dist/content/link.js.map +1 -1
- package/dist/content/nestable.d.ts +0 -1
- package/dist/content/nestable.d.ts.map +1 -1
- package/dist/content/nestable.js.map +1 -1
- package/dist/content/repeatable.d.ts +3 -4
- package/dist/content/repeatable.d.ts.map +1 -1
- package/dist/content/repeatable.js.map +1 -1
- package/dist/content/richText.d.ts +2 -3
- package/dist/content/richText.d.ts.map +1 -1
- package/dist/content/richText.js +2 -2
- package/dist/content/richText.js.map +1 -1
- package/dist/content/separator.d.ts +1 -2
- package/dist/content/separator.d.ts.map +1 -1
- package/dist/content/separator.js.map +1 -1
- package/dist/content/slice.d.ts +13 -14
- package/dist/content/slice.d.ts.map +1 -1
- package/dist/content/slice.js.map +1 -1
- package/dist/content/slices.d.ts +13 -14
- package/dist/content/slices.d.ts.map +1 -1
- package/dist/content/slices.js.map +1 -1
- package/dist/content/table.d.ts +1 -2
- package/dist/content/table.d.ts.map +1 -1
- package/dist/content/table.js.map +1 -1
- package/dist/content/uid.d.ts +1 -2
- package/dist/content/uid.d.ts.map +1 -1
- package/dist/content/uid.js.map +1 -1
- package/dist/content/widget.d.ts +0 -1
- package/dist/content/widget.d.ts.map +1 -1
- package/dist/content/widget.js.map +1 -1
- package/dist/helpers/contentPath.d.ts +1 -1
- package/dist/helpers/contentPath.d.ts.map +1 -1
- package/dist/helpers/contentPath.js +1 -1
- package/dist/helpers/contentPath.js.map +1 -1
- package/dist/helpers/customTypeModel.d.ts +1 -3
- package/dist/helpers/customTypeModel.d.ts.map +1 -1
- package/dist/helpers/customTypeModel.js +1 -1
- package/dist/helpers/customTypeModel.js.map +1 -1
- package/dist/helpers/documentContent.d.ts +1 -3
- package/dist/helpers/documentContent.d.ts.map +1 -1
- package/dist/helpers/documentContent.js +1 -1
- package/dist/helpers/documentContent.js.map +1 -1
- package/dist/helpers/fieldModel.d.ts +1 -1
- package/dist/helpers/fieldModel.d.ts.map +1 -1
- package/dist/helpers/fieldModel.js +1 -1
- package/dist/helpers/fieldModel.js.map +1 -1
- package/dist/helpers/imageContent.d.ts +2 -6
- package/dist/helpers/imageContent.d.ts.map +1 -1
- package/dist/helpers/imageContent.js +1 -1
- package/dist/helpers/imageContent.js.map +1 -1
- package/dist/helpers/repository.d.ts +1 -1
- package/dist/helpers/repository.d.ts.map +1 -1
- package/dist/helpers/repository.js +1 -1
- package/dist/helpers/repository.js.map +1 -1
- package/dist/helpers/sliceContent.d.ts +1 -3
- package/dist/helpers/sliceContent.d.ts.map +1 -1
- package/dist/helpers/sliceContent.js.map +1 -1
- package/dist/helpers/sliceModel.d.ts +1 -1
- package/dist/helpers/sliceModel.d.ts.map +1 -1
- package/dist/helpers/sliceModel.js +1 -1
- package/dist/helpers/sliceModel.js.map +1 -1
- package/dist/helpers/traverseContent.d.ts +0 -1
- package/dist/helpers/traverseContent.d.ts.map +1 -1
- package/dist/helpers/traverseContent.js.map +1 -1
- package/dist/helpers/traverseContentWithModel.d.ts +0 -1
- package/dist/helpers/traverseContentWithModel.d.ts.map +1 -1
- package/dist/helpers/traverseContentWithModel.js.map +1 -1
- package/dist/helpers/withDefaultContent.d.ts +1 -3
- package/dist/helpers/withDefaultContent.d.ts.map +1 -1
- package/dist/helpers/withDefaultContent.js +1 -1
- package/dist/helpers/withDefaultContent.js.map +1 -1
- package/dist/io-ts.d.ts +1203 -1209
- package/dist/io-ts.d.ts.map +1 -1
- package/dist/io-ts.js.map +1 -1
- package/dist/model/boolean.d.ts +1 -2
- package/dist/model/boolean.d.ts.map +1 -1
- package/dist/model/boolean.js.map +1 -1
- package/dist/model/color.d.ts +1 -2
- package/dist/model/color.d.ts.map +1 -1
- package/dist/model/color.js.map +1 -1
- package/dist/model/customType.d.ts +3 -4
- package/dist/model/customType.d.ts.map +1 -1
- package/dist/model/customType.js +1 -1
- package/dist/model/customType.js.map +1 -1
- package/dist/model/date.d.ts +1 -2
- package/dist/model/date.d.ts.map +1 -1
- package/dist/model/date.js.map +1 -1
- package/dist/model/embed.d.ts +1 -2
- package/dist/model/embed.d.ts.map +1 -1
- package/dist/model/embed.js.map +1 -1
- package/dist/model/geopoint.d.ts +1 -2
- package/dist/model/geopoint.d.ts.map +1 -1
- package/dist/model/geopoint.js.map +1 -1
- package/dist/model/group.d.ts +39 -40
- package/dist/model/group.d.ts.map +1 -1
- package/dist/model/group.js +1 -1
- package/dist/model/group.js.map +1 -1
- package/dist/model/image.d.ts +1 -2
- package/dist/model/image.d.ts.map +1 -1
- package/dist/model/image.js +1 -1
- package/dist/model/image.js.map +1 -1
- package/dist/model/integrationField.d.ts +1 -2
- package/dist/model/integrationField.d.ts.map +1 -1
- package/dist/model/integrationField.js.map +1 -1
- package/dist/model/link.d.ts +2 -3
- package/dist/model/link.d.ts.map +1 -1
- package/dist/model/link.js.map +1 -1
- package/dist/model/nestable.d.ts +0 -1
- package/dist/model/nestable.d.ts.map +1 -1
- package/dist/model/nestable.js.map +1 -1
- package/dist/model/number.d.ts +1 -2
- package/dist/model/number.d.ts.map +1 -1
- package/dist/model/number.js.map +1 -1
- package/dist/model/range.d.ts +1 -2
- package/dist/model/range.d.ts.map +1 -1
- package/dist/model/range.js.map +1 -1
- package/dist/model/richText.d.ts +1 -2
- package/dist/model/richText.d.ts.map +1 -1
- package/dist/model/richText.js +1 -1
- package/dist/model/richText.js.map +1 -1
- package/dist/model/select.d.ts +1 -2
- package/dist/model/select.d.ts.map +1 -1
- package/dist/model/select.js.map +1 -1
- package/dist/model/separator.d.ts +1 -2
- package/dist/model/separator.d.ts.map +1 -1
- package/dist/model/separator.js.map +1 -1
- package/dist/model/slice.d.ts +44 -45
- package/dist/model/slice.d.ts.map +1 -1
- package/dist/model/slice.js +1 -1
- package/dist/model/slice.js.map +1 -1
- package/dist/model/slices.d.ts +1 -2
- package/dist/model/slices.d.ts.map +1 -1
- package/dist/model/slices.js +1 -1
- package/dist/model/slices.js.map +1 -1
- package/dist/model/table.d.ts +3 -3
- package/dist/model/table.d.ts.map +1 -1
- package/dist/model/table.js.map +1 -1
- package/dist/model/text.d.ts +1 -2
- package/dist/model/text.d.ts.map +1 -1
- package/dist/model/text.js.map +1 -1
- package/dist/model/timestamp.d.ts +1 -2
- package/dist/model/timestamp.d.ts.map +1 -1
- package/dist/model/timestamp.js.map +1 -1
- package/dist/model/uid.d.ts +1 -2
- package/dist/model/uid.d.ts.map +1 -1
- package/dist/model/uid.js.map +1 -1
- package/dist/model/widget.d.ts +25 -26
- package/dist/model/widget.d.ts.map +1 -1
- package/dist/model/widget.js +1 -1
- package/dist/model/widget.js.map +1 -1
- package/dist/zod4.d.ts +3351 -3353
- package/dist/zod4.d.ts.map +1 -1
- package/dist/zod4.js.map +1 -1
- package/package.json +12 -13
- package/src/helpers/customTypeModel.ts +3 -1
- package/src/model/image.ts +4 -1
package/dist/common/asset.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/common/asset.d.ts
|
|
4
3
|
declare const AssetSchema: z.ZodMiniObject<{
|
|
5
4
|
id: z.ZodMiniString<string>;
|
|
@@ -18,5 +17,5 @@ declare const AssetSchema: z.ZodMiniObject<{
|
|
|
18
17
|
}, z.core.$strict>;
|
|
19
18
|
type Asset = z.infer<typeof AssetSchema>;
|
|
20
19
|
//#endregion
|
|
21
|
-
export { Asset };
|
|
20
|
+
export { Asset, AssetSchema };
|
|
22
21
|
//# sourceMappingURL=asset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","names":[],"sources":["../../src/common/asset.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"asset.d.ts","names":[],"sources":["../../src/common/asset.ts"],"mappings":";;cAEa,aAAW,EAAA;;;;;;;;;;;;;;;KAgBZ,QAAQ,EAAE,aAAa"}
|
package/dist/common/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","names":[],"sources":["../../src/common/asset.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const AssetSchema = z.strictObject({\n\tid: z.string(),\n\tlast_modified: z.string(),\n\tkind: z.union([z.literal(\"image\"), z.literal(\"all\")]),\n\tfilename: z.optional(z.string()),\n\textension: z.optional(z.string()),\n\tsize: z.optional(z.number()),\n\torigin_url: z.string(),\n\turl: z.string(),\n\twidth: z.optional(z.number()),\n\theight: z.optional(z.number()),\n\tnotes: z.optional(z.string()),\n\tcredits: z.optional(z.string()),\n\talt: z.optional(z.string()),\n})\n\nexport type Asset = z.infer<typeof AssetSchema>\n\nexport const getAssetOrThrow =\n\t(assets: Record<Asset[\"id\"], Asset | undefined>): ((assetId: Asset[\"id\"]) => Asset) =>\n\t(assetId: Asset[\"id\"]): Asset => {\n\t\tconst asset = assets[assetId]\n\t\tif (!asset) {\n\t\t\tthrow new Error(`Missing asset with id '${assetId}'!`)\n\t\t}\n\t\treturn asset\n\t}\n"],"mappings":";;AAEA,MAAa,cAAc,EAAE,aAAa;CACzC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"asset.js","names":[],"sources":["../../src/common/asset.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const AssetSchema = z.strictObject({\n\tid: z.string(),\n\tlast_modified: z.string(),\n\tkind: z.union([z.literal(\"image\"), z.literal(\"all\")]),\n\tfilename: z.optional(z.string()),\n\textension: z.optional(z.string()),\n\tsize: z.optional(z.number()),\n\torigin_url: z.string(),\n\turl: z.string(),\n\twidth: z.optional(z.number()),\n\theight: z.optional(z.number()),\n\tnotes: z.optional(z.string()),\n\tcredits: z.optional(z.string()),\n\talt: z.optional(z.string()),\n})\n\nexport type Asset = z.infer<typeof AssetSchema>\n\nexport const getAssetOrThrow =\n\t(assets: Record<Asset[\"id\"], Asset | undefined>): ((assetId: Asset[\"id\"]) => Asset) =>\n\t(assetId: Asset[\"id\"]): Asset => {\n\t\tconst asset = assets[assetId]\n\t\tif (!asset) {\n\t\t\tthrow new Error(`Missing asset with id '${assetId}'!`)\n\t\t}\n\t\treturn asset\n\t}\n"],"mappings":";;AAEA,MAAa,cAAc,EAAE,aAAa;CACzC,IAAI,EAAE,OAAO;CACb,eAAe,EAAE,OAAO;CACxB,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,KAAK,CAAC,CAAC;CACpD,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC;CAC/B,WAAW,EAAE,SAAS,EAAE,OAAO,CAAC;CAChC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;CAC3B,YAAY,EAAE,OAAO;CACrB,KAAK,EAAE,OAAO;CACd,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;CAC5B,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;CAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;CAC5B,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;CAC9B,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC;AAC3B,CAAC"}
|
package/dist/common/embed.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/common/embed.d.ts
|
|
4
3
|
declare const EmbedSchema: z.ZodMiniObject<{
|
|
5
4
|
type: z.ZodMiniString<string>;
|
|
@@ -17,5 +16,5 @@ declare const EmbedSchema: z.ZodMiniObject<{
|
|
|
17
16
|
}, z.core.$strict>;
|
|
18
17
|
type Embed = z.infer<typeof EmbedSchema>;
|
|
19
18
|
//#endregion
|
|
20
|
-
export { Embed };
|
|
19
|
+
export { Embed, EmbedSchema };
|
|
21
20
|
//# sourceMappingURL=embed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.d.ts","names":[],"sources":["../../src/common/embed.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"embed.d.ts","names":[],"sources":["../../src/common/embed.ts"],"mappings":";;cAGa,aAAW,EAAA;;;;;;;;;;;;;;KAeZ,QAAQ,EAAE,aAAa"}
|
package/dist/common/embed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","names":[],"sources":["../../src/common/embed.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n// This type represents response format from oEmbed API\nexport const EmbedSchema = z.strictObject({\n\ttype: z.string(),\n\tversion: z.nullish(z.string()),\n\tauthor_name: z.nullish(z.string()),\n\tauthor_url: z.nullish(z.string()),\n\tprovider_name: z.nullish(z.string()),\n\tprovider_url: z.nullish(z.string()),\n\tcache_age: z.nullish(z.string()),\n\tthumbnail_url: z.nullish(z.string()),\n\tthumbnail_width: z.nullish(z.number()),\n\tthumbnail_height: z.nullish(z.number()),\n\thtml: z.nullish(z.string()),\n\ttitle: z.nullish(z.string()),\n})\n\nexport type Embed = z.infer<typeof EmbedSchema>\n\nexport const getEmbedOrThrow =\n\t(embeds: Record<string, Embed | undefined>): ((embedUrl: string) => Embed) =>\n\t(embedUrl: string): Embed => {\n\t\tconst embed = embeds[embedUrl]\n\t\tif (!embed) throw new Error(`Missing embed with url '${embedUrl}'`)\n\t\treturn embed\n\t}\n"],"mappings":";;AAGA,MAAa,cAAc,EAAE,aAAa;CACzC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"embed.js","names":[],"sources":["../../src/common/embed.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n// This type represents response format from oEmbed API\nexport const EmbedSchema = z.strictObject({\n\ttype: z.string(),\n\tversion: z.nullish(z.string()),\n\tauthor_name: z.nullish(z.string()),\n\tauthor_url: z.nullish(z.string()),\n\tprovider_name: z.nullish(z.string()),\n\tprovider_url: z.nullish(z.string()),\n\tcache_age: z.nullish(z.string()),\n\tthumbnail_url: z.nullish(z.string()),\n\tthumbnail_width: z.nullish(z.number()),\n\tthumbnail_height: z.nullish(z.number()),\n\thtml: z.nullish(z.string()),\n\ttitle: z.nullish(z.string()),\n})\n\nexport type Embed = z.infer<typeof EmbedSchema>\n\nexport const getEmbedOrThrow =\n\t(embeds: Record<string, Embed | undefined>): ((embedUrl: string) => Embed) =>\n\t(embedUrl: string): Embed => {\n\t\tconst embed = embeds[embedUrl]\n\t\tif (!embed) throw new Error(`Missing embed with url '${embedUrl}'`)\n\t\treturn embed\n\t}\n"],"mappings":";;AAGA,MAAa,cAAc,EAAE,aAAa;CACzC,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC7B,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC;CACjC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC;CAChC,eAAe,EAAE,QAAQ,EAAE,OAAO,CAAC;CACnC,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC;CAClC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC/B,eAAe,EAAE,QAAQ,EAAE,OAAO,CAAC;CACnC,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;CACrC,kBAAkB,EAAE,QAAQ,EAAE,OAAO,CAAC;CACtC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC1B,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;AAC5B,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/common/hexaColorCode.d.ts
|
|
4
3
|
declare const HexaColorCodeSchema: z.ZodMiniString<string>;
|
|
5
4
|
type HexaColorCode = z.infer<typeof HexaColorCodeSchema>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { HexaColorCode };
|
|
6
|
+
export { HexaColorCode, HexaColorCodeSchema };
|
|
8
7
|
//# sourceMappingURL=hexaColorCode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexaColorCode.d.ts","names":[],"sources":["../../src/common/hexaColorCode.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hexaColorCode.d.ts","names":[],"sources":["../../src/common/hexaColorCode.ts"],"mappings":";;cAIa,qBAAmB,EAAA;KAMpB,gBAAgB,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hexaColorCode.js","names":[],"sources":["../../src/common/hexaColorCode.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst hexaColorCodeRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/\n\nexport const HexaColorCodeSchema = z.string().check(\n\tz.refine((s) => hexaColorCodeRegex.test(s), {\n\t\terror: () => \"The value must be a valid hex color code (e.g. #FFF or #FFFFFF)\",\n\t}),\n)\n\nexport type HexaColorCode = z.infer<typeof HexaColorCodeSchema>\n"],"mappings":";;AAEA,MAAM,qBAAqB;AAE3B,MAAa,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"hexaColorCode.js","names":[],"sources":["../../src/common/hexaColorCode.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst hexaColorCodeRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/\n\nexport const HexaColorCodeSchema = z.string().check(\n\tz.refine((s) => hexaColorCodeRegex.test(s), {\n\t\terror: () => \"The value must be a valid hex color code (e.g. #FFF or #FFFFFF)\",\n\t}),\n)\n\nexport type HexaColorCode = z.infer<typeof HexaColorCodeSchema>\n"],"mappings":";;AAEA,MAAM,qBAAqB;AAE3B,MAAa,sBAAsB,EAAE,OAAO,CAAC,CAAC,MAC7C,EAAE,QAAQ,MAAM,mBAAmB,KAAK,CAAC,GAAG,EAC3C,aAAa,kEACd,CAAC,CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/common/nonEmptyString.d.ts
|
|
4
3
|
declare const NonEmptyStringSchema: z.ZodMiniString<string>;
|
|
5
4
|
type NonEmptyString = z.infer<typeof NonEmptyStringSchema>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { NonEmptyString };
|
|
6
|
+
export { NonEmptyString, NonEmptyStringSchema };
|
|
8
7
|
//# sourceMappingURL=nonEmptyString.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonEmptyString.d.ts","names":[],"sources":["../../src/common/nonEmptyString.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nonEmptyString.d.ts","names":[],"sources":["../../src/common/nonEmptyString.ts"],"mappings":";;cAEa,sBAAoB,EAAA;KAMrB,iBAAiB,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonEmptyString.js","names":[],"sources":["../../src/common/nonEmptyString.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const NonEmptyStringSchema = z.string().check(\n\tz.refine((s) => s.trim().length > 0, {\n\t\terror: () => \"The value must be a non-empty string\",\n\t}),\n)\n\nexport type NonEmptyString = z.infer<typeof NonEmptyStringSchema>\n"],"mappings":";;AAEA,MAAa,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"nonEmptyString.js","names":[],"sources":["../../src/common/nonEmptyString.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const NonEmptyStringSchema = z.string().check(\n\tz.refine((s) => s.trim().length > 0, {\n\t\terror: () => \"The value must be a non-empty string\",\n\t}),\n)\n\nexport type NonEmptyString = z.infer<typeof NonEmptyStringSchema>\n"],"mappings":";;AAEA,MAAa,uBAAuB,EAAE,OAAO,CAAC,CAAC,MAC9C,EAAE,QAAQ,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,GAAG,EACpC,aAAa,uCACd,CAAC,CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/common/widgetKey.d.ts
|
|
4
3
|
declare const WidgetKeySchema: z.ZodMiniString<string>;
|
|
5
4
|
type WidgetKey = z.infer<typeof WidgetKeySchema>;
|
|
6
5
|
//#endregion
|
|
7
|
-
export { WidgetKey };
|
|
6
|
+
export { WidgetKey, WidgetKeySchema };
|
|
8
7
|
//# sourceMappingURL=widgetKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetKey.d.ts","names":[],"sources":["../../src/common/widgetKey.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"widgetKey.d.ts","names":[],"sources":["../../src/common/widgetKey.ts"],"mappings":";;cAIa,iBAAe,EAAA;KAMhB,YAAY,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetKey.js","names":[],"sources":["../../src/common/widgetKey.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst widgetKeyRegex = /^[^<>]+$/\n\nexport const WidgetKeySchema = z.string().check(\n\tz.refine((s) => s.length === 0 || widgetKeyRegex.test(s), {\n\t\terror: () => \"The value must not contain < or > characters\",\n\t}),\n)\n\nexport type WidgetKey = z.infer<typeof WidgetKeySchema>\n"],"mappings":";;AAEA,MAAM,iBAAiB;AAEvB,MAAa,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"widgetKey.js","names":[],"sources":["../../src/common/widgetKey.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst widgetKeyRegex = /^[^<>]+$/\n\nexport const WidgetKeySchema = z.string().check(\n\tz.refine((s) => s.length === 0 || widgetKeyRegex.test(s), {\n\t\terror: () => \"The value must not contain < or > characters\",\n\t}),\n)\n\nexport type WidgetKey = z.infer<typeof WidgetKeySchema>\n"],"mappings":";;AAEA,MAAM,iBAAiB;AAEvB,MAAa,kBAAkB,EAAE,OAAO,CAAC,CAAC,MACzC,EAAE,QAAQ,MAAM,EAAE,WAAW,KAAK,eAAe,KAAK,CAAC,GAAG,EACzD,aAAa,+CACd,CAAC,CACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/content/boolean.d.ts
|
|
4
3
|
declare const BooleanContentSchema: z.ZodMiniObject<{
|
|
5
4
|
__TYPE__: z.ZodMiniLiteral<"BooleanContent">;
|
|
@@ -7,5 +6,5 @@ declare const BooleanContentSchema: z.ZodMiniObject<{
|
|
|
7
6
|
}, z.core.$strip>;
|
|
8
7
|
type BooleanContent = z.infer<typeof BooleanContentSchema>;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { BooleanContent };
|
|
9
|
+
export { BooleanContent, BooleanContentSchema };
|
|
11
10
|
//# sourceMappingURL=boolean.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.d.ts","names":[],"sources":["../../src/content/boolean.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"boolean.d.ts","names":[],"sources":["../../src/content/boolean.ts"],"mappings":";;cAIa,sBAAoB,EAAA;;;;KAKrB,iBAAiB,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.js","names":[],"sources":["../../src/content/boolean.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const BooleanContentType = \"BooleanContent\" as const\n\nexport const BooleanContentSchema = z.object({\n\t__TYPE__: z.literal(BooleanContentType),\n\tvalue: z.boolean(),\n})\n\nexport type BooleanContent = z.infer<typeof BooleanContentSchema>\n"],"mappings":";;AAEA,MAAa,qBAAqB;AAElC,MAAa,uBAAuB,EAAE,OAAO;CAC5C,UAAU,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"boolean.js","names":[],"sources":["../../src/content/boolean.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nexport const BooleanContentType = \"BooleanContent\" as const\n\nexport const BooleanContentSchema = z.object({\n\t__TYPE__: z.literal(BooleanContentType),\n\tvalue: z.boolean(),\n})\n\nexport type BooleanContent = z.infer<typeof BooleanContentSchema>\n"],"mappings":";;AAEA,MAAa,qBAAqB;AAElC,MAAa,uBAAuB,EAAE,OAAO;CAC5C,UAAU,EAAE,QAAQ,kBAAkB;CACtC,OAAO,EAAE,QAAQ;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.js","names":[],"sources":["../../../src/content/codec/boolean.ts"],"sourcesContent":["import { BooleanContentSchema, BooleanContentType } from \"../boolean\"\nimport type { BooleanContent } from \"../boolean\"\nimport { BooleanLegacySchema } from \"../legacy/boolean\"\nimport type { BooleanLegacy } from \"../legacy/boolean\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nexport const BooleanLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<BooleanContent, BooleanLegacy> => ({\n\tname: \"BooleanLegacy\",\n\n\tis(input): input is BooleanContent {\n\t\treturn BooleanContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = BooleanLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: BooleanContentType,\n\t\t\t\tvalue: parsed.data,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: input.value,\n\t\t\ttypes: { [ctx.keyOfType]: \"Boolean\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAMA,MAAa,sBACZ,SACiD;CACjD,MAAM;CAEN,GAAG,OAAgC;
|
|
1
|
+
{"version":3,"file":"boolean.js","names":[],"sources":["../../../src/content/codec/boolean.ts"],"sourcesContent":["import { BooleanContentSchema, BooleanContentType } from \"../boolean\"\nimport type { BooleanContent } from \"../boolean\"\nimport { BooleanLegacySchema } from \"../legacy/boolean\"\nimport type { BooleanLegacy } from \"../legacy/boolean\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nexport const BooleanLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<BooleanContent, BooleanLegacy> => ({\n\tname: \"BooleanLegacy\",\n\n\tis(input): input is BooleanContent {\n\t\treturn BooleanContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = BooleanLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: BooleanContentType,\n\t\t\t\tvalue: parsed.data,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: input.value,\n\t\t\ttypes: { [ctx.keyOfType]: \"Boolean\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAMA,MAAa,sBACZ,SACiD;CACjD,MAAM;CAEN,GAAG,OAAgC;EAClC,OAAO,qBAAqB,UAAU,KAAK,CAAC,CAAC;CAC9C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,oBAAoB,UAAU,KAAK;EAClD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM;IACL,UAAU;IACV,OAAO,OAAO;GACf;EACD;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS,MAAM;GACf,OAAO,GAAG,IAAI,YAAY,UAAU;GACpC,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","names":[],"sources":["../../../src/content/codec/document.ts"],"sourcesContent":["import { DocumentContentSchema } from \"../document\"\nimport type { DocumentContent } from \"../document\"\nimport { DocumentLegacySchema } from \"../legacy/document\"\nimport type { DocumentLegacy } from \"../legacy/document\"\nimport { defaultCtx } from \"./legacyContentCtx\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\nimport { WidgetLegacyCodec } from \"./widget\"\n\nexport const DocumentLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<DocumentContent, DocumentLegacy> => ({\n\tname: \"DocumentLegacy\",\n\n\tis(input): input is DocumentContent {\n\t\treturn DocumentContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = DocumentLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\tconst data: DocumentContent = {}\n\n\t\tfor (const [widgetKey, widgetValue] of Object.entries(parsed.data)) {\n\t\t\tconst widgetCtx = defaultCtx(widgetKey, ctx.allTypes, ctx.allKeys)\n\t\t\tconst result = WidgetLegacyCodec(widgetCtx).toContent(widgetValue)\n\n\t\t\tif (result.success) {\n\t\t\t\tdata[widgetKey] = result.data\n\t\t\t}\n\t\t}\n\n\t\treturn { success: true, data }\n\t},\n\n\tfromContent(input) {\n\t\tconst legacy: ReturnType<LegacyCodec<DocumentContent, DocumentLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: {},\n\t\t\ttypes: {},\n\t\t\tkeys: {},\n\t\t}\n\n\t\tfor (const [widgetKey, widgetValue] of Object.entries(input)) {\n\t\t\tconst widgetCtx = defaultCtx(widgetKey, ctx.allTypes)\n\t\t\tconst result = WidgetLegacyCodec(widgetCtx).fromContent(widgetValue)\n\n\t\t\tif (!result) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlegacy.content[widgetKey] = result.content\n\t\t\tlegacy.types = { ...legacy.types, ...result.types }\n\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t}\n\n\t\treturn legacy\n\t},\n})\n"],"mappings":";;;;;AAQA,MAAa,uBACZ,SACmD;CACnD,MAAM;CAEN,GAAG,OAAiC;
|
|
1
|
+
{"version":3,"file":"document.js","names":[],"sources":["../../../src/content/codec/document.ts"],"sourcesContent":["import { DocumentContentSchema } from \"../document\"\nimport type { DocumentContent } from \"../document\"\nimport { DocumentLegacySchema } from \"../legacy/document\"\nimport type { DocumentLegacy } from \"../legacy/document\"\nimport { defaultCtx } from \"./legacyContentCtx\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\nimport { WidgetLegacyCodec } from \"./widget\"\n\nexport const DocumentLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<DocumentContent, DocumentLegacy> => ({\n\tname: \"DocumentLegacy\",\n\n\tis(input): input is DocumentContent {\n\t\treturn DocumentContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = DocumentLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\tconst data: DocumentContent = {}\n\n\t\tfor (const [widgetKey, widgetValue] of Object.entries(parsed.data)) {\n\t\t\tconst widgetCtx = defaultCtx(widgetKey, ctx.allTypes, ctx.allKeys)\n\t\t\tconst result = WidgetLegacyCodec(widgetCtx).toContent(widgetValue)\n\n\t\t\tif (result.success) {\n\t\t\t\tdata[widgetKey] = result.data\n\t\t\t}\n\t\t}\n\n\t\treturn { success: true, data }\n\t},\n\n\tfromContent(input) {\n\t\tconst legacy: ReturnType<LegacyCodec<DocumentContent, DocumentLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: {},\n\t\t\ttypes: {},\n\t\t\tkeys: {},\n\t\t}\n\n\t\tfor (const [widgetKey, widgetValue] of Object.entries(input)) {\n\t\t\tconst widgetCtx = defaultCtx(widgetKey, ctx.allTypes)\n\t\t\tconst result = WidgetLegacyCodec(widgetCtx).fromContent(widgetValue)\n\n\t\t\tif (!result) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlegacy.content[widgetKey] = result.content\n\t\t\tlegacy.types = { ...legacy.types, ...result.types }\n\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t}\n\n\t\treturn legacy\n\t},\n})\n"],"mappings":";;;;;AAQA,MAAa,uBACZ,SACmD;CACnD,MAAM;CAEN,GAAG,OAAiC;EACnC,OAAO,sBAAsB,UAAU,KAAK,CAAC,CAAC;CAC/C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,qBAAqB,UAAU,KAAK;EACnD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,MAAM,OAAwB,CAAC;EAE/B,KAAK,MAAM,CAAC,WAAW,gBAAgB,OAAO,QAAQ,OAAO,IAAI,GAAG;GAEnE,MAAM,SAAS,kBADG,WAAW,WAAW,IAAI,UAAU,IAAI,OACjB,CAAC,CAAC,CAAC,UAAU,WAAW;GAEjE,IAAI,OAAO,SACV,KAAK,aAAa,OAAO;EAE3B;EAEA,OAAO;GAAE,SAAS;GAAM;EAAK;CAC9B;CAEA,YAAY,OAAO;EAClB,MAAM,SAAkF;GACvF,SAAS,CAAC;GACV,OAAO,CAAC;GACR,MAAM,CAAC;EACR;EAEA,KAAK,MAAM,CAAC,WAAW,gBAAgB,OAAO,QAAQ,KAAK,GAAG;GAE7D,MAAM,SAAS,kBADG,WAAW,WAAW,IAAI,QACH,CAAC,CAAC,CAAC,YAAY,WAAW;GAEnE,IAAI,CAAC,QACJ;GAGD,OAAO,QAAQ,aAAa,OAAO;GACnC,OAAO,QAAQ;IAAE,GAAG,OAAO;IAAO,GAAG,OAAO;GAAM;GAClD,OAAO,OAAO;IAAE,GAAG,OAAO;IAAM,GAAG,OAAO;GAAK;EAChD;EAEA,OAAO;CACR;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","names":[],"sources":["../../../src/content/codec/embed.ts"],"sourcesContent":["import { EmbedContentSchema, EmbedContentType } from \"../embed\"\nimport type { EmbedContent } from \"../embed\"\nimport type { EmbedLegacy } from \"../legacy/embed\"\nimport { EmbedLegacySchema, EmbedLegacyLooseSchema } from \"../legacy/embed\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\n// Also used by content/codec/richText\nexport function embedLegacyToContent(value: EmbedLegacy): EmbedContent {\n\tconst parsed = EmbedLegacySchema.parse(value)\n\n\treturn {\n\t\t...parsed,\n\t\tall: value,\n\t\t__TYPE__: EmbedContentType,\n\t}\n}\n\n// Also used by content/codec/richText\nexport function embedContentToLegacy(value: EmbedContent): EmbedLegacy {\n\t/**\n\t * We cast here because actually in the all property we can have\n\t * extra keys that are never parsed and we don't want to loose them.\n\t */\n\treturn value.all as EmbedLegacy\n}\n\nexport const EmbedLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<EmbedContent, EmbedLegacy> => ({\n\tname: \"EmbedLegacy\",\n\n\tis(input): input is EmbedContent {\n\t\treturn EmbedContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = EmbedLegacyLooseSchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: embedLegacyToContent(parsed.data),\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: embedContentToLegacy(input),\n\t\t\ttypes: { [ctx.keyOfType]: \"Embed\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAOA,SAAgB,qBAAqB,OAAkC;
|
|
1
|
+
{"version":3,"file":"embed.js","names":[],"sources":["../../../src/content/codec/embed.ts"],"sourcesContent":["import { EmbedContentSchema, EmbedContentType } from \"../embed\"\nimport type { EmbedContent } from \"../embed\"\nimport type { EmbedLegacy } from \"../legacy/embed\"\nimport { EmbedLegacySchema, EmbedLegacyLooseSchema } from \"../legacy/embed\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\n// Also used by content/codec/richText\nexport function embedLegacyToContent(value: EmbedLegacy): EmbedContent {\n\tconst parsed = EmbedLegacySchema.parse(value)\n\n\treturn {\n\t\t...parsed,\n\t\tall: value,\n\t\t__TYPE__: EmbedContentType,\n\t}\n}\n\n// Also used by content/codec/richText\nexport function embedContentToLegacy(value: EmbedContent): EmbedLegacy {\n\t/**\n\t * We cast here because actually in the all property we can have\n\t * extra keys that are never parsed and we don't want to loose them.\n\t */\n\treturn value.all as EmbedLegacy\n}\n\nexport const EmbedLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<EmbedContent, EmbedLegacy> => ({\n\tname: \"EmbedLegacy\",\n\n\tis(input): input is EmbedContent {\n\t\treturn EmbedContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = EmbedLegacyLooseSchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: embedLegacyToContent(parsed.data),\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: embedContentToLegacy(input),\n\t\t\ttypes: { [ctx.keyOfType]: \"Embed\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAOA,SAAgB,qBAAqB,OAAkC;CAGtE,OAAO;EACN,GAHc,kBAAkB,MAAM,KAG9B;EACR,KAAK;EACL,UAAU;CACX;AACD;AAGA,SAAgB,qBAAqB,OAAkC;;;;;CAKtE,OAAO,MAAM;AACd;AAEA,MAAa,oBACZ,SAC6C;CAC7C,MAAM;CAEN,GAAG,OAA8B;EAChC,OAAO,mBAAmB,UAAU,KAAK,CAAC,CAAC;CAC5C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,uBAAuB,UAAU,KAAK;EACrD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM,qBAAqB,OAAO,IAAI;EACvC;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS,qBAAqB,KAAK;GACnC,OAAO,GAAG,IAAI,YAAY,QAAQ;GAClC,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.js","names":[],"sources":["../../../src/content/codec/empty.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { EmptyContentSchema, EmptyContentType } from \"../empty\"\nimport type { EmptyContent } from \"../empty\"\nimport { EmptyLegacySchema } from \"../legacy/empty\"\nimport type { EmptyLegacy } from \"../legacy/empty\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nconst UnsupportedEmptyLegacySchema = z.never()\n\nexport const EmptyLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<EmptyContent, EmptyLegacy> => ({\n\tname: \"EmptyLegacy\",\n\n\tis(input): input is EmptyContent {\n\t\treturn EmptyContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tif (!ctx.fieldType) {\n\t\t\treturn UnsupportedEmptyLegacySchema.safeParse(\n\t\t\t\tinput,\n\t\t\t) as z.core.util.SafeParseError<EmptyLegacy>\n\t\t}\n\n\t\tconst parsed = EmptyLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: EmptyContentType,\n\t\t\t\ttype: ctx.fieldType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst type = ctx.fieldType ?? input.type\n\t\treturn {\n\t\t\tcontent: null,\n\t\t\ttypes: { [ctx.keyOfType]: type },\n\t\t\tkeys: {},\n\t\t} as ReturnType<LegacyCodec<EmptyContent, EmptyLegacy>[\"fromContent\"]>\n\t},\n})\n"],"mappings":";;;;AAQA,MAAM,+BAA+B,EAAE,
|
|
1
|
+
{"version":3,"file":"empty.js","names":[],"sources":["../../../src/content/codec/empty.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { EmptyContentSchema, EmptyContentType } from \"../empty\"\nimport type { EmptyContent } from \"../empty\"\nimport { EmptyLegacySchema } from \"../legacy/empty\"\nimport type { EmptyLegacy } from \"../legacy/empty\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nconst UnsupportedEmptyLegacySchema = z.never()\n\nexport const EmptyLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<EmptyContent, EmptyLegacy> => ({\n\tname: \"EmptyLegacy\",\n\n\tis(input): input is EmptyContent {\n\t\treturn EmptyContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tif (!ctx.fieldType) {\n\t\t\treturn UnsupportedEmptyLegacySchema.safeParse(\n\t\t\t\tinput,\n\t\t\t) as z.core.util.SafeParseError<EmptyLegacy>\n\t\t}\n\n\t\tconst parsed = EmptyLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: EmptyContentType,\n\t\t\t\ttype: ctx.fieldType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst type = ctx.fieldType ?? input.type\n\t\treturn {\n\t\t\tcontent: null,\n\t\t\ttypes: { [ctx.keyOfType]: type },\n\t\t\tkeys: {},\n\t\t} as ReturnType<LegacyCodec<EmptyContent, EmptyLegacy>[\"fromContent\"]>\n\t},\n})\n"],"mappings":";;;;AAQA,MAAM,+BAA+B,EAAE,MAAM;AAE7C,MAAa,oBACZ,SAC6C;CAC7C,MAAM;CAEN,GAAG,OAA8B;EAChC,OAAO,mBAAmB,UAAU,KAAK,CAAC,CAAC;CAC5C;CAEA,UAAU,OAAO;EAChB,IAAI,CAAC,IAAI,WACR,OAAO,6BAA6B,UACnC,KACD;EAGD,MAAM,SAAS,kBAAkB,UAAU,KAAK;EAChD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM;IACL,UAAU;IACV,MAAM,IAAI;GACX;EACD;CACD;CAEA,YAAY,OAAO;EAClB,MAAM,OAAO,IAAI,aAAa,MAAM;EACpC,OAAO;GACN,SAAS;GACT,OAAO,GAAG,IAAI,YAAY,KAAK;GAC/B,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","names":[],"sources":["../../../src/content/codec/field.ts"],"sourcesContent":["import type { z } from \"zod/mini\"\n\nimport {\n\tColorContentSchema,\n\tDateContentSchema,\n\tFieldContentType,\n\tNumberContentSchema,\n\tRangeContentSchema,\n\tSelectContentSchema,\n\tTextContentSchema,\n\tTimestampContentSchema,\n} from \"../field\"\nimport type {\n\tColorContent,\n\tDateContent,\n\tNumberContent,\n\tRangeContent,\n\tSelectContent,\n\tTextContent,\n\tTimestampContent,\n} from \"../field\"\nimport type { StringLegacy } from \"../legacy/field\"\nimport { StringLegacySchema } from \"../legacy/field\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\ntype LegacyFieldContent =\n\t| TextContent\n\t| ColorContent\n\t| DateContent\n\t| TimestampContent\n\t| NumberContent\n\t| RangeContent\n\t| SelectContent\n\nfunction createFieldLegacyCodec<TContent extends LegacyFieldContent>(\n\tctx: LegacyContentCtx,\n\tname: string,\n\ttype: TContent[\"type\"],\n\tschema: z.ZodMiniType<TContent>,\n): LegacyCodec<TContent, StringLegacy> {\n\treturn {\n\t\tname,\n\t\tis(input): input is TContent {\n\t\t\treturn schema.safeParse(input).success\n\t\t},\n\t\ttoContent(input) {\n\t\t\tconst parsed = StringLegacySchema.safeParse(input)\n\t\t\tif (!parsed.success) {\n\t\t\t\treturn parsed\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: {\n\t\t\t\t\t__TYPE__: FieldContentType,\n\t\t\t\t\ttype,\n\t\t\t\t\tvalue: parsed.data,\n\t\t\t\t} as TContent,\n\t\t\t}\n\t\t},\n\t\tfromContent(input) {\n\t\t\treturn {\n\t\t\t\tcontent: input.value,\n\t\t\t\ttypes: { [ctx.keyOfType]: type },\n\t\t\t\tkeys: {},\n\t\t\t}\n\t\t},\n\t}\n}\n\nexport const TextLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<TextContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"TextLegacy\", \"Text\", TextContentSchema)\n\nexport const ColorLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<ColorContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"ColorLegacy\", \"Color\", ColorContentSchema)\n\nexport const DateLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<DateContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"DateLegacy\", \"Date\", DateContentSchema)\n\nexport const TimestampLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<TimestampContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"TimestampLegacy\", \"Timestamp\", TimestampContentSchema)\n\nexport const NumberLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<NumberContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"NumberLegacy\", \"Number\", NumberContentSchema)\n\nexport const RangeLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<RangeContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"RangeLegacy\", \"Range\", RangeContentSchema)\n\nexport const SelectLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<SelectContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"SelectLegacy\", \"Select\", SelectContentSchema)\n"],"mappings":";;;AAkCA,SAAS,uBACR,KACA,MACA,MACA,QACsC;
|
|
1
|
+
{"version":3,"file":"field.js","names":[],"sources":["../../../src/content/codec/field.ts"],"sourcesContent":["import type { z } from \"zod/mini\"\n\nimport {\n\tColorContentSchema,\n\tDateContentSchema,\n\tFieldContentType,\n\tNumberContentSchema,\n\tRangeContentSchema,\n\tSelectContentSchema,\n\tTextContentSchema,\n\tTimestampContentSchema,\n} from \"../field\"\nimport type {\n\tColorContent,\n\tDateContent,\n\tNumberContent,\n\tRangeContent,\n\tSelectContent,\n\tTextContent,\n\tTimestampContent,\n} from \"../field\"\nimport type { StringLegacy } from \"../legacy/field\"\nimport { StringLegacySchema } from \"../legacy/field\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\ntype LegacyFieldContent =\n\t| TextContent\n\t| ColorContent\n\t| DateContent\n\t| TimestampContent\n\t| NumberContent\n\t| RangeContent\n\t| SelectContent\n\nfunction createFieldLegacyCodec<TContent extends LegacyFieldContent>(\n\tctx: LegacyContentCtx,\n\tname: string,\n\ttype: TContent[\"type\"],\n\tschema: z.ZodMiniType<TContent>,\n): LegacyCodec<TContent, StringLegacy> {\n\treturn {\n\t\tname,\n\t\tis(input): input is TContent {\n\t\t\treturn schema.safeParse(input).success\n\t\t},\n\t\ttoContent(input) {\n\t\t\tconst parsed = StringLegacySchema.safeParse(input)\n\t\t\tif (!parsed.success) {\n\t\t\t\treturn parsed\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: {\n\t\t\t\t\t__TYPE__: FieldContentType,\n\t\t\t\t\ttype,\n\t\t\t\t\tvalue: parsed.data,\n\t\t\t\t} as TContent,\n\t\t\t}\n\t\t},\n\t\tfromContent(input) {\n\t\t\treturn {\n\t\t\t\tcontent: input.value,\n\t\t\t\ttypes: { [ctx.keyOfType]: type },\n\t\t\t\tkeys: {},\n\t\t\t}\n\t\t},\n\t}\n}\n\nexport const TextLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<TextContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"TextLegacy\", \"Text\", TextContentSchema)\n\nexport const ColorLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<ColorContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"ColorLegacy\", \"Color\", ColorContentSchema)\n\nexport const DateLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<DateContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"DateLegacy\", \"Date\", DateContentSchema)\n\nexport const TimestampLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<TimestampContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"TimestampLegacy\", \"Timestamp\", TimestampContentSchema)\n\nexport const NumberLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<NumberContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"NumberLegacy\", \"Number\", NumberContentSchema)\n\nexport const RangeLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<RangeContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"RangeLegacy\", \"Range\", RangeContentSchema)\n\nexport const SelectLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<SelectContent, StringLegacy> =>\n\tcreateFieldLegacyCodec(ctx, \"SelectLegacy\", \"Select\", SelectContentSchema)\n"],"mappings":";;;AAkCA,SAAS,uBACR,KACA,MACA,MACA,QACsC;CACtC,OAAO;EACN;EACA,GAAG,OAA0B;GAC5B,OAAO,OAAO,UAAU,KAAK,CAAC,CAAC;EAChC;EACA,UAAU,OAAO;GAChB,MAAM,SAAS,mBAAmB,UAAU,KAAK;GACjD,IAAI,CAAC,OAAO,SACX,OAAO;GAGR,OAAO;IACN,SAAS;IACT,MAAM;KACL,UAAU;KACV;KACA,OAAO,OAAO;IACf;GACD;EACD;EACA,YAAY,OAAO;GAClB,OAAO;IACN,SAAS,MAAM;IACf,OAAO,GAAG,IAAI,YAAY,KAAK;IAC/B,MAAM,CAAC;GACR;EACD;CACD;AACD;AAEA,MAAa,mBAAmB,QAC/B,uBAAuB,KAAK,cAAc,QAAQ,iBAAiB;AAEpE,MAAa,oBAAoB,QAChC,uBAAuB,KAAK,eAAe,SAAS,kBAAkB;AAEvE,MAAa,mBAAmB,QAC/B,uBAAuB,KAAK,cAAc,QAAQ,iBAAiB;AAEpE,MAAa,wBACZ,QAEA,uBAAuB,KAAK,mBAAmB,aAAa,sBAAsB;AAEnF,MAAa,qBACZ,QAEA,uBAAuB,KAAK,gBAAgB,UAAU,mBAAmB;AAE1E,MAAa,oBAAoB,QAChC,uBAAuB,KAAK,eAAe,SAAS,kBAAkB;AAEvE,MAAa,qBACZ,QAEA,uBAAuB,KAAK,gBAAgB,UAAU,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geopoint.js","names":[],"sources":["../../../src/content/codec/geopoint.ts"],"sourcesContent":["import { GeoPointContentSchema } from \"../geopoint\"\nimport type { GeoPointContent } from \"../geopoint\"\nimport { GeoPointLegacySchema } from \"../legacy/geopoint\"\nimport type { GeoPointLegacy } from \"../legacy/geopoint\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\n\nconst GeoPointContentType = \"GeoPointContent\"\n\nexport const GeoPointLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<GeoPointContent, GeoPointLegacy> => ({\n\tname: \"GeoPointLegacy\",\n\n\tis(input): input is GeoPointContent {\n\t\treturn GeoPointContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = GeoPointLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t...parsed.data,\n\t\t\t\t__TYPE__: GeoPointContentType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: { position: input.position },\n\t\t\ttypes: { [ctx.keyOfType]: \"GeoPoint\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAMA,MAAM,sBAAsB;AAE5B,MAAa,uBACZ,SACmD;CACnD,MAAM;CAEN,GAAG,OAAiC;
|
|
1
|
+
{"version":3,"file":"geopoint.js","names":[],"sources":["../../../src/content/codec/geopoint.ts"],"sourcesContent":["import { GeoPointContentSchema } from \"../geopoint\"\nimport type { GeoPointContent } from \"../geopoint\"\nimport { GeoPointLegacySchema } from \"../legacy/geopoint\"\nimport type { GeoPointLegacy } from \"../legacy/geopoint\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\n\nconst GeoPointContentType = \"GeoPointContent\"\n\nexport const GeoPointLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<GeoPointContent, GeoPointLegacy> => ({\n\tname: \"GeoPointLegacy\",\n\n\tis(input): input is GeoPointContent {\n\t\treturn GeoPointContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = GeoPointLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t...parsed.data,\n\t\t\t\t__TYPE__: GeoPointContentType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: { position: input.position },\n\t\t\ttypes: { [ctx.keyOfType]: \"GeoPoint\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAMA,MAAM,sBAAsB;AAE5B,MAAa,uBACZ,SACmD;CACnD,MAAM;CAEN,GAAG,OAAiC;EACnC,OAAO,sBAAsB,UAAU,KAAK,CAAC,CAAC;CAC/C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,qBAAqB,UAAU,KAAK;EACnD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM;IACL,GAAG,OAAO;IACV,UAAU;GACX;EACD;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS,EAAE,UAAU,MAAM,SAAS;GACpC,OAAO,GAAG,IAAI,YAAY,WAAW;GACrC,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -14,11 +14,12 @@ const GroupItemLegacyCodec = (ctx, index) => ({
|
|
|
14
14
|
const groupItemCtx = ctx.withContentKey(index.toString());
|
|
15
15
|
const value = [];
|
|
16
16
|
for (const [key, legacy] of Object.entries(parsed.data)) {
|
|
17
|
-
const
|
|
17
|
+
const itemCtx = getFieldCtx({
|
|
18
18
|
fieldKey: key,
|
|
19
19
|
contentKey: key,
|
|
20
20
|
ctx: groupItemCtx
|
|
21
|
-
})
|
|
21
|
+
});
|
|
22
|
+
const result = NestableAndGroupLegacyCodec(itemCtx).toContent(legacy);
|
|
22
23
|
if (result.success) value.push([key, result.data]);
|
|
23
24
|
}
|
|
24
25
|
return {
|
|
@@ -37,10 +38,11 @@ const GroupItemLegacyCodec = (ctx, index) => ({
|
|
|
37
38
|
keys: { [ctx.withContentKey(index.toString()).keyOfKey]: input.key }
|
|
38
39
|
};
|
|
39
40
|
for (const [key, content] of input.value) {
|
|
40
|
-
const
|
|
41
|
+
const itemCtx = getFieldCtx({
|
|
41
42
|
fieldKey: key,
|
|
42
43
|
ctx
|
|
43
|
-
})
|
|
44
|
+
});
|
|
45
|
+
const result = NestableAndGroupLegacyCodec(itemCtx).fromContent(content);
|
|
44
46
|
if (result) {
|
|
45
47
|
legacy.content[key] = result.content;
|
|
46
48
|
legacy.types = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","names":[],"sources":["../../../src/content/codec/group.ts"],"sourcesContent":["import {\n\tGroupContentSchema,\n\tGroupContentType,\n\tGroupItemContentSchema,\n\tGroupItemContentType,\n\tNestableAndGroupContentSchema,\n} from \"../group\"\nimport type { GroupContent, GroupItemContent, NestableAndGroupContent } from \"../group\"\nimport { GroupItemLegacySchema, GroupLegacySchema } from \"../legacy/group\"\nimport type { GroupItemLegacy, GroupLegacy, NestableAndGroupLegacy } from \"../legacy/group\"\nimport { type LegacyContentCtx, type LegacyCodec, getFieldCtx } from \"./legacyContentCtx\"\nimport { NestableLegacyCodec } from \"./nestable\"\n\nexport const GroupItemLegacyCodec = (\n\tctx: LegacyContentCtx,\n\tindex: number,\n): LegacyCodec<GroupItemContent, GroupItemLegacy> => ({\n\tname: \"GroupItemLegacy\",\n\n\tis(input): input is GroupItemContent {\n\t\treturn GroupItemContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = GroupItemLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\tconst groupItemCtx = ctx.withContentKey(index.toString())\n\n\t\tconst value: GroupItemContent[\"value\"] = []\n\t\tfor (const [key, legacy] of Object.entries(parsed.data)) {\n\t\t\tconst itemCtx = getFieldCtx({\n\t\t\t\tfieldKey: key,\n\t\t\t\tcontentKey: key,\n\t\t\t\tctx: groupItemCtx,\n\t\t\t})\n\n\t\t\tconst result = NestableAndGroupLegacyCodec(itemCtx).toContent(legacy)\n\t\t\tif (result.success) {\n\t\t\t\tvalue.push([key, result.data])\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: GroupItemContentType,\n\t\t\t\tkey: groupItemCtx.fieldContentKey,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst groupItemCtx = ctx.withContentKey(index.toString())\n\n\t\tconst legacy: ReturnType<LegacyCodec<GroupItemContent, GroupItemLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: {},\n\t\t\ttypes: {},\n\t\t\tkeys: { [groupItemCtx.keyOfKey]: input.key },\n\t\t}\n\n\t\tfor (const [key, content] of input.value) {\n\t\t\tconst itemCtx = getFieldCtx({ fieldKey: key, ctx })\n\n\t\t\tconst result = NestableAndGroupLegacyCodec(itemCtx).fromContent(content)\n\t\t\tif (result) {\n\t\t\t\tlegacy.content[key] = result.content\n\t\t\t\tlegacy.types = { ...legacy.types, ...result.types }\n\t\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t\t}\n\t\t}\n\n\t\treturn legacy\n\t},\n})\n\nexport const GroupLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<GroupContent, GroupLegacy> => ({\n\tname: \"GroupLegacy\",\n\n\tis(input): input is GroupContent {\n\t\treturn GroupContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = GroupLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\tconst value: GroupContent[\"value\"] = []\n\t\tfor (let index = 0; index < parsed.data.length; index++) {\n\t\t\tconst item = parsed.data[index]\n\n\t\t\t// Replace null items with empty GroupItemContent\n\t\t\tif (!item) {\n\t\t\t\tvalue.push({\n\t\t\t\t\t__TYPE__: GroupItemContentType,\n\t\t\t\t\tkey: ctx.withContentKey(index.toString()).fieldContentKey,\n\t\t\t\t\tvalue: [],\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst result = GroupItemLegacyCodec(ctx, index).toContent(item)\n\t\t\tif (!result.success) {\n\t\t\t\treturn result\n\t\t\t}\n\n\t\t\tvalue.push(result.data)\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: { __TYPE__: GroupContentType, value },\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst legacy: ReturnType<LegacyCodec<GroupContent, GroupLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: [],\n\t\t\ttypes: { [ctx.keyOfType]: \"Group\" },\n\t\t\tkeys: {},\n\t\t}\n\n\t\tfor (let index = 0; index < input.value.length; index++) {\n\t\t\tconst item = input.value[index]\n\t\t\tconst result = GroupItemLegacyCodec(ctx, index).fromContent(item)\n\n\t\t\tlegacy.content.push(result.content)\n\t\t\tlegacy.types = { ...legacy.types, ...result.types }\n\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t}\n\n\t\treturn legacy\n\t},\n})\n\nexport const NestableAndGroupLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<NestableAndGroupContent, NestableAndGroupLegacy, true> => ({\n\tname: \"NestableAndGroupLegacy\",\n\n\tis(input): input is NestableAndGroupContent {\n\t\treturn NestableAndGroupContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\treturn ctx.fieldType === \"Group\"\n\t\t\t? GroupLegacyCodec(ctx).toContent(input)\n\t\t\t: NestableLegacyCodec(ctx).toContent(input)\n\t},\n\n\tfromContent(input) {\n\t\treturn input.__TYPE__ === GroupContentType\n\t\t\t? GroupLegacyCodec(ctx).fromContent(input)\n\t\t\t: NestableLegacyCodec(ctx).fromContent(input)\n\t},\n})\n"],"mappings":";;;;;AAaA,MAAa,wBACZ,KACA,WACqD;CACrD,MAAM;CAEN,GAAG,OAAkC;
|
|
1
|
+
{"version":3,"file":"group.js","names":[],"sources":["../../../src/content/codec/group.ts"],"sourcesContent":["import {\n\tGroupContentSchema,\n\tGroupContentType,\n\tGroupItemContentSchema,\n\tGroupItemContentType,\n\tNestableAndGroupContentSchema,\n} from \"../group\"\nimport type { GroupContent, GroupItemContent, NestableAndGroupContent } from \"../group\"\nimport { GroupItemLegacySchema, GroupLegacySchema } from \"../legacy/group\"\nimport type { GroupItemLegacy, GroupLegacy, NestableAndGroupLegacy } from \"../legacy/group\"\nimport { type LegacyContentCtx, type LegacyCodec, getFieldCtx } from \"./legacyContentCtx\"\nimport { NestableLegacyCodec } from \"./nestable\"\n\nexport const GroupItemLegacyCodec = (\n\tctx: LegacyContentCtx,\n\tindex: number,\n): LegacyCodec<GroupItemContent, GroupItemLegacy> => ({\n\tname: \"GroupItemLegacy\",\n\n\tis(input): input is GroupItemContent {\n\t\treturn GroupItemContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = GroupItemLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\tconst groupItemCtx = ctx.withContentKey(index.toString())\n\n\t\tconst value: GroupItemContent[\"value\"] = []\n\t\tfor (const [key, legacy] of Object.entries(parsed.data)) {\n\t\t\tconst itemCtx = getFieldCtx({\n\t\t\t\tfieldKey: key,\n\t\t\t\tcontentKey: key,\n\t\t\t\tctx: groupItemCtx,\n\t\t\t})\n\n\t\t\tconst result = NestableAndGroupLegacyCodec(itemCtx).toContent(legacy)\n\t\t\tif (result.success) {\n\t\t\t\tvalue.push([key, result.data])\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: GroupItemContentType,\n\t\t\t\tkey: groupItemCtx.fieldContentKey,\n\t\t\t\tvalue,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst groupItemCtx = ctx.withContentKey(index.toString())\n\n\t\tconst legacy: ReturnType<LegacyCodec<GroupItemContent, GroupItemLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: {},\n\t\t\ttypes: {},\n\t\t\tkeys: { [groupItemCtx.keyOfKey]: input.key },\n\t\t}\n\n\t\tfor (const [key, content] of input.value) {\n\t\t\tconst itemCtx = getFieldCtx({ fieldKey: key, ctx })\n\n\t\t\tconst result = NestableAndGroupLegacyCodec(itemCtx).fromContent(content)\n\t\t\tif (result) {\n\t\t\t\tlegacy.content[key] = result.content\n\t\t\t\tlegacy.types = { ...legacy.types, ...result.types }\n\t\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t\t}\n\t\t}\n\n\t\treturn legacy\n\t},\n})\n\nexport const GroupLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<GroupContent, GroupLegacy> => ({\n\tname: \"GroupLegacy\",\n\n\tis(input): input is GroupContent {\n\t\treturn GroupContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = GroupLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\tconst value: GroupContent[\"value\"] = []\n\t\tfor (let index = 0; index < parsed.data.length; index++) {\n\t\t\tconst item = parsed.data[index]\n\n\t\t\t// Replace null items with empty GroupItemContent\n\t\t\tif (!item) {\n\t\t\t\tvalue.push({\n\t\t\t\t\t__TYPE__: GroupItemContentType,\n\t\t\t\t\tkey: ctx.withContentKey(index.toString()).fieldContentKey,\n\t\t\t\t\tvalue: [],\n\t\t\t\t})\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tconst result = GroupItemLegacyCodec(ctx, index).toContent(item)\n\t\t\tif (!result.success) {\n\t\t\t\treturn result\n\t\t\t}\n\n\t\t\tvalue.push(result.data)\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: { __TYPE__: GroupContentType, value },\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst legacy: ReturnType<LegacyCodec<GroupContent, GroupLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: [],\n\t\t\ttypes: { [ctx.keyOfType]: \"Group\" },\n\t\t\tkeys: {},\n\t\t}\n\n\t\tfor (let index = 0; index < input.value.length; index++) {\n\t\t\tconst item = input.value[index]\n\t\t\tconst result = GroupItemLegacyCodec(ctx, index).fromContent(item)\n\n\t\t\tlegacy.content.push(result.content)\n\t\t\tlegacy.types = { ...legacy.types, ...result.types }\n\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t}\n\n\t\treturn legacy\n\t},\n})\n\nexport const NestableAndGroupLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<NestableAndGroupContent, NestableAndGroupLegacy, true> => ({\n\tname: \"NestableAndGroupLegacy\",\n\n\tis(input): input is NestableAndGroupContent {\n\t\treturn NestableAndGroupContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\treturn ctx.fieldType === \"Group\"\n\t\t\t? GroupLegacyCodec(ctx).toContent(input)\n\t\t\t: NestableLegacyCodec(ctx).toContent(input)\n\t},\n\n\tfromContent(input) {\n\t\treturn input.__TYPE__ === GroupContentType\n\t\t\t? GroupLegacyCodec(ctx).fromContent(input)\n\t\t\t: NestableLegacyCodec(ctx).fromContent(input)\n\t},\n})\n"],"mappings":";;;;;AAaA,MAAa,wBACZ,KACA,WACqD;CACrD,MAAM;CAEN,GAAG,OAAkC;EACpC,OAAO,uBAAuB,UAAU,KAAK,CAAC,CAAC;CAChD;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,sBAAsB,UAAU,KAAK;EACpD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,MAAM,eAAe,IAAI,eAAe,MAAM,SAAS,CAAC;EAExD,MAAM,QAAmC,CAAC;EAC1C,KAAK,MAAM,CAAC,KAAK,WAAW,OAAO,QAAQ,OAAO,IAAI,GAAG;GACxD,MAAM,UAAU,YAAY;IAC3B,UAAU;IACV,YAAY;IACZ,KAAK;GACN,CAAC;GAED,MAAM,SAAS,4BAA4B,OAAO,CAAC,CAAC,UAAU,MAAM;GACpE,IAAI,OAAO,SACV,MAAM,KAAK,CAAC,KAAK,OAAO,IAAI,CAAC;EAE/B;EAEA,OAAO;GACN,SAAS;GACT,MAAM;IACL,UAAU;IACV,KAAK,aAAa;IAClB;GACD;EACD;CACD;CAEA,YAAY,OAAO;EAGlB,MAAM,SAAoF;GACzF,SAAS,CAAC;GACV,OAAO,CAAC;GACR,MAAM,GALc,IAAI,eAAe,MAAM,SAAS,CAKlC,CAAC,CAAC,WAAW,MAAM,IAAI;EAC5C;EAEA,KAAK,MAAM,CAAC,KAAK,YAAY,MAAM,OAAO;GACzC,MAAM,UAAU,YAAY;IAAE,UAAU;IAAK;GAAI,CAAC;GAElD,MAAM,SAAS,4BAA4B,OAAO,CAAC,CAAC,YAAY,OAAO;GACvE,IAAI,QAAQ;IACX,OAAO,QAAQ,OAAO,OAAO;IAC7B,OAAO,QAAQ;KAAE,GAAG,OAAO;KAAO,GAAG,OAAO;IAAM;IAClD,OAAO,OAAO;KAAE,GAAG,OAAO;KAAM,GAAG,OAAO;IAAK;GAChD;EACD;EAEA,OAAO;CACR;AACD;AAEA,MAAa,oBACZ,SAC6C;CAC7C,MAAM;CAEN,GAAG,OAA8B;EAChC,OAAO,mBAAmB,UAAU,KAAK,CAAC,CAAC;CAC5C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,kBAAkB,UAAU,KAAK;EAChD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,MAAM,QAA+B,CAAC;EACtC,KAAK,IAAI,QAAQ,GAAG,QAAQ,OAAO,KAAK,QAAQ,SAAS;GACxD,MAAM,OAAO,OAAO,KAAK;GAGzB,IAAI,CAAC,MAAM;IACV,MAAM,KAAK;KACV,UAAU;KACV,KAAK,IAAI,eAAe,MAAM,SAAS,CAAC,CAAC,CAAC;KAC1C,OAAO,CAAC;IACT,CAAC;IACD;GACD;GAEA,MAAM,SAAS,qBAAqB,KAAK,KAAK,CAAC,CAAC,UAAU,IAAI;GAC9D,IAAI,CAAC,OAAO,SACX,OAAO;GAGR,MAAM,KAAK,OAAO,IAAI;EACvB;EAEA,OAAO;GACN,SAAS;GACT,MAAM;IAAE,UAAU;IAAkB;GAAM;EAC3C;CACD;CAEA,YAAY,OAAO;EAClB,MAAM,SAA4E;GACjF,SAAS,CAAC;GACV,OAAO,GAAG,IAAI,YAAY,QAAQ;GAClC,MAAM,CAAC;EACR;EAEA,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,MAAM,QAAQ,SAAS;GACxD,MAAM,OAAO,MAAM,MAAM;GACzB,MAAM,SAAS,qBAAqB,KAAK,KAAK,CAAC,CAAC,YAAY,IAAI;GAEhE,OAAO,QAAQ,KAAK,OAAO,OAAO;GAClC,OAAO,QAAQ;IAAE,GAAG,OAAO;IAAO,GAAG,OAAO;GAAM;GAClD,OAAO,OAAO;IAAE,GAAG,OAAO;IAAM,GAAG,OAAO;GAAK;EAChD;EAEA,OAAO;CACR;AACD;AAEA,MAAa,+BACZ,SACyE;CACzE,MAAM;CAEN,GAAG,OAAyC;EAC3C,OAAO,8BAA8B,UAAU,KAAK,CAAC,CAAC;CACvD;CAEA,UAAU,OAAO;EAChB,OAAO,IAAI,cAAc,UACtB,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK,IACrC,oBAAoB,GAAG,CAAC,CAAC,UAAU,KAAK;CAC5C;CAEA,YAAY,OAAO;EAClB,OAAO,MAAM,aAAA,qBACV,iBAAiB,GAAG,CAAC,CAAC,YAAY,KAAK,IACvC,oBAAoB,GAAG,CAAC,CAAC,YAAY,KAAK;CAC9C;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","names":[],"sources":["../../../src/content/codec/image.ts"],"sourcesContent":["import { ImageContentSchema, ImageContentType } from \"../image\"\nimport type { ImageContent } from \"../image\"\nimport type { ImageLegacy } from \"../legacy/image\"\nimport { ImageLegacySchema } from \"../legacy/image\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\n// Also used by content/codec/richText\nexport function imageLegacyToContent(value: ImageLegacy): ImageContent {\n\treturn { ...value, __TYPE__: ImageContentType }\n}\n\nexport const ImageLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<ImageContent, ImageLegacy> => ({\n\tname: \"ImageLegacy\",\n\n\tis(input): input is ImageContent {\n\t\treturn ImageContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = ImageLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: imageLegacyToContent(parsed.data),\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: {\n\t\t\t\tedit: input.edit,\n\t\t\t\theight: input.height,\n\t\t\t\torigin: input.origin,\n\t\t\t\twidth: input.width,\n\t\t\t\t...(input.alt ? { alt: input.alt } : {}),\n\t\t\t\t...(input.credits ? { credits: input.credits } : {}),\n\t\t\t\t...(input.provider ? { provider: input.provider } : {}),\n\t\t\t\t...(input.thumbnails ? { thumbnails: input.thumbnails } : {}),\n\t\t\t\t...(input.url ? { url: input.url } : {}),\n\t\t\t},\n\t\t\ttypes: { [ctx.keyOfType]: \"Image\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAOA,SAAgB,qBAAqB,OAAkC;
|
|
1
|
+
{"version":3,"file":"image.js","names":[],"sources":["../../../src/content/codec/image.ts"],"sourcesContent":["import { ImageContentSchema, ImageContentType } from \"../image\"\nimport type { ImageContent } from \"../image\"\nimport type { ImageLegacy } from \"../legacy/image\"\nimport { ImageLegacySchema } from \"../legacy/image\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\n// Also used by content/codec/richText\nexport function imageLegacyToContent(value: ImageLegacy): ImageContent {\n\treturn { ...value, __TYPE__: ImageContentType }\n}\n\nexport const ImageLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<ImageContent, ImageLegacy> => ({\n\tname: \"ImageLegacy\",\n\n\tis(input): input is ImageContent {\n\t\treturn ImageContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = ImageLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: imageLegacyToContent(parsed.data),\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: {\n\t\t\t\tedit: input.edit,\n\t\t\t\theight: input.height,\n\t\t\t\torigin: input.origin,\n\t\t\t\twidth: input.width,\n\t\t\t\t...(input.alt ? { alt: input.alt } : {}),\n\t\t\t\t...(input.credits ? { credits: input.credits } : {}),\n\t\t\t\t...(input.provider ? { provider: input.provider } : {}),\n\t\t\t\t...(input.thumbnails ? { thumbnails: input.thumbnails } : {}),\n\t\t\t\t...(input.url ? { url: input.url } : {}),\n\t\t\t},\n\t\t\ttypes: { [ctx.keyOfType]: \"Image\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAOA,SAAgB,qBAAqB,OAAkC;CACtE,OAAO;EAAE,GAAG;EAAO,UAAU;CAAiB;AAC/C;AAEA,MAAa,oBACZ,SAC6C;CAC7C,MAAM;CAEN,GAAG,OAA8B;EAChC,OAAO,mBAAmB,UAAU,KAAK,CAAC,CAAC;CAC5C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,kBAAkB,UAAU,KAAK;EAChD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM,qBAAqB,OAAO,IAAI;EACvC;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS;IACR,MAAM,MAAM;IACZ,QAAQ,MAAM;IACd,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;IACtC,GAAI,MAAM,UAAU,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;IAClD,GAAI,MAAM,WAAW,EAAE,UAAU,MAAM,SAAS,IAAI,CAAC;IACrD,GAAI,MAAM,aAAa,EAAE,YAAY,MAAM,WAAW,IAAI,CAAC;IAC3D,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;GACvC;GACA,OAAO,GAAG,IAAI,YAAY,QAAQ;GAClC,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrationField.js","names":[],"sources":["../../../src/content/codec/integrationField.ts"],"sourcesContent":["import { IntegrationFieldContentSchema, IntegrationFieldContentType } from \"../integrationField\"\nimport type { IntegrationFieldContent } from \"../integrationField\"\nimport { IntegrationFieldLegacySchema } from \"../legacy/integrationField\"\nimport type { IntegrationFieldLegacy } from \"../legacy/integrationField\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nexport const IntegrationFieldLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<IntegrationFieldContent, IntegrationFieldLegacy> => ({\n\tname: \"IntegrationFieldLegacy\",\n\n\tis(input): input is IntegrationFieldContent {\n\t\treturn IntegrationFieldContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = IntegrationFieldLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: IntegrationFieldContentType,\n\t\t\t\tvalue: parsed.data,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: input.value,\n\t\t\ttypes: { [ctx.keyOfType]: \"IntegrationFields\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAMA,MAAa,+BACZ,SACmE;CACnE,MAAM;CAEN,GAAG,OAAyC;
|
|
1
|
+
{"version":3,"file":"integrationField.js","names":[],"sources":["../../../src/content/codec/integrationField.ts"],"sourcesContent":["import { IntegrationFieldContentSchema, IntegrationFieldContentType } from \"../integrationField\"\nimport type { IntegrationFieldContent } from \"../integrationField\"\nimport { IntegrationFieldLegacySchema } from \"../legacy/integrationField\"\nimport type { IntegrationFieldLegacy } from \"../legacy/integrationField\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nexport const IntegrationFieldLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<IntegrationFieldContent, IntegrationFieldLegacy> => ({\n\tname: \"IntegrationFieldLegacy\",\n\n\tis(input): input is IntegrationFieldContent {\n\t\treturn IntegrationFieldContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = IntegrationFieldLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: IntegrationFieldContentType,\n\t\t\t\tvalue: parsed.data,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: input.value,\n\t\t\ttypes: { [ctx.keyOfType]: \"IntegrationFields\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAMA,MAAa,+BACZ,SACmE;CACnE,MAAM;CAEN,GAAG,OAAyC;EAC3C,OAAO,8BAA8B,UAAU,KAAK,CAAC,CAAC;CACvD;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,6BAA6B,UAAU,KAAK;EAC3D,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM;IACL,UAAU;IACV,OAAO,OAAO;GACf;EACD;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS,MAAM;GACf,OAAO,GAAG,IAAI,YAAY,oBAAoB;GAC9C,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldOrSliceType } from "../../model/widget.js";
|
|
2
2
|
import { z } from "zod/mini";
|
|
3
|
-
|
|
4
3
|
//#region src/content/codec/legacyContentCtx.d.ts
|
|
5
4
|
interface LegacyContentCtxParams {
|
|
6
5
|
fieldKey: string;
|
|
@@ -22,14 +21,7 @@ declare class LegacyContentCtx {
|
|
|
22
21
|
contentKey: string;
|
|
23
22
|
contentPath: Array<string>;
|
|
24
23
|
fieldContentKey: string;
|
|
25
|
-
constructor({
|
|
26
|
-
fieldKey,
|
|
27
|
-
contentKey,
|
|
28
|
-
contentPath,
|
|
29
|
-
fieldPath,
|
|
30
|
-
allTypes,
|
|
31
|
-
allKeys
|
|
32
|
-
}: LegacyContentCtxParams);
|
|
24
|
+
constructor({ fieldKey, contentKey, contentPath, fieldPath, allTypes, allKeys }: LegacyContentCtxParams);
|
|
33
25
|
withContentKey(contentKey: string): LegacyContentCtx;
|
|
34
26
|
}
|
|
35
27
|
interface GetFieldCtxParams {
|
|
@@ -38,12 +30,7 @@ interface GetFieldCtxParams {
|
|
|
38
30
|
ctx: LegacyContentCtx;
|
|
39
31
|
prefixes?: Array<string>;
|
|
40
32
|
}
|
|
41
|
-
declare function getFieldCtx({
|
|
42
|
-
fieldKey,
|
|
43
|
-
contentKey: contentKeyParam,
|
|
44
|
-
ctx,
|
|
45
|
-
prefixes
|
|
46
|
-
}: GetFieldCtxParams): LegacyContentCtx;
|
|
33
|
+
declare function getFieldCtx({ fieldKey, contentKey: contentKeyParam, ctx, prefixes }: GetFieldCtxParams): LegacyContentCtx;
|
|
47
34
|
declare function defaultCtx(key: string, allTypes?: Map<string, FieldOrSliceType>, allKeys?: Map<string, string>): LegacyContentCtx;
|
|
48
35
|
//#endregion
|
|
49
36
|
export { LegacyContentCtx, defaultCtx, getFieldCtx };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacyContentCtx.d.ts","names":[],"sources":["../../../src/content/codec/legacyContentCtx.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"legacyContentCtx.d.ts","names":[],"sources":["../../../src/content/codec/legacyContentCtx.ts"],"mappings":";;;UAIU;EACT;EACA;EACA,YAAY;EACZ,cAAc;EACd,WAAW,YAAY;EACvB,UAAU;;cAGE;EACZ;EACA;EACA;EACA;EACA,WAAW;EACX,YAAY;EACZ,UAAU,YAAY;EACtB,SAAS;EACT;EACA,aAAa;EACb;EAEA,cACC,UACA,YACA,aACA,WACA,UACA,WACE;EAmBH,eAAe,qBAAqB;;UAS3B;EACT;EACA;EACA,KAAK;EACL,WAAW;;iBAGI,cACf,UACA,YAAY,iBACZ,KACA,YACE,oBAAoB;iBAYP,WACf,aACA,WAAU,YAAY,mBACtB,UAAS,sBACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacyContentCtx.js","names":[],"sources":["../../../src/content/codec/legacyContentCtx.ts"],"sourcesContent":["import type { z } from \"zod/mini\"\n\nimport type { FieldOrSliceType } from \"../../model/widget\"\n\ninterface LegacyContentCtxParams {\n\tfieldKey: string\n\tcontentKey?: string\n\tfieldPath?: Array<string>\n\tcontentPath?: Array<string>\n\tallTypes?: Map<string, FieldOrSliceType>\n\tallKeys?: Map<string, string>\n}\n\nexport class LegacyContentCtx {\n\tfieldKey: string\n\tprefixedKey: string\n\tkeyOfType: string\n\tkeyOfKey: string\n\tfieldPath: Array<string>\n\tfieldType?: FieldOrSliceType | undefined\n\tallTypes: Map<string, FieldOrSliceType>\n\tallKeys: Map<string, string>\n\tcontentKey: string\n\tcontentPath: Array<string>\n\tfieldContentKey: string\n\n\tconstructor({\n\t\tfieldKey,\n\t\tcontentKey,\n\t\tcontentPath,\n\t\tfieldPath,\n\t\tallTypes,\n\t\tallKeys,\n\t}: LegacyContentCtxParams) {\n\t\tthis.fieldKey = fieldKey\n\t\tthis.contentKey = contentKey || fieldKey\n\t\tthis.fieldPath = fieldPath || []\n\t\tthis.contentPath = contentPath || []\n\t\tthis.allTypes = allTypes || new Map<string, FieldOrSliceType>()\n\t\tthis.allKeys = allKeys || new Map<string, string>()\n\n\t\tconst prefixedKey = Array.of(this.fieldPath, [this.fieldKey]).flat().join(\".\")\n\n\t\tconst prefixedContentKey = Array.of(this.contentPath, [this.contentKey]).flat().join(\".\")\n\n\t\tthis.prefixedKey = prefixedKey\n\t\tthis.keyOfType = `${prefixedKey}_TYPE`\n\t\tthis.keyOfKey = `${prefixedContentKey}_KEY`\n\t\tthis.fieldType = this.allTypes.get(this.prefixedKey)\n\t\tthis.fieldContentKey = this.allKeys.get(prefixedContentKey) ?? crypto.randomUUID()\n\t}\n\n\twithContentKey(contentKey: string): LegacyContentCtx {\n\t\treturn new LegacyContentCtx({\n\t\t\t...this,\n\t\t\tcontentPath: [...this.contentPath, this.contentKey],\n\t\t\tcontentKey,\n\t\t})\n\t}\n}\n\ninterface GetFieldCtxParams {\n\tfieldKey: string\n\tcontentKey?: string\n\tctx: LegacyContentCtx\n\tprefixes?: Array<string>\n}\n\nexport function getFieldCtx({\n\tfieldKey,\n\tcontentKey: contentKeyParam,\n\tctx,\n\tprefixes,\n}: GetFieldCtxParams): LegacyContentCtx {\n\tconst contentKey = contentKeyParam || fieldKey\n\treturn new LegacyContentCtx({\n\t\tfieldKey,\n\t\tcontentKey,\n\t\tcontentPath: [...ctx.contentPath, ctx.contentKey, ...(prefixes || [])],\n\t\tfieldPath: [...ctx.fieldPath, ctx.fieldKey, ...(prefixes || [])],\n\t\tallTypes: ctx.allTypes,\n\t\tallKeys: ctx.allKeys,\n\t})\n}\n\nexport function defaultCtx(\n\tkey: string,\n\tallTypes: Map<string, FieldOrSliceType> = new Map(),\n\tallKeys: Map<string, string> = new Map(),\n): LegacyContentCtx {\n\treturn new LegacyContentCtx({\n\t\tfieldKey: key,\n\t\tcontentKey: key,\n\t\tcontentPath: [],\n\t\tfieldPath: [],\n\t\tallTypes,\n\t\tallKeys,\n\t})\n}\n\ntype WithTypes<T> = {\n\tkeys: Record<string, string>\n\ttypes: Record<string, FieldOrSliceType>\n\tcontent: T\n}\n\nexport type LegacyCodec<A, LegacyRaw, AllowUndefined extends boolean = false> = {\n\tname: string\n\tis(input: unknown): input is A\n\ttoContent(\n\t\tinput: unknown,\n\t): z.core.util.SafeParseSuccess<A> | z.core.util.SafeParseError<LegacyRaw | unknown>\n\tfromContent(\n\t\tvalue: A,\n\t): AllowUndefined extends false ? WithTypes<LegacyRaw> : WithTypes<LegacyRaw> | undefined\n}\n"],"mappings":";AAaA,IAAa,mBAAb,MAAa,iBAAiB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,EACX,UACA,YACA,aACA,WACA,UACA,WAC0B;
|
|
1
|
+
{"version":3,"file":"legacyContentCtx.js","names":[],"sources":["../../../src/content/codec/legacyContentCtx.ts"],"sourcesContent":["import type { z } from \"zod/mini\"\n\nimport type { FieldOrSliceType } from \"../../model/widget\"\n\ninterface LegacyContentCtxParams {\n\tfieldKey: string\n\tcontentKey?: string\n\tfieldPath?: Array<string>\n\tcontentPath?: Array<string>\n\tallTypes?: Map<string, FieldOrSliceType>\n\tallKeys?: Map<string, string>\n}\n\nexport class LegacyContentCtx {\n\tfieldKey: string\n\tprefixedKey: string\n\tkeyOfType: string\n\tkeyOfKey: string\n\tfieldPath: Array<string>\n\tfieldType?: FieldOrSliceType | undefined\n\tallTypes: Map<string, FieldOrSliceType>\n\tallKeys: Map<string, string>\n\tcontentKey: string\n\tcontentPath: Array<string>\n\tfieldContentKey: string\n\n\tconstructor({\n\t\tfieldKey,\n\t\tcontentKey,\n\t\tcontentPath,\n\t\tfieldPath,\n\t\tallTypes,\n\t\tallKeys,\n\t}: LegacyContentCtxParams) {\n\t\tthis.fieldKey = fieldKey\n\t\tthis.contentKey = contentKey || fieldKey\n\t\tthis.fieldPath = fieldPath || []\n\t\tthis.contentPath = contentPath || []\n\t\tthis.allTypes = allTypes || new Map<string, FieldOrSliceType>()\n\t\tthis.allKeys = allKeys || new Map<string, string>()\n\n\t\tconst prefixedKey = Array.of(this.fieldPath, [this.fieldKey]).flat().join(\".\")\n\n\t\tconst prefixedContentKey = Array.of(this.contentPath, [this.contentKey]).flat().join(\".\")\n\n\t\tthis.prefixedKey = prefixedKey\n\t\tthis.keyOfType = `${prefixedKey}_TYPE`\n\t\tthis.keyOfKey = `${prefixedContentKey}_KEY`\n\t\tthis.fieldType = this.allTypes.get(this.prefixedKey)\n\t\tthis.fieldContentKey = this.allKeys.get(prefixedContentKey) ?? crypto.randomUUID()\n\t}\n\n\twithContentKey(contentKey: string): LegacyContentCtx {\n\t\treturn new LegacyContentCtx({\n\t\t\t...this,\n\t\t\tcontentPath: [...this.contentPath, this.contentKey],\n\t\t\tcontentKey,\n\t\t})\n\t}\n}\n\ninterface GetFieldCtxParams {\n\tfieldKey: string\n\tcontentKey?: string\n\tctx: LegacyContentCtx\n\tprefixes?: Array<string>\n}\n\nexport function getFieldCtx({\n\tfieldKey,\n\tcontentKey: contentKeyParam,\n\tctx,\n\tprefixes,\n}: GetFieldCtxParams): LegacyContentCtx {\n\tconst contentKey = contentKeyParam || fieldKey\n\treturn new LegacyContentCtx({\n\t\tfieldKey,\n\t\tcontentKey,\n\t\tcontentPath: [...ctx.contentPath, ctx.contentKey, ...(prefixes || [])],\n\t\tfieldPath: [...ctx.fieldPath, ctx.fieldKey, ...(prefixes || [])],\n\t\tallTypes: ctx.allTypes,\n\t\tallKeys: ctx.allKeys,\n\t})\n}\n\nexport function defaultCtx(\n\tkey: string,\n\tallTypes: Map<string, FieldOrSliceType> = new Map(),\n\tallKeys: Map<string, string> = new Map(),\n): LegacyContentCtx {\n\treturn new LegacyContentCtx({\n\t\tfieldKey: key,\n\t\tcontentKey: key,\n\t\tcontentPath: [],\n\t\tfieldPath: [],\n\t\tallTypes,\n\t\tallKeys,\n\t})\n}\n\ntype WithTypes<T> = {\n\tkeys: Record<string, string>\n\ttypes: Record<string, FieldOrSliceType>\n\tcontent: T\n}\n\nexport type LegacyCodec<A, LegacyRaw, AllowUndefined extends boolean = false> = {\n\tname: string\n\tis(input: unknown): input is A\n\ttoContent(\n\t\tinput: unknown,\n\t): z.core.util.SafeParseSuccess<A> | z.core.util.SafeParseError<LegacyRaw | unknown>\n\tfromContent(\n\t\tvalue: A,\n\t): AllowUndefined extends false ? WithTypes<LegacyRaw> : WithTypes<LegacyRaw> | undefined\n}\n"],"mappings":";AAaA,IAAa,mBAAb,MAAa,iBAAiB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,EACX,UACA,YACA,aACA,WACA,UACA,WAC0B;EAC1B,KAAK,WAAW;EAChB,KAAK,aAAa,cAAc;EAChC,KAAK,YAAY,aAAa,CAAC;EAC/B,KAAK,cAAc,eAAe,CAAC;EACnC,KAAK,WAAW,4BAAY,IAAI,IAA8B;EAC9D,KAAK,UAAU,2BAAW,IAAI,IAAoB;EAElD,MAAM,cAAc,MAAM,GAAG,KAAK,WAAW,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG;EAE7E,MAAM,qBAAqB,MAAM,GAAG,KAAK,aAAa,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG;EAExF,KAAK,cAAc;EACnB,KAAK,YAAY,GAAG,YAAY;EAChC,KAAK,WAAW,GAAG,mBAAmB;EACtC,KAAK,YAAY,KAAK,SAAS,IAAI,KAAK,WAAW;EACnD,KAAK,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,KAAK,OAAO,WAAW;CAClF;CAEA,eAAe,YAAsC;EACpD,OAAO,IAAI,iBAAiB;GAC3B,GAAG;GACH,aAAa,CAAC,GAAG,KAAK,aAAa,KAAK,UAAU;GAClD;EACD,CAAC;CACF;AACD;AASA,SAAgB,YAAY,EAC3B,UACA,YAAY,iBACZ,KACA,YACuC;CAEvC,OAAO,IAAI,iBAAiB;EAC3B;EACA,YAHkB,mBAAmB;EAIrC,aAAa;GAAC,GAAG,IAAI;GAAa,IAAI;GAAY,GAAI,YAAY,CAAC;EAAE;EACrE,WAAW;GAAC,GAAG,IAAI;GAAW,IAAI;GAAU,GAAI,YAAY,CAAC;EAAE;EAC/D,UAAU,IAAI;EACd,SAAS,IAAI;CACd,CAAC;AACF;AAEA,SAAgB,WACf,KACA,2BAA0C,IAAI,IAAI,GAClD,0BAA+B,IAAI,IAAI,GACpB;CACnB,OAAO,IAAI,iBAAiB;EAC3B,UAAU;EACV,YAAY;EACZ,aAAa,CAAC;EACd,WAAW,CAAC;EACZ;EACA;CACD,CAAC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":[],"sources":["../../../src/content/codec/link.ts"],"sourcesContent":["import type {\n\tEmptyLinkLegacyValue,\n\tFilledLinkLegacyValue,\n\tLinkLegacyValue,\n\tLinkLegacy,\n} from \"../legacy/link\"\nimport { LinkKind, LinkType, LinkLegacySchema } from \"../legacy/link\"\nimport { LinkContentSchema, LinkContentType } from \"../link\"\nimport type {\n\tEmptyLinkContentValue,\n\tFilledLinkContentValue,\n\tLinkContent,\n\tLinkContentValue,\n} from \"../link\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\n// Also used by content/codec/richText\nexport function linkLegacyToValue(value: FilledLinkLegacyValue): FilledLinkContentValue\nexport function linkLegacyToValue(value: EmptyLinkLegacyValue): EmptyLinkContentValue\nexport function linkLegacyToValue(value: LinkLegacyValue): LinkContentValue\nexport function linkLegacyToValue(\n\tvalue: Omit<LinkLegacy, \"text\" | \"variant\" | \"key\">,\n): Omit<LinkContent[\"value\"], \"text\" | \"variant\"> {\n\tlet content: Omit<LinkContent[\"value\"], \"text\" | \"variant\">\n\tswitch (value.kind) {\n\t\tcase LinkKind.Image:\n\t\t\tcontent = { __TYPE__: LinkType.Image, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.File:\n\t\t\tcontent = { __TYPE__: LinkType.File, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.Document:\n\t\t\tcontent = { __TYPE__: LinkType.Document, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.External:\n\t\t\tcontent = { __TYPE__: LinkType.External, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.Media:\n\t\t\tcontent = { __TYPE__: LinkType.Media, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.Any:\n\t\tdefault:\n\t\t\tcontent = { __TYPE__: LinkType.Any, ...value }\n\t\t\tbreak\n\t}\n\n\treturn content\n}\n\n// Also used by content/codec/repeatable\nexport function linkLegacyToContent({ key, text, variant, ...legacy }: LinkLegacy): LinkContent {\n\treturn {\n\t\t__TYPE__: LinkContentType,\n\t\tkey,\n\t\tvalue: {\n\t\t\t...(text ? { text } : {}),\n\t\t\t...(variant ? { variant } : {}),\n\t\t\t...linkLegacyToValue(legacy),\n\t\t},\n\t}\n}\n\n// Also used by content/codec/richText\nexport function linkValueToLegacy(value: FilledLinkContentValue): FilledLinkLegacyValue\nexport function linkValueToLegacy(value: EmptyLinkContentValue): EmptyLinkLegacyValue\nexport function linkValueToLegacy(value: LinkContentValue): LinkLegacyValue {\n\tconst { __TYPE__, ...legacy } = value\n\treturn legacy\n}\n\nfunction linkContentToLegacy({ key, value }: LinkContent): LinkLegacy {\n\tconst { __TYPE__, ...legacy } = value\n\n\treturn { key, ...legacy }\n}\n\nexport const LinkLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<LinkContent, LinkLegacy> => ({\n\tname: \"LinkLegacy\",\n\n\tis(input): input is LinkContent {\n\t\treturn LinkContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = LinkLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: linkLegacyToContent(parsed.data),\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: linkContentToLegacy(input),\n\t\t\ttypes: { [ctx.keyOfType]: \"Link\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAoBA,SAAgB,kBACf,OACiD;CACjD,IAAI;
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../../src/content/codec/link.ts"],"sourcesContent":["import type {\n\tEmptyLinkLegacyValue,\n\tFilledLinkLegacyValue,\n\tLinkLegacyValue,\n\tLinkLegacy,\n} from \"../legacy/link\"\nimport { LinkKind, LinkType, LinkLegacySchema } from \"../legacy/link\"\nimport { LinkContentSchema, LinkContentType } from \"../link\"\nimport type {\n\tEmptyLinkContentValue,\n\tFilledLinkContentValue,\n\tLinkContent,\n\tLinkContentValue,\n} from \"../link\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\n// Also used by content/codec/richText\nexport function linkLegacyToValue(value: FilledLinkLegacyValue): FilledLinkContentValue\nexport function linkLegacyToValue(value: EmptyLinkLegacyValue): EmptyLinkContentValue\nexport function linkLegacyToValue(value: LinkLegacyValue): LinkContentValue\nexport function linkLegacyToValue(\n\tvalue: Omit<LinkLegacy, \"text\" | \"variant\" | \"key\">,\n): Omit<LinkContent[\"value\"], \"text\" | \"variant\"> {\n\tlet content: Omit<LinkContent[\"value\"], \"text\" | \"variant\">\n\tswitch (value.kind) {\n\t\tcase LinkKind.Image:\n\t\t\tcontent = { __TYPE__: LinkType.Image, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.File:\n\t\t\tcontent = { __TYPE__: LinkType.File, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.Document:\n\t\t\tcontent = { __TYPE__: LinkType.Document, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.External:\n\t\t\tcontent = { __TYPE__: LinkType.External, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.Media:\n\t\t\tcontent = { __TYPE__: LinkType.Media, ...value }\n\t\t\tbreak\n\t\tcase LinkKind.Any:\n\t\tdefault:\n\t\t\tcontent = { __TYPE__: LinkType.Any, ...value }\n\t\t\tbreak\n\t}\n\n\treturn content\n}\n\n// Also used by content/codec/repeatable\nexport function linkLegacyToContent({ key, text, variant, ...legacy }: LinkLegacy): LinkContent {\n\treturn {\n\t\t__TYPE__: LinkContentType,\n\t\tkey,\n\t\tvalue: {\n\t\t\t...(text ? { text } : {}),\n\t\t\t...(variant ? { variant } : {}),\n\t\t\t...linkLegacyToValue(legacy),\n\t\t},\n\t}\n}\n\n// Also used by content/codec/richText\nexport function linkValueToLegacy(value: FilledLinkContentValue): FilledLinkLegacyValue\nexport function linkValueToLegacy(value: EmptyLinkContentValue): EmptyLinkLegacyValue\nexport function linkValueToLegacy(value: LinkContentValue): LinkLegacyValue {\n\tconst { __TYPE__, ...legacy } = value\n\treturn legacy\n}\n\nfunction linkContentToLegacy({ key, value }: LinkContent): LinkLegacy {\n\tconst { __TYPE__, ...legacy } = value\n\n\treturn { key, ...legacy }\n}\n\nexport const LinkLegacyCodec = (ctx: LegacyContentCtx): LegacyCodec<LinkContent, LinkLegacy> => ({\n\tname: \"LinkLegacy\",\n\n\tis(input): input is LinkContent {\n\t\treturn LinkContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = LinkLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: linkLegacyToContent(parsed.data),\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: linkContentToLegacy(input),\n\t\t\ttypes: { [ctx.keyOfType]: \"Link\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;AAoBA,SAAgB,kBACf,OACiD;CACjD,IAAI;CACJ,QAAQ,MAAM,MAAd;EACC,KAAK,SAAS;GACb,UAAU;IAAE,UAAU,SAAS;IAAO,GAAG;GAAM;GAC/C;EACD,KAAK,SAAS;GACb,UAAU;IAAE,UAAU,SAAS;IAAM,GAAG;GAAM;GAC9C;EACD,KAAK,SAAS;GACb,UAAU;IAAE,UAAU,SAAS;IAAU,GAAG;GAAM;GAClD;EACD,KAAK,SAAS;GACb,UAAU;IAAE,UAAU,SAAS;IAAU,GAAG;GAAM;GAClD;EACD,KAAK,SAAS;GACb,UAAU;IAAE,UAAU,SAAS;IAAO,GAAG;GAAM;GAC/C;EACD,KAAK,SAAS;EACd;GACC,UAAU;IAAE,UAAU,SAAS;IAAK,GAAG;GAAM;GAC7C;CACF;CAEA,OAAO;AACR;AAGA,SAAgB,oBAAoB,EAAE,KAAK,MAAM,SAAS,GAAG,UAAmC;CAC/F,OAAO;EACN,UAAU;EACV;EACA,OAAO;GACN,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC;GACvB,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;GAC7B,GAAG,kBAAkB,MAAM;EAC5B;CACD;AACD;AAKA,SAAgB,kBAAkB,OAA0C;CAC3E,MAAM,EAAE,UAAU,GAAG,WAAW;CAChC,OAAO;AACR;AAEA,SAAS,oBAAoB,EAAE,KAAK,SAAkC;CACrE,MAAM,EAAE,UAAU,GAAG,WAAW;CAEhC,OAAO;EAAE;EAAK,GAAG;CAAO;AACzB;AAEA,MAAa,mBAAmB,SAAiE;CAChG,MAAM;CAEN,GAAG,OAA6B;EAC/B,OAAO,kBAAkB,UAAU,KAAK,CAAC,CAAC;CAC3C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,iBAAiB,UAAU,KAAK;EAC/C,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM,oBAAoB,OAAO,IAAI;EACtC;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS,oBAAoB,KAAK;GAClC,OAAO,GAAG,IAAI,YAAY,OAAO;GACjC,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestable.js","names":[],"sources":["../../../src/content/codec/nestable.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { BooleanContentType } from \"../boolean\"\nimport { EmbedContentType } from \"../embed\"\nimport { EmptyContentType } from \"../empty\"\nimport { FieldContentType } from \"../field\"\nimport { GeoPointContentType } from \"../geopoint\"\nimport { ImageContentType } from \"../image\"\nimport { IntegrationFieldContentType } from \"../integrationField\"\nimport type { NestableLegacy } from \"../legacy/nestable\"\nimport { LinkContentType } from \"../link\"\nimport type { NestableContent } from \"../nestable\"\nimport { NestableContentSchema } from \"../nestable\"\nimport { RepeatableContentType } from \"../repeatable\"\nimport { RichTextContentType } from \"../richText\"\nimport { SeparatorContentType } from \"../separator\"\nimport { TableContentType } from \"../table\"\nimport { BooleanLegacyCodec } from \"./boolean\"\nimport { EmbedLegacyCodec } from \"./embed\"\nimport { EmptyLegacyCodec } from \"./empty\"\nimport {\n\tColorLegacyCodec,\n\tDateLegacyCodec,\n\tNumberLegacyCodec,\n\tRangeLegacyCodec,\n\tSelectLegacyCodec,\n\tTextLegacyCodec,\n\tTimestampLegacyCodec,\n} from \"./field\"\nimport { GeoPointLegacyCodec } from \"./geopoint\"\nimport { ImageLegacyCodec } from \"./image\"\nimport { IntegrationFieldLegacyCodec } from \"./integrationField\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\nimport { LinkLegacyCodec } from \"./link\"\nimport { RepeatableLegacyCodec } from \"./repeatable\"\nimport { RichTextLegacyCodec } from \"./richText\"\nimport { SeparatorLegacyCodec } from \"./separator\"\nimport { TableLegacyCodec } from \"./table\"\n\nconst UnsupportedNestableLegacySchema = z.never()\n\nexport const NestableLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<NestableContent, NestableLegacy, true> => ({\n\tname: \"NestableLegacy\",\n\n\tis(input): input is NestableContent {\n\t\treturn NestableContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tif (!ctx.fieldType) {\n\t\t\treturn UnsupportedNestableLegacySchema.safeParse(\n\t\t\t\tinput,\n\t\t\t) as z.core.util.SafeParseError<NestableLegacy>\n\t\t}\n\n\t\tconst empty = EmptyLegacyCodec(ctx).toContent(input)\n\t\tif (empty.success) {\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: empty.data,\n\t\t\t}\n\t\t}\n\n\t\tswitch (ctx.fieldType) {\n\t\t\tcase \"Text\":\n\t\t\t\treturn TextLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Color\":\n\t\t\t\treturn ColorLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Date\":\n\t\t\t\treturn DateLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Timestamp\":\n\t\t\t\treturn TimestampLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Number\":\n\t\t\t\treturn NumberLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Range\":\n\t\t\t\treturn RangeLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Select\":\n\t\t\t\treturn SelectLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"GeoPoint\":\n\t\t\t\treturn GeoPointLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"StructuredText\":\n\t\t\t\treturn RichTextLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Boolean\":\n\t\t\t\treturn BooleanLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Embed\":\n\t\t\t\treturn EmbedLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Image\":\n\t\t\t\treturn ImageLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"IntegrationFields\":\n\t\t\t\treturn IntegrationFieldLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Link\":\n\t\t\t\treturn LinkLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Separator\":\n\t\t\t\treturn SeparatorLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Table\":\n\t\t\t\treturn TableLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Repeatable.Link\":\n\t\t\t\treturn RepeatableLegacyCodec(ctx, \"Link\").toContent(input)\n\t\t\tdefault:\n\t\t\t\treturn UnsupportedNestableLegacySchema.safeParse(\n\t\t\t\t\tinput,\n\t\t\t\t) as z.core.util.SafeParseError<NestableLegacy>\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tswitch (input.__TYPE__) {\n\t\t\tcase FieldContentType: {\n\t\t\t\tif (input.type === \"Text\") return TextLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Color\") return ColorLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Range\") return RangeLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Date\") return DateLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Number\") return NumberLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Timestamp\") return TimestampLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Select\") return SelectLegacyCodec(ctx).fromContent(input)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tcase GeoPointContentType:\n\t\t\t\treturn GeoPointLegacyCodec(ctx).fromContent(input)\n\t\t\tcase RichTextContentType:\n\t\t\t\treturn RichTextLegacyCodec(ctx).fromContent(input)\n\t\t\tcase EmbedContentType:\n\t\t\t\treturn EmbedLegacyCodec(ctx).fromContent(input)\n\t\t\tcase BooleanContentType:\n\t\t\t\treturn BooleanLegacyCodec(ctx).fromContent(input)\n\t\t\tcase ImageContentType:\n\t\t\t\treturn ImageLegacyCodec(ctx).fromContent(input)\n\t\t\tcase IntegrationFieldContentType:\n\t\t\t\treturn IntegrationFieldLegacyCodec(ctx).fromContent(input)\n\t\t\tcase LinkContentType:\n\t\t\t\treturn LinkLegacyCodec(ctx).fromContent(input)\n\t\t\tcase SeparatorContentType:\n\t\t\t\treturn SeparatorLegacyCodec(ctx).fromContent(input)\n\t\t\tcase TableContentType:\n\t\t\t\treturn TableLegacyCodec(ctx).fromContent(input)\n\t\t\tcase RepeatableContentType:\n\t\t\t\treturn RepeatableLegacyCodec(ctx, input.type).fromContent(input)\n\n\t\t\tcase EmptyContentType:\n\t\t\tdefault:\n\t\t\t\treturn undefined\n\t\t}\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,kCAAkC,EAAE,
|
|
1
|
+
{"version":3,"file":"nestable.js","names":[],"sources":["../../../src/content/codec/nestable.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { BooleanContentType } from \"../boolean\"\nimport { EmbedContentType } from \"../embed\"\nimport { EmptyContentType } from \"../empty\"\nimport { FieldContentType } from \"../field\"\nimport { GeoPointContentType } from \"../geopoint\"\nimport { ImageContentType } from \"../image\"\nimport { IntegrationFieldContentType } from \"../integrationField\"\nimport type { NestableLegacy } from \"../legacy/nestable\"\nimport { LinkContentType } from \"../link\"\nimport type { NestableContent } from \"../nestable\"\nimport { NestableContentSchema } from \"../nestable\"\nimport { RepeatableContentType } from \"../repeatable\"\nimport { RichTextContentType } from \"../richText\"\nimport { SeparatorContentType } from \"../separator\"\nimport { TableContentType } from \"../table\"\nimport { BooleanLegacyCodec } from \"./boolean\"\nimport { EmbedLegacyCodec } from \"./embed\"\nimport { EmptyLegacyCodec } from \"./empty\"\nimport {\n\tColorLegacyCodec,\n\tDateLegacyCodec,\n\tNumberLegacyCodec,\n\tRangeLegacyCodec,\n\tSelectLegacyCodec,\n\tTextLegacyCodec,\n\tTimestampLegacyCodec,\n} from \"./field\"\nimport { GeoPointLegacyCodec } from \"./geopoint\"\nimport { ImageLegacyCodec } from \"./image\"\nimport { IntegrationFieldLegacyCodec } from \"./integrationField\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\nimport { LinkLegacyCodec } from \"./link\"\nimport { RepeatableLegacyCodec } from \"./repeatable\"\nimport { RichTextLegacyCodec } from \"./richText\"\nimport { SeparatorLegacyCodec } from \"./separator\"\nimport { TableLegacyCodec } from \"./table\"\n\nconst UnsupportedNestableLegacySchema = z.never()\n\nexport const NestableLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<NestableContent, NestableLegacy, true> => ({\n\tname: \"NestableLegacy\",\n\n\tis(input): input is NestableContent {\n\t\treturn NestableContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tif (!ctx.fieldType) {\n\t\t\treturn UnsupportedNestableLegacySchema.safeParse(\n\t\t\t\tinput,\n\t\t\t) as z.core.util.SafeParseError<NestableLegacy>\n\t\t}\n\n\t\tconst empty = EmptyLegacyCodec(ctx).toContent(input)\n\t\tif (empty.success) {\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: empty.data,\n\t\t\t}\n\t\t}\n\n\t\tswitch (ctx.fieldType) {\n\t\t\tcase \"Text\":\n\t\t\t\treturn TextLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Color\":\n\t\t\t\treturn ColorLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Date\":\n\t\t\t\treturn DateLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Timestamp\":\n\t\t\t\treturn TimestampLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Number\":\n\t\t\t\treturn NumberLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Range\":\n\t\t\t\treturn RangeLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Select\":\n\t\t\t\treturn SelectLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"GeoPoint\":\n\t\t\t\treturn GeoPointLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"StructuredText\":\n\t\t\t\treturn RichTextLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Boolean\":\n\t\t\t\treturn BooleanLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Embed\":\n\t\t\t\treturn EmbedLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Image\":\n\t\t\t\treturn ImageLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"IntegrationFields\":\n\t\t\t\treturn IntegrationFieldLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Link\":\n\t\t\t\treturn LinkLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Separator\":\n\t\t\t\treturn SeparatorLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Table\":\n\t\t\t\treturn TableLegacyCodec(ctx).toContent(input)\n\t\t\tcase \"Repeatable.Link\":\n\t\t\t\treturn RepeatableLegacyCodec(ctx, \"Link\").toContent(input)\n\t\t\tdefault:\n\t\t\t\treturn UnsupportedNestableLegacySchema.safeParse(\n\t\t\t\t\tinput,\n\t\t\t\t) as z.core.util.SafeParseError<NestableLegacy>\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tswitch (input.__TYPE__) {\n\t\t\tcase FieldContentType: {\n\t\t\t\tif (input.type === \"Text\") return TextLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Color\") return ColorLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Range\") return RangeLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Date\") return DateLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Number\") return NumberLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Timestamp\") return TimestampLegacyCodec(ctx).fromContent(input)\n\t\t\t\tif (input.type === \"Select\") return SelectLegacyCodec(ctx).fromContent(input)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tcase GeoPointContentType:\n\t\t\t\treturn GeoPointLegacyCodec(ctx).fromContent(input)\n\t\t\tcase RichTextContentType:\n\t\t\t\treturn RichTextLegacyCodec(ctx).fromContent(input)\n\t\t\tcase EmbedContentType:\n\t\t\t\treturn EmbedLegacyCodec(ctx).fromContent(input)\n\t\t\tcase BooleanContentType:\n\t\t\t\treturn BooleanLegacyCodec(ctx).fromContent(input)\n\t\t\tcase ImageContentType:\n\t\t\t\treturn ImageLegacyCodec(ctx).fromContent(input)\n\t\t\tcase IntegrationFieldContentType:\n\t\t\t\treturn IntegrationFieldLegacyCodec(ctx).fromContent(input)\n\t\t\tcase LinkContentType:\n\t\t\t\treturn LinkLegacyCodec(ctx).fromContent(input)\n\t\t\tcase SeparatorContentType:\n\t\t\t\treturn SeparatorLegacyCodec(ctx).fromContent(input)\n\t\t\tcase TableContentType:\n\t\t\t\treturn TableLegacyCodec(ctx).fromContent(input)\n\t\t\tcase RepeatableContentType:\n\t\t\t\treturn RepeatableLegacyCodec(ctx, input.type).fromContent(input)\n\n\t\t\tcase EmptyContentType:\n\t\t\tdefault:\n\t\t\t\treturn undefined\n\t\t}\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,kCAAkC,EAAE,MAAM;AAEhD,MAAa,uBACZ,SACyD;CACzD,MAAM;CAEN,GAAG,OAAiC;EACnC,OAAO,sBAAsB,UAAU,KAAK,CAAC,CAAC;CAC/C;CAEA,UAAU,OAAO;EAChB,IAAI,CAAC,IAAI,WACR,OAAO,gCAAgC,UACtC,KACD;EAGD,MAAM,QAAQ,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK;EACnD,IAAI,MAAM,SACT,OAAO;GACN,SAAS;GACT,MAAM,MAAM;EACb;EAGD,QAAQ,IAAI,WAAZ;GACC,KAAK,QACJ,OAAO,gBAAgB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC5C,KAAK,SACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC7C,KAAK,QACJ,OAAO,gBAAgB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC5C,KAAK,aACJ,OAAO,qBAAqB,GAAG,CAAC,CAAC,UAAU,KAAK;GACjD,KAAK,UACJ,OAAO,kBAAkB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC9C,KAAK,SACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC7C,KAAK,UACJ,OAAO,kBAAkB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC9C,KAAK,YACJ,OAAO,oBAAoB,GAAG,CAAC,CAAC,UAAU,KAAK;GAChD,KAAK,kBACJ,OAAO,oBAAoB,GAAG,CAAC,CAAC,UAAU,KAAK;GAChD,KAAK,WACJ,OAAO,mBAAmB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC/C,KAAK,SACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC7C,KAAK,SACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC7C,KAAK,qBACJ,OAAO,4BAA4B,GAAG,CAAC,CAAC,UAAU,KAAK;GACxD,KAAK,QACJ,OAAO,gBAAgB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC5C,KAAK,aACJ,OAAO,qBAAqB,GAAG,CAAC,CAAC,UAAU,KAAK;GACjD,KAAK,SACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,UAAU,KAAK;GAC7C,KAAK,mBACJ,OAAO,sBAAsB,KAAK,MAAM,CAAC,CAAC,UAAU,KAAK;GAC1D,SACC,OAAO,gCAAgC,UACtC,KACD;EACF;CACD;CAEA,YAAY,OAAO;EAClB,QAAQ,MAAM,UAAd;GACC,KAAK;IACJ,IAAI,MAAM,SAAS,QAAQ,OAAO,gBAAgB,GAAG,CAAC,CAAC,YAAY,KAAK;IACxE,IAAI,MAAM,SAAS,SAAS,OAAO,iBAAiB,GAAG,CAAC,CAAC,YAAY,KAAK;IAC1E,IAAI,MAAM,SAAS,SAAS,OAAO,iBAAiB,GAAG,CAAC,CAAC,YAAY,KAAK;IAC1E,IAAI,MAAM,SAAS,QAAQ,OAAO,gBAAgB,GAAG,CAAC,CAAC,YAAY,KAAK;IACxE,IAAI,MAAM,SAAS,UAAU,OAAO,kBAAkB,GAAG,CAAC,CAAC,YAAY,KAAK;IAC5E,IAAI,MAAM,SAAS,aAAa,OAAO,qBAAqB,GAAG,CAAC,CAAC,YAAY,KAAK;IAClF,IAAI,MAAM,SAAS,UAAU,OAAO,kBAAkB,GAAG,CAAC,CAAC,YAAY,KAAK;IAC5E;GAED,KAAK,qBACJ,OAAO,oBAAoB,GAAG,CAAC,CAAC,YAAY,KAAK;GAClD,KAAK,qBACJ,OAAO,oBAAoB,GAAG,CAAC,CAAC,YAAY,KAAK;GAClD,KAAK,kBACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,YAAY,KAAK;GAC/C,KAAK,oBACJ,OAAO,mBAAmB,GAAG,CAAC,CAAC,YAAY,KAAK;GACjD,KAAK,kBACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,YAAY,KAAK;GAC/C,KAAK,6BACJ,OAAO,4BAA4B,GAAG,CAAC,CAAC,YAAY,KAAK;GAC1D,KAAK,iBACJ,OAAO,gBAAgB,GAAG,CAAC,CAAC,YAAY,KAAK;GAC9C,KAAK,sBACJ,OAAO,qBAAqB,GAAG,CAAC,CAAC,YAAY,KAAK;GACnD,KAAK,kBACJ,OAAO,iBAAiB,GAAG,CAAC,CAAC,YAAY,KAAK;GAC/C,KAAK,uBACJ,OAAO,sBAAsB,KAAK,MAAM,IAAI,CAAC,CAAC,YAAY,KAAK;GAEhE,KAAK;GACL,SACC;EACF;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeatable.js","names":[],"sources":["../../../src/content/codec/repeatable.ts"],"sourcesContent":["import { LinkLegacySchema } from \"../legacy/link\"\nimport { RepeatableLegacySchema } from \"../legacy/repeatable\"\nimport type { RepeatableLegacy } from \"../legacy/repeatable\"\nimport { RepeatableContentSchema, RepeatableContentType } from \"../repeatable\"\nimport type { RepeatableContent } from \"../repeatable\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\nimport { LinkLegacyCodec, linkLegacyToContent } from \"./link\"\n\nexport const RepeatableLegacyCodec = (\n\tctx: LegacyContentCtx,\n\tfieldType: \"Link\",\n): LegacyCodec<RepeatableContent, RepeatableLegacy> => ({\n\tname: \"RepeatableLegacy\",\n\n\tis(input): input is RepeatableContent {\n\t\treturn RepeatableContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = RepeatableLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: RepeatableContentType,\n\t\t\t\ttype: fieldType,\n\t\t\t\tvalue: parsed.data.flatMap((item) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tswitch (fieldType) {\n\t\t\t\t\t\t\tcase \"Link\":\n\t\t\t\t\t\t\t\treturn [linkLegacyToContent(LinkLegacySchema.parse(item))]\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn []\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst legacy: ReturnType<LegacyCodec<RepeatableContent, RepeatableLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: [],\n\t\t\ttypes: { [ctx.keyOfType]: `Repeatable.${fieldType}` },\n\t\t\tkeys: {},\n\t\t}\n\n\t\tfor (const item of input.value) {\n\t\t\ttry {\n\t\t\t\tswitch (fieldType) {\n\t\t\t\t\tcase \"Link\":\n\t\t\t\t\t\tconst result = LinkLegacyCodec(ctx).fromContent(item)\n\t\t\t\t\t\tlegacy.content.push(result.content)\n\t\t\t\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// noop, continue\n\t\t\t}\n\t\t}\n\t\treturn legacy\n\t},\n})\n"],"mappings":";;;;;AAQA,MAAa,yBACZ,KACA,eACuD;CACvD,MAAM;CAEN,GAAG,OAAmC;
|
|
1
|
+
{"version":3,"file":"repeatable.js","names":[],"sources":["../../../src/content/codec/repeatable.ts"],"sourcesContent":["import { LinkLegacySchema } from \"../legacy/link\"\nimport { RepeatableLegacySchema } from \"../legacy/repeatable\"\nimport type { RepeatableLegacy } from \"../legacy/repeatable\"\nimport { RepeatableContentSchema, RepeatableContentType } from \"../repeatable\"\nimport type { RepeatableContent } from \"../repeatable\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\nimport { LinkLegacyCodec, linkLegacyToContent } from \"./link\"\n\nexport const RepeatableLegacyCodec = (\n\tctx: LegacyContentCtx,\n\tfieldType: \"Link\",\n): LegacyCodec<RepeatableContent, RepeatableLegacy> => ({\n\tname: \"RepeatableLegacy\",\n\n\tis(input): input is RepeatableContent {\n\t\treturn RepeatableContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = RepeatableLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: RepeatableContentType,\n\t\t\t\ttype: fieldType,\n\t\t\t\tvalue: parsed.data.flatMap((item) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tswitch (fieldType) {\n\t\t\t\t\t\t\tcase \"Link\":\n\t\t\t\t\t\t\t\treturn [linkLegacyToContent(LinkLegacySchema.parse(item))]\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\treturn []\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\tconst legacy: ReturnType<LegacyCodec<RepeatableContent, RepeatableLegacy>[\"fromContent\"]> = {\n\t\t\tcontent: [],\n\t\t\ttypes: { [ctx.keyOfType]: `Repeatable.${fieldType}` },\n\t\t\tkeys: {},\n\t\t}\n\n\t\tfor (const item of input.value) {\n\t\t\ttry {\n\t\t\t\tswitch (fieldType) {\n\t\t\t\t\tcase \"Link\":\n\t\t\t\t\t\tconst result = LinkLegacyCodec(ctx).fromContent(item)\n\t\t\t\t\t\tlegacy.content.push(result.content)\n\t\t\t\t\t\tlegacy.keys = { ...legacy.keys, ...result.keys }\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// noop, continue\n\t\t\t}\n\t\t}\n\t\treturn legacy\n\t},\n})\n"],"mappings":";;;;;AAQA,MAAa,yBACZ,KACA,eACuD;CACvD,MAAM;CAEN,GAAG,OAAmC;EACrC,OAAO,wBAAwB,UAAU,KAAK,CAAC,CAAC;CACjD;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,uBAAuB,UAAU,KAAK;EACrD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM;IACL,UAAU;IACV,MAAM;IACN,OAAO,OAAO,KAAK,SAAS,SAAS;KACpC,IAAI;MACH,QAAQ,WAAR;OACC,KAAK,QACJ,OAAO,CAAC,oBAAoB,iBAAiB,MAAM,IAAI,CAAC,CAAC;OAC1D,SACC,OAAO,CAAC;MACV;KACD,QAAQ;MACP,OAAO,CAAC;KACT;IACD,CAAC;GACF;EACD;CACD;CAEA,YAAY,OAAO;EAClB,MAAM,SAAsF;GAC3F,SAAS,CAAC;GACV,OAAO,GAAG,IAAI,YAAY,cAAc,YAAY;GACpD,MAAM,CAAC;EACR;EAEA,KAAK,MAAM,QAAQ,MAAM,OACxB,IAAI;GACH,QAAQ,WAAR;IACC,KAAK;KACJ,MAAM,SAAS,gBAAgB,GAAG,CAAC,CAAC,YAAY,IAAI;KACpD,OAAO,QAAQ,KAAK,OAAO,OAAO;KAClC,OAAO,OAAO;MAAE,GAAG,OAAO;MAAM,GAAG,OAAO;KAAK;KAC/C;GACF;EACD,QAAQ,CAER;EAED,OAAO;CACR;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richText.js","names":[],"sources":["../../../src/content/codec/richText.ts"],"sourcesContent":["import type { RichTextLegacy, RichTextLegacyBlock, RichTextLegacySpan } from \"../legacy/richText\"\nimport {\n\tRichTextLegacyBlockSchema,\n\tRichTextLegacySchema,\n\tRichTextNodeType,\n} from \"../legacy/richText\"\nimport type { RichTextContent, RichTextContentBlock, RichTextContentSpan } from \"../richText\"\nimport { RichTextContentSchema, RichTextContentType } from \"../richText\"\nimport { embedContentToLegacy, embedLegacyToContent } from \"./embed\"\nimport { imageLegacyToContent } from \"./image\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\nimport { linkLegacyToValue, linkValueToLegacy } from \"./link\"\n\n// Also used by content/codec/table\nexport function blockLegacyToValue(block: RichTextLegacyBlock): RichTextContentBlock {\n\tif (block.type === RichTextNodeType.embed) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: embedLegacyToContent(block.data),\n\t\t}\n\t}\n\n\tif (block.type === RichTextNodeType.image) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: {\n\t\t\t\t...imageLegacyToContent(block.data),\n\t\t\t\t...(block.data.linkTo ? { linkTo: linkLegacyToValue(block.data.linkTo) } : {}),\n\t\t\t},\n\t\t}\n\t}\n\n\tconst spans: RichTextContentSpan[] = []\n\tfor (const span of block.content.spans ?? []) {\n\t\tif (span.type === RichTextNodeType.hyperlink) {\n\t\t\t// Legacy documents can have hyperlink spans with null data. We\n\t\t\t// drop them since a hyperlink without link data is meaningless.\n\t\t\tif (span.data) {\n\t\t\t\tspans.push({ ...span, data: linkLegacyToValue(span.data) })\n\t\t\t}\n\t\t} else {\n\t\t\tspans.push(span)\n\t\t}\n\t}\n\n\treturn { ...block, content: { ...block.content, spans } }\n}\n\n// Also used by content/codec/table\nexport function blockValueToLegacy(block: RichTextContentBlock): RichTextLegacyBlock {\n\tif (block.type === RichTextNodeType.embed) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: embedContentToLegacy(block.data),\n\t\t}\n\t}\n\n\tif (block.type === RichTextNodeType.image) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: {\n\t\t\t\t...block.data,\n\t\t\t\t...(block.data.linkTo ? { linkTo: linkValueToLegacy(block.data.linkTo) } : {}),\n\t\t\t},\n\t\t}\n\t}\n\n\tif (\"content\" in block) {\n\t\tconst spans: RichTextLegacySpan[] = []\n\t\tfor (const span of block.content.spans ?? []) {\n\t\t\tif (span.type === RichTextNodeType.hyperlink) {\n\t\t\t\t// Legacy documents can have hyperlink spans with null data. We\n\t\t\t\t// drop them since a hyperlink without link data is meaningless.\n\t\t\t\tif (span.data) {\n\t\t\t\t\tspans.push({ ...span, data: linkValueToLegacy(span.data) })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tspans.push(span)\n\t\t\t}\n\t\t}\n\n\t\treturn { ...block, content: { ...block.content, spans } }\n\t}\n\n\treturn RichTextLegacyBlockSchema.parse(block)\n}\n\nexport const RichTextLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<RichTextContent, RichTextLegacy> => ({\n\tname: \"RichTextLegacy\",\n\n\tis(input): input is RichTextContent {\n\t\treturn RichTextContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = RichTextLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\tvalue: parsed.data.map((block) => blockLegacyToValue(block)),\n\t\t\t\t__TYPE__: RichTextContentType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: input.value.map((block) => blockValueToLegacy(block)),\n\t\t\ttypes: { [ctx.keyOfType]: \"StructuredText\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;;;;AAcA,SAAgB,mBAAmB,OAAkD;
|
|
1
|
+
{"version":3,"file":"richText.js","names":[],"sources":["../../../src/content/codec/richText.ts"],"sourcesContent":["import type { RichTextLegacy, RichTextLegacyBlock, RichTextLegacySpan } from \"../legacy/richText\"\nimport {\n\tRichTextLegacyBlockSchema,\n\tRichTextLegacySchema,\n\tRichTextNodeType,\n} from \"../legacy/richText\"\nimport type { RichTextContent, RichTextContentBlock, RichTextContentSpan } from \"../richText\"\nimport { RichTextContentSchema, RichTextContentType } from \"../richText\"\nimport { embedContentToLegacy, embedLegacyToContent } from \"./embed\"\nimport { imageLegacyToContent } from \"./image\"\nimport type { LegacyCodec, LegacyContentCtx } from \"./legacyContentCtx\"\nimport { linkLegacyToValue, linkValueToLegacy } from \"./link\"\n\n// Also used by content/codec/table\nexport function blockLegacyToValue(block: RichTextLegacyBlock): RichTextContentBlock {\n\tif (block.type === RichTextNodeType.embed) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: embedLegacyToContent(block.data),\n\t\t}\n\t}\n\n\tif (block.type === RichTextNodeType.image) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: {\n\t\t\t\t...imageLegacyToContent(block.data),\n\t\t\t\t...(block.data.linkTo ? { linkTo: linkLegacyToValue(block.data.linkTo) } : {}),\n\t\t\t},\n\t\t}\n\t}\n\n\tconst spans: RichTextContentSpan[] = []\n\tfor (const span of block.content.spans ?? []) {\n\t\tif (span.type === RichTextNodeType.hyperlink) {\n\t\t\t// Legacy documents can have hyperlink spans with null data. We\n\t\t\t// drop them since a hyperlink without link data is meaningless.\n\t\t\tif (span.data) {\n\t\t\t\tspans.push({ ...span, data: linkLegacyToValue(span.data) })\n\t\t\t}\n\t\t} else {\n\t\t\tspans.push(span)\n\t\t}\n\t}\n\n\treturn { ...block, content: { ...block.content, spans } }\n}\n\n// Also used by content/codec/table\nexport function blockValueToLegacy(block: RichTextContentBlock): RichTextLegacyBlock {\n\tif (block.type === RichTextNodeType.embed) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: embedContentToLegacy(block.data),\n\t\t}\n\t}\n\n\tif (block.type === RichTextNodeType.image) {\n\t\treturn {\n\t\t\t...block,\n\t\t\tdata: {\n\t\t\t\t...block.data,\n\t\t\t\t...(block.data.linkTo ? { linkTo: linkValueToLegacy(block.data.linkTo) } : {}),\n\t\t\t},\n\t\t}\n\t}\n\n\tif (\"content\" in block) {\n\t\tconst spans: RichTextLegacySpan[] = []\n\t\tfor (const span of block.content.spans ?? []) {\n\t\t\tif (span.type === RichTextNodeType.hyperlink) {\n\t\t\t\t// Legacy documents can have hyperlink spans with null data. We\n\t\t\t\t// drop them since a hyperlink without link data is meaningless.\n\t\t\t\tif (span.data) {\n\t\t\t\t\tspans.push({ ...span, data: linkValueToLegacy(span.data) })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tspans.push(span)\n\t\t\t}\n\t\t}\n\n\t\treturn { ...block, content: { ...block.content, spans } }\n\t}\n\n\treturn RichTextLegacyBlockSchema.parse(block)\n}\n\nexport const RichTextLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<RichTextContent, RichTextLegacy> => ({\n\tname: \"RichTextLegacy\",\n\n\tis(input): input is RichTextContent {\n\t\treturn RichTextContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(input) {\n\t\tconst parsed = RichTextLegacySchema.safeParse(input)\n\t\tif (!parsed.success) {\n\t\t\treturn parsed\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\tvalue: parsed.data.map((block) => blockLegacyToValue(block)),\n\t\t\t\t__TYPE__: RichTextContentType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent(input) {\n\t\treturn {\n\t\t\tcontent: input.value.map((block) => blockValueToLegacy(block)),\n\t\t\ttypes: { [ctx.keyOfType]: \"StructuredText\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;;;;;AAcA,SAAgB,mBAAmB,OAAkD;CACpF,IAAI,MAAM,SAAS,iBAAiB,OACnC,OAAO;EACN,GAAG;EACH,MAAM,qBAAqB,MAAM,IAAI;CACtC;CAGD,IAAI,MAAM,SAAS,iBAAiB,OACnC,OAAO;EACN,GAAG;EACH,MAAM;GACL,GAAG,qBAAqB,MAAM,IAAI;GAClC,GAAI,MAAM,KAAK,SAAS,EAAE,QAAQ,kBAAkB,MAAM,KAAK,MAAM,EAAE,IAAI,CAAC;EAC7E;CACD;CAGD,MAAM,QAA+B,CAAC;CACtC,KAAK,MAAM,QAAQ,MAAM,QAAQ,SAAS,CAAC,GAC1C,IAAI,KAAK,SAAS,iBAAiB;MAG9B,KAAK,MACR,MAAM,KAAK;GAAE,GAAG;GAAM,MAAM,kBAAkB,KAAK,IAAI;EAAE,CAAC;CAAA,OAG3D,MAAM,KAAK,IAAI;CAIjB,OAAO;EAAE,GAAG;EAAO,SAAS;GAAE,GAAG,MAAM;GAAS;EAAM;CAAE;AACzD;AAGA,SAAgB,mBAAmB,OAAkD;CACpF,IAAI,MAAM,SAAS,iBAAiB,OACnC,OAAO;EACN,GAAG;EACH,MAAM,qBAAqB,MAAM,IAAI;CACtC;CAGD,IAAI,MAAM,SAAS,iBAAiB,OACnC,OAAO;EACN,GAAG;EACH,MAAM;GACL,GAAG,MAAM;GACT,GAAI,MAAM,KAAK,SAAS,EAAE,QAAQ,kBAAkB,MAAM,KAAK,MAAM,EAAE,IAAI,CAAC;EAC7E;CACD;CAGD,IAAI,aAAa,OAAO;EACvB,MAAM,QAA8B,CAAC;EACrC,KAAK,MAAM,QAAQ,MAAM,QAAQ,SAAS,CAAC,GAC1C,IAAI,KAAK,SAAS,iBAAiB;OAG9B,KAAK,MACR,MAAM,KAAK;IAAE,GAAG;IAAM,MAAM,kBAAkB,KAAK,IAAI;GAAE,CAAC;EAAA,OAG3D,MAAM,KAAK,IAAI;EAIjB,OAAO;GAAE,GAAG;GAAO,SAAS;IAAE,GAAG,MAAM;IAAS;GAAM;EAAE;CACzD;CAEA,OAAO,0BAA0B,MAAM,KAAK;AAC7C;AAEA,MAAa,uBACZ,SACmD;CACnD,MAAM;CAEN,GAAG,OAAiC;EACnC,OAAO,sBAAsB,UAAU,KAAK,CAAC,CAAC;CAC/C;CAEA,UAAU,OAAO;EAChB,MAAM,SAAS,qBAAqB,UAAU,KAAK;EACnD,IAAI,CAAC,OAAO,SACX,OAAO;EAGR,OAAO;GACN,SAAS;GACT,MAAM;IACL,OAAO,OAAO,KAAK,KAAK,UAAU,mBAAmB,KAAK,CAAC;IAC3D,UAAU;GACX;EACD;CACD;CAEA,YAAY,OAAO;EAClB,OAAO;GACN,SAAS,MAAM,MAAM,KAAK,UAAU,mBAAmB,KAAK,CAAC;GAC7D,OAAO,GAAG,IAAI,YAAY,iBAAiB;GAC3C,MAAM,CAAC;EACR;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/content/codec/separator.ts"],"sourcesContent":["import type { SeparatorLegacy } from \"../legacy/separator\"\nimport { SeparatorContentSchema } from \"../separator\"\nimport type { SeparatorContent } from \"../separator\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nconst SeparatorContentType = \"SeparatorContent\"\n\nexport const SeparatorLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<SeparatorContent, SeparatorLegacy> => ({\n\tname: \"SeparatorLegacy\",\n\n\tis(input): input is SeparatorContent {\n\t\treturn SeparatorContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(_input) {\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: SeparatorContentType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent() {\n\t\treturn {\n\t\t\tcontent: {},\n\t\t\ttypes: { [ctx.keyOfType]: \"Separator\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;AAKA,MAAM,uBAAuB;AAE7B,MAAa,wBACZ,SACqD;CACrD,MAAM;CAEN,GAAG,OAAkC;
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/content/codec/separator.ts"],"sourcesContent":["import type { SeparatorLegacy } from \"../legacy/separator\"\nimport { SeparatorContentSchema } from \"../separator\"\nimport type { SeparatorContent } from \"../separator\"\nimport type { LegacyContentCtx, LegacyCodec } from \"./legacyContentCtx\"\n\nconst SeparatorContentType = \"SeparatorContent\"\n\nexport const SeparatorLegacyCodec = (\n\tctx: LegacyContentCtx,\n): LegacyCodec<SeparatorContent, SeparatorLegacy> => ({\n\tname: \"SeparatorLegacy\",\n\n\tis(input): input is SeparatorContent {\n\t\treturn SeparatorContentSchema.safeParse(input).success\n\t},\n\n\ttoContent(_input) {\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: {\n\t\t\t\t__TYPE__: SeparatorContentType,\n\t\t\t},\n\t\t}\n\t},\n\n\tfromContent() {\n\t\treturn {\n\t\t\tcontent: {},\n\t\t\ttypes: { [ctx.keyOfType]: \"Separator\" },\n\t\t\tkeys: {},\n\t\t}\n\t},\n})\n"],"mappings":";;AAKA,MAAM,uBAAuB;AAE7B,MAAa,wBACZ,SACqD;CACrD,MAAM;CAEN,GAAG,OAAkC;EACpC,OAAO,uBAAuB,UAAU,KAAK,CAAC,CAAC;CAChD;CAEA,UAAU,QAAQ;EACjB,OAAO;GACN,SAAS;GACT,MAAM,EACL,UAAU,qBACX;EACD;CACD;CAEA,cAAc;EACb,OAAO;GACN,SAAS,CAAC;GACV,OAAO,GAAG,IAAI,YAAY,YAAY;GACtC,MAAM,CAAC;EACR;CACD;AACD"}
|