document-schema 4.0.0 → 4.2.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/README.md +95 -6
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/construct-D5pdDPqM.d.cts +204 -0
- package/dist/construct-D5pdDPqM.d.ts +204 -0
- package/dist/construct.cjs +106 -0
- package/dist/construct.d.cts +2 -0
- package/dist/construct.d.ts +2 -0
- package/dist/construct.js +93 -0
- package/dist/{content-CiZf6Fqn.d.ts → content-D3C14yyb.d.ts} +97 -9
- package/dist/content-json-schema-defs.cjs +256 -4
- package/dist/content-json-schema-defs.js +256 -4
- package/dist/{content-BN0PWqpt.d.cts → content-oSmH1_zP.d.cts} +97 -9
- package/dist/content.cjs +32 -0
- package/dist/content.d.cts +2 -2
- package/dist/content.d.ts +2 -2
- package/dist/content.js +28 -1
- package/dist/definitions.d.cts +1 -1
- package/dist/definitions.d.ts +1 -1
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -3
- package/dist/{math-B7gZJeND.d.cts → math-BlG8Tjk-.d.cts} +3 -3
- package/dist/{math-B7gZJeND.d.ts → math-BlG8Tjk-.d.ts} +3 -3
- package/dist/math.d.cts +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/{package-node-DDPSNOvy.d.cts → package-node-B9qLyhk5.d.ts} +73 -55
- package/dist/{package-node-QVFHQcm8.d.ts → package-node-DUKZHgAg.d.cts} +73 -55
- package/dist/package-node.cjs +32 -12
- package/dist/package-node.d.cts +2 -2
- package/dist/package-node.d.ts +2 -2
- package/dist/package-node.js +28 -14
- package/dist/package.cjs +4 -1
- package/dist/package.d.cts +52 -7
- package/dist/package.d.ts +52 -7
- package/dist/package.js +4 -1
- 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.d.cts +2 -2
- package/dist/style.d.ts +2 -2
- package/package.json +1 -1
- package/schemas/content-document.schema.json +399 -7
- package/schemas/document-package.schema.json +534 -7
package/dist/package-node.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_construct = require("./construct.cjs");
|
|
2
3
|
const require_content = require("./content.cjs");
|
|
3
4
|
let zod = require("zod");
|
|
4
5
|
//#region src/package-node.ts
|
|
@@ -28,14 +29,19 @@ function isLeafChild(schema, value) {
|
|
|
28
29
|
if (isRecord(value) && "style" in value) return false;
|
|
29
30
|
return schema.safeParse(value).success;
|
|
30
31
|
}
|
|
32
|
+
function isPackageBlockLeaf(value) {
|
|
33
|
+
if (require_content.isContentConstructStart(value) || require_content.isContentConstructEnd(value)) return false;
|
|
34
|
+
return require_content.isContentBlock(value);
|
|
35
|
+
}
|
|
36
|
+
const PackageBlockLeafSchema = zod.z.custom(isPackageBlockLeaf);
|
|
31
37
|
function isSectionChild(value) {
|
|
32
|
-
return isHeadingGroupNode(value) || isListGroupNode(value) || isLeafChild(
|
|
38
|
+
return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
|
|
33
39
|
}
|
|
34
40
|
function isShapeChild(value) {
|
|
35
|
-
return isListGroupNode(value) || isLeafChild(
|
|
41
|
+
return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
|
|
36
42
|
}
|
|
37
43
|
function isListChild(value) {
|
|
38
|
-
return isListGroupNode(value) || isLeafChild(
|
|
44
|
+
return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
|
|
39
45
|
}
|
|
40
46
|
function isSheetChild(value) {
|
|
41
47
|
return isLeafChild(require_content.ContentSheetImageSchema, value) || isLeafChild(require_content.ContentEmbeddedObjectSchema, value);
|
|
@@ -44,28 +50,34 @@ function isDrawPageChild(value) {
|
|
|
44
50
|
return isShapeGroupNode(value) || isLeafChild(require_content.ContentVectorSchema, value);
|
|
45
51
|
}
|
|
46
52
|
function isSectionGroupNode(value) {
|
|
47
|
-
return isRecord(value) &&
|
|
53
|
+
return isRecord(value) && SectionDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
|
|
48
54
|
}
|
|
49
55
|
function isSlideGroupNode(value) {
|
|
50
|
-
return isRecord(value) &&
|
|
56
|
+
return isRecord(value) && SlideDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeGroupNode);
|
|
51
57
|
}
|
|
52
58
|
function isSheetGroupNode(value) {
|
|
53
|
-
return isRecord(value) &&
|
|
59
|
+
return isRecord(value) && SheetDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSheetChild);
|
|
54
60
|
}
|
|
55
61
|
function isDrawPageGroupNode(value) {
|
|
56
|
-
return isRecord(value) &&
|
|
62
|
+
return isRecord(value) && DrawPageDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isDrawPageChild);
|
|
57
63
|
}
|
|
58
64
|
function isShapeGroupNode(value) {
|
|
59
|
-
return isRecord(value) &&
|
|
65
|
+
return isRecord(value) && ShapeDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
|
|
60
66
|
}
|
|
61
67
|
function isHeadingGroupNode(value) {
|
|
62
|
-
return isRecord(value) &&
|
|
68
|
+
return isRecord(value) && HeadingParagraphSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
|
|
63
69
|
}
|
|
64
70
|
function isListGroupNode(value) {
|
|
65
|
-
return isRecord(value) &&
|
|
71
|
+
return isRecord(value) && ListParagraphSchema.safeParse(value.node).success && isGroupWrapper(value, isListChild);
|
|
72
|
+
}
|
|
73
|
+
function isSectionConstructGroupNode(value) {
|
|
74
|
+
return isRecord(value) && require_construct.ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
|
|
75
|
+
}
|
|
76
|
+
function isShapeConstructGroupNode(value) {
|
|
77
|
+
return isRecord(value) && require_construct.ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
|
|
66
78
|
}
|
|
67
79
|
const packageLeafUnion = zod.z.union([
|
|
68
|
-
|
|
80
|
+
PackageBlockLeafSchema,
|
|
69
81
|
require_content.ContentSheetImageSchema,
|
|
70
82
|
require_content.ContentEmbeddedObjectSchema,
|
|
71
83
|
require_content.ContentVectorSchema,
|
|
@@ -75,7 +87,7 @@ function isPackageLeaf(value) {
|
|
|
75
87
|
return packageLeafUnion.safeParse(value).success;
|
|
76
88
|
}
|
|
77
89
|
function isPackageGroup(value) {
|
|
78
|
-
return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value);
|
|
90
|
+
return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isShapeConstructGroupNode(value);
|
|
79
91
|
}
|
|
80
92
|
function isPackageNode(value) {
|
|
81
93
|
return isPackageGroup(value) || isPackageLeaf(value);
|
|
@@ -87,6 +99,8 @@ const DrawPageGroupSchema = zod.z.custom(isDrawPageGroupNode);
|
|
|
87
99
|
const ShapeGroupSchema = zod.z.custom(isShapeGroupNode);
|
|
88
100
|
const HeadingGroupSchema = zod.z.custom(isHeadingGroupNode);
|
|
89
101
|
const ListGroupSchema = zod.z.custom(isListGroupNode);
|
|
102
|
+
const SectionConstructGroupSchema = zod.z.custom(isSectionConstructGroupNode);
|
|
103
|
+
const ShapeConstructGroupSchema = zod.z.custom(isShapeConstructGroupNode);
|
|
90
104
|
const PackageGroupSchema = zod.z.custom(isPackageGroup);
|
|
91
105
|
const PackageLeafSchema = zod.z.custom(isPackageLeaf);
|
|
92
106
|
const PackageNodeSchema = zod.z.custom(isPackageNode);
|
|
@@ -97,11 +111,14 @@ exports.HeadingGroupSchema = HeadingGroupSchema;
|
|
|
97
111
|
exports.HeadingParagraphSchema = HeadingParagraphSchema;
|
|
98
112
|
exports.ListGroupSchema = ListGroupSchema;
|
|
99
113
|
exports.ListParagraphSchema = ListParagraphSchema;
|
|
114
|
+
exports.PackageBlockLeafSchema = PackageBlockLeafSchema;
|
|
100
115
|
exports.PackageGroupSchema = PackageGroupSchema;
|
|
101
116
|
exports.PackageLeafSchema = PackageLeafSchema;
|
|
102
117
|
exports.PackageNodeSchema = PackageNodeSchema;
|
|
118
|
+
exports.SectionConstructGroupSchema = SectionConstructGroupSchema;
|
|
103
119
|
exports.SectionDescriptorSchema = SectionDescriptorSchema;
|
|
104
120
|
exports.SectionGroupSchema = SectionGroupSchema;
|
|
121
|
+
exports.ShapeConstructGroupSchema = ShapeConstructGroupSchema;
|
|
105
122
|
exports.ShapeDescriptorSchema = ShapeDescriptorSchema;
|
|
106
123
|
exports.ShapeGroupSchema = ShapeGroupSchema;
|
|
107
124
|
exports.SheetDescriptorSchema = SheetDescriptorSchema;
|
|
@@ -111,10 +128,13 @@ exports.SlideGroupSchema = SlideGroupSchema;
|
|
|
111
128
|
exports.isDrawPageGroupNode = isDrawPageGroupNode;
|
|
112
129
|
exports.isHeadingGroupNode = isHeadingGroupNode;
|
|
113
130
|
exports.isListGroupNode = isListGroupNode;
|
|
131
|
+
exports.isPackageBlockLeaf = isPackageBlockLeaf;
|
|
114
132
|
exports.isPackageGroup = isPackageGroup;
|
|
115
133
|
exports.isPackageLeaf = isPackageLeaf;
|
|
116
134
|
exports.isPackageNode = isPackageNode;
|
|
135
|
+
exports.isSectionConstructGroupNode = isSectionConstructGroupNode;
|
|
117
136
|
exports.isSectionGroupNode = isSectionGroupNode;
|
|
137
|
+
exports.isShapeConstructGroupNode = isShapeConstructGroupNode;
|
|
118
138
|
exports.isShapeGroupNode = isShapeGroupNode;
|
|
119
139
|
exports.isSheetGroupNode = isSheetGroupNode;
|
|
120
140
|
exports.isSlideGroupNode = isSlideGroupNode;
|
package/dist/package-node.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageGroup, isPackageLeaf, isPackageNode, isSectionGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
|
|
1
|
+
import { $ as isSectionConstructGroupNode, A as ShapeChild, B as SheetGroupNode, C as SectionChild, D as SectionDescriptorSchema, E as SectionDescriptor, F as ShapeGroupNode, G as SlideGroupSchema, H as SlideDescriptor, I as ShapeGroupSchema, J as isListGroupNode, K as isDrawPageGroupNode, L as SheetChild, M as ShapeConstructGroupSchema, N as ShapeDescriptor, O as SectionGroupNode, P as ShapeDescriptorSchema, Q as isPackageNode, R as SheetDescriptor, S as PackageNodeSchema, T as SectionConstructGroupSchema, U as SlideDescriptorSchema, V as SheetGroupSchema, W as SlideGroupNode, X as isPackageGroup, Y as isPackageBlockLeaf, Z as isPackageLeaf, _ as PackageGroup, a as DrawPageGroupSchema, b as PackageLeafSchema, c as HeadingParagraph, d as ListGroupNode, et as isSectionGroupNode, f as ListGroupSchema, g as PackageBlockLeafSchema, h as PackageBlockLeaf, i as DrawPageGroupNode, it as isSlideGroupNode, j as ShapeConstructGroupNode, k as SectionGroupSchema, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isShapeGroupNode, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isSheetGroupNode, s as HeadingGroupSchema, t as DrawPageChild, tt as isShapeConstructGroupNode, u as ListChild, v as PackageGroupSchema, w as SectionConstructGroupNode, x as PackageNode, y as PackageLeaf, z as SheetDescriptorSchema } from "./package-node-DUKZHgAg.cjs";
|
|
2
|
+
export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageBlockLeaf, PackageBlockLeafSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
|
package/dist/package-node.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageGroup, isPackageLeaf, isPackageNode, isSectionGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
|
|
1
|
+
import { $ as isSectionConstructGroupNode, A as ShapeChild, B as SheetGroupNode, C as SectionChild, D as SectionDescriptorSchema, E as SectionDescriptor, F as ShapeGroupNode, G as SlideGroupSchema, H as SlideDescriptor, I as ShapeGroupSchema, J as isListGroupNode, K as isDrawPageGroupNode, L as SheetChild, M as ShapeConstructGroupSchema, N as ShapeDescriptor, O as SectionGroupNode, P as ShapeDescriptorSchema, Q as isPackageNode, R as SheetDescriptor, S as PackageNodeSchema, T as SectionConstructGroupSchema, U as SlideDescriptorSchema, V as SheetGroupSchema, W as SlideGroupNode, X as isPackageGroup, Y as isPackageBlockLeaf, Z as isPackageLeaf, _ as PackageGroup, a as DrawPageGroupSchema, b as PackageLeafSchema, c as HeadingParagraph, d as ListGroupNode, et as isSectionGroupNode, f as ListGroupSchema, g as PackageBlockLeafSchema, h as PackageBlockLeaf, i as DrawPageGroupNode, it as isSlideGroupNode, j as ShapeConstructGroupNode, k as SectionGroupSchema, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isShapeGroupNode, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isSheetGroupNode, s as HeadingGroupSchema, t as DrawPageChild, tt as isShapeConstructGroupNode, u as ListChild, v as PackageGroupSchema, w as SectionConstructGroupNode, x as PackageNode, y as PackageLeaf, z as SheetDescriptorSchema } from "./package-node-B9qLyhk5.js";
|
|
2
|
+
export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageBlockLeaf, PackageBlockLeafSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
|
package/dist/package-node.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConstructDescriptorSchema } from "./construct.js";
|
|
2
|
+
import { ContentDrawPageSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentListMembershipSchema, ContentParagraphSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetImageSchema, ContentSheetSchema, ContentSlideSchema, ContentVectorSchema, isContentBlock, isContentConstructEnd, isContentConstructStart } from "./content.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/package-node.ts
|
|
4
5
|
const SectionDescriptorSchema = ContentSectionSchema.omit({ blocks: true }).extend({ kind: z.literal("section") }).strict();
|
|
@@ -27,14 +28,19 @@ function isLeafChild(schema, value) {
|
|
|
27
28
|
if (isRecord(value) && "style" in value) return false;
|
|
28
29
|
return schema.safeParse(value).success;
|
|
29
30
|
}
|
|
31
|
+
function isPackageBlockLeaf(value) {
|
|
32
|
+
if (isContentConstructStart(value) || isContentConstructEnd(value)) return false;
|
|
33
|
+
return isContentBlock(value);
|
|
34
|
+
}
|
|
35
|
+
const PackageBlockLeafSchema = z.custom(isPackageBlockLeaf);
|
|
30
36
|
function isSectionChild(value) {
|
|
31
|
-
return isHeadingGroupNode(value) || isListGroupNode(value) || isLeafChild(
|
|
37
|
+
return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
|
|
32
38
|
}
|
|
33
39
|
function isShapeChild(value) {
|
|
34
|
-
return isListGroupNode(value) || isLeafChild(
|
|
40
|
+
return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
|
|
35
41
|
}
|
|
36
42
|
function isListChild(value) {
|
|
37
|
-
return isListGroupNode(value) || isLeafChild(
|
|
43
|
+
return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
|
|
38
44
|
}
|
|
39
45
|
function isSheetChild(value) {
|
|
40
46
|
return isLeafChild(ContentSheetImageSchema, value) || isLeafChild(ContentEmbeddedObjectSchema, value);
|
|
@@ -43,28 +49,34 @@ function isDrawPageChild(value) {
|
|
|
43
49
|
return isShapeGroupNode(value) || isLeafChild(ContentVectorSchema, value);
|
|
44
50
|
}
|
|
45
51
|
function isSectionGroupNode(value) {
|
|
46
|
-
return isRecord(value) &&
|
|
52
|
+
return isRecord(value) && SectionDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
|
|
47
53
|
}
|
|
48
54
|
function isSlideGroupNode(value) {
|
|
49
|
-
return isRecord(value) &&
|
|
55
|
+
return isRecord(value) && SlideDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeGroupNode);
|
|
50
56
|
}
|
|
51
57
|
function isSheetGroupNode(value) {
|
|
52
|
-
return isRecord(value) &&
|
|
58
|
+
return isRecord(value) && SheetDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSheetChild);
|
|
53
59
|
}
|
|
54
60
|
function isDrawPageGroupNode(value) {
|
|
55
|
-
return isRecord(value) &&
|
|
61
|
+
return isRecord(value) && DrawPageDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isDrawPageChild);
|
|
56
62
|
}
|
|
57
63
|
function isShapeGroupNode(value) {
|
|
58
|
-
return isRecord(value) &&
|
|
64
|
+
return isRecord(value) && ShapeDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
|
|
59
65
|
}
|
|
60
66
|
function isHeadingGroupNode(value) {
|
|
61
|
-
return isRecord(value) &&
|
|
67
|
+
return isRecord(value) && HeadingParagraphSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
|
|
62
68
|
}
|
|
63
69
|
function isListGroupNode(value) {
|
|
64
|
-
return isRecord(value) &&
|
|
70
|
+
return isRecord(value) && ListParagraphSchema.safeParse(value.node).success && isGroupWrapper(value, isListChild);
|
|
71
|
+
}
|
|
72
|
+
function isSectionConstructGroupNode(value) {
|
|
73
|
+
return isRecord(value) && ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isSectionChild);
|
|
74
|
+
}
|
|
75
|
+
function isShapeConstructGroupNode(value) {
|
|
76
|
+
return isRecord(value) && ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
|
|
65
77
|
}
|
|
66
78
|
const packageLeafUnion = z.union([
|
|
67
|
-
|
|
79
|
+
PackageBlockLeafSchema,
|
|
68
80
|
ContentSheetImageSchema,
|
|
69
81
|
ContentEmbeddedObjectSchema,
|
|
70
82
|
ContentVectorSchema,
|
|
@@ -74,7 +86,7 @@ function isPackageLeaf(value) {
|
|
|
74
86
|
return packageLeafUnion.safeParse(value).success;
|
|
75
87
|
}
|
|
76
88
|
function isPackageGroup(value) {
|
|
77
|
-
return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value);
|
|
89
|
+
return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isShapeConstructGroupNode(value);
|
|
78
90
|
}
|
|
79
91
|
function isPackageNode(value) {
|
|
80
92
|
return isPackageGroup(value) || isPackageLeaf(value);
|
|
@@ -86,8 +98,10 @@ const DrawPageGroupSchema = z.custom(isDrawPageGroupNode);
|
|
|
86
98
|
const ShapeGroupSchema = z.custom(isShapeGroupNode);
|
|
87
99
|
const HeadingGroupSchema = z.custom(isHeadingGroupNode);
|
|
88
100
|
const ListGroupSchema = z.custom(isListGroupNode);
|
|
101
|
+
const SectionConstructGroupSchema = z.custom(isSectionConstructGroupNode);
|
|
102
|
+
const ShapeConstructGroupSchema = z.custom(isShapeConstructGroupNode);
|
|
89
103
|
const PackageGroupSchema = z.custom(isPackageGroup);
|
|
90
104
|
const PackageLeafSchema = z.custom(isPackageLeaf);
|
|
91
105
|
const PackageNodeSchema = z.custom(isPackageNode);
|
|
92
106
|
//#endregion
|
|
93
|
-
export { DrawPageDescriptorSchema, DrawPageGroupSchema, HeadingGroupSchema, HeadingParagraphSchema, ListGroupSchema, ListParagraphSchema, PackageGroupSchema, PackageLeafSchema, PackageNodeSchema, SectionDescriptorSchema, SectionGroupSchema, ShapeDescriptorSchema, ShapeGroupSchema, SheetDescriptorSchema, SheetGroupSchema, SlideDescriptorSchema, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageGroup, isPackageLeaf, isPackageNode, isSectionGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
|
|
107
|
+
export { DrawPageDescriptorSchema, DrawPageGroupSchema, HeadingGroupSchema, HeadingParagraphSchema, ListGroupSchema, ListParagraphSchema, PackageBlockLeafSchema, PackageGroupSchema, PackageLeafSchema, PackageNodeSchema, SectionConstructGroupSchema, SectionDescriptorSchema, SectionGroupSchema, ShapeConstructGroupSchema, ShapeDescriptorSchema, ShapeGroupSchema, SheetDescriptorSchema, SheetGroupSchema, SlideDescriptorSchema, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
|
package/dist/package.cjs
CHANGED
|
@@ -11,7 +11,10 @@ const packageEnvelopeFields = {
|
|
|
11
11
|
...require_content.contentDocumentSharedFields,
|
|
12
12
|
pages: zod.z.array(require_geometry.PageSizeSchema).optional(),
|
|
13
13
|
styles: require_definitions.StylesTableSchema.optional(),
|
|
14
|
-
definitions: require_definitions.DefinitionsTableSchema.optional()
|
|
14
|
+
definitions: require_definitions.DefinitionsTableSchema.optional(),
|
|
15
|
+
layers: require_definitions.DefinitionsTableSchema.optional(),
|
|
16
|
+
attachments: require_definitions.DefinitionsTableSchema.optional(),
|
|
17
|
+
destinations: require_definitions.DefinitionsTableSchema.optional()
|
|
15
18
|
};
|
|
16
19
|
const DocumentPackageSchema = zod.z.discriminatedUnion("kind", [
|
|
17
20
|
zod.z.object({
|
package/dist/package.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-B1oTCtzc.cjs";
|
|
2
|
-
import { s as MathExpression } from "./math-
|
|
3
|
-
import {
|
|
2
|
+
import { s as MathExpression } from "./math-BlG8Tjk-.cjs";
|
|
3
|
+
import { B as SheetGroupNode, O as SectionGroupNode, W as SlideGroupNode, i as DrawPageGroupNode } from "./package-node-DUKZHgAg.cjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/package.d.ts
|
|
6
6
|
declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -44,6 +44,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
44
44
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
45
|
kind: z.ZodString;
|
|
46
46
|
}, z.core.$loose>>>;
|
|
47
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
48
|
+
kind: z.ZodString;
|
|
49
|
+
}, z.core.$loose>>>;
|
|
50
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
|
+
kind: z.ZodString;
|
|
52
|
+
}, z.core.$loose>>>;
|
|
53
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
54
|
+
kind: z.ZodString;
|
|
55
|
+
}, z.core.$loose>>>;
|
|
47
56
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
48
57
|
symbols: z.ZodArray<z.ZodObject<{
|
|
49
58
|
glyph: z.ZodString;
|
|
@@ -58,9 +67,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
58
67
|
symbol: z.ZodString;
|
|
59
68
|
name: z.ZodOptional<z.ZodString>;
|
|
60
69
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
61
|
-
time: "time";
|
|
62
70
|
length: "length";
|
|
63
71
|
mass: "mass";
|
|
72
|
+
time: "time";
|
|
64
73
|
electricCurrent: "electricCurrent";
|
|
65
74
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
66
75
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -139,6 +148,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
148
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
140
149
|
kind: z.ZodString;
|
|
141
150
|
}, z.core.$loose>>>;
|
|
151
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
152
|
+
kind: z.ZodString;
|
|
153
|
+
}, z.core.$loose>>>;
|
|
154
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
155
|
+
kind: z.ZodString;
|
|
156
|
+
}, z.core.$loose>>>;
|
|
157
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
158
|
+
kind: z.ZodString;
|
|
159
|
+
}, z.core.$loose>>>;
|
|
142
160
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
143
161
|
symbols: z.ZodArray<z.ZodObject<{
|
|
144
162
|
glyph: z.ZodString;
|
|
@@ -153,9 +171,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
153
171
|
symbol: z.ZodString;
|
|
154
172
|
name: z.ZodOptional<z.ZodString>;
|
|
155
173
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
156
|
-
time: "time";
|
|
157
174
|
length: "length";
|
|
158
175
|
mass: "mass";
|
|
176
|
+
time: "time";
|
|
159
177
|
electricCurrent: "electricCurrent";
|
|
160
178
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
161
179
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -234,6 +252,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
234
252
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
235
253
|
kind: z.ZodString;
|
|
236
254
|
}, z.core.$loose>>>;
|
|
255
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
256
|
+
kind: z.ZodString;
|
|
257
|
+
}, z.core.$loose>>>;
|
|
258
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
259
|
+
kind: z.ZodString;
|
|
260
|
+
}, z.core.$loose>>>;
|
|
261
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
262
|
+
kind: z.ZodString;
|
|
263
|
+
}, z.core.$loose>>>;
|
|
237
264
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
238
265
|
symbols: z.ZodArray<z.ZodObject<{
|
|
239
266
|
glyph: z.ZodString;
|
|
@@ -248,9 +275,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
248
275
|
symbol: z.ZodString;
|
|
249
276
|
name: z.ZodOptional<z.ZodString>;
|
|
250
277
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
251
|
-
time: "time";
|
|
252
278
|
length: "length";
|
|
253
279
|
mass: "mass";
|
|
280
|
+
time: "time";
|
|
254
281
|
electricCurrent: "electricCurrent";
|
|
255
282
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
256
283
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -329,6 +356,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
329
356
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
330
357
|
kind: z.ZodString;
|
|
331
358
|
}, z.core.$loose>>>;
|
|
359
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
360
|
+
kind: z.ZodString;
|
|
361
|
+
}, z.core.$loose>>>;
|
|
362
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
363
|
+
kind: z.ZodString;
|
|
364
|
+
}, z.core.$loose>>>;
|
|
365
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
366
|
+
kind: z.ZodString;
|
|
367
|
+
}, z.core.$loose>>>;
|
|
332
368
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
333
369
|
symbols: z.ZodArray<z.ZodObject<{
|
|
334
370
|
glyph: z.ZodString;
|
|
@@ -343,9 +379,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
343
379
|
symbol: z.ZodString;
|
|
344
380
|
name: z.ZodOptional<z.ZodString>;
|
|
345
381
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
346
|
-
time: "time";
|
|
347
382
|
length: "length";
|
|
348
383
|
mass: "mass";
|
|
384
|
+
time: "time";
|
|
349
385
|
electricCurrent: "electricCurrent";
|
|
350
386
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
351
387
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -436,6 +472,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
436
472
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
437
473
|
kind: z.ZodString;
|
|
438
474
|
}, z.core.$loose>>>;
|
|
475
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
476
|
+
kind: z.ZodString;
|
|
477
|
+
}, z.core.$loose>>>;
|
|
478
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
479
|
+
kind: z.ZodString;
|
|
480
|
+
}, z.core.$loose>>>;
|
|
481
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
482
|
+
kind: z.ZodString;
|
|
483
|
+
}, z.core.$loose>>>;
|
|
439
484
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
440
485
|
symbols: z.ZodArray<z.ZodObject<{
|
|
441
486
|
glyph: z.ZodString;
|
|
@@ -450,9 +495,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
450
495
|
symbol: z.ZodString;
|
|
451
496
|
name: z.ZodOptional<z.ZodString>;
|
|
452
497
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
453
|
-
time: "time";
|
|
454
498
|
length: "length";
|
|
455
499
|
mass: "mass";
|
|
500
|
+
time: "time";
|
|
456
501
|
electricCurrent: "electricCurrent";
|
|
457
502
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
458
503
|
amountOfSubstance: "amountOfSubstance";
|
package/dist/package.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-B1oTCtzc.js";
|
|
2
|
-
import { s as MathExpression } from "./math-
|
|
3
|
-
import {
|
|
2
|
+
import { s as MathExpression } from "./math-BlG8Tjk-.js";
|
|
3
|
+
import { B as SheetGroupNode, O as SectionGroupNode, W as SlideGroupNode, i as DrawPageGroupNode } from "./package-node-B9qLyhk5.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/package.d.ts
|
|
6
6
|
declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -44,6 +44,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
44
44
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
45
|
kind: z.ZodString;
|
|
46
46
|
}, z.core.$loose>>>;
|
|
47
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
48
|
+
kind: z.ZodString;
|
|
49
|
+
}, z.core.$loose>>>;
|
|
50
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
|
+
kind: z.ZodString;
|
|
52
|
+
}, z.core.$loose>>>;
|
|
53
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
54
|
+
kind: z.ZodString;
|
|
55
|
+
}, z.core.$loose>>>;
|
|
47
56
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
48
57
|
symbols: z.ZodArray<z.ZodObject<{
|
|
49
58
|
glyph: z.ZodString;
|
|
@@ -58,9 +67,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
58
67
|
symbol: z.ZodString;
|
|
59
68
|
name: z.ZodOptional<z.ZodString>;
|
|
60
69
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
61
|
-
time: "time";
|
|
62
70
|
length: "length";
|
|
63
71
|
mass: "mass";
|
|
72
|
+
time: "time";
|
|
64
73
|
electricCurrent: "electricCurrent";
|
|
65
74
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
66
75
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -139,6 +148,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
148
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
140
149
|
kind: z.ZodString;
|
|
141
150
|
}, z.core.$loose>>>;
|
|
151
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
152
|
+
kind: z.ZodString;
|
|
153
|
+
}, z.core.$loose>>>;
|
|
154
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
155
|
+
kind: z.ZodString;
|
|
156
|
+
}, z.core.$loose>>>;
|
|
157
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
158
|
+
kind: z.ZodString;
|
|
159
|
+
}, z.core.$loose>>>;
|
|
142
160
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
143
161
|
symbols: z.ZodArray<z.ZodObject<{
|
|
144
162
|
glyph: z.ZodString;
|
|
@@ -153,9 +171,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
153
171
|
symbol: z.ZodString;
|
|
154
172
|
name: z.ZodOptional<z.ZodString>;
|
|
155
173
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
156
|
-
time: "time";
|
|
157
174
|
length: "length";
|
|
158
175
|
mass: "mass";
|
|
176
|
+
time: "time";
|
|
159
177
|
electricCurrent: "electricCurrent";
|
|
160
178
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
161
179
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -234,6 +252,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
234
252
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
235
253
|
kind: z.ZodString;
|
|
236
254
|
}, z.core.$loose>>>;
|
|
255
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
256
|
+
kind: z.ZodString;
|
|
257
|
+
}, z.core.$loose>>>;
|
|
258
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
259
|
+
kind: z.ZodString;
|
|
260
|
+
}, z.core.$loose>>>;
|
|
261
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
262
|
+
kind: z.ZodString;
|
|
263
|
+
}, z.core.$loose>>>;
|
|
237
264
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
238
265
|
symbols: z.ZodArray<z.ZodObject<{
|
|
239
266
|
glyph: z.ZodString;
|
|
@@ -248,9 +275,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
248
275
|
symbol: z.ZodString;
|
|
249
276
|
name: z.ZodOptional<z.ZodString>;
|
|
250
277
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
251
|
-
time: "time";
|
|
252
278
|
length: "length";
|
|
253
279
|
mass: "mass";
|
|
280
|
+
time: "time";
|
|
254
281
|
electricCurrent: "electricCurrent";
|
|
255
282
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
256
283
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -329,6 +356,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
329
356
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
330
357
|
kind: z.ZodString;
|
|
331
358
|
}, z.core.$loose>>>;
|
|
359
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
360
|
+
kind: z.ZodString;
|
|
361
|
+
}, z.core.$loose>>>;
|
|
362
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
363
|
+
kind: z.ZodString;
|
|
364
|
+
}, z.core.$loose>>>;
|
|
365
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
366
|
+
kind: z.ZodString;
|
|
367
|
+
}, z.core.$loose>>>;
|
|
332
368
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
333
369
|
symbols: z.ZodArray<z.ZodObject<{
|
|
334
370
|
glyph: z.ZodString;
|
|
@@ -343,9 +379,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
343
379
|
symbol: z.ZodString;
|
|
344
380
|
name: z.ZodOptional<z.ZodString>;
|
|
345
381
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
346
|
-
time: "time";
|
|
347
382
|
length: "length";
|
|
348
383
|
mass: "mass";
|
|
384
|
+
time: "time";
|
|
349
385
|
electricCurrent: "electricCurrent";
|
|
350
386
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
351
387
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -436,6 +472,15 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
436
472
|
definitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
437
473
|
kind: z.ZodString;
|
|
438
474
|
}, z.core.$loose>>>;
|
|
475
|
+
layers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
476
|
+
kind: z.ZodString;
|
|
477
|
+
}, z.core.$loose>>>;
|
|
478
|
+
attachments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
479
|
+
kind: z.ZodString;
|
|
480
|
+
}, z.core.$loose>>>;
|
|
481
|
+
destinations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
482
|
+
kind: z.ZodString;
|
|
483
|
+
}, z.core.$loose>>>;
|
|
439
484
|
symbolTable: z.ZodOptional<z.ZodObject<{
|
|
440
485
|
symbols: z.ZodArray<z.ZodObject<{
|
|
441
486
|
glyph: z.ZodString;
|
|
@@ -450,9 +495,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
450
495
|
symbol: z.ZodString;
|
|
451
496
|
name: z.ZodOptional<z.ZodString>;
|
|
452
497
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
453
|
-
time: "time";
|
|
454
498
|
length: "length";
|
|
455
499
|
mass: "mass";
|
|
500
|
+
time: "time";
|
|
456
501
|
electricCurrent: "electricCurrent";
|
|
457
502
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
458
503
|
amountOfSubstance: "amountOfSubstance";
|
package/dist/package.js
CHANGED
|
@@ -10,7 +10,10 @@ const packageEnvelopeFields = {
|
|
|
10
10
|
...contentDocumentSharedFields,
|
|
11
11
|
pages: z.array(PageSizeSchema).optional(),
|
|
12
12
|
styles: StylesTableSchema.optional(),
|
|
13
|
-
definitions: DefinitionsTableSchema.optional()
|
|
13
|
+
definitions: DefinitionsTableSchema.optional(),
|
|
14
|
+
layers: DefinitionsTableSchema.optional(),
|
|
15
|
+
attachments: DefinitionsTableSchema.optional(),
|
|
16
|
+
destinations: DefinitionsTableSchema.optional()
|
|
14
17
|
};
|
|
15
18
|
const DocumentPackageSchema = z.discriminatedUnion("kind", [
|
|
16
19
|
z.object({
|
package/dist/schema-io.cjs
CHANGED
|
@@ -7,7 +7,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
7
7
|
ContentDocument: "content-document.schema.json"
|
|
8
8
|
};
|
|
9
9
|
function schemaUriFor(kind) {
|
|
10
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
10
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.2.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
11
11
|
}
|
|
12
12
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
13
13
|
function parseSchemaUri(uri) {
|
|
@@ -93,7 +93,7 @@ function documentFromJson(value) {
|
|
|
93
93
|
if (parts.stem === "layout-document") throw new LayoutSchemaDemotedError(value.$schema);
|
|
94
94
|
const kind = kindForFileStem(parts.stem);
|
|
95
95
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
96
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("4.
|
|
96
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("4.2.0")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "4.2.0");
|
|
97
97
|
switch (kind) {
|
|
98
98
|
case "DocumentPackage": return {
|
|
99
99
|
kind,
|
package/dist/schema-io.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as ContentDocument } from "./content-oSmH1_zP.cjs";
|
|
2
2
|
import { DocumentPackage } from "./package.cjs";
|
|
3
3
|
//#region src/schema-io.d.ts
|
|
4
4
|
type DocumentSchemaKind = 'DocumentPackage' | 'ContentDocument';
|
package/dist/schema-io.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as ContentDocument } from "./content-D3C14yyb.js";
|
|
2
2
|
import { DocumentPackage } from "./package.js";
|
|
3
3
|
//#region src/schema-io.d.ts
|
|
4
4
|
type DocumentSchemaKind = 'DocumentPackage' | 'ContentDocument';
|
package/dist/schema-io.js
CHANGED
|
@@ -6,7 +6,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
6
6
|
ContentDocument: "content-document.schema.json"
|
|
7
7
|
};
|
|
8
8
|
function schemaUriFor(kind) {
|
|
9
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
9
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.2.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
10
10
|
}
|
|
11
11
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
12
12
|
function parseSchemaUri(uri) {
|
|
@@ -92,7 +92,7 @@ function documentFromJson(value) {
|
|
|
92
92
|
if (parts.stem === "layout-document") throw new LayoutSchemaDemotedError(value.$schema);
|
|
93
93
|
const kind = kindForFileStem(parts.stem);
|
|
94
94
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
95
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("4.
|
|
95
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("4.2.0")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "4.2.0");
|
|
96
96
|
switch (kind) {
|
|
97
97
|
case "DocumentPackage": return {
|
|
98
98
|
kind,
|
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": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "The canonical, format-agnostic content and document-package schemas shared by ooxml.js, odf.js, documents.js, pdf-codec, and markdown-codec -- pure Zod schemas, no behaviour.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|