document-model.js 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/dist/style.d.cts +2 -2
- package/dist/style.d.ts +2 -2
- 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
package/dist/content.cjs
CHANGED
|
@@ -21,7 +21,7 @@ const ContentRunSchema = zod.z.object({
|
|
|
21
21
|
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional()
|
|
22
22
|
});
|
|
23
23
|
const ContentListMembershipSchema = zod.z.object({
|
|
24
|
-
numId: zod.z.string(),
|
|
24
|
+
numId: zod.z.string().optional(),
|
|
25
25
|
level: zod.z.number().int().nonnegative()
|
|
26
26
|
});
|
|
27
27
|
const ContentParagraphSchema = zod.z.object({
|
|
@@ -359,47 +359,40 @@ const ContentFormulaSchema = zod.z.object({
|
|
|
359
359
|
content: require_math.MathExpressionSchema.optional(),
|
|
360
360
|
provenance: require_math.MathProvenanceSchema.optional()
|
|
361
361
|
});
|
|
362
|
-
const CONTENT_FORMAT_VERSION = 3;
|
|
363
362
|
const contentDocumentSharedFields = { symbolTable: require_math.SymbolTableSchema.optional() };
|
|
364
363
|
const ContentDocumentSchema = zod.z.discriminatedUnion("kind", [
|
|
365
364
|
zod.z.object({
|
|
366
365
|
kind: zod.z.literal("wordprocessing"),
|
|
367
|
-
formatVersion: zod.z.literal(3),
|
|
368
366
|
metadata: require_metadata.LayoutMetadataSchema,
|
|
369
367
|
...contentDocumentSharedFields,
|
|
370
368
|
sections: zod.z.array(ContentSectionSchema)
|
|
371
369
|
}),
|
|
372
370
|
zod.z.object({
|
|
373
371
|
kind: zod.z.literal("presentation"),
|
|
374
|
-
formatVersion: zod.z.literal(3),
|
|
375
372
|
metadata: require_metadata.LayoutMetadataSchema,
|
|
376
373
|
...contentDocumentSharedFields,
|
|
377
374
|
slides: zod.z.array(ContentSlideSchema)
|
|
378
375
|
}),
|
|
379
376
|
zod.z.object({
|
|
380
377
|
kind: zod.z.literal("spreadsheet"),
|
|
381
|
-
formatVersion: zod.z.literal(3),
|
|
382
378
|
metadata: require_metadata.LayoutMetadataSchema,
|
|
383
379
|
...contentDocumentSharedFields,
|
|
384
380
|
sheets: zod.z.array(ContentSheetSchema)
|
|
385
381
|
}),
|
|
386
382
|
zod.z.object({
|
|
387
383
|
kind: zod.z.literal("drawing"),
|
|
388
|
-
formatVersion: zod.z.literal(3),
|
|
389
384
|
metadata: require_metadata.LayoutMetadataSchema,
|
|
390
385
|
...contentDocumentSharedFields,
|
|
391
386
|
pages: zod.z.array(ContentDrawPageSchema)
|
|
392
387
|
}),
|
|
393
388
|
zod.z.object({
|
|
394
389
|
kind: zod.z.literal("formula"),
|
|
395
|
-
formatVersion: zod.z.literal(3),
|
|
396
390
|
metadata: require_metadata.LayoutMetadataSchema,
|
|
397
391
|
...contentDocumentSharedFields,
|
|
398
392
|
formula: ContentFormulaSchema
|
|
399
393
|
})
|
|
400
394
|
]);
|
|
401
395
|
//#endregion
|
|
402
|
-
exports.CONTENT_FORMAT_VERSION = CONTENT_FORMAT_VERSION;
|
|
403
396
|
exports.ContentBlockSchema = ContentBlockSchema;
|
|
404
397
|
exports.ContentBorderSchema = ContentBorderSchema;
|
|
405
398
|
exports.ContentCellBordersSchema = ContentCellBordersSchema;
|
|
@@ -437,4 +430,5 @@ exports.ContentTableSchema = ContentTableSchema;
|
|
|
437
430
|
exports.ContentVectorSchema = ContentVectorSchema;
|
|
438
431
|
exports.DecimalStringSchema = DecimalStringSchema;
|
|
439
432
|
exports.clampHeadingLevel = clampHeadingLevel;
|
|
433
|
+
exports.contentDocumentSharedFields = contentDocumentSharedFields;
|
|
440
434
|
exports.isContentBlock = isContentBlock;
|