document-schema 4.0.0 → 4.1.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 +64 -4
- package/dist/construct-CdQuI9f5.d.cts +204 -0
- package/dist/construct-CdQuI9f5.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-json-schema-defs.cjs +224 -2
- package/dist/content-json-schema-defs.js +224 -2
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/{package-node-DDPSNOvy.d.cts → package-node-BiUEzIzl.d.cts} +22 -7
- package/dist/{package-node-QVFHQcm8.d.ts → package-node-DLUobcDQ.d.ts} +22 -7
- package/dist/package-node.cjs +24 -11
- package/dist/package-node.d.cts +2 -2
- package/dist/package-node.d.ts +2 -2
- package/dist/package-node.js +21 -12
- package/dist/package.cjs +4 -1
- package/dist/package.d.cts +46 -1
- package/dist/package.d.ts +46 -1
- package/dist/package.js +4 -1
- package/dist/schema-io.cjs +2 -2
- package/dist/schema-io.js +2 -2
- package/package.json +1 -1
- package/schemas/content-document.schema.json +340 -3
- package/schemas/document-package.schema.json +475 -3
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/construct.ts
|
|
3
|
+
const ContentControlTypeSchema = z.enum([
|
|
4
|
+
"richText",
|
|
5
|
+
"plainText",
|
|
6
|
+
"checkbox",
|
|
7
|
+
"dropDown",
|
|
8
|
+
"comboBox",
|
|
9
|
+
"date",
|
|
10
|
+
"picture",
|
|
11
|
+
"repeatingSection",
|
|
12
|
+
"button",
|
|
13
|
+
"index",
|
|
14
|
+
"group"
|
|
15
|
+
]);
|
|
16
|
+
const ContentControlLockSchema = z.enum([
|
|
17
|
+
"content",
|
|
18
|
+
"container",
|
|
19
|
+
"both"
|
|
20
|
+
]);
|
|
21
|
+
const ContentControlDescriptorSchema = z.strictObject({
|
|
22
|
+
kind: z.literal("contentControl"),
|
|
23
|
+
controlType: ContentControlTypeSchema,
|
|
24
|
+
tag: z.string().optional(),
|
|
25
|
+
alias: z.string().optional(),
|
|
26
|
+
lock: ContentControlLockSchema.optional(),
|
|
27
|
+
value: z.string().optional(),
|
|
28
|
+
checked: z.boolean().optional(),
|
|
29
|
+
options: z.array(z.string()).optional()
|
|
30
|
+
});
|
|
31
|
+
const FieldDescriptorSchema = z.strictObject({
|
|
32
|
+
kind: z.literal("field"),
|
|
33
|
+
instruction: z.string(),
|
|
34
|
+
cachedResult: z.string().optional()
|
|
35
|
+
});
|
|
36
|
+
const AnchorTypeSchema = z.enum([
|
|
37
|
+
"bookmark",
|
|
38
|
+
"footnote",
|
|
39
|
+
"endnote",
|
|
40
|
+
"comment"
|
|
41
|
+
]);
|
|
42
|
+
const AnchorDescriptorSchema = z.strictObject({
|
|
43
|
+
kind: z.literal("anchor"),
|
|
44
|
+
anchorType: AnchorTypeSchema,
|
|
45
|
+
name: z.string(),
|
|
46
|
+
definition: z.string().optional()
|
|
47
|
+
});
|
|
48
|
+
const LinkTargetSchema = z.discriminatedUnion("kind", [z.strictObject({
|
|
49
|
+
kind: z.literal("external"),
|
|
50
|
+
uri: z.string()
|
|
51
|
+
}), z.strictObject({
|
|
52
|
+
kind: z.literal("internal"),
|
|
53
|
+
anchor: z.string()
|
|
54
|
+
})]);
|
|
55
|
+
const LinkDescriptorSchema = z.strictObject({
|
|
56
|
+
kind: z.literal("link"),
|
|
57
|
+
target: LinkTargetSchema,
|
|
58
|
+
title: z.string().optional()
|
|
59
|
+
});
|
|
60
|
+
const ProvenanceChangeSchema = z.enum([
|
|
61
|
+
"insertion",
|
|
62
|
+
"deletion",
|
|
63
|
+
"moveFrom",
|
|
64
|
+
"moveTo",
|
|
65
|
+
"formatChange"
|
|
66
|
+
]);
|
|
67
|
+
const ProvenanceDescriptorSchema = z.strictObject({
|
|
68
|
+
kind: z.literal("provenance"),
|
|
69
|
+
change: ProvenanceChangeSchema,
|
|
70
|
+
author: z.string().optional(),
|
|
71
|
+
dateIso: z.string().optional()
|
|
72
|
+
});
|
|
73
|
+
const DivisionSourceSchema = z.strictObject({
|
|
74
|
+
href: z.string(),
|
|
75
|
+
sectionName: z.string().optional()
|
|
76
|
+
});
|
|
77
|
+
const DivisionDescriptorSchema = z.strictObject({
|
|
78
|
+
kind: z.literal("division"),
|
|
79
|
+
name: z.string().optional(),
|
|
80
|
+
columnCount: z.number().int().positive().optional(),
|
|
81
|
+
protected: z.boolean().optional(),
|
|
82
|
+
source: DivisionSourceSchema.optional()
|
|
83
|
+
});
|
|
84
|
+
const ConstructDescriptorSchema = z.discriminatedUnion("kind", [
|
|
85
|
+
ContentControlDescriptorSchema,
|
|
86
|
+
FieldDescriptorSchema,
|
|
87
|
+
AnchorDescriptorSchema,
|
|
88
|
+
LinkDescriptorSchema,
|
|
89
|
+
ProvenanceDescriptorSchema,
|
|
90
|
+
DivisionDescriptorSchema
|
|
91
|
+
]);
|
|
92
|
+
//#endregion
|
|
93
|
+
export { AnchorDescriptorSchema, AnchorTypeSchema, ConstructDescriptorSchema, ContentControlDescriptorSchema, ContentControlLockSchema, ContentControlTypeSchema, DivisionDescriptorSchema, DivisionSourceSchema, FieldDescriptorSchema, LinkDescriptorSchema, LinkTargetSchema, ProvenanceChangeSchema, ProvenanceDescriptorSchema };
|
|
@@ -1267,6 +1267,7 @@ const CONTENT_DEFS = {
|
|
|
1267
1267
|
items: { oneOf: [
|
|
1268
1268
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1269
1269
|
{ $ref: "#/$defs/ListGroup" },
|
|
1270
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1270
1271
|
{ $ref: "#/$defs/ContentBlock" }
|
|
1271
1272
|
] }
|
|
1272
1273
|
}
|
|
@@ -1284,6 +1285,7 @@ const CONTENT_DEFS = {
|
|
|
1284
1285
|
items: { oneOf: [
|
|
1285
1286
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1286
1287
|
{ $ref: "#/$defs/ListGroup" },
|
|
1288
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1287
1289
|
{ $ref: "#/$defs/ContentBlock" }
|
|
1288
1290
|
] }
|
|
1289
1291
|
}
|
|
@@ -1298,7 +1300,11 @@ const CONTENT_DEFS = {
|
|
|
1298
1300
|
style: { type: "string" },
|
|
1299
1301
|
children: {
|
|
1300
1302
|
type: "array",
|
|
1301
|
-
items: { oneOf: [
|
|
1303
|
+
items: { oneOf: [
|
|
1304
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1305
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1306
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1307
|
+
] }
|
|
1302
1308
|
}
|
|
1303
1309
|
},
|
|
1304
1310
|
required: ["node", "children"],
|
|
@@ -1324,7 +1330,11 @@ const CONTENT_DEFS = {
|
|
|
1324
1330
|
style: { type: "string" },
|
|
1325
1331
|
children: {
|
|
1326
1332
|
type: "array",
|
|
1327
|
-
items: { oneOf: [
|
|
1333
|
+
items: { oneOf: [
|
|
1334
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1335
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1336
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1337
|
+
] }
|
|
1328
1338
|
}
|
|
1329
1339
|
},
|
|
1330
1340
|
required: ["node", "children"],
|
|
@@ -1356,6 +1366,218 @@ const CONTENT_DEFS = {
|
|
|
1356
1366
|
required: ["node", "children"],
|
|
1357
1367
|
additionalProperties: false
|
|
1358
1368
|
},
|
|
1369
|
+
SectionConstructGroup: {
|
|
1370
|
+
type: "object",
|
|
1371
|
+
properties: {
|
|
1372
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1373
|
+
style: { type: "string" },
|
|
1374
|
+
children: {
|
|
1375
|
+
type: "array",
|
|
1376
|
+
items: { oneOf: [
|
|
1377
|
+
{ $ref: "#/$defs/HeadingGroup" },
|
|
1378
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1379
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1380
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1381
|
+
] }
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
required: ["node", "children"],
|
|
1385
|
+
additionalProperties: false
|
|
1386
|
+
},
|
|
1387
|
+
ShapeConstructGroup: {
|
|
1388
|
+
type: "object",
|
|
1389
|
+
properties: {
|
|
1390
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1391
|
+
style: { type: "string" },
|
|
1392
|
+
children: {
|
|
1393
|
+
type: "array",
|
|
1394
|
+
items: { oneOf: [
|
|
1395
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1396
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1397
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1398
|
+
] }
|
|
1399
|
+
}
|
|
1400
|
+
},
|
|
1401
|
+
required: ["node", "children"],
|
|
1402
|
+
additionalProperties: false
|
|
1403
|
+
},
|
|
1404
|
+
ContentControlDescriptor: {
|
|
1405
|
+
type: "object",
|
|
1406
|
+
properties: {
|
|
1407
|
+
kind: {
|
|
1408
|
+
type: "string",
|
|
1409
|
+
const: "contentControl"
|
|
1410
|
+
},
|
|
1411
|
+
controlType: {
|
|
1412
|
+
type: "string",
|
|
1413
|
+
enum: [
|
|
1414
|
+
"richText",
|
|
1415
|
+
"plainText",
|
|
1416
|
+
"checkbox",
|
|
1417
|
+
"dropDown",
|
|
1418
|
+
"comboBox",
|
|
1419
|
+
"date",
|
|
1420
|
+
"picture",
|
|
1421
|
+
"repeatingSection",
|
|
1422
|
+
"button",
|
|
1423
|
+
"index",
|
|
1424
|
+
"group"
|
|
1425
|
+
]
|
|
1426
|
+
},
|
|
1427
|
+
tag: { type: "string" },
|
|
1428
|
+
alias: { type: "string" },
|
|
1429
|
+
lock: {
|
|
1430
|
+
type: "string",
|
|
1431
|
+
enum: [
|
|
1432
|
+
"content",
|
|
1433
|
+
"container",
|
|
1434
|
+
"both"
|
|
1435
|
+
]
|
|
1436
|
+
},
|
|
1437
|
+
value: { type: "string" },
|
|
1438
|
+
checked: { type: "boolean" },
|
|
1439
|
+
options: {
|
|
1440
|
+
type: "array",
|
|
1441
|
+
items: { type: "string" }
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1444
|
+
required: ["kind", "controlType"],
|
|
1445
|
+
additionalProperties: false
|
|
1446
|
+
},
|
|
1447
|
+
FieldDescriptor: {
|
|
1448
|
+
type: "object",
|
|
1449
|
+
properties: {
|
|
1450
|
+
kind: {
|
|
1451
|
+
type: "string",
|
|
1452
|
+
const: "field"
|
|
1453
|
+
},
|
|
1454
|
+
instruction: { type: "string" },
|
|
1455
|
+
cachedResult: { type: "string" }
|
|
1456
|
+
},
|
|
1457
|
+
required: ["kind", "instruction"],
|
|
1458
|
+
additionalProperties: false
|
|
1459
|
+
},
|
|
1460
|
+
AnchorDescriptor: {
|
|
1461
|
+
type: "object",
|
|
1462
|
+
properties: {
|
|
1463
|
+
kind: {
|
|
1464
|
+
type: "string",
|
|
1465
|
+
const: "anchor"
|
|
1466
|
+
},
|
|
1467
|
+
anchorType: {
|
|
1468
|
+
type: "string",
|
|
1469
|
+
enum: [
|
|
1470
|
+
"bookmark",
|
|
1471
|
+
"footnote",
|
|
1472
|
+
"endnote",
|
|
1473
|
+
"comment"
|
|
1474
|
+
]
|
|
1475
|
+
},
|
|
1476
|
+
name: { type: "string" },
|
|
1477
|
+
definition: { type: "string" }
|
|
1478
|
+
},
|
|
1479
|
+
required: [
|
|
1480
|
+
"kind",
|
|
1481
|
+
"anchorType",
|
|
1482
|
+
"name"
|
|
1483
|
+
],
|
|
1484
|
+
additionalProperties: false
|
|
1485
|
+
},
|
|
1486
|
+
LinkTarget: { oneOf: [{
|
|
1487
|
+
type: "object",
|
|
1488
|
+
properties: {
|
|
1489
|
+
kind: {
|
|
1490
|
+
type: "string",
|
|
1491
|
+
const: "external"
|
|
1492
|
+
},
|
|
1493
|
+
uri: { type: "string" }
|
|
1494
|
+
},
|
|
1495
|
+
required: ["kind", "uri"],
|
|
1496
|
+
additionalProperties: false
|
|
1497
|
+
}, {
|
|
1498
|
+
type: "object",
|
|
1499
|
+
properties: {
|
|
1500
|
+
kind: {
|
|
1501
|
+
type: "string",
|
|
1502
|
+
const: "internal"
|
|
1503
|
+
},
|
|
1504
|
+
anchor: { type: "string" }
|
|
1505
|
+
},
|
|
1506
|
+
required: ["kind", "anchor"],
|
|
1507
|
+
additionalProperties: false
|
|
1508
|
+
}] },
|
|
1509
|
+
LinkDescriptor: {
|
|
1510
|
+
type: "object",
|
|
1511
|
+
properties: {
|
|
1512
|
+
kind: {
|
|
1513
|
+
type: "string",
|
|
1514
|
+
const: "link"
|
|
1515
|
+
},
|
|
1516
|
+
target: { $ref: "#/$defs/LinkTarget" },
|
|
1517
|
+
title: { type: "string" }
|
|
1518
|
+
},
|
|
1519
|
+
required: ["kind", "target"],
|
|
1520
|
+
additionalProperties: false
|
|
1521
|
+
},
|
|
1522
|
+
ProvenanceDescriptor: {
|
|
1523
|
+
type: "object",
|
|
1524
|
+
properties: {
|
|
1525
|
+
kind: {
|
|
1526
|
+
type: "string",
|
|
1527
|
+
const: "provenance"
|
|
1528
|
+
},
|
|
1529
|
+
change: {
|
|
1530
|
+
type: "string",
|
|
1531
|
+
enum: [
|
|
1532
|
+
"insertion",
|
|
1533
|
+
"deletion",
|
|
1534
|
+
"moveFrom",
|
|
1535
|
+
"moveTo",
|
|
1536
|
+
"formatChange"
|
|
1537
|
+
]
|
|
1538
|
+
},
|
|
1539
|
+
author: { type: "string" },
|
|
1540
|
+
dateIso: { type: "string" }
|
|
1541
|
+
},
|
|
1542
|
+
required: ["kind", "change"],
|
|
1543
|
+
additionalProperties: false
|
|
1544
|
+
},
|
|
1545
|
+
DivisionSource: {
|
|
1546
|
+
type: "object",
|
|
1547
|
+
properties: {
|
|
1548
|
+
href: { type: "string" },
|
|
1549
|
+
sectionName: { type: "string" }
|
|
1550
|
+
},
|
|
1551
|
+
required: ["href"],
|
|
1552
|
+
additionalProperties: false
|
|
1553
|
+
},
|
|
1554
|
+
DivisionDescriptor: {
|
|
1555
|
+
type: "object",
|
|
1556
|
+
properties: {
|
|
1557
|
+
kind: {
|
|
1558
|
+
type: "string",
|
|
1559
|
+
const: "division"
|
|
1560
|
+
},
|
|
1561
|
+
name: { type: "string" },
|
|
1562
|
+
columnCount: {
|
|
1563
|
+
type: "integer",
|
|
1564
|
+
exclusiveMinimum: 0,
|
|
1565
|
+
maximum: MAX_SAFE_INTEGER
|
|
1566
|
+
},
|
|
1567
|
+
protected: { type: "boolean" },
|
|
1568
|
+
source: { $ref: "#/$defs/DivisionSource" }
|
|
1569
|
+
},
|
|
1570
|
+
required: ["kind"],
|
|
1571
|
+
additionalProperties: false
|
|
1572
|
+
},
|
|
1573
|
+
ConstructDescriptor: { oneOf: [
|
|
1574
|
+
{ $ref: "#/$defs/ContentControlDescriptor" },
|
|
1575
|
+
{ $ref: "#/$defs/FieldDescriptor" },
|
|
1576
|
+
{ $ref: "#/$defs/AnchorDescriptor" },
|
|
1577
|
+
{ $ref: "#/$defs/LinkDescriptor" },
|
|
1578
|
+
{ $ref: "#/$defs/ProvenanceDescriptor" },
|
|
1579
|
+
{ $ref: "#/$defs/DivisionDescriptor" }
|
|
1580
|
+
] },
|
|
1359
1581
|
StyleParagraphProperties: {
|
|
1360
1582
|
type: "object",
|
|
1361
1583
|
properties: {
|
|
@@ -1266,6 +1266,7 @@ const CONTENT_DEFS = {
|
|
|
1266
1266
|
items: { oneOf: [
|
|
1267
1267
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1268
1268
|
{ $ref: "#/$defs/ListGroup" },
|
|
1269
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1269
1270
|
{ $ref: "#/$defs/ContentBlock" }
|
|
1270
1271
|
] }
|
|
1271
1272
|
}
|
|
@@ -1283,6 +1284,7 @@ const CONTENT_DEFS = {
|
|
|
1283
1284
|
items: { oneOf: [
|
|
1284
1285
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1285
1286
|
{ $ref: "#/$defs/ListGroup" },
|
|
1287
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1286
1288
|
{ $ref: "#/$defs/ContentBlock" }
|
|
1287
1289
|
] }
|
|
1288
1290
|
}
|
|
@@ -1297,7 +1299,11 @@ const CONTENT_DEFS = {
|
|
|
1297
1299
|
style: { type: "string" },
|
|
1298
1300
|
children: {
|
|
1299
1301
|
type: "array",
|
|
1300
|
-
items: { oneOf: [
|
|
1302
|
+
items: { oneOf: [
|
|
1303
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1304
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1305
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1306
|
+
] }
|
|
1301
1307
|
}
|
|
1302
1308
|
},
|
|
1303
1309
|
required: ["node", "children"],
|
|
@@ -1323,7 +1329,11 @@ const CONTENT_DEFS = {
|
|
|
1323
1329
|
style: { type: "string" },
|
|
1324
1330
|
children: {
|
|
1325
1331
|
type: "array",
|
|
1326
|
-
items: { oneOf: [
|
|
1332
|
+
items: { oneOf: [
|
|
1333
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1334
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1335
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1336
|
+
] }
|
|
1327
1337
|
}
|
|
1328
1338
|
},
|
|
1329
1339
|
required: ["node", "children"],
|
|
@@ -1355,6 +1365,218 @@ const CONTENT_DEFS = {
|
|
|
1355
1365
|
required: ["node", "children"],
|
|
1356
1366
|
additionalProperties: false
|
|
1357
1367
|
},
|
|
1368
|
+
SectionConstructGroup: {
|
|
1369
|
+
type: "object",
|
|
1370
|
+
properties: {
|
|
1371
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1372
|
+
style: { type: "string" },
|
|
1373
|
+
children: {
|
|
1374
|
+
type: "array",
|
|
1375
|
+
items: { oneOf: [
|
|
1376
|
+
{ $ref: "#/$defs/HeadingGroup" },
|
|
1377
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1378
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1379
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1380
|
+
] }
|
|
1381
|
+
}
|
|
1382
|
+
},
|
|
1383
|
+
required: ["node", "children"],
|
|
1384
|
+
additionalProperties: false
|
|
1385
|
+
},
|
|
1386
|
+
ShapeConstructGroup: {
|
|
1387
|
+
type: "object",
|
|
1388
|
+
properties: {
|
|
1389
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1390
|
+
style: { type: "string" },
|
|
1391
|
+
children: {
|
|
1392
|
+
type: "array",
|
|
1393
|
+
items: { oneOf: [
|
|
1394
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1395
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1396
|
+
{ $ref: "#/$defs/ContentBlock" }
|
|
1397
|
+
] }
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
required: ["node", "children"],
|
|
1401
|
+
additionalProperties: false
|
|
1402
|
+
},
|
|
1403
|
+
ContentControlDescriptor: {
|
|
1404
|
+
type: "object",
|
|
1405
|
+
properties: {
|
|
1406
|
+
kind: {
|
|
1407
|
+
type: "string",
|
|
1408
|
+
const: "contentControl"
|
|
1409
|
+
},
|
|
1410
|
+
controlType: {
|
|
1411
|
+
type: "string",
|
|
1412
|
+
enum: [
|
|
1413
|
+
"richText",
|
|
1414
|
+
"plainText",
|
|
1415
|
+
"checkbox",
|
|
1416
|
+
"dropDown",
|
|
1417
|
+
"comboBox",
|
|
1418
|
+
"date",
|
|
1419
|
+
"picture",
|
|
1420
|
+
"repeatingSection",
|
|
1421
|
+
"button",
|
|
1422
|
+
"index",
|
|
1423
|
+
"group"
|
|
1424
|
+
]
|
|
1425
|
+
},
|
|
1426
|
+
tag: { type: "string" },
|
|
1427
|
+
alias: { type: "string" },
|
|
1428
|
+
lock: {
|
|
1429
|
+
type: "string",
|
|
1430
|
+
enum: [
|
|
1431
|
+
"content",
|
|
1432
|
+
"container",
|
|
1433
|
+
"both"
|
|
1434
|
+
]
|
|
1435
|
+
},
|
|
1436
|
+
value: { type: "string" },
|
|
1437
|
+
checked: { type: "boolean" },
|
|
1438
|
+
options: {
|
|
1439
|
+
type: "array",
|
|
1440
|
+
items: { type: "string" }
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1443
|
+
required: ["kind", "controlType"],
|
|
1444
|
+
additionalProperties: false
|
|
1445
|
+
},
|
|
1446
|
+
FieldDescriptor: {
|
|
1447
|
+
type: "object",
|
|
1448
|
+
properties: {
|
|
1449
|
+
kind: {
|
|
1450
|
+
type: "string",
|
|
1451
|
+
const: "field"
|
|
1452
|
+
},
|
|
1453
|
+
instruction: { type: "string" },
|
|
1454
|
+
cachedResult: { type: "string" }
|
|
1455
|
+
},
|
|
1456
|
+
required: ["kind", "instruction"],
|
|
1457
|
+
additionalProperties: false
|
|
1458
|
+
},
|
|
1459
|
+
AnchorDescriptor: {
|
|
1460
|
+
type: "object",
|
|
1461
|
+
properties: {
|
|
1462
|
+
kind: {
|
|
1463
|
+
type: "string",
|
|
1464
|
+
const: "anchor"
|
|
1465
|
+
},
|
|
1466
|
+
anchorType: {
|
|
1467
|
+
type: "string",
|
|
1468
|
+
enum: [
|
|
1469
|
+
"bookmark",
|
|
1470
|
+
"footnote",
|
|
1471
|
+
"endnote",
|
|
1472
|
+
"comment"
|
|
1473
|
+
]
|
|
1474
|
+
},
|
|
1475
|
+
name: { type: "string" },
|
|
1476
|
+
definition: { type: "string" }
|
|
1477
|
+
},
|
|
1478
|
+
required: [
|
|
1479
|
+
"kind",
|
|
1480
|
+
"anchorType",
|
|
1481
|
+
"name"
|
|
1482
|
+
],
|
|
1483
|
+
additionalProperties: false
|
|
1484
|
+
},
|
|
1485
|
+
LinkTarget: { oneOf: [{
|
|
1486
|
+
type: "object",
|
|
1487
|
+
properties: {
|
|
1488
|
+
kind: {
|
|
1489
|
+
type: "string",
|
|
1490
|
+
const: "external"
|
|
1491
|
+
},
|
|
1492
|
+
uri: { type: "string" }
|
|
1493
|
+
},
|
|
1494
|
+
required: ["kind", "uri"],
|
|
1495
|
+
additionalProperties: false
|
|
1496
|
+
}, {
|
|
1497
|
+
type: "object",
|
|
1498
|
+
properties: {
|
|
1499
|
+
kind: {
|
|
1500
|
+
type: "string",
|
|
1501
|
+
const: "internal"
|
|
1502
|
+
},
|
|
1503
|
+
anchor: { type: "string" }
|
|
1504
|
+
},
|
|
1505
|
+
required: ["kind", "anchor"],
|
|
1506
|
+
additionalProperties: false
|
|
1507
|
+
}] },
|
|
1508
|
+
LinkDescriptor: {
|
|
1509
|
+
type: "object",
|
|
1510
|
+
properties: {
|
|
1511
|
+
kind: {
|
|
1512
|
+
type: "string",
|
|
1513
|
+
const: "link"
|
|
1514
|
+
},
|
|
1515
|
+
target: { $ref: "#/$defs/LinkTarget" },
|
|
1516
|
+
title: { type: "string" }
|
|
1517
|
+
},
|
|
1518
|
+
required: ["kind", "target"],
|
|
1519
|
+
additionalProperties: false
|
|
1520
|
+
},
|
|
1521
|
+
ProvenanceDescriptor: {
|
|
1522
|
+
type: "object",
|
|
1523
|
+
properties: {
|
|
1524
|
+
kind: {
|
|
1525
|
+
type: "string",
|
|
1526
|
+
const: "provenance"
|
|
1527
|
+
},
|
|
1528
|
+
change: {
|
|
1529
|
+
type: "string",
|
|
1530
|
+
enum: [
|
|
1531
|
+
"insertion",
|
|
1532
|
+
"deletion",
|
|
1533
|
+
"moveFrom",
|
|
1534
|
+
"moveTo",
|
|
1535
|
+
"formatChange"
|
|
1536
|
+
]
|
|
1537
|
+
},
|
|
1538
|
+
author: { type: "string" },
|
|
1539
|
+
dateIso: { type: "string" }
|
|
1540
|
+
},
|
|
1541
|
+
required: ["kind", "change"],
|
|
1542
|
+
additionalProperties: false
|
|
1543
|
+
},
|
|
1544
|
+
DivisionSource: {
|
|
1545
|
+
type: "object",
|
|
1546
|
+
properties: {
|
|
1547
|
+
href: { type: "string" },
|
|
1548
|
+
sectionName: { type: "string" }
|
|
1549
|
+
},
|
|
1550
|
+
required: ["href"],
|
|
1551
|
+
additionalProperties: false
|
|
1552
|
+
},
|
|
1553
|
+
DivisionDescriptor: {
|
|
1554
|
+
type: "object",
|
|
1555
|
+
properties: {
|
|
1556
|
+
kind: {
|
|
1557
|
+
type: "string",
|
|
1558
|
+
const: "division"
|
|
1559
|
+
},
|
|
1560
|
+
name: { type: "string" },
|
|
1561
|
+
columnCount: {
|
|
1562
|
+
type: "integer",
|
|
1563
|
+
exclusiveMinimum: 0,
|
|
1564
|
+
maximum: MAX_SAFE_INTEGER
|
|
1565
|
+
},
|
|
1566
|
+
protected: { type: "boolean" },
|
|
1567
|
+
source: { $ref: "#/$defs/DivisionSource" }
|
|
1568
|
+
},
|
|
1569
|
+
required: ["kind"],
|
|
1570
|
+
additionalProperties: false
|
|
1571
|
+
},
|
|
1572
|
+
ConstructDescriptor: { oneOf: [
|
|
1573
|
+
{ $ref: "#/$defs/ContentControlDescriptor" },
|
|
1574
|
+
{ $ref: "#/$defs/FieldDescriptor" },
|
|
1575
|
+
{ $ref: "#/$defs/AnchorDescriptor" },
|
|
1576
|
+
{ $ref: "#/$defs/LinkDescriptor" },
|
|
1577
|
+
{ $ref: "#/$defs/ProvenanceDescriptor" },
|
|
1578
|
+
{ $ref: "#/$defs/DivisionDescriptor" }
|
|
1579
|
+
] },
|
|
1358
1580
|
StyleParagraphProperties: {
|
|
1359
1581
|
type: "object",
|
|
1360
1582
|
properties: {
|
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_a1 = require("./a1.cjs");
|
|
3
3
|
require("./codec.cjs");
|
|
4
4
|
const require_color = require("./color.cjs");
|
|
5
|
+
const require_construct = require("./construct.cjs");
|
|
5
6
|
const require_math = require("./math.cjs");
|
|
6
7
|
const require_geometry = require("./geometry.cjs");
|
|
7
8
|
const require_mathml = require("./mathml.cjs");
|
|
@@ -17,15 +18,21 @@ require("./font-port.cjs");
|
|
|
17
18
|
require("./text-layout.cjs");
|
|
18
19
|
require("./math-layout.cjs");
|
|
19
20
|
exports.AlignmentSchema = require_style.AlignmentSchema;
|
|
21
|
+
exports.AnchorDescriptorSchema = require_construct.AnchorDescriptorSchema;
|
|
22
|
+
exports.AnchorTypeSchema = require_construct.AnchorTypeSchema;
|
|
20
23
|
exports.BoxSchema = require_geometry.BoxSchema;
|
|
21
24
|
exports.COLOR_BLACK = require_color.COLOR_BLACK;
|
|
22
25
|
exports.CONTENT_DEFS = require_content_json_schema_defs.CONTENT_DEFS;
|
|
23
26
|
exports.CONTENT_DOCUMENT_URI = require_content_json_schema_defs.CONTENT_DOCUMENT_URI;
|
|
24
27
|
exports.ColorSchema = require_color.ColorSchema;
|
|
28
|
+
exports.ConstructDescriptorSchema = require_construct.ConstructDescriptorSchema;
|
|
25
29
|
exports.ContentBlockSchema = require_content.ContentBlockSchema;
|
|
26
30
|
exports.ContentBorderSchema = require_content.ContentBorderSchema;
|
|
27
31
|
exports.ContentCellBordersSchema = require_content.ContentCellBordersSchema;
|
|
28
32
|
exports.ContentCellValueSchema = require_content.ContentCellValueSchema;
|
|
33
|
+
exports.ContentControlDescriptorSchema = require_construct.ContentControlDescriptorSchema;
|
|
34
|
+
exports.ContentControlLockSchema = require_construct.ContentControlLockSchema;
|
|
35
|
+
exports.ContentControlTypeSchema = require_construct.ContentControlTypeSchema;
|
|
29
36
|
exports.ContentDocumentSchema = require_content.ContentDocumentSchema;
|
|
30
37
|
exports.ContentDrawPageSchema = require_content.ContentDrawPageSchema;
|
|
31
38
|
exports.ContentEmbeddedObjectBlockSchema = require_content.ContentEmbeddedObjectBlockSchema;
|
|
@@ -62,17 +69,22 @@ exports.DecimalStringSchema = require_content.DecimalStringSchema;
|
|
|
62
69
|
exports.DefinitionEntrySchema = require_definitions.DefinitionEntrySchema;
|
|
63
70
|
exports.DefinitionsTableSchema = require_definitions.DefinitionsTableSchema;
|
|
64
71
|
exports.DimensionVectorSchema = require_math.DimensionVectorSchema;
|
|
72
|
+
exports.DivisionDescriptorSchema = require_construct.DivisionDescriptorSchema;
|
|
73
|
+
exports.DivisionSourceSchema = require_construct.DivisionSourceSchema;
|
|
65
74
|
exports.DocumentPackageSchema = require_package.DocumentPackageSchema;
|
|
66
75
|
exports.DrawPageDescriptorSchema = require_package_node.DrawPageDescriptorSchema;
|
|
67
76
|
exports.DrawPageGroupSchema = require_package_node.DrawPageGroupSchema;
|
|
68
77
|
exports.EMBEDDED_OBJECT_KINDS = require_content_json_schema_defs.EMBEDDED_OBJECT_KINDS;
|
|
69
78
|
exports.ExactRationalSchema = require_math.ExactRationalSchema;
|
|
79
|
+
exports.FieldDescriptorSchema = require_construct.FieldDescriptorSchema;
|
|
70
80
|
exports.HeadingGroupSchema = require_package_node.HeadingGroupSchema;
|
|
71
81
|
exports.HeadingParagraphSchema = require_package_node.HeadingParagraphSchema;
|
|
72
82
|
exports.LayoutFontSchema = require_style.LayoutFontSchema;
|
|
73
83
|
exports.LayoutFrameSchema = require_geometry.LayoutFrameSchema;
|
|
74
84
|
exports.LayoutMetadataSchema = require_metadata.LayoutMetadataSchema;
|
|
75
85
|
exports.LayoutSchemaDemotedError = require_schema_io.LayoutSchemaDemotedError;
|
|
86
|
+
exports.LinkDescriptorSchema = require_construct.LinkDescriptorSchema;
|
|
87
|
+
exports.LinkTargetSchema = require_construct.LinkTargetSchema;
|
|
76
88
|
exports.ListGroupSchema = require_package_node.ListGroupSchema;
|
|
77
89
|
exports.ListParagraphSchema = require_package_node.ListParagraphSchema;
|
|
78
90
|
exports.MAX_SAFE_INTEGER = require_content_json_schema_defs.MAX_SAFE_INTEGER;
|
|
@@ -106,13 +118,17 @@ exports.PackageGroupSchema = require_package_node.PackageGroupSchema;
|
|
|
106
118
|
exports.PackageLeafSchema = require_package_node.PackageLeafSchema;
|
|
107
119
|
exports.PackageNodeSchema = require_package_node.PackageNodeSchema;
|
|
108
120
|
exports.PageSizeSchema = require_geometry.PageSizeSchema;
|
|
121
|
+
exports.ProvenanceChangeSchema = require_construct.ProvenanceChangeSchema;
|
|
122
|
+
exports.ProvenanceDescriptorSchema = require_construct.ProvenanceDescriptorSchema;
|
|
109
123
|
exports.SCHEMA_FILE_NAMES = require_schema_io.SCHEMA_FILE_NAMES;
|
|
110
124
|
exports.SI_BASE_DIMENSIONS = require_math.SI_BASE_DIMENSIONS;
|
|
111
125
|
exports.SLIDE_SIZE_STANDARD = require_geometry.SLIDE_SIZE_STANDARD;
|
|
112
126
|
exports.SLIDE_SIZE_WIDESCREEN = require_geometry.SLIDE_SIZE_WIDESCREEN;
|
|
113
127
|
exports.SchemaVersionMismatchError = require_schema_io.SchemaVersionMismatchError;
|
|
128
|
+
exports.SectionConstructGroupSchema = require_package_node.SectionConstructGroupSchema;
|
|
114
129
|
exports.SectionDescriptorSchema = require_package_node.SectionDescriptorSchema;
|
|
115
130
|
exports.SectionGroupSchema = require_package_node.SectionGroupSchema;
|
|
131
|
+
exports.ShapeConstructGroupSchema = require_package_node.ShapeConstructGroupSchema;
|
|
116
132
|
exports.ShapeDescriptorSchema = require_package_node.ShapeDescriptorSchema;
|
|
117
133
|
exports.ShapeGroupSchema = require_package_node.ShapeGroupSchema;
|
|
118
134
|
exports.SheetDescriptorSchema = require_package_node.SheetDescriptorSchema;
|
|
@@ -146,7 +162,9 @@ exports.isMathMlNode = require_mathml.isMathMlNode;
|
|
|
146
162
|
exports.isPackageGroup = require_package_node.isPackageGroup;
|
|
147
163
|
exports.isPackageLeaf = require_package_node.isPackageLeaf;
|
|
148
164
|
exports.isPackageNode = require_package_node.isPackageNode;
|
|
165
|
+
exports.isSectionConstructGroupNode = require_package_node.isSectionConstructGroupNode;
|
|
149
166
|
exports.isSectionGroupNode = require_package_node.isSectionGroupNode;
|
|
167
|
+
exports.isShapeConstructGroupNode = require_package_node.isShapeConstructGroupNode;
|
|
150
168
|
exports.isShapeGroupNode = require_package_node.isShapeGroupNode;
|
|
151
169
|
exports.isSheetGroupNode = require_package_node.isSheetGroupNode;
|
|
152
170
|
exports.isSlideGroupNode = require_package_node.isSlideGroupNode;
|