@forevka/wordcanvas 0.8.1 → 0.9.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/dist-lib/assets/{worker-BFAbWoje.js → worker-VdvO3cMW.js} +1198 -1182
- package/dist-lib/builder.js +5 -5
- package/dist-lib/{editorApp-CQn18PAu.js → editorApp-BGyP48-P.js} +37 -36
- package/dist-lib/{recalcToc-Dzz8cQho.js → engine-Chvebzwr.js} +525 -548
- package/dist-lib/export.js +8 -7
- package/dist-lib/generate-toc.js +7 -6
- package/dist-lib/import.js +2 -2
- package/dist-lib/{lists-DpmgbDyt.js → lists-BVCy5dMa.js} +2 -2
- package/dist-lib/{parse-CIuWi88O.js → parse-PD2rg4oO.js} +28 -28
- package/dist-lib/{pipeline-DQil8qUX.js → pipeline-r7GVSMFb.js} +60 -60
- package/dist-lib/query.js +977 -0
- package/dist-lib/recalc-docx.js +22 -21
- package/dist-lib/recalcToc-CAeOzLr3.js +37 -0
- package/dist-lib/{stylesheet-BeM16Mvj.js → stylesheet-IH4Hyc8o.js} +3 -3
- package/dist-lib/{toc-C-JErW1U.js → toc-B-TzD-Mr.js} +102 -86
- package/dist-lib/{webmcp-B9Q6w0Vl.js → webmcp-CDpzmTtU.js} +2 -2
- package/dist-lib/{wordcanvas-Cla5Ys8Y.js → wordcanvas-CIqBAV2w.js} +3 -3
- package/dist-lib/wordcanvas.js +1 -1
- package/dist-node/{chunk-JVSPB6WM.js → chunk-A53KB3BE.js} +2 -2
- package/dist-node/{chunk-HMBQQDXD.js → chunk-TLGEFCLV.js} +64 -1
- package/dist-node/chunk-TLGEFCLV.js.map +7 -0
- package/dist-node/{chunk-KZHUXFDE.js → chunk-VNDCELYX.js} +5 -45
- package/dist-node/chunk-VNDCELYX.js.map +7 -0
- package/dist-node/{engine-46GL2RKU.js → engine-QKH45ZHY.js} +5 -4
- package/dist-node/export.js +3 -3
- package/dist-node/generate-toc.js +3 -3
- package/dist-node/import.js +2 -2
- package/dist-node/recalc-docx.js +2 -2
- package/package.json +6 -2
- package/types/builder.d.ts +47 -2
- package/types/model.d.ts +34 -0
- package/types/query.d.ts +416 -0
- package/dist-node/chunk-HMBQQDXD.js.map +0 -7
- package/dist-node/chunk-KZHUXFDE.js.map +0 -7
- /package/dist-node/{chunk-JVSPB6WM.js.map → chunk-A53KB3BE.js.map} +0 -0
- /package/dist-node/{engine-46GL2RKU.js.map → engine-QKH45ZHY.js.map} +0 -0
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
effectiveFractions,
|
|
9
9
|
formatListNumber,
|
|
10
10
|
isHiddenParagraph,
|
|
11
|
-
markerText
|
|
12
|
-
|
|
11
|
+
markerText,
|
|
12
|
+
resolveSections
|
|
13
|
+
} from "./chunk-TLGEFCLV.js";
|
|
13
14
|
import {
|
|
14
15
|
MATH_FONT_FAMILY,
|
|
15
16
|
PARA_BORDER_PAD_PX,
|
|
@@ -5281,30 +5282,6 @@ var ORPHAN_MIN = 2;
|
|
|
5281
5282
|
var WIDOW_MIN = 2;
|
|
5282
5283
|
var TOC_GUTTER = 48;
|
|
5283
5284
|
var BAND_KEYS = ["header", "footer", "headerFirst", "headerEven", "footerFirst", "footerEven"];
|
|
5284
|
-
function effectiveSection(base, patch) {
|
|
5285
|
-
const out = {
|
|
5286
|
-
pageWidthPx: patch.pageWidthPx ?? base.pageWidthPx,
|
|
5287
|
-
pageHeightPx: patch.pageHeightPx ?? base.pageHeightPx,
|
|
5288
|
-
marginPx: patch.marginPx ?? base.marginPx
|
|
5289
|
-
};
|
|
5290
|
-
const columns = patch.columns === void 0 ? base.columns : patch.columns ?? void 0;
|
|
5291
|
-
if (columns) out.columns = columns;
|
|
5292
|
-
if (patch.pageNumberStart !== void 0) out.pageNumberStart = patch.pageNumberStart;
|
|
5293
|
-
const headerDist = patch.headerDistancePx ?? base.headerDistancePx;
|
|
5294
|
-
if (headerDist !== void 0) out.headerDistancePx = headerDist;
|
|
5295
|
-
const footerDist = patch.footerDistancePx ?? base.footerDistancePx;
|
|
5296
|
-
if (footerDist !== void 0) out.footerDistancePx = footerDist;
|
|
5297
|
-
const pageColorHex = patch.pageColorHex ?? base.pageColorHex;
|
|
5298
|
-
if (pageColorHex !== void 0) out.pageColorHex = pageColorHex;
|
|
5299
|
-
const pageBorders = patch.pageBorders ?? base.pageBorders;
|
|
5300
|
-
if (pageBorders !== void 0) out.pageBorders = pageBorders;
|
|
5301
|
-
if (patch.lineNumbering !== void 0) out.lineNumbering = patch.lineNumbering;
|
|
5302
|
-
for (const key of BAND_KEYS) {
|
|
5303
|
-
const blocks = patch[key] ?? base[key];
|
|
5304
|
-
if (blocks) out[key] = blocks;
|
|
5305
|
-
}
|
|
5306
|
-
return out;
|
|
5307
|
-
}
|
|
5308
5285
|
function headerBandTop(s, bandHeight) {
|
|
5309
5286
|
if (s.headerDistancePx !== void 0) return s.headerDistancePx;
|
|
5310
5287
|
return Math.max(8, (s.marginPx.top - bandHeight) / 2);
|
|
@@ -5313,21 +5290,6 @@ function footerBandTop(s, bandHeight) {
|
|
|
5313
5290
|
if (s.footerDistancePx !== void 0) return s.pageHeightPx - s.footerDistancePx - bandHeight;
|
|
5314
5291
|
return s.pageHeightPx - Math.max(8, (s.marginPx.bottom - bandHeight) / 2) - bandHeight;
|
|
5315
5292
|
}
|
|
5316
|
-
function resolveSections(doc) {
|
|
5317
|
-
const out = [];
|
|
5318
|
-
for (let i = 0; i < doc.blocks.length; i++) {
|
|
5319
|
-
const b = doc.blocks[i];
|
|
5320
|
-
if (b.kind === "paragraph" && b.style.sectionBreak) {
|
|
5321
|
-
out.push({
|
|
5322
|
-
props: effectiveSection(doc.section, b.style.sectionBreak.props),
|
|
5323
|
-
endBlock: i,
|
|
5324
|
-
breakType: b.style.sectionBreak.type
|
|
5325
|
-
});
|
|
5326
|
-
}
|
|
5327
|
-
}
|
|
5328
|
-
out.push({ props: doc.section, endBlock: doc.blocks.length - 1, breakType: doc.section.breakType ?? "nextPage" });
|
|
5329
|
-
return out;
|
|
5330
|
-
}
|
|
5331
5293
|
function layoutDocument(doc, getLines, getPrepared, rawBand, measureTableCached = measureTable, layoutBandCached = layoutBand) {
|
|
5332
5294
|
const BAND_GAP = 6;
|
|
5333
5295
|
const bandBoxCache = /* @__PURE__ */ new Map();
|
|
@@ -6957,8 +6919,6 @@ function placeTable(t, rows, colWidths, x, y, width, firstRowIndex, listCtx) {
|
|
|
6957
6919
|
}
|
|
6958
6920
|
|
|
6959
6921
|
export {
|
|
6960
|
-
createLayoutEngine
|
|
6961
|
-
effectiveSection,
|
|
6962
|
-
resolveSections
|
|
6922
|
+
createLayoutEngine
|
|
6963
6923
|
};
|
|
6964
|
-
//# sourceMappingURL=chunk-
|
|
6924
|
+
//# sourceMappingURL=chunk-VNDCELYX.js.map
|