@json-to-office/core-docx 0.37.0 → 0.38.1
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/components/text-box.d.ts.map +1 -1
- package/dist/core/content.d.ts.map +1 -1
- package/dist/index.js +77 -46
- package/dist/index.js.map +1 -1
- package/dist/plugin/example/index.js +77 -46
- package/dist/plugin/example/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/bookmarkRegistry.d.ts +20 -0
- package/dist/utils/bookmarkRegistry.d.ts.map +1 -1
- package/dist/utils/imageUtils.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-box.d.ts","sourceRoot":"","sources":["../../src/components/text-box.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,KAAK,EAWN,MAAM,MAAM,CAAC;AACd,OAAO,EACL,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"text-box.d.ts","sourceRoot":"","sources":["../../src/components/text-box.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,KAAK,EAWN,MAAM,MAAM,CAAC;AACd,OAAO,EACL,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAmdxC,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,UAAU,EAAE,aAAa,GACxC,OAAO,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,CAiBhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/core/content.ts"],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;SACH,CAAC;KACH,CAAC;IACF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,KAAK,CAAC,CAiMhB"}
|
package/dist/index.js
CHANGED
|
@@ -2623,8 +2623,8 @@ import {
|
|
|
2623
2623
|
Paragraph as Paragraph9,
|
|
2624
2624
|
TextRun as TextRun9,
|
|
2625
2625
|
AlignmentType as AlignmentType5,
|
|
2626
|
-
BookmarkStart as
|
|
2627
|
-
BookmarkEnd as
|
|
2626
|
+
BookmarkStart as BookmarkStart3,
|
|
2627
|
+
BookmarkEnd as BookmarkEnd3
|
|
2628
2628
|
} from "docx";
|
|
2629
2629
|
|
|
2630
2630
|
// src/utils/imageUtils.ts
|
|
@@ -2677,6 +2677,7 @@ import { ImageRun } from "docx";
|
|
|
2677
2677
|
var SVG_RASTER_SCALE = 3;
|
|
2678
2678
|
var SVG_MAX_EDGE_PX = 4096;
|
|
2679
2679
|
var SVG_MIN_EDGE_PX = 16;
|
|
2680
|
+
var SVG_MAX_TOTAL_PX = 1e6;
|
|
2680
2681
|
var resvgModule;
|
|
2681
2682
|
function loadResvg() {
|
|
2682
2683
|
resvgModule ??= import("@resvg/resvg-js");
|
|
@@ -2688,6 +2689,13 @@ function toRasterPx(px) {
|
|
|
2688
2689
|
Math.max(SVG_MIN_EDGE_PX, Math.round(px * SVG_RASTER_SCALE))
|
|
2689
2690
|
);
|
|
2690
2691
|
}
|
|
2692
|
+
function capToPixelBudget(edge, aspect) {
|
|
2693
|
+
if (!Number.isFinite(aspect) || aspect <= 0) return void 0;
|
|
2694
|
+
const total = edge * edge * aspect;
|
|
2695
|
+
if (total <= SVG_MAX_TOTAL_PX) return edge;
|
|
2696
|
+
const scaled = Math.floor(edge * Math.sqrt(SVG_MAX_TOTAL_PX / total));
|
|
2697
|
+
return scaled >= SVG_MIN_EDGE_PX ? scaled : void 0;
|
|
2698
|
+
}
|
|
2691
2699
|
async function rasterizeSvgFallback(svg, transformation) {
|
|
2692
2700
|
let Resvg;
|
|
2693
2701
|
try {
|
|
@@ -2704,8 +2712,22 @@ async function rasterizeSvgFallback(svg, transformation) {
|
|
|
2704
2712
|
const markup = svg.toString("utf-8");
|
|
2705
2713
|
const probeImage = new Resvg(markup);
|
|
2706
2714
|
const wide = probeImage.width / probeImage.height > transformation.width / transformation.height;
|
|
2707
|
-
const
|
|
2708
|
-
|
|
2715
|
+
const mode = wide ? "height" : "width";
|
|
2716
|
+
const value = capToPixelBudget(
|
|
2717
|
+
toRasterPx(wide ? transformation.height : transformation.width),
|
|
2718
|
+
wide ? probeImage.width / probeImage.height : probeImage.height / probeImage.width
|
|
2719
|
+
);
|
|
2720
|
+
if (value === void 0) {
|
|
2721
|
+
reportWarning(
|
|
2722
|
+
"image",
|
|
2723
|
+
"IMAGE_SVG_RASTER_SKIPPED",
|
|
2724
|
+
"Inline SVG is too far from square to rasterize within the fallback pixel budget, so its fallback only renders in Word 2016+."
|
|
2725
|
+
);
|
|
2726
|
+
return void 0;
|
|
2727
|
+
}
|
|
2728
|
+
return Buffer.from(
|
|
2729
|
+
new Resvg(markup, { fitTo: { mode, value } }).render().asPng()
|
|
2730
|
+
);
|
|
2709
2731
|
} catch (error) {
|
|
2710
2732
|
reportWarning(
|
|
2711
2733
|
"image",
|
|
@@ -4637,14 +4659,18 @@ import {
|
|
|
4637
4659
|
PageNumber as PageNumber2,
|
|
4638
4660
|
ColumnBreak,
|
|
4639
4661
|
TableLayoutType,
|
|
4640
|
-
VerticalAlign
|
|
4641
|
-
Bookmark
|
|
4662
|
+
VerticalAlign
|
|
4642
4663
|
} from "docx";
|
|
4643
4664
|
init_styles();
|
|
4644
4665
|
init_defaults();
|
|
4645
4666
|
|
|
4646
4667
|
// src/utils/bookmarkRegistry.ts
|
|
4647
4668
|
import { AsyncLocalStorage as AsyncLocalStorage4 } from "async_hooks";
|
|
4669
|
+
import { BookmarkStart, BookmarkEnd } from "docx";
|
|
4670
|
+
var CONTENT_LINK_ID_BASE = 2e6;
|
|
4671
|
+
function createState() {
|
|
4672
|
+
return { bookmarks: /* @__PURE__ */ new Map(), nextLinkId: CONTENT_LINK_ID_BASE + 1 };
|
|
4673
|
+
}
|
|
4648
4674
|
function slugifyBookmarkText(text) {
|
|
4649
4675
|
return text.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").substring(0, 40);
|
|
4650
4676
|
}
|
|
@@ -4657,14 +4683,14 @@ function dedupeBookmarkId(base, taken) {
|
|
|
4657
4683
|
return id;
|
|
4658
4684
|
}
|
|
4659
4685
|
var BookmarkRegistry = class {
|
|
4660
|
-
fallback =
|
|
4686
|
+
fallback = createState();
|
|
4661
4687
|
scopes = new AsyncLocalStorage4();
|
|
4662
4688
|
get state() {
|
|
4663
4689
|
return this.scopes.getStore() ?? this.fallback;
|
|
4664
4690
|
}
|
|
4665
4691
|
/** Run work with an isolated registry that follows its async call chain. */
|
|
4666
4692
|
runScoped(callback) {
|
|
4667
|
-
return this.scopes.run(
|
|
4693
|
+
return this.scopes.run(createState(), callback);
|
|
4668
4694
|
}
|
|
4669
4695
|
/**
|
|
4670
4696
|
* Register a bookmark
|
|
@@ -4677,6 +4703,19 @@ var BookmarkRegistry = class {
|
|
|
4677
4703
|
}
|
|
4678
4704
|
this.state.bookmarks.set(id, { id, title, type });
|
|
4679
4705
|
}
|
|
4706
|
+
/**
|
|
4707
|
+
* A `w:id` no other bookmark in this document will use.
|
|
4708
|
+
*
|
|
4709
|
+
* docx's own `Bookmark` cannot supply one: its constructor builds a fresh
|
|
4710
|
+
* id generator per instance (`bookmarkUniqueNumericIdGen()`), so every
|
|
4711
|
+
* bookmark it emits carries `w:id="1"`. Reported upstream as dolanmiu/docx
|
|
4712
|
+
* #3478, still unreleased as of 9.7.1. Duplicated ids leave the start/end
|
|
4713
|
+
* pairing ambiguous, which is why a `REF` field could not read a target's
|
|
4714
|
+
* text even though navigating to it by name worked.
|
|
4715
|
+
*/
|
|
4716
|
+
allocateLinkId() {
|
|
4717
|
+
return this.state.nextLinkId++;
|
|
4718
|
+
}
|
|
4680
4719
|
/**
|
|
4681
4720
|
* Generate a unique bookmark ID from text
|
|
4682
4721
|
* Converts text to a URL-friendly format
|
|
@@ -4726,6 +4765,14 @@ var BookmarkRegistry = class {
|
|
|
4726
4765
|
}
|
|
4727
4766
|
};
|
|
4728
4767
|
var globalBookmarkRegistry = new BookmarkRegistry();
|
|
4768
|
+
function createBookmarkedContent(name, children) {
|
|
4769
|
+
const linkId = globalBookmarkRegistry.allocateLinkId();
|
|
4770
|
+
return [
|
|
4771
|
+
new BookmarkStart(name, linkId),
|
|
4772
|
+
...children,
|
|
4773
|
+
new BookmarkEnd(linkId)
|
|
4774
|
+
];
|
|
4775
|
+
}
|
|
4729
4776
|
|
|
4730
4777
|
// src/utils/commentAnchors.ts
|
|
4731
4778
|
import {
|
|
@@ -4740,7 +4787,7 @@ import { Paragraph, TextRun as TextRun4 } from "docx";
|
|
|
4740
4787
|
import { AsyncLocalStorage as AsyncLocalStorage5 } from "async_hooks";
|
|
4741
4788
|
var DEFAULT_COMMENT_AUTHOR = "json-to-office";
|
|
4742
4789
|
var DEFAULT_COMMENT_DATE = "1970-01-01T00:00:00Z";
|
|
4743
|
-
function
|
|
4790
|
+
function createState2() {
|
|
4744
4791
|
return { counter: 0, comments: [], hasResolved: false };
|
|
4745
4792
|
}
|
|
4746
4793
|
function deriveInitials(author) {
|
|
@@ -4751,14 +4798,14 @@ function bodyParagraphs(text) {
|
|
|
4751
4798
|
return normalizeUnicodeText(text).split("\n").map((line) => new Paragraph({ children: [new TextRun4({ text: line })] }));
|
|
4752
4799
|
}
|
|
4753
4800
|
var CommentRegistry = class {
|
|
4754
|
-
fallback =
|
|
4801
|
+
fallback = createState2();
|
|
4755
4802
|
scopes = new AsyncLocalStorage5();
|
|
4756
4803
|
get state() {
|
|
4757
4804
|
return this.scopes.getStore() ?? this.fallback;
|
|
4758
4805
|
}
|
|
4759
4806
|
/** Run work with an isolated registry that follows its async call chain. */
|
|
4760
4807
|
runScoped(callback) {
|
|
4761
|
-
return this.scopes.run(
|
|
4808
|
+
return this.scopes.run(createState2(), callback);
|
|
4762
4809
|
}
|
|
4763
4810
|
/**
|
|
4764
4811
|
* Register a comment thread and return every id its anchors must carry — the
|
|
@@ -4826,7 +4873,7 @@ var CommentRegistry = class {
|
|
|
4826
4873
|
state.comments.length = 0;
|
|
4827
4874
|
state.hasResolved = false;
|
|
4828
4875
|
} else {
|
|
4829
|
-
this.fallback =
|
|
4876
|
+
this.fallback = createState2();
|
|
4830
4877
|
}
|
|
4831
4878
|
}
|
|
4832
4879
|
};
|
|
@@ -4848,7 +4895,7 @@ function closeCommentRange(ids) {
|
|
|
4848
4895
|
// src/utils/noteRegistry.ts
|
|
4849
4896
|
import { Paragraph as Paragraph2, TextRun as TextRun6 } from "docx";
|
|
4850
4897
|
import { AsyncLocalStorage as AsyncLocalStorage6 } from "async_hooks";
|
|
4851
|
-
function
|
|
4898
|
+
function createState3() {
|
|
4852
4899
|
return {
|
|
4853
4900
|
footnoteCounter: 0,
|
|
4854
4901
|
endnoteCounter: 0,
|
|
@@ -4865,14 +4912,14 @@ function bodyParagraphs2(text, style) {
|
|
|
4865
4912
|
);
|
|
4866
4913
|
}
|
|
4867
4914
|
var NoteRegistry = class {
|
|
4868
|
-
fallback =
|
|
4915
|
+
fallback = createState3();
|
|
4869
4916
|
scopes = new AsyncLocalStorage6();
|
|
4870
4917
|
get state() {
|
|
4871
4918
|
return this.scopes.getStore() ?? this.fallback;
|
|
4872
4919
|
}
|
|
4873
4920
|
/** Run work with an isolated registry that follows its async call chain. */
|
|
4874
4921
|
runScoped(callback) {
|
|
4875
|
-
return this.scopes.run(
|
|
4922
|
+
return this.scopes.run(createState3(), callback);
|
|
4876
4923
|
}
|
|
4877
4924
|
/**
|
|
4878
4925
|
* Register a footnote body and return the id its reference must use. Ids are
|
|
@@ -4916,7 +4963,7 @@ var NoteRegistry = class {
|
|
|
4916
4963
|
delete state.endnotes[key];
|
|
4917
4964
|
}
|
|
4918
4965
|
} else {
|
|
4919
|
-
this.fallback =
|
|
4966
|
+
this.fallback = createState3();
|
|
4920
4967
|
}
|
|
4921
4968
|
}
|
|
4922
4969
|
};
|
|
@@ -5082,10 +5129,7 @@ function createText(content, theme, themeName, options = {}) {
|
|
|
5082
5129
|
"paragraph"
|
|
5083
5130
|
);
|
|
5084
5131
|
children.push(
|
|
5085
|
-
|
|
5086
|
-
id: options.bookmarkId,
|
|
5087
|
-
children: revisionRuns
|
|
5088
|
-
})
|
|
5132
|
+
...createBookmarkedContent(options.bookmarkId, revisionRuns)
|
|
5089
5133
|
);
|
|
5090
5134
|
} else {
|
|
5091
5135
|
children.push(...revisionRuns);
|
|
@@ -5108,12 +5152,7 @@ function createText(content, theme, themeName, options = {}) {
|
|
|
5108
5152
|
normalizedContent,
|
|
5109
5153
|
"paragraph"
|
|
5110
5154
|
);
|
|
5111
|
-
children.push(
|
|
5112
|
-
new Bookmark({
|
|
5113
|
-
id: options.bookmarkId,
|
|
5114
|
-
children: textRuns
|
|
5115
|
-
})
|
|
5116
|
-
);
|
|
5155
|
+
children.push(...createBookmarkedContent(options.bookmarkId, textRuns));
|
|
5117
5156
|
} else {
|
|
5118
5157
|
children.push(...textRuns);
|
|
5119
5158
|
}
|
|
@@ -5274,10 +5313,7 @@ function createHeading(text, level, theme, _themeName, options = {}) {
|
|
|
5274
5313
|
"heading"
|
|
5275
5314
|
);
|
|
5276
5315
|
children.push(
|
|
5277
|
-
|
|
5278
|
-
id: options.bookmarkId,
|
|
5279
|
-
children: revisionRuns
|
|
5280
|
-
})
|
|
5316
|
+
...createBookmarkedContent(options.bookmarkId, revisionRuns)
|
|
5281
5317
|
);
|
|
5282
5318
|
} else {
|
|
5283
5319
|
children.push(...revisionRuns);
|
|
@@ -5300,10 +5336,7 @@ function createHeading(text, level, theme, _themeName, options = {}) {
|
|
|
5300
5336
|
headingTextChildren.push(...makeHeadingRuns(normalizedText));
|
|
5301
5337
|
}
|
|
5302
5338
|
children.push(
|
|
5303
|
-
|
|
5304
|
-
id: options.bookmarkId,
|
|
5305
|
-
children: headingTextChildren
|
|
5306
|
-
})
|
|
5339
|
+
...createBookmarkedContent(options.bookmarkId, headingTextChildren)
|
|
5307
5340
|
);
|
|
5308
5341
|
} else {
|
|
5309
5342
|
if (hasInlineSyntax) {
|
|
@@ -5495,9 +5528,7 @@ function createList(items, _theme, _themeName, options = {}) {
|
|
|
5495
5528
|
let itemContent = textRuns;
|
|
5496
5529
|
if (itemId) {
|
|
5497
5530
|
globalBookmarkRegistry.register(itemId, itemText, "list-item");
|
|
5498
|
-
itemContent =
|
|
5499
|
-
new Bookmark({ id: itemId, children: textRuns })
|
|
5500
|
-
];
|
|
5531
|
+
itemContent = createBookmarkedContent(itemId, textRuns);
|
|
5501
5532
|
}
|
|
5502
5533
|
const paragraphChildren = [
|
|
5503
5534
|
...commentAnchor && index === firstRendered ? commentAnchor.start : [],
|
|
@@ -7342,23 +7373,23 @@ async function renderTableComponent(component, theme, themeName) {
|
|
|
7342
7373
|
}
|
|
7343
7374
|
|
|
7344
7375
|
// src/components/section.ts
|
|
7345
|
-
import { Paragraph as Paragraph6, BookmarkStart, BookmarkEnd } from "docx";
|
|
7376
|
+
import { Paragraph as Paragraph6, BookmarkStart as BookmarkStart2, BookmarkEnd as BookmarkEnd2 } from "docx";
|
|
7346
7377
|
|
|
7347
7378
|
// src/core/sectionBookmarks.ts
|
|
7348
7379
|
import { AsyncLocalStorage as AsyncLocalStorage8 } from "async_hooks";
|
|
7349
7380
|
var NESTED_LINK_ID_BASE = 1e6;
|
|
7350
|
-
function
|
|
7381
|
+
function createState4() {
|
|
7351
7382
|
return { nextNested: 1, resolved: /* @__PURE__ */ new WeakMap() };
|
|
7352
7383
|
}
|
|
7353
7384
|
var SectionBookmarkRegistry = class {
|
|
7354
|
-
fallback =
|
|
7385
|
+
fallback = createState4();
|
|
7355
7386
|
scopes = new AsyncLocalStorage8();
|
|
7356
7387
|
get state() {
|
|
7357
7388
|
return this.scopes.getStore() ?? this.fallback;
|
|
7358
7389
|
}
|
|
7359
7390
|
/** Run work with an isolated registry that follows its async call chain. */
|
|
7360
7391
|
runScoped(callback) {
|
|
7361
|
-
return this.scopes.run(
|
|
7392
|
+
return this.scopes.run(createState4(), callback);
|
|
7362
7393
|
}
|
|
7363
7394
|
/**
|
|
7364
7395
|
* The bookmark for a layout section, derived from its ordinal.
|
|
@@ -7389,7 +7420,7 @@ var SectionBookmarkRegistry = class {
|
|
|
7389
7420
|
/** Test-only: reset the unscoped fallback counters. */
|
|
7390
7421
|
clear() {
|
|
7391
7422
|
if (!this.scopes.getStore()) {
|
|
7392
|
-
this.fallback =
|
|
7423
|
+
this.fallback = createState4();
|
|
7393
7424
|
}
|
|
7394
7425
|
}
|
|
7395
7426
|
};
|
|
@@ -7402,7 +7433,7 @@ async function renderSectionComponent(component, theme, themeName, context) {
|
|
|
7402
7433
|
const { id: sectionBookmarkId, linkId: bookmarkLinkId } = globalSectionBookmarkRegistry.forSectionComponent(component);
|
|
7403
7434
|
elements.push(
|
|
7404
7435
|
new Paragraph6({
|
|
7405
|
-
children: [new
|
|
7436
|
+
children: [new BookmarkStart2(sectionBookmarkId, bookmarkLinkId)],
|
|
7406
7437
|
spacing: {
|
|
7407
7438
|
before: 0,
|
|
7408
7439
|
after: 0,
|
|
@@ -7430,7 +7461,7 @@ async function renderSectionComponent(component, theme, themeName, context) {
|
|
|
7430
7461
|
}
|
|
7431
7462
|
elements.push(
|
|
7432
7463
|
new Paragraph6({
|
|
7433
|
-
children: [new
|
|
7464
|
+
children: [new BookmarkEnd2(bookmarkLinkId)],
|
|
7434
7465
|
spacing: {
|
|
7435
7466
|
before: 0,
|
|
7436
7467
|
after: 0,
|
|
@@ -8918,7 +8949,7 @@ async function renderSection(section, theme, themeName, context, sectionOrdinal,
|
|
|
8918
8949
|
if (sectionBookmarkId && isFirstLayoutOfUserSection && sharedLinkId !== void 0) {
|
|
8919
8950
|
elements.push(
|
|
8920
8951
|
new Paragraph9({
|
|
8921
|
-
children: [new
|
|
8952
|
+
children: [new BookmarkStart3(sectionBookmarkId, sharedLinkId)],
|
|
8922
8953
|
spacing: {
|
|
8923
8954
|
before: 0,
|
|
8924
8955
|
after: 0,
|
|
@@ -8943,7 +8974,7 @@ async function renderSection(section, theme, themeName, context, sectionOrdinal,
|
|
|
8943
8974
|
if (closeBookmark && sharedLinkId !== void 0) {
|
|
8944
8975
|
elements.push(
|
|
8945
8976
|
new Paragraph9({
|
|
8946
|
-
children: [new
|
|
8977
|
+
children: [new BookmarkEnd3(sharedLinkId)]
|
|
8947
8978
|
})
|
|
8948
8979
|
);
|
|
8949
8980
|
}
|