@prismicio/types-internal 4.0.0-pr.6.38cb7de → 4.0.0-pr.6.bbcafda
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/helpers/traverseContent.js +1 -1
- package/dist/helpers/traverseContentWithModel.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -2
- package/dist/io-ts.js +3 -3
- package/dist/model/nestable.js +3 -3
- package/dist/model/richText.js +3 -4
- package/dist/model/richText.js.map +1 -1
- package/dist/model/table.d.ts +1 -2
- package/dist/model/table.d.ts.map +1 -1
- package/dist/model/table.js +7 -9
- package/dist/model/table.js.map +1 -1
- package/dist/zod4.js +3 -3
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/model/table.ts +2 -10
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TableCellModel } from "../model/table.js";
|
|
2
1
|
import { make } from "./contentPath.js";
|
|
3
2
|
import { flatten } from "./customTypeModel.js";
|
|
4
3
|
import { isRepeatableContentValue } from "../content/repeatable.js";
|
|
@@ -8,6 +7,7 @@ import { isNestableContent } from "../content/nestable.js";
|
|
|
8
7
|
import "../content/group.js";
|
|
9
8
|
import "../content/slice.js";
|
|
10
9
|
import "../content/slices.js";
|
|
10
|
+
import { TableCellModel } from "../model/table.js";
|
|
11
11
|
//#region src/helpers/traverseContent.ts
|
|
12
12
|
function traverseDocumentContent(document, config) {
|
|
13
13
|
const { model, transformWidget, transformSlice } = config;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TableCellModel } from "../model/table.js";
|
|
2
1
|
import { make } from "./contentPath.js";
|
|
3
2
|
import { flatten } from "./customTypeModel.js";
|
|
4
3
|
import { isRepeatableContentValue } from "../content/repeatable.js";
|
|
@@ -8,6 +7,7 @@ import { isNestableContent } from "../content/nestable.js";
|
|
|
8
7
|
import "../content/group.js";
|
|
9
8
|
import "../content/slice.js";
|
|
10
9
|
import "../content/slices.js";
|
|
10
|
+
import { TableCellModel } from "../model/table.js";
|
|
11
11
|
//#region src/helpers/traverseContentWithModel.ts
|
|
12
12
|
function traverseDocumentContentWithModel(document, config) {
|
|
13
13
|
const { model, transformWidget, transformSlice } = config;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { RangeModel } from "./model/range.js";
|
|
|
17
17
|
import { RichTextModel } from "./model/richText.js";
|
|
18
18
|
import { SelectModel } from "./model/select.js";
|
|
19
19
|
import { SeparatorModel } from "./model/separator.js";
|
|
20
|
-
import {
|
|
20
|
+
import { TableModel } from "./model/table.js";
|
|
21
21
|
import { TextModel } from "./model/text.js";
|
|
22
22
|
import { TimestampModel } from "./model/timestamp.js";
|
|
23
23
|
import { NestableModel } from "./model/nestable.js";
|
|
@@ -52,4 +52,4 @@ import { customTypeModel_d_exports } from "./helpers/customTypeModel.js";
|
|
|
52
52
|
import { documentContent_d_exports } from "./helpers/documentContent.js";
|
|
53
53
|
import { TraverseSliceContentFunction, TraverseWidgetContentFunction, traverseCompositeSliceContent, traverseDocumentContent, traverseGroupContent, traverseGroupItemsContent, traverseLegacySliceContent, traverseRepeatableContent, traverseSharedSliceContent, traverseSlicesContent, traverseTableContent } from "./helpers/traverseContent.js";
|
|
54
54
|
import { TraverseSliceContentWithModelFunction, TraverseWidgetContentWithModelFunction, traverseCompositeSliceContentWithModel, traverseDocumentContentWithModel, traverseGroupContentWithModel, traverseGroupItemsContentWithModel, traverseLegacySliceContentWithModel, traverseRepeatableContentWithModel, traverseSharedSliceContentWithModel, traverseSlicesContentWithModel, traverseTableContentWithModel } from "./helpers/traverseContentWithModel.js";
|
|
55
|
-
export { type Asset, type BooleanContent, type BooleanModel, type ColorContent, type ColorModel, type CompositeSliceContent, type CompositeSliceItemContent, type CompositeSliceModel, type CustomTypeModel, type DateContent, type DateModel, type DocumentContent, type DynamicSectionModel, type DynamicSliceModel, type DynamicSlicesModel, type DynamicWidgetModel, type Embed, type EmbedContent, type EmbedModel, type EmptyContent, type FieldContent, type FieldModelType, type GeoPointContent, type GeoPointModel, type GroupContent, type GroupItemContent, type GroupModel, type HexaColorCode, type ImageContent, type ImageModel, type IntegrationFieldContent, type IntegrationFieldModel, LegacyContentCtx, type LegacySliceContent, type LegacySliceItemContent, type LegacySliceModel, type LinkContent, type LinkModel, type NestableContent, type NestableModel, type NestedGroupModel, type NonEmptyString, type NumberContent, type NumberModel, type RangeContent, type RangeModel, type RepeatableContent, type RichTextContent, type RichTextContentBlock, type RichTextContentSpan, type RichTextModel, type SelectContent, type SelectModel, type SeparatorContent, type SeparatorModel, type SharedSliceContent, type SharedSliceItemContent, type SharedSliceModel, type SharedSliceRefModel, type SharedSliceVariationContentModel as SharedSliceVariationModel, type SliceContent, type SliceContentModel, type SliceItemContent, type SliceModelType, type SlicesContent, type StaticCustomTypeModel, type StaticSectionModel, type StaticSliceModel, type StaticSlicesModel, type StaticWidgetModel,
|
|
55
|
+
export { type Asset, type BooleanContent, type BooleanModel, type ColorContent, type ColorModel, type CompositeSliceContent, type CompositeSliceItemContent, type CompositeSliceModel, type CustomTypeModel, type DateContent, type DateModel, type DocumentContent, type DynamicSectionModel, type DynamicSliceModel, type DynamicSlicesModel, type DynamicWidgetModel, type Embed, type EmbedContent, type EmbedModel, type EmptyContent, type FieldContent, type FieldModelType, type GeoPointContent, type GeoPointModel, type GroupContent, type GroupItemContent, type GroupModel, type HexaColorCode, type ImageContent, type ImageModel, type IntegrationFieldContent, type IntegrationFieldModel, LegacyContentCtx, type LegacySliceContent, type LegacySliceItemContent, type LegacySliceModel, type LinkContent, type LinkModel, type NestableContent, type NestableModel, type NestedGroupModel, type NonEmptyString, type NumberContent, type NumberModel, type RangeContent, type RangeModel, type RepeatableContent, type RichTextContent, type RichTextContentBlock, type RichTextContentSpan, type RichTextModel, type SelectContent, type SelectModel, type SeparatorContent, type SeparatorModel, type SharedSliceContent, type SharedSliceItemContent, type SharedSliceModel, type SharedSliceRefModel, type SharedSliceVariationContentModel as SharedSliceVariationModel, type SliceContent, type SliceContentModel, type SliceItemContent, type SliceModelType, type SlicesContent, type StaticCustomTypeModel, type StaticSectionModel, type StaticSliceModel, type StaticSlicesModel, type StaticWidgetModel, type TableContent, type TableModel, type TextContent, type TextModel, type TimestampContent, type TimestampModel, type TraverseSliceContentFunction, type TraverseSliceContentWithModelFunction, type TraverseWidgetContentFunction, type TraverseWidgetContentWithModelFunction, type UIDContent, type UIDModel, type WidgetContent, type WidgetKey, contentPath_d_exports as contentPath, customTypeModel_d_exports as customTypeModel, defaultCtx, documentContent_d_exports as documentContent, getFieldCtx, traverseCompositeSliceContent, traverseCompositeSliceContentWithModel, traverseDocumentContent, traverseDocumentContentWithModel, traverseGroupContent, traverseGroupContentWithModel, traverseGroupItemsContent, traverseGroupItemsContentWithModel, traverseLegacySliceContent, traverseLegacySliceContentWithModel, traverseRepeatableContent, traverseRepeatableContentWithModel, traverseSharedSliceContent, traverseSharedSliceContentWithModel, traverseSlicesContent, traverseSlicesContentWithModel, traverseTableContent, traverseTableContentWithModel };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { TableCellModelNodeTypes } from "./model/table.js";
|
|
2
1
|
import { LegacyContentCtx, defaultCtx, getFieldCtx } from "./content/codec/legacyContentCtx.js";
|
|
3
2
|
import { contentPath_exports } from "./helpers/contentPath.js";
|
|
4
3
|
import { customTypeModel_exports } from "./helpers/customTypeModel.js";
|
|
5
4
|
import { traverseCompositeSliceContent, traverseDocumentContent, traverseGroupContent, traverseGroupItemsContent, traverseLegacySliceContent, traverseRepeatableContent, traverseSharedSliceContent, traverseSlicesContent, traverseTableContent } from "./helpers/traverseContent.js";
|
|
6
5
|
import { documentContent_exports } from "./helpers/documentContent.js";
|
|
7
6
|
import { traverseCompositeSliceContentWithModel, traverseDocumentContentWithModel, traverseGroupContentWithModel, traverseGroupItemsContentWithModel, traverseLegacySliceContentWithModel, traverseRepeatableContentWithModel, traverseSharedSliceContentWithModel, traverseSlicesContentWithModel, traverseTableContentWithModel } from "./helpers/traverseContentWithModel.js";
|
|
8
|
-
export { LegacyContentCtx,
|
|
7
|
+
export { LegacyContentCtx, contentPath_exports as contentPath, customTypeModel_exports as customTypeModel, defaultCtx, documentContent_exports as documentContent, getFieldCtx, traverseCompositeSliceContent, traverseCompositeSliceContentWithModel, traverseDocumentContent, traverseDocumentContentWithModel, traverseGroupContent, traverseGroupContentWithModel, traverseGroupItemsContent, traverseGroupItemsContentWithModel, traverseLegacySliceContent, traverseLegacySliceContentWithModel, traverseRepeatableContent, traverseRepeatableContentWithModel, traverseSharedSliceContent, traverseSharedSliceContentWithModel, traverseSlicesContent, traverseSlicesContentWithModel, traverseTableContent, traverseTableContentWithModel };
|
package/dist/io-ts.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { ImageModelSchema as ImageModelSchema$1 } from "./model/image.js";
|
|
2
|
-
import { RichTextModelSchema as RichTextModelSchema$1 } from "./model/richText.js";
|
|
3
|
-
import { TableModelSchema as TableModelSchema$1 } from "./model/table.js";
|
|
4
1
|
import { WidgetKeySchema as WidgetKeySchema$1 } from "./common/widgetKey.js";
|
|
5
2
|
import { BooleanContentSchema as BooleanContentSchema$1 } from "./content/boolean.js";
|
|
6
3
|
import { EmbedContentSchema as EmbedContentSchema$1 } from "./content/embed.js";
|
|
@@ -46,12 +43,15 @@ import { ColorModelSchema as ColorModelSchema$1 } from "./model/color.js";
|
|
|
46
43
|
import { DateModelSchema as DateModelSchema$1 } from "./model/date.js";
|
|
47
44
|
import { EmbedModelSchema as EmbedModelSchema$1 } from "./model/embed.js";
|
|
48
45
|
import { GeoPointModelSchema as GeoPointModelSchema$1 } from "./model/geopoint.js";
|
|
46
|
+
import { ImageModelSchema as ImageModelSchema$1 } from "./model/image.js";
|
|
49
47
|
import { IntegrationFieldModelSchema as IntegrationFieldModelSchema$1 } from "./model/integrationField.js";
|
|
50
48
|
import { LinkModelSchema as LinkModelSchema$1 } from "./model/link.js";
|
|
51
49
|
import { NumberModelSchema as NumberModelSchema$1 } from "./model/number.js";
|
|
52
50
|
import { RangeModelSchema as RangeModelSchema$1 } from "./model/range.js";
|
|
51
|
+
import { RichTextModelSchema as RichTextModelSchema$1 } from "./model/richText.js";
|
|
53
52
|
import { SelectModelSchema as SelectModelSchema$1 } from "./model/select.js";
|
|
54
53
|
import { SeparatorModelSchema as SeparatorModelSchema$1 } from "./model/separator.js";
|
|
54
|
+
import { TableModelSchema as TableModelSchema$1 } from "./model/table.js";
|
|
55
55
|
import { TextModelSchema as TextModelSchema$1 } from "./model/text.js";
|
|
56
56
|
import { TimestampModelSchema as TimestampModelSchema$1 } from "./model/timestamp.js";
|
|
57
57
|
import { NestableModelSchema as NestableModelSchema$1 } from "./model/nestable.js";
|
package/dist/model/nestable.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ImageModelSchema } from "./image.js";
|
|
2
|
-
import { RichTextModelSchema } from "./richText.js";
|
|
3
|
-
import { TableModelSchema } from "./table.js";
|
|
4
1
|
import { BooleanModelSchema } from "./boolean.js";
|
|
5
2
|
import { ColorModelSchema } from "./color.js";
|
|
6
3
|
import { DateModelSchema } from "./date.js";
|
|
7
4
|
import { EmbedModelSchema } from "./embed.js";
|
|
8
5
|
import { GeoPointModelSchema } from "./geopoint.js";
|
|
6
|
+
import { ImageModelSchema } from "./image.js";
|
|
9
7
|
import { IntegrationFieldModelSchema } from "./integrationField.js";
|
|
10
8
|
import { LinkModelSchema } from "./link.js";
|
|
11
9
|
import { NumberModelSchema } from "./number.js";
|
|
12
10
|
import { RangeModelSchema } from "./range.js";
|
|
11
|
+
import { RichTextModelSchema } from "./richText.js";
|
|
13
12
|
import { SelectModelSchema } from "./select.js";
|
|
14
13
|
import { SeparatorModelSchema } from "./separator.js";
|
|
14
|
+
import { TableModelSchema } from "./table.js";
|
|
15
15
|
import { TextModelSchema } from "./text.js";
|
|
16
16
|
import { TimestampModelSchema } from "./timestamp.js";
|
|
17
17
|
import { z } from "zod/mini";
|
package/dist/model/richText.js
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from "zod/mini";
|
|
|
3
3
|
//#region src/model/richText.ts
|
|
4
4
|
const RichTextFieldType = "StructuredText";
|
|
5
5
|
const DEFAULT_OPTION = "paragraph";
|
|
6
|
-
const
|
|
6
|
+
const VALID_NODE_TYPES = Object.values({
|
|
7
7
|
heading1: "heading1",
|
|
8
8
|
heading2: "heading2",
|
|
9
9
|
heading3: "heading3",
|
|
@@ -20,8 +20,7 @@ const RichTextNodeType = {
|
|
|
20
20
|
strong: "strong",
|
|
21
21
|
em: "em",
|
|
22
22
|
rtl: "rtl"
|
|
23
|
-
};
|
|
24
|
-
const VALID_NODE_TYPES = Object.values(RichTextNodeType);
|
|
23
|
+
});
|
|
25
24
|
/**
|
|
26
25
|
* RichTextOptions parses comma-separated node types, filters invalid ones,
|
|
27
26
|
* and defaults to "paragraph" if empty or null.
|
|
@@ -68,6 +67,6 @@ const RichTextModelSchema = z.object({
|
|
|
68
67
|
config: z.optional(RichTextConfigSchema)
|
|
69
68
|
});
|
|
70
69
|
//#endregion
|
|
71
|
-
export { RichTextModelSchema
|
|
70
|
+
export { RichTextModelSchema };
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=richText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"richText.js","names":[],"sources":["../../src/model/richText.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { ImageConstraintSchema } from \"./image\"\n\nexport const RichTextFieldType = \"StructuredText\"\n\nexport const DEFAULT_OPTION = \"paragraph\"\n\nexport const RichTextNodeType = {\n\theading1: \"heading1\",\n\theading2: \"heading2\",\n\theading3: \"heading3\",\n\theading4: \"heading4\",\n\theading5: \"heading5\",\n\theading6: \"heading6\",\n\tparagraph: \"paragraph\",\n\tpreformatted: \"preformatted\",\n\torderedList: \"o-list-item\",\n\tlist: \"list-item\",\n\timage: \"image\",\n\tembed: \"embed\",\n\thyperlink: \"hyperlink\",\n\tstrong: \"strong\",\n\tem: \"em\",\n\trtl: \"rtl\",\n} as const\n\nconst VALID_NODE_TYPES = Object.values(RichTextNodeType)\n\n/**\n * RichTextOptions parses comma-separated node types, filters invalid ones,\n * and defaults to \"paragraph\" if empty or null.\n */\nconst RichTextOptionsSchema = z.pipe(\n\tz.union([z.string(), z.null()]),\n\tz.transform((s: string | null) => {\n\t\tif (!s) return DEFAULT_OPTION\n\t\tconst entries = s.split(\",\").map((e: string) => e.trim())\n\t\tconst filtered = entries.filter((e: string) =>\n\t\t\tVALID_NODE_TYPES.includes(e as (typeof VALID_NODE_TYPES)[number]),\n\t\t)\n\t\treturn filtered.length ? filtered.join(\",\") : DEFAULT_OPTION\n\t}),\n)\n\n/**\n * RichTextLabels accepts multiple formats and normalizes to string[]:\n * - null → []\n * - \"label\" → [\"label\"]\n * - [\"a\", \"b\"] → [\"a\", \"b\"]\n * - { \"\": [{name: \"a\"}], \"key\": [{name: \"b\"}] } → [\"a\", \"b\"] (legacy format)\n */\nconst LegacyLabelsFormat = z.record(z.string(), z.array(z.object({ name: z.string() })))\n\nconst RichTextLabelsSchema: z.ZodMiniType<string[]> = z.pipe(\n\tz.union([\n\t\tz.pipe(\n\t\t\tz.null(),\n\t\t\tz.transform(() => [] as string[]),\n\t\t),\n\t\tz.pipe(\n\t\t\tz.string(),\n\t\t\tz.transform((s: string) => [s]),\n\t\t),\n\t\tz.array(z.string()),\n\t\tz.pipe(\n\t\t\tLegacyLabelsFormat,\n\t\t\tz.transform((obj: Record<string, Array<{ name: string }>>) => {\n\t\t\t\tconst entries = Object.entries(obj)\n\t\t\t\tif (!entries.length) return [] as string[]\n\n\t\t\t\t// Handle legacy format with empty key\n\t\t\t\tif (obj[\"\"]) {\n\t\t\t\t\treturn obj[\"\"].map((l: { name: string }) => l.name)\n\t\t\t\t}\n\n\t\t\t\t// Convert all entries to flat array of names\n\t\t\t\treturn entries\n\t\t\t\t\t.reduce<string[]>((acc, [, labelsEntries]) => {\n\t\t\t\t\t\treturn acc.concat(labelsEntries.map((l: { name: string }) => l.name))\n\t\t\t\t\t}, [])\n\t\t\t\t\t.filter(Boolean)\n\t\t\t}),\n\t\t),\n\t]),\n\tz.transform((result: string[]) => result as string[]),\n)\n\nconst RichTextConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tuseAsTitle: z.optional(z.boolean()),\n\tsingle: z.optional(RichTextOptionsSchema),\n\tmulti: z.optional(RichTextOptionsSchema),\n\timageConstraint: z.optional(ImageConstraintSchema),\n\tlabels: z.optional(RichTextLabelsSchema),\n\tallowTargetBlank: z.optional(z.boolean()),\n})\n\nexport const RichTextModelSchema = z.object({\n\ttype: z.literal(RichTextFieldType),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(RichTextConfigSchema),\n})\n\nexport type RichTextModel = z.infer<typeof RichTextModelSchema>\n"],"mappings":";;;AAIA,MAAa,oBAAoB;AAEjC,MAAa,iBAAiB;
|
|
1
|
+
{"version":3,"file":"richText.js","names":[],"sources":["../../src/model/richText.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { ImageConstraintSchema } from \"./image\"\n\nexport const RichTextFieldType = \"StructuredText\"\n\nexport const DEFAULT_OPTION = \"paragraph\"\n\nexport const RichTextNodeType = {\n\theading1: \"heading1\",\n\theading2: \"heading2\",\n\theading3: \"heading3\",\n\theading4: \"heading4\",\n\theading5: \"heading5\",\n\theading6: \"heading6\",\n\tparagraph: \"paragraph\",\n\tpreformatted: \"preformatted\",\n\torderedList: \"o-list-item\",\n\tlist: \"list-item\",\n\timage: \"image\",\n\tembed: \"embed\",\n\thyperlink: \"hyperlink\",\n\tstrong: \"strong\",\n\tem: \"em\",\n\trtl: \"rtl\",\n} as const\n\nconst VALID_NODE_TYPES = Object.values(RichTextNodeType)\n\n/**\n * RichTextOptions parses comma-separated node types, filters invalid ones,\n * and defaults to \"paragraph\" if empty or null.\n */\nconst RichTextOptionsSchema = z.pipe(\n\tz.union([z.string(), z.null()]),\n\tz.transform((s: string | null) => {\n\t\tif (!s) return DEFAULT_OPTION\n\t\tconst entries = s.split(\",\").map((e: string) => e.trim())\n\t\tconst filtered = entries.filter((e: string) =>\n\t\t\tVALID_NODE_TYPES.includes(e as (typeof VALID_NODE_TYPES)[number]),\n\t\t)\n\t\treturn filtered.length ? filtered.join(\",\") : DEFAULT_OPTION\n\t}),\n)\n\n/**\n * RichTextLabels accepts multiple formats and normalizes to string[]:\n * - null → []\n * - \"label\" → [\"label\"]\n * - [\"a\", \"b\"] → [\"a\", \"b\"]\n * - { \"\": [{name: \"a\"}], \"key\": [{name: \"b\"}] } → [\"a\", \"b\"] (legacy format)\n */\nconst LegacyLabelsFormat = z.record(z.string(), z.array(z.object({ name: z.string() })))\n\nconst RichTextLabelsSchema: z.ZodMiniType<string[]> = z.pipe(\n\tz.union([\n\t\tz.pipe(\n\t\t\tz.null(),\n\t\t\tz.transform(() => [] as string[]),\n\t\t),\n\t\tz.pipe(\n\t\t\tz.string(),\n\t\t\tz.transform((s: string) => [s]),\n\t\t),\n\t\tz.array(z.string()),\n\t\tz.pipe(\n\t\t\tLegacyLabelsFormat,\n\t\t\tz.transform((obj: Record<string, Array<{ name: string }>>) => {\n\t\t\t\tconst entries = Object.entries(obj)\n\t\t\t\tif (!entries.length) return [] as string[]\n\n\t\t\t\t// Handle legacy format with empty key\n\t\t\t\tif (obj[\"\"]) {\n\t\t\t\t\treturn obj[\"\"].map((l: { name: string }) => l.name)\n\t\t\t\t}\n\n\t\t\t\t// Convert all entries to flat array of names\n\t\t\t\treturn entries\n\t\t\t\t\t.reduce<string[]>((acc, [, labelsEntries]) => {\n\t\t\t\t\t\treturn acc.concat(labelsEntries.map((l: { name: string }) => l.name))\n\t\t\t\t\t}, [])\n\t\t\t\t\t.filter(Boolean)\n\t\t\t}),\n\t\t),\n\t]),\n\tz.transform((result: string[]) => result as string[]),\n)\n\nconst RichTextConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tuseAsTitle: z.optional(z.boolean()),\n\tsingle: z.optional(RichTextOptionsSchema),\n\tmulti: z.optional(RichTextOptionsSchema),\n\timageConstraint: z.optional(ImageConstraintSchema),\n\tlabels: z.optional(RichTextLabelsSchema),\n\tallowTargetBlank: z.optional(z.boolean()),\n})\n\nexport const RichTextModelSchema = z.object({\n\ttype: z.literal(RichTextFieldType),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(RichTextConfigSchema),\n})\n\nexport type RichTextModel = z.infer<typeof RichTextModelSchema>\n"],"mappings":";;;AAIA,MAAa,oBAAoB;AAEjC,MAAa,iBAAiB;AAqB9B,MAAM,mBAAmB,OAAO,OAnBA;CAC/B,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,UAAU;CACV,WAAW;CACX,cAAc;CACd,aAAa;CACb,MAAM;CACN,OAAO;CACP,OAAO;CACP,WAAW;CACX,QAAQ;CACR,IAAI;CACJ,KAAK;CACL,CAEuD;;;;;AAMxD,MAAM,wBAAwB,EAAE,KAC/B,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,EAC/B,EAAE,WAAW,MAAqB;AACjC,KAAI,CAAC,EAAG,QAAO;CAEf,MAAM,WADU,EAAE,MAAM,IAAI,CAAC,KAAK,MAAc,EAAE,MAAM,CAAC,CAChC,QAAQ,MAChC,iBAAiB,SAAS,EAAuC,CACjE;AACD,QAAO,SAAS,SAAS,SAAS,KAAK,IAAI,GAAG;EAC7C,CACF;;;;;;;;AASD,MAAM,qBAAqB,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AAExF,MAAM,uBAAgD,EAAE,KACvD,EAAE,MAAM;CACP,EAAE,KACD,EAAE,MAAM,EACR,EAAE,gBAAgB,EAAE,CAAa,CACjC;CACD,EAAE,KACD,EAAE,QAAQ,EACV,EAAE,WAAW,MAAc,CAAC,EAAE,CAAC,CAC/B;CACD,EAAE,MAAM,EAAE,QAAQ,CAAC;CACnB,EAAE,KACD,oBACA,EAAE,WAAW,QAAiD;EAC7D,MAAM,UAAU,OAAO,QAAQ,IAAI;AACnC,MAAI,CAAC,QAAQ,OAAQ,QAAO,EAAE;AAG9B,MAAI,IAAI,IACP,QAAO,IAAI,IAAI,KAAK,MAAwB,EAAE,KAAK;AAIpD,SAAO,QACL,QAAkB,KAAK,GAAG,mBAAmB;AAC7C,UAAO,IAAI,OAAO,cAAc,KAAK,MAAwB,EAAE,KAAK,CAAC;KACnE,EAAE,CAAC,CACL,OAAO,QAAQ;GAChB,CACF;CACD,CAAC,EACF,EAAE,WAAW,WAAqB,OAAmB,CACrD;AAED,MAAM,uBAAuB,EAAE,OAAO;CACrC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;CAC5B,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC;CACnC,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC;CACnC,QAAQ,EAAE,SAAS,sBAAsB;CACzC,OAAO,EAAE,SAAS,sBAAsB;CACxC,iBAAiB,EAAE,SAAS,sBAAsB;CAClD,QAAQ,EAAE,SAAS,qBAAqB;CACxC,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC;CACzC,CAAC;AAEF,MAAa,sBAAsB,EAAE,OAAO;CAC3C,MAAM,EAAE,QAAQ,kBAAkB;CAClC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC;CAC/B,QAAQ,EAAE,SAAS,qBAAqB;CACxC,CAAC"}
|
package/dist/model/table.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ declare const TableModelSchema: z.ZodMiniObject<{
|
|
|
8
8
|
}, z.core.$strip>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
type TableModel = z.infer<typeof TableModelSchema>;
|
|
11
|
-
declare const TableCellModelNodeTypes: ("paragraph" | "hyperlink" | "strong" | "em")[];
|
|
12
11
|
//#endregion
|
|
13
|
-
export {
|
|
12
|
+
export { TableModel };
|
|
14
13
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","names":[],"sources":["../../src/model/table.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"table.d.ts","names":[],"sources":["../../src/model/table.ts"],"mappings":";;;cAMa,gBAAA,EAAgB,CAAA,CAAA,aAAA;;;;;;KAKjB,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,gBAAA"}
|
package/dist/model/table.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RichTextNodeType } from "./richText.js";
|
|
2
1
|
import { z } from "zod/mini";
|
|
3
2
|
//#region src/model/table.ts
|
|
4
3
|
const TableConfigSchema = z.object({ label: z.nullish(z.string()) });
|
|
@@ -6,17 +5,16 @@ const TableModelSchema = z.object({
|
|
|
6
5
|
type: z.literal("Table"),
|
|
7
6
|
config: z.optional(TableConfigSchema)
|
|
8
7
|
});
|
|
9
|
-
const TableCellModelNodeTypes = [
|
|
10
|
-
RichTextNodeType.paragraph,
|
|
11
|
-
RichTextNodeType.strong,
|
|
12
|
-
RichTextNodeType.em,
|
|
13
|
-
RichTextNodeType.hyperlink
|
|
14
|
-
];
|
|
15
8
|
const TableCellModel = {
|
|
16
9
|
type: "StructuredText",
|
|
17
|
-
config: { multi:
|
|
10
|
+
config: { multi: [
|
|
11
|
+
"paragraph",
|
|
12
|
+
"strong",
|
|
13
|
+
"em",
|
|
14
|
+
"hyperlink"
|
|
15
|
+
].join(",") }
|
|
18
16
|
};
|
|
19
17
|
//#endregion
|
|
20
|
-
export { TableCellModel,
|
|
18
|
+
export { TableCellModel, TableModelSchema };
|
|
21
19
|
|
|
22
20
|
//# sourceMappingURL=table.js.map
|
package/dist/model/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":[],"sources":["../../src/model/table.ts"],"sourcesContent":["import { z } from \"zod/mini\"\
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../src/model/table.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst TableConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n})\n\nexport const TableModelSchema = z.object({\n\ttype: z.literal(\"Table\"),\n\tconfig: z.optional(TableConfigSchema),\n})\n\nexport type TableModel = z.infer<typeof TableModelSchema>\n\n// TableCell configuration constant (used for cell rich text configuration)\nexport const TableCellModel = {\n\ttype: \"StructuredText\" as const,\n\tconfig: {\n\t\tmulti: [\"paragraph\", \"strong\", \"em\", \"hyperlink\"].join(\",\"),\n\t},\n}\n"],"mappings":";;AAEA,MAAM,oBAAoB,EAAE,OAAO,EAClC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC5B,CAAC;AAEF,MAAa,mBAAmB,EAAE,OAAO;CACxC,MAAM,EAAE,QAAQ,QAAQ;CACxB,QAAQ,EAAE,SAAS,kBAAkB;CACrC,CAAC;AAKF,MAAa,iBAAiB;CAC7B,MAAM;CACN,QAAQ,EACP,OAAO;EAAC;EAAa;EAAU;EAAM;EAAY,CAAC,KAAK,IAAI,EAC3D;CACD"}
|
package/dist/zod4.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { ImageModelSchema as ImageModelSchema$1 } from "./model/image.js";
|
|
2
|
-
import { RichTextModelSchema as RichTextModelSchema$1 } from "./model/richText.js";
|
|
3
|
-
import { TableModelSchema as TableModelSchema$1 } from "./model/table.js";
|
|
4
1
|
import { WidgetKeySchema as WidgetKeySchema$1 } from "./common/widgetKey.js";
|
|
5
2
|
import { BooleanContentSchema as BooleanContentSchema$1 } from "./content/boolean.js";
|
|
6
3
|
import { EmbedContentSchema as EmbedContentSchema$1 } from "./content/embed.js";
|
|
@@ -27,12 +24,15 @@ import { ColorModelSchema as ColorModelSchema$1 } from "./model/color.js";
|
|
|
27
24
|
import { DateModelSchema as DateModelSchema$1 } from "./model/date.js";
|
|
28
25
|
import { EmbedModelSchema as EmbedModelSchema$1 } from "./model/embed.js";
|
|
29
26
|
import { GeoPointModelSchema as GeoPointModelSchema$1 } from "./model/geopoint.js";
|
|
27
|
+
import { ImageModelSchema as ImageModelSchema$1 } from "./model/image.js";
|
|
30
28
|
import { IntegrationFieldModelSchema as IntegrationFieldModelSchema$1 } from "./model/integrationField.js";
|
|
31
29
|
import { LinkModelSchema as LinkModelSchema$1 } from "./model/link.js";
|
|
32
30
|
import { NumberModelSchema as NumberModelSchema$1 } from "./model/number.js";
|
|
33
31
|
import { RangeModelSchema as RangeModelSchema$1 } from "./model/range.js";
|
|
32
|
+
import { RichTextModelSchema as RichTextModelSchema$1 } from "./model/richText.js";
|
|
34
33
|
import { SelectModelSchema as SelectModelSchema$1 } from "./model/select.js";
|
|
35
34
|
import { SeparatorModelSchema as SeparatorModelSchema$1 } from "./model/separator.js";
|
|
35
|
+
import { TableModelSchema as TableModelSchema$1 } from "./model/table.js";
|
|
36
36
|
import { TextModelSchema as TextModelSchema$1 } from "./model/text.js";
|
|
37
37
|
import { TimestampModelSchema as TimestampModelSchema$1 } from "./model/timestamp.js";
|
|
38
38
|
import { NestableModelSchema as NestableModelSchema$1 } from "./model/nestable.js";
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -77,7 +77,6 @@ export type {
|
|
|
77
77
|
} from "./model/slice"
|
|
78
78
|
export type { DynamicSlicesModel, StaticSlicesModel } from "./model/slices"
|
|
79
79
|
export type { TableModel } from "./model/table"
|
|
80
|
-
export { TableCellModelNodeTypes } from "./model/table"
|
|
81
80
|
export type { TextModel } from "./model/text"
|
|
82
81
|
export type { TimestampModel } from "./model/timestamp"
|
|
83
82
|
export type { UIDModel } from "./model/uid"
|
package/src/model/table.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini"
|
|
2
|
-
import { RichTextNodeType, type RichTextModel } from "./richText"
|
|
3
2
|
|
|
4
3
|
const TableConfigSchema = z.object({
|
|
5
4
|
label: z.nullish(z.string()),
|
|
@@ -13,16 +12,9 @@ export const TableModelSchema = z.object({
|
|
|
13
12
|
export type TableModel = z.infer<typeof TableModelSchema>
|
|
14
13
|
|
|
15
14
|
// TableCell configuration constant (used for cell rich text configuration)
|
|
16
|
-
export const
|
|
17
|
-
RichTextNodeType.paragraph,
|
|
18
|
-
RichTextNodeType.strong,
|
|
19
|
-
RichTextNodeType.em,
|
|
20
|
-
RichTextNodeType.hyperlink
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
export const TableCellModel: RichTextModel = {
|
|
15
|
+
export const TableCellModel = {
|
|
24
16
|
type: "StructuredText" as const,
|
|
25
17
|
config: {
|
|
26
|
-
multi:
|
|
18
|
+
multi: ["paragraph", "strong", "em", "hyperlink"].join(","),
|
|
27
19
|
},
|
|
28
20
|
}
|