doc-schema.js 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-eCPtLgjC.d.cts → content-B5VNueO_.d.cts} +97 -9
- package/dist/{content-D4gWnk94.d.ts → content-DPtA7fC1.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.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-BlG8Tjk-.d.cts → math-B7gZJeND.d.cts} +3 -3
- package/dist/{math-BlG8Tjk-.d.ts → math-B7gZJeND.d.ts} +3 -3
- package/dist/math.d.cts +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/{package-node-DuEoTvZ9.d.ts → package-node-BGOvE4E_.d.ts} +25 -7
- package/dist/{package-node-j6AUkspU.d.cts → package-node-Cz-iiwsx.d.cts} +25 -7
- 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/package.json +1 -1
- package/schemas/content-document.schema.json +399 -7
- package/schemas/document-package.schema.json +534 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as ContentFormula, X as ContentSheetImage, f as ContentConstructStart, n as ContentBlock, u as ContentConstructEnd, v as ContentEmbeddedObject, xt as ContentVector } from "./content-B5VNueO_.cjs";
|
|
2
|
+
import { a as ConstructDescriptor } from "./construct-D5pdDPqM.cjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/package-node.d.ts
|
|
4
5
|
declare const SectionDescriptorSchema: z.ZodObject<{
|
|
@@ -374,10 +375,11 @@ declare const ListParagraphSchema: z.ZodObject<{
|
|
|
374
375
|
}, z.core.$strip>;
|
|
375
376
|
}, z.core.$strip>;
|
|
376
377
|
type ListParagraph = z.infer<typeof ListParagraphSchema>;
|
|
377
|
-
type
|
|
378
|
-
type
|
|
379
|
-
type
|
|
380
|
-
type
|
|
378
|
+
type PackageBlockLeaf = Exclude<ContentBlock, ContentConstructStart | ContentConstructEnd>;
|
|
379
|
+
type PackageLeaf = PackageBlockLeaf | ContentSheetImage | ContentEmbeddedObject | ContentVector | ContentFormula;
|
|
380
|
+
type SectionChild = HeadingGroupNode | ListGroupNode | SectionConstructGroupNode | PackageBlockLeaf;
|
|
381
|
+
type ShapeChild = ListGroupNode | ShapeConstructGroupNode | PackageBlockLeaf;
|
|
382
|
+
type ListChild = ListGroupNode | ShapeConstructGroupNode | PackageBlockLeaf;
|
|
381
383
|
type SheetChild = ContentSheetImage | ContentEmbeddedObject;
|
|
382
384
|
type DrawPageChild = ShapeGroupNode | ContentVector;
|
|
383
385
|
interface SectionGroupNode {
|
|
@@ -415,8 +417,20 @@ interface ListGroupNode {
|
|
|
415
417
|
style?: string;
|
|
416
418
|
children: ListChild[];
|
|
417
419
|
}
|
|
418
|
-
|
|
420
|
+
interface SectionConstructGroupNode {
|
|
421
|
+
readonly node: ConstructDescriptor;
|
|
422
|
+
style?: string;
|
|
423
|
+
children: SectionChild[];
|
|
424
|
+
}
|
|
425
|
+
interface ShapeConstructGroupNode {
|
|
426
|
+
readonly node: ConstructDescriptor;
|
|
427
|
+
style?: string;
|
|
428
|
+
children: ShapeChild[];
|
|
429
|
+
}
|
|
430
|
+
type PackageGroup = SectionGroupNode | SlideGroupNode | SheetGroupNode | DrawPageGroupNode | ShapeGroupNode | HeadingGroupNode | ListGroupNode | SectionConstructGroupNode | ShapeConstructGroupNode;
|
|
419
431
|
type PackageNode = PackageGroup | PackageLeaf;
|
|
432
|
+
declare function isPackageBlockLeaf(value: unknown): value is PackageBlockLeaf;
|
|
433
|
+
declare const PackageBlockLeafSchema: z.ZodCustom<PackageBlockLeaf, PackageBlockLeaf>;
|
|
420
434
|
declare function isSectionGroupNode(value: unknown): value is SectionGroupNode;
|
|
421
435
|
declare function isSlideGroupNode(value: unknown): value is SlideGroupNode;
|
|
422
436
|
declare function isSheetGroupNode(value: unknown): value is SheetGroupNode;
|
|
@@ -424,6 +438,8 @@ declare function isDrawPageGroupNode(value: unknown): value is DrawPageGroupNode
|
|
|
424
438
|
declare function isShapeGroupNode(value: unknown): value is ShapeGroupNode;
|
|
425
439
|
declare function isHeadingGroupNode(value: unknown): value is HeadingGroupNode;
|
|
426
440
|
declare function isListGroupNode(value: unknown): value is ListGroupNode;
|
|
441
|
+
declare function isSectionConstructGroupNode(value: unknown): value is SectionConstructGroupNode;
|
|
442
|
+
declare function isShapeConstructGroupNode(value: unknown): value is ShapeConstructGroupNode;
|
|
427
443
|
declare function isPackageLeaf(value: unknown): value is PackageLeaf;
|
|
428
444
|
declare function isPackageGroup(value: unknown): value is PackageGroup;
|
|
429
445
|
declare function isPackageNode(value: unknown): value is PackageNode;
|
|
@@ -434,8 +450,10 @@ declare const DrawPageGroupSchema: z.ZodCustom<DrawPageGroupNode, DrawPageGroupN
|
|
|
434
450
|
declare const ShapeGroupSchema: z.ZodCustom<ShapeGroupNode, ShapeGroupNode>;
|
|
435
451
|
declare const HeadingGroupSchema: z.ZodCustom<HeadingGroupNode, HeadingGroupNode>;
|
|
436
452
|
declare const ListGroupSchema: z.ZodCustom<ListGroupNode, ListGroupNode>;
|
|
453
|
+
declare const SectionConstructGroupSchema: z.ZodCustom<SectionConstructGroupNode, SectionConstructGroupNode>;
|
|
454
|
+
declare const ShapeConstructGroupSchema: z.ZodCustom<ShapeConstructGroupNode, ShapeConstructGroupNode>;
|
|
437
455
|
declare const PackageGroupSchema: z.ZodCustom<PackageGroup, PackageGroup>;
|
|
438
456
|
declare const PackageLeafSchema: z.ZodCustom<PackageLeaf, PackageLeaf>;
|
|
439
457
|
declare const PackageNodeSchema: z.ZodCustom<PackageNode, PackageNode>;
|
|
440
458
|
//#endregion
|
|
441
|
-
export {
|
|
459
|
+
export { isSectionConstructGroupNode as $, ShapeChild as A, SheetGroupNode as B, SectionChild as C, SectionDescriptorSchema as D, SectionDescriptor as E, ShapeGroupNode as F, SlideGroupSchema as G, SlideDescriptor as H, ShapeGroupSchema as I, isListGroupNode as J, isDrawPageGroupNode as K, SheetChild as L, ShapeConstructGroupSchema as M, ShapeDescriptor as N, SectionGroupNode as O, ShapeDescriptorSchema as P, isPackageNode as Q, SheetDescriptor as R, PackageNodeSchema as S, SectionConstructGroupSchema as T, SlideDescriptorSchema as U, SheetGroupSchema as V, SlideGroupNode as W, isPackageGroup as X, isPackageBlockLeaf as Y, isPackageLeaf as Z, PackageGroup as _, DrawPageGroupSchema as a, PackageLeafSchema as b, HeadingParagraph as c, ListGroupNode as d, isSectionGroupNode as et, ListGroupSchema as f, PackageBlockLeafSchema as g, PackageBlockLeaf as h, DrawPageGroupNode as i, isSlideGroupNode as it, ShapeConstructGroupNode as j, SectionGroupSchema as k, HeadingParagraphSchema as l, ListParagraphSchema as m, DrawPageDescriptor as n, isShapeGroupNode as nt, HeadingGroupNode as o, ListParagraph as p, isHeadingGroupNode as q, DrawPageDescriptorSchema as r, isSheetGroupNode as rt, HeadingGroupSchema as s, DrawPageChild as t, isShapeConstructGroupNode as tt, ListChild as u, PackageGroupSchema as v, SectionConstructGroupNode as w, PackageNode as x, PackageLeaf as y, SheetDescriptorSchema as z };
|
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-Cz-iiwsx.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-BGOvE4E_.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-B7gZJeND.cjs";
|
|
3
|
+
import { B as SheetGroupNode, O as SectionGroupNode, W as SlideGroupNode, i as DrawPageGroupNode } from "./package-node-Cz-iiwsx.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<{
|
|
70
|
+
time: "time";
|
|
61
71
|
length: "length";
|
|
62
72
|
mass: "mass";
|
|
63
|
-
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<{
|
|
174
|
+
time: "time";
|
|
156
175
|
length: "length";
|
|
157
176
|
mass: "mass";
|
|
158
|
-
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<{
|
|
278
|
+
time: "time";
|
|
251
279
|
length: "length";
|
|
252
280
|
mass: "mass";
|
|
253
|
-
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<{
|
|
382
|
+
time: "time";
|
|
346
383
|
length: "length";
|
|
347
384
|
mass: "mass";
|
|
348
|
-
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<{
|
|
498
|
+
time: "time";
|
|
453
499
|
length: "length";
|
|
454
500
|
mass: "mass";
|
|
455
|
-
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-B7gZJeND.js";
|
|
3
|
+
import { B as SheetGroupNode, O as SectionGroupNode, W as SlideGroupNode, i as DrawPageGroupNode } from "./package-node-BGOvE4E_.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<{
|
|
70
|
+
time: "time";
|
|
61
71
|
length: "length";
|
|
62
72
|
mass: "mass";
|
|
63
|
-
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<{
|
|
174
|
+
time: "time";
|
|
156
175
|
length: "length";
|
|
157
176
|
mass: "mass";
|
|
158
|
-
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<{
|
|
278
|
+
time: "time";
|
|
251
279
|
length: "length";
|
|
252
280
|
mass: "mass";
|
|
253
|
-
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<{
|
|
382
|
+
time: "time";
|
|
346
383
|
length: "length";
|
|
347
384
|
mass: "mass";
|
|
348
|
-
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<{
|
|
498
|
+
time: "time";
|
|
453
499
|
length: "length";
|
|
454
500
|
mass: "mass";
|
|
455
|
-
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,
|