document-content-model 4.3.2 → 7.6.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 (96) hide show
  1. package/README.md +274 -95
  2. package/dist/border-weight.cjs +26 -0
  3. package/dist/border-weight.d.cts +12 -0
  4. package/dist/border-weight.d.ts +12 -0
  5. package/dist/border-weight.js +23 -0
  6. package/dist/codec.d.cts +1 -1
  7. package/dist/codec.d.ts +1 -1
  8. package/dist/{construct-ETSlnMle.d.cts → construct-GVdTKrE7.d.cts} +242 -2
  9. package/dist/{construct-ETSlnMle.d.ts → construct-GVdTKrE7.d.ts} +242 -2
  10. package/dist/construct.cjs +13 -6
  11. package/dist/construct.d.cts +1 -1
  12. package/dist/construct.d.ts +1 -1
  13. package/dist/construct.js +13 -6
  14. package/dist/content-BCOxY0Eb.d.ts +10273 -0
  15. package/dist/content-BzkhrS6P.d.cts +10273 -0
  16. package/dist/content-json-schema-defs.cjs +1056 -189
  17. package/dist/content-json-schema-defs.js +1056 -189
  18. package/dist/content.cjs +514 -36
  19. package/dist/content.d.cts +2 -2
  20. package/dist/content.d.ts +2 -2
  21. package/dist/content.js +488 -37
  22. package/dist/decompose.cjs +7 -17
  23. package/dist/decompose.d.cts +5 -5
  24. package/dist/decompose.d.ts +5 -5
  25. package/dist/decompose.js +7 -17
  26. package/dist/definitions.cjs +5 -1
  27. package/dist/definitions.d.cts +37 -1
  28. package/dist/definitions.d.ts +37 -1
  29. package/dist/definitions.js +5 -1
  30. package/dist/factor-styles.cjs +14 -8
  31. package/dist/factor-styles.d.cts +6 -6
  32. package/dist/factor-styles.d.ts +6 -6
  33. package/dist/factor-styles.js +15 -9
  34. package/dist/flatten.cjs +5 -5
  35. package/dist/flatten.d.cts +4 -4
  36. package/dist/flatten.d.ts +4 -4
  37. package/dist/flatten.js +5 -5
  38. package/dist/font-port.d.cts +2 -2
  39. package/dist/font-port.d.ts +2 -2
  40. package/dist/index.cjs +54 -14
  41. package/dist/index.d.cts +14 -12
  42. package/dist/index.d.ts +14 -12
  43. package/dist/index.js +12 -10
  44. package/dist/{math-BlG8Tjk-.d.cts → math-BScHxedi.d.cts} +97 -14
  45. package/dist/{math-BlG8Tjk-.d.ts → math-BScHxedi.d.ts} +97 -14
  46. package/dist/math-layout.d.cts +6 -6
  47. package/dist/math-layout.d.ts +6 -6
  48. package/dist/math.cjs +32 -6
  49. package/dist/math.d.cts +2 -2
  50. package/dist/math.d.ts +2 -2
  51. package/dist/math.js +29 -7
  52. package/dist/{mathml-B1oTCtzc.d.cts → mathml-Czqc1mdZ.d.cts} +3 -3
  53. package/dist/{mathml-B1oTCtzc.d.ts → mathml-Czqc1mdZ.d.ts} +3 -3
  54. package/dist/mathml.cjs +9 -2
  55. package/dist/mathml.d.cts +1 -1
  56. package/dist/mathml.d.ts +1 -1
  57. package/dist/mathml.js +9 -2
  58. package/dist/metadata.cjs +12 -1
  59. package/dist/metadata.d.cts +13 -0
  60. package/dist/metadata.d.ts +13 -0
  61. package/dist/metadata.js +12 -1
  62. package/dist/package-node-C4mh1hLY.d.ts +1989 -0
  63. package/dist/package-node-RQMDBzwd.d.cts +1989 -0
  64. package/dist/package-node.cjs +21 -21
  65. package/dist/package-node.d.cts +2 -2
  66. package/dist/package-node.d.ts +2 -2
  67. package/dist/package-node.js +14 -14
  68. package/dist/package.cjs +5 -3
  69. package/dist/package.d.cts +253 -8
  70. package/dist/package.d.ts +253 -8
  71. package/dist/package.js +5 -3
  72. package/dist/schema-io.cjs +21 -11
  73. package/dist/schema-io.d.cts +13 -9
  74. package/dist/schema-io.d.ts +13 -9
  75. package/dist/schema-io.js +21 -12
  76. package/dist/source-Bas5ol6f.d.cts +43 -0
  77. package/dist/source-Bas5ol6f.d.ts +43 -0
  78. package/dist/source.cjs +27 -0
  79. package/dist/source.d.cts +2 -0
  80. package/dist/source.d.ts +2 -0
  81. package/dist/source.js +25 -0
  82. package/dist/style-D06NwxAJ.d.cts +29 -0
  83. package/dist/style-D06NwxAJ.d.ts +29 -0
  84. package/dist/style.cjs +2 -0
  85. package/dist/style.d.cts +2 -24
  86. package/dist/style.d.ts +2 -24
  87. package/dist/style.js +2 -1
  88. package/dist/text-layout.d.cts +1 -1
  89. package/dist/text-layout.d.ts +1 -1
  90. package/package.json +28 -29
  91. package/schemas/content-document.schema.json +6623 -1694
  92. package/schemas/{document-package.schema.json → document-tree.schema.json} +1826 -143
  93. package/dist/content-BLwxI5ba.d.cts +0 -2481
  94. package/dist/content-BdzcBsxm.d.ts +0 -2481
  95. package/dist/package-node-C-ewnL0v.d.cts +0 -459
  96. package/dist/package-node-D3scv-Cl.d.ts +0 -459
package/dist/mathml.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as isMathMlNode, a as MathMlComment, c as MathMlDeclarationSchema, d as MathMlNode, f as MathMlNodeSchema, g as MathMlTextSchema, h as MathMlText, i as MathMlCdataSchema, l as MathMlElement, m as MathMlPiSchema, n as MathMlAttributeSchema, o as MathMlCommentSchema, p as MathMlPi, r as MathMlCdata, s as MathMlDeclaration, t as MathMlAttribute, u as MathMlElementSchema } from "./mathml-B1oTCtzc.js";
1
+ import { _ as isMathMlNode, a as MathMlComment, c as MathMlDeclarationSchema, d as MathMlNode, f as MathMlNodeSchema, g as MathMlTextSchema, h as MathMlText, i as MathMlCdataSchema, l as MathMlElement, m as MathMlPiSchema, n as MathMlAttributeSchema, o as MathMlCommentSchema, p as MathMlPi, r as MathMlCdata, s as MathMlDeclaration, t as MathMlAttribute, u as MathMlElementSchema } from "./mathml-Czqc1mdZ.js";
2
2
  export { MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, isMathMlNode };
package/dist/mathml.js CHANGED
@@ -40,12 +40,19 @@ function isMathMlNode(value) {
40
40
  if (type === "element") return typeof value.tag === "string" && Array.isArray(value.attributes) && value.attributes.every(isMathMlAttribute) && Array.isArray(value.children) && value.children.every(isMathMlNode);
41
41
  return false;
42
42
  }
43
- const MathMlNodeSchema = z.custom(isMathMlNode);
44
43
  const MathMlElementSchema = z.object({
45
44
  type: z.literal("element"),
46
45
  tag: z.string(),
47
46
  attributes: z.array(MathMlAttributeSchema),
48
- children: z.array(MathMlNodeSchema)
47
+ children: z.lazy(() => z.array(MathMlNodeSchema))
49
48
  });
49
+ const MathMlNodeSchema = z.discriminatedUnion("type", [
50
+ MathMlTextSchema,
51
+ MathMlCdataSchema,
52
+ MathMlCommentSchema,
53
+ MathMlDeclarationSchema,
54
+ MathMlPiSchema,
55
+ MathMlElementSchema
56
+ ]);
50
57
  //#endregion
51
58
  export { MathMlAttributeSchema, MathMlCdataSchema, MathMlCommentSchema, MathMlDeclarationSchema, MathMlElementSchema, MathMlNodeSchema, MathMlPiSchema, MathMlTextSchema, isMathMlNode };
package/dist/metadata.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_style = require("./style.cjs");
2
3
  let zod = require("zod");
3
4
  //#region src/metadata.ts
4
5
  const LayoutMetadataSchema = zod.z.object({
@@ -9,7 +10,17 @@ const LayoutMetadataSchema = zod.z.object({
9
10
  creator: zod.z.string().optional(),
10
11
  producer: zod.z.string().optional(),
11
12
  createdIso: zod.z.string().optional(),
12
- modifiedIso: zod.z.string().optional()
13
+ modifiedIso: zod.z.string().optional(),
14
+ lastPrintedIso: zod.z.string().optional(),
15
+ language: zod.z.string().optional(),
16
+ direction: require_style.TextDirectionSchema.optional(),
17
+ publisher: zod.z.string().optional(),
18
+ contributor: zod.z.string().optional(),
19
+ rights: zod.z.string().optional(),
20
+ identifier: zod.z.string().optional(),
21
+ comments: zod.z.string().optional(),
22
+ company: zod.z.string().optional(),
23
+ manager: zod.z.string().optional()
13
24
  });
14
25
  //#endregion
15
26
  exports.LayoutMetadataSchema = LayoutMetadataSchema;
@@ -9,6 +9,19 @@ declare const LayoutMetadataSchema: z.ZodObject<{
9
9
  producer: z.ZodOptional<z.ZodString>;
10
10
  createdIso: z.ZodOptional<z.ZodString>;
11
11
  modifiedIso: z.ZodOptional<z.ZodString>;
12
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
13
+ language: z.ZodOptional<z.ZodString>;
14
+ direction: z.ZodOptional<z.ZodEnum<{
15
+ ltr: "ltr";
16
+ rtl: "rtl";
17
+ }>>;
18
+ publisher: z.ZodOptional<z.ZodString>;
19
+ contributor: z.ZodOptional<z.ZodString>;
20
+ rights: z.ZodOptional<z.ZodString>;
21
+ identifier: z.ZodOptional<z.ZodString>;
22
+ comments: z.ZodOptional<z.ZodString>;
23
+ company: z.ZodOptional<z.ZodString>;
24
+ manager: z.ZodOptional<z.ZodString>;
12
25
  }, z.core.$strip>;
13
26
  type LayoutMetadata = z.infer<typeof LayoutMetadataSchema>;
14
27
  //#endregion
@@ -9,6 +9,19 @@ declare const LayoutMetadataSchema: z.ZodObject<{
9
9
  producer: z.ZodOptional<z.ZodString>;
10
10
  createdIso: z.ZodOptional<z.ZodString>;
11
11
  modifiedIso: z.ZodOptional<z.ZodString>;
12
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
13
+ language: z.ZodOptional<z.ZodString>;
14
+ direction: z.ZodOptional<z.ZodEnum<{
15
+ ltr: "ltr";
16
+ rtl: "rtl";
17
+ }>>;
18
+ publisher: z.ZodOptional<z.ZodString>;
19
+ contributor: z.ZodOptional<z.ZodString>;
20
+ rights: z.ZodOptional<z.ZodString>;
21
+ identifier: z.ZodOptional<z.ZodString>;
22
+ comments: z.ZodOptional<z.ZodString>;
23
+ company: z.ZodOptional<z.ZodString>;
24
+ manager: z.ZodOptional<z.ZodString>;
12
25
  }, z.core.$strip>;
13
26
  type LayoutMetadata = z.infer<typeof LayoutMetadataSchema>;
14
27
  //#endregion
package/dist/metadata.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { TextDirectionSchema } from "./style.js";
1
2
  import { z } from "zod";
2
3
  //#region src/metadata.ts
3
4
  const LayoutMetadataSchema = z.object({
@@ -8,7 +9,17 @@ const LayoutMetadataSchema = z.object({
8
9
  creator: z.string().optional(),
9
10
  producer: z.string().optional(),
10
11
  createdIso: z.string().optional(),
11
- modifiedIso: z.string().optional()
12
+ modifiedIso: z.string().optional(),
13
+ lastPrintedIso: z.string().optional(),
14
+ language: z.string().optional(),
15
+ direction: TextDirectionSchema.optional(),
16
+ publisher: z.string().optional(),
17
+ contributor: z.string().optional(),
18
+ rights: z.string().optional(),
19
+ identifier: z.string().optional(),
20
+ comments: z.string().optional(),
21
+ company: z.string().optional(),
22
+ manager: z.string().optional()
12
23
  });
13
24
  //#endregion
14
25
  export { LayoutMetadataSchema };