document-schema 1.10.1 → 2.0.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/package.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { d as MathMlNode } from "./mathml-B1oTCtzc.js";
1
2
  import { ContentBlock, ContentEmbeddedObject } from "./content.js";
2
3
  import { z } from "zod";
3
4
  //#region src/package.d.ts
@@ -6,7 +7,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
6
7
  formatVersion: z.ZodLiteral<1>;
7
8
  content: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
9
  kind: z.ZodLiteral<"wordprocessing">;
9
- formatVersion: z.ZodLiteral<1>;
10
+ formatVersion: z.ZodLiteral<2>;
10
11
  metadata: z.ZodObject<{
11
12
  title: z.ZodOptional<z.ZodString>;
12
13
  author: z.ZodOptional<z.ZodString>;
@@ -32,7 +33,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
32
33
  }, z.core.$strip>>;
33
34
  }, z.core.$strip>, z.ZodObject<{
34
35
  kind: z.ZodLiteral<"presentation">;
35
- formatVersion: z.ZodLiteral<1>;
36
+ formatVersion: z.ZodLiteral<2>;
36
37
  metadata: z.ZodObject<{
37
38
  title: z.ZodOptional<z.ZodString>;
38
39
  author: z.ZodOptional<z.ZodString>;
@@ -63,6 +64,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
63
64
  insetBottomPt: z.ZodNumber;
64
65
  fontScale: z.ZodOptional<z.ZodNumber>;
65
66
  lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
67
+ paintOrder: z.ZodOptional<z.ZodNumber>;
66
68
  sourcePath: z.ZodOptional<z.ZodString>;
67
69
  blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
68
70
  }, z.core.$strip>>;
@@ -70,7 +72,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
70
72
  }, z.core.$strip>>;
71
73
  }, z.core.$strip>, z.ZodObject<{
72
74
  kind: z.ZodLiteral<"spreadsheet">;
73
- formatVersion: z.ZodLiteral<1>;
75
+ formatVersion: z.ZodLiteral<2>;
74
76
  metadata: z.ZodObject<{
75
77
  title: z.ZodOptional<z.ZodString>;
76
78
  author: z.ZodOptional<z.ZodString>;
@@ -89,13 +91,16 @@ declare const DocumentPackageSchema: z.ZodObject<{
89
91
  value: z.ZodDiscriminatedUnion<[z.ZodObject<{
90
92
  kind: z.ZodLiteral<"number">;
91
93
  value: z.ZodNumber;
94
+ exactValue: z.ZodOptional<z.ZodString>;
92
95
  }, z.core.$strip>, z.ZodObject<{
93
96
  kind: z.ZodLiteral<"percentage">;
94
97
  value: z.ZodNumber;
98
+ exactValue: z.ZodOptional<z.ZodString>;
95
99
  }, z.core.$strip>, z.ZodObject<{
96
100
  kind: z.ZodLiteral<"currency">;
97
101
  value: z.ZodNumber;
98
102
  currency: z.ZodOptional<z.ZodString>;
103
+ exactValue: z.ZodOptional<z.ZodString>;
99
104
  }, z.core.$strip>, z.ZodObject<{
100
105
  kind: z.ZodLiteral<"boolean">;
101
106
  value: z.ZodBoolean;
@@ -105,6 +110,9 @@ declare const DocumentPackageSchema: z.ZodObject<{
105
110
  }, z.core.$strip>, z.ZodObject<{
106
111
  kind: z.ZodLiteral<"time">;
107
112
  value: z.ZodString;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ kind: z.ZodLiteral<"dateTime">;
115
+ value: z.ZodString;
108
116
  }, z.core.$strip>, z.ZodObject<{
109
117
  kind: z.ZodLiteral<"string">;
110
118
  value: z.ZodString;
@@ -134,15 +142,90 @@ declare const DocumentPackageSchema: z.ZodObject<{
134
142
  }, z.core.$strip>>>;
135
143
  colSpan: z.ZodOptional<z.ZodNumber>;
136
144
  rowSpan: z.ZodOptional<z.ZodNumber>;
145
+ background: z.ZodOptional<z.ZodObject<{
146
+ r: z.ZodNumber;
147
+ g: z.ZodNumber;
148
+ b: z.ZodNumber;
149
+ }, z.core.$strip>>;
150
+ borders: z.ZodOptional<z.ZodObject<{
151
+ left: z.ZodOptional<z.ZodObject<{
152
+ color: z.ZodObject<{
153
+ r: z.ZodNumber;
154
+ g: z.ZodNumber;
155
+ b: z.ZodNumber;
156
+ }, z.core.$strip>;
157
+ widthPt: z.ZodNumber;
158
+ style: z.ZodOptional<z.ZodEnum<{
159
+ solid: "solid";
160
+ dashed: "dashed";
161
+ dotted: "dotted";
162
+ double: "double";
163
+ }>>;
164
+ }, z.core.$strip>>;
165
+ right: z.ZodOptional<z.ZodObject<{
166
+ color: z.ZodObject<{
167
+ r: z.ZodNumber;
168
+ g: z.ZodNumber;
169
+ b: z.ZodNumber;
170
+ }, z.core.$strip>;
171
+ widthPt: z.ZodNumber;
172
+ style: z.ZodOptional<z.ZodEnum<{
173
+ solid: "solid";
174
+ dashed: "dashed";
175
+ dotted: "dotted";
176
+ double: "double";
177
+ }>>;
178
+ }, z.core.$strip>>;
179
+ top: z.ZodOptional<z.ZodObject<{
180
+ color: z.ZodObject<{
181
+ r: z.ZodNumber;
182
+ g: z.ZodNumber;
183
+ b: z.ZodNumber;
184
+ }, z.core.$strip>;
185
+ widthPt: z.ZodNumber;
186
+ style: z.ZodOptional<z.ZodEnum<{
187
+ solid: "solid";
188
+ dashed: "dashed";
189
+ dotted: "dotted";
190
+ double: "double";
191
+ }>>;
192
+ }, z.core.$strip>>;
193
+ bottom: z.ZodOptional<z.ZodObject<{
194
+ color: z.ZodObject<{
195
+ r: z.ZodNumber;
196
+ g: z.ZodNumber;
197
+ b: z.ZodNumber;
198
+ }, z.core.$strip>;
199
+ widthPt: z.ZodNumber;
200
+ style: z.ZodOptional<z.ZodEnum<{
201
+ solid: "solid";
202
+ dashed: "dashed";
203
+ dotted: "dotted";
204
+ double: "double";
205
+ }>>;
206
+ }, z.core.$strip>>;
207
+ }, z.core.$strip>>;
208
+ alignment: z.ZodOptional<z.ZodEnum<{
209
+ left: "left";
210
+ center: "center";
211
+ right: "right";
212
+ justify: "justify";
213
+ }>>;
214
+ verticalAlignment: z.ZodOptional<z.ZodEnum<{
215
+ top: "top";
216
+ bottom: "bottom";
217
+ middle: "middle";
218
+ }>>;
219
+ sourcePath: z.ZodOptional<z.ZodString>;
137
220
  }, z.core.$strip>>;
138
221
  columns: z.ZodArray<z.ZodObject<{
139
222
  index: z.ZodNumber;
140
- widthPt: z.ZodNumber;
223
+ widthPt: z.ZodOptional<z.ZodNumber>;
141
224
  hidden: z.ZodOptional<z.ZodBoolean>;
142
225
  }, z.core.$strip>>;
143
226
  rows: z.ZodArray<z.ZodObject<{
144
227
  index: z.ZodNumber;
145
- heightPt: z.ZodNumber;
228
+ heightPt: z.ZodOptional<z.ZodNumber>;
146
229
  hidden: z.ZodOptional<z.ZodBoolean>;
147
230
  }, z.core.$strip>>;
148
231
  images: z.ZodArray<z.ZodObject<{
@@ -178,7 +261,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
178
261
  endRow: z.ZodNumber;
179
262
  endColumn: z.ZodNumber;
180
263
  }, z.core.$strip>>;
181
- scale: z.ZodOptional<z.ZodNumber>;
264
+ scalePercent: z.ZodOptional<z.ZodNumber>;
182
265
  fitToPages: z.ZodOptional<z.ZodObject<{
183
266
  width: z.ZodNumber;
184
267
  height: z.ZodNumber;
@@ -206,7 +289,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
206
289
  }, z.core.$strip>>;
207
290
  }, z.core.$strip>, z.ZodObject<{
208
291
  kind: z.ZodLiteral<"drawing">;
209
- formatVersion: z.ZodLiteral<1>;
292
+ formatVersion: z.ZodLiteral<2>;
210
293
  metadata: z.ZodObject<{
211
294
  title: z.ZodOptional<z.ZodString>;
212
295
  author: z.ZodOptional<z.ZodString>;
@@ -237,6 +320,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
237
320
  insetBottomPt: z.ZodNumber;
238
321
  fontScale: z.ZodOptional<z.ZodNumber>;
239
322
  lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
323
+ paintOrder: z.ZodOptional<z.ZodNumber>;
240
324
  sourcePath: z.ZodOptional<z.ZodString>;
241
325
  blocks: z.ZodArray<z.ZodCustom<ContentBlock, ContentBlock>>;
242
326
  }, z.core.$strip>>;
@@ -248,6 +332,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
248
332
  widthPt: z.ZodNumber;
249
333
  heightPt: z.ZodNumber;
250
334
  }, z.core.$strip>;
335
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
251
336
  fill: z.ZodOptional<z.ZodObject<{
252
337
  r: z.ZodNumber;
253
338
  g: z.ZodNumber;
@@ -260,7 +345,14 @@ declare const DocumentPackageSchema: z.ZodObject<{
260
345
  b: z.ZodNumber;
261
346
  }, z.core.$strip>;
262
347
  widthPt: z.ZodNumber;
348
+ style: z.ZodOptional<z.ZodEnum<{
349
+ solid: "solid";
350
+ dashed: "dashed";
351
+ dotted: "dotted";
352
+ double: "double";
353
+ }>>;
263
354
  }, z.core.$strip>>;
355
+ paintOrder: z.ZodOptional<z.ZodNumber>;
264
356
  sourcePath: z.ZodOptional<z.ZodString>;
265
357
  }, z.core.$strip>, z.ZodObject<{
266
358
  kind: z.ZodLiteral<"ellipse">;
@@ -270,6 +362,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
270
362
  widthPt: z.ZodNumber;
271
363
  heightPt: z.ZodNumber;
272
364
  }, z.core.$strip>;
365
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
273
366
  fill: z.ZodOptional<z.ZodObject<{
274
367
  r: z.ZodNumber;
275
368
  g: z.ZodNumber;
@@ -282,7 +375,14 @@ declare const DocumentPackageSchema: z.ZodObject<{
282
375
  b: z.ZodNumber;
283
376
  }, z.core.$strip>;
284
377
  widthPt: z.ZodNumber;
378
+ style: z.ZodOptional<z.ZodEnum<{
379
+ solid: "solid";
380
+ dashed: "dashed";
381
+ dotted: "dotted";
382
+ double: "double";
383
+ }>>;
285
384
  }, z.core.$strip>>;
385
+ paintOrder: z.ZodOptional<z.ZodNumber>;
286
386
  sourcePath: z.ZodOptional<z.ZodString>;
287
387
  }, z.core.$strip>, z.ZodObject<{
288
388
  kind: z.ZodLiteral<"line">;
@@ -301,7 +401,14 @@ declare const DocumentPackageSchema: z.ZodObject<{
301
401
  b: z.ZodNumber;
302
402
  }, z.core.$strip>;
303
403
  widthPt: z.ZodNumber;
404
+ style: z.ZodOptional<z.ZodEnum<{
405
+ solid: "solid";
406
+ dashed: "dashed";
407
+ dotted: "dotted";
408
+ double: "double";
409
+ }>>;
304
410
  }, z.core.$strip>;
411
+ paintOrder: z.ZodOptional<z.ZodNumber>;
305
412
  sourcePath: z.ZodOptional<z.ZodString>;
306
413
  }, z.core.$strip>, z.ZodObject<{
307
414
  kind: z.ZodLiteral<"path">;
@@ -311,6 +418,7 @@ declare const DocumentPackageSchema: z.ZodObject<{
311
418
  widthPt: z.ZodNumber;
312
419
  heightPt: z.ZodNumber;
313
420
  }, z.core.$strip>;
421
+ rotationDeg: z.ZodOptional<z.ZodNumber>;
314
422
  subpaths: z.ZodArray<z.ZodObject<{
315
423
  start: z.ZodObject<{
316
424
  xPt: z.ZodNumber;
@@ -355,10 +463,34 @@ declare const DocumentPackageSchema: z.ZodObject<{
355
463
  b: z.ZodNumber;
356
464
  }, z.core.$strip>;
357
465
  widthPt: z.ZodNumber;
466
+ style: z.ZodOptional<z.ZodEnum<{
467
+ solid: "solid";
468
+ dashed: "dashed";
469
+ dotted: "dotted";
470
+ double: "double";
471
+ }>>;
358
472
  }, z.core.$strip>>;
473
+ paintOrder: z.ZodOptional<z.ZodNumber>;
359
474
  sourcePath: z.ZodOptional<z.ZodString>;
360
475
  }, z.core.$strip>], "kind">>;
361
476
  }, z.core.$strip>>;
477
+ }, z.core.$strip>, z.ZodObject<{
478
+ kind: z.ZodLiteral<"formula">;
479
+ formatVersion: z.ZodLiteral<2>;
480
+ metadata: z.ZodObject<{
481
+ title: z.ZodOptional<z.ZodString>;
482
+ author: z.ZodOptional<z.ZodString>;
483
+ subject: z.ZodOptional<z.ZodString>;
484
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
485
+ creator: z.ZodOptional<z.ZodString>;
486
+ producer: z.ZodOptional<z.ZodString>;
487
+ createdIso: z.ZodOptional<z.ZodString>;
488
+ modifiedIso: z.ZodOptional<z.ZodString>;
489
+ }, z.core.$strip>;
490
+ formula: z.ZodObject<{
491
+ mathml: z.ZodArray<z.ZodCustom<MathMlNode, MathMlNode>>;
492
+ starMath: z.ZodOptional<z.ZodString>;
493
+ }, z.core.$strip>;
362
494
  }, z.core.$strip>], "kind">;
363
495
  layout: z.ZodOptional<z.ZodObject<{
364
496
  formatVersion: z.ZodLiteral<1>;
@@ -383,12 +515,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
383
515
  font: z.ZodObject<{
384
516
  family: z.ZodString;
385
517
  weight: z.ZodEnum<{
386
- bold: "bold";
387
518
  normal: "normal";
519
+ bold: "bold";
388
520
  }>;
389
521
  style: z.ZodEnum<{
390
- italic: "italic";
391
522
  normal: "normal";
523
+ italic: "italic";
392
524
  }>;
393
525
  }, z.core.$strip>;
394
526
  sizePt: z.ZodNumber;
@@ -9,7 +9,7 @@ const SCHEMA_FILE_NAMES = {
9
9
  LayoutDocument: "layout-document.schema.json"
10
10
  };
11
11
  function schemaUriFor(kind) {
12
- return `https://cdn.jsdelivr.net/npm/document-schema.js@1.10.1/schemas/${SCHEMA_FILE_NAMES[kind]}`;
12
+ return `https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
13
13
  }
14
14
  const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@[^/]+\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
15
15
  function kindForFileStem(stem) {
package/dist/schema-io.js CHANGED
@@ -8,7 +8,7 @@ const SCHEMA_FILE_NAMES = {
8
8
  LayoutDocument: "layout-document.schema.json"
9
9
  };
10
10
  function schemaUriFor(kind) {
11
- return `https://cdn.jsdelivr.net/npm/document-schema.js@1.10.1/schemas/${SCHEMA_FILE_NAMES[kind]}`;
11
+ return `https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
12
12
  }
13
13
  const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@[^/]+\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
14
14
  function kindForFileStem(stem) {
package/dist/style.d.cts CHANGED
@@ -10,12 +10,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
10
10
  declare const LayoutFontSchema: z.ZodObject<{
11
11
  family: z.ZodString;
12
12
  weight: z.ZodEnum<{
13
- bold: "bold";
14
13
  normal: "normal";
14
+ bold: "bold";
15
15
  }>;
16
16
  style: z.ZodEnum<{
17
- italic: "italic";
18
17
  normal: "normal";
18
+ italic: "italic";
19
19
  }>;
20
20
  }, z.core.$strip>;
21
21
  type LayoutFont = z.infer<typeof LayoutFontSchema>;
package/dist/style.d.ts CHANGED
@@ -10,12 +10,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
10
10
  declare const LayoutFontSchema: z.ZodObject<{
11
11
  family: z.ZodString;
12
12
  weight: z.ZodEnum<{
13
- bold: "bold";
14
13
  normal: "normal";
14
+ bold: "bold";
15
15
  }>;
16
16
  style: z.ZodEnum<{
17
- italic: "italic";
18
17
  normal: "normal";
18
+ italic: "italic";
19
19
  }>;
20
20
  }, z.core.$strip>;
21
21
  type LayoutFont = z.infer<typeof LayoutFontSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-schema",
3
- "version": "1.10.1",
3
+ "version": "2.0.0",
4
4
  "description": "The canonical, format-agnostic content and layout schemas shared by ooxml.js, odf.js, and documents.js -- pure Zod schemas, no behaviour.",
5
5
  "type": "module",
6
6
  "repository": {