ooxml-core 0.10.0 → 0.11.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/docx.d.ts +13 -0
- package/dist/automation/docx.d.ts.map +1 -0
- package/dist/automation/index.cjs +36838 -0
- package/dist/automation/index.d.ts +6 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.mjs +36824 -0
- package/dist/automation/node.cjs +103 -0
- package/dist/automation/node.d.ts +16 -0
- package/dist/automation/node.d.ts.map +1 -0
- package/dist/automation/node.mjs +101 -0
- package/dist/automation/visio.d.ts +30 -0
- package/dist/automation/visio.d.ts.map +1 -0
- package/dist/automation/xlsx.d.ts +25 -0
- package/dist/automation/xlsx.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +149047 -0
- package/dist/pptx/automation/index.d.ts +1474 -0
- package/dist/pptx/automation/index.d.ts.map +1 -0
- package/dist/pptx/automation/index.mjs +148926 -0
- package/dist/pptx/chunks/{index-BWUBPGgv.d.ts → index-BWRd8p4y.d.ts} +2 -2
- package/dist/pptx/chunks/{index-BWUBPGgv.d.ts.map → index-BWRd8p4y.d.ts.map} +1 -1
- package/dist/pptx/chunks/index-LoCVDu8Z.d.ts +9644 -0
- package/dist/pptx/chunks/index-LoCVDu8Z.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-IlJiffp7.d.ts → text-operations-2tKzrY5o.d.ts} +7381 -7381
- package/dist/pptx/chunks/text-operations-2tKzrY5o.d.ts.map +1 -0
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/index.d.ts +4 -9644
- package/dist/visio/edit-geometry-admission.d.ts +1 -1
- package/dist/visio/edit-geometry-admission.d.ts.map +1 -1
- package/dist/visio/edit-geometry.d.ts +1 -1
- package/dist/visio/edit-geometry.d.ts.map +1 -1
- package/dist/visio/edit-master-move.d.ts +12 -0
- package/dist/visio/edit-master-move.d.ts.map +1 -0
- package/dist/visio/edit-master-scope.d.ts +1 -1
- package/dist/visio/edit-master-scope.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-index.d.ts +2 -0
- package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
- package/dist/visio/edit-scope.d.ts +1 -1
- package/dist/visio/edit-scope.d.ts.map +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/index.cjs +151 -14
- package/dist/visio/index.mjs +151 -14
- package/package.json +21 -3
- package/dist/pptx/chunks/text-operations-IlJiffp7.d.ts.map +0 -1
- package/dist/pptx/index.d.ts.map +0 -1
|
@@ -3,7 +3,7 @@ export declare const cells: (shape: Element) => Map<string, Element>;
|
|
|
3
3
|
export declare function numeric(node: Element | undefined, fallback?: number): number;
|
|
4
4
|
export declare function editableCell(node: Element | undefined): void;
|
|
5
5
|
export declare function setCell(shape: Element, name: string, value: number, formula?: string): void;
|
|
6
|
-
export declare function admitted(root: Element, shapeId: string): Element;
|
|
6
|
+
export declare function admitted(root: Element, shapeId: string, masterMovePins?: ReadonlySet<Element>): Element;
|
|
7
7
|
/** Only proven inactive inherited scalar protection is admitted; masters remain unsupported. */
|
|
8
8
|
export declare function protectedShape(shape: Element, document: Element): void;
|
|
9
9
|
export declare function resizeGeometry(shape: Element, roots: ReadonlyMap<string, Element>, edit: VisioGeometryEdit, check: () => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-geometry-admission.d.ts","sourceRoot":"","sources":["../../src/visio/edit-geometry-admission.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAW5D,eAAO,MAAM,KAAK,GAAI,OAAO,OAAO,yBAC+C,CAAC;AACpF,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5E;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAsB5D;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAa3F;AACD,wBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"edit-geometry-admission.d.ts","sourceRoot":"","sources":["../../src/visio/edit-geometry-admission.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAW5D,eAAO,MAAM,KAAK,GAAI,OAAO,OAAO,yBAC+C,CAAC;AACpF,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5E;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAsB5D;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAa3F;AACD,wBAAgB,QAAQ,CACvB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,WAAW,CAAC,OAAO,CAAa,GAC9C,OAAO,CA4CT;AACD,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAiGtE;AACD,wBAAgB,cAAc,CAC7B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,IAAI,GACf,IAAI,CA+CN"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { VisioGeometryEdit } from './edit-commands.js';
|
|
2
|
-
export declare function applyGeometryEdit(roots: ReadonlyMap<string, Element>, document: Element, edit: VisioGeometryEdit, check: () => void): readonly string[];
|
|
2
|
+
export declare function applyGeometryEdit(roots: ReadonlyMap<string, Element>, document: Element, edit: VisioGeometryEdit, check: () => void, masterMovePins?: ReadonlySet<Element>): readonly string[];
|
|
3
3
|
//# sourceMappingURL=edit-geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-geometry.d.ts","sourceRoot":"","sources":["../../src/visio/edit-geometry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA4E5D,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"edit-geometry.d.ts","sourceRoot":"","sources":["../../src/visio/edit-geometry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AA4E5D,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,MAAM,IAAI,EACjB,cAAc,GAAE,WAAW,CAAC,OAAO,CAAa,GAC9C,SAAS,MAAM,EAAE,CAsHnB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VisioGeometryEdit } from './edit-commands.js';
|
|
2
|
+
import type { MasterCellSource } from './edit-master-index.js';
|
|
3
|
+
interface MoveBinding {
|
|
4
|
+
instance?: Element;
|
|
5
|
+
template: Element;
|
|
6
|
+
cells: ReadonlyMap<string, MasterCellSource>;
|
|
7
|
+
inheritedCells: ReadonlyMap<string, MasterCellSource>;
|
|
8
|
+
}
|
|
9
|
+
/** Preparing pin leaves is not authorization: the entire master dependency proof must still succeed. */
|
|
10
|
+
export declare function prepareMasterMovePins(roots: ReadonlyMap<string, Element>, commands: readonly VisioGeometryEdit[], bindings: readonly MoveBinding[], check: () => void): ReadonlySet<Element>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=edit-master-move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit-master-move.d.ts","sourceRoot":"","sources":["../../src/visio/edit-master-move.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,UAAU,WAAW;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACtD;AAUD,wGAAwG;AACxG,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,KAAK,EAAE,MAAM,IAAI,GACf,WAAW,CAAC,OAAO,CAAC,CAqHtB"}
|
|
@@ -3,5 +3,5 @@ import type { VisioPackage } from './package.js';
|
|
|
3
3
|
/** Prove that effective cells of active master instances cannot depend on the edited local shapes.
|
|
4
4
|
* Definitions remain untouched. Unsupported formulas and unresolved scopes remain refused.
|
|
5
5
|
*/
|
|
6
|
-
export declare function assertVisioMasterIndependence(pkg: VisioPackage, roots: ReadonlyMap<string, Element>, commands: readonly VisioGeometryEdit[], check: () => void): Promise<
|
|
6
|
+
export declare function assertVisioMasterIndependence(pkg: VisioPackage, roots: ReadonlyMap<string, Element>, commands: readonly VisioGeometryEdit[], check: () => void): Promise<ReadonlySet<Element>>;
|
|
7
7
|
//# sourceMappingURL=edit-master-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-master-scope.d.ts","sourceRoot":"","sources":["../../src/visio/edit-master-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"edit-master-scope.d.ts","sourceRoot":"","sources":["../../src/visio/edit-master-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA+BjD;;GAEG;AACH,wBAAsB,6BAA6B,CAClD,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,KAAK,EAAE,MAAM,IAAI,GACf,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAgQ/B"}
|
|
@@ -10,6 +10,8 @@ export interface VisioRecalculationOptions {
|
|
|
10
10
|
maxSteps?: number;
|
|
11
11
|
maxDepth?: number;
|
|
12
12
|
check?: () => void;
|
|
13
|
+
/** Internal post-proof authorization of explicit local master move leaves only. */
|
|
14
|
+
masterMovePins?: ReadonlySet<Element>;
|
|
13
15
|
}
|
|
14
16
|
export interface IndexedCell extends VisioCellKey {
|
|
15
17
|
node?: Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-recalculate-index.d.ts","sourceRoot":"","sources":["../../src/visio/edit-recalculate-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG9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tE,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKzE;AAWD,oGAAoG;AACpG,wBAAgB,UAAU,CACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,OAAO,EAAE,yBAAyB,4BA0JlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VisioGeometryEdit } from './edit-commands.js';
|
|
2
2
|
import type { VisioPackage } from './package.js';
|
|
3
3
|
/** Separate master and page ShapeSheet ID namespaces; refuse unsupported affected metadata and inheritance. */
|
|
4
|
-
export declare function assertGeometryPackageScope(pkg: VisioPackage, pagePaths: ReadonlySet<string>, commands: readonly VisioGeometryEdit[], check: () => void, roots: ReadonlyMap<string, Element>): Promise<
|
|
4
|
+
export declare function assertGeometryPackageScope(pkg: VisioPackage, pagePaths: ReadonlySet<string>, commands: readonly VisioGeometryEdit[], check: () => void, roots: ReadonlyMap<string, Element>): Promise<ReadonlySet<Element>>;
|
|
5
5
|
//# sourceMappingURL=edit-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-scope.d.ts","sourceRoot":"","sources":["../../src/visio/edit-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA0CjD,+GAA+G;AAC/G,wBAAsB,0BAA0B,CAC/C,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAC9B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,KAAK,EAAE,MAAM,IAAI,EACjB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"edit-scope.d.ts","sourceRoot":"","sources":["../../src/visio/edit-scope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EAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/visio/edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9E,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGxE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF,MAAM,WAAW,eAAe;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,WAAW,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D;AAMD;;GAEG;AACH,wBAAsB,QAAQ,CAC7B,KAAK,EAAE,UAAU,GAAG,WAAW,EAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,CA4GzB"}
|
package/dist/visio/index.cjs
CHANGED
|
@@ -6183,7 +6183,7 @@ function recalculateVisioCells(roots, changed, options = {}) {
|
|
|
6183
6183
|
if (active.size >= maxDepth)
|
|
6184
6184
|
fail("LIMIT_FORMULA_DEPTH", "ShapeSheet dependency depth limit exceeded.");
|
|
6185
6185
|
const item = cells3.get(id);
|
|
6186
|
-
if (!item || item.unsafe)
|
|
6186
|
+
if (!item || item.unsafe && (!item.node || !options.masterMovePins?.has(item.node)))
|
|
6187
6187
|
fail(
|
|
6188
6188
|
"EDIT_UNSUPPORTED_DEPENDENCY",
|
|
6189
6189
|
"Affected formula references missing, inherited or grouped cells."
|
|
@@ -6336,7 +6336,7 @@ function setCell(shape, name, value, formula) {
|
|
|
6336
6336
|
if (formula) node.setAttribute("F", formula);
|
|
6337
6337
|
else if (attribute2(node, "F") !== "No Formula") node.removeAttribute("F");
|
|
6338
6338
|
}
|
|
6339
|
-
function admitted(root, shapeId) {
|
|
6339
|
+
function admitted(root, shapeId, masterMovePins = /* @__PURE__ */ new Set()) {
|
|
6340
6340
|
const containers = children(root, "Shapes");
|
|
6341
6341
|
if (containers.length !== 1)
|
|
6342
6342
|
fail("UNSUPPORTED_GEOMETRY_EDIT", "One local Shapes container is required.");
|
|
@@ -6346,7 +6346,10 @@ function admitted(root, shapeId) {
|
|
|
6346
6346
|
if (candidates.length !== 1)
|
|
6347
6347
|
fail("EDIT_TARGET_NOT_FOUND", "A unique top-level local shape is required.");
|
|
6348
6348
|
const shape = candidates[0];
|
|
6349
|
-
if (shape.hasAttribute("Master") || shape.hasAttribute("MasterShape")
|
|
6349
|
+
if ((shape.hasAttribute("Master") || shape.hasAttribute("MasterShape")) && !["PinX", "PinY"].every((name) => {
|
|
6350
|
+
const cell = cells(shape).get(name);
|
|
6351
|
+
return cell && masterMovePins.has(cell);
|
|
6352
|
+
}) || ["1", "true"].includes(attribute2(shape, "Del") ?? "") || children(shape, "Shapes").length || children(shape, "ForeignData").length || children(shape, "Rel").length || attribute2(shape, "Type") && attribute2(shape, "Type") !== "Shape")
|
|
6350
6353
|
fail(
|
|
6351
6354
|
"UNSUPPORTED_GEOMETRY_EDIT",
|
|
6352
6355
|
"Master, group, foreign, deleted and non-shape operations are unsupported."
|
|
@@ -6553,7 +6556,7 @@ function createRectangle(root, edit) {
|
|
|
6553
6556
|
container.appendChild(shape);
|
|
6554
6557
|
return shape;
|
|
6555
6558
|
}
|
|
6556
|
-
function applyGeometryEdit(roots, document, edit, check) {
|
|
6559
|
+
function applyGeometryEdit(roots, document, edit, check, masterMovePins = /* @__PURE__ */ new Set()) {
|
|
6557
6560
|
check();
|
|
6558
6561
|
const root = roots.get(edit.pageId);
|
|
6559
6562
|
if (!root) fail("EDIT_TARGET_NOT_FOUND", "Page does not exist.");
|
|
@@ -6565,7 +6568,11 @@ function applyGeometryEdit(roots, document, edit, check) {
|
|
|
6565
6568
|
expected = { width: edit.width, height: edit.height, x: edit.x, y: edit.y };
|
|
6566
6569
|
for (const name of ["Width", "Height", "PinX", "PinY"]) add(name);
|
|
6567
6570
|
} else {
|
|
6568
|
-
const shape = admitted(
|
|
6571
|
+
const shape = admitted(
|
|
6572
|
+
root,
|
|
6573
|
+
edit.shapeId,
|
|
6574
|
+
edit.type === "move-shape" ? masterMovePins : /* @__PURE__ */ new Set()
|
|
6575
|
+
);
|
|
6569
6576
|
protectedShape(shape, document);
|
|
6570
6577
|
if (edit.type !== "delete-shape") {
|
|
6571
6578
|
for (const connections2 of children(root, "Connects"))
|
|
@@ -6643,8 +6650,10 @@ function applyGeometryEdit(roots, document, edit, check) {
|
|
|
6643
6650
|
}
|
|
6644
6651
|
}
|
|
6645
6652
|
if (!changed.length) return [];
|
|
6646
|
-
const affectedPages = recalculateVisioCells(roots, changed, { check });
|
|
6647
|
-
const result = cells(
|
|
6653
|
+
const affectedPages = recalculateVisioCells(roots, changed, { check, masterMovePins });
|
|
6654
|
+
const result = cells(
|
|
6655
|
+
admitted(root, edit.shapeId, edit.type === "move-shape" ? masterMovePins : /* @__PURE__ */ new Set())
|
|
6656
|
+
);
|
|
6648
6657
|
if (expected && (numeric3(result.get("Width")) !== expected.width || numeric3(result.get("Height")) !== expected.height || numeric3(result.get("PinX"), expected.width / 2) !== expected.x || numeric3(result.get("PinY"), expected.height / 2) !== expected.y))
|
|
6649
6658
|
fail(
|
|
6650
6659
|
"EDIT_UNSUPPORTED_DEPENDENCY",
|
|
@@ -6692,6 +6701,116 @@ function analyzeVisioMasterFormula(source, options) {
|
|
|
6692
6701
|
return { ...analysis, references: [...references.values()], dynamic: dynamic2, readsText, readsTheme };
|
|
6693
6702
|
}
|
|
6694
6703
|
|
|
6704
|
+
// src/visio/edit-master-move.ts
|
|
6705
|
+
var protection = [
|
|
6706
|
+
"LockMoveX",
|
|
6707
|
+
"LockMoveY",
|
|
6708
|
+
"LockWidth",
|
|
6709
|
+
"LockHeight",
|
|
6710
|
+
"LockAspect",
|
|
6711
|
+
"LockDelete"
|
|
6712
|
+
];
|
|
6713
|
+
var dimensions2 = ["PinX", "PinY", "Width", "Height", "LocPinX", "LocPinY"];
|
|
6714
|
+
function prepareMasterMovePins(roots, commands, bindings, check) {
|
|
6715
|
+
const result = /* @__PURE__ */ new Set();
|
|
6716
|
+
let work = 1e5;
|
|
6717
|
+
const charge = (amount = 1) => {
|
|
6718
|
+
check();
|
|
6719
|
+
work -= amount;
|
|
6720
|
+
if (work < 0)
|
|
6721
|
+
fail("EDIT_UNSUPPORTED_PACKAGE_DEPENDENCY", "Master move preparation budget exceeded.");
|
|
6722
|
+
};
|
|
6723
|
+
const analyze = (formula) => {
|
|
6724
|
+
charge(formula.length);
|
|
6725
|
+
return analyzeVisioFormula(formula);
|
|
6726
|
+
};
|
|
6727
|
+
for (const command2 of commands) {
|
|
6728
|
+
charge();
|
|
6729
|
+
const root = roots.get(command2.pageId);
|
|
6730
|
+
const instance = children(children(root, "Shapes")[0], "Shape").find(
|
|
6731
|
+
(shape) => attribute2(shape, "ID") === command2.shapeId
|
|
6732
|
+
);
|
|
6733
|
+
if (!instance?.hasAttribute("Master")) continue;
|
|
6734
|
+
if (command2.type !== "move-shape")
|
|
6735
|
+
fail("UNSUPPORTED_GEOMETRY_EDIT", "Master-linked resizing and deletion remain unsupported.");
|
|
6736
|
+
const binding = bindings.find((candidate) => candidate.instance === instance);
|
|
6737
|
+
if (!binding) fail("UNSUPPORTED_GEOMETRY_EDIT", "A unique effective master root is required.");
|
|
6738
|
+
for (const node of [instance, binding.template]) {
|
|
6739
|
+
charge();
|
|
6740
|
+
if (attribute2(node, "Type") !== "Shape" || children(node, "Shapes").length || children(node, "ForeignData").length || children(node, "Rel").length || ["1", "true"].includes(attribute2(node, "Del") ?? ""))
|
|
6741
|
+
fail("UNSUPPORTED_GEOMETRY_EDIT", "Master moves require top-level local 2D shape roots.");
|
|
6742
|
+
}
|
|
6743
|
+
for (const name of ["BeginX", "BeginY", "EndX", "EndY"])
|
|
6744
|
+
if (binding.cells.has(name.toLowerCase()))
|
|
6745
|
+
fail("UNSUPPORTED_GEOMETRY_EDIT", "Master lines and endpoint routing remain unsupported.");
|
|
6746
|
+
const oneD = binding.cells.get("oned")?.node;
|
|
6747
|
+
charge();
|
|
6748
|
+
if (oneD && (numeric3(oneD) !== 0 || visioFormulaCachedValue(attribute2(oneD, "V") ?? "", attribute2(oneD, "U")).unit !== "scalar" || executableCellFormula(attribute2(oneD, "F"))))
|
|
6749
|
+
fail("UNSUPPORTED_GEOMETRY_EDIT", "A static effective 2D master is required.");
|
|
6750
|
+
const local = cells(instance);
|
|
6751
|
+
for (const name of dimensions2) {
|
|
6752
|
+
charge();
|
|
6753
|
+
const node = local.get(name);
|
|
6754
|
+
numeric3(node);
|
|
6755
|
+
if (visioFormulaCachedValue("0", attribute2(node, "U") ?? "DL").unit !== "length")
|
|
6756
|
+
fail("EDIT_FORMULA_UNIT", "Master transform caches require length units.");
|
|
6757
|
+
}
|
|
6758
|
+
if (numeric3(local.get("Width")) <= 0 || numeric3(local.get("Height")) <= 0)
|
|
6759
|
+
fail("UNSUPPORTED_GEOMETRY_EDIT", "Positive explicit local dimensions are required.");
|
|
6760
|
+
for (const name of protection) {
|
|
6761
|
+
charge();
|
|
6762
|
+
const node = binding.cells.get(name.toLowerCase())?.node;
|
|
6763
|
+
if (!node || visioFormulaCachedValue(attribute2(node, "V") ?? "", attribute2(node, "U")).unit !== "scalar" || numeric3(node) !== 0)
|
|
6764
|
+
fail(
|
|
6765
|
+
"EDIT_PROTECTED_CELL",
|
|
6766
|
+
"Effective master protection must be explicitly proven inactive."
|
|
6767
|
+
);
|
|
6768
|
+
const formula = executableCellFormula(attribute2(node, "F"));
|
|
6769
|
+
if (formula) {
|
|
6770
|
+
const analysis = analyze(formula);
|
|
6771
|
+
if (analysis.dynamic || analysis.references.length || analysis.unsupportedFunctions.length)
|
|
6772
|
+
fail("EDIT_PROTECTED_CELL", "Effective master protection dependencies are unsupported.");
|
|
6773
|
+
const value = evaluateVisioFormula(
|
|
6774
|
+
formula,
|
|
6775
|
+
() => fail("EDIT_PROTECTED_CELL", "Unexpected protection dependency."),
|
|
6776
|
+
{ onStep: () => charge() }
|
|
6777
|
+
);
|
|
6778
|
+
if (value.unit !== "scalar" || value.value !== 0)
|
|
6779
|
+
fail("EDIT_PROTECTED_CELL", "Effective master protection is active or stale.");
|
|
6780
|
+
}
|
|
6781
|
+
}
|
|
6782
|
+
for (const name of ["PinX", "PinY"]) {
|
|
6783
|
+
charge();
|
|
6784
|
+
const node = local.get(name);
|
|
6785
|
+
if (binding.cells.get(name.toLowerCase())?.node !== node)
|
|
6786
|
+
fail("EDIT_PROTECTED_CELL", "The rotation pin must be an explicit local override.");
|
|
6787
|
+
charge(executableCellFormula(attribute2(node, "F"))?.length ?? 0);
|
|
6788
|
+
editableCell(node);
|
|
6789
|
+
const inherited = binding.inheritedCells.get(name.toLowerCase())?.node;
|
|
6790
|
+
numeric3(inherited);
|
|
6791
|
+
if (visioFormulaCachedValue("0", attribute2(inherited, "U") ?? "DL").unit !== "length")
|
|
6792
|
+
fail("EDIT_FORMULA_UNIT", "Inherited rotation pins require length units.");
|
|
6793
|
+
const formula = executableCellFormula(attribute2(inherited, "F"));
|
|
6794
|
+
if (formula) {
|
|
6795
|
+
const analysis = analyze(formula);
|
|
6796
|
+
if (analysis.guarded || analysis.dynamic || analysis.unsupportedFunctions.length)
|
|
6797
|
+
fail("EDIT_PROTECTED_CELL", "Protected or redirected master pins cannot be overridden.");
|
|
6798
|
+
}
|
|
6799
|
+
result.add(node);
|
|
6800
|
+
}
|
|
6801
|
+
}
|
|
6802
|
+
if (result.size) {
|
|
6803
|
+
const indexed = indexCells(roots, { check });
|
|
6804
|
+
const pins = new Set(
|
|
6805
|
+
[...indexed.values()].filter((cell) => cell.node && result.has(cell.node)).map(key)
|
|
6806
|
+
);
|
|
6807
|
+
for (const cell of indexed.values())
|
|
6808
|
+
if (charge(), cell.dependencies.some((dependency) => pins.has(dependency)))
|
|
6809
|
+
fail("EDIT_UNSUPPORTED_DEPENDENCY", "A page cache depends on a master rotation pin.");
|
|
6810
|
+
}
|
|
6811
|
+
return result;
|
|
6812
|
+
}
|
|
6813
|
+
|
|
6695
6814
|
// src/visio/edit-master-index.ts
|
|
6696
6815
|
function masterCells(sheet, charge = () => {
|
|
6697
6816
|
}) {
|
|
@@ -6846,7 +6965,7 @@ async function assertVisioMasterIndependence(pkg, roots, commands, check) {
|
|
|
6846
6965
|
const instances = [...roots].flatMap(
|
|
6847
6966
|
([pageId, root]) => masterShapes(root).filter((shape) => shape.hasAttribute("Master")).map((instance) => ({ pageId, instance }))
|
|
6848
6967
|
);
|
|
6849
|
-
if (!instances.length) return;
|
|
6968
|
+
if (!instances.length) return /* @__PURE__ */ new Set();
|
|
6850
6969
|
const documentPart = await related(pkg, "", "document");
|
|
6851
6970
|
if (!documentPart) problem("Missing master document relationship.");
|
|
6852
6971
|
const document = await visioXml(pkg, documentPart, "VisioDocument");
|
|
@@ -6928,12 +7047,14 @@ async function assertVisioMasterIndependence(pkg, roots, commands, check) {
|
|
|
6928
7047
|
for (const [name, node] of masterStyleCells(document, template, local, check, charge))
|
|
6929
7048
|
cells3.set(name, { node, kind: "style" });
|
|
6930
7049
|
overlay(cells3, masterCells(template, charge), "template", charge);
|
|
7050
|
+
const inheritedCells = new Map(cells3);
|
|
6931
7051
|
overlay(cells3, masterCells(local, charge), "instance", charge);
|
|
6932
7052
|
const binding = {
|
|
6933
7053
|
id: `${pageId}:${attribute2(instance, "ID")}:${templateId}`,
|
|
6934
7054
|
pageId,
|
|
6935
7055
|
template,
|
|
6936
7056
|
cells: cells3,
|
|
7057
|
+
inheritedCells,
|
|
6937
7058
|
context,
|
|
6938
7059
|
...local ? { instance: local } : {}
|
|
6939
7060
|
};
|
|
@@ -6944,6 +7065,7 @@ async function assertVisioMasterIndependence(pkg, roots, commands, check) {
|
|
|
6944
7065
|
for (const id of byTemplate.keys())
|
|
6945
7066
|
if (!context.has(id)) problem("MasterShape refers to a missing template.");
|
|
6946
7067
|
}
|
|
7068
|
+
const movePins = prepareMasterMovePins(roots, commands, bindings, check);
|
|
6947
7069
|
const changed = commands.flatMap(
|
|
6948
7070
|
(command2) => command2.type === "delete-shape" ? [] : (command2.type === "move-shape" ? ["PinX", "PinY"] : command2.type === "resize-shape" ? ["Width", "Height"] : ["Width", "Height", "PinX", "PinY"]).map((cell) => ({ pageId: command2.pageId, shapeId: command2.shapeId, cell }))
|
|
6949
7071
|
);
|
|
@@ -6971,6 +7093,7 @@ async function assertVisioMasterIndependence(pkg, roots, commands, check) {
|
|
|
6971
7093
|
template: shape,
|
|
6972
7094
|
instance: shape,
|
|
6973
7095
|
cells: cells3,
|
|
7096
|
+
inheritedCells: /* @__PURE__ */ new Map(),
|
|
6974
7097
|
context: /* @__PURE__ */ new Map()
|
|
6975
7098
|
};
|
|
6976
7099
|
pageInputs.set(id, result);
|
|
@@ -7048,7 +7171,14 @@ async function assertVisioMasterIndependence(pkg, roots, commands, check) {
|
|
|
7048
7171
|
active.delete(id);
|
|
7049
7172
|
done.add(id);
|
|
7050
7173
|
};
|
|
7051
|
-
for (const binding of bindings)
|
|
7174
|
+
for (const binding of bindings)
|
|
7175
|
+
for (const name of binding.cells.keys()) {
|
|
7176
|
+
const source = binding.cells.get(name);
|
|
7177
|
+
if (["pinx", "piny"].includes(name) && source?.kind === "instance" && movePins.has(source.node))
|
|
7178
|
+
continue;
|
|
7179
|
+
inspect2(binding, name);
|
|
7180
|
+
}
|
|
7181
|
+
return movePins;
|
|
7052
7182
|
}
|
|
7053
7183
|
|
|
7054
7184
|
// src/visio/edit-scope.ts
|
|
@@ -7168,6 +7298,7 @@ async function assertGeometryPackageScope(pkg, pagePaths, commands, check, roots
|
|
|
7168
7298
|
});
|
|
7169
7299
|
}
|
|
7170
7300
|
}
|
|
7301
|
+
let movePins = /* @__PURE__ */ new Set();
|
|
7171
7302
|
if (hasMasterInstances) {
|
|
7172
7303
|
for (const command2 of commands) {
|
|
7173
7304
|
const root = roots.get(command2.pageId);
|
|
@@ -7175,12 +7306,16 @@ async function assertGeometryPackageScope(pkg, pagePaths, commands, check, roots
|
|
|
7175
7306
|
const target = Array.from(root.getElementsByTagNameNS(root.namespaceURI, "Shape")).find(
|
|
7176
7307
|
(shape) => attribute2(shape, "ID") === command2.shapeId
|
|
7177
7308
|
);
|
|
7178
|
-
if (target?.hasAttribute("
|
|
7309
|
+
if (target?.hasAttribute("MasterShape") && !target.hasAttribute("Master"))
|
|
7179
7310
|
fail("UNSUPPORTED_GEOMETRY_EDIT", "Editing master-linked shapes is unsupported.");
|
|
7311
|
+
if (target?.hasAttribute("Master") && (command2.type !== "move-shape" || !["PinX", "PinY", "Width", "Height", "LocPinX", "LocPinY"].every(
|
|
7312
|
+
(name) => children(target, "Cell").some((node) => attribute2(node, "N") === name)
|
|
7313
|
+
)))
|
|
7314
|
+
fail("UNSUPPORTED_GEOMETRY_EDIT", "Master moves require complete local transform caches.");
|
|
7180
7315
|
}
|
|
7181
|
-
await assertVisioMasterIndependence(pkg, roots, commands, check);
|
|
7316
|
+
movePins = await assertVisioMasterIndependence(pkg, roots, commands, check);
|
|
7182
7317
|
}
|
|
7183
|
-
if (!documentRoot) return;
|
|
7318
|
+
if (!documentRoot) return movePins;
|
|
7184
7319
|
const styles = /* @__PURE__ */ new Map();
|
|
7185
7320
|
for (const container of children(documentRoot, "StyleSheets"))
|
|
7186
7321
|
for (const style of children(container, "StyleSheet")) {
|
|
@@ -7245,6 +7380,7 @@ async function assertGeometryPackageScope(pkg, pagePaths, commands, check, roots
|
|
|
7245
7380
|
}
|
|
7246
7381
|
}
|
|
7247
7382
|
}
|
|
7383
|
+
return movePins;
|
|
7248
7384
|
}
|
|
7249
7385
|
|
|
7250
7386
|
// src/visio/edit.ts
|
|
@@ -7272,12 +7408,13 @@ async function editVsdx(input, edits, options = {}) {
|
|
|
7272
7408
|
const roots = /* @__PURE__ */ new Map();
|
|
7273
7409
|
const geometry = commands.some((command2) => command2.type !== "replace-plain-text");
|
|
7274
7410
|
let document;
|
|
7411
|
+
let masterMovePins = /* @__PURE__ */ new Set();
|
|
7275
7412
|
if (geometry) {
|
|
7276
7413
|
for (const [pageId, path2] of pages) {
|
|
7277
7414
|
const sourceRoot = await visioXml(pkg, path2, "PageContents");
|
|
7278
7415
|
roots.set(pageId, sourceRoot.ownerDocument.cloneNode(true).documentElement);
|
|
7279
7416
|
}
|
|
7280
|
-
await assertGeometryPackageScope(
|
|
7417
|
+
masterMovePins = await assertGeometryPackageScope(
|
|
7281
7418
|
pkg,
|
|
7282
7419
|
new Set(pages.values()),
|
|
7283
7420
|
commands.filter((command2) => command2.type !== "replace-plain-text"),
|
|
@@ -7304,7 +7441,7 @@ async function editVsdx(input, edits, options = {}) {
|
|
|
7304
7441
|
textChanged = true;
|
|
7305
7442
|
}
|
|
7306
7443
|
} else {
|
|
7307
|
-
for (const pageId of applyGeometryEdit(roots, document, command2, check))
|
|
7444
|
+
for (const pageId of applyGeometryEdit(roots, document, command2, check, masterMovePins))
|
|
7308
7445
|
dirty.set(pages.get(pageId), roots.get(pageId));
|
|
7309
7446
|
}
|
|
7310
7447
|
}
|