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.
Files changed (103) hide show
  1. package/dist/bijection-constructs-3By08A5K.cjs +14695 -0
  2. package/dist/bijection-constructs-DlP29TpB.js +14624 -0
  3. package/dist/bijection-constructs.cjs +4 -0
  4. package/dist/bijection-constructs.d.cts +6 -0
  5. package/dist/bijection-constructs.d.ts +6 -0
  6. package/dist/bijection-constructs.js +2 -0
  7. package/dist/bijection-corpus.cjs +12 -0
  8. package/dist/bijection-corpus.d.cts +46 -0
  9. package/dist/bijection-corpus.d.ts +46 -0
  10. package/dist/bijection-corpus.js +2 -0
  11. package/dist/codec.d.cts +1 -1
  12. package/dist/codec.d.ts +1 -1
  13. package/dist/{construct-C9cYkjnd.d.cts → construct-C4XiF8OW.d.cts} +6 -6
  14. package/dist/{construct-C9cYkjnd.d.ts → construct-C4XiF8OW.d.ts} +6 -6
  15. package/dist/construct.d.cts +1 -1
  16. package/dist/construct.d.ts +1 -1
  17. package/dist/{content-1yGdeaVT.d.ts → content-CBE4kBMo.d.ts} +7917 -9507
  18. package/dist/{content-CSf8z9NW.d.cts → content-DKx5QaRd.d.cts} +7917 -9507
  19. package/dist/content-drawing-Dlo8cXJj.d.cts +1606 -0
  20. package/dist/content-drawing-DuvQQwuc.d.ts +1606 -0
  21. package/dist/content-drawing.cjs +186 -0
  22. package/dist/content-drawing.d.cts +2 -0
  23. package/dist/content-drawing.d.ts +2 -0
  24. package/dist/content-drawing.js +171 -0
  25. package/dist/content-json-schema-defs.cjs +27 -3033
  26. package/dist/content-json-schema-defs.d.cts +2 -6
  27. package/dist/content-json-schema-defs.d.ts +2 -6
  28. package/dist/content-json-schema-defs.js +28 -3031
  29. package/dist/content-sheet.cjs +408 -0
  30. package/dist/content-sheet.d.cts +2 -0
  31. package/dist/content-sheet.d.ts +2 -0
  32. package/dist/content-sheet.js +385 -0
  33. package/dist/content-vocabulary.cjs +190 -0
  34. package/dist/content-vocabulary.d.cts +2 -0
  35. package/dist/content-vocabulary.d.ts +2 -0
  36. package/dist/content-vocabulary.js +168 -0
  37. package/dist/content.cjs +29 -781
  38. package/dist/content.d.cts +2 -2
  39. package/dist/content.d.ts +2 -2
  40. package/dist/content.js +6 -701
  41. package/dist/decompose.d.cts +3 -2
  42. package/dist/decompose.d.ts +3 -2
  43. package/dist/definitions.cjs +2 -1
  44. package/dist/definitions.d.cts +4 -4
  45. package/dist/definitions.d.ts +4 -4
  46. package/dist/definitions.js +2 -1
  47. package/dist/factor-styles.d.cts +1 -1
  48. package/dist/factor-styles.d.ts +1 -1
  49. package/dist/flatten.d.cts +1 -1
  50. package/dist/flatten.d.ts +1 -1
  51. package/dist/index.cjs +69 -63
  52. package/dist/index.d.cts +10 -8
  53. package/dist/index.d.ts +10 -8
  54. package/dist/index.js +10 -6
  55. package/dist/json-schema-defs-blocks.cjs +1036 -0
  56. package/dist/json-schema-defs-blocks.d.cts +5 -0
  57. package/dist/json-schema-defs-blocks.d.ts +5 -0
  58. package/dist/json-schema-defs-blocks.js +1035 -0
  59. package/dist/json-schema-defs-math.cjs +291 -0
  60. package/dist/json-schema-defs-math.d.cts +5 -0
  61. package/dist/json-schema-defs-math.d.ts +5 -0
  62. package/dist/json-schema-defs-math.js +290 -0
  63. package/dist/json-schema-defs-shared.cjs +42 -0
  64. package/dist/json-schema-defs-shared.d.cts +9 -0
  65. package/dist/json-schema-defs-shared.d.ts +9 -0
  66. package/dist/json-schema-defs-shared.js +38 -0
  67. package/dist/json-schema-defs-sheet.cjs +944 -0
  68. package/dist/json-schema-defs-sheet.d.cts +5 -0
  69. package/dist/json-schema-defs-sheet.d.ts +5 -0
  70. package/dist/json-schema-defs-sheet.js +943 -0
  71. package/dist/json-schema-defs-tree.cjs +237 -0
  72. package/dist/json-schema-defs-tree.d.cts +5 -0
  73. package/dist/json-schema-defs-tree.d.ts +5 -0
  74. package/dist/json-schema-defs-tree.js +237 -0
  75. package/dist/json-schema-defs-vector.cjs +513 -0
  76. package/dist/json-schema-defs-vector.d.cts +5 -0
  77. package/dist/json-schema-defs-vector.d.ts +5 -0
  78. package/dist/json-schema-defs-vector.js +512 -0
  79. package/dist/magic-string.es-CB2hOw9v.js +1012 -0
  80. package/dist/magic-string.es-MEBc20Ce.cjs +1012 -0
  81. package/dist/{package-node-ng7Yimj9.d.cts → package-node-BYL2owXg.d.cts} +40 -39
  82. package/dist/{package-node-CpE1BAqK.d.ts → package-node-vI3Q0nFf.d.ts} +40 -39
  83. package/dist/package-node.cjs +12 -9
  84. package/dist/package-node.d.cts +1 -1
  85. package/dist/package-node.d.ts +1 -1
  86. package/dist/package-node.js +4 -1
  87. package/dist/package.d.cts +6 -6
  88. package/dist/package.d.ts +6 -6
  89. package/dist/schema-io.cjs +2 -2
  90. package/dist/schema-io.d.cts +1 -1
  91. package/dist/schema-io.d.ts +1 -1
  92. package/dist/schema-io.js +2 -2
  93. package/dist/{style-BGMcYrD2.d.cts → style-D06NwxAJ.d.cts} +1 -1
  94. package/dist/{style-BGMcYrD2.d.ts → style-D06NwxAJ.d.ts} +1 -1
  95. package/dist/style.d.cts +1 -1
  96. package/dist/style.d.ts +1 -1
  97. package/dist/table-grid.d.cts +2 -2
  98. package/dist/table-grid.d.ts +2 -2
  99. package/dist/text-layout.d.cts +1 -1
  100. package/dist/text-layout.d.ts +1 -1
  101. package/package.json +1 -1
  102. package/schemas/content-document.schema.json +16 -16
  103. package/schemas/document-tree.schema.json +3 -3
@@ -0,0 +1,385 @@
1
+ import { SourceResidueSchema } from "./source.js";
2
+ import { LayoutFrameSchema, MarginsSchema, PageSizeSchema } from "./geometry.js";
3
+ import { AlignmentSchema } from "./style.js";
4
+ import { ColorSchema } from "./color.js";
5
+ import { CONTENT_ANNOTATION_FIELDS, ContentBorderSchema, ContentEmbeddedObjectSchema, ContentFontSchema, ContentImageBlockSchema, ContentRunSchema } from "./content-vocabulary.js";
6
+ import { z } from "zod";
7
+ //#region src/content-sheet.ts
8
+ const ContentCellBordersSchema = z.object({
9
+ left: ContentBorderSchema.optional(),
10
+ right: ContentBorderSchema.optional(),
11
+ top: ContentBorderSchema.optional(),
12
+ bottom: ContentBorderSchema.optional(),
13
+ diagonalUp: ContentBorderSchema.optional(),
14
+ diagonalDown: ContentBorderSchema.optional()
15
+ });
16
+ const ContentCellPatternTypeSchema = z.enum([
17
+ "percent5",
18
+ "percent10",
19
+ "percent12",
20
+ "percent15",
21
+ "percent20",
22
+ "percent25",
23
+ "percent30",
24
+ "percent35",
25
+ "percent37",
26
+ "percent40",
27
+ "percent45",
28
+ "percent50",
29
+ "percent55",
30
+ "percent60",
31
+ "percent62",
32
+ "percent65",
33
+ "percent70",
34
+ "percent75",
35
+ "percent80",
36
+ "percent85",
37
+ "percent87",
38
+ "percent90",
39
+ "percent95",
40
+ "horizontalStripe",
41
+ "verticalStripe",
42
+ "diagonalStripe",
43
+ "reverseDiagonalStripe",
44
+ "horizontalCross",
45
+ "diagonalCross",
46
+ "thinHorizontalStripe",
47
+ "thinVerticalStripe",
48
+ "thinDiagonalStripe",
49
+ "thinReverseDiagonalStripe",
50
+ "thinHorizontalCross",
51
+ "thinDiagonalCross",
52
+ "mediumGray",
53
+ "darkGray",
54
+ "lightGray",
55
+ "darkHorizontal",
56
+ "darkVertical",
57
+ "darkDown",
58
+ "darkUp",
59
+ "darkGrid",
60
+ "darkTrellis",
61
+ "lightHorizontal",
62
+ "lightVertical",
63
+ "lightDown",
64
+ "lightUp",
65
+ "lightGrid",
66
+ "lightTrellis",
67
+ "gray125",
68
+ "gray0625"
69
+ ]);
70
+ const ContentCellFillSchema = z.discriminatedUnion("kind", [z.object({
71
+ kind: z.literal("solid"),
72
+ color: ColorSchema
73
+ }), z.object({
74
+ kind: z.literal("pattern"),
75
+ patternType: ContentCellPatternTypeSchema,
76
+ foregroundColor: ColorSchema.optional(),
77
+ backgroundColor: ColorSchema.optional()
78
+ })]);
79
+ function resolveCellFillColor(fill) {
80
+ return fill.kind === "solid" ? fill.color : fill.foregroundColor ?? fill.backgroundColor;
81
+ }
82
+ function unrecognizedFillKind(fill) {
83
+ return String(fill.kind);
84
+ }
85
+ const DecimalStringSchema = z.string().regex(/^-?(0|[1-9]\d*)(\.\d+)?$/);
86
+ const ContentCellValueSchema = z.discriminatedUnion("kind", [
87
+ z.object({
88
+ kind: z.literal("number"),
89
+ value: z.number(),
90
+ exactValue: DecimalStringSchema.optional()
91
+ }),
92
+ z.object({
93
+ kind: z.literal("percentage"),
94
+ value: z.number(),
95
+ exactValue: DecimalStringSchema.optional()
96
+ }),
97
+ z.object({
98
+ kind: z.literal("currency"),
99
+ value: z.number(),
100
+ currency: z.string().optional(),
101
+ exactValue: DecimalStringSchema.optional()
102
+ }),
103
+ z.object({
104
+ kind: z.literal("boolean"),
105
+ value: z.boolean()
106
+ }),
107
+ z.object({
108
+ kind: z.literal("date"),
109
+ value: z.string()
110
+ }),
111
+ z.object({
112
+ kind: z.literal("time"),
113
+ value: z.string()
114
+ }),
115
+ z.object({
116
+ kind: z.literal("dateTime"),
117
+ value: z.string()
118
+ }),
119
+ z.object({
120
+ kind: z.literal("string"),
121
+ value: z.string()
122
+ }),
123
+ z.object({
124
+ kind: z.literal("error"),
125
+ value: z.string()
126
+ }),
127
+ z.object({ kind: z.literal("empty") })
128
+ ]);
129
+ const ContentSheetCellCommentSchema = z.object({
130
+ text: z.string(),
131
+ author: z.string().optional(),
132
+ createdAt: z.string().optional(),
133
+ replies: z.array(z.object({
134
+ text: z.string(),
135
+ author: z.string().optional()
136
+ })).optional()
137
+ });
138
+ const ContentSheetCellSchema = z.object({
139
+ row: z.number().int().nonnegative(),
140
+ column: z.number().int().nonnegative(),
141
+ value: ContentCellValueSchema,
142
+ formula: z.string().optional(),
143
+ displayText: z.string(),
144
+ numberFormatCode: z.string().optional(),
145
+ font: ContentFontSchema.optional(),
146
+ runs: z.array(ContentRunSchema).optional(),
147
+ colSpan: z.number().int().positive().optional(),
148
+ rowSpan: z.number().int().positive().optional(),
149
+ background: ContentCellFillSchema.optional(),
150
+ borders: ContentCellBordersSchema.optional(),
151
+ alignment: AlignmentSchema.optional(),
152
+ verticalAlignment: z.enum([
153
+ "top",
154
+ "middle",
155
+ "bottom"
156
+ ]).optional(),
157
+ comment: ContentSheetCellCommentSchema.optional(),
158
+ sourcePath: z.string().optional(),
159
+ source: SourceResidueSchema.optional(),
160
+ frames: z.array(LayoutFrameSchema).optional(),
161
+ ...CONTENT_ANNOTATION_FIELDS
162
+ });
163
+ const ContentSheetColumnSchema = z.object({
164
+ index: z.number().int().nonnegative(),
165
+ widthPt: z.number().positive().optional(),
166
+ hidden: z.boolean().optional()
167
+ });
168
+ const ContentSheetRowSchema = z.object({
169
+ index: z.number().int().nonnegative(),
170
+ heightPt: z.number().positive().optional(),
171
+ hidden: z.boolean().optional()
172
+ });
173
+ const ContentSheetPrintRangeSchema = z.object({
174
+ startRow: z.number().int().nonnegative(),
175
+ startColumn: z.number().int().nonnegative(),
176
+ endRow: z.number().int().nonnegative(),
177
+ endColumn: z.number().int().nonnegative()
178
+ });
179
+ const ContentSheetRepeatRangeSchema = z.object({
180
+ start: z.number().int().nonnegative(),
181
+ end: z.number().int().nonnegative()
182
+ });
183
+ const ContentSheetPrintSettingsSchema = z.object({
184
+ pageSize: PageSizeSchema,
185
+ margins: MarginsSchema,
186
+ printRange: ContentSheetPrintRangeSchema.optional(),
187
+ scalePercent: z.number().positive().optional(),
188
+ fitToPages: z.object({
189
+ width: z.number().int().positive(),
190
+ height: z.number().int().positive()
191
+ }).optional(),
192
+ repeatRows: ContentSheetRepeatRangeSchema.optional(),
193
+ repeatColumns: ContentSheetRepeatRangeSchema.optional(),
194
+ gridlines: z.boolean(),
195
+ headers: z.boolean(),
196
+ pageOrder: z.enum(["downThenOver", "overThenDown"]),
197
+ manualBreaks: z.object({
198
+ rows: z.array(z.number().int().nonnegative()),
199
+ columns: z.array(z.number().int().nonnegative())
200
+ }).optional()
201
+ });
202
+ const ContentSheetRangeSchema = z.object({
203
+ startRow: z.number().int().nonnegative(),
204
+ startColumn: z.number().int().nonnegative(),
205
+ endRow: z.number().int().nonnegative(),
206
+ endColumn: z.number().int().nonnegative()
207
+ });
208
+ const SheetRuleOperatorSchema = z.enum([
209
+ "between",
210
+ "notBetween",
211
+ "equal",
212
+ "notEqual",
213
+ "greaterThan",
214
+ "greaterThanOrEqual",
215
+ "lessThan",
216
+ "lessThanOrEqual"
217
+ ]);
218
+ const ContentSheetDataValidationTypeSchema = z.enum([
219
+ "whole",
220
+ "decimal",
221
+ "list",
222
+ "date",
223
+ "time",
224
+ "textLength",
225
+ "custom"
226
+ ]);
227
+ const ContentSheetDataValidationSchema = z.object({
228
+ ranges: z.array(ContentSheetRangeSchema),
229
+ type: ContentSheetDataValidationTypeSchema,
230
+ operator: SheetRuleOperatorSchema.optional(),
231
+ formula1: z.string().optional(),
232
+ formula2: z.string().optional(),
233
+ allowBlank: z.boolean().optional(),
234
+ showInputMessage: z.boolean().optional(),
235
+ promptTitle: z.string().optional(),
236
+ prompt: z.string().optional(),
237
+ showErrorMessage: z.boolean().optional(),
238
+ errorStyle: z.enum([
239
+ "stop",
240
+ "warning",
241
+ "information"
242
+ ]).optional(),
243
+ errorTitle: z.string().optional(),
244
+ error: z.string().optional(),
245
+ source: SourceResidueSchema.optional()
246
+ });
247
+ const ContentSheetConditionalFormatStyleSchema = z.object({
248
+ textColor: ColorSchema.optional(),
249
+ background: ColorSchema.optional(),
250
+ source: SourceResidueSchema.optional()
251
+ });
252
+ const cfvoTypeSchema = z.enum([
253
+ "num",
254
+ "percent",
255
+ "max",
256
+ "min",
257
+ "formula",
258
+ "percentile"
259
+ ]);
260
+ const ContentSheetConditionalFormatValueSchema = z.object({
261
+ type: cfvoTypeSchema,
262
+ value: z.string().optional()
263
+ });
264
+ const MIN_COLOR_SCALE_STOPS = 2;
265
+ const MAX_COLOR_SCALE_STOPS = 3;
266
+ const conditionalFormatCommonFields = {
267
+ ranges: z.array(ContentSheetRangeSchema),
268
+ priority: z.number().int().optional(),
269
+ stopIfTrue: z.boolean().optional(),
270
+ source: SourceResidueSchema.optional()
271
+ };
272
+ const ContentSheetConditionalFormatSchema = z.discriminatedUnion("type", [
273
+ z.object({
274
+ type: z.literal("cellIs"),
275
+ ...conditionalFormatCommonFields,
276
+ operator: SheetRuleOperatorSchema,
277
+ formula1: z.string(),
278
+ formula2: z.string().optional(),
279
+ style: ContentSheetConditionalFormatStyleSchema.optional()
280
+ }),
281
+ z.object({
282
+ type: z.enum([
283
+ "containsText",
284
+ "notContainsText",
285
+ "beginsWith",
286
+ "endsWith"
287
+ ]),
288
+ ...conditionalFormatCommonFields,
289
+ text: z.string(),
290
+ style: ContentSheetConditionalFormatStyleSchema.optional()
291
+ }),
292
+ z.object({
293
+ type: z.enum([
294
+ "containsBlanks",
295
+ "notContainsBlanks",
296
+ "containsErrors",
297
+ "notContainsErrors",
298
+ "uniqueValues",
299
+ "duplicateValues"
300
+ ]),
301
+ ...conditionalFormatCommonFields,
302
+ style: ContentSheetConditionalFormatStyleSchema.optional()
303
+ }),
304
+ z.object({
305
+ type: z.literal("top10"),
306
+ ...conditionalFormatCommonFields,
307
+ rank: z.number().positive(),
308
+ percent: z.boolean().optional(),
309
+ bottom: z.boolean().optional(),
310
+ style: ContentSheetConditionalFormatStyleSchema.optional()
311
+ }),
312
+ z.object({
313
+ type: z.literal("aboveAverage"),
314
+ ...conditionalFormatCommonFields,
315
+ aboveAverage: z.boolean().optional(),
316
+ equalAverage: z.boolean().optional(),
317
+ stdDev: z.number().int().positive().optional(),
318
+ style: ContentSheetConditionalFormatStyleSchema.optional()
319
+ }),
320
+ z.object({
321
+ type: z.literal("timePeriod"),
322
+ ...conditionalFormatCommonFields,
323
+ timePeriod: z.enum([
324
+ "yesterday",
325
+ "today",
326
+ "tomorrow",
327
+ "last7Days",
328
+ "thisMonth",
329
+ "lastMonth",
330
+ "nextMonth",
331
+ "thisWeek",
332
+ "lastWeek",
333
+ "nextWeek",
334
+ "thisYear",
335
+ "lastYear",
336
+ "nextYear"
337
+ ]),
338
+ style: ContentSheetConditionalFormatStyleSchema.optional()
339
+ }),
340
+ z.object({
341
+ type: z.literal("colorScale"),
342
+ ...conditionalFormatCommonFields,
343
+ stops: z.array(z.object({
344
+ value: ContentSheetConditionalFormatValueSchema,
345
+ color: ColorSchema
346
+ })).min(MIN_COLOR_SCALE_STOPS).max(MAX_COLOR_SCALE_STOPS)
347
+ }),
348
+ z.object({
349
+ type: z.literal("dataBar"),
350
+ ...conditionalFormatCommonFields,
351
+ min: ContentSheetConditionalFormatValueSchema,
352
+ max: ContentSheetConditionalFormatValueSchema,
353
+ color: ColorSchema,
354
+ showValue: z.boolean().optional()
355
+ }),
356
+ z.object({
357
+ type: z.literal("iconSet"),
358
+ ...conditionalFormatCommonFields,
359
+ iconSetType: z.string(),
360
+ thresholds: z.array(ContentSheetConditionalFormatValueSchema),
361
+ reverse: z.boolean().optional(),
362
+ showValue: z.boolean().optional()
363
+ })
364
+ ]);
365
+ const ContentSheetImageSchema = ContentImageBlockSchema.extend({
366
+ anchorRow: z.number().int().nonnegative(),
367
+ anchorColumn: z.number().int().nonnegative(),
368
+ offsetXPt: z.number(),
369
+ offsetYPt: z.number()
370
+ });
371
+ const ContentSheetSchema = z.object({
372
+ name: z.string(),
373
+ cells: z.array(ContentSheetCellSchema),
374
+ columns: z.array(ContentSheetColumnSchema),
375
+ rows: z.array(ContentSheetRowSchema),
376
+ images: z.array(ContentSheetImageSchema),
377
+ printSettings: ContentSheetPrintSettingsSchema,
378
+ embeddedObjects: z.array(ContentEmbeddedObjectSchema).optional(),
379
+ dataValidations: z.array(ContentSheetDataValidationSchema).optional(),
380
+ conditionalFormats: z.array(ContentSheetConditionalFormatSchema).optional(),
381
+ source: SourceResidueSchema.optional(),
382
+ ...CONTENT_ANNOTATION_FIELDS
383
+ });
384
+ //#endregion
385
+ export { ContentCellBordersSchema, ContentCellFillSchema, ContentCellPatternTypeSchema, ContentCellValueSchema, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidationSchema, ContentSheetDataValidationTypeSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRangeSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, DecimalStringSchema, SheetRuleOperatorSchema, resolveCellFillColor, unrecognizedFillKind };
@@ -0,0 +1,190 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_source = require("./source.cjs");
3
+ const require_construct = require("./construct.cjs");
4
+ const require_geometry = require("./geometry.cjs");
5
+ const require_style = require("./style.cjs");
6
+ const require_color = require("./color.cjs");
7
+ let zod = require("zod");
8
+ //#region src/content-vocabulary.ts
9
+ const ContentOriginSchema = zod.z.enum([
10
+ "chart",
11
+ "diagram",
12
+ "table",
13
+ "image",
14
+ "notes",
15
+ "body"
16
+ ]);
17
+ const ContentTranscriptSchema = zod.z.object({
18
+ text: zod.z.string(),
19
+ confidence: zod.z.enum([
20
+ "high",
21
+ "medium",
22
+ "low"
23
+ ]),
24
+ mechanism: zod.z.enum(["deterministic", "model"])
25
+ });
26
+ const ContentInterpretationSchema = zod.z.object({
27
+ transcript: ContentTranscriptSchema.optional(),
28
+ description: zod.z.string().optional(),
29
+ by: zod.z.object({
30
+ model: zod.z.string(),
31
+ at: zod.z.string()
32
+ }).optional()
33
+ });
34
+ const CONTENT_ANNOTATION_FIELDS = {
35
+ origin: ContentOriginSchema.optional(),
36
+ interpretation: ContentInterpretationSchema.optional()
37
+ };
38
+ const RUN_FONT_PROPERTY_SHAPE = {
39
+ bold: zod.z.boolean().optional(),
40
+ italic: zod.z.boolean().optional(),
41
+ underline: zod.z.boolean().optional(),
42
+ strike: zod.z.boolean().optional(),
43
+ fontFamily: zod.z.string().optional(),
44
+ sizePt: zod.z.number().positive().optional(),
45
+ color: require_color.ColorSchema.optional()
46
+ };
47
+ const ContentFontSchema = zod.z.object(RUN_FONT_PROPERTY_SHAPE);
48
+ const ContentRunSchema = zod.z.object({
49
+ text: zod.z.string(),
50
+ ...RUN_FONT_PROPERTY_SHAPE,
51
+ hyperlink: zod.z.string().optional(),
52
+ verticalAlign: zod.z.enum(["superscript", "subscript"]).optional(),
53
+ direction: require_style.TextDirectionSchema.optional(),
54
+ sourcePath: zod.z.string().optional(),
55
+ source: require_source.SourceResidueSchema.optional(),
56
+ frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
57
+ ...CONTENT_ANNOTATION_FIELDS
58
+ });
59
+ const RunConstructExtentSchema = zod.z.object({
60
+ descriptor: require_construct.ConstructDescriptorSchema,
61
+ startRun: zod.z.number().int().nonnegative(),
62
+ endRun: zod.z.number().int().nonnegative()
63
+ });
64
+ const ContentStrokeStyleSchema = zod.z.enum([
65
+ "solid",
66
+ "dashed",
67
+ "dotted",
68
+ "double"
69
+ ]);
70
+ const ContentBorderSchema = zod.z.object({
71
+ color: require_color.ColorSchema,
72
+ widthPt: zod.z.number().positive(),
73
+ style: ContentStrokeStyleSchema.optional()
74
+ });
75
+ const ContentFloatOriginSchema = zod.z.enum([
76
+ "page",
77
+ "margin",
78
+ "leftMargin",
79
+ "rightMargin",
80
+ "topMargin",
81
+ "bottomMargin",
82
+ "insideMargin",
83
+ "outsideMargin",
84
+ "column",
85
+ "character",
86
+ "paragraph",
87
+ "line",
88
+ "frame"
89
+ ]);
90
+ const ContentFloatAlignSchema = zod.z.enum([
91
+ "left",
92
+ "right",
93
+ "top",
94
+ "bottom",
95
+ "center",
96
+ "inside",
97
+ "outside"
98
+ ]);
99
+ const ContentFloatAxisSchema = zod.z.union([zod.z.strictObject({
100
+ relativeTo: ContentFloatOriginSchema,
101
+ offsetPt: zod.z.number()
102
+ }), zod.z.strictObject({
103
+ relativeTo: ContentFloatOriginSchema,
104
+ align: ContentFloatAlignSchema
105
+ })]);
106
+ const ContentFloatPositionSchema = zod.z.object({
107
+ horizontal: ContentFloatAxisSchema,
108
+ vertical: ContentFloatAxisSchema
109
+ });
110
+ const IMAGE_FORMATS = [
111
+ "png",
112
+ "jpeg",
113
+ "svg",
114
+ "gif"
115
+ ];
116
+ function isImageFormat(value) {
117
+ return IMAGE_FORMATS.includes(value);
118
+ }
119
+ const ContentImageOriginalSchema = zod.z.object({
120
+ filter: zod.z.enum(["jbig2", "jpeg2000"]),
121
+ base64: zod.z.string(),
122
+ jbig2GlobalsBase64: zod.z.string().optional()
123
+ });
124
+ const ContentImageBlockSchema = zod.z.object({
125
+ kind: zod.z.literal("image"),
126
+ format: zod.z.enum(IMAGE_FORMATS),
127
+ base64: zod.z.string(),
128
+ widthPt: zod.z.number().positive(),
129
+ heightPt: zod.z.number().positive(),
130
+ altText: zod.z.string().optional(),
131
+ original: ContentImageOriginalSchema.optional(),
132
+ anchorRunIndex: zod.z.number().int().nonnegative().optional(),
133
+ anchorOffset: zod.z.number().int().nonnegative().optional(),
134
+ caption: zod.z.string().optional(),
135
+ floatPosition: ContentFloatPositionSchema.optional(),
136
+ sourcePath: zod.z.string().optional(),
137
+ source: require_source.SourceResidueSchema.optional(),
138
+ frames: zod.z.array(require_geometry.LayoutFrameSchema).optional(),
139
+ ...CONTENT_ANNOTATION_FIELDS
140
+ });
141
+ const contentBlockSchemaBox = {};
142
+ const contentDocumentSchemaBox = {};
143
+ const CONTENT_EMBEDDED_OBJECT_FIELDS = {
144
+ objectKind: zod.z.enum([
145
+ "formula",
146
+ "wordprocessing",
147
+ "presentation",
148
+ "spreadsheet",
149
+ "drawing",
150
+ "chart"
151
+ ]),
152
+ document: zod.z.lazy(() => contentDocumentSchemaBox.value),
153
+ frame: require_geometry.BoxSchema,
154
+ anchorRow: zod.z.number().int().nonnegative().optional(),
155
+ anchorColumn: zod.z.number().int().nonnegative().optional(),
156
+ offsetXPt: zod.z.number().optional(),
157
+ offsetYPt: zod.z.number().optional(),
158
+ source: require_source.SourceResidueSchema.optional(),
159
+ ...CONTENT_ANNOTATION_FIELDS
160
+ };
161
+ const ContentEmbeddedObjectSchema = zod.z.object(CONTENT_EMBEDDED_OBJECT_FIELDS);
162
+ const ContentEmbeddedObjectBlockSchema = zod.z.object({
163
+ kind: zod.z.literal("embeddedObject"),
164
+ ...CONTENT_EMBEDDED_OBJECT_FIELDS,
165
+ sourcePath: zod.z.string().optional(),
166
+ frames: zod.z.array(require_geometry.LayoutFrameSchema).optional()
167
+ });
168
+ //#endregion
169
+ exports.CONTENT_ANNOTATION_FIELDS = CONTENT_ANNOTATION_FIELDS;
170
+ exports.ContentBorderSchema = ContentBorderSchema;
171
+ exports.ContentEmbeddedObjectBlockSchema = ContentEmbeddedObjectBlockSchema;
172
+ exports.ContentEmbeddedObjectSchema = ContentEmbeddedObjectSchema;
173
+ exports.ContentFloatAlignSchema = ContentFloatAlignSchema;
174
+ exports.ContentFloatAxisSchema = ContentFloatAxisSchema;
175
+ exports.ContentFloatOriginSchema = ContentFloatOriginSchema;
176
+ exports.ContentFloatPositionSchema = ContentFloatPositionSchema;
177
+ exports.ContentFontSchema = ContentFontSchema;
178
+ exports.ContentImageBlockSchema = ContentImageBlockSchema;
179
+ exports.ContentImageOriginalSchema = ContentImageOriginalSchema;
180
+ exports.ContentInterpretationSchema = ContentInterpretationSchema;
181
+ exports.ContentOriginSchema = ContentOriginSchema;
182
+ exports.ContentRunSchema = ContentRunSchema;
183
+ exports.ContentStrokeStyleSchema = ContentStrokeStyleSchema;
184
+ exports.ContentTranscriptSchema = ContentTranscriptSchema;
185
+ exports.IMAGE_FORMATS = IMAGE_FORMATS;
186
+ exports.RUN_FONT_PROPERTY_SHAPE = RUN_FONT_PROPERTY_SHAPE;
187
+ exports.RunConstructExtentSchema = RunConstructExtentSchema;
188
+ exports.contentBlockSchemaBox = contentBlockSchemaBox;
189
+ exports.contentDocumentSchemaBox = contentDocumentSchemaBox;
190
+ exports.isImageFormat = isImageFormat;
@@ -0,0 +1,2 @@
1
+ import { $t as ContentImageBlockSchema, Bt as ContentEmbeddedObjectBlockSchema, Gt as ContentFloatAxisSchema, Ht as ContentFloatAlign, Jt as ContentFloatPosition, Kt as ContentFloatOrigin, Lt as CONTENT_ANNOTATION_FIELDS, Qt as ContentImageBlock, Rt as ContentBorder, Ut as ContentFloatAlignSchema, Vt as ContentEmbeddedObjectSchema, Wt as ContentFloatAxis, Xt as ContentFont, Yt as ContentFloatPositionSchema, Zt as ContentFontSchema, _n as contentBlockSchemaBox, an as ContentOriginSchema, cn as ContentStrokeStyle, dn as ContentTranscriptSchema, en as ContentImageOriginal, fn as IMAGE_FORMATS, gn as RunConstructExtentSchema, hn as RunConstructExtent, in as ContentOrigin, ln as ContentStrokeStyleSchema, mn as RUN_FONT_PROPERTY_SHAPE, nn as ContentInterpretation, on as ContentRun, pn as ImageFormat, qt as ContentFloatOriginSchema, rn as ContentInterpretationSchema, sn as ContentRunSchema, tn as ContentImageOriginalSchema, un as ContentTranscript, vn as contentDocumentSchemaBox, yn as isImageFormat, zt as ContentBorderSchema } from "./content-DKx5QaRd.cjs";
2
+ export { CONTENT_ANNOTATION_FIELDS, ContentBorder, ContentBorderSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFloatAlign, ContentFloatAlignSchema, ContentFloatAxis, ContentFloatAxisSchema, ContentFloatOrigin, ContentFloatOriginSchema, ContentFloatPosition, ContentFloatPositionSchema, ContentFont, ContentFontSchema, ContentImageBlock, ContentImageBlockSchema, ContentImageOriginal, ContentImageOriginalSchema, ContentInterpretation, ContentInterpretationSchema, ContentOrigin, ContentOriginSchema, ContentRun, ContentRunSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentTranscript, ContentTranscriptSchema, IMAGE_FORMATS, ImageFormat, RUN_FONT_PROPERTY_SHAPE, RunConstructExtent, RunConstructExtentSchema, contentBlockSchemaBox, contentDocumentSchemaBox, isImageFormat };
@@ -0,0 +1,2 @@
1
+ import { $t as ContentImageBlockSchema, Bt as ContentEmbeddedObjectBlockSchema, Gt as ContentFloatAxisSchema, Ht as ContentFloatAlign, Jt as ContentFloatPosition, Kt as ContentFloatOrigin, Lt as CONTENT_ANNOTATION_FIELDS, Qt as ContentImageBlock, Rt as ContentBorder, Ut as ContentFloatAlignSchema, Vt as ContentEmbeddedObjectSchema, Wt as ContentFloatAxis, Xt as ContentFont, Yt as ContentFloatPositionSchema, Zt as ContentFontSchema, _n as contentBlockSchemaBox, an as ContentOriginSchema, cn as ContentStrokeStyle, dn as ContentTranscriptSchema, en as ContentImageOriginal, fn as IMAGE_FORMATS, gn as RunConstructExtentSchema, hn as RunConstructExtent, in as ContentOrigin, ln as ContentStrokeStyleSchema, mn as RUN_FONT_PROPERTY_SHAPE, nn as ContentInterpretation, on as ContentRun, pn as ImageFormat, qt as ContentFloatOriginSchema, rn as ContentInterpretationSchema, sn as ContentRunSchema, tn as ContentImageOriginalSchema, un as ContentTranscript, vn as contentDocumentSchemaBox, yn as isImageFormat, zt as ContentBorderSchema } from "./content-CBE4kBMo.js";
2
+ export { CONTENT_ANNOTATION_FIELDS, ContentBorder, ContentBorderSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFloatAlign, ContentFloatAlignSchema, ContentFloatAxis, ContentFloatAxisSchema, ContentFloatOrigin, ContentFloatOriginSchema, ContentFloatPosition, ContentFloatPositionSchema, ContentFont, ContentFontSchema, ContentImageBlock, ContentImageBlockSchema, ContentImageOriginal, ContentImageOriginalSchema, ContentInterpretation, ContentInterpretationSchema, ContentOrigin, ContentOriginSchema, ContentRun, ContentRunSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentTranscript, ContentTranscriptSchema, IMAGE_FORMATS, ImageFormat, RUN_FONT_PROPERTY_SHAPE, RunConstructExtent, RunConstructExtentSchema, contentBlockSchemaBox, contentDocumentSchemaBox, isImageFormat };