doc-model.js 2.0.0 → 2.1.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/layout.cjs CHANGED
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_color = require("./color.cjs");
3
3
  const require_metadata = require("./metadata.cjs");
4
4
  const require_style = require("./style.cjs");
5
+ const require_content = require("./content.cjs");
5
6
  let zod = require("zod");
6
7
  //#region src/layout.ts
7
8
  const LAYOUT_FORMAT_VERSION = 1;
@@ -49,6 +50,7 @@ const LayoutLineSchema = zod.z.object({
49
50
  y2Pt: zod.z.number(),
50
51
  color: require_color.ColorSchema,
51
52
  widthPt: zod.z.number().positive(),
53
+ style: require_content.ContentStrokeStyleSchema.optional(),
52
54
  sourcePath: zod.z.string().optional()
53
55
  });
54
56
  const LayoutEllipseSchema = zod.z.object({
@@ -92,6 +94,7 @@ const LayoutPathSchema = zod.z.object({
92
94
  color: require_color.ColorSchema,
93
95
  widthPt: zod.z.number().positive()
94
96
  }).optional(),
97
+ style: require_content.ContentStrokeStyleSchema.optional(),
95
98
  sourcePath: zod.z.string().optional()
96
99
  });
97
100
  const LayoutLinkSchema = zod.z.object({
package/dist/layout.d.cts CHANGED
@@ -74,6 +74,12 @@ declare const LayoutLineSchema: z.ZodObject<{
74
74
  b: z.ZodNumber;
75
75
  }, z.core.$strip>;
76
76
  widthPt: z.ZodNumber;
77
+ style: z.ZodOptional<z.ZodEnum<{
78
+ solid: "solid";
79
+ dashed: "dashed";
80
+ dotted: "dotted";
81
+ double: "double";
82
+ }>>;
77
83
  sourcePath: z.ZodOptional<z.ZodString>;
78
84
  }, z.core.$strip>;
79
85
  type LayoutLine = z.infer<typeof LayoutLineSchema>;
@@ -169,6 +175,12 @@ declare const LayoutPathSchema: z.ZodObject<{
169
175
  }, z.core.$strip>;
170
176
  widthPt: z.ZodNumber;
171
177
  }, z.core.$strip>>;
178
+ style: z.ZodOptional<z.ZodEnum<{
179
+ solid: "solid";
180
+ dashed: "dashed";
181
+ dotted: "dotted";
182
+ double: "double";
183
+ }>>;
172
184
  sourcePath: z.ZodOptional<z.ZodString>;
173
185
  }, z.core.$strip>;
174
186
  type LayoutPath = z.infer<typeof LayoutPathSchema>;
@@ -249,6 +261,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
249
261
  b: z.ZodNumber;
250
262
  }, z.core.$strip>;
251
263
  widthPt: z.ZodNumber;
264
+ style: z.ZodOptional<z.ZodEnum<{
265
+ solid: "solid";
266
+ dashed: "dashed";
267
+ dotted: "dotted";
268
+ double: "double";
269
+ }>>;
252
270
  sourcePath: z.ZodOptional<z.ZodString>;
253
271
  }, z.core.$strip>, z.ZodObject<{
254
272
  kind: z.ZodLiteral<"ellipse">;
@@ -307,6 +325,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
307
325
  }, z.core.$strip>;
308
326
  widthPt: z.ZodNumber;
309
327
  }, z.core.$strip>>;
328
+ style: z.ZodOptional<z.ZodEnum<{
329
+ solid: "solid";
330
+ dashed: "dashed";
331
+ dotted: "dotted";
332
+ double: "double";
333
+ }>>;
310
334
  sourcePath: z.ZodOptional<z.ZodString>;
311
335
  }, z.core.$strip>, z.ZodObject<{
312
336
  kind: z.ZodLiteral<"link">;
@@ -388,6 +412,12 @@ declare const LayoutPageSchema: z.ZodObject<{
388
412
  b: z.ZodNumber;
389
413
  }, z.core.$strip>;
390
414
  widthPt: z.ZodNumber;
415
+ style: z.ZodOptional<z.ZodEnum<{
416
+ solid: "solid";
417
+ dashed: "dashed";
418
+ dotted: "dotted";
419
+ double: "double";
420
+ }>>;
391
421
  sourcePath: z.ZodOptional<z.ZodString>;
392
422
  }, z.core.$strip>, z.ZodObject<{
393
423
  kind: z.ZodLiteral<"ellipse">;
@@ -446,6 +476,12 @@ declare const LayoutPageSchema: z.ZodObject<{
446
476
  }, z.core.$strip>;
447
477
  widthPt: z.ZodNumber;
448
478
  }, z.core.$strip>>;
479
+ style: z.ZodOptional<z.ZodEnum<{
480
+ solid: "solid";
481
+ dashed: "dashed";
482
+ dotted: "dotted";
483
+ double: "double";
484
+ }>>;
449
485
  sourcePath: z.ZodOptional<z.ZodString>;
450
486
  }, z.core.$strip>, z.ZodObject<{
451
487
  kind: z.ZodLiteral<"link">;
@@ -551,6 +587,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
551
587
  b: z.ZodNumber;
552
588
  }, z.core.$strip>;
553
589
  widthPt: z.ZodNumber;
590
+ style: z.ZodOptional<z.ZodEnum<{
591
+ solid: "solid";
592
+ dashed: "dashed";
593
+ dotted: "dotted";
594
+ double: "double";
595
+ }>>;
554
596
  sourcePath: z.ZodOptional<z.ZodString>;
555
597
  }, z.core.$strip>, z.ZodObject<{
556
598
  kind: z.ZodLiteral<"ellipse">;
@@ -609,6 +651,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
609
651
  }, z.core.$strip>;
610
652
  widthPt: z.ZodNumber;
611
653
  }, z.core.$strip>>;
654
+ style: z.ZodOptional<z.ZodEnum<{
655
+ solid: "solid";
656
+ dashed: "dashed";
657
+ dotted: "dotted";
658
+ double: "double";
659
+ }>>;
612
660
  sourcePath: z.ZodOptional<z.ZodString>;
613
661
  }, z.core.$strip>, z.ZodObject<{
614
662
  kind: z.ZodLiteral<"link">;
package/dist/layout.d.ts CHANGED
@@ -74,6 +74,12 @@ declare const LayoutLineSchema: z.ZodObject<{
74
74
  b: z.ZodNumber;
75
75
  }, z.core.$strip>;
76
76
  widthPt: z.ZodNumber;
77
+ style: z.ZodOptional<z.ZodEnum<{
78
+ solid: "solid";
79
+ dashed: "dashed";
80
+ dotted: "dotted";
81
+ double: "double";
82
+ }>>;
77
83
  sourcePath: z.ZodOptional<z.ZodString>;
78
84
  }, z.core.$strip>;
79
85
  type LayoutLine = z.infer<typeof LayoutLineSchema>;
@@ -169,6 +175,12 @@ declare const LayoutPathSchema: z.ZodObject<{
169
175
  }, z.core.$strip>;
170
176
  widthPt: z.ZodNumber;
171
177
  }, z.core.$strip>>;
178
+ style: z.ZodOptional<z.ZodEnum<{
179
+ solid: "solid";
180
+ dashed: "dashed";
181
+ dotted: "dotted";
182
+ double: "double";
183
+ }>>;
172
184
  sourcePath: z.ZodOptional<z.ZodString>;
173
185
  }, z.core.$strip>;
174
186
  type LayoutPath = z.infer<typeof LayoutPathSchema>;
@@ -249,6 +261,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
249
261
  b: z.ZodNumber;
250
262
  }, z.core.$strip>;
251
263
  widthPt: z.ZodNumber;
264
+ style: z.ZodOptional<z.ZodEnum<{
265
+ solid: "solid";
266
+ dashed: "dashed";
267
+ dotted: "dotted";
268
+ double: "double";
269
+ }>>;
252
270
  sourcePath: z.ZodOptional<z.ZodString>;
253
271
  }, z.core.$strip>, z.ZodObject<{
254
272
  kind: z.ZodLiteral<"ellipse">;
@@ -307,6 +325,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
307
325
  }, z.core.$strip>;
308
326
  widthPt: z.ZodNumber;
309
327
  }, z.core.$strip>>;
328
+ style: z.ZodOptional<z.ZodEnum<{
329
+ solid: "solid";
330
+ dashed: "dashed";
331
+ dotted: "dotted";
332
+ double: "double";
333
+ }>>;
310
334
  sourcePath: z.ZodOptional<z.ZodString>;
311
335
  }, z.core.$strip>, z.ZodObject<{
312
336
  kind: z.ZodLiteral<"link">;
@@ -388,6 +412,12 @@ declare const LayoutPageSchema: z.ZodObject<{
388
412
  b: z.ZodNumber;
389
413
  }, z.core.$strip>;
390
414
  widthPt: z.ZodNumber;
415
+ style: z.ZodOptional<z.ZodEnum<{
416
+ solid: "solid";
417
+ dashed: "dashed";
418
+ dotted: "dotted";
419
+ double: "double";
420
+ }>>;
391
421
  sourcePath: z.ZodOptional<z.ZodString>;
392
422
  }, z.core.$strip>, z.ZodObject<{
393
423
  kind: z.ZodLiteral<"ellipse">;
@@ -446,6 +476,12 @@ declare const LayoutPageSchema: z.ZodObject<{
446
476
  }, z.core.$strip>;
447
477
  widthPt: z.ZodNumber;
448
478
  }, z.core.$strip>>;
479
+ style: z.ZodOptional<z.ZodEnum<{
480
+ solid: "solid";
481
+ dashed: "dashed";
482
+ dotted: "dotted";
483
+ double: "double";
484
+ }>>;
449
485
  sourcePath: z.ZodOptional<z.ZodString>;
450
486
  }, z.core.$strip>, z.ZodObject<{
451
487
  kind: z.ZodLiteral<"link">;
@@ -551,6 +587,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
551
587
  b: z.ZodNumber;
552
588
  }, z.core.$strip>;
553
589
  widthPt: z.ZodNumber;
590
+ style: z.ZodOptional<z.ZodEnum<{
591
+ solid: "solid";
592
+ dashed: "dashed";
593
+ dotted: "dotted";
594
+ double: "double";
595
+ }>>;
554
596
  sourcePath: z.ZodOptional<z.ZodString>;
555
597
  }, z.core.$strip>, z.ZodObject<{
556
598
  kind: z.ZodLiteral<"ellipse">;
@@ -609,6 +651,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
609
651
  }, z.core.$strip>;
610
652
  widthPt: z.ZodNumber;
611
653
  }, z.core.$strip>>;
654
+ style: z.ZodOptional<z.ZodEnum<{
655
+ solid: "solid";
656
+ dashed: "dashed";
657
+ dotted: "dotted";
658
+ double: "double";
659
+ }>>;
612
660
  sourcePath: z.ZodOptional<z.ZodString>;
613
661
  }, z.core.$strip>, z.ZodObject<{
614
662
  kind: z.ZodLiteral<"link">;
package/dist/layout.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ColorSchema } from "./color.js";
2
2
  import { LayoutMetadataSchema } from "./metadata.js";
3
3
  import { LayoutFontSchema } from "./style.js";
4
+ import { ContentStrokeStyleSchema } from "./content.js";
4
5
  import { z } from "zod";
5
6
  //#region src/layout.ts
6
7
  const LAYOUT_FORMAT_VERSION = 1;
@@ -48,6 +49,7 @@ const LayoutLineSchema = z.object({
48
49
  y2Pt: z.number(),
49
50
  color: ColorSchema,
50
51
  widthPt: z.number().positive(),
52
+ style: ContentStrokeStyleSchema.optional(),
51
53
  sourcePath: z.string().optional()
52
54
  });
53
55
  const LayoutEllipseSchema = z.object({
@@ -91,6 +93,7 @@ const LayoutPathSchema = z.object({
91
93
  color: ColorSchema,
92
94
  widthPt: z.number().positive()
93
95
  }).optional(),
96
+ style: ContentStrokeStyleSchema.optional(),
94
97
  sourcePath: z.string().optional()
95
98
  });
96
99
  const LayoutLinkSchema = z.object({
@@ -574,6 +574,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
574
574
  b: z.ZodNumber;
575
575
  }, z.core.$strip>;
576
576
  widthPt: z.ZodNumber;
577
+ style: z.ZodOptional<z.ZodEnum<{
578
+ solid: "solid";
579
+ dashed: "dashed";
580
+ dotted: "dotted";
581
+ double: "double";
582
+ }>>;
577
583
  sourcePath: z.ZodOptional<z.ZodString>;
578
584
  }, z.core.$strip>, z.ZodObject<{
579
585
  kind: z.ZodLiteral<"ellipse">;
@@ -632,6 +638,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
632
638
  }, z.core.$strip>;
633
639
  widthPt: z.ZodNumber;
634
640
  }, z.core.$strip>>;
641
+ style: z.ZodOptional<z.ZodEnum<{
642
+ solid: "solid";
643
+ dashed: "dashed";
644
+ dotted: "dotted";
645
+ double: "double";
646
+ }>>;
635
647
  sourcePath: z.ZodOptional<z.ZodString>;
636
648
  }, z.core.$strip>, z.ZodObject<{
637
649
  kind: z.ZodLiteral<"link">;
package/dist/package.d.ts CHANGED
@@ -574,6 +574,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
574
574
  b: z.ZodNumber;
575
575
  }, z.core.$strip>;
576
576
  widthPt: z.ZodNumber;
577
+ style: z.ZodOptional<z.ZodEnum<{
578
+ solid: "solid";
579
+ dashed: "dashed";
580
+ dotted: "dotted";
581
+ double: "double";
582
+ }>>;
577
583
  sourcePath: z.ZodOptional<z.ZodString>;
578
584
  }, z.core.$strip>, z.ZodObject<{
579
585
  kind: z.ZodLiteral<"ellipse">;
@@ -632,6 +638,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
632
638
  }, z.core.$strip>;
633
639
  widthPt: z.ZodNumber;
634
640
  }, z.core.$strip>>;
641
+ style: z.ZodOptional<z.ZodEnum<{
642
+ solid: "solid";
643
+ dashed: "dashed";
644
+ dotted: "dotted";
645
+ double: "double";
646
+ }>>;
635
647
  sourcePath: z.ZodOptional<z.ZodString>;
636
648
  }, z.core.$strip>, z.ZodObject<{
637
649
  kind: z.ZodLiteral<"link">;
@@ -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@2.0.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
12
+ return `https://cdn.jsdelivr.net/npm/document-schema.js@2.1.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@2.0.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
11
+ return `https://cdn.jsdelivr.net/npm/document-schema.js@2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-model.js",
3
- "version": "2.0.0",
3
+ "version": "2.1.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": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/content-document.schema.json",
4
4
  "oneOf": [
5
5
  {
6
6
  "type": "object",
@@ -1208,7 +1208,7 @@
1208
1208
  ]
1209
1209
  },
1210
1210
  "document": {
1211
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json"
1211
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/content-document.schema.json"
1212
1212
  },
1213
1213
  "frame": {
1214
1214
  "$ref": "#/$defs/Box"
@@ -2483,7 +2483,7 @@
2483
2483
  ]
2484
2484
  },
2485
2485
  "document": {
2486
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json"
2486
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/content-document.schema.json"
2487
2487
  },
2488
2488
  "frame": {
2489
2489
  "$ref": "#/$defs/Box"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/document-package.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/document-package.schema.json",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "formatVersion": {
@@ -8,10 +8,10 @@
8
8
  "const": 1
9
9
  },
10
10
  "content": {
11
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json"
11
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/content-document.schema.json"
12
12
  },
13
13
  "layout": {
14
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/layout-document.schema.json"
14
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/layout-document.schema.json"
15
15
  }
16
16
  },
17
17
  "required": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/layout-document.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.1.0/schemas/layout-document.schema.json",
4
4
  "type": "object",
5
5
  "properties": {
6
6
  "formatVersion": {
@@ -346,6 +346,15 @@
346
346
  "type": "number",
347
347
  "exclusiveMinimum": 0
348
348
  },
349
+ "style": {
350
+ "type": "string",
351
+ "enum": [
352
+ "solid",
353
+ "dashed",
354
+ "dotted",
355
+ "double"
356
+ ]
357
+ },
349
358
  "sourcePath": {
350
359
  "type": "string"
351
360
  }
@@ -630,6 +639,15 @@
630
639
  ],
631
640
  "additionalProperties": false
632
641
  },
642
+ "style": {
643
+ "type": "string",
644
+ "enum": [
645
+ "solid",
646
+ "dashed",
647
+ "dotted",
648
+ "double"
649
+ ]
650
+ },
633
651
  "sourcePath": {
634
652
  "type": "string"
635
653
  }