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.
Files changed (40) hide show
  1. package/README.md +95 -6
  2. package/dist/codec.d.cts +1 -1
  3. package/dist/codec.d.ts +1 -1
  4. package/dist/construct-CdQuI9f5.d.cts +204 -0
  5. package/dist/construct-CdQuI9f5.d.ts +204 -0
  6. package/dist/construct.cjs +106 -0
  7. package/dist/construct.d.cts +2 -0
  8. package/dist/construct.d.ts +2 -0
  9. package/dist/construct.js +93 -0
  10. package/dist/{content-BN0PWqpt.d.cts → content-BmqzegMG.d.cts} +90 -2
  11. package/dist/{content-CiZf6Fqn.d.ts → content-CIwPb_yh.d.ts} +90 -2
  12. package/dist/content-json-schema-defs.cjs +256 -4
  13. package/dist/content-json-schema-defs.js +256 -4
  14. package/dist/content.cjs +32 -0
  15. package/dist/content.d.cts +2 -2
  16. package/dist/content.d.ts +2 -2
  17. package/dist/content.js +28 -1
  18. package/dist/definitions.d.cts +1 -1
  19. package/dist/definitions.d.ts +1 -1
  20. package/dist/index.cjs +25 -0
  21. package/dist/index.d.cts +4 -3
  22. package/dist/index.d.ts +4 -3
  23. package/dist/index.js +4 -3
  24. package/dist/{package-node-DDPSNOvy.d.cts → package-node-C7RiYhyk.d.ts} +27 -9
  25. package/dist/{package-node-QVFHQcm8.d.ts → package-node-a9CyRaD3.d.cts} +27 -9
  26. package/dist/package-node.cjs +32 -12
  27. package/dist/package-node.d.cts +2 -2
  28. package/dist/package-node.d.ts +2 -2
  29. package/dist/package-node.js +28 -14
  30. package/dist/package.cjs +4 -1
  31. package/dist/package.d.cts +46 -1
  32. package/dist/package.d.ts +46 -1
  33. package/dist/package.js +4 -1
  34. package/dist/schema-io.cjs +2 -2
  35. package/dist/schema-io.d.cts +1 -1
  36. package/dist/schema-io.d.ts +1 -1
  37. package/dist/schema-io.js +2 -2
  38. package/package.json +1 -1
  39. package/schemas/content-document.schema.json +399 -7
  40. package/schemas/document-package.schema.json +534 -7
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@4.0.0/schemas/document-package.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@4.2.0/schemas/document-package.schema.json",
4
4
  "oneOf": [
5
5
  {
6
6
  "type": "object",
@@ -84,6 +84,33 @@
84
84
  "$ref": "#/$defs/DefinitionEntry"
85
85
  }
86
86
  },
87
+ "layers": {
88
+ "type": "object",
89
+ "propertyNames": {
90
+ "type": "string"
91
+ },
92
+ "additionalProperties": {
93
+ "$ref": "#/$defs/DefinitionEntry"
94
+ }
95
+ },
96
+ "attachments": {
97
+ "type": "object",
98
+ "propertyNames": {
99
+ "type": "string"
100
+ },
101
+ "additionalProperties": {
102
+ "$ref": "#/$defs/DefinitionEntry"
103
+ }
104
+ },
105
+ "destinations": {
106
+ "type": "object",
107
+ "propertyNames": {
108
+ "type": "string"
109
+ },
110
+ "additionalProperties": {
111
+ "$ref": "#/$defs/DefinitionEntry"
112
+ }
113
+ },
87
114
  "children": {
88
115
  "type": "array",
89
116
  "items": {
@@ -180,6 +207,33 @@
180
207
  "$ref": "#/$defs/DefinitionEntry"
181
208
  }
182
209
  },
210
+ "layers": {
211
+ "type": "object",
212
+ "propertyNames": {
213
+ "type": "string"
214
+ },
215
+ "additionalProperties": {
216
+ "$ref": "#/$defs/DefinitionEntry"
217
+ }
218
+ },
219
+ "attachments": {
220
+ "type": "object",
221
+ "propertyNames": {
222
+ "type": "string"
223
+ },
224
+ "additionalProperties": {
225
+ "$ref": "#/$defs/DefinitionEntry"
226
+ }
227
+ },
228
+ "destinations": {
229
+ "type": "object",
230
+ "propertyNames": {
231
+ "type": "string"
232
+ },
233
+ "additionalProperties": {
234
+ "$ref": "#/$defs/DefinitionEntry"
235
+ }
236
+ },
183
237
  "children": {
184
238
  "type": "array",
185
239
  "items": {
@@ -276,6 +330,33 @@
276
330
  "$ref": "#/$defs/DefinitionEntry"
277
331
  }
278
332
  },
333
+ "layers": {
334
+ "type": "object",
335
+ "propertyNames": {
336
+ "type": "string"
337
+ },
338
+ "additionalProperties": {
339
+ "$ref": "#/$defs/DefinitionEntry"
340
+ }
341
+ },
342
+ "attachments": {
343
+ "type": "object",
344
+ "propertyNames": {
345
+ "type": "string"
346
+ },
347
+ "additionalProperties": {
348
+ "$ref": "#/$defs/DefinitionEntry"
349
+ }
350
+ },
351
+ "destinations": {
352
+ "type": "object",
353
+ "propertyNames": {
354
+ "type": "string"
355
+ },
356
+ "additionalProperties": {
357
+ "$ref": "#/$defs/DefinitionEntry"
358
+ }
359
+ },
279
360
  "children": {
280
361
  "type": "array",
281
362
  "items": {
@@ -372,6 +453,33 @@
372
453
  "$ref": "#/$defs/DefinitionEntry"
373
454
  }
374
455
  },
456
+ "layers": {
457
+ "type": "object",
458
+ "propertyNames": {
459
+ "type": "string"
460
+ },
461
+ "additionalProperties": {
462
+ "$ref": "#/$defs/DefinitionEntry"
463
+ }
464
+ },
465
+ "attachments": {
466
+ "type": "object",
467
+ "propertyNames": {
468
+ "type": "string"
469
+ },
470
+ "additionalProperties": {
471
+ "$ref": "#/$defs/DefinitionEntry"
472
+ }
473
+ },
474
+ "destinations": {
475
+ "type": "object",
476
+ "propertyNames": {
477
+ "type": "string"
478
+ },
479
+ "additionalProperties": {
480
+ "$ref": "#/$defs/DefinitionEntry"
481
+ }
482
+ },
375
483
  "children": {
376
484
  "type": "array",
377
485
  "items": {
@@ -468,6 +576,33 @@
468
576
  "$ref": "#/$defs/DefinitionEntry"
469
577
  }
470
578
  },
579
+ "layers": {
580
+ "type": "object",
581
+ "propertyNames": {
582
+ "type": "string"
583
+ },
584
+ "additionalProperties": {
585
+ "$ref": "#/$defs/DefinitionEntry"
586
+ }
587
+ },
588
+ "attachments": {
589
+ "type": "object",
590
+ "propertyNames": {
591
+ "type": "string"
592
+ },
593
+ "additionalProperties": {
594
+ "$ref": "#/$defs/DefinitionEntry"
595
+ }
596
+ },
597
+ "destinations": {
598
+ "type": "object",
599
+ "propertyNames": {
600
+ "type": "string"
601
+ },
602
+ "additionalProperties": {
603
+ "$ref": "#/$defs/DefinitionEntry"
604
+ }
605
+ },
471
606
  "children": {
472
607
  "minItems": 1,
473
608
  "maxItems": 1,
@@ -931,7 +1066,7 @@
931
1066
  ]
932
1067
  },
933
1068
  "document": {
934
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.0.0/schemas/content-document.schema.json"
1069
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.2.0/schemas/content-document.schema.json"
935
1070
  },
936
1071
  "frame": {
937
1072
  "$ref": "#/$defs/Box"
@@ -970,7 +1105,62 @@
970
1105
  ],
971
1106
  "additionalProperties": false
972
1107
  },
1108
+ "ContentConstructStart": {
1109
+ "type": "object",
1110
+ "properties": {
1111
+ "kind": {
1112
+ "type": "string",
1113
+ "const": "constructStart"
1114
+ },
1115
+ "descriptor": {
1116
+ "$ref": "#/$defs/ConstructDescriptor"
1117
+ }
1118
+ },
1119
+ "required": [
1120
+ "kind",
1121
+ "descriptor"
1122
+ ],
1123
+ "additionalProperties": false
1124
+ },
1125
+ "ContentConstructEnd": {
1126
+ "type": "object",
1127
+ "properties": {
1128
+ "kind": {
1129
+ "type": "string",
1130
+ "const": "constructEnd"
1131
+ }
1132
+ },
1133
+ "required": [
1134
+ "kind"
1135
+ ],
1136
+ "additionalProperties": false
1137
+ },
973
1138
  "ContentBlock": {
1139
+ "oneOf": [
1140
+ {
1141
+ "$ref": "#/$defs/ContentParagraph"
1142
+ },
1143
+ {
1144
+ "$ref": "#/$defs/ContentTable"
1145
+ },
1146
+ {
1147
+ "$ref": "#/$defs/ContentImageBlock"
1148
+ },
1149
+ {
1150
+ "$ref": "#/$defs/ContentPageBreak"
1151
+ },
1152
+ {
1153
+ "$ref": "#/$defs/ContentEmbeddedObjectBlock"
1154
+ },
1155
+ {
1156
+ "$ref": "#/$defs/ContentConstructStart"
1157
+ },
1158
+ {
1159
+ "$ref": "#/$defs/ContentConstructEnd"
1160
+ }
1161
+ ]
1162
+ },
1163
+ "PackageBlockLeaf": {
974
1164
  "oneOf": [
975
1165
  {
976
1166
  "$ref": "#/$defs/ContentParagraph"
@@ -2151,7 +2341,7 @@
2151
2341
  ]
2152
2342
  },
2153
2343
  "document": {
2154
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.0.0/schemas/content-document.schema.json"
2344
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.2.0/schemas/content-document.schema.json"
2155
2345
  },
2156
2346
  "frame": {
2157
2347
  "$ref": "#/$defs/Box"
@@ -2200,7 +2390,10 @@
2200
2390
  "$ref": "#/$defs/ListGroup"
2201
2391
  },
2202
2392
  {
2203
- "$ref": "#/$defs/ContentBlock"
2393
+ "$ref": "#/$defs/SectionConstructGroup"
2394
+ },
2395
+ {
2396
+ "$ref": "#/$defs/PackageBlockLeaf"
2204
2397
  }
2205
2398
  ]
2206
2399
  }
@@ -2232,7 +2425,10 @@
2232
2425
  "$ref": "#/$defs/ListGroup"
2233
2426
  },
2234
2427
  {
2235
- "$ref": "#/$defs/ContentBlock"
2428
+ "$ref": "#/$defs/SectionConstructGroup"
2429
+ },
2430
+ {
2431
+ "$ref": "#/$defs/PackageBlockLeaf"
2236
2432
  }
2237
2433
  ]
2238
2434
  }
@@ -2261,7 +2457,10 @@
2261
2457
  "$ref": "#/$defs/ListGroup"
2262
2458
  },
2263
2459
  {
2264
- "$ref": "#/$defs/ContentBlock"
2460
+ "$ref": "#/$defs/ShapeConstructGroup"
2461
+ },
2462
+ {
2463
+ "$ref": "#/$defs/PackageBlockLeaf"
2265
2464
  }
2266
2465
  ]
2267
2466
  }
@@ -2312,7 +2511,10 @@
2312
2511
  "$ref": "#/$defs/ListGroup"
2313
2512
  },
2314
2513
  {
2315
- "$ref": "#/$defs/ContentBlock"
2514
+ "$ref": "#/$defs/ShapeConstructGroup"
2515
+ },
2516
+ {
2517
+ "$ref": "#/$defs/PackageBlockLeaf"
2316
2518
  }
2317
2519
  ]
2318
2520
  }
@@ -2382,6 +2584,331 @@
2382
2584
  ],
2383
2585
  "additionalProperties": false
2384
2586
  },
2587
+ "SectionConstructGroup": {
2588
+ "type": "object",
2589
+ "properties": {
2590
+ "node": {
2591
+ "$ref": "#/$defs/ConstructDescriptor"
2592
+ },
2593
+ "style": {
2594
+ "type": "string"
2595
+ },
2596
+ "children": {
2597
+ "type": "array",
2598
+ "items": {
2599
+ "oneOf": [
2600
+ {
2601
+ "$ref": "#/$defs/HeadingGroup"
2602
+ },
2603
+ {
2604
+ "$ref": "#/$defs/ListGroup"
2605
+ },
2606
+ {
2607
+ "$ref": "#/$defs/SectionConstructGroup"
2608
+ },
2609
+ {
2610
+ "$ref": "#/$defs/PackageBlockLeaf"
2611
+ }
2612
+ ]
2613
+ }
2614
+ }
2615
+ },
2616
+ "required": [
2617
+ "node",
2618
+ "children"
2619
+ ],
2620
+ "additionalProperties": false
2621
+ },
2622
+ "ShapeConstructGroup": {
2623
+ "type": "object",
2624
+ "properties": {
2625
+ "node": {
2626
+ "$ref": "#/$defs/ConstructDescriptor"
2627
+ },
2628
+ "style": {
2629
+ "type": "string"
2630
+ },
2631
+ "children": {
2632
+ "type": "array",
2633
+ "items": {
2634
+ "oneOf": [
2635
+ {
2636
+ "$ref": "#/$defs/ListGroup"
2637
+ },
2638
+ {
2639
+ "$ref": "#/$defs/ShapeConstructGroup"
2640
+ },
2641
+ {
2642
+ "$ref": "#/$defs/PackageBlockLeaf"
2643
+ }
2644
+ ]
2645
+ }
2646
+ }
2647
+ },
2648
+ "required": [
2649
+ "node",
2650
+ "children"
2651
+ ],
2652
+ "additionalProperties": false
2653
+ },
2654
+ "ContentControlDescriptor": {
2655
+ "type": "object",
2656
+ "properties": {
2657
+ "kind": {
2658
+ "type": "string",
2659
+ "const": "contentControl"
2660
+ },
2661
+ "controlType": {
2662
+ "type": "string",
2663
+ "enum": [
2664
+ "richText",
2665
+ "plainText",
2666
+ "checkbox",
2667
+ "dropDown",
2668
+ "comboBox",
2669
+ "date",
2670
+ "picture",
2671
+ "repeatingSection",
2672
+ "button",
2673
+ "index",
2674
+ "group"
2675
+ ]
2676
+ },
2677
+ "tag": {
2678
+ "type": "string"
2679
+ },
2680
+ "alias": {
2681
+ "type": "string"
2682
+ },
2683
+ "lock": {
2684
+ "type": "string",
2685
+ "enum": [
2686
+ "content",
2687
+ "container",
2688
+ "both"
2689
+ ]
2690
+ },
2691
+ "value": {
2692
+ "type": "string"
2693
+ },
2694
+ "checked": {
2695
+ "type": "boolean"
2696
+ },
2697
+ "options": {
2698
+ "type": "array",
2699
+ "items": {
2700
+ "type": "string"
2701
+ }
2702
+ }
2703
+ },
2704
+ "required": [
2705
+ "kind",
2706
+ "controlType"
2707
+ ],
2708
+ "additionalProperties": false
2709
+ },
2710
+ "FieldDescriptor": {
2711
+ "type": "object",
2712
+ "properties": {
2713
+ "kind": {
2714
+ "type": "string",
2715
+ "const": "field"
2716
+ },
2717
+ "instruction": {
2718
+ "type": "string"
2719
+ },
2720
+ "cachedResult": {
2721
+ "type": "string"
2722
+ }
2723
+ },
2724
+ "required": [
2725
+ "kind",
2726
+ "instruction"
2727
+ ],
2728
+ "additionalProperties": false
2729
+ },
2730
+ "AnchorDescriptor": {
2731
+ "type": "object",
2732
+ "properties": {
2733
+ "kind": {
2734
+ "type": "string",
2735
+ "const": "anchor"
2736
+ },
2737
+ "anchorType": {
2738
+ "type": "string",
2739
+ "enum": [
2740
+ "bookmark",
2741
+ "footnote",
2742
+ "endnote",
2743
+ "comment"
2744
+ ]
2745
+ },
2746
+ "name": {
2747
+ "type": "string"
2748
+ },
2749
+ "definition": {
2750
+ "type": "string"
2751
+ }
2752
+ },
2753
+ "required": [
2754
+ "kind",
2755
+ "anchorType",
2756
+ "name"
2757
+ ],
2758
+ "additionalProperties": false
2759
+ },
2760
+ "LinkTarget": {
2761
+ "oneOf": [
2762
+ {
2763
+ "type": "object",
2764
+ "properties": {
2765
+ "kind": {
2766
+ "type": "string",
2767
+ "const": "external"
2768
+ },
2769
+ "uri": {
2770
+ "type": "string"
2771
+ }
2772
+ },
2773
+ "required": [
2774
+ "kind",
2775
+ "uri"
2776
+ ],
2777
+ "additionalProperties": false
2778
+ },
2779
+ {
2780
+ "type": "object",
2781
+ "properties": {
2782
+ "kind": {
2783
+ "type": "string",
2784
+ "const": "internal"
2785
+ },
2786
+ "anchor": {
2787
+ "type": "string"
2788
+ }
2789
+ },
2790
+ "required": [
2791
+ "kind",
2792
+ "anchor"
2793
+ ],
2794
+ "additionalProperties": false
2795
+ }
2796
+ ]
2797
+ },
2798
+ "LinkDescriptor": {
2799
+ "type": "object",
2800
+ "properties": {
2801
+ "kind": {
2802
+ "type": "string",
2803
+ "const": "link"
2804
+ },
2805
+ "target": {
2806
+ "$ref": "#/$defs/LinkTarget"
2807
+ },
2808
+ "title": {
2809
+ "type": "string"
2810
+ }
2811
+ },
2812
+ "required": [
2813
+ "kind",
2814
+ "target"
2815
+ ],
2816
+ "additionalProperties": false
2817
+ },
2818
+ "ProvenanceDescriptor": {
2819
+ "type": "object",
2820
+ "properties": {
2821
+ "kind": {
2822
+ "type": "string",
2823
+ "const": "provenance"
2824
+ },
2825
+ "change": {
2826
+ "type": "string",
2827
+ "enum": [
2828
+ "insertion",
2829
+ "deletion",
2830
+ "moveFrom",
2831
+ "moveTo",
2832
+ "formatChange"
2833
+ ]
2834
+ },
2835
+ "author": {
2836
+ "type": "string"
2837
+ },
2838
+ "dateIso": {
2839
+ "type": "string"
2840
+ }
2841
+ },
2842
+ "required": [
2843
+ "kind",
2844
+ "change"
2845
+ ],
2846
+ "additionalProperties": false
2847
+ },
2848
+ "DivisionSource": {
2849
+ "type": "object",
2850
+ "properties": {
2851
+ "href": {
2852
+ "type": "string"
2853
+ },
2854
+ "sectionName": {
2855
+ "type": "string"
2856
+ }
2857
+ },
2858
+ "required": [
2859
+ "href"
2860
+ ],
2861
+ "additionalProperties": false
2862
+ },
2863
+ "DivisionDescriptor": {
2864
+ "type": "object",
2865
+ "properties": {
2866
+ "kind": {
2867
+ "type": "string",
2868
+ "const": "division"
2869
+ },
2870
+ "name": {
2871
+ "type": "string"
2872
+ },
2873
+ "columnCount": {
2874
+ "type": "integer",
2875
+ "exclusiveMinimum": 0,
2876
+ "maximum": 9007199254740991
2877
+ },
2878
+ "protected": {
2879
+ "type": "boolean"
2880
+ },
2881
+ "source": {
2882
+ "$ref": "#/$defs/DivisionSource"
2883
+ }
2884
+ },
2885
+ "required": [
2886
+ "kind"
2887
+ ],
2888
+ "additionalProperties": false
2889
+ },
2890
+ "ConstructDescriptor": {
2891
+ "oneOf": [
2892
+ {
2893
+ "$ref": "#/$defs/ContentControlDescriptor"
2894
+ },
2895
+ {
2896
+ "$ref": "#/$defs/FieldDescriptor"
2897
+ },
2898
+ {
2899
+ "$ref": "#/$defs/AnchorDescriptor"
2900
+ },
2901
+ {
2902
+ "$ref": "#/$defs/LinkDescriptor"
2903
+ },
2904
+ {
2905
+ "$ref": "#/$defs/ProvenanceDescriptor"
2906
+ },
2907
+ {
2908
+ "$ref": "#/$defs/DivisionDescriptor"
2909
+ }
2910
+ ]
2911
+ },
2385
2912
  "StyleParagraphProperties": {
2386
2913
  "type": "object",
2387
2914
  "properties": {