document-model.js 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -6
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/construct-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-BN0PWqpt.d.cts → content-BmqzegMG.d.cts} +90 -2
- package/dist/{content-CiZf6Fqn.d.ts → content-CIwPb_yh.d.ts} +90 -2
- 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 +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/{package-node-DDPSNOvy.d.cts → package-node-C7RiYhyk.d.ts} +27 -9
- package/dist/{package-node-QVFHQcm8.d.ts → package-node-a9CyRaD3.d.cts} +27 -9
- 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 +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.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
|
@@ -390,7 +390,37 @@ const CONTENT_DEFS = {
|
|
|
390
390
|
],
|
|
391
391
|
additionalProperties: false
|
|
392
392
|
},
|
|
393
|
+
ContentConstructStart: {
|
|
394
|
+
type: "object",
|
|
395
|
+
properties: {
|
|
396
|
+
kind: {
|
|
397
|
+
type: "string",
|
|
398
|
+
const: "constructStart"
|
|
399
|
+
},
|
|
400
|
+
descriptor: { $ref: "#/$defs/ConstructDescriptor" }
|
|
401
|
+
},
|
|
402
|
+
required: ["kind", "descriptor"],
|
|
403
|
+
additionalProperties: false
|
|
404
|
+
},
|
|
405
|
+
ContentConstructEnd: {
|
|
406
|
+
type: "object",
|
|
407
|
+
properties: { kind: {
|
|
408
|
+
type: "string",
|
|
409
|
+
const: "constructEnd"
|
|
410
|
+
} },
|
|
411
|
+
required: ["kind"],
|
|
412
|
+
additionalProperties: false
|
|
413
|
+
},
|
|
393
414
|
ContentBlock: { oneOf: [
|
|
415
|
+
{ $ref: "#/$defs/ContentParagraph" },
|
|
416
|
+
{ $ref: "#/$defs/ContentTable" },
|
|
417
|
+
{ $ref: "#/$defs/ContentImageBlock" },
|
|
418
|
+
{ $ref: "#/$defs/ContentPageBreak" },
|
|
419
|
+
{ $ref: "#/$defs/ContentEmbeddedObjectBlock" },
|
|
420
|
+
{ $ref: "#/$defs/ContentConstructStart" },
|
|
421
|
+
{ $ref: "#/$defs/ContentConstructEnd" }
|
|
422
|
+
] },
|
|
423
|
+
PackageBlockLeaf: { oneOf: [
|
|
394
424
|
{ $ref: "#/$defs/ContentParagraph" },
|
|
395
425
|
{ $ref: "#/$defs/ContentTable" },
|
|
396
426
|
{ $ref: "#/$defs/ContentImageBlock" },
|
|
@@ -1267,7 +1297,8 @@ const CONTENT_DEFS = {
|
|
|
1267
1297
|
items: { oneOf: [
|
|
1268
1298
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1269
1299
|
{ $ref: "#/$defs/ListGroup" },
|
|
1270
|
-
{ $ref: "#/$defs/
|
|
1300
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1301
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1271
1302
|
] }
|
|
1272
1303
|
}
|
|
1273
1304
|
},
|
|
@@ -1284,7 +1315,8 @@ const CONTENT_DEFS = {
|
|
|
1284
1315
|
items: { oneOf: [
|
|
1285
1316
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1286
1317
|
{ $ref: "#/$defs/ListGroup" },
|
|
1287
|
-
{ $ref: "#/$defs/
|
|
1318
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1319
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1288
1320
|
] }
|
|
1289
1321
|
}
|
|
1290
1322
|
},
|
|
@@ -1298,7 +1330,11 @@ const CONTENT_DEFS = {
|
|
|
1298
1330
|
style: { type: "string" },
|
|
1299
1331
|
children: {
|
|
1300
1332
|
type: "array",
|
|
1301
|
-
items: { oneOf: [
|
|
1333
|
+
items: { oneOf: [
|
|
1334
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1335
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1336
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1337
|
+
] }
|
|
1302
1338
|
}
|
|
1303
1339
|
},
|
|
1304
1340
|
required: ["node", "children"],
|
|
@@ -1324,7 +1360,11 @@ const CONTENT_DEFS = {
|
|
|
1324
1360
|
style: { type: "string" },
|
|
1325
1361
|
children: {
|
|
1326
1362
|
type: "array",
|
|
1327
|
-
items: { oneOf: [
|
|
1363
|
+
items: { oneOf: [
|
|
1364
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1365
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1366
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1367
|
+
] }
|
|
1328
1368
|
}
|
|
1329
1369
|
},
|
|
1330
1370
|
required: ["node", "children"],
|
|
@@ -1356,6 +1396,218 @@ const CONTENT_DEFS = {
|
|
|
1356
1396
|
required: ["node", "children"],
|
|
1357
1397
|
additionalProperties: false
|
|
1358
1398
|
},
|
|
1399
|
+
SectionConstructGroup: {
|
|
1400
|
+
type: "object",
|
|
1401
|
+
properties: {
|
|
1402
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1403
|
+
style: { type: "string" },
|
|
1404
|
+
children: {
|
|
1405
|
+
type: "array",
|
|
1406
|
+
items: { oneOf: [
|
|
1407
|
+
{ $ref: "#/$defs/HeadingGroup" },
|
|
1408
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1409
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1410
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1411
|
+
] }
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
required: ["node", "children"],
|
|
1415
|
+
additionalProperties: false
|
|
1416
|
+
},
|
|
1417
|
+
ShapeConstructGroup: {
|
|
1418
|
+
type: "object",
|
|
1419
|
+
properties: {
|
|
1420
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1421
|
+
style: { type: "string" },
|
|
1422
|
+
children: {
|
|
1423
|
+
type: "array",
|
|
1424
|
+
items: { oneOf: [
|
|
1425
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1426
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1427
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1428
|
+
] }
|
|
1429
|
+
}
|
|
1430
|
+
},
|
|
1431
|
+
required: ["node", "children"],
|
|
1432
|
+
additionalProperties: false
|
|
1433
|
+
},
|
|
1434
|
+
ContentControlDescriptor: {
|
|
1435
|
+
type: "object",
|
|
1436
|
+
properties: {
|
|
1437
|
+
kind: {
|
|
1438
|
+
type: "string",
|
|
1439
|
+
const: "contentControl"
|
|
1440
|
+
},
|
|
1441
|
+
controlType: {
|
|
1442
|
+
type: "string",
|
|
1443
|
+
enum: [
|
|
1444
|
+
"richText",
|
|
1445
|
+
"plainText",
|
|
1446
|
+
"checkbox",
|
|
1447
|
+
"dropDown",
|
|
1448
|
+
"comboBox",
|
|
1449
|
+
"date",
|
|
1450
|
+
"picture",
|
|
1451
|
+
"repeatingSection",
|
|
1452
|
+
"button",
|
|
1453
|
+
"index",
|
|
1454
|
+
"group"
|
|
1455
|
+
]
|
|
1456
|
+
},
|
|
1457
|
+
tag: { type: "string" },
|
|
1458
|
+
alias: { type: "string" },
|
|
1459
|
+
lock: {
|
|
1460
|
+
type: "string",
|
|
1461
|
+
enum: [
|
|
1462
|
+
"content",
|
|
1463
|
+
"container",
|
|
1464
|
+
"both"
|
|
1465
|
+
]
|
|
1466
|
+
},
|
|
1467
|
+
value: { type: "string" },
|
|
1468
|
+
checked: { type: "boolean" },
|
|
1469
|
+
options: {
|
|
1470
|
+
type: "array",
|
|
1471
|
+
items: { type: "string" }
|
|
1472
|
+
}
|
|
1473
|
+
},
|
|
1474
|
+
required: ["kind", "controlType"],
|
|
1475
|
+
additionalProperties: false
|
|
1476
|
+
},
|
|
1477
|
+
FieldDescriptor: {
|
|
1478
|
+
type: "object",
|
|
1479
|
+
properties: {
|
|
1480
|
+
kind: {
|
|
1481
|
+
type: "string",
|
|
1482
|
+
const: "field"
|
|
1483
|
+
},
|
|
1484
|
+
instruction: { type: "string" },
|
|
1485
|
+
cachedResult: { type: "string" }
|
|
1486
|
+
},
|
|
1487
|
+
required: ["kind", "instruction"],
|
|
1488
|
+
additionalProperties: false
|
|
1489
|
+
},
|
|
1490
|
+
AnchorDescriptor: {
|
|
1491
|
+
type: "object",
|
|
1492
|
+
properties: {
|
|
1493
|
+
kind: {
|
|
1494
|
+
type: "string",
|
|
1495
|
+
const: "anchor"
|
|
1496
|
+
},
|
|
1497
|
+
anchorType: {
|
|
1498
|
+
type: "string",
|
|
1499
|
+
enum: [
|
|
1500
|
+
"bookmark",
|
|
1501
|
+
"footnote",
|
|
1502
|
+
"endnote",
|
|
1503
|
+
"comment"
|
|
1504
|
+
]
|
|
1505
|
+
},
|
|
1506
|
+
name: { type: "string" },
|
|
1507
|
+
definition: { type: "string" }
|
|
1508
|
+
},
|
|
1509
|
+
required: [
|
|
1510
|
+
"kind",
|
|
1511
|
+
"anchorType",
|
|
1512
|
+
"name"
|
|
1513
|
+
],
|
|
1514
|
+
additionalProperties: false
|
|
1515
|
+
},
|
|
1516
|
+
LinkTarget: { oneOf: [{
|
|
1517
|
+
type: "object",
|
|
1518
|
+
properties: {
|
|
1519
|
+
kind: {
|
|
1520
|
+
type: "string",
|
|
1521
|
+
const: "external"
|
|
1522
|
+
},
|
|
1523
|
+
uri: { type: "string" }
|
|
1524
|
+
},
|
|
1525
|
+
required: ["kind", "uri"],
|
|
1526
|
+
additionalProperties: false
|
|
1527
|
+
}, {
|
|
1528
|
+
type: "object",
|
|
1529
|
+
properties: {
|
|
1530
|
+
kind: {
|
|
1531
|
+
type: "string",
|
|
1532
|
+
const: "internal"
|
|
1533
|
+
},
|
|
1534
|
+
anchor: { type: "string" }
|
|
1535
|
+
},
|
|
1536
|
+
required: ["kind", "anchor"],
|
|
1537
|
+
additionalProperties: false
|
|
1538
|
+
}] },
|
|
1539
|
+
LinkDescriptor: {
|
|
1540
|
+
type: "object",
|
|
1541
|
+
properties: {
|
|
1542
|
+
kind: {
|
|
1543
|
+
type: "string",
|
|
1544
|
+
const: "link"
|
|
1545
|
+
},
|
|
1546
|
+
target: { $ref: "#/$defs/LinkTarget" },
|
|
1547
|
+
title: { type: "string" }
|
|
1548
|
+
},
|
|
1549
|
+
required: ["kind", "target"],
|
|
1550
|
+
additionalProperties: false
|
|
1551
|
+
},
|
|
1552
|
+
ProvenanceDescriptor: {
|
|
1553
|
+
type: "object",
|
|
1554
|
+
properties: {
|
|
1555
|
+
kind: {
|
|
1556
|
+
type: "string",
|
|
1557
|
+
const: "provenance"
|
|
1558
|
+
},
|
|
1559
|
+
change: {
|
|
1560
|
+
type: "string",
|
|
1561
|
+
enum: [
|
|
1562
|
+
"insertion",
|
|
1563
|
+
"deletion",
|
|
1564
|
+
"moveFrom",
|
|
1565
|
+
"moveTo",
|
|
1566
|
+
"formatChange"
|
|
1567
|
+
]
|
|
1568
|
+
},
|
|
1569
|
+
author: { type: "string" },
|
|
1570
|
+
dateIso: { type: "string" }
|
|
1571
|
+
},
|
|
1572
|
+
required: ["kind", "change"],
|
|
1573
|
+
additionalProperties: false
|
|
1574
|
+
},
|
|
1575
|
+
DivisionSource: {
|
|
1576
|
+
type: "object",
|
|
1577
|
+
properties: {
|
|
1578
|
+
href: { type: "string" },
|
|
1579
|
+
sectionName: { type: "string" }
|
|
1580
|
+
},
|
|
1581
|
+
required: ["href"],
|
|
1582
|
+
additionalProperties: false
|
|
1583
|
+
},
|
|
1584
|
+
DivisionDescriptor: {
|
|
1585
|
+
type: "object",
|
|
1586
|
+
properties: {
|
|
1587
|
+
kind: {
|
|
1588
|
+
type: "string",
|
|
1589
|
+
const: "division"
|
|
1590
|
+
},
|
|
1591
|
+
name: { type: "string" },
|
|
1592
|
+
columnCount: {
|
|
1593
|
+
type: "integer",
|
|
1594
|
+
exclusiveMinimum: 0,
|
|
1595
|
+
maximum: MAX_SAFE_INTEGER
|
|
1596
|
+
},
|
|
1597
|
+
protected: { type: "boolean" },
|
|
1598
|
+
source: { $ref: "#/$defs/DivisionSource" }
|
|
1599
|
+
},
|
|
1600
|
+
required: ["kind"],
|
|
1601
|
+
additionalProperties: false
|
|
1602
|
+
},
|
|
1603
|
+
ConstructDescriptor: { oneOf: [
|
|
1604
|
+
{ $ref: "#/$defs/ContentControlDescriptor" },
|
|
1605
|
+
{ $ref: "#/$defs/FieldDescriptor" },
|
|
1606
|
+
{ $ref: "#/$defs/AnchorDescriptor" },
|
|
1607
|
+
{ $ref: "#/$defs/LinkDescriptor" },
|
|
1608
|
+
{ $ref: "#/$defs/ProvenanceDescriptor" },
|
|
1609
|
+
{ $ref: "#/$defs/DivisionDescriptor" }
|
|
1610
|
+
] },
|
|
1359
1611
|
StyleParagraphProperties: {
|
|
1360
1612
|
type: "object",
|
|
1361
1613
|
properties: {
|
|
@@ -389,7 +389,37 @@ const CONTENT_DEFS = {
|
|
|
389
389
|
],
|
|
390
390
|
additionalProperties: false
|
|
391
391
|
},
|
|
392
|
+
ContentConstructStart: {
|
|
393
|
+
type: "object",
|
|
394
|
+
properties: {
|
|
395
|
+
kind: {
|
|
396
|
+
type: "string",
|
|
397
|
+
const: "constructStart"
|
|
398
|
+
},
|
|
399
|
+
descriptor: { $ref: "#/$defs/ConstructDescriptor" }
|
|
400
|
+
},
|
|
401
|
+
required: ["kind", "descriptor"],
|
|
402
|
+
additionalProperties: false
|
|
403
|
+
},
|
|
404
|
+
ContentConstructEnd: {
|
|
405
|
+
type: "object",
|
|
406
|
+
properties: { kind: {
|
|
407
|
+
type: "string",
|
|
408
|
+
const: "constructEnd"
|
|
409
|
+
} },
|
|
410
|
+
required: ["kind"],
|
|
411
|
+
additionalProperties: false
|
|
412
|
+
},
|
|
392
413
|
ContentBlock: { oneOf: [
|
|
414
|
+
{ $ref: "#/$defs/ContentParagraph" },
|
|
415
|
+
{ $ref: "#/$defs/ContentTable" },
|
|
416
|
+
{ $ref: "#/$defs/ContentImageBlock" },
|
|
417
|
+
{ $ref: "#/$defs/ContentPageBreak" },
|
|
418
|
+
{ $ref: "#/$defs/ContentEmbeddedObjectBlock" },
|
|
419
|
+
{ $ref: "#/$defs/ContentConstructStart" },
|
|
420
|
+
{ $ref: "#/$defs/ContentConstructEnd" }
|
|
421
|
+
] },
|
|
422
|
+
PackageBlockLeaf: { oneOf: [
|
|
393
423
|
{ $ref: "#/$defs/ContentParagraph" },
|
|
394
424
|
{ $ref: "#/$defs/ContentTable" },
|
|
395
425
|
{ $ref: "#/$defs/ContentImageBlock" },
|
|
@@ -1266,7 +1296,8 @@ const CONTENT_DEFS = {
|
|
|
1266
1296
|
items: { oneOf: [
|
|
1267
1297
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1268
1298
|
{ $ref: "#/$defs/ListGroup" },
|
|
1269
|
-
{ $ref: "#/$defs/
|
|
1299
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1300
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1270
1301
|
] }
|
|
1271
1302
|
}
|
|
1272
1303
|
},
|
|
@@ -1283,7 +1314,8 @@ const CONTENT_DEFS = {
|
|
|
1283
1314
|
items: { oneOf: [
|
|
1284
1315
|
{ $ref: "#/$defs/HeadingGroup" },
|
|
1285
1316
|
{ $ref: "#/$defs/ListGroup" },
|
|
1286
|
-
{ $ref: "#/$defs/
|
|
1317
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1318
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1287
1319
|
] }
|
|
1288
1320
|
}
|
|
1289
1321
|
},
|
|
@@ -1297,7 +1329,11 @@ const CONTENT_DEFS = {
|
|
|
1297
1329
|
style: { type: "string" },
|
|
1298
1330
|
children: {
|
|
1299
1331
|
type: "array",
|
|
1300
|
-
items: { oneOf: [
|
|
1332
|
+
items: { oneOf: [
|
|
1333
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1334
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1335
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1336
|
+
] }
|
|
1301
1337
|
}
|
|
1302
1338
|
},
|
|
1303
1339
|
required: ["node", "children"],
|
|
@@ -1323,7 +1359,11 @@ const CONTENT_DEFS = {
|
|
|
1323
1359
|
style: { type: "string" },
|
|
1324
1360
|
children: {
|
|
1325
1361
|
type: "array",
|
|
1326
|
-
items: { oneOf: [
|
|
1362
|
+
items: { oneOf: [
|
|
1363
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1364
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1365
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1366
|
+
] }
|
|
1327
1367
|
}
|
|
1328
1368
|
},
|
|
1329
1369
|
required: ["node", "children"],
|
|
@@ -1355,6 +1395,218 @@ const CONTENT_DEFS = {
|
|
|
1355
1395
|
required: ["node", "children"],
|
|
1356
1396
|
additionalProperties: false
|
|
1357
1397
|
},
|
|
1398
|
+
SectionConstructGroup: {
|
|
1399
|
+
type: "object",
|
|
1400
|
+
properties: {
|
|
1401
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1402
|
+
style: { type: "string" },
|
|
1403
|
+
children: {
|
|
1404
|
+
type: "array",
|
|
1405
|
+
items: { oneOf: [
|
|
1406
|
+
{ $ref: "#/$defs/HeadingGroup" },
|
|
1407
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1408
|
+
{ $ref: "#/$defs/SectionConstructGroup" },
|
|
1409
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1410
|
+
] }
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
required: ["node", "children"],
|
|
1414
|
+
additionalProperties: false
|
|
1415
|
+
},
|
|
1416
|
+
ShapeConstructGroup: {
|
|
1417
|
+
type: "object",
|
|
1418
|
+
properties: {
|
|
1419
|
+
node: { $ref: "#/$defs/ConstructDescriptor" },
|
|
1420
|
+
style: { type: "string" },
|
|
1421
|
+
children: {
|
|
1422
|
+
type: "array",
|
|
1423
|
+
items: { oneOf: [
|
|
1424
|
+
{ $ref: "#/$defs/ListGroup" },
|
|
1425
|
+
{ $ref: "#/$defs/ShapeConstructGroup" },
|
|
1426
|
+
{ $ref: "#/$defs/PackageBlockLeaf" }
|
|
1427
|
+
] }
|
|
1428
|
+
}
|
|
1429
|
+
},
|
|
1430
|
+
required: ["node", "children"],
|
|
1431
|
+
additionalProperties: false
|
|
1432
|
+
},
|
|
1433
|
+
ContentControlDescriptor: {
|
|
1434
|
+
type: "object",
|
|
1435
|
+
properties: {
|
|
1436
|
+
kind: {
|
|
1437
|
+
type: "string",
|
|
1438
|
+
const: "contentControl"
|
|
1439
|
+
},
|
|
1440
|
+
controlType: {
|
|
1441
|
+
type: "string",
|
|
1442
|
+
enum: [
|
|
1443
|
+
"richText",
|
|
1444
|
+
"plainText",
|
|
1445
|
+
"checkbox",
|
|
1446
|
+
"dropDown",
|
|
1447
|
+
"comboBox",
|
|
1448
|
+
"date",
|
|
1449
|
+
"picture",
|
|
1450
|
+
"repeatingSection",
|
|
1451
|
+
"button",
|
|
1452
|
+
"index",
|
|
1453
|
+
"group"
|
|
1454
|
+
]
|
|
1455
|
+
},
|
|
1456
|
+
tag: { type: "string" },
|
|
1457
|
+
alias: { type: "string" },
|
|
1458
|
+
lock: {
|
|
1459
|
+
type: "string",
|
|
1460
|
+
enum: [
|
|
1461
|
+
"content",
|
|
1462
|
+
"container",
|
|
1463
|
+
"both"
|
|
1464
|
+
]
|
|
1465
|
+
},
|
|
1466
|
+
value: { type: "string" },
|
|
1467
|
+
checked: { type: "boolean" },
|
|
1468
|
+
options: {
|
|
1469
|
+
type: "array",
|
|
1470
|
+
items: { type: "string" }
|
|
1471
|
+
}
|
|
1472
|
+
},
|
|
1473
|
+
required: ["kind", "controlType"],
|
|
1474
|
+
additionalProperties: false
|
|
1475
|
+
},
|
|
1476
|
+
FieldDescriptor: {
|
|
1477
|
+
type: "object",
|
|
1478
|
+
properties: {
|
|
1479
|
+
kind: {
|
|
1480
|
+
type: "string",
|
|
1481
|
+
const: "field"
|
|
1482
|
+
},
|
|
1483
|
+
instruction: { type: "string" },
|
|
1484
|
+
cachedResult: { type: "string" }
|
|
1485
|
+
},
|
|
1486
|
+
required: ["kind", "instruction"],
|
|
1487
|
+
additionalProperties: false
|
|
1488
|
+
},
|
|
1489
|
+
AnchorDescriptor: {
|
|
1490
|
+
type: "object",
|
|
1491
|
+
properties: {
|
|
1492
|
+
kind: {
|
|
1493
|
+
type: "string",
|
|
1494
|
+
const: "anchor"
|
|
1495
|
+
},
|
|
1496
|
+
anchorType: {
|
|
1497
|
+
type: "string",
|
|
1498
|
+
enum: [
|
|
1499
|
+
"bookmark",
|
|
1500
|
+
"footnote",
|
|
1501
|
+
"endnote",
|
|
1502
|
+
"comment"
|
|
1503
|
+
]
|
|
1504
|
+
},
|
|
1505
|
+
name: { type: "string" },
|
|
1506
|
+
definition: { type: "string" }
|
|
1507
|
+
},
|
|
1508
|
+
required: [
|
|
1509
|
+
"kind",
|
|
1510
|
+
"anchorType",
|
|
1511
|
+
"name"
|
|
1512
|
+
],
|
|
1513
|
+
additionalProperties: false
|
|
1514
|
+
},
|
|
1515
|
+
LinkTarget: { oneOf: [{
|
|
1516
|
+
type: "object",
|
|
1517
|
+
properties: {
|
|
1518
|
+
kind: {
|
|
1519
|
+
type: "string",
|
|
1520
|
+
const: "external"
|
|
1521
|
+
},
|
|
1522
|
+
uri: { type: "string" }
|
|
1523
|
+
},
|
|
1524
|
+
required: ["kind", "uri"],
|
|
1525
|
+
additionalProperties: false
|
|
1526
|
+
}, {
|
|
1527
|
+
type: "object",
|
|
1528
|
+
properties: {
|
|
1529
|
+
kind: {
|
|
1530
|
+
type: "string",
|
|
1531
|
+
const: "internal"
|
|
1532
|
+
},
|
|
1533
|
+
anchor: { type: "string" }
|
|
1534
|
+
},
|
|
1535
|
+
required: ["kind", "anchor"],
|
|
1536
|
+
additionalProperties: false
|
|
1537
|
+
}] },
|
|
1538
|
+
LinkDescriptor: {
|
|
1539
|
+
type: "object",
|
|
1540
|
+
properties: {
|
|
1541
|
+
kind: {
|
|
1542
|
+
type: "string",
|
|
1543
|
+
const: "link"
|
|
1544
|
+
},
|
|
1545
|
+
target: { $ref: "#/$defs/LinkTarget" },
|
|
1546
|
+
title: { type: "string" }
|
|
1547
|
+
},
|
|
1548
|
+
required: ["kind", "target"],
|
|
1549
|
+
additionalProperties: false
|
|
1550
|
+
},
|
|
1551
|
+
ProvenanceDescriptor: {
|
|
1552
|
+
type: "object",
|
|
1553
|
+
properties: {
|
|
1554
|
+
kind: {
|
|
1555
|
+
type: "string",
|
|
1556
|
+
const: "provenance"
|
|
1557
|
+
},
|
|
1558
|
+
change: {
|
|
1559
|
+
type: "string",
|
|
1560
|
+
enum: [
|
|
1561
|
+
"insertion",
|
|
1562
|
+
"deletion",
|
|
1563
|
+
"moveFrom",
|
|
1564
|
+
"moveTo",
|
|
1565
|
+
"formatChange"
|
|
1566
|
+
]
|
|
1567
|
+
},
|
|
1568
|
+
author: { type: "string" },
|
|
1569
|
+
dateIso: { type: "string" }
|
|
1570
|
+
},
|
|
1571
|
+
required: ["kind", "change"],
|
|
1572
|
+
additionalProperties: false
|
|
1573
|
+
},
|
|
1574
|
+
DivisionSource: {
|
|
1575
|
+
type: "object",
|
|
1576
|
+
properties: {
|
|
1577
|
+
href: { type: "string" },
|
|
1578
|
+
sectionName: { type: "string" }
|
|
1579
|
+
},
|
|
1580
|
+
required: ["href"],
|
|
1581
|
+
additionalProperties: false
|
|
1582
|
+
},
|
|
1583
|
+
DivisionDescriptor: {
|
|
1584
|
+
type: "object",
|
|
1585
|
+
properties: {
|
|
1586
|
+
kind: {
|
|
1587
|
+
type: "string",
|
|
1588
|
+
const: "division"
|
|
1589
|
+
},
|
|
1590
|
+
name: { type: "string" },
|
|
1591
|
+
columnCount: {
|
|
1592
|
+
type: "integer",
|
|
1593
|
+
exclusiveMinimum: 0,
|
|
1594
|
+
maximum: MAX_SAFE_INTEGER
|
|
1595
|
+
},
|
|
1596
|
+
protected: { type: "boolean" },
|
|
1597
|
+
source: { $ref: "#/$defs/DivisionSource" }
|
|
1598
|
+
},
|
|
1599
|
+
required: ["kind"],
|
|
1600
|
+
additionalProperties: false
|
|
1601
|
+
},
|
|
1602
|
+
ConstructDescriptor: { oneOf: [
|
|
1603
|
+
{ $ref: "#/$defs/ContentControlDescriptor" },
|
|
1604
|
+
{ $ref: "#/$defs/FieldDescriptor" },
|
|
1605
|
+
{ $ref: "#/$defs/AnchorDescriptor" },
|
|
1606
|
+
{ $ref: "#/$defs/LinkDescriptor" },
|
|
1607
|
+
{ $ref: "#/$defs/ProvenanceDescriptor" },
|
|
1608
|
+
{ $ref: "#/$defs/DivisionDescriptor" }
|
|
1609
|
+
] },
|
|
1358
1610
|
StyleParagraphProperties: {
|
|
1359
1611
|
type: "object",
|
|
1360
1612
|
properties: {
|
package/dist/content.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_color = require("./color.cjs");
|
|
3
|
+
const require_construct = require("./construct.cjs");
|
|
3
4
|
const require_math = require("./math.cjs");
|
|
4
5
|
const require_geometry = require("./geometry.cjs");
|
|
5
6
|
const require_mathml = require("./mathml.cjs");
|
|
@@ -57,6 +58,11 @@ const ContentPageBreakSchema = zod.z.object({
|
|
|
57
58
|
sourcePath: zod.z.string().optional(),
|
|
58
59
|
frames: zod.z.array(require_geometry.LayoutFrameSchema).optional()
|
|
59
60
|
});
|
|
61
|
+
const ContentConstructStartSchema = zod.z.object({
|
|
62
|
+
kind: zod.z.literal("constructStart"),
|
|
63
|
+
descriptor: require_construct.ConstructDescriptorSchema
|
|
64
|
+
});
|
|
65
|
+
const ContentConstructEndSchema = zod.z.object({ kind: zod.z.literal("constructEnd") });
|
|
60
66
|
function isRecord(value) {
|
|
61
67
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
62
68
|
}
|
|
@@ -78,6 +84,12 @@ function isContentEmbeddedObject(value) {
|
|
|
78
84
|
function isContentEmbeddedObjectBlock(value) {
|
|
79
85
|
return isRecord(value) && value.kind === "embeddedObject" && isContentEmbeddedObject(value);
|
|
80
86
|
}
|
|
87
|
+
function isContentConstructStart(value) {
|
|
88
|
+
return isRecord(value) && value.kind === "constructStart" && require_construct.ConstructDescriptorSchema.safeParse(value.descriptor).success;
|
|
89
|
+
}
|
|
90
|
+
function isContentConstructEnd(value) {
|
|
91
|
+
return isRecord(value) && value.kind === "constructEnd";
|
|
92
|
+
}
|
|
81
93
|
function isContentBlock(value) {
|
|
82
94
|
if (!isRecord(value)) return false;
|
|
83
95
|
const kind = value.kind;
|
|
@@ -86,11 +98,26 @@ function isContentBlock(value) {
|
|
|
86
98
|
if (kind === "pageBreak") return true;
|
|
87
99
|
if (kind === "table") return Array.isArray(value.rows) && value.rows.every(isContentTableRow) && Array.isArray(value.columnWidthsPt) && value.columnWidthsPt.every((w) => typeof w === "number");
|
|
88
100
|
if (kind === "embeddedObject") return isContentEmbeddedObject(value);
|
|
101
|
+
if (kind === "constructStart") return isContentConstructStart(value);
|
|
102
|
+
if (kind === "constructEnd") return true;
|
|
89
103
|
return false;
|
|
90
104
|
}
|
|
91
105
|
const ContentBlockSchema = zod.z.custom(isContentBlock);
|
|
92
106
|
const ContentEmbeddedObjectSchema = zod.z.custom(isContentEmbeddedObject);
|
|
93
107
|
const ContentEmbeddedObjectBlockSchema = zod.z.custom(isContentEmbeddedObjectBlock);
|
|
108
|
+
function findConstructMarkerImbalance(blocks) {
|
|
109
|
+
const openStartIndices = [];
|
|
110
|
+
for (const [index, block] of blocks.entries()) if (isContentConstructStart(block)) openStartIndices.push(index);
|
|
111
|
+
else if (isContentConstructEnd(block) && openStartIndices.pop() === void 0) return {
|
|
112
|
+
kind: "unmatchedEnd",
|
|
113
|
+
index
|
|
114
|
+
};
|
|
115
|
+
const outermostUnclosed = openStartIndices[0];
|
|
116
|
+
if (outermostUnclosed !== void 0) return {
|
|
117
|
+
kind: "unclosedStart",
|
|
118
|
+
index: outermostUnclosed
|
|
119
|
+
};
|
|
120
|
+
}
|
|
94
121
|
const ContentStrokeStyleSchema = zod.z.enum([
|
|
95
122
|
"solid",
|
|
96
123
|
"dashed",
|
|
@@ -397,6 +424,8 @@ exports.ContentBlockSchema = ContentBlockSchema;
|
|
|
397
424
|
exports.ContentBorderSchema = ContentBorderSchema;
|
|
398
425
|
exports.ContentCellBordersSchema = ContentCellBordersSchema;
|
|
399
426
|
exports.ContentCellValueSchema = ContentCellValueSchema;
|
|
427
|
+
exports.ContentConstructEndSchema = ContentConstructEndSchema;
|
|
428
|
+
exports.ContentConstructStartSchema = ContentConstructStartSchema;
|
|
400
429
|
exports.ContentDocumentSchema = ContentDocumentSchema;
|
|
401
430
|
exports.ContentDrawPageSchema = ContentDrawPageSchema;
|
|
402
431
|
exports.ContentEmbeddedObjectBlockSchema = ContentEmbeddedObjectBlockSchema;
|
|
@@ -431,4 +460,7 @@ exports.ContentVectorSchema = ContentVectorSchema;
|
|
|
431
460
|
exports.DecimalStringSchema = DecimalStringSchema;
|
|
432
461
|
exports.clampHeadingLevel = clampHeadingLevel;
|
|
433
462
|
exports.contentDocumentSharedFields = contentDocumentSharedFields;
|
|
463
|
+
exports.findConstructMarkerImbalance = findConstructMarkerImbalance;
|
|
434
464
|
exports.isContentBlock = isContentBlock;
|
|
465
|
+
exports.isContentConstructEnd = isContentConstructEnd;
|
|
466
|
+
exports.isContentConstructStart = isContentConstructStart;
|
package/dist/content.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFormula, ContentFormulaSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellComment, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, FusedNode, clampHeadingLevel, contentDocumentSharedFields, isContentBlock };
|
|
1
|
+
import { $ as ContentSheetPrintRangeSchema, A as ContentPageBreakSchema, At as isContentConstructEnd, B as ContentSectionSchema, C as ContentFormula, Ct as DecimalString, D as ContentListMembership, Dt as contentDocumentSharedFields, E as ContentImageBlockSchema, Et as clampHeadingLevel, F as ContentPathSegment, G as ContentSheetCellComment, H as ContentShapeSchema, I as ContentPathSegmentSchema, J as ContentSheetColumn, K as ContentSheetCellCommentSchema, L as ContentRun, M as ContentParagraphSchema, N as ContentPathPoint, O as ContentListMembershipSchema, Ot as findConstructMarkerImbalance, P as ContentPathPointSchema, Q as ContentSheetPrintRange, R as ContentRunSchema, S as ContentEmbeddedObjectSchema, St as ContentVectorSchema, T as ContentImageBlock, Tt as FusedNode, U as ContentSheet, V as ContentShape, W as ContentSheetCell, X as ContentSheetImage, Y as ContentSheetColumnSchema, Z as ContentSheetImageSchema, _ as ContentDrawPageSchema, _t as ContentTableCellSchema, a as ContentBorderSchema, at as ContentSheetRowSchema, b as ContentEmbeddedObjectBlockSchema, bt as ContentTableSchema, c as ContentCellValue, ct as ContentSlideSchema, d as ContentConstructEndSchema, dt as ContentStrokeStyle, et as ContentSheetPrintSettings, f as ContentConstructStart, ft as ContentStrokeStyleSchema, g as ContentDrawPage, gt as ContentTableCell, h as ContentDocumentSchema, ht as ContentTable, i as ContentBorder, it as ContentSheetRow, j as ContentParagraph, jt as isContentConstructStart, k as ContentPageBreak, kt as isContentBlock, l as ContentCellValueSchema, lt as ContentStroke, m as ContentDocument, mt as ContentSubpathSchema, n as ContentBlock, nt as ContentSheetRepeatRange, o as ContentCellBorders, ot as ContentSheetSchema, p as ContentConstructStartSchema, pt as ContentSubpath, q as ContentSheetCellSchema, r as ContentBlockSchema, rt as ContentSheetRepeatRangeSchema, s as ContentCellBordersSchema, st as ContentSlide, t as ConstructMarkerImbalance, tt as ContentSheetPrintSettingsSchema, u as ContentConstructEnd, ut as ContentStrokeSchema, v as ContentEmbeddedObject, vt as ContentTableRow, w as ContentFormulaSchema, wt as DecimalStringSchema, x as ContentEmbeddedObjectKind, xt as ContentVector, y as ContentEmbeddedObjectBlock, yt as ContentTableRowSchema, z as ContentSection } from "./content-BmqzegMG.cjs";
|
|
2
|
+
export { ConstructMarkerImbalance, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellValue, ContentCellValueSchema, ContentConstructEnd, ContentConstructEndSchema, ContentConstructStart, ContentConstructStartSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFormula, ContentFormulaSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellComment, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, FusedNode, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, isContentBlock, isContentConstructEnd, isContentConstructStart };
|