document-content-model 7.15.3 → 7.16.0
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/bijection-constructs-3By08A5K.cjs +14695 -0
- package/dist/bijection-constructs-DlP29TpB.js +14624 -0
- package/dist/bijection-constructs.cjs +4 -0
- package/dist/bijection-constructs.d.cts +6 -0
- package/dist/bijection-constructs.d.ts +6 -0
- package/dist/bijection-constructs.js +2 -0
- package/dist/bijection-corpus.cjs +12 -0
- package/dist/bijection-corpus.d.cts +46 -0
- package/dist/bijection-corpus.d.ts +46 -0
- package/dist/bijection-corpus.js +2 -0
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{construct-C9cYkjnd.d.cts → construct-C4XiF8OW.d.cts} +6 -6
- package/dist/{construct-C9cYkjnd.d.ts → construct-C4XiF8OW.d.ts} +6 -6
- package/dist/construct.d.cts +1 -1
- package/dist/construct.d.ts +1 -1
- package/dist/{content-1yGdeaVT.d.ts → content-CBE4kBMo.d.ts} +7917 -9507
- package/dist/{content-CSf8z9NW.d.cts → content-DKx5QaRd.d.cts} +7917 -9507
- package/dist/content-drawing-Dlo8cXJj.d.cts +1606 -0
- package/dist/content-drawing-DuvQQwuc.d.ts +1606 -0
- package/dist/content-drawing.cjs +186 -0
- package/dist/content-drawing.d.cts +2 -0
- package/dist/content-drawing.d.ts +2 -0
- package/dist/content-drawing.js +171 -0
- package/dist/content-json-schema-defs.cjs +27 -3033
- package/dist/content-json-schema-defs.d.cts +2 -6
- package/dist/content-json-schema-defs.d.ts +2 -6
- package/dist/content-json-schema-defs.js +28 -3031
- package/dist/content-sheet.cjs +408 -0
- package/dist/content-sheet.d.cts +2 -0
- package/dist/content-sheet.d.ts +2 -0
- package/dist/content-sheet.js +385 -0
- package/dist/content-vocabulary.cjs +190 -0
- package/dist/content-vocabulary.d.cts +2 -0
- package/dist/content-vocabulary.d.ts +2 -0
- package/dist/content-vocabulary.js +168 -0
- package/dist/content.cjs +29 -781
- package/dist/content.d.cts +2 -2
- package/dist/content.d.ts +2 -2
- package/dist/content.js +6 -701
- package/dist/decompose.d.cts +3 -2
- package/dist/decompose.d.ts +3 -2
- package/dist/definitions.cjs +2 -1
- package/dist/definitions.d.cts +4 -4
- package/dist/definitions.d.ts +4 -4
- package/dist/definitions.js +2 -1
- package/dist/factor-styles.d.cts +1 -1
- package/dist/factor-styles.d.ts +1 -1
- package/dist/flatten.d.cts +1 -1
- package/dist/flatten.d.ts +1 -1
- package/dist/index.cjs +69 -63
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +10 -6
- package/dist/json-schema-defs-blocks.cjs +1036 -0
- package/dist/json-schema-defs-blocks.d.cts +5 -0
- package/dist/json-schema-defs-blocks.d.ts +5 -0
- package/dist/json-schema-defs-blocks.js +1035 -0
- package/dist/json-schema-defs-math.cjs +291 -0
- package/dist/json-schema-defs-math.d.cts +5 -0
- package/dist/json-schema-defs-math.d.ts +5 -0
- package/dist/json-schema-defs-math.js +290 -0
- package/dist/json-schema-defs-shared.cjs +42 -0
- package/dist/json-schema-defs-shared.d.cts +9 -0
- package/dist/json-schema-defs-shared.d.ts +9 -0
- package/dist/json-schema-defs-shared.js +38 -0
- package/dist/json-schema-defs-sheet.cjs +944 -0
- package/dist/json-schema-defs-sheet.d.cts +5 -0
- package/dist/json-schema-defs-sheet.d.ts +5 -0
- package/dist/json-schema-defs-sheet.js +943 -0
- package/dist/json-schema-defs-tree.cjs +237 -0
- package/dist/json-schema-defs-tree.d.cts +5 -0
- package/dist/json-schema-defs-tree.d.ts +5 -0
- package/dist/json-schema-defs-tree.js +237 -0
- package/dist/json-schema-defs-vector.cjs +513 -0
- package/dist/json-schema-defs-vector.d.cts +5 -0
- package/dist/json-schema-defs-vector.d.ts +5 -0
- package/dist/json-schema-defs-vector.js +512 -0
- package/dist/magic-string.es-CB2hOw9v.js +1012 -0
- package/dist/magic-string.es-MEBc20Ce.cjs +1012 -0
- package/dist/{package-node-ng7Yimj9.d.cts → package-node-BYL2owXg.d.cts} +40 -39
- package/dist/{package-node-CpE1BAqK.d.ts → package-node-vI3Q0nFf.d.ts} +40 -39
- package/dist/package-node.cjs +12 -9
- package/dist/package-node.d.cts +1 -1
- package/dist/package-node.d.ts +1 -1
- package/dist/package-node.js +4 -1
- package/dist/package.d.cts +6 -6
- package/dist/package.d.ts +6 -6
- package/dist/schema-io.cjs +2 -2
- package/dist/schema-io.d.cts +1 -1
- package/dist/schema-io.d.ts +1 -1
- package/dist/schema-io.js +2 -2
- package/dist/{style-BGMcYrD2.d.cts → style-D06NwxAJ.d.cts} +1 -1
- package/dist/{style-BGMcYrD2.d.ts → style-D06NwxAJ.d.ts} +1 -1
- package/dist/style.d.cts +1 -1
- package/dist/style.d.ts +1 -1
- package/dist/table-grid.d.cts +2 -2
- package/dist/table-grid.d.ts +2 -2
- package/dist/text-layout.d.cts +1 -1
- package/dist/text-layout.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/content-document.schema.json +16 -16
- package/schemas/document-tree.schema.json +3 -3
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_source = require("./source.cjs");
|
|
3
|
+
const require_geometry = require("./geometry.cjs");
|
|
4
|
+
const require_color = require("./color.cjs");
|
|
5
|
+
const require_content_vocabulary = require("./content-vocabulary.cjs");
|
|
6
|
+
let zod = require("zod");
|
|
7
|
+
//#region src/content-drawing.ts
|
|
8
|
+
const ContentShapeSchema = zod.z.object({
|
|
9
|
+
name: zod.z.string().optional(),
|
|
10
|
+
frame: require_geometry.BoxSchema,
|
|
11
|
+
rotationDeg: zod.z.number().optional(),
|
|
12
|
+
insetLeftPt: zod.z.number().nonnegative(),
|
|
13
|
+
insetTopPt: zod.z.number().nonnegative(),
|
|
14
|
+
insetRightPt: zod.z.number().nonnegative(),
|
|
15
|
+
insetBottomPt: zod.z.number().nonnegative(),
|
|
16
|
+
fontScale: zod.z.number().positive().optional(),
|
|
17
|
+
lineSpacingReduction: zod.z.number().nonnegative().optional(),
|
|
18
|
+
paintOrder: zod.z.number().optional(),
|
|
19
|
+
readingOrder: zod.z.number().optional(),
|
|
20
|
+
sourcePath: zod.z.string().optional(),
|
|
21
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
22
|
+
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
|
|
23
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS,
|
|
24
|
+
blocks: zod.z.lazy(() => zod.z.array(require_content_vocabulary.contentBlockSchemaBox.value))
|
|
25
|
+
});
|
|
26
|
+
const ContentSlideSchema = zod.z.object({
|
|
27
|
+
size: require_geometry.PageSizeSchema,
|
|
28
|
+
shapes: zod.z.array(ContentShapeSchema),
|
|
29
|
+
notes: zod.z.string(),
|
|
30
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
31
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS
|
|
32
|
+
});
|
|
33
|
+
const ContentStrokeDashSchema = zod.z.object({
|
|
34
|
+
dots1: zod.z.number().int().positive(),
|
|
35
|
+
dots1LengthPt: zod.z.number().positive(),
|
|
36
|
+
dots2: zod.z.number().int().positive().optional(),
|
|
37
|
+
dots2LengthPt: zod.z.number().positive().optional(),
|
|
38
|
+
distancePt: zod.z.number().nonnegative()
|
|
39
|
+
});
|
|
40
|
+
const ContentStrokeSchema = zod.z.object({
|
|
41
|
+
color: require_color.ColorSchema,
|
|
42
|
+
widthPt: zod.z.number().positive(),
|
|
43
|
+
style: require_content_vocabulary.ContentStrokeStyleSchema.optional(),
|
|
44
|
+
opacity: zod.z.number().min(0).max(1).optional(),
|
|
45
|
+
dashPattern: ContentStrokeDashSchema.optional()
|
|
46
|
+
});
|
|
47
|
+
const ContentGradientStyleSchema = zod.z.enum([
|
|
48
|
+
"linear",
|
|
49
|
+
"axial",
|
|
50
|
+
"radial",
|
|
51
|
+
"ellipsoid",
|
|
52
|
+
"square",
|
|
53
|
+
"rectangular"
|
|
54
|
+
]);
|
|
55
|
+
const ContentGradientFillSchema = zod.z.object({
|
|
56
|
+
kind: zod.z.literal("gradient"),
|
|
57
|
+
style: ContentGradientStyleSchema,
|
|
58
|
+
startColor: require_color.ColorSchema,
|
|
59
|
+
endColor: require_color.ColorSchema,
|
|
60
|
+
angleDeg: zod.z.number().optional()
|
|
61
|
+
});
|
|
62
|
+
const ContentHatchStyleSchema = zod.z.enum([
|
|
63
|
+
"single",
|
|
64
|
+
"double",
|
|
65
|
+
"triple"
|
|
66
|
+
]);
|
|
67
|
+
const ContentHatchFillSchema = zod.z.object({
|
|
68
|
+
kind: zod.z.literal("hatch"),
|
|
69
|
+
style: ContentHatchStyleSchema,
|
|
70
|
+
color: require_color.ColorSchema,
|
|
71
|
+
distancePt: zod.z.number().nonnegative(),
|
|
72
|
+
rotationDeg: zod.z.number().optional()
|
|
73
|
+
});
|
|
74
|
+
const ContentBitmapFillSchema = zod.z.object({
|
|
75
|
+
kind: zod.z.literal("bitmap"),
|
|
76
|
+
format: zod.z.enum([
|
|
77
|
+
"png",
|
|
78
|
+
"jpeg",
|
|
79
|
+
"svg",
|
|
80
|
+
"gif"
|
|
81
|
+
]),
|
|
82
|
+
base64: zod.z.string()
|
|
83
|
+
});
|
|
84
|
+
const ContentFillPatternSchema = zod.z.discriminatedUnion("kind", [
|
|
85
|
+
ContentGradientFillSchema,
|
|
86
|
+
ContentHatchFillSchema,
|
|
87
|
+
ContentBitmapFillSchema
|
|
88
|
+
]);
|
|
89
|
+
const ContentPathPointSchema = zod.z.object({
|
|
90
|
+
xPt: zod.z.number(),
|
|
91
|
+
yPt: zod.z.number()
|
|
92
|
+
});
|
|
93
|
+
const ContentPathSegmentSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
94
|
+
kind: zod.z.literal("line"),
|
|
95
|
+
to: ContentPathPointSchema
|
|
96
|
+
}), zod.z.object({
|
|
97
|
+
kind: zod.z.literal("cubic"),
|
|
98
|
+
control1: ContentPathPointSchema,
|
|
99
|
+
control2: ContentPathPointSchema,
|
|
100
|
+
to: ContentPathPointSchema
|
|
101
|
+
})]);
|
|
102
|
+
const ContentSubpathSchema = zod.z.object({
|
|
103
|
+
start: ContentPathPointSchema,
|
|
104
|
+
segments: zod.z.array(ContentPathSegmentSchema),
|
|
105
|
+
closed: zod.z.boolean()
|
|
106
|
+
});
|
|
107
|
+
const ContentVectorSchema = zod.z.discriminatedUnion("kind", [
|
|
108
|
+
zod.z.object({
|
|
109
|
+
kind: zod.z.literal("rect"),
|
|
110
|
+
frame: require_geometry.BoxSchema,
|
|
111
|
+
rotationDeg: zod.z.number().optional(),
|
|
112
|
+
fill: require_color.ColorSchema.optional(),
|
|
113
|
+
fillPattern: ContentFillPatternSchema.optional(),
|
|
114
|
+
fillOpacity: zod.z.number().min(0).max(1).optional(),
|
|
115
|
+
stroke: ContentStrokeSchema.optional(),
|
|
116
|
+
paintOrder: zod.z.number().optional(),
|
|
117
|
+
sourcePath: zod.z.string().optional(),
|
|
118
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
119
|
+
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
|
|
120
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS
|
|
121
|
+
}),
|
|
122
|
+
zod.z.object({
|
|
123
|
+
kind: zod.z.literal("ellipse"),
|
|
124
|
+
frame: require_geometry.BoxSchema,
|
|
125
|
+
rotationDeg: zod.z.number().optional(),
|
|
126
|
+
fill: require_color.ColorSchema.optional(),
|
|
127
|
+
fillPattern: ContentFillPatternSchema.optional(),
|
|
128
|
+
fillOpacity: zod.z.number().min(0).max(1).optional(),
|
|
129
|
+
stroke: ContentStrokeSchema.optional(),
|
|
130
|
+
paintOrder: zod.z.number().optional(),
|
|
131
|
+
sourcePath: zod.z.string().optional(),
|
|
132
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
133
|
+
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
|
|
134
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS
|
|
135
|
+
}),
|
|
136
|
+
zod.z.object({
|
|
137
|
+
kind: zod.z.literal("line"),
|
|
138
|
+
from: ContentPathPointSchema,
|
|
139
|
+
to: ContentPathPointSchema,
|
|
140
|
+
stroke: ContentStrokeSchema,
|
|
141
|
+
paintOrder: zod.z.number().optional(),
|
|
142
|
+
sourcePath: zod.z.string().optional(),
|
|
143
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
144
|
+
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
|
|
145
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS
|
|
146
|
+
}),
|
|
147
|
+
zod.z.object({
|
|
148
|
+
kind: zod.z.literal("path"),
|
|
149
|
+
frame: require_geometry.BoxSchema,
|
|
150
|
+
rotationDeg: zod.z.number().optional(),
|
|
151
|
+
subpaths: zod.z.array(ContentSubpathSchema),
|
|
152
|
+
fill: require_color.ColorSchema.optional(),
|
|
153
|
+
fillPattern: ContentFillPatternSchema.optional(),
|
|
154
|
+
fillOpacity: zod.z.number().min(0).max(1).optional(),
|
|
155
|
+
fillRule: zod.z.enum(["nonzero", "evenodd"]).optional(),
|
|
156
|
+
stroke: ContentStrokeSchema.optional(),
|
|
157
|
+
paintOrder: zod.z.number().optional(),
|
|
158
|
+
sourcePath: zod.z.string().optional(),
|
|
159
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
160
|
+
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
|
|
161
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS
|
|
162
|
+
})
|
|
163
|
+
]);
|
|
164
|
+
const ContentDrawPageSchema = zod.z.object({
|
|
165
|
+
size: require_geometry.PageSizeSchema,
|
|
166
|
+
shapes: zod.z.array(ContentShapeSchema),
|
|
167
|
+
vectors: zod.z.array(ContentVectorSchema),
|
|
168
|
+
source: require_source.SourceResidueSchema.optional(),
|
|
169
|
+
...require_content_vocabulary.CONTENT_ANNOTATION_FIELDS
|
|
170
|
+
});
|
|
171
|
+
//#endregion
|
|
172
|
+
exports.ContentBitmapFillSchema = ContentBitmapFillSchema;
|
|
173
|
+
exports.ContentDrawPageSchema = ContentDrawPageSchema;
|
|
174
|
+
exports.ContentFillPatternSchema = ContentFillPatternSchema;
|
|
175
|
+
exports.ContentGradientFillSchema = ContentGradientFillSchema;
|
|
176
|
+
exports.ContentGradientStyleSchema = ContentGradientStyleSchema;
|
|
177
|
+
exports.ContentHatchFillSchema = ContentHatchFillSchema;
|
|
178
|
+
exports.ContentHatchStyleSchema = ContentHatchStyleSchema;
|
|
179
|
+
exports.ContentPathPointSchema = ContentPathPointSchema;
|
|
180
|
+
exports.ContentPathSegmentSchema = ContentPathSegmentSchema;
|
|
181
|
+
exports.ContentShapeSchema = ContentShapeSchema;
|
|
182
|
+
exports.ContentSlideSchema = ContentSlideSchema;
|
|
183
|
+
exports.ContentStrokeDashSchema = ContentStrokeDashSchema;
|
|
184
|
+
exports.ContentStrokeSchema = ContentStrokeSchema;
|
|
185
|
+
exports.ContentSubpathSchema = ContentSubpathSchema;
|
|
186
|
+
exports.ContentVectorSchema = ContentVectorSchema;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as ContentVectorSchema, C as ContentStroke, D as ContentSubpath, E as ContentStrokeSchema, O as ContentSubpathSchema, S as ContentSlideSchema, T as ContentStrokeDashSchema, _ as ContentPathSegment, a as ContentFillPattern, b as ContentShapeSchema, c as ContentGradientFillSchema, d as ContentHatchFill, f as ContentHatchFillSchema, g as ContentPathPointSchema, h as ContentPathPoint, i as ContentDrawPageSchema, k as ContentVector, l as ContentGradientStyle, m as ContentHatchStyleSchema, n as ContentBitmapFillSchema, o as ContentFillPatternSchema, p as ContentHatchStyle, r as ContentDrawPage, s as ContentGradientFill, t as ContentBitmapFill, u as ContentGradientStyleSchema, v as ContentPathSegmentSchema, w as ContentStrokeDash, x as ContentSlide, y as ContentShape } from "./content-drawing-Dlo8cXJj.cjs";
|
|
2
|
+
export { ContentBitmapFill, ContentBitmapFillSchema, ContentDrawPage, ContentDrawPageSchema, ContentFillPattern, ContentFillPatternSchema, ContentGradientFill, ContentGradientFillSchema, ContentGradientStyle, ContentGradientStyleSchema, ContentHatchFill, ContentHatchFillSchema, ContentHatchStyle, ContentHatchStyleSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentShape, ContentShapeSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeDash, ContentStrokeDashSchema, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentVector, ContentVectorSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as ContentVectorSchema, C as ContentStroke, D as ContentSubpath, E as ContentStrokeSchema, O as ContentSubpathSchema, S as ContentSlideSchema, T as ContentStrokeDashSchema, _ as ContentPathSegment, a as ContentFillPattern, b as ContentShapeSchema, c as ContentGradientFillSchema, d as ContentHatchFill, f as ContentHatchFillSchema, g as ContentPathPointSchema, h as ContentPathPoint, i as ContentDrawPageSchema, k as ContentVector, l as ContentGradientStyle, m as ContentHatchStyleSchema, n as ContentBitmapFillSchema, o as ContentFillPatternSchema, p as ContentHatchStyle, r as ContentDrawPage, s as ContentGradientFill, t as ContentBitmapFill, u as ContentGradientStyleSchema, v as ContentPathSegmentSchema, w as ContentStrokeDash, x as ContentSlide, y as ContentShape } from "./content-drawing-DuvQQwuc.js";
|
|
2
|
+
export { ContentBitmapFill, ContentBitmapFillSchema, ContentDrawPage, ContentDrawPageSchema, ContentFillPattern, ContentFillPatternSchema, ContentGradientFill, ContentGradientFillSchema, ContentGradientStyle, ContentGradientStyleSchema, ContentHatchFill, ContentHatchFillSchema, ContentHatchStyle, ContentHatchStyleSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentShape, ContentShapeSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeDash, ContentStrokeDashSchema, ContentStrokeSchema, ContentSubpath, ContentSubpathSchema, ContentVector, ContentVectorSchema };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { SourceResidueSchema } from "./source.js";
|
|
2
|
+
import { BoxSchema, LayoutFrameSchema, PageSizeSchema } from "./geometry.js";
|
|
3
|
+
import { ColorSchema } from "./color.js";
|
|
4
|
+
import { CONTENT_ANNOTATION_FIELDS, ContentStrokeStyleSchema, contentBlockSchemaBox } from "./content-vocabulary.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/content-drawing.ts
|
|
7
|
+
const ContentShapeSchema = z.object({
|
|
8
|
+
name: z.string().optional(),
|
|
9
|
+
frame: BoxSchema,
|
|
10
|
+
rotationDeg: z.number().optional(),
|
|
11
|
+
insetLeftPt: z.number().nonnegative(),
|
|
12
|
+
insetTopPt: z.number().nonnegative(),
|
|
13
|
+
insetRightPt: z.number().nonnegative(),
|
|
14
|
+
insetBottomPt: z.number().nonnegative(),
|
|
15
|
+
fontScale: z.number().positive().optional(),
|
|
16
|
+
lineSpacingReduction: z.number().nonnegative().optional(),
|
|
17
|
+
paintOrder: z.number().optional(),
|
|
18
|
+
readingOrder: z.number().optional(),
|
|
19
|
+
sourcePath: z.string().optional(),
|
|
20
|
+
source: SourceResidueSchema.optional(),
|
|
21
|
+
frames: z.array(LayoutFrameSchema).optional(),
|
|
22
|
+
...CONTENT_ANNOTATION_FIELDS,
|
|
23
|
+
blocks: z.lazy(() => z.array(contentBlockSchemaBox.value))
|
|
24
|
+
});
|
|
25
|
+
const ContentSlideSchema = z.object({
|
|
26
|
+
size: PageSizeSchema,
|
|
27
|
+
shapes: z.array(ContentShapeSchema),
|
|
28
|
+
notes: z.string(),
|
|
29
|
+
source: SourceResidueSchema.optional(),
|
|
30
|
+
...CONTENT_ANNOTATION_FIELDS
|
|
31
|
+
});
|
|
32
|
+
const ContentStrokeDashSchema = z.object({
|
|
33
|
+
dots1: z.number().int().positive(),
|
|
34
|
+
dots1LengthPt: z.number().positive(),
|
|
35
|
+
dots2: z.number().int().positive().optional(),
|
|
36
|
+
dots2LengthPt: z.number().positive().optional(),
|
|
37
|
+
distancePt: z.number().nonnegative()
|
|
38
|
+
});
|
|
39
|
+
const ContentStrokeSchema = z.object({
|
|
40
|
+
color: ColorSchema,
|
|
41
|
+
widthPt: z.number().positive(),
|
|
42
|
+
style: ContentStrokeStyleSchema.optional(),
|
|
43
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
44
|
+
dashPattern: ContentStrokeDashSchema.optional()
|
|
45
|
+
});
|
|
46
|
+
const ContentGradientStyleSchema = z.enum([
|
|
47
|
+
"linear",
|
|
48
|
+
"axial",
|
|
49
|
+
"radial",
|
|
50
|
+
"ellipsoid",
|
|
51
|
+
"square",
|
|
52
|
+
"rectangular"
|
|
53
|
+
]);
|
|
54
|
+
const ContentGradientFillSchema = z.object({
|
|
55
|
+
kind: z.literal("gradient"),
|
|
56
|
+
style: ContentGradientStyleSchema,
|
|
57
|
+
startColor: ColorSchema,
|
|
58
|
+
endColor: ColorSchema,
|
|
59
|
+
angleDeg: z.number().optional()
|
|
60
|
+
});
|
|
61
|
+
const ContentHatchStyleSchema = z.enum([
|
|
62
|
+
"single",
|
|
63
|
+
"double",
|
|
64
|
+
"triple"
|
|
65
|
+
]);
|
|
66
|
+
const ContentHatchFillSchema = z.object({
|
|
67
|
+
kind: z.literal("hatch"),
|
|
68
|
+
style: ContentHatchStyleSchema,
|
|
69
|
+
color: ColorSchema,
|
|
70
|
+
distancePt: z.number().nonnegative(),
|
|
71
|
+
rotationDeg: z.number().optional()
|
|
72
|
+
});
|
|
73
|
+
const ContentBitmapFillSchema = z.object({
|
|
74
|
+
kind: z.literal("bitmap"),
|
|
75
|
+
format: z.enum([
|
|
76
|
+
"png",
|
|
77
|
+
"jpeg",
|
|
78
|
+
"svg",
|
|
79
|
+
"gif"
|
|
80
|
+
]),
|
|
81
|
+
base64: z.string()
|
|
82
|
+
});
|
|
83
|
+
const ContentFillPatternSchema = z.discriminatedUnion("kind", [
|
|
84
|
+
ContentGradientFillSchema,
|
|
85
|
+
ContentHatchFillSchema,
|
|
86
|
+
ContentBitmapFillSchema
|
|
87
|
+
]);
|
|
88
|
+
const ContentPathPointSchema = z.object({
|
|
89
|
+
xPt: z.number(),
|
|
90
|
+
yPt: z.number()
|
|
91
|
+
});
|
|
92
|
+
const ContentPathSegmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
93
|
+
kind: z.literal("line"),
|
|
94
|
+
to: ContentPathPointSchema
|
|
95
|
+
}), z.object({
|
|
96
|
+
kind: z.literal("cubic"),
|
|
97
|
+
control1: ContentPathPointSchema,
|
|
98
|
+
control2: ContentPathPointSchema,
|
|
99
|
+
to: ContentPathPointSchema
|
|
100
|
+
})]);
|
|
101
|
+
const ContentSubpathSchema = z.object({
|
|
102
|
+
start: ContentPathPointSchema,
|
|
103
|
+
segments: z.array(ContentPathSegmentSchema),
|
|
104
|
+
closed: z.boolean()
|
|
105
|
+
});
|
|
106
|
+
const ContentVectorSchema = z.discriminatedUnion("kind", [
|
|
107
|
+
z.object({
|
|
108
|
+
kind: z.literal("rect"),
|
|
109
|
+
frame: BoxSchema,
|
|
110
|
+
rotationDeg: z.number().optional(),
|
|
111
|
+
fill: ColorSchema.optional(),
|
|
112
|
+
fillPattern: ContentFillPatternSchema.optional(),
|
|
113
|
+
fillOpacity: z.number().min(0).max(1).optional(),
|
|
114
|
+
stroke: ContentStrokeSchema.optional(),
|
|
115
|
+
paintOrder: z.number().optional(),
|
|
116
|
+
sourcePath: z.string().optional(),
|
|
117
|
+
source: SourceResidueSchema.optional(),
|
|
118
|
+
frames: z.array(LayoutFrameSchema).optional(),
|
|
119
|
+
...CONTENT_ANNOTATION_FIELDS
|
|
120
|
+
}),
|
|
121
|
+
z.object({
|
|
122
|
+
kind: z.literal("ellipse"),
|
|
123
|
+
frame: BoxSchema,
|
|
124
|
+
rotationDeg: z.number().optional(),
|
|
125
|
+
fill: ColorSchema.optional(),
|
|
126
|
+
fillPattern: ContentFillPatternSchema.optional(),
|
|
127
|
+
fillOpacity: z.number().min(0).max(1).optional(),
|
|
128
|
+
stroke: ContentStrokeSchema.optional(),
|
|
129
|
+
paintOrder: z.number().optional(),
|
|
130
|
+
sourcePath: z.string().optional(),
|
|
131
|
+
source: SourceResidueSchema.optional(),
|
|
132
|
+
frames: z.array(LayoutFrameSchema).optional(),
|
|
133
|
+
...CONTENT_ANNOTATION_FIELDS
|
|
134
|
+
}),
|
|
135
|
+
z.object({
|
|
136
|
+
kind: z.literal("line"),
|
|
137
|
+
from: ContentPathPointSchema,
|
|
138
|
+
to: ContentPathPointSchema,
|
|
139
|
+
stroke: ContentStrokeSchema,
|
|
140
|
+
paintOrder: z.number().optional(),
|
|
141
|
+
sourcePath: z.string().optional(),
|
|
142
|
+
source: SourceResidueSchema.optional(),
|
|
143
|
+
frames: z.array(LayoutFrameSchema).optional(),
|
|
144
|
+
...CONTENT_ANNOTATION_FIELDS
|
|
145
|
+
}),
|
|
146
|
+
z.object({
|
|
147
|
+
kind: z.literal("path"),
|
|
148
|
+
frame: BoxSchema,
|
|
149
|
+
rotationDeg: z.number().optional(),
|
|
150
|
+
subpaths: z.array(ContentSubpathSchema),
|
|
151
|
+
fill: ColorSchema.optional(),
|
|
152
|
+
fillPattern: ContentFillPatternSchema.optional(),
|
|
153
|
+
fillOpacity: z.number().min(0).max(1).optional(),
|
|
154
|
+
fillRule: z.enum(["nonzero", "evenodd"]).optional(),
|
|
155
|
+
stroke: ContentStrokeSchema.optional(),
|
|
156
|
+
paintOrder: z.number().optional(),
|
|
157
|
+
sourcePath: z.string().optional(),
|
|
158
|
+
source: SourceResidueSchema.optional(),
|
|
159
|
+
frames: z.array(LayoutFrameSchema).optional(),
|
|
160
|
+
...CONTENT_ANNOTATION_FIELDS
|
|
161
|
+
})
|
|
162
|
+
]);
|
|
163
|
+
const ContentDrawPageSchema = z.object({
|
|
164
|
+
size: PageSizeSchema,
|
|
165
|
+
shapes: z.array(ContentShapeSchema),
|
|
166
|
+
vectors: z.array(ContentVectorSchema),
|
|
167
|
+
source: SourceResidueSchema.optional(),
|
|
168
|
+
...CONTENT_ANNOTATION_FIELDS
|
|
169
|
+
});
|
|
170
|
+
//#endregion
|
|
171
|
+
export { ContentBitmapFillSchema, ContentDrawPageSchema, ContentFillPatternSchema, ContentGradientFillSchema, ContentGradientStyleSchema, ContentHatchFillSchema, ContentHatchStyleSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentShapeSchema, ContentSlideSchema, ContentStrokeDashSchema, ContentStrokeSchema, ContentSubpathSchema, ContentVectorSchema };
|