docx 7.6.0 → 7.8.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 (90) hide show
  1. package/README.md +3 -2
  2. package/build/file/core-properties/properties.d.ts +2 -0
  3. package/build/file/document/document.d.ts +1 -1
  4. package/build/file/drawing/doc-properties/doc-properties.d.ts +6 -1
  5. package/build/file/drawing/drawing.d.ts +2 -0
  6. package/build/file/drawing/inline/inline.d.ts +8 -1
  7. package/build/file/index.d.ts +0 -1
  8. package/build/file/numbering/level.d.ts +57 -8
  9. package/build/file/paragraph/formatting/alignment.d.ts +8 -3
  10. package/build/file/paragraph/formatting/spacing.d.ts +1 -0
  11. package/build/file/paragraph/formatting/width.d.ts +0 -0
  12. package/build/file/paragraph/formatting/word-wrap.d.ts +11 -0
  13. package/build/file/paragraph/frame/frame-properties.d.ts +1 -1
  14. package/build/file/paragraph/math/math-component.d.ts +1 -1
  15. package/build/file/paragraph/paragraph.d.ts +1 -1
  16. package/build/file/paragraph/properties.d.ts +2 -0
  17. package/build/file/paragraph/run/image-run.d.ts +2 -0
  18. package/build/file/paragraph/run/properties.d.ts +3 -2
  19. package/build/file/paragraph/run/run-components/text.d.ts +7 -1
  20. package/build/file/paragraph/run/run.d.ts +2 -1
  21. package/build/file/paragraph/run/text-attributes.d.ts +1 -1
  22. package/build/file/paragraph/run/underline.d.ts +2 -1
  23. package/build/file/relationships/relationship/relationship.d.ts +1 -1
  24. package/build/file/settings/compatibility.d.ts +65 -1
  25. package/build/file/settings/settings.d.ts +3 -1
  26. package/build/file/shared/index.d.ts +1 -0
  27. package/build/file/{space-type.d.ts → shared/space-type.d.ts} +0 -0
  28. package/build/file/table/table-properties/index.d.ts +0 -1
  29. package/build/file/table/table-properties/table-float-properties.d.ts +4 -1
  30. package/build/file/xml-components/default-attributes.d.ts +1 -1
  31. package/build/file/xml-components/simple-elements.d.ts +3 -0
  32. package/build/index.js +1 -1
  33. package/package.json +6 -6
  34. package/src/file/core-properties/properties.ts +2 -0
  35. package/src/file/document/document.ts +4 -2
  36. package/src/file/drawing/anchor/anchor.spec.ts +244 -1
  37. package/src/file/drawing/anchor/anchor.ts +1 -1
  38. package/src/file/drawing/doc-properties/doc-properties.ts +27 -6
  39. package/src/file/drawing/drawing.spec.ts +12 -0
  40. package/src/file/drawing/drawing.ts +8 -1
  41. package/src/file/drawing/inline/inline.ts +9 -3
  42. package/src/file/file.ts +3 -2
  43. package/src/file/index.ts +0 -1
  44. package/src/file/numbering/abstract-numbering.spec.ts +1999 -87
  45. package/src/file/numbering/concrete-numbering.spec.ts +21 -5
  46. package/src/file/numbering/level.ts +126 -8
  47. package/src/file/paragraph/formatting/alignment.ts +37 -2
  48. package/src/file/paragraph/formatting/spacing.ts +1 -0
  49. package/src/file/paragraph/formatting/width.ts +0 -0
  50. package/src/file/paragraph/formatting/word-wrap.spec.ts +20 -0
  51. package/src/file/paragraph/formatting/word-wrap.ts +14 -0
  52. package/src/file/paragraph/links/pageref-field-instruction.ts +1 -1
  53. package/src/file/paragraph/paragraph.spec.ts +2 -1
  54. package/src/file/paragraph/properties.spec.ts +19 -0
  55. package/src/file/paragraph/properties.ts +7 -0
  56. package/src/file/paragraph/run/comment-run.spec.ts +43 -0
  57. package/src/file/paragraph/run/image-run.spec.ts +6 -0
  58. package/src/file/paragraph/run/image-run.ts +10 -7
  59. package/src/file/paragraph/run/page-number.ts +1 -1
  60. package/src/file/paragraph/run/properties.ts +26 -3
  61. package/src/file/paragraph/run/run-components/text.spec.ts +22 -0
  62. package/src/file/paragraph/run/run-components/text.ts +24 -4
  63. package/src/file/paragraph/run/run.spec.ts +53 -8
  64. package/src/file/paragraph/run/run.ts +2 -6
  65. package/src/file/paragraph/run/sequential-identifier-instruction.ts +1 -1
  66. package/src/file/paragraph/run/tab.ts +1 -0
  67. package/src/file/paragraph/run/text-attributes.ts +1 -1
  68. package/src/file/paragraph/run/underline.ts +1 -0
  69. package/src/file/settings/compatibility.spec.ts +729 -3
  70. package/src/file/settings/compatibility.ts +390 -5
  71. package/src/file/settings/settings.spec.ts +75 -0
  72. package/src/file/settings/settings.ts +5 -3
  73. package/src/file/shared/index.ts +1 -0
  74. package/src/file/{space-type.ts → shared/space-type.ts} +0 -0
  75. package/src/file/table/table-properties/index.ts +0 -1
  76. package/src/file/table/table-properties/table-float-properties.spec.ts +7 -2
  77. package/src/file/table/table-properties/table-float-properties.ts +16 -4
  78. package/src/file/table-of-contents/field-instruction.ts +1 -1
  79. package/src/file/table-of-contents/sdt-properties.ts +2 -3
  80. package/src/file/track-revision/track-revision-components/deleted-page-number.ts +1 -1
  81. package/src/file/track-revision/track-revision-components/deleted-text.ts +1 -1
  82. package/src/file/xml-components/imported-xml-component.spec.ts +25 -1
  83. package/src/file/xml-components/simple-elements.ts +7 -0
  84. package/build/file/drawing/doc-properties/doc-properties-attributes.d.ts +0 -12
  85. package/build/file/table/table-properties/table-overlap.d.ts +0 -8
  86. package/build/file/table-of-contents/alias.d.ts +0 -4
  87. package/src/file/drawing/doc-properties/doc-properties-attributes.ts +0 -13
  88. package/src/file/table/table-properties/table-overlap.spec.ts +0 -22
  89. package/src/file/table/table-properties/table-overlap.ts +0 -26
  90. package/src/file/table-of-contents/alias.ts +0 -12
@@ -1,7 +1,6 @@
1
1
  import { expect } from "chai";
2
2
 
3
3
  import { Formatter } from "@export/formatter";
4
- import { EMPTY_OBJECT } from "@file/xml-components";
5
4
 
6
5
  import { AlignmentType, EmphasisMarkType, TabStopPosition } from "../paragraph";
7
6
  import { UnderlineType } from "../paragraph/run/underline";
@@ -26,11 +25,61 @@ describe("AbstractNumbering", () => {
26
25
  },
27
26
  ]);
28
27
  const tree = new Formatter().format(abstractNumbering);
29
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ _attr: { "w:ilvl": 3, "w15:tentative": 1 } });
30
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:start": { _attr: { "w:val": 1 } } });
31
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:lvlJc": { _attr: { "w:val": "end" } } });
32
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:numFmt": { _attr: { "w:val": LevelFormat.LOWER_LETTER } } });
33
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:lvlText": { _attr: { "w:val": "%1)" } } });
28
+ expect(tree).to.deep.equal({
29
+ "w:abstractNum": [
30
+ {
31
+ _attr: {
32
+ "w15:restartNumberingAfterBreak": 0,
33
+ "w:abstractNumId": 1,
34
+ },
35
+ },
36
+ {
37
+ "w:multiLevelType": {
38
+ _attr: {
39
+ "w:val": "hybridMultilevel",
40
+ },
41
+ },
42
+ },
43
+ {
44
+ "w:lvl": [
45
+ {
46
+ "w:start": {
47
+ _attr: {
48
+ "w:val": 1,
49
+ },
50
+ },
51
+ },
52
+ {
53
+ "w:numFmt": {
54
+ _attr: {
55
+ "w:val": LevelFormat.LOWER_LETTER,
56
+ },
57
+ },
58
+ },
59
+ {
60
+ "w:lvlText": {
61
+ _attr: {
62
+ "w:val": "%1)",
63
+ },
64
+ },
65
+ },
66
+ {
67
+ "w:lvlJc": {
68
+ _attr: {
69
+ "w:val": "end",
70
+ },
71
+ },
72
+ },
73
+ {
74
+ _attr: {
75
+ "w15:tentative": 1,
76
+ "w:ilvl": 3,
77
+ },
78
+ },
79
+ ],
80
+ },
81
+ ],
82
+ });
34
83
  });
35
84
 
36
85
  it("uses 'start' as the default alignment", () => {
@@ -42,11 +91,61 @@ describe("AbstractNumbering", () => {
42
91
  },
43
92
  ]);
44
93
  const tree = new Formatter().format(abstractNumbering);
45
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ _attr: { "w:ilvl": 3, "w15:tentative": 1 } });
46
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:start": { _attr: { "w:val": 1 } } });
47
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:lvlJc": { _attr: { "w:val": "start" } } });
48
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:numFmt": { _attr: { "w:val": LevelFormat.LOWER_LETTER } } });
49
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:lvlText": { _attr: { "w:val": "%1)" } } });
94
+ expect(tree).to.deep.equal({
95
+ "w:abstractNum": [
96
+ {
97
+ _attr: {
98
+ "w15:restartNumberingAfterBreak": 0,
99
+ "w:abstractNumId": 1,
100
+ },
101
+ },
102
+ {
103
+ "w:multiLevelType": {
104
+ _attr: {
105
+ "w:val": "hybridMultilevel",
106
+ },
107
+ },
108
+ },
109
+ {
110
+ "w:lvl": [
111
+ {
112
+ "w:start": {
113
+ _attr: {
114
+ "w:val": 1,
115
+ },
116
+ },
117
+ },
118
+ {
119
+ "w:numFmt": {
120
+ _attr: {
121
+ "w:val": LevelFormat.LOWER_LETTER,
122
+ },
123
+ },
124
+ },
125
+ {
126
+ "w:lvlText": {
127
+ _attr: {
128
+ "w:val": "%1)",
129
+ },
130
+ },
131
+ },
132
+ {
133
+ "w:lvlJc": {
134
+ _attr: {
135
+ "w:val": "start",
136
+ },
137
+ },
138
+ },
139
+ {
140
+ _attr: {
141
+ "w15:tentative": 1,
142
+ "w:ilvl": 3,
143
+ },
144
+ },
145
+ ],
146
+ },
147
+ ],
148
+ });
50
149
  });
51
150
 
52
151
  it("has suffix", () => {
@@ -60,7 +159,69 @@ describe("AbstractNumbering", () => {
60
159
  },
61
160
  ]);
62
161
  const tree = new Formatter().format(abstractNumbering);
63
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:suff": { _attr: { "w:val": "space" } } });
162
+ expect(tree).to.deep.equal({
163
+ "w:abstractNum": [
164
+ {
165
+ _attr: {
166
+ "w15:restartNumberingAfterBreak": 0,
167
+ "w:abstractNumId": 1,
168
+ },
169
+ },
170
+ {
171
+ "w:multiLevelType": {
172
+ _attr: {
173
+ "w:val": "hybridMultilevel",
174
+ },
175
+ },
176
+ },
177
+ {
178
+ "w:lvl": [
179
+ {
180
+ "w:start": {
181
+ _attr: {
182
+ "w:val": 1,
183
+ },
184
+ },
185
+ },
186
+ {
187
+ "w:numFmt": {
188
+ _attr: {
189
+ "w:val": "lowerLetter",
190
+ },
191
+ },
192
+ },
193
+ {
194
+ "w:suff": {
195
+ _attr: {
196
+ "w:val": "space",
197
+ },
198
+ },
199
+ },
200
+ {
201
+ "w:lvlText": {
202
+ _attr: {
203
+ "w:val": "%1)",
204
+ },
205
+ },
206
+ },
207
+ {
208
+ "w:lvlJc": {
209
+ _attr: {
210
+ "w:val": "end",
211
+ },
212
+ },
213
+ },
214
+ {
215
+ _attr: {
216
+ "w15:tentative": 1,
217
+ "w:ilvl": 3,
218
+ },
219
+ },
220
+ ],
221
+ },
222
+ ],
223
+ });
224
+ // expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:suff": { _attr: { "w:val": "space" } } });
64
225
  });
65
226
 
66
227
  describe("formatting methods: paragraph properties", () => {
@@ -78,8 +239,71 @@ describe("AbstractNumbering", () => {
78
239
  },
79
240
  ]);
80
241
  const tree = new Formatter().format(abstractNumbering);
81
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
82
- "w:pPr": [{ "w:ind": { _attr: { "w:left": 720 } } }],
242
+ expect(tree).to.deep.equal({
243
+ "w:abstractNum": [
244
+ {
245
+ _attr: {
246
+ "w15:restartNumberingAfterBreak": 0,
247
+ "w:abstractNumId": 1,
248
+ },
249
+ },
250
+ {
251
+ "w:multiLevelType": {
252
+ _attr: {
253
+ "w:val": "hybridMultilevel",
254
+ },
255
+ },
256
+ },
257
+ {
258
+ "w:lvl": [
259
+ {
260
+ "w:start": {
261
+ _attr: {
262
+ "w:val": 1,
263
+ },
264
+ },
265
+ },
266
+ {
267
+ "w:numFmt": {
268
+ _attr: {
269
+ "w:val": "lowerRoman",
270
+ },
271
+ },
272
+ },
273
+ {
274
+ "w:lvlText": {
275
+ _attr: {
276
+ "w:val": "%0.",
277
+ },
278
+ },
279
+ },
280
+ {
281
+ "w:lvlJc": {
282
+ _attr: {
283
+ "w:val": "start",
284
+ },
285
+ },
286
+ },
287
+ {
288
+ "w:pPr": [
289
+ {
290
+ "w:ind": {
291
+ _attr: {
292
+ "w:left": 720,
293
+ },
294
+ },
295
+ },
296
+ ],
297
+ },
298
+ {
299
+ _attr: {
300
+ "w15:tentative": 1,
301
+ "w:ilvl": 0,
302
+ },
303
+ },
304
+ ],
305
+ },
306
+ ],
83
307
  });
84
308
  });
85
309
 
@@ -97,8 +321,72 @@ describe("AbstractNumbering", () => {
97
321
  },
98
322
  ]);
99
323
  const tree = new Formatter().format(abstractNumbering);
100
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
101
- "w:pPr": [{ "w:spacing": { _attr: { "w:before": 50, "w:after": 150 } } }],
324
+ expect(tree).to.deep.equal({
325
+ "w:abstractNum": [
326
+ {
327
+ _attr: {
328
+ "w15:restartNumberingAfterBreak": 0,
329
+ "w:abstractNumId": 1,
330
+ },
331
+ },
332
+ {
333
+ "w:multiLevelType": {
334
+ _attr: {
335
+ "w:val": "hybridMultilevel",
336
+ },
337
+ },
338
+ },
339
+ {
340
+ "w:lvl": [
341
+ {
342
+ "w:start": {
343
+ _attr: {
344
+ "w:val": 1,
345
+ },
346
+ },
347
+ },
348
+ {
349
+ "w:numFmt": {
350
+ _attr: {
351
+ "w:val": "lowerRoman",
352
+ },
353
+ },
354
+ },
355
+ {
356
+ "w:lvlText": {
357
+ _attr: {
358
+ "w:val": "%0.",
359
+ },
360
+ },
361
+ },
362
+ {
363
+ "w:lvlJc": {
364
+ _attr: {
365
+ "w:val": "start",
366
+ },
367
+ },
368
+ },
369
+ {
370
+ "w:pPr": [
371
+ {
372
+ "w:spacing": {
373
+ _attr: {
374
+ "w:after": 150,
375
+ "w:before": 50,
376
+ },
377
+ },
378
+ },
379
+ ],
380
+ },
381
+ {
382
+ _attr: {
383
+ "w15:tentative": 1,
384
+ "w:ilvl": 0,
385
+ },
386
+ },
387
+ ],
388
+ },
389
+ ],
102
390
  });
103
391
  });
104
392
 
@@ -116,8 +404,71 @@ describe("AbstractNumbering", () => {
116
404
  },
117
405
  ]);
118
406
  const tree = new Formatter().format(abstractNumbering);
119
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
120
- "w:pPr": [{ "w:jc": { _attr: { "w:val": "center" } } }],
407
+ expect(tree).to.deep.equal({
408
+ "w:abstractNum": [
409
+ {
410
+ _attr: {
411
+ "w15:restartNumberingAfterBreak": 0,
412
+ "w:abstractNumId": 1,
413
+ },
414
+ },
415
+ {
416
+ "w:multiLevelType": {
417
+ _attr: {
418
+ "w:val": "hybridMultilevel",
419
+ },
420
+ },
421
+ },
422
+ {
423
+ "w:lvl": [
424
+ {
425
+ "w:start": {
426
+ _attr: {
427
+ "w:val": 1,
428
+ },
429
+ },
430
+ },
431
+ {
432
+ "w:numFmt": {
433
+ _attr: {
434
+ "w:val": "lowerRoman",
435
+ },
436
+ },
437
+ },
438
+ {
439
+ "w:lvlText": {
440
+ _attr: {
441
+ "w:val": "%0.",
442
+ },
443
+ },
444
+ },
445
+ {
446
+ "w:lvlJc": {
447
+ _attr: {
448
+ "w:val": "start",
449
+ },
450
+ },
451
+ },
452
+ {
453
+ "w:pPr": [
454
+ {
455
+ "w:jc": {
456
+ _attr: {
457
+ "w:val": "center",
458
+ },
459
+ },
460
+ },
461
+ ],
462
+ },
463
+ {
464
+ _attr: {
465
+ "w15:tentative": 1,
466
+ "w:ilvl": 0,
467
+ },
468
+ },
469
+ ],
470
+ },
471
+ ],
121
472
  });
122
473
  });
123
474
 
@@ -135,8 +486,71 @@ describe("AbstractNumbering", () => {
135
486
  },
136
487
  ]);
137
488
  const tree = new Formatter().format(abstractNumbering);
138
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
139
- "w:pPr": [{ "w:jc": { _attr: { "w:val": "left" } } }],
489
+ expect(tree).to.deep.equal({
490
+ "w:abstractNum": [
491
+ {
492
+ _attr: {
493
+ "w15:restartNumberingAfterBreak": 0,
494
+ "w:abstractNumId": 1,
495
+ },
496
+ },
497
+ {
498
+ "w:multiLevelType": {
499
+ _attr: {
500
+ "w:val": "hybridMultilevel",
501
+ },
502
+ },
503
+ },
504
+ {
505
+ "w:lvl": [
506
+ {
507
+ "w:start": {
508
+ _attr: {
509
+ "w:val": 1,
510
+ },
511
+ },
512
+ },
513
+ {
514
+ "w:numFmt": {
515
+ _attr: {
516
+ "w:val": "lowerRoman",
517
+ },
518
+ },
519
+ },
520
+ {
521
+ "w:lvlText": {
522
+ _attr: {
523
+ "w:val": "%0.",
524
+ },
525
+ },
526
+ },
527
+ {
528
+ "w:lvlJc": {
529
+ _attr: {
530
+ "w:val": "start",
531
+ },
532
+ },
533
+ },
534
+ {
535
+ "w:pPr": [
536
+ {
537
+ "w:jc": {
538
+ _attr: {
539
+ "w:val": "left",
540
+ },
541
+ },
542
+ },
543
+ ],
544
+ },
545
+ {
546
+ _attr: {
547
+ "w15:tentative": 1,
548
+ "w:ilvl": 0,
549
+ },
550
+ },
551
+ ],
552
+ },
553
+ ],
140
554
  });
141
555
  });
142
556
 
@@ -154,8 +568,71 @@ describe("AbstractNumbering", () => {
154
568
  },
155
569
  ]);
156
570
  const tree = new Formatter().format(abstractNumbering);
157
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
158
- "w:pPr": [{ "w:jc": { _attr: { "w:val": "right" } } }],
571
+ expect(tree).to.deep.equal({
572
+ "w:abstractNum": [
573
+ {
574
+ _attr: {
575
+ "w15:restartNumberingAfterBreak": 0,
576
+ "w:abstractNumId": 1,
577
+ },
578
+ },
579
+ {
580
+ "w:multiLevelType": {
581
+ _attr: {
582
+ "w:val": "hybridMultilevel",
583
+ },
584
+ },
585
+ },
586
+ {
587
+ "w:lvl": [
588
+ {
589
+ "w:start": {
590
+ _attr: {
591
+ "w:val": 1,
592
+ },
593
+ },
594
+ },
595
+ {
596
+ "w:numFmt": {
597
+ _attr: {
598
+ "w:val": "lowerRoman",
599
+ },
600
+ },
601
+ },
602
+ {
603
+ "w:lvlText": {
604
+ _attr: {
605
+ "w:val": "%0.",
606
+ },
607
+ },
608
+ },
609
+ {
610
+ "w:lvlJc": {
611
+ _attr: {
612
+ "w:val": "start",
613
+ },
614
+ },
615
+ },
616
+ {
617
+ "w:pPr": [
618
+ {
619
+ "w:jc": {
620
+ _attr: {
621
+ "w:val": "right",
622
+ },
623
+ },
624
+ },
625
+ ],
626
+ },
627
+ {
628
+ _attr: {
629
+ "w15:tentative": 1,
630
+ "w:ilvl": 0,
631
+ },
632
+ },
633
+ ],
634
+ },
635
+ ],
159
636
  });
160
637
  });
161
638
 
@@ -173,8 +650,71 @@ describe("AbstractNumbering", () => {
173
650
  },
174
651
  ]);
175
652
  const tree = new Formatter().format(abstractNumbering);
176
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
177
- "w:pPr": [{ "w:jc": { _attr: { "w:val": "both" } } }],
653
+ expect(tree).to.deep.equal({
654
+ "w:abstractNum": [
655
+ {
656
+ _attr: {
657
+ "w15:restartNumberingAfterBreak": 0,
658
+ "w:abstractNumId": 1,
659
+ },
660
+ },
661
+ {
662
+ "w:multiLevelType": {
663
+ _attr: {
664
+ "w:val": "hybridMultilevel",
665
+ },
666
+ },
667
+ },
668
+ {
669
+ "w:lvl": [
670
+ {
671
+ "w:start": {
672
+ _attr: {
673
+ "w:val": 1,
674
+ },
675
+ },
676
+ },
677
+ {
678
+ "w:numFmt": {
679
+ _attr: {
680
+ "w:val": "lowerRoman",
681
+ },
682
+ },
683
+ },
684
+ {
685
+ "w:lvlText": {
686
+ _attr: {
687
+ "w:val": "%0.",
688
+ },
689
+ },
690
+ },
691
+ {
692
+ "w:lvlJc": {
693
+ _attr: {
694
+ "w:val": "start",
695
+ },
696
+ },
697
+ },
698
+ {
699
+ "w:pPr": [
700
+ {
701
+ "w:jc": {
702
+ _attr: {
703
+ "w:val": "both",
704
+ },
705
+ },
706
+ },
707
+ ],
708
+ },
709
+ {
710
+ _attr: {
711
+ "w15:tentative": 1,
712
+ "w:ilvl": 0,
713
+ },
714
+ },
715
+ ],
716
+ },
717
+ ],
178
718
  });
179
719
  });
180
720
 
@@ -192,20 +732,75 @@ describe("AbstractNumbering", () => {
192
732
  },
193
733
  ]);
194
734
  const tree = new Formatter().format(abstractNumbering);
195
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
196
- "w:pPr": [
735
+ expect(tree).to.deep.equal({
736
+ "w:abstractNum": [
197
737
  {
198
- "w:pBdr": [
738
+ _attr: {
739
+ "w15:restartNumberingAfterBreak": 0,
740
+ "w:abstractNumId": 1,
741
+ },
742
+ },
743
+ {
744
+ "w:multiLevelType": {
745
+ _attr: {
746
+ "w:val": "hybridMultilevel",
747
+ },
748
+ },
749
+ },
750
+ {
751
+ "w:lvl": [
752
+ {
753
+ "w:start": {
754
+ _attr: {
755
+ "w:val": 1,
756
+ },
757
+ },
758
+ },
759
+ {
760
+ "w:numFmt": {
761
+ _attr: {
762
+ "w:val": "lowerRoman",
763
+ },
764
+ },
765
+ },
766
+ {
767
+ "w:lvlText": {
768
+ _attr: {
769
+ "w:val": "%0.",
770
+ },
771
+ },
772
+ },
199
773
  {
200
- "w:bottom": {
774
+ "w:lvlJc": {
201
775
  _attr: {
202
- "w:color": "auto",
203
- "w:space": 1,
204
- "w:val": "single",
205
- "w:sz": 6,
776
+ "w:val": "start",
206
777
  },
207
778
  },
208
779
  },
780
+ {
781
+ "w:pPr": [
782
+ {
783
+ "w:pBdr": [
784
+ {
785
+ "w:bottom": {
786
+ _attr: {
787
+ "w:color": "auto",
788
+ "w:space": 1,
789
+ "w:sz": 6,
790
+ "w:val": "single",
791
+ },
792
+ },
793
+ },
794
+ ],
795
+ },
796
+ ],
797
+ },
798
+ {
799
+ _attr: {
800
+ "w15:tentative": 1,
801
+ "w:ilvl": 0,
802
+ },
803
+ },
209
804
  ],
210
805
  },
211
806
  ],
@@ -226,10 +821,74 @@ describe("AbstractNumbering", () => {
226
821
  },
227
822
  ]);
228
823
  const tree = new Formatter().format(abstractNumbering);
229
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
230
- "w:pPr": [
824
+ expect(tree).to.deep.equal({
825
+ "w:abstractNum": [
231
826
  {
232
- "w:tabs": [{ "w:tab": { _attr: { "w:val": "left", "w:pos": 1200 } } }],
827
+ _attr: {
828
+ "w15:restartNumberingAfterBreak": 0,
829
+ "w:abstractNumId": 1,
830
+ },
831
+ },
832
+ {
833
+ "w:multiLevelType": {
834
+ _attr: {
835
+ "w:val": "hybridMultilevel",
836
+ },
837
+ },
838
+ },
839
+ {
840
+ "w:lvl": [
841
+ {
842
+ "w:start": {
843
+ _attr: {
844
+ "w:val": 1,
845
+ },
846
+ },
847
+ },
848
+ {
849
+ "w:numFmt": {
850
+ _attr: {
851
+ "w:val": "lowerRoman",
852
+ },
853
+ },
854
+ },
855
+ {
856
+ "w:lvlText": {
857
+ _attr: {
858
+ "w:val": "%0.",
859
+ },
860
+ },
861
+ },
862
+ {
863
+ "w:lvlJc": {
864
+ _attr: {
865
+ "w:val": "start",
866
+ },
867
+ },
868
+ },
869
+ {
870
+ "w:pPr": [
871
+ {
872
+ "w:tabs": [
873
+ {
874
+ "w:tab": {
875
+ _attr: {
876
+ "w:pos": 1200,
877
+ "w:val": "left",
878
+ },
879
+ },
880
+ },
881
+ ],
882
+ },
883
+ ],
884
+ },
885
+ {
886
+ _attr: {
887
+ "w15:tentative": 1,
888
+ "w:ilvl": 0,
889
+ },
890
+ },
891
+ ],
233
892
  },
234
893
  ],
235
894
  });
@@ -249,10 +908,74 @@ describe("AbstractNumbering", () => {
249
908
  },
250
909
  ]);
251
910
  const tree = new Formatter().format(abstractNumbering);
252
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
253
- "w:pPr": [
911
+ expect(tree).to.deep.equal({
912
+ "w:abstractNum": [
254
913
  {
255
- "w:tabs": [{ "w:tab": { _attr: { "w:val": "right", "w:pos": 9026 } } }],
914
+ _attr: {
915
+ "w15:restartNumberingAfterBreak": 0,
916
+ "w:abstractNumId": 1,
917
+ },
918
+ },
919
+ {
920
+ "w:multiLevelType": {
921
+ _attr: {
922
+ "w:val": "hybridMultilevel",
923
+ },
924
+ },
925
+ },
926
+ {
927
+ "w:lvl": [
928
+ {
929
+ "w:start": {
930
+ _attr: {
931
+ "w:val": 1,
932
+ },
933
+ },
934
+ },
935
+ {
936
+ "w:numFmt": {
937
+ _attr: {
938
+ "w:val": "lowerRoman",
939
+ },
940
+ },
941
+ },
942
+ {
943
+ "w:lvlText": {
944
+ _attr: {
945
+ "w:val": "%0.",
946
+ },
947
+ },
948
+ },
949
+ {
950
+ "w:lvlJc": {
951
+ _attr: {
952
+ "w:val": "start",
953
+ },
954
+ },
955
+ },
956
+ {
957
+ "w:pPr": [
958
+ {
959
+ "w:tabs": [
960
+ {
961
+ "w:tab": {
962
+ _attr: {
963
+ "w:pos": 9026,
964
+ "w:val": "right",
965
+ },
966
+ },
967
+ },
968
+ ],
969
+ },
970
+ ],
971
+ },
972
+ {
973
+ _attr: {
974
+ "w15:tentative": 1,
975
+ "w:ilvl": 0,
976
+ },
977
+ },
978
+ ],
256
979
  },
257
980
  ],
258
981
  });
@@ -272,8 +995,67 @@ describe("AbstractNumbering", () => {
272
995
  },
273
996
  ]);
274
997
  const tree = new Formatter().format(abstractNumbering);
275
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
276
- "w:pPr": [{ "w:keepLines": EMPTY_OBJECT }],
998
+ expect(tree).to.deep.equal({
999
+ "w:abstractNum": [
1000
+ {
1001
+ _attr: {
1002
+ "w15:restartNumberingAfterBreak": 0,
1003
+ "w:abstractNumId": 1,
1004
+ },
1005
+ },
1006
+ {
1007
+ "w:multiLevelType": {
1008
+ _attr: {
1009
+ "w:val": "hybridMultilevel",
1010
+ },
1011
+ },
1012
+ },
1013
+ {
1014
+ "w:lvl": [
1015
+ {
1016
+ "w:start": {
1017
+ _attr: {
1018
+ "w:val": 1,
1019
+ },
1020
+ },
1021
+ },
1022
+ {
1023
+ "w:numFmt": {
1024
+ _attr: {
1025
+ "w:val": "lowerRoman",
1026
+ },
1027
+ },
1028
+ },
1029
+ {
1030
+ "w:lvlText": {
1031
+ _attr: {
1032
+ "w:val": "%0.",
1033
+ },
1034
+ },
1035
+ },
1036
+ {
1037
+ "w:lvlJc": {
1038
+ _attr: {
1039
+ "w:val": "start",
1040
+ },
1041
+ },
1042
+ },
1043
+ {
1044
+ "w:pPr": [
1045
+ {
1046
+ "w:keepLines": {},
1047
+ },
1048
+ ],
1049
+ },
1050
+ {
1051
+ _attr: {
1052
+ "w15:tentative": 1,
1053
+ "w:ilvl": 0,
1054
+ },
1055
+ },
1056
+ ],
1057
+ },
1058
+ ],
277
1059
  });
278
1060
  });
279
1061
 
@@ -291,8 +1073,67 @@ describe("AbstractNumbering", () => {
291
1073
  },
292
1074
  ]);
293
1075
  const tree = new Formatter().format(abstractNumbering);
294
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
295
- "w:pPr": [{ "w:keepNext": EMPTY_OBJECT }],
1076
+ expect(tree).to.deep.equal({
1077
+ "w:abstractNum": [
1078
+ {
1079
+ _attr: {
1080
+ "w15:restartNumberingAfterBreak": 0,
1081
+ "w:abstractNumId": 1,
1082
+ },
1083
+ },
1084
+ {
1085
+ "w:multiLevelType": {
1086
+ _attr: {
1087
+ "w:val": "hybridMultilevel",
1088
+ },
1089
+ },
1090
+ },
1091
+ {
1092
+ "w:lvl": [
1093
+ {
1094
+ "w:start": {
1095
+ _attr: {
1096
+ "w:val": 1,
1097
+ },
1098
+ },
1099
+ },
1100
+ {
1101
+ "w:numFmt": {
1102
+ _attr: {
1103
+ "w:val": "lowerRoman",
1104
+ },
1105
+ },
1106
+ },
1107
+ {
1108
+ "w:lvlText": {
1109
+ _attr: {
1110
+ "w:val": "%0.",
1111
+ },
1112
+ },
1113
+ },
1114
+ {
1115
+ "w:lvlJc": {
1116
+ _attr: {
1117
+ "w:val": "start",
1118
+ },
1119
+ },
1120
+ },
1121
+ {
1122
+ "w:pPr": [
1123
+ {
1124
+ "w:keepNext": {},
1125
+ },
1126
+ ],
1127
+ },
1128
+ {
1129
+ _attr: {
1130
+ "w15:tentative": 1,
1131
+ "w:ilvl": 0,
1132
+ },
1133
+ },
1134
+ ],
1135
+ },
1136
+ ],
296
1137
  });
297
1138
  });
298
1139
  });
@@ -329,10 +1170,67 @@ describe("AbstractNumbering", () => {
329
1170
  style: {
330
1171
  run: { size, sizeComplexScript },
331
1172
  },
332
- },
333
- ]);
334
- const tree = new Formatter().format(abstractNumbering);
335
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:rPr": expected });
1173
+ },
1174
+ ]);
1175
+ const tree = new Formatter().format(abstractNumbering);
1176
+ expect(tree).to.deep.equal({
1177
+ "w:abstractNum": [
1178
+ {
1179
+ _attr: {
1180
+ "w15:restartNumberingAfterBreak": 0,
1181
+ "w:abstractNumId": 1,
1182
+ },
1183
+ },
1184
+ {
1185
+ "w:multiLevelType": {
1186
+ _attr: {
1187
+ "w:val": "hybridMultilevel",
1188
+ },
1189
+ },
1190
+ },
1191
+ {
1192
+ "w:lvl": [
1193
+ {
1194
+ "w:start": {
1195
+ _attr: {
1196
+ "w:val": 1,
1197
+ },
1198
+ },
1199
+ },
1200
+ {
1201
+ "w:numFmt": {
1202
+ _attr: {
1203
+ "w:val": "lowerRoman",
1204
+ },
1205
+ },
1206
+ },
1207
+ {
1208
+ "w:lvlText": {
1209
+ _attr: {
1210
+ "w:val": "%0.",
1211
+ },
1212
+ },
1213
+ },
1214
+ {
1215
+ "w:lvlJc": {
1216
+ _attr: {
1217
+ "w:val": "start",
1218
+ },
1219
+ },
1220
+ },
1221
+ {
1222
+ "w:rPr": expected,
1223
+ },
1224
+ {
1225
+ _attr: {
1226
+ "w15:tentative": 1,
1227
+ "w:ilvl": 0,
1228
+ },
1229
+ },
1230
+ ],
1231
+ },
1232
+ ],
1233
+ });
336
1234
  });
337
1235
  });
338
1236
 
@@ -350,8 +1248,67 @@ describe("AbstractNumbering", () => {
350
1248
  },
351
1249
  ]);
352
1250
  const tree = new Formatter().format(abstractNumbering);
353
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
354
- "w:rPr": [{ "w:smallCaps": {} }],
1251
+ expect(tree).to.deep.equal({
1252
+ "w:abstractNum": [
1253
+ {
1254
+ _attr: {
1255
+ "w15:restartNumberingAfterBreak": 0,
1256
+ "w:abstractNumId": 1,
1257
+ },
1258
+ },
1259
+ {
1260
+ "w:multiLevelType": {
1261
+ _attr: {
1262
+ "w:val": "hybridMultilevel",
1263
+ },
1264
+ },
1265
+ },
1266
+ {
1267
+ "w:lvl": [
1268
+ {
1269
+ "w:start": {
1270
+ _attr: {
1271
+ "w:val": 1,
1272
+ },
1273
+ },
1274
+ },
1275
+ {
1276
+ "w:numFmt": {
1277
+ _attr: {
1278
+ "w:val": "lowerRoman",
1279
+ },
1280
+ },
1281
+ },
1282
+ {
1283
+ "w:lvlText": {
1284
+ _attr: {
1285
+ "w:val": "%0.",
1286
+ },
1287
+ },
1288
+ },
1289
+ {
1290
+ "w:lvlJc": {
1291
+ _attr: {
1292
+ "w:val": "start",
1293
+ },
1294
+ },
1295
+ },
1296
+ {
1297
+ "w:rPr": [
1298
+ {
1299
+ "w:smallCaps": {},
1300
+ },
1301
+ ],
1302
+ },
1303
+ {
1304
+ _attr: {
1305
+ "w15:tentative": 1,
1306
+ "w:ilvl": 0,
1307
+ },
1308
+ },
1309
+ ],
1310
+ },
1311
+ ],
355
1312
  });
356
1313
  });
357
1314
 
@@ -369,8 +1326,67 @@ describe("AbstractNumbering", () => {
369
1326
  },
370
1327
  ]);
371
1328
  const tree = new Formatter().format(abstractNumbering);
372
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
373
- "w:rPr": [{ "w:caps": {} }],
1329
+ expect(tree).to.deep.equal({
1330
+ "w:abstractNum": [
1331
+ {
1332
+ _attr: {
1333
+ "w15:restartNumberingAfterBreak": 0,
1334
+ "w:abstractNumId": 1,
1335
+ },
1336
+ },
1337
+ {
1338
+ "w:multiLevelType": {
1339
+ _attr: {
1340
+ "w:val": "hybridMultilevel",
1341
+ },
1342
+ },
1343
+ },
1344
+ {
1345
+ "w:lvl": [
1346
+ {
1347
+ "w:start": {
1348
+ _attr: {
1349
+ "w:val": 1,
1350
+ },
1351
+ },
1352
+ },
1353
+ {
1354
+ "w:numFmt": {
1355
+ _attr: {
1356
+ "w:val": "lowerRoman",
1357
+ },
1358
+ },
1359
+ },
1360
+ {
1361
+ "w:lvlText": {
1362
+ _attr: {
1363
+ "w:val": "%0.",
1364
+ },
1365
+ },
1366
+ },
1367
+ {
1368
+ "w:lvlJc": {
1369
+ _attr: {
1370
+ "w:val": "start",
1371
+ },
1372
+ },
1373
+ },
1374
+ {
1375
+ "w:rPr": [
1376
+ {
1377
+ "w:caps": {},
1378
+ },
1379
+ ],
1380
+ },
1381
+ {
1382
+ _attr: {
1383
+ "w15:tentative": 1,
1384
+ "w:ilvl": 0,
1385
+ },
1386
+ },
1387
+ ],
1388
+ },
1389
+ ],
374
1390
  });
375
1391
  });
376
1392
 
@@ -389,8 +1405,67 @@ describe("AbstractNumbering", () => {
389
1405
  ]);
390
1406
 
391
1407
  const tree = new Formatter().format(abstractNumbering);
392
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
393
- "w:rPr": [{ "w:strike": {} }],
1408
+ expect(tree).to.deep.equal({
1409
+ "w:abstractNum": [
1410
+ {
1411
+ _attr: {
1412
+ "w15:restartNumberingAfterBreak": 0,
1413
+ "w:abstractNumId": 1,
1414
+ },
1415
+ },
1416
+ {
1417
+ "w:multiLevelType": {
1418
+ _attr: {
1419
+ "w:val": "hybridMultilevel",
1420
+ },
1421
+ },
1422
+ },
1423
+ {
1424
+ "w:lvl": [
1425
+ {
1426
+ "w:start": {
1427
+ _attr: {
1428
+ "w:val": 1,
1429
+ },
1430
+ },
1431
+ },
1432
+ {
1433
+ "w:numFmt": {
1434
+ _attr: {
1435
+ "w:val": "lowerRoman",
1436
+ },
1437
+ },
1438
+ },
1439
+ {
1440
+ "w:lvlText": {
1441
+ _attr: {
1442
+ "w:val": "%0.",
1443
+ },
1444
+ },
1445
+ },
1446
+ {
1447
+ "w:lvlJc": {
1448
+ _attr: {
1449
+ "w:val": "start",
1450
+ },
1451
+ },
1452
+ },
1453
+ {
1454
+ "w:rPr": [
1455
+ {
1456
+ "w:strike": {},
1457
+ },
1458
+ ],
1459
+ },
1460
+ {
1461
+ _attr: {
1462
+ "w15:tentative": 1,
1463
+ "w:ilvl": 0,
1464
+ },
1465
+ },
1466
+ ],
1467
+ },
1468
+ ],
394
1469
  });
395
1470
  });
396
1471
 
@@ -408,8 +1483,67 @@ describe("AbstractNumbering", () => {
408
1483
  },
409
1484
  ]);
410
1485
  const tree = new Formatter().format(abstractNumbering);
411
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
412
- "w:rPr": [{ "w:dstrike": {} }],
1486
+ expect(tree).to.deep.equal({
1487
+ "w:abstractNum": [
1488
+ {
1489
+ _attr: {
1490
+ "w15:restartNumberingAfterBreak": 0,
1491
+ "w:abstractNumId": 1,
1492
+ },
1493
+ },
1494
+ {
1495
+ "w:multiLevelType": {
1496
+ _attr: {
1497
+ "w:val": "hybridMultilevel",
1498
+ },
1499
+ },
1500
+ },
1501
+ {
1502
+ "w:lvl": [
1503
+ {
1504
+ "w:start": {
1505
+ _attr: {
1506
+ "w:val": 1,
1507
+ },
1508
+ },
1509
+ },
1510
+ {
1511
+ "w:numFmt": {
1512
+ _attr: {
1513
+ "w:val": "lowerRoman",
1514
+ },
1515
+ },
1516
+ },
1517
+ {
1518
+ "w:lvlText": {
1519
+ _attr: {
1520
+ "w:val": "%0.",
1521
+ },
1522
+ },
1523
+ },
1524
+ {
1525
+ "w:lvlJc": {
1526
+ _attr: {
1527
+ "w:val": "start",
1528
+ },
1529
+ },
1530
+ },
1531
+ {
1532
+ "w:rPr": [
1533
+ {
1534
+ "w:dstrike": {},
1535
+ },
1536
+ ],
1537
+ },
1538
+ {
1539
+ _attr: {
1540
+ "w15:tentative": 1,
1541
+ "w:ilvl": 0,
1542
+ },
1543
+ },
1544
+ ],
1545
+ },
1546
+ ],
413
1547
  });
414
1548
  });
415
1549
 
@@ -427,8 +1561,63 @@ describe("AbstractNumbering", () => {
427
1561
  },
428
1562
  ]);
429
1563
  const tree = new Formatter().format(abstractNumbering);
430
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
431
- "w:rPr": [{ "w:vertAlign": { _attr: { "w:val": "subscript" } } }],
1564
+ expect(tree).to.deep.equal({
1565
+ "w:abstractNum": [
1566
+ {
1567
+ _attr: {
1568
+ "w15:restartNumberingAfterBreak": 0,
1569
+ "w:abstractNumId": 1,
1570
+ },
1571
+ },
1572
+ {
1573
+ "w:multiLevelType": {
1574
+ _attr: {
1575
+ "w:val": "hybridMultilevel",
1576
+ },
1577
+ },
1578
+ },
1579
+ {
1580
+ "w:lvl": [
1581
+ {
1582
+ "w:start": {
1583
+ _attr: {
1584
+ "w:val": 1,
1585
+ },
1586
+ },
1587
+ },
1588
+ {
1589
+ "w:numFmt": {
1590
+ _attr: {
1591
+ "w:val": "lowerRoman",
1592
+ },
1593
+ },
1594
+ },
1595
+ {
1596
+ "w:lvlText": {
1597
+ _attr: {
1598
+ "w:val": "%0.",
1599
+ },
1600
+ },
1601
+ },
1602
+ {
1603
+ "w:lvlJc": {
1604
+ _attr: {
1605
+ "w:val": "start",
1606
+ },
1607
+ },
1608
+ },
1609
+ {
1610
+ "w:rPr": [{ "w:vertAlign": { _attr: { "w:val": "subscript" } } }],
1611
+ },
1612
+ {
1613
+ _attr: {
1614
+ "w15:tentative": 1,
1615
+ "w:ilvl": 0,
1616
+ },
1617
+ },
1618
+ ],
1619
+ },
1620
+ ],
432
1621
  });
433
1622
  });
434
1623
 
@@ -446,8 +1635,63 @@ describe("AbstractNumbering", () => {
446
1635
  },
447
1636
  ]);
448
1637
  const tree = new Formatter().format(abstractNumbering);
449
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
450
- "w:rPr": [{ "w:vertAlign": { _attr: { "w:val": "superscript" } } }],
1638
+ expect(tree).to.deep.equal({
1639
+ "w:abstractNum": [
1640
+ {
1641
+ _attr: {
1642
+ "w15:restartNumberingAfterBreak": 0,
1643
+ "w:abstractNumId": 1,
1644
+ },
1645
+ },
1646
+ {
1647
+ "w:multiLevelType": {
1648
+ _attr: {
1649
+ "w:val": "hybridMultilevel",
1650
+ },
1651
+ },
1652
+ },
1653
+ {
1654
+ "w:lvl": [
1655
+ {
1656
+ "w:start": {
1657
+ _attr: {
1658
+ "w:val": 1,
1659
+ },
1660
+ },
1661
+ },
1662
+ {
1663
+ "w:numFmt": {
1664
+ _attr: {
1665
+ "w:val": "lowerRoman",
1666
+ },
1667
+ },
1668
+ },
1669
+ {
1670
+ "w:lvlText": {
1671
+ _attr: {
1672
+ "w:val": "%0.",
1673
+ },
1674
+ },
1675
+ },
1676
+ {
1677
+ "w:lvlJc": {
1678
+ _attr: {
1679
+ "w:val": "start",
1680
+ },
1681
+ },
1682
+ },
1683
+ {
1684
+ "w:rPr": [{ "w:vertAlign": { _attr: { "w:val": "superscript" } } }],
1685
+ },
1686
+ {
1687
+ _attr: {
1688
+ "w15:tentative": 1,
1689
+ "w:ilvl": 0,
1690
+ },
1691
+ },
1692
+ ],
1693
+ },
1694
+ ],
451
1695
  });
452
1696
  });
453
1697
 
@@ -465,17 +1709,72 @@ describe("AbstractNumbering", () => {
465
1709
  },
466
1710
  ]);
467
1711
  const tree = new Formatter().format(abstractNumbering);
468
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
469
- "w:rPr": [
1712
+ expect(tree).to.deep.equal({
1713
+ "w:abstractNum": [
1714
+ {
1715
+ _attr: {
1716
+ "w15:restartNumberingAfterBreak": 0,
1717
+ "w:abstractNumId": 1,
1718
+ },
1719
+ },
470
1720
  {
471
- "w:rFonts": {
1721
+ "w:multiLevelType": {
472
1722
  _attr: {
473
- "w:ascii": "Times",
474
- "w:cs": "Times",
475
- "w:eastAsia": "Times",
476
- "w:hAnsi": "Times",
1723
+ "w:val": "hybridMultilevel",
1724
+ },
1725
+ },
1726
+ },
1727
+ {
1728
+ "w:lvl": [
1729
+ {
1730
+ "w:start": {
1731
+ _attr: {
1732
+ "w:val": 1,
1733
+ },
1734
+ },
1735
+ },
1736
+ {
1737
+ "w:numFmt": {
1738
+ _attr: {
1739
+ "w:val": "lowerRoman",
1740
+ },
1741
+ },
1742
+ },
1743
+ {
1744
+ "w:lvlText": {
1745
+ _attr: {
1746
+ "w:val": "%0.",
1747
+ },
1748
+ },
1749
+ },
1750
+ {
1751
+ "w:lvlJc": {
1752
+ _attr: {
1753
+ "w:val": "start",
1754
+ },
1755
+ },
477
1756
  },
478
- },
1757
+ {
1758
+ "w:rPr": [
1759
+ {
1760
+ "w:rFonts": {
1761
+ _attr: {
1762
+ "w:ascii": "Times",
1763
+ "w:cs": "Times",
1764
+ "w:eastAsia": "Times",
1765
+ "w:hAnsi": "Times",
1766
+ },
1767
+ },
1768
+ },
1769
+ ],
1770
+ },
1771
+ {
1772
+ _attr: {
1773
+ "w15:tentative": 1,
1774
+ "w:ilvl": 0,
1775
+ },
1776
+ },
1777
+ ],
479
1778
  },
480
1779
  ],
481
1780
  });
@@ -498,16 +1797,71 @@ describe("AbstractNumbering", () => {
498
1797
  },
499
1798
  ]);
500
1799
  const tree = new Formatter().format(abstractNumbering);
501
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
502
- "w:rPr": [
1800
+ expect(tree).to.deep.equal({
1801
+ "w:abstractNum": [
503
1802
  {
504
- "w:rFonts": {
1803
+ _attr: {
1804
+ "w15:restartNumberingAfterBreak": 0,
1805
+ "w:abstractNumId": 1,
1806
+ },
1807
+ },
1808
+ {
1809
+ "w:multiLevelType": {
505
1810
  _attr: {
506
- "w:ascii": "Times",
507
- "w:eastAsia": "KaiTi",
1811
+ "w:val": "hybridMultilevel",
508
1812
  },
509
1813
  },
510
1814
  },
1815
+ {
1816
+ "w:lvl": [
1817
+ {
1818
+ "w:start": {
1819
+ _attr: {
1820
+ "w:val": 1,
1821
+ },
1822
+ },
1823
+ },
1824
+ {
1825
+ "w:numFmt": {
1826
+ _attr: {
1827
+ "w:val": "lowerRoman",
1828
+ },
1829
+ },
1830
+ },
1831
+ {
1832
+ "w:lvlText": {
1833
+ _attr: {
1834
+ "w:val": "%0.",
1835
+ },
1836
+ },
1837
+ },
1838
+ {
1839
+ "w:lvlJc": {
1840
+ _attr: {
1841
+ "w:val": "start",
1842
+ },
1843
+ },
1844
+ },
1845
+ {
1846
+ "w:rPr": [
1847
+ {
1848
+ "w:rFonts": {
1849
+ _attr: {
1850
+ "w:ascii": "Times",
1851
+ "w:eastAsia": "KaiTi",
1852
+ },
1853
+ },
1854
+ },
1855
+ ],
1856
+ },
1857
+ {
1858
+ _attr: {
1859
+ "w15:tentative": 1,
1860
+ "w:ilvl": 0,
1861
+ },
1862
+ },
1863
+ ],
1864
+ },
511
1865
  ],
512
1866
  });
513
1867
  });
@@ -541,7 +1895,64 @@ describe("AbstractNumbering", () => {
541
1895
  },
542
1896
  ]);
543
1897
  const tree = new Formatter().format(abstractNumbering);
544
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:rPr": expected });
1898
+ expect(tree).to.deep.equal({
1899
+ "w:abstractNum": [
1900
+ {
1901
+ _attr: {
1902
+ "w15:restartNumberingAfterBreak": 0,
1903
+ "w:abstractNumId": 1,
1904
+ },
1905
+ },
1906
+ {
1907
+ "w:multiLevelType": {
1908
+ _attr: {
1909
+ "w:val": "hybridMultilevel",
1910
+ },
1911
+ },
1912
+ },
1913
+ {
1914
+ "w:lvl": [
1915
+ {
1916
+ "w:start": {
1917
+ _attr: {
1918
+ "w:val": 1,
1919
+ },
1920
+ },
1921
+ },
1922
+ {
1923
+ "w:numFmt": {
1924
+ _attr: {
1925
+ "w:val": "lowerRoman",
1926
+ },
1927
+ },
1928
+ },
1929
+ {
1930
+ "w:lvlText": {
1931
+ _attr: {
1932
+ "w:val": "%0.",
1933
+ },
1934
+ },
1935
+ },
1936
+ {
1937
+ "w:lvlJc": {
1938
+ _attr: {
1939
+ "w:val": "start",
1940
+ },
1941
+ },
1942
+ },
1943
+ {
1944
+ "w:rPr": expected,
1945
+ },
1946
+ {
1947
+ _attr: {
1948
+ "w15:tentative": 1,
1949
+ "w:ilvl": 0,
1950
+ },
1951
+ },
1952
+ ],
1953
+ },
1954
+ ],
1955
+ });
545
1956
  });
546
1957
  });
547
1958
 
@@ -574,7 +1985,64 @@ describe("AbstractNumbering", () => {
574
1985
  },
575
1986
  ]);
576
1987
  const tree = new Formatter().format(abstractNumbering);
577
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:rPr": expected });
1988
+ expect(tree).to.deep.equal({
1989
+ "w:abstractNum": [
1990
+ {
1991
+ _attr: {
1992
+ "w15:restartNumberingAfterBreak": 0,
1993
+ "w:abstractNumId": 1,
1994
+ },
1995
+ },
1996
+ {
1997
+ "w:multiLevelType": {
1998
+ _attr: {
1999
+ "w:val": "hybridMultilevel",
2000
+ },
2001
+ },
2002
+ },
2003
+ {
2004
+ "w:lvl": [
2005
+ {
2006
+ "w:start": {
2007
+ _attr: {
2008
+ "w:val": 1,
2009
+ },
2010
+ },
2011
+ },
2012
+ {
2013
+ "w:numFmt": {
2014
+ _attr: {
2015
+ "w:val": "lowerRoman",
2016
+ },
2017
+ },
2018
+ },
2019
+ {
2020
+ "w:lvlText": {
2021
+ _attr: {
2022
+ "w:val": "%0.",
2023
+ },
2024
+ },
2025
+ },
2026
+ {
2027
+ "w:lvlJc": {
2028
+ _attr: {
2029
+ "w:val": "start",
2030
+ },
2031
+ },
2032
+ },
2033
+ {
2034
+ "w:rPr": expected,
2035
+ },
2036
+ {
2037
+ _attr: {
2038
+ "w15:tentative": 1,
2039
+ "w:ilvl": 0,
2040
+ },
2041
+ },
2042
+ ],
2043
+ },
2044
+ ],
2045
+ });
578
2046
  });
579
2047
  });
580
2048
 
@@ -612,7 +2080,64 @@ describe("AbstractNumbering", () => {
612
2080
  },
613
2081
  ]);
614
2082
  const tree = new Formatter().format(abstractNumbering);
615
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:rPr": expected });
2083
+ expect(tree).to.deep.equal({
2084
+ "w:abstractNum": [
2085
+ {
2086
+ _attr: {
2087
+ "w15:restartNumberingAfterBreak": 0,
2088
+ "w:abstractNumId": 1,
2089
+ },
2090
+ },
2091
+ {
2092
+ "w:multiLevelType": {
2093
+ _attr: {
2094
+ "w:val": "hybridMultilevel",
2095
+ },
2096
+ },
2097
+ },
2098
+ {
2099
+ "w:lvl": [
2100
+ {
2101
+ "w:start": {
2102
+ _attr: {
2103
+ "w:val": 1,
2104
+ },
2105
+ },
2106
+ },
2107
+ {
2108
+ "w:numFmt": {
2109
+ _attr: {
2110
+ "w:val": "lowerRoman",
2111
+ },
2112
+ },
2113
+ },
2114
+ {
2115
+ "w:lvlText": {
2116
+ _attr: {
2117
+ "w:val": "%0.",
2118
+ },
2119
+ },
2120
+ },
2121
+ {
2122
+ "w:lvlJc": {
2123
+ _attr: {
2124
+ "w:val": "start",
2125
+ },
2126
+ },
2127
+ },
2128
+ {
2129
+ "w:rPr": expected,
2130
+ },
2131
+ {
2132
+ _attr: {
2133
+ "w15:tentative": 1,
2134
+ "w:ilvl": 0,
2135
+ },
2136
+ },
2137
+ ],
2138
+ },
2139
+ ],
2140
+ });
616
2141
  });
617
2142
  });
618
2143
 
@@ -647,7 +2172,64 @@ describe("AbstractNumbering", () => {
647
2172
  },
648
2173
  ]);
649
2174
  const tree = new Formatter().format(abstractNumbering);
650
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({ "w:rPr": expected });
2175
+ expect(tree).to.deep.equal({
2176
+ "w:abstractNum": [
2177
+ {
2178
+ _attr: {
2179
+ "w15:restartNumberingAfterBreak": 0,
2180
+ "w:abstractNumId": 1,
2181
+ },
2182
+ },
2183
+ {
2184
+ "w:multiLevelType": {
2185
+ _attr: {
2186
+ "w:val": "hybridMultilevel",
2187
+ },
2188
+ },
2189
+ },
2190
+ {
2191
+ "w:lvl": [
2192
+ {
2193
+ "w:start": {
2194
+ _attr: {
2195
+ "w:val": 1,
2196
+ },
2197
+ },
2198
+ },
2199
+ {
2200
+ "w:numFmt": {
2201
+ _attr: {
2202
+ "w:val": "lowerRoman",
2203
+ },
2204
+ },
2205
+ },
2206
+ {
2207
+ "w:lvlText": {
2208
+ _attr: {
2209
+ "w:val": "%0.",
2210
+ },
2211
+ },
2212
+ },
2213
+ {
2214
+ "w:lvlJc": {
2215
+ _attr: {
2216
+ "w:val": "start",
2217
+ },
2218
+ },
2219
+ },
2220
+ {
2221
+ "w:rPr": expected,
2222
+ },
2223
+ {
2224
+ _attr: {
2225
+ "w15:tentative": 1,
2226
+ "w:ilvl": 0,
2227
+ },
2228
+ },
2229
+ ],
2230
+ },
2231
+ ],
2232
+ });
651
2233
  });
652
2234
  });
653
2235
 
@@ -666,8 +2248,63 @@ describe("AbstractNumbering", () => {
666
2248
  },
667
2249
  ]);
668
2250
  const tree = new Formatter().format(abstractNumbering);
669
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
670
- "w:rPr": [{ "w:u": { _attr: { "w:val": "single" } } }],
2251
+ expect(tree).to.deep.equal({
2252
+ "w:abstractNum": [
2253
+ {
2254
+ _attr: {
2255
+ "w15:restartNumberingAfterBreak": 0,
2256
+ "w:abstractNumId": 1,
2257
+ },
2258
+ },
2259
+ {
2260
+ "w:multiLevelType": {
2261
+ _attr: {
2262
+ "w:val": "hybridMultilevel",
2263
+ },
2264
+ },
2265
+ },
2266
+ {
2267
+ "w:lvl": [
2268
+ {
2269
+ "w:start": {
2270
+ _attr: {
2271
+ "w:val": 1,
2272
+ },
2273
+ },
2274
+ },
2275
+ {
2276
+ "w:numFmt": {
2277
+ _attr: {
2278
+ "w:val": "lowerRoman",
2279
+ },
2280
+ },
2281
+ },
2282
+ {
2283
+ "w:lvlText": {
2284
+ _attr: {
2285
+ "w:val": "%0.",
2286
+ },
2287
+ },
2288
+ },
2289
+ {
2290
+ "w:lvlJc": {
2291
+ _attr: {
2292
+ "w:val": "start",
2293
+ },
2294
+ },
2295
+ },
2296
+ {
2297
+ "w:rPr": [{ "w:u": { _attr: { "w:val": "single" } } }],
2298
+ },
2299
+ {
2300
+ _attr: {
2301
+ "w15:tentative": 1,
2302
+ "w:ilvl": 0,
2303
+ },
2304
+ },
2305
+ ],
2306
+ },
2307
+ ],
671
2308
  });
672
2309
  });
673
2310
 
@@ -687,8 +2324,63 @@ describe("AbstractNumbering", () => {
687
2324
  },
688
2325
  ]);
689
2326
  const tree = new Formatter().format(abstractNumbering);
690
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
691
- "w:rPr": [{ "w:u": { _attr: { "w:val": "double" } } }],
2327
+ expect(tree).to.deep.equal({
2328
+ "w:abstractNum": [
2329
+ {
2330
+ _attr: {
2331
+ "w15:restartNumberingAfterBreak": 0,
2332
+ "w:abstractNumId": 1,
2333
+ },
2334
+ },
2335
+ {
2336
+ "w:multiLevelType": {
2337
+ _attr: {
2338
+ "w:val": "hybridMultilevel",
2339
+ },
2340
+ },
2341
+ },
2342
+ {
2343
+ "w:lvl": [
2344
+ {
2345
+ "w:start": {
2346
+ _attr: {
2347
+ "w:val": 1,
2348
+ },
2349
+ },
2350
+ },
2351
+ {
2352
+ "w:numFmt": {
2353
+ _attr: {
2354
+ "w:val": "lowerRoman",
2355
+ },
2356
+ },
2357
+ },
2358
+ {
2359
+ "w:lvlText": {
2360
+ _attr: {
2361
+ "w:val": "%0.",
2362
+ },
2363
+ },
2364
+ },
2365
+ {
2366
+ "w:lvlJc": {
2367
+ _attr: {
2368
+ "w:val": "start",
2369
+ },
2370
+ },
2371
+ },
2372
+ {
2373
+ "w:rPr": [{ "w:u": { _attr: { "w:val": "double" } } }],
2374
+ },
2375
+ {
2376
+ _attr: {
2377
+ "w15:tentative": 1,
2378
+ "w:ilvl": 0,
2379
+ },
2380
+ },
2381
+ ],
2382
+ },
2383
+ ],
692
2384
  });
693
2385
  });
694
2386
 
@@ -709,8 +2401,63 @@ describe("AbstractNumbering", () => {
709
2401
  },
710
2402
  ]);
711
2403
  const tree = new Formatter().format(abstractNumbering);
712
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
713
- "w:rPr": [{ "w:u": { _attr: { "w:val": "double", "w:color": "005599" } } }],
2404
+ expect(tree).to.deep.equal({
2405
+ "w:abstractNum": [
2406
+ {
2407
+ _attr: {
2408
+ "w15:restartNumberingAfterBreak": 0,
2409
+ "w:abstractNumId": 1,
2410
+ },
2411
+ },
2412
+ {
2413
+ "w:multiLevelType": {
2414
+ _attr: {
2415
+ "w:val": "hybridMultilevel",
2416
+ },
2417
+ },
2418
+ },
2419
+ {
2420
+ "w:lvl": [
2421
+ {
2422
+ "w:start": {
2423
+ _attr: {
2424
+ "w:val": 1,
2425
+ },
2426
+ },
2427
+ },
2428
+ {
2429
+ "w:numFmt": {
2430
+ _attr: {
2431
+ "w:val": "lowerRoman",
2432
+ },
2433
+ },
2434
+ },
2435
+ {
2436
+ "w:lvlText": {
2437
+ _attr: {
2438
+ "w:val": "%0.",
2439
+ },
2440
+ },
2441
+ },
2442
+ {
2443
+ "w:lvlJc": {
2444
+ _attr: {
2445
+ "w:val": "start",
2446
+ },
2447
+ },
2448
+ },
2449
+ {
2450
+ "w:rPr": [{ "w:u": { _attr: { "w:val": "double", "w:color": "005599" } } }],
2451
+ },
2452
+ {
2453
+ _attr: {
2454
+ "w15:tentative": 1,
2455
+ "w:ilvl": 0,
2456
+ },
2457
+ },
2458
+ ],
2459
+ },
2460
+ ],
714
2461
  });
715
2462
  });
716
2463
  });
@@ -730,8 +2477,63 @@ describe("AbstractNumbering", () => {
730
2477
  },
731
2478
  ]);
732
2479
  const tree = new Formatter().format(abstractNumbering);
733
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
734
- "w:rPr": [{ "w:em": { _attr: { "w:val": "dot" } } }],
2480
+ expect(tree).to.deep.equal({
2481
+ "w:abstractNum": [
2482
+ {
2483
+ _attr: {
2484
+ "w15:restartNumberingAfterBreak": 0,
2485
+ "w:abstractNumId": 1,
2486
+ },
2487
+ },
2488
+ {
2489
+ "w:multiLevelType": {
2490
+ _attr: {
2491
+ "w:val": "hybridMultilevel",
2492
+ },
2493
+ },
2494
+ },
2495
+ {
2496
+ "w:lvl": [
2497
+ {
2498
+ "w:start": {
2499
+ _attr: {
2500
+ "w:val": 1,
2501
+ },
2502
+ },
2503
+ },
2504
+ {
2505
+ "w:numFmt": {
2506
+ _attr: {
2507
+ "w:val": "lowerRoman",
2508
+ },
2509
+ },
2510
+ },
2511
+ {
2512
+ "w:lvlText": {
2513
+ _attr: {
2514
+ "w:val": "%0.",
2515
+ },
2516
+ },
2517
+ },
2518
+ {
2519
+ "w:lvlJc": {
2520
+ _attr: {
2521
+ "w:val": "start",
2522
+ },
2523
+ },
2524
+ },
2525
+ {
2526
+ "w:rPr": [{ "w:em": { _attr: { "w:val": "dot" } } }],
2527
+ },
2528
+ {
2529
+ _attr: {
2530
+ "w15:tentative": 1,
2531
+ "w:ilvl": 0,
2532
+ },
2533
+ },
2534
+ ],
2535
+ },
2536
+ ],
735
2537
  });
736
2538
  });
737
2539
 
@@ -751,8 +2553,63 @@ describe("AbstractNumbering", () => {
751
2553
  },
752
2554
  ]);
753
2555
  const tree = new Formatter().format(abstractNumbering);
754
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
755
- "w:rPr": [{ "w:em": { _attr: { "w:val": "dot" } } }],
2556
+ expect(tree).to.deep.equal({
2557
+ "w:abstractNum": [
2558
+ {
2559
+ _attr: {
2560
+ "w15:restartNumberingAfterBreak": 0,
2561
+ "w:abstractNumId": 1,
2562
+ },
2563
+ },
2564
+ {
2565
+ "w:multiLevelType": {
2566
+ _attr: {
2567
+ "w:val": "hybridMultilevel",
2568
+ },
2569
+ },
2570
+ },
2571
+ {
2572
+ "w:lvl": [
2573
+ {
2574
+ "w:start": {
2575
+ _attr: {
2576
+ "w:val": 1,
2577
+ },
2578
+ },
2579
+ },
2580
+ {
2581
+ "w:numFmt": {
2582
+ _attr: {
2583
+ "w:val": "lowerRoman",
2584
+ },
2585
+ },
2586
+ },
2587
+ {
2588
+ "w:lvlText": {
2589
+ _attr: {
2590
+ "w:val": "%0.",
2591
+ },
2592
+ },
2593
+ },
2594
+ {
2595
+ "w:lvlJc": {
2596
+ _attr: {
2597
+ "w:val": "start",
2598
+ },
2599
+ },
2600
+ },
2601
+ {
2602
+ "w:rPr": [{ "w:em": { _attr: { "w:val": "dot" } } }],
2603
+ },
2604
+ {
2605
+ _attr: {
2606
+ "w15:tentative": 1,
2607
+ "w:ilvl": 0,
2608
+ },
2609
+ },
2610
+ ],
2611
+ },
2612
+ ],
756
2613
  });
757
2614
  });
758
2615
  });
@@ -771,8 +2628,63 @@ describe("AbstractNumbering", () => {
771
2628
  },
772
2629
  ]);
773
2630
  const tree = new Formatter().format(abstractNumbering);
774
- expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
775
- "w:rPr": [{ "w:color": { _attr: { "w:val": "123456" } } }],
2631
+ expect(tree).to.deep.equal({
2632
+ "w:abstractNum": [
2633
+ {
2634
+ _attr: {
2635
+ "w15:restartNumberingAfterBreak": 0,
2636
+ "w:abstractNumId": 1,
2637
+ },
2638
+ },
2639
+ {
2640
+ "w:multiLevelType": {
2641
+ _attr: {
2642
+ "w:val": "hybridMultilevel",
2643
+ },
2644
+ },
2645
+ },
2646
+ {
2647
+ "w:lvl": [
2648
+ {
2649
+ "w:start": {
2650
+ _attr: {
2651
+ "w:val": 1,
2652
+ },
2653
+ },
2654
+ },
2655
+ {
2656
+ "w:numFmt": {
2657
+ _attr: {
2658
+ "w:val": "lowerRoman",
2659
+ },
2660
+ },
2661
+ },
2662
+ {
2663
+ "w:lvlText": {
2664
+ _attr: {
2665
+ "w:val": "%0.",
2666
+ },
2667
+ },
2668
+ },
2669
+ {
2670
+ "w:lvlJc": {
2671
+ _attr: {
2672
+ "w:val": "start",
2673
+ },
2674
+ },
2675
+ },
2676
+ {
2677
+ "w:rPr": [{ "w:color": { _attr: { "w:val": "123456" } } }],
2678
+ },
2679
+ {
2680
+ _attr: {
2681
+ "w15:tentative": 1,
2682
+ "w:ilvl": 0,
2683
+ },
2684
+ },
2685
+ ],
2686
+ },
2687
+ ],
776
2688
  });
777
2689
  });
778
2690
  });