@json-to-office/core-docx 4.4.0 → 4.4.2
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/dist/index.js +29 -11
- package/dist/index.js.map +1 -1
- package/dist/plugin/example/index.js +22 -9
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/quality/rules.d.ts +4 -1
- package/dist/quality/rules.d.ts.map +1 -1
- package/dist/renderers/docxjs/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3293,6 +3293,7 @@ import {
|
|
|
3293
3293
|
Header,
|
|
3294
3294
|
ImageRun,
|
|
3295
3295
|
Packer,
|
|
3296
|
+
LineRuleType as LineRuleType2,
|
|
3296
3297
|
Paragraph as Paragraph2
|
|
3297
3298
|
} from "docx";
|
|
3298
3299
|
function createDocxJsRenderer() {
|
|
@@ -3546,21 +3547,33 @@ function sectionChildren(section2, resources) {
|
|
|
3546
3547
|
const blocks = section2.children.map((block2) => emitBlock(block2, resources));
|
|
3547
3548
|
const bookmark = section2.bookmark;
|
|
3548
3549
|
if (!bookmark) return blocks;
|
|
3549
|
-
const out = [];
|
|
3550
|
+
const out = [...blocks];
|
|
3550
3551
|
if (bookmark.opens) {
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3552
|
+
const start = new BookmarkStart2(bookmark.name, bookmark.id);
|
|
3553
|
+
const first = out[0];
|
|
3554
|
+
if (first instanceof Paragraph2) {
|
|
3555
|
+
first.addRunToFront(start);
|
|
3556
|
+
} else {
|
|
3557
|
+
out.unshift(anchorParagraph(start));
|
|
3558
|
+
}
|
|
3557
3559
|
}
|
|
3558
|
-
out.push(...blocks);
|
|
3559
3560
|
if (bookmark.closes) {
|
|
3560
|
-
|
|
3561
|
+
const end = new BookmarkEnd2(bookmark.id);
|
|
3562
|
+
const last = out[out.length - 1];
|
|
3563
|
+
if (last instanceof Paragraph2) {
|
|
3564
|
+
last.addChildElement(end);
|
|
3565
|
+
} else {
|
|
3566
|
+
out.push(anchorParagraph(end));
|
|
3567
|
+
}
|
|
3561
3568
|
}
|
|
3562
3569
|
return out;
|
|
3563
3570
|
}
|
|
3571
|
+
function anchorParagraph(anchor) {
|
|
3572
|
+
return new Paragraph2({
|
|
3573
|
+
children: [anchor],
|
|
3574
|
+
spacing: { before: 0, after: 0, line: 20, lineRule: LineRuleType2.EXACT }
|
|
3575
|
+
});
|
|
3576
|
+
}
|
|
3564
3577
|
function coreProperties(ir) {
|
|
3565
3578
|
const { metadata } = ir;
|
|
3566
3579
|
return {
|
|
@@ -14844,7 +14857,7 @@ var DOCX_QUALITY_PROFILES = {
|
|
|
14844
14857
|
"client-report": {
|
|
14845
14858
|
id: "client-report",
|
|
14846
14859
|
formats: ["docx"],
|
|
14847
|
-
description: "Client or public-administration report: a running head with page numbers on every section after the cover, a takeaway and a source wherever a block declares them, no heading skipped,
|
|
14860
|
+
description: "Client or public-administration report: a running head with page numbers on every section after the cover, a takeaway and a source wherever a block declares them, no heading skipped, every size on the theme scale with at most eight in play, and no page rendered empty under the running head.",
|
|
14848
14861
|
rules: {
|
|
14849
14862
|
"docx/required-chrome": {
|
|
14850
14863
|
parameters: { required: ["takeaway", "source"] }
|
|
@@ -14858,7 +14871,12 @@ var DOCX_QUALITY_PROFILES = {
|
|
|
14858
14871
|
"docx/heading-hierarchy": { severity: "warning" },
|
|
14859
14872
|
"docx/type-scale": { enabled: true },
|
|
14860
14873
|
"docx/size-count": { enabled: true, parameters: { maximumSizes: 8 } },
|
|
14861
|
-
"docx/role-drift": { enabled: true }
|
|
14874
|
+
"docx/role-drift": { enabled: true },
|
|
14875
|
+
// The report blocks place every figure in a captioned block, so a page
|
|
14876
|
+
// with no text under the running head is a stray break or an empty
|
|
14877
|
+
// section, not a plate. A genuine full-page figure suppresses this at
|
|
14878
|
+
// its page through the policy.
|
|
14879
|
+
"rendered/empty-page": { severity: "warning" }
|
|
14862
14880
|
}
|
|
14863
14881
|
},
|
|
14864
14882
|
"executive-report": {
|