document-schema 3.2.0 → 4.0.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 +82 -31
- package/dist/codec.d.cts +2 -7
- package/dist/codec.d.ts +2 -7
- package/dist/content-BN0PWqpt.d.cts +2393 -0
- package/dist/content-CiZf6Fqn.d.ts +2393 -0
- package/dist/content-json-schema-defs.cjs +1006 -1
- package/dist/content-json-schema-defs.js +1006 -1
- package/dist/content.cjs +2 -8
- package/dist/content.d.cts +2 -2354
- package/dist/content.d.ts +2 -2354
- package/dist/content.js +2 -8
- package/dist/definitions.cjs +109 -0
- package/dist/definitions.d.cts +115 -0
- package/dist/definitions.d.ts +115 -0
- package/dist/definitions.js +99 -0
- package/dist/index.cjs +42 -18
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +6 -5
- package/dist/package-node-DDPSNOvy.d.cts +441 -0
- package/dist/package-node-QVFHQcm8.d.ts +441 -0
- package/dist/package-node.cjs +120 -0
- package/dist/package-node.d.cts +2 -0
- package/dist/package-node.d.ts +2 -0
- package/dist/package-node.js +93 -0
- package/dist/package.cjs +37 -7
- package/dist/package.d.cts +452 -755
- package/dist/package.d.ts +452 -755
- package/dist/package.js +39 -8
- package/dist/schema-io.cjs +55 -25
- package/dist/schema-io.d.cts +13 -11
- package/dist/schema-io.d.ts +13 -11
- package/dist/schema-io.js +54 -25
- package/package.json +2 -2
- package/schemas/content-document.schema.json +1476 -69
- package/schemas/document-package.schema.json +3056 -30
- package/dist/layout.cjs +0 -150
- package/dist/layout.d.cts +0 -684
- package/dist/layout.d.ts +0 -684
- package/dist/layout.js +0 -136
- package/schemas/layout-document.schema.json +0 -760
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { G as ContentSheetImage, gt as ContentVector, p as ContentEmbeddedObject, t as ContentBlock, v as ContentFormula } from "./content-CiZf6Fqn.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/package-node.d.ts
|
|
4
|
+
declare const SectionDescriptorSchema: z.ZodObject<{
|
|
5
|
+
pageSize: z.ZodObject<{
|
|
6
|
+
widthPt: z.ZodNumber;
|
|
7
|
+
heightPt: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
margins: z.ZodObject<{
|
|
10
|
+
topPt: z.ZodNumber;
|
|
11
|
+
rightPt: z.ZodNumber;
|
|
12
|
+
bottomPt: z.ZodNumber;
|
|
13
|
+
leftPt: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
kind: z.ZodLiteral<"section">;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
type SectionDescriptor = z.infer<typeof SectionDescriptorSchema>;
|
|
18
|
+
declare const SlideDescriptorSchema: z.ZodObject<{
|
|
19
|
+
size: z.ZodObject<{
|
|
20
|
+
widthPt: z.ZodNumber;
|
|
21
|
+
heightPt: z.ZodNumber;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
notes: z.ZodString;
|
|
24
|
+
kind: z.ZodLiteral<"slide">;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
type SlideDescriptor = z.infer<typeof SlideDescriptorSchema>;
|
|
27
|
+
declare const SheetDescriptorSchema: z.ZodObject<{
|
|
28
|
+
cells: z.ZodArray<z.ZodObject<{
|
|
29
|
+
row: z.ZodNumber;
|
|
30
|
+
column: z.ZodNumber;
|
|
31
|
+
value: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
+
kind: z.ZodLiteral<"number">;
|
|
33
|
+
value: z.ZodNumber;
|
|
34
|
+
exactValue: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
36
|
+
kind: z.ZodLiteral<"percentage">;
|
|
37
|
+
value: z.ZodNumber;
|
|
38
|
+
exactValue: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"currency">;
|
|
41
|
+
value: z.ZodNumber;
|
|
42
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
43
|
+
exactValue: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
kind: z.ZodLiteral<"boolean">;
|
|
46
|
+
value: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
kind: z.ZodLiteral<"date">;
|
|
49
|
+
value: z.ZodString;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"time">;
|
|
52
|
+
value: z.ZodString;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
kind: z.ZodLiteral<"dateTime">;
|
|
55
|
+
value: z.ZodString;
|
|
56
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
57
|
+
kind: z.ZodLiteral<"string">;
|
|
58
|
+
value: z.ZodString;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"error">;
|
|
61
|
+
value: z.ZodString;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
kind: z.ZodLiteral<"empty">;
|
|
64
|
+
}, z.core.$strip>], "kind">;
|
|
65
|
+
formula: z.ZodOptional<z.ZodString>;
|
|
66
|
+
displayText: z.ZodString;
|
|
67
|
+
runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
text: z.ZodString;
|
|
69
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
strike: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
74
|
+
sizePt: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
r: z.ZodNumber;
|
|
77
|
+
g: z.ZodNumber;
|
|
78
|
+
b: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
hyperlink: z.ZodOptional<z.ZodString>;
|
|
81
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
82
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
83
|
+
pageIndex: z.ZodNumber;
|
|
84
|
+
xPt: z.ZodNumber;
|
|
85
|
+
yPt: z.ZodNumber;
|
|
86
|
+
widthPt: z.ZodNumber;
|
|
87
|
+
heightPt: z.ZodNumber;
|
|
88
|
+
}, z.core.$strip>>>;
|
|
89
|
+
}, z.core.$strip>>>;
|
|
90
|
+
colSpan: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
rowSpan: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
background: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
r: z.ZodNumber;
|
|
94
|
+
g: z.ZodNumber;
|
|
95
|
+
b: z.ZodNumber;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
borders: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
left: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
color: z.ZodObject<{
|
|
100
|
+
r: z.ZodNumber;
|
|
101
|
+
g: z.ZodNumber;
|
|
102
|
+
b: z.ZodNumber;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
widthPt: z.ZodNumber;
|
|
105
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
solid: "solid";
|
|
107
|
+
dashed: "dashed";
|
|
108
|
+
dotted: "dotted";
|
|
109
|
+
double: "double";
|
|
110
|
+
}>>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
right: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
color: z.ZodObject<{
|
|
114
|
+
r: z.ZodNumber;
|
|
115
|
+
g: z.ZodNumber;
|
|
116
|
+
b: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
widthPt: z.ZodNumber;
|
|
119
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
120
|
+
solid: "solid";
|
|
121
|
+
dashed: "dashed";
|
|
122
|
+
dotted: "dotted";
|
|
123
|
+
double: "double";
|
|
124
|
+
}>>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
top: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
color: z.ZodObject<{
|
|
128
|
+
r: z.ZodNumber;
|
|
129
|
+
g: z.ZodNumber;
|
|
130
|
+
b: z.ZodNumber;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
widthPt: z.ZodNumber;
|
|
133
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
solid: "solid";
|
|
135
|
+
dashed: "dashed";
|
|
136
|
+
dotted: "dotted";
|
|
137
|
+
double: "double";
|
|
138
|
+
}>>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
bottom: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
color: z.ZodObject<{
|
|
142
|
+
r: z.ZodNumber;
|
|
143
|
+
g: z.ZodNumber;
|
|
144
|
+
b: z.ZodNumber;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
widthPt: z.ZodNumber;
|
|
147
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
148
|
+
solid: "solid";
|
|
149
|
+
dashed: "dashed";
|
|
150
|
+
dotted: "dotted";
|
|
151
|
+
double: "double";
|
|
152
|
+
}>>;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
alignment: z.ZodOptional<z.ZodEnum<{
|
|
156
|
+
left: "left";
|
|
157
|
+
center: "center";
|
|
158
|
+
right: "right";
|
|
159
|
+
justify: "justify";
|
|
160
|
+
}>>;
|
|
161
|
+
verticalAlignment: z.ZodOptional<z.ZodEnum<{
|
|
162
|
+
top: "top";
|
|
163
|
+
bottom: "bottom";
|
|
164
|
+
middle: "middle";
|
|
165
|
+
}>>;
|
|
166
|
+
comment: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
text: z.ZodString;
|
|
168
|
+
author: z.ZodOptional<z.ZodString>;
|
|
169
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
170
|
+
replies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
+
text: z.ZodString;
|
|
172
|
+
author: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strip>>>;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
176
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
|
+
pageIndex: z.ZodNumber;
|
|
178
|
+
xPt: z.ZodNumber;
|
|
179
|
+
yPt: z.ZodNumber;
|
|
180
|
+
widthPt: z.ZodNumber;
|
|
181
|
+
heightPt: z.ZodNumber;
|
|
182
|
+
}, z.core.$strip>>>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
185
|
+
index: z.ZodNumber;
|
|
186
|
+
heightPt: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
191
|
+
index: z.ZodNumber;
|
|
192
|
+
widthPt: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
printSettings: z.ZodObject<{
|
|
196
|
+
pageSize: z.ZodObject<{
|
|
197
|
+
widthPt: z.ZodNumber;
|
|
198
|
+
heightPt: z.ZodNumber;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
margins: z.ZodObject<{
|
|
201
|
+
topPt: z.ZodNumber;
|
|
202
|
+
rightPt: z.ZodNumber;
|
|
203
|
+
bottomPt: z.ZodNumber;
|
|
204
|
+
leftPt: z.ZodNumber;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
printRange: z.ZodOptional<z.ZodObject<{
|
|
207
|
+
startRow: z.ZodNumber;
|
|
208
|
+
startColumn: z.ZodNumber;
|
|
209
|
+
endRow: z.ZodNumber;
|
|
210
|
+
endColumn: z.ZodNumber;
|
|
211
|
+
}, z.core.$strip>>;
|
|
212
|
+
scalePercent: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
fitToPages: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
width: z.ZodNumber;
|
|
215
|
+
height: z.ZodNumber;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
repeatRows: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
start: z.ZodNumber;
|
|
219
|
+
end: z.ZodNumber;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
repeatColumns: z.ZodOptional<z.ZodObject<{
|
|
222
|
+
start: z.ZodNumber;
|
|
223
|
+
end: z.ZodNumber;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
gridlines: z.ZodBoolean;
|
|
226
|
+
headers: z.ZodBoolean;
|
|
227
|
+
pageOrder: z.ZodEnum<{
|
|
228
|
+
downThenOver: "downThenOver";
|
|
229
|
+
overThenDown: "overThenDown";
|
|
230
|
+
}>;
|
|
231
|
+
manualBreaks: z.ZodOptional<z.ZodObject<{
|
|
232
|
+
rows: z.ZodArray<z.ZodNumber>;
|
|
233
|
+
columns: z.ZodArray<z.ZodNumber>;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
kind: z.ZodLiteral<"sheet">;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
type SheetDescriptor = z.infer<typeof SheetDescriptorSchema>;
|
|
239
|
+
declare const DrawPageDescriptorSchema: z.ZodObject<{
|
|
240
|
+
size: z.ZodObject<{
|
|
241
|
+
widthPt: z.ZodNumber;
|
|
242
|
+
heightPt: z.ZodNumber;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
kind: z.ZodLiteral<"drawPage">;
|
|
245
|
+
}, z.core.$strict>;
|
|
246
|
+
type DrawPageDescriptor = z.infer<typeof DrawPageDescriptorSchema>;
|
|
247
|
+
declare const ShapeDescriptorSchema: z.ZodObject<{
|
|
248
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
249
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
250
|
+
pageIndex: z.ZodNumber;
|
|
251
|
+
xPt: z.ZodNumber;
|
|
252
|
+
yPt: z.ZodNumber;
|
|
253
|
+
widthPt: z.ZodNumber;
|
|
254
|
+
heightPt: z.ZodNumber;
|
|
255
|
+
}, z.core.$strip>>>;
|
|
256
|
+
frame: z.ZodObject<{
|
|
257
|
+
xPt: z.ZodNumber;
|
|
258
|
+
yPt: z.ZodNumber;
|
|
259
|
+
widthPt: z.ZodNumber;
|
|
260
|
+
heightPt: z.ZodNumber;
|
|
261
|
+
}, z.core.$strip>;
|
|
262
|
+
name: z.ZodOptional<z.ZodString>;
|
|
263
|
+
rotationDeg: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
insetLeftPt: z.ZodNumber;
|
|
265
|
+
insetTopPt: z.ZodNumber;
|
|
266
|
+
insetRightPt: z.ZodNumber;
|
|
267
|
+
insetBottomPt: z.ZodNumber;
|
|
268
|
+
fontScale: z.ZodOptional<z.ZodNumber>;
|
|
269
|
+
lineSpacingReduction: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
paintOrder: z.ZodOptional<z.ZodNumber>;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
type ShapeDescriptor = z.infer<typeof ShapeDescriptorSchema>;
|
|
273
|
+
declare const HeadingParagraphSchema: z.ZodObject<{
|
|
274
|
+
kind: z.ZodLiteral<"paragraph">;
|
|
275
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
276
|
+
text: z.ZodString;
|
|
277
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
279
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
280
|
+
strike: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
282
|
+
sizePt: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
r: z.ZodNumber;
|
|
285
|
+
g: z.ZodNumber;
|
|
286
|
+
b: z.ZodNumber;
|
|
287
|
+
}, z.core.$strip>>;
|
|
288
|
+
hyperlink: z.ZodOptional<z.ZodString>;
|
|
289
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
290
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
291
|
+
pageIndex: z.ZodNumber;
|
|
292
|
+
xPt: z.ZodNumber;
|
|
293
|
+
yPt: z.ZodNumber;
|
|
294
|
+
widthPt: z.ZodNumber;
|
|
295
|
+
heightPt: z.ZodNumber;
|
|
296
|
+
}, z.core.$strip>>>;
|
|
297
|
+
}, z.core.$strip>>;
|
|
298
|
+
styleId: z.ZodOptional<z.ZodString>;
|
|
299
|
+
alignment: z.ZodOptional<z.ZodEnum<{
|
|
300
|
+
left: "left";
|
|
301
|
+
center: "center";
|
|
302
|
+
right: "right";
|
|
303
|
+
justify: "justify";
|
|
304
|
+
}>>;
|
|
305
|
+
list: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
numId: z.ZodOptional<z.ZodString>;
|
|
307
|
+
level: z.ZodNumber;
|
|
308
|
+
}, z.core.$strip>>;
|
|
309
|
+
spacingBeforePt: z.ZodOptional<z.ZodNumber>;
|
|
310
|
+
spacingAfterPt: z.ZodOptional<z.ZodNumber>;
|
|
311
|
+
lineSpacing: z.ZodOptional<z.ZodNumber>;
|
|
312
|
+
indentLeftPt: z.ZodOptional<z.ZodNumber>;
|
|
313
|
+
indentFirstLinePt: z.ZodOptional<z.ZodNumber>;
|
|
314
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
315
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
316
|
+
pageIndex: z.ZodNumber;
|
|
317
|
+
xPt: z.ZodNumber;
|
|
318
|
+
yPt: z.ZodNumber;
|
|
319
|
+
widthPt: z.ZodNumber;
|
|
320
|
+
heightPt: z.ZodNumber;
|
|
321
|
+
}, z.core.$strip>>>;
|
|
322
|
+
headingLevel: z.ZodNumber;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
type HeadingParagraph = z.infer<typeof HeadingParagraphSchema>;
|
|
325
|
+
declare const ListParagraphSchema: z.ZodObject<{
|
|
326
|
+
kind: z.ZodLiteral<"paragraph">;
|
|
327
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
328
|
+
text: z.ZodString;
|
|
329
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
+
italic: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
underline: z.ZodOptional<z.ZodBoolean>;
|
|
332
|
+
strike: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
334
|
+
sizePt: z.ZodOptional<z.ZodNumber>;
|
|
335
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
336
|
+
r: z.ZodNumber;
|
|
337
|
+
g: z.ZodNumber;
|
|
338
|
+
b: z.ZodNumber;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
hyperlink: z.ZodOptional<z.ZodString>;
|
|
341
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
342
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
343
|
+
pageIndex: z.ZodNumber;
|
|
344
|
+
xPt: z.ZodNumber;
|
|
345
|
+
yPt: z.ZodNumber;
|
|
346
|
+
widthPt: z.ZodNumber;
|
|
347
|
+
heightPt: z.ZodNumber;
|
|
348
|
+
}, z.core.$strip>>>;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
styleId: z.ZodOptional<z.ZodString>;
|
|
351
|
+
headingLevel: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
alignment: z.ZodOptional<z.ZodEnum<{
|
|
353
|
+
left: "left";
|
|
354
|
+
center: "center";
|
|
355
|
+
right: "right";
|
|
356
|
+
justify: "justify";
|
|
357
|
+
}>>;
|
|
358
|
+
spacingBeforePt: z.ZodOptional<z.ZodNumber>;
|
|
359
|
+
spacingAfterPt: z.ZodOptional<z.ZodNumber>;
|
|
360
|
+
lineSpacing: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
indentLeftPt: z.ZodOptional<z.ZodNumber>;
|
|
362
|
+
indentFirstLinePt: z.ZodOptional<z.ZodNumber>;
|
|
363
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
364
|
+
frames: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
365
|
+
pageIndex: z.ZodNumber;
|
|
366
|
+
xPt: z.ZodNumber;
|
|
367
|
+
yPt: z.ZodNumber;
|
|
368
|
+
widthPt: z.ZodNumber;
|
|
369
|
+
heightPt: z.ZodNumber;
|
|
370
|
+
}, z.core.$strip>>>;
|
|
371
|
+
list: z.ZodObject<{
|
|
372
|
+
numId: z.ZodOptional<z.ZodString>;
|
|
373
|
+
level: z.ZodNumber;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
type ListParagraph = z.infer<typeof ListParagraphSchema>;
|
|
377
|
+
type PackageLeaf = ContentBlock | ContentSheetImage | ContentEmbeddedObject | ContentVector | ContentFormula;
|
|
378
|
+
type SectionChild = HeadingGroupNode | ListGroupNode | ContentBlock;
|
|
379
|
+
type ShapeChild = ListGroupNode | ContentBlock;
|
|
380
|
+
type ListChild = ListGroupNode | ContentBlock;
|
|
381
|
+
type SheetChild = ContentSheetImage | ContentEmbeddedObject;
|
|
382
|
+
type DrawPageChild = ShapeGroupNode | ContentVector;
|
|
383
|
+
interface SectionGroupNode {
|
|
384
|
+
readonly node: SectionDescriptor;
|
|
385
|
+
style?: string;
|
|
386
|
+
children: SectionChild[];
|
|
387
|
+
}
|
|
388
|
+
interface SlideGroupNode {
|
|
389
|
+
readonly node: SlideDescriptor;
|
|
390
|
+
style?: string;
|
|
391
|
+
children: ShapeGroupNode[];
|
|
392
|
+
}
|
|
393
|
+
interface SheetGroupNode {
|
|
394
|
+
readonly node: SheetDescriptor;
|
|
395
|
+
style?: string;
|
|
396
|
+
children: SheetChild[];
|
|
397
|
+
}
|
|
398
|
+
interface DrawPageGroupNode {
|
|
399
|
+
readonly node: DrawPageDescriptor;
|
|
400
|
+
style?: string;
|
|
401
|
+
children: DrawPageChild[];
|
|
402
|
+
}
|
|
403
|
+
interface ShapeGroupNode {
|
|
404
|
+
readonly node: ShapeDescriptor;
|
|
405
|
+
style?: string;
|
|
406
|
+
children: ShapeChild[];
|
|
407
|
+
}
|
|
408
|
+
interface HeadingGroupNode {
|
|
409
|
+
readonly node: HeadingParagraph;
|
|
410
|
+
style?: string;
|
|
411
|
+
children: SectionChild[];
|
|
412
|
+
}
|
|
413
|
+
interface ListGroupNode {
|
|
414
|
+
readonly node: ListParagraph;
|
|
415
|
+
style?: string;
|
|
416
|
+
children: ListChild[];
|
|
417
|
+
}
|
|
418
|
+
type PackageGroup = SectionGroupNode | SlideGroupNode | SheetGroupNode | DrawPageGroupNode | ShapeGroupNode | HeadingGroupNode | ListGroupNode;
|
|
419
|
+
type PackageNode = PackageGroup | PackageLeaf;
|
|
420
|
+
declare function isSectionGroupNode(value: unknown): value is SectionGroupNode;
|
|
421
|
+
declare function isSlideGroupNode(value: unknown): value is SlideGroupNode;
|
|
422
|
+
declare function isSheetGroupNode(value: unknown): value is SheetGroupNode;
|
|
423
|
+
declare function isDrawPageGroupNode(value: unknown): value is DrawPageGroupNode;
|
|
424
|
+
declare function isShapeGroupNode(value: unknown): value is ShapeGroupNode;
|
|
425
|
+
declare function isHeadingGroupNode(value: unknown): value is HeadingGroupNode;
|
|
426
|
+
declare function isListGroupNode(value: unknown): value is ListGroupNode;
|
|
427
|
+
declare function isPackageLeaf(value: unknown): value is PackageLeaf;
|
|
428
|
+
declare function isPackageGroup(value: unknown): value is PackageGroup;
|
|
429
|
+
declare function isPackageNode(value: unknown): value is PackageNode;
|
|
430
|
+
declare const SectionGroupSchema: z.ZodCustom<SectionGroupNode, SectionGroupNode>;
|
|
431
|
+
declare const SlideGroupSchema: z.ZodCustom<SlideGroupNode, SlideGroupNode>;
|
|
432
|
+
declare const SheetGroupSchema: z.ZodCustom<SheetGroupNode, SheetGroupNode>;
|
|
433
|
+
declare const DrawPageGroupSchema: z.ZodCustom<DrawPageGroupNode, DrawPageGroupNode>;
|
|
434
|
+
declare const ShapeGroupSchema: z.ZodCustom<ShapeGroupNode, ShapeGroupNode>;
|
|
435
|
+
declare const HeadingGroupSchema: z.ZodCustom<HeadingGroupNode, HeadingGroupNode>;
|
|
436
|
+
declare const ListGroupSchema: z.ZodCustom<ListGroupNode, ListGroupNode>;
|
|
437
|
+
declare const PackageGroupSchema: z.ZodCustom<PackageGroup, PackageGroup>;
|
|
438
|
+
declare const PackageLeafSchema: z.ZodCustom<PackageLeaf, PackageLeaf>;
|
|
439
|
+
declare const PackageNodeSchema: z.ZodCustom<PackageNode, PackageNode>;
|
|
440
|
+
//#endregion
|
|
441
|
+
export { ShapeGroupSchema as A, isDrawPageGroupNode as B, SectionDescriptorSchema as C, ShapeDescriptor as D, ShapeChild as E, SheetGroupSchema as F, isPackageNode as G, isListGroupNode as H, SlideDescriptor as I, isSheetGroupNode as J, isSectionGroupNode as K, SlideDescriptorSchema as L, SheetDescriptor as M, SheetDescriptorSchema as N, ShapeDescriptorSchema as O, SheetGroupNode as P, SlideGroupNode as R, SectionDescriptor as S, SectionGroupSchema as T, isPackageGroup as U, isHeadingGroupNode as V, isPackageLeaf as W, isSlideGroupNode as Y, PackageLeaf as _, DrawPageGroupSchema as a, PackageNodeSchema as b, HeadingParagraph as c, ListGroupNode as d, ListGroupSchema as f, PackageGroupSchema as g, PackageGroup as h, DrawPageGroupNode as i, SheetChild as j, ShapeGroupNode as k, HeadingParagraphSchema as l, ListParagraphSchema as m, DrawPageDescriptor as n, HeadingGroupNode as o, ListParagraph as p, isShapeGroupNode as q, DrawPageDescriptorSchema as r, HeadingGroupSchema as s, DrawPageChild as t, ListChild as u, PackageLeafSchema as v, SectionGroupNode as w, SectionChild as x, PackageNode as y, SlideGroupSchema as z };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_content = require("./content.cjs");
|
|
3
|
+
let zod = require("zod");
|
|
4
|
+
//#region src/package-node.ts
|
|
5
|
+
const SectionDescriptorSchema = require_content.ContentSectionSchema.omit({ blocks: true }).extend({ kind: zod.z.literal("section") }).strict();
|
|
6
|
+
const SlideDescriptorSchema = require_content.ContentSlideSchema.omit({ shapes: true }).extend({ kind: zod.z.literal("slide") }).strict();
|
|
7
|
+
const SheetDescriptorSchema = require_content.ContentSheetSchema.omit({
|
|
8
|
+
images: true,
|
|
9
|
+
embeddedObjects: true
|
|
10
|
+
}).extend({ kind: zod.z.literal("sheet") }).strict();
|
|
11
|
+
const DrawPageDescriptorSchema = require_content.ContentDrawPageSchema.omit({
|
|
12
|
+
shapes: true,
|
|
13
|
+
vectors: true
|
|
14
|
+
}).extend({ kind: zod.z.literal("drawPage") }).strict();
|
|
15
|
+
const ShapeDescriptorSchema = require_content.ContentShapeSchema.omit({ blocks: true }).strict();
|
|
16
|
+
const HeadingParagraphSchema = require_content.ContentParagraphSchema.extend({ headingLevel: zod.z.number().int().positive() });
|
|
17
|
+
const ListParagraphSchema = require_content.ContentParagraphSchema.extend({ list: require_content.ContentListMembershipSchema });
|
|
18
|
+
function isRecord(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20
|
+
}
|
|
21
|
+
function isGroupWrapper(value, isChild) {
|
|
22
|
+
if (!isRecord(value.node)) return false;
|
|
23
|
+
if (value.style !== void 0 && typeof value.style !== "string") return false;
|
|
24
|
+
if (!Object.keys(value).every((key) => key === "node" || key === "style" || key === "children")) return false;
|
|
25
|
+
return Array.isArray(value.children) && value.children.every(isChild);
|
|
26
|
+
}
|
|
27
|
+
function isLeafChild(schema, value) {
|
|
28
|
+
if (isRecord(value) && "style" in value) return false;
|
|
29
|
+
return schema.safeParse(value).success;
|
|
30
|
+
}
|
|
31
|
+
function isSectionChild(value) {
|
|
32
|
+
return isHeadingGroupNode(value) || isListGroupNode(value) || isLeafChild(require_content.ContentBlockSchema, value);
|
|
33
|
+
}
|
|
34
|
+
function isShapeChild(value) {
|
|
35
|
+
return isListGroupNode(value) || isLeafChild(require_content.ContentBlockSchema, value);
|
|
36
|
+
}
|
|
37
|
+
function isListChild(value) {
|
|
38
|
+
return isListGroupNode(value) || isLeafChild(require_content.ContentBlockSchema, value);
|
|
39
|
+
}
|
|
40
|
+
function isSheetChild(value) {
|
|
41
|
+
return isLeafChild(require_content.ContentSheetImageSchema, value) || isLeafChild(require_content.ContentEmbeddedObjectSchema, value);
|
|
42
|
+
}
|
|
43
|
+
function isDrawPageChild(value) {
|
|
44
|
+
return isShapeGroupNode(value) || isLeafChild(require_content.ContentVectorSchema, value);
|
|
45
|
+
}
|
|
46
|
+
function isSectionGroupNode(value) {
|
|
47
|
+
return isRecord(value) && isGroupWrapper(value, isSectionChild) && SectionDescriptorSchema.safeParse(value.node).success;
|
|
48
|
+
}
|
|
49
|
+
function isSlideGroupNode(value) {
|
|
50
|
+
return isRecord(value) && isGroupWrapper(value, isShapeGroupNode) && SlideDescriptorSchema.safeParse(value.node).success;
|
|
51
|
+
}
|
|
52
|
+
function isSheetGroupNode(value) {
|
|
53
|
+
return isRecord(value) && isGroupWrapper(value, isSheetChild) && SheetDescriptorSchema.safeParse(value.node).success;
|
|
54
|
+
}
|
|
55
|
+
function isDrawPageGroupNode(value) {
|
|
56
|
+
return isRecord(value) && isGroupWrapper(value, isDrawPageChild) && DrawPageDescriptorSchema.safeParse(value.node).success;
|
|
57
|
+
}
|
|
58
|
+
function isShapeGroupNode(value) {
|
|
59
|
+
return isRecord(value) && isGroupWrapper(value, isShapeChild) && ShapeDescriptorSchema.safeParse(value.node).success;
|
|
60
|
+
}
|
|
61
|
+
function isHeadingGroupNode(value) {
|
|
62
|
+
return isRecord(value) && isGroupWrapper(value, isSectionChild) && HeadingParagraphSchema.safeParse(value.node).success;
|
|
63
|
+
}
|
|
64
|
+
function isListGroupNode(value) {
|
|
65
|
+
return isRecord(value) && isGroupWrapper(value, isListChild) && ListParagraphSchema.safeParse(value.node).success;
|
|
66
|
+
}
|
|
67
|
+
const packageLeafUnion = zod.z.union([
|
|
68
|
+
require_content.ContentBlockSchema,
|
|
69
|
+
require_content.ContentSheetImageSchema,
|
|
70
|
+
require_content.ContentEmbeddedObjectSchema,
|
|
71
|
+
require_content.ContentVectorSchema,
|
|
72
|
+
require_content.ContentFormulaSchema
|
|
73
|
+
]);
|
|
74
|
+
function isPackageLeaf(value) {
|
|
75
|
+
return packageLeafUnion.safeParse(value).success;
|
|
76
|
+
}
|
|
77
|
+
function isPackageGroup(value) {
|
|
78
|
+
return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value);
|
|
79
|
+
}
|
|
80
|
+
function isPackageNode(value) {
|
|
81
|
+
return isPackageGroup(value) || isPackageLeaf(value);
|
|
82
|
+
}
|
|
83
|
+
const SectionGroupSchema = zod.z.custom(isSectionGroupNode);
|
|
84
|
+
const SlideGroupSchema = zod.z.custom(isSlideGroupNode);
|
|
85
|
+
const SheetGroupSchema = zod.z.custom(isSheetGroupNode);
|
|
86
|
+
const DrawPageGroupSchema = zod.z.custom(isDrawPageGroupNode);
|
|
87
|
+
const ShapeGroupSchema = zod.z.custom(isShapeGroupNode);
|
|
88
|
+
const HeadingGroupSchema = zod.z.custom(isHeadingGroupNode);
|
|
89
|
+
const ListGroupSchema = zod.z.custom(isListGroupNode);
|
|
90
|
+
const PackageGroupSchema = zod.z.custom(isPackageGroup);
|
|
91
|
+
const PackageLeafSchema = zod.z.custom(isPackageLeaf);
|
|
92
|
+
const PackageNodeSchema = zod.z.custom(isPackageNode);
|
|
93
|
+
//#endregion
|
|
94
|
+
exports.DrawPageDescriptorSchema = DrawPageDescriptorSchema;
|
|
95
|
+
exports.DrawPageGroupSchema = DrawPageGroupSchema;
|
|
96
|
+
exports.HeadingGroupSchema = HeadingGroupSchema;
|
|
97
|
+
exports.HeadingParagraphSchema = HeadingParagraphSchema;
|
|
98
|
+
exports.ListGroupSchema = ListGroupSchema;
|
|
99
|
+
exports.ListParagraphSchema = ListParagraphSchema;
|
|
100
|
+
exports.PackageGroupSchema = PackageGroupSchema;
|
|
101
|
+
exports.PackageLeafSchema = PackageLeafSchema;
|
|
102
|
+
exports.PackageNodeSchema = PackageNodeSchema;
|
|
103
|
+
exports.SectionDescriptorSchema = SectionDescriptorSchema;
|
|
104
|
+
exports.SectionGroupSchema = SectionGroupSchema;
|
|
105
|
+
exports.ShapeDescriptorSchema = ShapeDescriptorSchema;
|
|
106
|
+
exports.ShapeGroupSchema = ShapeGroupSchema;
|
|
107
|
+
exports.SheetDescriptorSchema = SheetDescriptorSchema;
|
|
108
|
+
exports.SheetGroupSchema = SheetGroupSchema;
|
|
109
|
+
exports.SlideDescriptorSchema = SlideDescriptorSchema;
|
|
110
|
+
exports.SlideGroupSchema = SlideGroupSchema;
|
|
111
|
+
exports.isDrawPageGroupNode = isDrawPageGroupNode;
|
|
112
|
+
exports.isHeadingGroupNode = isHeadingGroupNode;
|
|
113
|
+
exports.isListGroupNode = isListGroupNode;
|
|
114
|
+
exports.isPackageGroup = isPackageGroup;
|
|
115
|
+
exports.isPackageLeaf = isPackageLeaf;
|
|
116
|
+
exports.isPackageNode = isPackageNode;
|
|
117
|
+
exports.isSectionGroupNode = isSectionGroupNode;
|
|
118
|
+
exports.isShapeGroupNode = isShapeGroupNode;
|
|
119
|
+
exports.isSheetGroupNode = isSheetGroupNode;
|
|
120
|
+
exports.isSlideGroupNode = isSlideGroupNode;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as ShapeGroupSchema, B as isDrawPageGroupNode, C as SectionDescriptorSchema, D as ShapeDescriptor, E as ShapeChild, F as SheetGroupSchema, G as isPackageNode, H as isListGroupNode, I as SlideDescriptor, J as isSheetGroupNode, K as isSectionGroupNode, L as SlideDescriptorSchema, M as SheetDescriptor, N as SheetDescriptorSchema, O as ShapeDescriptorSchema, P as SheetGroupNode, R as SlideGroupNode, S as SectionDescriptor, T as SectionGroupSchema, U as isPackageGroup, V as isHeadingGroupNode, W as isPackageLeaf, Y as isSlideGroupNode, _ as PackageLeaf, a as DrawPageGroupSchema, b as PackageNodeSchema, c as HeadingParagraph, d as ListGroupNode, f as ListGroupSchema, g as PackageGroupSchema, h as PackageGroup, i as DrawPageGroupNode, j as SheetChild, k as ShapeGroupNode, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, o as HeadingGroupNode, p as ListParagraph, q as isShapeGroupNode, r as DrawPageDescriptorSchema, s as HeadingGroupSchema, t as DrawPageChild, u as ListChild, v as PackageLeafSchema, w as SectionGroupNode, x as SectionChild, y as PackageNode, z as SlideGroupSchema } from "./package-node-DDPSNOvy.cjs";
|
|
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 };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as ShapeGroupSchema, B as isDrawPageGroupNode, C as SectionDescriptorSchema, D as ShapeDescriptor, E as ShapeChild, F as SheetGroupSchema, G as isPackageNode, H as isListGroupNode, I as SlideDescriptor, J as isSheetGroupNode, K as isSectionGroupNode, L as SlideDescriptorSchema, M as SheetDescriptor, N as SheetDescriptorSchema, O as ShapeDescriptorSchema, P as SheetGroupNode, R as SlideGroupNode, S as SectionDescriptor, T as SectionGroupSchema, U as isPackageGroup, V as isHeadingGroupNode, W as isPackageLeaf, Y as isSlideGroupNode, _ as PackageLeaf, a as DrawPageGroupSchema, b as PackageNodeSchema, c as HeadingParagraph, d as ListGroupNode, f as ListGroupSchema, g as PackageGroupSchema, h as PackageGroup, i as DrawPageGroupNode, j as SheetChild, k as ShapeGroupNode, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, o as HeadingGroupNode, p as ListParagraph, q as isShapeGroupNode, r as DrawPageDescriptorSchema, s as HeadingGroupSchema, t as DrawPageChild, u as ListChild, v as PackageLeafSchema, w as SectionGroupNode, x as SectionChild, y as PackageNode, z as SlideGroupSchema } from "./package-node-QVFHQcm8.js";
|
|
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 };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ContentBlockSchema, ContentDrawPageSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentListMembershipSchema, ContentParagraphSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetImageSchema, ContentSheetSchema, ContentSlideSchema, ContentVectorSchema } from "./content.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/package-node.ts
|
|
4
|
+
const SectionDescriptorSchema = ContentSectionSchema.omit({ blocks: true }).extend({ kind: z.literal("section") }).strict();
|
|
5
|
+
const SlideDescriptorSchema = ContentSlideSchema.omit({ shapes: true }).extend({ kind: z.literal("slide") }).strict();
|
|
6
|
+
const SheetDescriptorSchema = ContentSheetSchema.omit({
|
|
7
|
+
images: true,
|
|
8
|
+
embeddedObjects: true
|
|
9
|
+
}).extend({ kind: z.literal("sheet") }).strict();
|
|
10
|
+
const DrawPageDescriptorSchema = ContentDrawPageSchema.omit({
|
|
11
|
+
shapes: true,
|
|
12
|
+
vectors: true
|
|
13
|
+
}).extend({ kind: z.literal("drawPage") }).strict();
|
|
14
|
+
const ShapeDescriptorSchema = ContentShapeSchema.omit({ blocks: true }).strict();
|
|
15
|
+
const HeadingParagraphSchema = ContentParagraphSchema.extend({ headingLevel: z.number().int().positive() });
|
|
16
|
+
const ListParagraphSchema = ContentParagraphSchema.extend({ list: ContentListMembershipSchema });
|
|
17
|
+
function isRecord(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19
|
+
}
|
|
20
|
+
function isGroupWrapper(value, isChild) {
|
|
21
|
+
if (!isRecord(value.node)) return false;
|
|
22
|
+
if (value.style !== void 0 && typeof value.style !== "string") return false;
|
|
23
|
+
if (!Object.keys(value).every((key) => key === "node" || key === "style" || key === "children")) return false;
|
|
24
|
+
return Array.isArray(value.children) && value.children.every(isChild);
|
|
25
|
+
}
|
|
26
|
+
function isLeafChild(schema, value) {
|
|
27
|
+
if (isRecord(value) && "style" in value) return false;
|
|
28
|
+
return schema.safeParse(value).success;
|
|
29
|
+
}
|
|
30
|
+
function isSectionChild(value) {
|
|
31
|
+
return isHeadingGroupNode(value) || isListGroupNode(value) || isLeafChild(ContentBlockSchema, value);
|
|
32
|
+
}
|
|
33
|
+
function isShapeChild(value) {
|
|
34
|
+
return isListGroupNode(value) || isLeafChild(ContentBlockSchema, value);
|
|
35
|
+
}
|
|
36
|
+
function isListChild(value) {
|
|
37
|
+
return isListGroupNode(value) || isLeafChild(ContentBlockSchema, value);
|
|
38
|
+
}
|
|
39
|
+
function isSheetChild(value) {
|
|
40
|
+
return isLeafChild(ContentSheetImageSchema, value) || isLeafChild(ContentEmbeddedObjectSchema, value);
|
|
41
|
+
}
|
|
42
|
+
function isDrawPageChild(value) {
|
|
43
|
+
return isShapeGroupNode(value) || isLeafChild(ContentVectorSchema, value);
|
|
44
|
+
}
|
|
45
|
+
function isSectionGroupNode(value) {
|
|
46
|
+
return isRecord(value) && isGroupWrapper(value, isSectionChild) && SectionDescriptorSchema.safeParse(value.node).success;
|
|
47
|
+
}
|
|
48
|
+
function isSlideGroupNode(value) {
|
|
49
|
+
return isRecord(value) && isGroupWrapper(value, isShapeGroupNode) && SlideDescriptorSchema.safeParse(value.node).success;
|
|
50
|
+
}
|
|
51
|
+
function isSheetGroupNode(value) {
|
|
52
|
+
return isRecord(value) && isGroupWrapper(value, isSheetChild) && SheetDescriptorSchema.safeParse(value.node).success;
|
|
53
|
+
}
|
|
54
|
+
function isDrawPageGroupNode(value) {
|
|
55
|
+
return isRecord(value) && isGroupWrapper(value, isDrawPageChild) && DrawPageDescriptorSchema.safeParse(value.node).success;
|
|
56
|
+
}
|
|
57
|
+
function isShapeGroupNode(value) {
|
|
58
|
+
return isRecord(value) && isGroupWrapper(value, isShapeChild) && ShapeDescriptorSchema.safeParse(value.node).success;
|
|
59
|
+
}
|
|
60
|
+
function isHeadingGroupNode(value) {
|
|
61
|
+
return isRecord(value) && isGroupWrapper(value, isSectionChild) && HeadingParagraphSchema.safeParse(value.node).success;
|
|
62
|
+
}
|
|
63
|
+
function isListGroupNode(value) {
|
|
64
|
+
return isRecord(value) && isGroupWrapper(value, isListChild) && ListParagraphSchema.safeParse(value.node).success;
|
|
65
|
+
}
|
|
66
|
+
const packageLeafUnion = z.union([
|
|
67
|
+
ContentBlockSchema,
|
|
68
|
+
ContentSheetImageSchema,
|
|
69
|
+
ContentEmbeddedObjectSchema,
|
|
70
|
+
ContentVectorSchema,
|
|
71
|
+
ContentFormulaSchema
|
|
72
|
+
]);
|
|
73
|
+
function isPackageLeaf(value) {
|
|
74
|
+
return packageLeafUnion.safeParse(value).success;
|
|
75
|
+
}
|
|
76
|
+
function isPackageGroup(value) {
|
|
77
|
+
return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value);
|
|
78
|
+
}
|
|
79
|
+
function isPackageNode(value) {
|
|
80
|
+
return isPackageGroup(value) || isPackageLeaf(value);
|
|
81
|
+
}
|
|
82
|
+
const SectionGroupSchema = z.custom(isSectionGroupNode);
|
|
83
|
+
const SlideGroupSchema = z.custom(isSlideGroupNode);
|
|
84
|
+
const SheetGroupSchema = z.custom(isSheetGroupNode);
|
|
85
|
+
const DrawPageGroupSchema = z.custom(isDrawPageGroupNode);
|
|
86
|
+
const ShapeGroupSchema = z.custom(isShapeGroupNode);
|
|
87
|
+
const HeadingGroupSchema = z.custom(isHeadingGroupNode);
|
|
88
|
+
const ListGroupSchema = z.custom(isListGroupNode);
|
|
89
|
+
const PackageGroupSchema = z.custom(isPackageGroup);
|
|
90
|
+
const PackageLeafSchema = z.custom(isPackageLeaf);
|
|
91
|
+
const PackageNodeSchema = z.custom(isPackageNode);
|
|
92
|
+
//#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 };
|