document-content-model 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-ETSlnMle.d.cts +204 -0
- package/dist/construct-ETSlnMle.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-BN0PWqpt.d.cts → content-BLwxI5ba.d.cts} +97 -9
- package/dist/{content-CiZf6Fqn.d.ts → content-BdzcBsxm.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-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-Bt4_XS3d.d.ts → package-node-CmNXOetG.d.ts} +72 -54
- package/dist/{package-node-Bz55gXHd.d.cts → package-node-CtvgL_ON.d.cts} +72 -54
- 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-BdzcBsxm.js";
|
|
2
|
+
import { a as ConstructDescriptor } from "./construct-ETSlnMle.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/package-node.d.ts
|
|
4
5
|
declare const SectionDescriptorSchema: z.ZodObject<{
|
|
@@ -26,47 +27,11 @@ declare const SlideDescriptorSchema: z.ZodObject<{
|
|
|
26
27
|
type SlideDescriptor = z.infer<typeof SlideDescriptorSchema>;
|
|
27
28
|
declare const SheetDescriptorSchema: z.ZodObject<{
|
|
28
29
|
name: z.ZodString;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
margins: z.ZodObject<{
|
|
35
|
-
topPt: z.ZodNumber;
|
|
36
|
-
rightPt: z.ZodNumber;
|
|
37
|
-
bottomPt: z.ZodNumber;
|
|
38
|
-
leftPt: z.ZodNumber;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
printRange: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
startRow: z.ZodNumber;
|
|
42
|
-
startColumn: z.ZodNumber;
|
|
43
|
-
endRow: z.ZodNumber;
|
|
44
|
-
endColumn: z.ZodNumber;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
scalePercent: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
48
|
-
width: z.ZodNumber;
|
|
49
|
-
height: z.ZodNumber;
|
|
50
|
-
}, z.core.$strip>>;
|
|
51
|
-
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
52
|
-
start: z.ZodNumber;
|
|
53
|
-
end: z.ZodNumber;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
56
|
-
start: z.ZodNumber;
|
|
57
|
-
end: z.ZodNumber;
|
|
58
|
-
}, z.core.$strip>>;
|
|
59
|
-
gridlines: z.ZodBoolean;
|
|
60
|
-
headers: z.ZodBoolean;
|
|
61
|
-
pageOrder: z.ZodEnum<{
|
|
62
|
-
downThenOver: "downThenOver";
|
|
63
|
-
overThenDown: "overThenDown";
|
|
64
|
-
}>;
|
|
65
|
-
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
rows: z.ZodArray<z.ZodNumber>;
|
|
67
|
-
columns: z.ZodArray<z.ZodNumber>;
|
|
68
|
-
}, z.core.$strip>>;
|
|
69
|
-
}, z.core.$strip>;
|
|
30
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
31
|
+
index: z.ZodNumber;
|
|
32
|
+
heightPt: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
70
35
|
cells: z.ZodArray<z.ZodObject<{
|
|
71
36
|
row: z.ZodNumber;
|
|
72
37
|
column: z.ZodNumber;
|
|
@@ -228,11 +193,47 @@ declare const SheetDescriptorSchema: z.ZodObject<{
|
|
|
228
193
|
widthPt: z.ZodOptional<z.ZodNumber>;
|
|
229
194
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
230
195
|
}, z.core.$strip>>;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
196
|
+
printSettings: z.ZodObject<{
|
|
197
|
+
pageSize: z.ZodObject<{
|
|
198
|
+
widthPt: z.ZodNumber;
|
|
199
|
+
heightPt: z.ZodNumber;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
margins: z.ZodObject<{
|
|
202
|
+
topPt: z.ZodNumber;
|
|
203
|
+
rightPt: z.ZodNumber;
|
|
204
|
+
bottomPt: z.ZodNumber;
|
|
205
|
+
leftPt: z.ZodNumber;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
printRange: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
startRow: z.ZodNumber;
|
|
209
|
+
startColumn: z.ZodNumber;
|
|
210
|
+
endRow: z.ZodNumber;
|
|
211
|
+
endColumn: z.ZodNumber;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
scalePercent: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
width: z.ZodNumber;
|
|
216
|
+
height: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
219
|
+
start: z.ZodNumber;
|
|
220
|
+
end: z.ZodNumber;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
start: z.ZodNumber;
|
|
224
|
+
end: z.ZodNumber;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
gridlines: z.ZodBoolean;
|
|
227
|
+
headers: z.ZodBoolean;
|
|
228
|
+
pageOrder: z.ZodEnum<{
|
|
229
|
+
downThenOver: "downThenOver";
|
|
230
|
+
overThenDown: "overThenDown";
|
|
231
|
+
}>;
|
|
232
|
+
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
rows: z.ZodArray<z.ZodNumber>;
|
|
234
|
+
columns: z.ZodArray<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
}, z.core.$strip>;
|
|
236
237
|
kind: z.ZodLiteral<"sheet">;
|
|
237
238
|
}, z.core.$strict>;
|
|
238
239
|
type SheetDescriptor = z.infer<typeof SheetDescriptorSchema>;
|
|
@@ -245,6 +246,7 @@ declare const DrawPageDescriptorSchema: z.ZodObject<{
|
|
|
245
246
|
}, z.core.$strict>;
|
|
246
247
|
type DrawPageDescriptor = z.infer<typeof DrawPageDescriptorSchema>;
|
|
247
248
|
declare const ShapeDescriptorSchema: z.ZodObject<{
|
|
249
|
+
name: z.ZodOptional<z.ZodString>;
|
|
248
250
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
249
251
|
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
250
252
|
pageIndex: z.ZodNumber;
|
|
@@ -259,7 +261,6 @@ declare const ShapeDescriptorSchema: z.ZodObject<{
|
|
|
259
261
|
widthPt: z.ZodNumber;
|
|
260
262
|
heightPt: z.ZodNumber;
|
|
261
263
|
}, z.core.$strip>;
|
|
262
|
-
name: z.ZodOptional<z.ZodString>;
|
|
263
264
|
rotationDeg: z.ZodOptional<z.ZodNumber>;
|
|
264
265
|
insetLeftPt: z.ZodNumber;
|
|
265
266
|
insetTopPt: z.ZodNumber;
|
|
@@ -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 };
|
|
@@ -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-BLwxI5ba.cjs";
|
|
2
|
+
import { a as ConstructDescriptor } from "./construct-ETSlnMle.cjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/package-node.d.ts
|
|
4
5
|
declare const SectionDescriptorSchema: z.ZodObject<{
|
|
@@ -26,47 +27,11 @@ declare const SlideDescriptorSchema: z.ZodObject<{
|
|
|
26
27
|
type SlideDescriptor = z.infer<typeof SlideDescriptorSchema>;
|
|
27
28
|
declare const SheetDescriptorSchema: z.ZodObject<{
|
|
28
29
|
name: z.ZodString;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
margins: z.ZodObject<{
|
|
35
|
-
topPt: z.ZodNumber;
|
|
36
|
-
rightPt: z.ZodNumber;
|
|
37
|
-
bottomPt: z.ZodNumber;
|
|
38
|
-
leftPt: z.ZodNumber;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
printRange: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
startRow: z.ZodNumber;
|
|
42
|
-
startColumn: z.ZodNumber;
|
|
43
|
-
endRow: z.ZodNumber;
|
|
44
|
-
endColumn: z.ZodNumber;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
scalePercent: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
48
|
-
width: z.ZodNumber;
|
|
49
|
-
height: z.ZodNumber;
|
|
50
|
-
}, z.core.$strip>>;
|
|
51
|
-
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
52
|
-
start: z.ZodNumber;
|
|
53
|
-
end: z.ZodNumber;
|
|
54
|
-
}, z.core.$strip>>;
|
|
55
|
-
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
56
|
-
start: z.ZodNumber;
|
|
57
|
-
end: z.ZodNumber;
|
|
58
|
-
}, z.core.$strip>>;
|
|
59
|
-
gridlines: z.ZodBoolean;
|
|
60
|
-
headers: z.ZodBoolean;
|
|
61
|
-
pageOrder: z.ZodEnum<{
|
|
62
|
-
downThenOver: "downThenOver";
|
|
63
|
-
overThenDown: "overThenDown";
|
|
64
|
-
}>;
|
|
65
|
-
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
rows: z.ZodArray<z.ZodNumber>;
|
|
67
|
-
columns: z.ZodArray<z.ZodNumber>;
|
|
68
|
-
}, z.core.$strip>>;
|
|
69
|
-
}, z.core.$strip>;
|
|
30
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
31
|
+
index: z.ZodNumber;
|
|
32
|
+
heightPt: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
70
35
|
cells: z.ZodArray<z.ZodObject<{
|
|
71
36
|
row: z.ZodNumber;
|
|
72
37
|
column: z.ZodNumber;
|
|
@@ -228,11 +193,47 @@ declare const SheetDescriptorSchema: z.ZodObject<{
|
|
|
228
193
|
widthPt: z.ZodOptional<z.ZodNumber>;
|
|
229
194
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
230
195
|
}, z.core.$strip>>;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
196
|
+
printSettings: z.ZodObject<{
|
|
197
|
+
pageSize: z.ZodObject<{
|
|
198
|
+
widthPt: z.ZodNumber;
|
|
199
|
+
heightPt: z.ZodNumber;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
margins: z.ZodObject<{
|
|
202
|
+
topPt: z.ZodNumber;
|
|
203
|
+
rightPt: z.ZodNumber;
|
|
204
|
+
bottomPt: z.ZodNumber;
|
|
205
|
+
leftPt: z.ZodNumber;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
printRange: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
startRow: z.ZodNumber;
|
|
209
|
+
startColumn: z.ZodNumber;
|
|
210
|
+
endRow: z.ZodNumber;
|
|
211
|
+
endColumn: z.ZodNumber;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
scalePercent: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
width: z.ZodNumber;
|
|
216
|
+
height: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
219
|
+
start: z.ZodNumber;
|
|
220
|
+
end: z.ZodNumber;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
start: z.ZodNumber;
|
|
224
|
+
end: z.ZodNumber;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
gridlines: z.ZodBoolean;
|
|
227
|
+
headers: z.ZodBoolean;
|
|
228
|
+
pageOrder: z.ZodEnum<{
|
|
229
|
+
downThenOver: "downThenOver";
|
|
230
|
+
overThenDown: "overThenDown";
|
|
231
|
+
}>;
|
|
232
|
+
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
rows: z.ZodArray<z.ZodNumber>;
|
|
234
|
+
columns: z.ZodArray<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
}, z.core.$strip>;
|
|
236
237
|
kind: z.ZodLiteral<"sheet">;
|
|
237
238
|
}, z.core.$strict>;
|
|
238
239
|
type SheetDescriptor = z.infer<typeof SheetDescriptorSchema>;
|
|
@@ -245,6 +246,7 @@ declare const DrawPageDescriptorSchema: z.ZodObject<{
|
|
|
245
246
|
}, z.core.$strict>;
|
|
246
247
|
type DrawPageDescriptor = z.infer<typeof DrawPageDescriptorSchema>;
|
|
247
248
|
declare const ShapeDescriptorSchema: z.ZodObject<{
|
|
249
|
+
name: z.ZodOptional<z.ZodString>;
|
|
248
250
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
249
251
|
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
250
252
|
pageIndex: z.ZodNumber;
|
|
@@ -259,7 +261,6 @@ declare const ShapeDescriptorSchema: z.ZodObject<{
|
|
|
259
261
|
widthPt: z.ZodNumber;
|
|
260
262
|
heightPt: z.ZodNumber;
|
|
261
263
|
}, z.core.$strip>;
|
|
262
|
-
name: z.ZodOptional<z.ZodString>;
|
|
263
264
|
rotationDeg: z.ZodOptional<z.ZodNumber>;
|
|
264
265
|
insetLeftPt: z.ZodNumber;
|
|
265
266
|
insetTopPt: z.ZodNumber;
|
|
@@ -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-CtvgL_ON.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-CmNXOetG.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({
|