ooxml-core 1.11.0 → 1.12.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/automation/index.cjs +210 -20
- package/dist/automation/index.mjs +210 -20
- package/dist/docx/embedded.cjs +1 -1
- package/dist/docx/embedded.mjs +1 -1
- package/dist/docx/index.cjs +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/layout/adapt-table.d.ts.map +1 -1
- package/dist/docx/layout/flow-table.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +145 -9
- package/dist/docx/layout/index.d.ts +1 -0
- package/dist/docx/layout/index.d.ts.map +1 -1
- package/dist/docx/layout/index.mjs +145 -10
- package/dist/docx/layout/input.d.ts +5 -0
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/layout-session.d.ts +10 -0
- package/dist/docx/layout/layout-session.d.ts.map +1 -0
- package/dist/docx/layout/nested-fragment-edges.d.ts.map +1 -1
- package/dist/docx/layout/paragraph-cache.d.ts +8 -0
- package/dist/docx/layout/paragraph-cache.d.ts.map +1 -0
- package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
- package/dist/docx/layout/paragraph-tokens.d.ts +1 -1
- package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
- package/dist/docx/layout/table-paragraph-keeps.d.ts +14 -0
- package/dist/docx/layout/table-paragraph-keeps.d.ts.map +1 -0
- package/dist/docx/load/index.cjs +1 -1
- package/dist/docx/load/index.mjs +1 -1
- package/dist/docx/ui/index.cjs +83 -6
- package/dist/docx/ui/index.mjs +83 -7
- package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
- package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
- package/dist/docx/ui/word-count.d.ts +3 -0
- package/dist/docx/ui/word-count.d.ts.map +1 -1
- package/dist/geometry/element-transform.d.ts +90 -0
- package/dist/geometry/element-transform.d.ts.map +1 -0
- package/dist/geometry/index.cjs +90 -0
- package/dist/geometry/index.d.ts +1 -0
- package/dist/geometry/index.d.ts.map +1 -1
- package/dist/geometry/index.mjs +83 -1
- package/dist/index.cjs +90 -0
- package/dist/index.mjs +90 -0
- package/dist/visio/index.cjs +314 -39
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +313 -40
- package/dist/visio/model.d.ts +12 -0
- package/dist/visio/model.d.ts.map +1 -1
- package/dist/visio/paper-sizes.d.ts +5 -0
- package/dist/visio/paper-sizes.d.ts.map +1 -1
- package/dist/visio/parser.d.ts.map +1 -1
- package/dist/visio/print-count.d.ts +20 -0
- package/dist/visio/print-count.d.ts.map +1 -0
- package/dist/visio/print-settings.d.ts +14 -0
- package/dist/visio/print-settings.d.ts.map +1 -0
- package/dist/visio/ui/index.cjs +194 -4
- package/dist/visio/ui/index.mjs +194 -4
- package/dist/xlsx/ui/ribbon/parts.d.ts +1 -0
- package/dist/xlsx/ui/ribbon/parts.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -10715,7 +10715,7 @@ function parseRowProperties(row3) {
|
|
|
10715
10715
|
const result2 = {};
|
|
10716
10716
|
const height = first2(trPr, "trHeight");
|
|
10717
10717
|
const heightTwips = dxa(getW(height, "val"));
|
|
10718
|
-
if (heightTwips) {
|
|
10718
|
+
if (heightTwips !== void 0) {
|
|
10719
10719
|
result2.heightTwips = heightTwips;
|
|
10720
10720
|
result2.heightRule = getW(height, "hRule") === "exact" ? "exact" : "atLeast";
|
|
10721
10721
|
}
|
|
@@ -48838,6 +48838,177 @@ function readVisioPageSetup(cells3) {
|
|
|
48838
48838
|
return Object.keys(result2).length ? result2 : void 0;
|
|
48839
48839
|
}
|
|
48840
48840
|
|
|
48841
|
+
// visio/print-settings.ts
|
|
48842
|
+
var NAMES = [
|
|
48843
|
+
"PaperKind",
|
|
48844
|
+
"PrintPageOrientation",
|
|
48845
|
+
"PageLeftMargin",
|
|
48846
|
+
"PageRightMargin",
|
|
48847
|
+
"PageTopMargin",
|
|
48848
|
+
"PageBottomMargin",
|
|
48849
|
+
"ScaleX",
|
|
48850
|
+
"ScaleY",
|
|
48851
|
+
"OnPage",
|
|
48852
|
+
"PagesX",
|
|
48853
|
+
"PagesY",
|
|
48854
|
+
"CenterX",
|
|
48855
|
+
"CenterY"
|
|
48856
|
+
];
|
|
48857
|
+
var BOOLEAN = /* @__PURE__ */ new Set(["OnPage", "CenterX", "CenterY"]);
|
|
48858
|
+
var LENGTH = /* @__PURE__ */ new Set(["PageLeftMargin", "PageRightMargin", "PageTopMargin", "PageBottomMargin"]);
|
|
48859
|
+
var CANONICAL = new Map(
|
|
48860
|
+
[...NAMES, "PageWidth", "PageHeight", "PageScale", "DrawingScale"].map((name3) => [
|
|
48861
|
+
name3.toLowerCase(),
|
|
48862
|
+
name3
|
|
48863
|
+
])
|
|
48864
|
+
);
|
|
48865
|
+
function indexCells(sheet) {
|
|
48866
|
+
const cells3 = /* @__PURE__ */ new Map();
|
|
48867
|
+
let duplicate = false;
|
|
48868
|
+
for (const node2 of children3(sheet, "Cell")) {
|
|
48869
|
+
const name3 = attribute3(node2, "N") ?? "", canonical2 = CANONICAL.get(name3.toLowerCase());
|
|
48870
|
+
if (!canonical2) continue;
|
|
48871
|
+
if (canonical2 !== name3) duplicate = true;
|
|
48872
|
+
const values2 = cells3.get(canonical2) ?? [];
|
|
48873
|
+
if (values2.length < 2) values2.push(node2);
|
|
48874
|
+
cells3.set(canonical2, values2);
|
|
48875
|
+
if (values2.length > 1) duplicate = true;
|
|
48876
|
+
}
|
|
48877
|
+
return { cells: cells3, duplicate };
|
|
48878
|
+
}
|
|
48879
|
+
function createVisioPrintSettingsReader(documentSheets, rootStyles) {
|
|
48880
|
+
const indexes2 = { document: indexCells(documentSheets[0]), root: indexCells(rootStyles[0]) };
|
|
48881
|
+
return (pageSheets) => readVisioPrintCountSettings(pageSheets, documentSheets, rootStyles, indexes2);
|
|
48882
|
+
}
|
|
48883
|
+
function readVisioPrintCountSettings(pageSheets, documentSheets, rootStyles, indexes2) {
|
|
48884
|
+
let refusal;
|
|
48885
|
+
const refuse3 = (reason) => {
|
|
48886
|
+
refusal ??= reason;
|
|
48887
|
+
};
|
|
48888
|
+
if (pageSheets.length !== 1) refuse3("ambiguous-page-sheet");
|
|
48889
|
+
if (documentSheets.length > 1) refuse3("ambiguous-document-sheet");
|
|
48890
|
+
if (!documentSheets.length) refuse3("missing-setting");
|
|
48891
|
+
if (rootStyles.length > 1) refuse3("duplicate-setting");
|
|
48892
|
+
const root = rootStyles[0];
|
|
48893
|
+
if (!root || attribute3(root, "ID") !== "0" || attribute3(root, "NameU") !== "No Style")
|
|
48894
|
+
refuse3("unsupported-print-style");
|
|
48895
|
+
for (const sheet of [...pageSheets, ...documentSheets])
|
|
48896
|
+
for (const name3 of ["LineStyle", "FillStyle", "TextStyle"])
|
|
48897
|
+
if (attribute3(sheet, name3) !== "0") refuse3("unsupported-print-style");
|
|
48898
|
+
for (const name3 of ["LineStyle", "FillStyle", "TextStyle"])
|
|
48899
|
+
if (attribute3(root, name3) !== void 0) refuse3("unsupported-print-style");
|
|
48900
|
+
const localIndex = indexCells(pageSheets[0]), rootIndex = indexes2?.root ?? indexCells(root);
|
|
48901
|
+
const documentIndex = indexes2?.document ?? indexCells(documentSheets[0]);
|
|
48902
|
+
if (localIndex.duplicate || rootIndex.duplicate || documentIndex.duplicate)
|
|
48903
|
+
refuse3("duplicate-setting");
|
|
48904
|
+
const local = localIndex.cells, inherited = rootIndex.cells;
|
|
48905
|
+
const read = (node2, name3, origin) => {
|
|
48906
|
+
const invalid3 = () => {
|
|
48907
|
+
refuse3(origin === "local" ? "invalid-local-setting" : "invalid-document-setting");
|
|
48908
|
+
return void 0;
|
|
48909
|
+
};
|
|
48910
|
+
if (node2.hasAttribute("E")) return invalid3();
|
|
48911
|
+
let raw2 = (attribute3(node2, "V") ?? "").trim();
|
|
48912
|
+
if (!raw2 || raw2.length > 128) return invalid3();
|
|
48913
|
+
if (BOOLEAN.has(name3)) {
|
|
48914
|
+
if (!["0", "1", "false", "true"].includes(raw2)) return invalid3();
|
|
48915
|
+
raw2 = raw2 === "true" ? "1" : raw2 === "false" ? "0" : raw2;
|
|
48916
|
+
}
|
|
48917
|
+
try {
|
|
48918
|
+
const value2 = visioFormulaCachedValue(raw2, attribute3(node2, "U"));
|
|
48919
|
+
const length = LENGTH.has(name3) || /^(PageWidth|PageHeight|PageScale|DrawingScale)$/.test(name3);
|
|
48920
|
+
if (!["scalar", ...length ? ["length"] : []].includes(value2.unit) || Math.abs(value2.value) > 1e9)
|
|
48921
|
+
return invalid3();
|
|
48922
|
+
const formula = attribute3(node2, "F");
|
|
48923
|
+
if (formula !== void 0) {
|
|
48924
|
+
const source2 = formula.trim();
|
|
48925
|
+
if (/^(true|false)$/i.test(source2)) {
|
|
48926
|
+
if ((source2.toLowerCase() === "true" ? 1 : 0) !== value2.value) return invalid3();
|
|
48927
|
+
} else {
|
|
48928
|
+
if (!source2 || source2 === "Inh") return invalid3();
|
|
48929
|
+
const limits = { maxLength: 512, maxNodes: 64, maxDepth: 16, maxSteps: 128 };
|
|
48930
|
+
const analysis = analyzeVisioFormula(source2, limits);
|
|
48931
|
+
if (analysis.dynamic || analysis.guarded || analysis.references.length || analysis.unsupportedFunctions.length) {
|
|
48932
|
+
refuse3("dynamic-setting");
|
|
48933
|
+
return void 0;
|
|
48934
|
+
}
|
|
48935
|
+
const evaluated = evaluateVisioFormula(
|
|
48936
|
+
source2,
|
|
48937
|
+
() => {
|
|
48938
|
+
throw new Error("Unexpected reference");
|
|
48939
|
+
},
|
|
48940
|
+
limits
|
|
48941
|
+
);
|
|
48942
|
+
if (evaluated.value !== value2.value || !["scalar", ...length ? ["length"] : []].includes(evaluated.unit))
|
|
48943
|
+
return invalid3();
|
|
48944
|
+
}
|
|
48945
|
+
}
|
|
48946
|
+
return value2.value;
|
|
48947
|
+
} catch {
|
|
48948
|
+
return invalid3();
|
|
48949
|
+
}
|
|
48950
|
+
};
|
|
48951
|
+
const values2 = /* @__PURE__ */ new Map();
|
|
48952
|
+
for (const name3 of NAMES) {
|
|
48953
|
+
const nodes = local.get(name3) ?? inherited.get(name3);
|
|
48954
|
+
if (!nodes?.length) continue;
|
|
48955
|
+
if (nodes.length !== 1) continue;
|
|
48956
|
+
const value2 = read(nodes[0], name3, local.has(name3) ? "local" : "document");
|
|
48957
|
+
if (value2 !== void 0) values2.set(name3, value2);
|
|
48958
|
+
}
|
|
48959
|
+
for (const name3 of ["PageWidth", "PageHeight", "PageScale", "DrawingScale"]) {
|
|
48960
|
+
const nodes = local.get(name3);
|
|
48961
|
+
if (!nodes || nodes.length !== 1 || !(read(nodes[0], name3, "local") > 0))
|
|
48962
|
+
refuse3("unusable-drawing-scale");
|
|
48963
|
+
}
|
|
48964
|
+
const setup = {};
|
|
48965
|
+
const paper = values2.get("PaperKind");
|
|
48966
|
+
if (paper !== void 0 && Number.isSafeInteger(paper) && paper >= 0 && paper <= 65535)
|
|
48967
|
+
setup.paperKind = paper;
|
|
48968
|
+
else if (paper !== void 0)
|
|
48969
|
+
refuse3(local.has("PaperKind") ? "invalid-local-setting" : "invalid-document-setting");
|
|
48970
|
+
const orientation = values2.get("PrintPageOrientation");
|
|
48971
|
+
if (orientation === 0 || orientation === 1 || orientation === 2)
|
|
48972
|
+
setup.printPageOrientation = orientation;
|
|
48973
|
+
else if (orientation !== void 0)
|
|
48974
|
+
refuse3(
|
|
48975
|
+
local.has("PrintPageOrientation") ? "invalid-local-setting" : "invalid-document-setting"
|
|
48976
|
+
);
|
|
48977
|
+
const margins = ["Left", "Right", "Top", "Bottom"].map((side2) => values2.get(`Page${side2}Margin`));
|
|
48978
|
+
if (margins.every((n) => n !== void 0 && n >= 0 && n <= 1e3))
|
|
48979
|
+
setup.margins = {
|
|
48980
|
+
left: margins[0],
|
|
48981
|
+
right: margins[1],
|
|
48982
|
+
top: margins[2],
|
|
48983
|
+
bottom: margins[3]
|
|
48984
|
+
};
|
|
48985
|
+
else if (margins.some((n) => n !== void 0 && (n < 0 || n > 1e3)))
|
|
48986
|
+
refuse3("unusable-print-area");
|
|
48987
|
+
for (const [name3, key2] of [
|
|
48988
|
+
["ScaleX", "printZoom"],
|
|
48989
|
+
["ScaleY", "printZoomY"],
|
|
48990
|
+
["PagesX", "printPagesAcross"],
|
|
48991
|
+
["PagesY", "printPagesDown"]
|
|
48992
|
+
]) {
|
|
48993
|
+
const value2 = values2.get(name3);
|
|
48994
|
+
if (value2 !== void 0) {
|
|
48995
|
+
if ((name3 === "PagesX" || name3 === "PagesY") && (!Number.isSafeInteger(value2) || value2 < 1))
|
|
48996
|
+
refuse3(local.has(name3) ? "invalid-local-setting" : "invalid-document-setting");
|
|
48997
|
+
else setup[key2] = value2;
|
|
48998
|
+
}
|
|
48999
|
+
}
|
|
49000
|
+
for (const [name3, key2] of [
|
|
49001
|
+
["OnPage", "printFitToPages"],
|
|
49002
|
+
["CenterX", "printCenterX"],
|
|
49003
|
+
["CenterY", "printCenterY"]
|
|
49004
|
+
]) {
|
|
49005
|
+
const value2 = values2.get(name3);
|
|
49006
|
+
if (value2 !== void 0) setup[key2] = value2 === 1;
|
|
49007
|
+
}
|
|
49008
|
+
if (refusal) setup.printCountRefusal = refusal;
|
|
49009
|
+
return setup;
|
|
49010
|
+
}
|
|
49011
|
+
|
|
48841
49012
|
// visio/page-layout.ts
|
|
48842
49013
|
var VISIO_GRID_DENSITIES = Object.freeze([0, 2, 4, 8]);
|
|
48843
49014
|
var VISIO_RULER_DENSITIES = Object.freeze([8, 16, 32]);
|
|
@@ -48861,7 +49032,7 @@ var VISIO_PAGE_LAYOUT_DEFAULTS = Object.freeze({
|
|
|
48861
49032
|
rulerOriginX: 0,
|
|
48862
49033
|
rulerOriginY: 0
|
|
48863
49034
|
});
|
|
48864
|
-
var
|
|
49035
|
+
var NAMES2 = {
|
|
48865
49036
|
lineJumpCode: "LineJumpCode",
|
|
48866
49037
|
lineJumpStyle: "LineJumpStyle",
|
|
48867
49038
|
lineJumpDirectionX: "PageLineJumpDirX",
|
|
@@ -48884,8 +49055,8 @@ var NAMES = {
|
|
|
48884
49055
|
var NUMBER5 = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
48885
49056
|
function readVisioPageLayout(cells3) {
|
|
48886
49057
|
const result2 = {};
|
|
48887
|
-
for (const key2 of Object.keys(
|
|
48888
|
-
const cell = cells3.get(
|
|
49058
|
+
for (const key2 of Object.keys(NAMES2)) {
|
|
49059
|
+
const cell = cells3.get(NAMES2[key2]);
|
|
48889
49060
|
const raw2 = cell?.value?.trim();
|
|
48890
49061
|
if (!cell || cell.error !== void 0 || cell.formula === "Inh" || !raw2 || raw2.length > 64)
|
|
48891
49062
|
continue;
|
|
@@ -49172,6 +49343,11 @@ async function parseVsdx(input, options = {}) {
|
|
|
49172
49343
|
});
|
|
49173
49344
|
const rootStyle = styles.get("0");
|
|
49174
49345
|
if (rootStyle?.attributes.get("NameU") === "No Style") resources.rootSheet = rootStyle.sheet;
|
|
49346
|
+
const printStyleGroups = children3(documentRoot, "StyleSheets");
|
|
49347
|
+
const readPrintSettings = createVisioPrintSettingsReader(
|
|
49348
|
+
children3(documentRoot, "DocumentSheet"),
|
|
49349
|
+
printStyleGroups.length === 1 ? children3(printStyleGroups[0], "StyleSheet").filter((node2) => attribute3(node2, "ID") === "0") : []
|
|
49350
|
+
);
|
|
49175
49351
|
const masters = /* @__PURE__ */ new Map();
|
|
49176
49352
|
const masterRecords = [];
|
|
49177
49353
|
const mastersPart = await related(pkg, documentPart, "masters", false);
|
|
@@ -49335,7 +49511,17 @@ async function parseVsdx(input, options = {}) {
|
|
|
49335
49511
|
const value2 = number(sheet.cells, name3, Number.NaN, localReport);
|
|
49336
49512
|
if (Number.isSafeInteger(value2) && value2 >= 0 && value2 <= 255) pageModes[key2] = value2;
|
|
49337
49513
|
}
|
|
49338
|
-
const
|
|
49514
|
+
const { paperKind, printPageOrientation, margins, printZoom, ...countMetadata } = readPrintSettings(children3(page, "PageSheet"));
|
|
49515
|
+
const pageSetup = {
|
|
49516
|
+
...readVisioPageSetup(sheet.cells),
|
|
49517
|
+
...countMetadata,
|
|
49518
|
+
printCountSettings: {
|
|
49519
|
+
...paperKind === void 0 ? {} : { paperKind },
|
|
49520
|
+
...printPageOrientation === void 0 ? {} : { printPageOrientation },
|
|
49521
|
+
...margins === void 0 ? {} : { margins },
|
|
49522
|
+
...printZoom === void 0 ? {} : { printZoom }
|
|
49523
|
+
}
|
|
49524
|
+
};
|
|
49339
49525
|
const layout3 = readVisioPageLayout(sheet.cells);
|
|
49340
49526
|
for (const connection of connectors)
|
|
49341
49527
|
if (!seen.has(connection.fromShapeId) || !seen.has(connection.toShapeId))
|
|
@@ -50625,7 +50811,7 @@ function cellUnit(name3, relative) {
|
|
|
50625
50811
|
return "length";
|
|
50626
50812
|
return !relative && /\.[XY]\d+$/i.test(name3) ? "length" : "scalar";
|
|
50627
50813
|
}
|
|
50628
|
-
function
|
|
50814
|
+
function indexCells2(roots, options) {
|
|
50629
50815
|
const cells3 = /* @__PURE__ */ new Map();
|
|
50630
50816
|
const maxCells = bound(options.maxCells, 1e5);
|
|
50631
50817
|
const add3 = (item) => {
|
|
@@ -50835,7 +51021,7 @@ function createVisioCellEvaluator(cells3, options = {}, verifyCaches = false) {
|
|
|
50835
51021
|
|
|
50836
51022
|
// visio/edit-recalculate.ts
|
|
50837
51023
|
function recalculateVisioCells(roots, changed, options = {}) {
|
|
50838
|
-
const cells3 =
|
|
51024
|
+
const cells3 = indexCells2(roots, options);
|
|
50839
51025
|
const reverse2 = /* @__PURE__ */ new Map();
|
|
50840
51026
|
for (const [id3, item] of cells3)
|
|
50841
51027
|
for (const dependency of item.dependencies) {
|
|
@@ -50873,7 +51059,7 @@ function recalculateVisioCells(roots, changed, options = {}) {
|
|
|
50873
51059
|
return [...pages];
|
|
50874
51060
|
}
|
|
50875
51061
|
function assertVisioShapesUnreferenced(roots, removed, options = {}) {
|
|
50876
|
-
const cells3 =
|
|
51062
|
+
const cells3 = indexCells2(roots, options);
|
|
50877
51063
|
for (const cell of cells3.values()) {
|
|
50878
51064
|
options.check?.();
|
|
50879
51065
|
if (removed.get(cell.pageId)?.has(cell.shapeId)) continue;
|
|
@@ -50895,7 +51081,7 @@ function assertVisioShapeUnreferenced(roots, pageId2, shapeId2, options = {}) {
|
|
|
50895
51081
|
assertVisioShapesUnreferenced(roots, /* @__PURE__ */ new Map([[pageId2, /* @__PURE__ */ new Set([shapeId2])]]), options);
|
|
50896
51082
|
}
|
|
50897
51083
|
function createVisioDependencyQuery(roots, options = {}) {
|
|
50898
|
-
const cells3 =
|
|
51084
|
+
const cells3 = indexCells2(roots, options);
|
|
50899
51085
|
return (source2, targets) => {
|
|
50900
51086
|
const wanted = new Set(targets.map(key));
|
|
50901
51087
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -51563,7 +51749,7 @@ function serializeEditedXml(root, limits, check3) {
|
|
|
51563
51749
|
|
|
51564
51750
|
// visio/edit-formatting-scope.ts
|
|
51565
51751
|
async function assertFormattingDependencies(pkg, pagePaths, roots, pageId2, shape2, changed, check3, instanceView2) {
|
|
51566
|
-
|
|
51752
|
+
indexCells2(roots, { check: check3 });
|
|
51567
51753
|
const shapeId2 = attribute3(shape2, "ID");
|
|
51568
51754
|
const changedNames = new Set([...changed.keys()].map((name3) => name3.toLowerCase()));
|
|
51569
51755
|
const jumpOnly = [...changedNames].every(
|
|
@@ -58453,15 +58639,19 @@ var VISIO_PAPER_SIZES = Object.freeze([
|
|
|
58453
58639
|
function visioPaperSize(paperKind) {
|
|
58454
58640
|
return VISIO_PAPER_SIZES.find((item) => item.paperKind === paperKind);
|
|
58455
58641
|
}
|
|
58642
|
+
function visioOrientedPaperSize(paper, landscape) {
|
|
58643
|
+
const short = Math.min(paper.width, paper.height), long = Math.max(paper.width, paper.height);
|
|
58644
|
+
return { width: landscape ? long : short, height: landscape ? short : long };
|
|
58645
|
+
}
|
|
58456
58646
|
function visioPrintTile(page, paper = page.pageSetup?.paperKind === void 0 ? void 0 : visioPaperSize(page.pageSetup.paperKind)) {
|
|
58457
58647
|
if (!paper) return void 0;
|
|
58458
58648
|
const setup = page.pageSetup;
|
|
58459
58649
|
const landscape = setup?.printPageOrientation === 2 || setup?.printPageOrientation !== 1 && page.width > page.height;
|
|
58460
|
-
const
|
|
58650
|
+
const oriented = visioOrientedPaperSize(paper, landscape);
|
|
58461
58651
|
const margins = setup?.margins ?? { left: 0, right: 0, top: 0, bottom: 0 };
|
|
58462
58652
|
const zoom = setup?.printZoom ?? 1;
|
|
58463
|
-
const width = (
|
|
58464
|
-
const height = (
|
|
58653
|
+
const width = (oriented.width - margins.left - margins.right) / zoom;
|
|
58654
|
+
const height = (oriented.height - margins.top - margins.bottom) / zoom;
|
|
58465
58655
|
return width > 0.01 && height > 0.01 ? { width, height } : void 0;
|
|
58466
58656
|
}
|
|
58467
58657
|
|
|
@@ -59991,7 +60181,7 @@ function resizeVisioShapeAtAnchor(roots, document, edit, check3, glueShapes = /*
|
|
|
59991
60181
|
for (const connection of children3(container, "Connect"))
|
|
59992
60182
|
if (!glueShapes.has(shape2) && ["FromSheet", "ToSheet"].some((name3) => attribute3(connection, name3) === edit.shapeId))
|
|
59993
60183
|
fail2("UNSUPPORTED_GEOMETRY_EDIT", "Glued shapes require routing outside this subset.");
|
|
59994
|
-
const graph =
|
|
60184
|
+
const graph = indexCells2(roots, { check: check3, glueShapes });
|
|
59995
60185
|
const id3 = (cell) => key({ pageId: edit.pageId, shapeId: edit.shapeId, cell });
|
|
59996
60186
|
const source2 = createVisioCellEvaluator(graph, { check: check3, glueShapes }, true);
|
|
59997
60187
|
const read = (name3, fallback) => graph.has(id3(name3)) ? source2(id3(name3)).value : numeric4(local.get(name3), fallback);
|
|
@@ -60160,7 +60350,7 @@ function editableTransformCell(roots, edit, node2, check3, options = {}) {
|
|
|
60160
60350
|
const formula = executableCellFormula(attribute3(node2, "F"));
|
|
60161
60351
|
if (!formula || !analyzeVisioFormula(formula).references.length) return editableCell(node2);
|
|
60162
60352
|
const evaluate = createVisioCellEvaluator(
|
|
60163
|
-
|
|
60353
|
+
indexCells2(roots, { ...options, check: check3 }),
|
|
60164
60354
|
{ ...options, check: check3 },
|
|
60165
60355
|
true
|
|
60166
60356
|
);
|
|
@@ -60290,7 +60480,7 @@ function prepareMasterMovePins(roots, commands, bindings, check3) {
|
|
|
60290
60480
|
}
|
|
60291
60481
|
}
|
|
60292
60482
|
if (result2.size) {
|
|
60293
|
-
const indexed =
|
|
60483
|
+
const indexed = indexCells2(roots, { check: check3 });
|
|
60294
60484
|
const pins = new Set(
|
|
60295
60485
|
[...indexed.values()].filter((cell) => cell.node && result2.has(cell.node)).map(key)
|
|
60296
60486
|
);
|
|
@@ -61241,7 +61431,7 @@ async function recalculatePageFormulas(pkg, pagesPart, pages, paths, dirty, chec
|
|
|
61241
61431
|
if (!needed) return;
|
|
61242
61432
|
const options = { check: check3, pageContext: after };
|
|
61243
61433
|
const changed = [];
|
|
61244
|
-
for (const cell of
|
|
61434
|
+
for (const cell of indexCells2(roots, options).values()) {
|
|
61245
61435
|
if (!cell.node) continue;
|
|
61246
61436
|
const functions = pageFunctions(attribute3(cell.node, "F") ?? "");
|
|
61247
61437
|
const old = before.get(cell.pageId), current = after.get(cell.pageId);
|
|
@@ -62678,7 +62868,7 @@ async function duplicateVisioShapes(pkg, pagePaths, roots, document, edit, check
|
|
|
62678
62868
|
structural ||= !source2 || await shapeIsStructural(source2, template);
|
|
62679
62869
|
}
|
|
62680
62870
|
await assertDuplicateScope(pkg, pagePaths, root, newIds, check3, structural);
|
|
62681
|
-
const indexed =
|
|
62871
|
+
const indexed = indexCells2(detached ? /* @__PURE__ */ new Map([[sourcePageId, sourceRoot]]) : roots, { check: check3 });
|
|
62682
62872
|
const evaluate = createVisioCellEvaluator(indexed, { check: check3 }, true);
|
|
62683
62873
|
const containers = children3(root, "Shapes");
|
|
62684
62874
|
if (containers.length > 1) fail2("INVALID_SHAPE_ID", "Duplicate Shapes containers.");
|
|
@@ -63213,7 +63403,7 @@ function assertOutlineUnreferenced(roots, pageId2, shape2, check3) {
|
|
|
63213
63403
|
for (const node2 of section3.getElementsByTagNameNS(section3.namespaceURI, "Cell"))
|
|
63214
63404
|
owned.add(node2);
|
|
63215
63405
|
const prefix3 = JSON.stringify([pageId2, shapeId2]).slice(0, -1) + ",";
|
|
63216
|
-
for (const cell of
|
|
63406
|
+
for (const cell of indexCells2(roots, { check: check3 }).values()) {
|
|
63217
63407
|
check3();
|
|
63218
63408
|
if (cell.node && owned.has(cell.node)) continue;
|
|
63219
63409
|
for (const dependency of cell.dependencies) {
|
|
@@ -64417,7 +64607,7 @@ async function captureVisioClipboard(input, pageId2, shapeIds2, options = {}) {
|
|
|
64417
64607
|
}
|
|
64418
64608
|
await assertShapeOrderPackageScope(pkg, check3, structural);
|
|
64419
64609
|
const evaluate = createVisioCellEvaluator(
|
|
64420
|
-
|
|
64610
|
+
indexCells2(/* @__PURE__ */ new Map([[pageId2, root]]), { check: check3 }),
|
|
64421
64611
|
{ check: check3 },
|
|
64422
64612
|
true
|
|
64423
64613
|
);
|
package/dist/docx/embedded.cjs
CHANGED
|
@@ -8684,7 +8684,7 @@ function parseRowProperties(row) {
|
|
|
8684
8684
|
const result = {};
|
|
8685
8685
|
const height = first2(trPr, "trHeight");
|
|
8686
8686
|
const heightTwips = dxa(getW(height, "val"));
|
|
8687
|
-
if (heightTwips) {
|
|
8687
|
+
if (heightTwips !== void 0) {
|
|
8688
8688
|
result.heightTwips = heightTwips;
|
|
8689
8689
|
result.heightRule = getW(height, "hRule") === "exact" ? "exact" : "atLeast";
|
|
8690
8690
|
}
|
package/dist/docx/embedded.mjs
CHANGED
|
@@ -8678,7 +8678,7 @@ function parseRowProperties(row) {
|
|
|
8678
8678
|
const result = {};
|
|
8679
8679
|
const height = first2(trPr, "trHeight");
|
|
8680
8680
|
const heightTwips = dxa(getW(height, "val"));
|
|
8681
|
-
if (heightTwips) {
|
|
8681
|
+
if (heightTwips !== void 0) {
|
|
8682
8682
|
result.heightTwips = heightTwips;
|
|
8683
8683
|
result.heightRule = getW(height, "hRule") === "exact" ? "exact" : "atLeast";
|
|
8684
8684
|
}
|
package/dist/docx/index.cjs
CHANGED
|
@@ -11891,7 +11891,7 @@ function parseRowProperties(row) {
|
|
|
11891
11891
|
const result = {};
|
|
11892
11892
|
const height = first2(trPr, "trHeight");
|
|
11893
11893
|
const heightTwips = dxa(getW(height, "val"));
|
|
11894
|
-
if (heightTwips) {
|
|
11894
|
+
if (heightTwips !== void 0) {
|
|
11895
11895
|
result.heightTwips = heightTwips;
|
|
11896
11896
|
result.heightRule = getW(height, "hRule") === "exact" ? "exact" : "atLeast";
|
|
11897
11897
|
}
|
package/dist/docx/index.mjs
CHANGED
|
@@ -11885,7 +11885,7 @@ function parseRowProperties(row) {
|
|
|
11885
11885
|
const result = {};
|
|
11886
11886
|
const height = first2(trPr, "trHeight");
|
|
11887
11887
|
const heightTwips = dxa(getW(height, "val"));
|
|
11888
|
-
if (heightTwips) {
|
|
11888
|
+
if (heightTwips !== void 0) {
|
|
11889
11889
|
result.heightTwips = heightTwips;
|
|
11890
11890
|
result.heightRule = getW(height, "hRule") === "exact" ? "exact" : "atLeast";
|
|
11891
11891
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapt-table.d.ts","sourceRoot":"","sources":["../../../docx/layout/adapt-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,eAAe,EAEpB,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EACX,YAAY,EAGZ,eAAe,EACf,WAAW,EAGX,MAAM,SAAS,CAAC;AAWjB,qFAAqF;AACrF,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED,wBAAgB,MAAM,CACrB,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,mBAAmB,UAAQ,GACzB,YAAY,GAAG,SAAS,CAoB1B;
|
|
1
|
+
{"version":3,"file":"adapt-table.d.ts","sourceRoot":"","sources":["../../../docx/layout/adapt-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,eAAe,EAEpB,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EACX,YAAY,EAGZ,eAAe,EACf,WAAW,EAGX,MAAM,SAAS,CAAC;AAWjB,qFAAqF;AACrF,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED,wBAAgB,MAAM,CACrB,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAC7B,mBAAmB,UAAQ,GACzB,YAAY,GAAG,SAAS,CAoB1B;AAiBD;;;;GAIG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,EACpB,cAAc,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,eAAe,EACzD,OAAO,UAAQ,GACb,WAAW,CAsFb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-table.d.ts","sourceRoot":"","sources":["../../../docx/layout/flow-table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-table.d.ts","sourceRoot":"","sources":["../../../docx/layout/flow-table.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAG3D;;;;;;GAMG;AACH,wBAAgB,UAAU,CACzB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC/B,gBAAgB,CAAC,EAAE,kBAAkB,GACnC,IAAI,CAwUN"}
|