superdoc 2.4.0-next.9 → 2.5.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/README.md +12 -90
- package/dist/chunks/{FindReplaceSurface-9VkPw_-X.cjs → FindReplaceSurface-0p7EtMZh.cjs} +4 -3
- package/dist/chunks/{FindReplaceSurface-BuvaIrQ5.es.js → FindReplaceSurface-40AnrqWk.es.js} +4 -2
- package/dist/chunks/{PasswordPromptSurface-Bu5xHm91.cjs → PasswordPromptSurface-31lYPcCK.cjs} +4 -3
- package/dist/chunks/{PasswordPromptSurface-Bz9_sKhX.es.js → PasswordPromptSurface-CwYeO3iQ.es.js} +4 -2
- package/dist/chunks/{PdfViewer-CdVGB6Fe.es.js → PdfViewer-D8h7LRZy.es.js} +103 -19
- package/dist/chunks/{PdfViewer-D4eD2dV1.cjs → PdfViewer-Dug6yDRC.cjs} +105 -20
- package/dist/chunks/_plugin-vue_export-helper-BOaGB7Aw.es.js +8 -0
- package/dist/chunks/_plugin-vue_export-helper-SDR04tiH.cjs +13 -0
- package/dist/chunks/{blank-docx-DP8RUPW-.cjs → blank-docx-BuFAbRjs.cjs} +2 -0
- package/dist/chunks/{blank-docx-XRX6Ker2.es.js → blank-docx-DzQccOlW.es.js} +2 -0
- package/dist/chunks/constants-B6VBlmKp.es.js +4 -0
- package/dist/chunks/constants-DpXuDx_g.cjs +9 -0
- package/dist/chunks/{create-super-doc-ui-ByvmsAAG.cjs → create-super-doc-ui-Bom7oDPv.cjs} +2027 -1158
- package/dist/chunks/{create-super-doc-ui-DBXOhHdW.es.js → create-super-doc-ui-DbzVC0rr.es.js} +2216 -1107
- package/dist/chunks/{eventemitter3-Bt2s0X0a.es.js → eventemitter3-CMOjDs74.es.js} +124 -16
- package/dist/chunks/{eventemitter3-DqY4aSMf.cjs → eventemitter3-D38u8ta_.cjs} +125 -16
- package/dist/chunks/jszip-RC64TPzL.cjs +4758 -0
- package/dist/chunks/jszip-VxCFV9YS.es.js +4717 -0
- package/dist/chunks/{rolldown-runtime-D7PMmH3s.es.js → rolldown-runtime-B5TtN50X.es.js} +13 -4
- package/dist/chunks/{rolldown-runtime-1Y-nnZJ3.cjs → rolldown-runtime-DtsSbkrh.cjs} +12 -3
- package/dist/chunks/{uuid-CFp0WGVU.cjs → uuid-BhG0ngwk.cjs} +10 -6
- package/dist/chunks/{uuid-B2Sqk-3p.es.js → uuid-H0Xcmmhy.es.js} +8 -3
- package/dist/collaboration-upgrade-engine.cjs +34 -9
- package/dist/collaboration-upgrade-engine.es.js +30 -5
- package/dist/document-api/src/citations/citations.types.d.ts +9 -0
- package/dist/document-api/src/comments/comments.types.d.ts +7 -0
- package/dist/document-api/src/types/receipt.d.ts +9 -5
- package/dist/document-api/src/types/track-changes.types.d.ts +17 -0
- package/dist/layout-engine/contracts/src/graphic-placement.d.ts +35 -6
- package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +22 -2
- package/dist/layout-engine/contracts/src/index.d.ts +370 -15
- package/dist/layout-engine/contracts/src/inline-box.d.ts +19 -0
- package/dist/layout-engine/contracts/src/paragraph-visible-text.d.ts +19 -0
- package/dist/layout-engine/contracts/src/resolved-layout.d.ts +5 -0
- package/dist/layout-engine/dom-contract/src/class-names.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/footnote-scorer.d.ts +1 -1
- package/dist/layout-engine/layout-bridge/src/hydrateTableTextboxMeasures.d.ts +9 -0
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +42 -11
- package/dist/layout-engine/layout-bridge/src/index.d.ts +4 -2
- package/dist/layout-engine/layout-bridge/src/inline-box-key.d.ts +3 -0
- package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +11 -4
- package/dist/layout-engine/layout-bridge/src/remeasure.d.ts +2 -2
- package/dist/layout-engine/layout-bridge/src/run-visual-marks.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +0 -12
- package/dist/layout-engine/layout-engine/src/anchors.d.ts +4 -0
- package/dist/layout-engine/layout-engine/src/execution.d.ts +21 -0
- package/dist/layout-engine/layout-engine/src/floating-objects.d.ts +15 -2
- package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +2 -0
- package/dist/layout-engine/layout-engine/src/footnote-anchor-index.d.ts +17 -0
- package/dist/layout-engine/layout-engine/src/index.d.ts +13 -10
- package/dist/layout-engine/layout-engine/src/inline-drawing-alignment.d.ts +9 -0
- package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +3 -3
- package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +2 -2
- package/dist/layout-engine/layout-engine/src/layout-textbox.d.ts +3 -3
- package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +3 -41
- package/dist/layout-engine/layout-engine/src/paginator.d.ts +7 -2
- package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +2 -0
- package/dist/layout-engine/layout-engine/src/section-breaks.d.ts +1 -0
- package/dist/layout-engine/layout-engine/src/section-props.d.ts +5 -0
- package/dist/layout-engine/painters/dom/src/chart-renderer.d.ts +3 -3
- package/dist/layout-engine/painters/dom/src/images/image-outline.d.ts +7 -0
- package/dist/layout-engine/painters/dom/src/images/render-placeholder.d.ts +12 -0
- package/dist/layout-engine/painters/dom/src/renderer.d.ts +54 -0
- package/dist/layout-engine/painters/dom/src/runs/inline-box.d.ts +8 -0
- package/dist/layout-engine/painters/dom/src/runs/text-effects.d.ts +30 -0
- package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +6 -4
- package/dist/layout-engine/painters/dom/src/shapes/preset-text-warp-data.d.ts +32 -0
- package/dist/layout-engine/painters/dom/src/shapes/wordart-warp.d.ts +39 -0
- package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +20 -27
- package/dist/layout-engine/painters/dom/src/table/renderTableFragment.d.ts +1 -1
- package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +7 -0
- package/dist/public/ui-react.cjs +66 -2
- package/dist/public/ui-react.es.js +66 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +134 -98
- package/dist/style.layered.css +134 -98
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +2 -0
- package/dist/superdoc/src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue.d.ts +16 -0
- package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +3 -1
- package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +12 -0
- package/dist/superdoc/src/core/SuperDoc.d.ts +10 -7
- package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +5 -0
- package/dist/superdoc/src/core/extensions/index.d.ts +1 -1
- package/dist/superdoc/src/core/extensions/types.d.ts +63 -5
- package/dist/superdoc/src/core/types/index.d.ts +423 -37
- package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +3 -3
- package/dist/superdoc/src/helpers/comment-small-screen.d.ts +10 -0
- package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +3 -5
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +4 -4
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +11 -0
- package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +1 -1
- package/dist/superdoc/src/public/index.d.cts +20 -0
- package/dist/superdoc/src/public/index.d.ts +10 -0
- package/dist/superdoc/src/public/ui/types.d.ts +5 -5
- package/dist/superdoc/src/stores/comments-store.d.ts +81 -78
- package/dist/superdoc/src/stores/superdoc-store.d.ts +243 -234
- package/dist/superdoc.cjs +6748 -2162
- package/dist/superdoc.es.js +6621 -2035
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +37 -37
- package/package.json +14 -18
- package/AGENTS.md +0 -337
- package/dist/chunks/_plugin-vue_export-helper-CZ1Nl59K.cjs +0 -11
- package/dist/chunks/_plugin-vue_export-helper-DSMAhhwD.es.js +0 -6
- package/dist/chunks/constants-BfH0br5u.es.js +0 -3
- package/dist/chunks/constants-D7TNtyJd.cjs +0 -14
- package/dist/chunks/jszip-C8srOKAO.es.js +0 -4650
- package/dist/chunks/jszip-Cs9JBLlJ.cjs +0 -4691
- package/dist/superdoc/src/helpers/v2-remote-review-hydration.d.ts +0 -12
- package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +0 -19
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esmMin = (fn, res) => () =>
|
|
8
|
-
|
|
8
|
+
var __esmMin = (fn, res, err) => () => {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = fn(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
17
|
var __copyProps = (to, from, except, desc) => {
|
|
10
18
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
19
|
key = keys[i];
|
|
@@ -16,12 +24,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
24
|
}
|
|
17
25
|
return to;
|
|
18
26
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
20
28
|
value: mod,
|
|
21
29
|
enumerable: true
|
|
22
30
|
}) : target, mod));
|
|
23
31
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
24
32
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
25
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
33
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
26
34
|
});
|
|
35
|
+
//#endregion
|
|
27
36
|
export { __toESM as i, __esmMin as n, __require as r, __commonJSMin as t };
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esmMin = (fn, res) => () =>
|
|
8
|
-
|
|
8
|
+
var __esmMin = (fn, res, err) => () => {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = fn(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
17
|
var __copyProps = (to, from, except, desc) => {
|
|
10
18
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
19
|
key = keys[i];
|
|
@@ -16,10 +24,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
24
|
}
|
|
17
25
|
return to;
|
|
18
26
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
20
28
|
value: mod,
|
|
21
29
|
enumerable: true
|
|
22
30
|
}) : target, mod));
|
|
31
|
+
//#endregion
|
|
23
32
|
Object.defineProperty(exports, "__commonJSMin", {
|
|
24
33
|
enumerable: true,
|
|
25
34
|
get: function() {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm-browser/stringify.js
|
|
1
2
|
var byteToHex = [];
|
|
2
3
|
for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
|
|
3
4
|
function unsafeStringify(arr, offset = 0) {
|
|
4
5
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
5
6
|
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm-browser/rng.js
|
|
6
9
|
var getRandomValues;
|
|
7
|
-
var rnds8 = new Uint8Array(16);
|
|
10
|
+
var rnds8 = /* @__PURE__ */ new Uint8Array(16);
|
|
8
11
|
function rng() {
|
|
9
12
|
if (!getRandomValues) {
|
|
10
13
|
if (typeof crypto === "undefined" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
@@ -12,8 +15,9 @@ function rng() {
|
|
|
12
15
|
}
|
|
13
16
|
return getRandomValues(rnds8);
|
|
14
17
|
}
|
|
15
|
-
var
|
|
16
|
-
|
|
18
|
+
var native_default = { randomUUID: typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm-browser/v4.js
|
|
17
21
|
function v4(options, buf, offset) {
|
|
18
22
|
if (native_default.randomUUID && !buf && !options) return native_default.randomUUID();
|
|
19
23
|
options = options || {};
|
|
@@ -29,10 +33,10 @@ function v4(options, buf, offset) {
|
|
|
29
33
|
}
|
|
30
34
|
return unsafeStringify(rnds);
|
|
31
35
|
}
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "
|
|
36
|
+
//#endregion
|
|
37
|
+
Object.defineProperty(exports, "v4", {
|
|
34
38
|
enumerable: true,
|
|
35
39
|
get: function() {
|
|
36
|
-
return
|
|
40
|
+
return v4;
|
|
37
41
|
}
|
|
38
42
|
});
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm-browser/stringify.js
|
|
1
2
|
var byteToHex = [];
|
|
2
3
|
for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
|
|
3
4
|
function unsafeStringify(arr, offset = 0) {
|
|
4
5
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
5
6
|
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm-browser/rng.js
|
|
6
9
|
var getRandomValues;
|
|
7
|
-
var rnds8 = new Uint8Array(16);
|
|
10
|
+
var rnds8 = /* @__PURE__ */ new Uint8Array(16);
|
|
8
11
|
function rng() {
|
|
9
12
|
if (!getRandomValues) {
|
|
10
13
|
if (typeof crypto === "undefined" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
@@ -13,6 +16,8 @@ function rng() {
|
|
|
13
16
|
return getRandomValues(rnds8);
|
|
14
17
|
}
|
|
15
18
|
var native_default = { randomUUID: typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm-browser/v4.js
|
|
16
21
|
function v4(options, buf, offset) {
|
|
17
22
|
if (native_default.randomUUID && !buf && !options) return native_default.randomUUID();
|
|
18
23
|
options = options || {};
|
|
@@ -28,5 +33,5 @@ function v4(options, buf, offset) {
|
|
|
28
33
|
}
|
|
29
34
|
return unsafeStringify(rnds);
|
|
30
35
|
}
|
|
31
|
-
|
|
32
|
-
export {
|
|
36
|
+
//#endregion
|
|
37
|
+
export { v4 as t };
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
let
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
let _superdoc_docx_engine_collaboration_upgrade_engine = require("@superdoc/docx-engine/collaboration-upgrade-engine");
|
|
3
|
+
//#region src/public/collaboration-upgrade-engine.ts
|
|
4
|
+
/**
|
|
5
|
+
* SuperDoc public facade: `superdoc/collaboration-upgrade-engine`.
|
|
6
|
+
*
|
|
7
|
+
* This is a Node-only bridge used by the public v2 collaboration upgrade package.
|
|
8
|
+
* It deliberately exposes data-only inputs and outputs: no live Y.Doc, editor,
|
|
9
|
+
* provider, browser, UI, or private workspace type crosses this boundary.
|
|
10
|
+
*/
|
|
11
|
+
/** Compatibility protocol between the upgrade package and installed SuperDoc. */
|
|
12
|
+
var COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION = 1;
|
|
13
|
+
/** Recovery-bundle versions accepted by this engine. */
|
|
14
|
+
var SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS = Object.freeze([1]);
|
|
15
|
+
/** Frozen final-v1 reader contracts accepted by this engine. */
|
|
16
|
+
var SUPPORTED_V1_READER_CONTRACT_VERSIONS = Object.freeze([1]);
|
|
17
|
+
/** Minimum supported Node.js major version. */
|
|
18
|
+
var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
19
|
+
var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
8
20
|
var ENGINE_INFO = Object.freeze({
|
|
9
21
|
...PRIVATE_ENGINE_INFO,
|
|
10
|
-
superdocVersion: "2.
|
|
22
|
+
superdocVersion: "2.5.0",
|
|
11
23
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
12
24
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
13
25
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
14
26
|
});
|
|
27
|
+
/** Return immutable metadata used to reject incompatible engines preflight. */
|
|
15
28
|
function getCollaborationUpgradeEngineInfo() {
|
|
16
29
|
return ENGINE_INFO;
|
|
17
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Build and offline-validate one self-contained v2 collaboration update.
|
|
33
|
+
*
|
|
34
|
+
* This function performs no provider I/O and never mutates the v1 source room.
|
|
35
|
+
*/
|
|
18
36
|
async function buildV2CollaborationUpgradeArtifactFromBundle(input) {
|
|
19
37
|
assertSupportedNodeRuntime();
|
|
20
|
-
return (0,
|
|
38
|
+
return (0, _superdoc_docx_engine_collaboration_upgrade_engine.buildV2CollaborationUpgradeArtifactFromBundle)(input);
|
|
21
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Validate target bytes after a provider reads them through a fresh client.
|
|
42
|
+
*
|
|
43
|
+
* Provenance and carrier bytes are derived from the authenticated recovery
|
|
44
|
+
* bundle rather than accepted as independent caller assertions.
|
|
45
|
+
*/
|
|
22
46
|
async function validateV2CollaborationUpgradeTarget(input) {
|
|
23
47
|
assertSupportedNodeRuntime();
|
|
24
|
-
return (0,
|
|
48
|
+
return (0, _superdoc_docx_engine_collaboration_upgrade_engine.validateV2CollaborationUpgradeTarget)(input);
|
|
25
49
|
}
|
|
26
50
|
function assertSupportedNodeRuntime() {
|
|
27
51
|
const nodeVersion = globalThis.process?.versions?.node;
|
|
28
52
|
const nodeMajor = nodeVersion ? Number.parseInt(nodeVersion.split(".")[0] ?? "", 10) : NaN;
|
|
29
53
|
if (!Number.isInteger(nodeMajor) || nodeMajor < 20) throw new Error(`superdoc/collaboration-upgrade-engine requires Node.js 20 or newer`);
|
|
30
54
|
}
|
|
55
|
+
//#endregion
|
|
31
56
|
exports.COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR;
|
|
32
57
|
exports.COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION = COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION;
|
|
33
58
|
exports.SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS = SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS;
|
|
@@ -1,23 +1,47 @@
|
|
|
1
1
|
import { buildV2CollaborationUpgradeArtifactFromBundle as buildV2CollaborationUpgradeArtifactFromBundle$1, getCollaborationUpgradeEngineInfo as getCollaborationUpgradeEngineInfo$1, validateV2CollaborationUpgradeTarget as validateV2CollaborationUpgradeTarget$1 } from "@superdoc/docx-engine/collaboration-upgrade-engine";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/public/collaboration-upgrade-engine.ts
|
|
3
|
+
/**
|
|
4
|
+
* SuperDoc public facade: `superdoc/collaboration-upgrade-engine`.
|
|
5
|
+
*
|
|
6
|
+
* This is a Node-only bridge used by the public v2 collaboration upgrade package.
|
|
7
|
+
* It deliberately exposes data-only inputs and outputs: no live Y.Doc, editor,
|
|
8
|
+
* provider, browser, UI, or private workspace type crosses this boundary.
|
|
9
|
+
*/
|
|
10
|
+
/** Compatibility protocol between the upgrade package and installed SuperDoc. */
|
|
11
|
+
var COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION = 1;
|
|
12
|
+
/** Recovery-bundle versions accepted by this engine. */
|
|
13
|
+
var SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS = Object.freeze([1]);
|
|
14
|
+
/** Frozen final-v1 reader contracts accepted by this engine. */
|
|
15
|
+
var SUPPORTED_V1_READER_CONTRACT_VERSIONS = Object.freeze([1]);
|
|
16
|
+
/** Minimum supported Node.js major version. */
|
|
17
|
+
var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
6
18
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
7
19
|
var ENGINE_INFO = Object.freeze({
|
|
8
20
|
...PRIVATE_ENGINE_INFO,
|
|
9
|
-
superdocVersion: "2.
|
|
21
|
+
superdocVersion: "2.5.0",
|
|
10
22
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
11
23
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
12
24
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
13
25
|
});
|
|
26
|
+
/** Return immutable metadata used to reject incompatible engines preflight. */
|
|
14
27
|
function getCollaborationUpgradeEngineInfo() {
|
|
15
28
|
return ENGINE_INFO;
|
|
16
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Build and offline-validate one self-contained v2 collaboration update.
|
|
32
|
+
*
|
|
33
|
+
* This function performs no provider I/O and never mutates the v1 source room.
|
|
34
|
+
*/
|
|
17
35
|
async function buildV2CollaborationUpgradeArtifactFromBundle(input) {
|
|
18
36
|
assertSupportedNodeRuntime();
|
|
19
37
|
return buildV2CollaborationUpgradeArtifactFromBundle$1(input);
|
|
20
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Validate target bytes after a provider reads them through a fresh client.
|
|
41
|
+
*
|
|
42
|
+
* Provenance and carrier bytes are derived from the authenticated recovery
|
|
43
|
+
* bundle rather than accepted as independent caller assertions.
|
|
44
|
+
*/
|
|
21
45
|
async function validateV2CollaborationUpgradeTarget(input) {
|
|
22
46
|
assertSupportedNodeRuntime();
|
|
23
47
|
return validateV2CollaborationUpgradeTarget$1(input);
|
|
@@ -27,4 +51,5 @@ function assertSupportedNodeRuntime() {
|
|
|
27
51
|
const nodeMajor = nodeVersion ? Number.parseInt(nodeVersion.split(".")[0] ?? "", 10) : NaN;
|
|
28
52
|
if (!Number.isInteger(nodeMajor) || nodeMajor < 20) throw new Error(`superdoc/collaboration-upgrade-engine requires Node.js 20 or newer`);
|
|
29
53
|
}
|
|
54
|
+
//#endregion
|
|
30
55
|
export { COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR, COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION, SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS, SUPPORTED_V1_READER_CONTRACT_VERSIONS, buildV2CollaborationUpgradeArtifactFromBundle, getCollaborationUpgradeEngineInfo, validateV2CollaborationUpgradeTarget };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InlineAnchor } from '../types/base.js';
|
|
2
2
|
import { TextTarget } from '../types/address.js';
|
|
3
|
+
import { StoryLocator } from '../types/story.types.js';
|
|
3
4
|
import { AdapterMutationFailure } from '../types/adapter-result.js';
|
|
4
5
|
import { DiscoveryOutput } from '../types/discovery.js';
|
|
5
6
|
import { TocCreateLocation } from '../toc/toc.types.js';
|
|
@@ -7,6 +8,14 @@ export interface CitationAddress {
|
|
|
7
8
|
kind: 'inline';
|
|
8
9
|
nodeType: 'citation';
|
|
9
10
|
anchor: InlineAnchor;
|
|
11
|
+
/** Story containing this citation. Omit for body (backward compatible). */
|
|
12
|
+
story?: StoryLocator;
|
|
13
|
+
/** Session-stable story identity used by the v2 runtime with `fieldId`. */
|
|
14
|
+
storyId?: string;
|
|
15
|
+
/** Session-stable identity of the citation's backing OOXML field. */
|
|
16
|
+
fieldId?: string;
|
|
17
|
+
/** Field occurrence fallback for collocated citations with identical anchors. */
|
|
18
|
+
occurrenceIndex?: number;
|
|
10
19
|
}
|
|
11
20
|
export interface CitationSourceAddress {
|
|
12
21
|
kind: 'entity';
|
|
@@ -200,6 +200,13 @@ export interface CommentsListQuery {
|
|
|
200
200
|
includeResolved?: boolean;
|
|
201
201
|
limit?: number;
|
|
202
202
|
offset?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Optional bounded review-window filter. Each id may be canonical or an
|
|
205
|
+
* imported/source alias. Only matching visible threads are projected.
|
|
206
|
+
*/
|
|
207
|
+
visibleCommentIds?: readonly string[];
|
|
208
|
+
/** Include every reply belonging to a matched visible thread. */
|
|
209
|
+
includeThreadReplies?: boolean;
|
|
203
210
|
}
|
|
204
211
|
/**
|
|
205
212
|
* Domain fields for a comment discovery item (C2).
|
|
@@ -42,22 +42,26 @@ export type ReviewWarning = {
|
|
|
42
42
|
* operation. Callers maintain their own held-ref state by applying these
|
|
43
43
|
* deltas:
|
|
44
44
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
45
|
+
* `atChar` is story-absolute. When `blockId` and `atCharInBlock` are both
|
|
46
|
+
* present, they identify the same shift in block-local visible coordinates.
|
|
47
|
+
* Consumers that store block-local ranges must fail closed when that pair is
|
|
48
|
+
* absent rather than interpreting `atChar` as a block offset.
|
|
49
49
|
*
|
|
50
50
|
* Negative `delta` describes a deletion. Positive `delta` describes an
|
|
51
51
|
* insertion (e.g. when a `<w:del>` is rejected and its content is restored
|
|
52
52
|
* to the visible flow).
|
|
53
53
|
*
|
|
54
|
-
* One entry per story. Cross-story shifts are reported
|
|
54
|
+
* One entry is emitted per story. Cross-story shifts are reported separately.
|
|
55
55
|
*/
|
|
56
56
|
export interface TextRangeShift {
|
|
57
57
|
/** The story whose text was shifted. */
|
|
58
58
|
story: StoryLocator;
|
|
59
59
|
/** Character offset in the story's flattened text where the shift begins. */
|
|
60
60
|
atChar: number;
|
|
61
|
+
/** Block containing the shift, when the producer can prove one. */
|
|
62
|
+
blockId?: string;
|
|
63
|
+
/** Visible character offset within `blockId`, paired with `blockId`. */
|
|
64
|
+
atCharInBlock?: number;
|
|
61
65
|
/** Net change in characters. Negative for deletions, positive for insertions. */
|
|
62
66
|
delta: number;
|
|
63
67
|
}
|
|
@@ -457,6 +457,16 @@ export interface TrackChangeNavigationTarget {
|
|
|
457
457
|
blockId: string;
|
|
458
458
|
role: 'primary' | 'move-source' | 'move-destination' | 'formatting-carrier' | 'structural-carrier';
|
|
459
459
|
}
|
|
460
|
+
export interface TrackChangeCustomAttribute {
|
|
461
|
+
/** Source-qualified attribute name, preserving the prefix used by the carrier. */
|
|
462
|
+
name: string;
|
|
463
|
+
/** Resolved extension namespace URI. */
|
|
464
|
+
namespaceUri: string;
|
|
465
|
+
/** Attribute local name without its namespace prefix. */
|
|
466
|
+
localName: string;
|
|
467
|
+
/** Decoded XML attribute value. */
|
|
468
|
+
value: string;
|
|
469
|
+
}
|
|
460
470
|
export interface TrackChangeInfo {
|
|
461
471
|
address: TrackedChangeAddress;
|
|
462
472
|
/** Stable SuperDoc logical tracked-change id (spec §3 / §4). */
|
|
@@ -569,6 +579,11 @@ export interface TrackChangeInfo {
|
|
|
569
579
|
* tracked changes. Absent when the change is standalone.
|
|
570
580
|
*/
|
|
571
581
|
overlap?: TrackChangeOverlapInfo;
|
|
582
|
+
/**
|
|
583
|
+
* Unknown extension attributes attached to contributing OOXML revision carriers.
|
|
584
|
+
* Exact duplicates are removed in document order; conflicting values are retained.
|
|
585
|
+
*/
|
|
586
|
+
readonly customAttributes?: readonly TrackChangeCustomAttribute[];
|
|
572
587
|
}
|
|
573
588
|
export interface TrackChangesListQuery {
|
|
574
589
|
limit?: number;
|
|
@@ -694,6 +709,8 @@ export interface TrackChangeDomain {
|
|
|
694
709
|
* stack without an extra `trackChanges.get` round trip.
|
|
695
710
|
*/
|
|
696
711
|
overlap?: TrackChangeOverlapInfo;
|
|
712
|
+
/** Unknown extension attributes attached to the contributing OOXML revision carriers. */
|
|
713
|
+
readonly customAttributes?: readonly TrackChangeCustomAttribute[];
|
|
697
714
|
}
|
|
698
715
|
/**
|
|
699
716
|
* Standardized discovery output for `trackChanges.list`.
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/** ECMA-376 Part 1 §20.4.3.4 (`ST_RelFromH`). */
|
|
2
|
+
export declare const ANCHOR_H_RELATIVE_VALUES: readonly ["margin", "page", "column", "character", "leftMargin", "rightMargin", "insideMargin", "outsideMargin"];
|
|
3
|
+
/** ECMA-376 Part 1 §20.4.3.5 (`ST_RelFromV`). */
|
|
4
|
+
export declare const ANCHOR_V_RELATIVE_VALUES: readonly ["margin", "page", "paragraph", "line", "topMargin", "bottomMargin", "insideMargin", "outsideMargin"];
|
|
5
|
+
/** ECMA-376 Part 1 §20.4.3.1 (`ST_AlignH`). */
|
|
6
|
+
export declare const ANCHOR_H_ALIGN_VALUES: readonly ["left", "right", "center", "inside", "outside"];
|
|
7
|
+
/** ECMA-376 Part 1 §20.4.3.2 (`ST_AlignV`). */
|
|
8
|
+
export declare const ANCHOR_V_ALIGN_VALUES: readonly ["top", "bottom", "center", "inside", "outside"];
|
|
9
|
+
export type AnchorHRelative = (typeof ANCHOR_H_RELATIVE_VALUES)[number];
|
|
10
|
+
export type AnchorVRelative = (typeof ANCHOR_V_RELATIVE_VALUES)[number];
|
|
11
|
+
export type AnchorAlignH = (typeof ANCHOR_H_ALIGN_VALUES)[number];
|
|
12
|
+
export type AnchorAlignV = (typeof ANCHOR_V_ALIGN_VALUES)[number];
|
|
13
|
+
export declare function isAnchorHRelative(value: unknown): value is AnchorHRelative;
|
|
14
|
+
export declare function isAnchorVRelative(value: unknown): value is AnchorVRelative;
|
|
15
|
+
export declare function isAnchorAlignH(value: unknown): value is AnchorAlignH;
|
|
16
|
+
export declare function isAnchorAlignV(value: unknown): value is AnchorAlignV;
|
|
5
17
|
export declare function isPositionedParagraphFrame<T extends {
|
|
6
18
|
wrap?: string;
|
|
7
19
|
}>(frame: T | undefined): frame is T & {
|
|
@@ -35,6 +47,10 @@ export type ColumnLayoutForAnchor = {
|
|
|
35
47
|
*/
|
|
36
48
|
export type ResolveAnchoredGraphicYInput = {
|
|
37
49
|
anchor?: {
|
|
50
|
+
simplePos?: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
};
|
|
38
54
|
vRelativeFrom?: AnchorVRelative;
|
|
39
55
|
alignV?: AnchorAlignV;
|
|
40
56
|
offsetV?: number;
|
|
@@ -49,8 +65,12 @@ export type ResolveAnchoredGraphicYInput = {
|
|
|
49
65
|
* Used for `paragraph` and legacy (undefined vRelativeFrom) positioning.
|
|
50
66
|
*/
|
|
51
67
|
anchorParagraphY?: number;
|
|
68
|
+
/** Anchor line top Y. Falls back to the paragraph top when unavailable. */
|
|
69
|
+
anchorLineY?: number;
|
|
52
70
|
/** First line height of the anchor paragraph (paragraph-relative alignV). */
|
|
53
71
|
firstLineHeight?: number;
|
|
72
|
+
/** One-based physical page number, used by inside/outside placement. */
|
|
73
|
+
pageNumber?: number;
|
|
54
74
|
/**
|
|
55
75
|
* When true, anchor has no host paragraph (pre-registered / paragraphless layout).
|
|
56
76
|
* For `vRelativeFrom: 'paragraph'`, use `contentTop + offsetV` instead of alignV on a
|
|
@@ -62,15 +82,24 @@ export type ResolveAnchoredGraphicYInput = {
|
|
|
62
82
|
* Resolve the vertical paint position for an anchored graphic (image, drawing, or table).
|
|
63
83
|
*/
|
|
64
84
|
export declare function resolveAnchoredGraphicY(input: ResolveAnchoredGraphicYInput): number;
|
|
85
|
+
export type ResolveAnchoredGraphicXContext = {
|
|
86
|
+
/** One-based physical page number, used by inside/outside placement. */
|
|
87
|
+
pageNumber?: number;
|
|
88
|
+
/** Page-space X of the anchor character. Falls back to the column origin. */
|
|
89
|
+
anchorCharacterX?: number;
|
|
90
|
+
};
|
|
65
91
|
/**
|
|
66
92
|
* Resolve horizontal paint position for an anchored graphic.
|
|
67
93
|
*/
|
|
68
94
|
export declare function resolveAnchoredGraphicX(anchor: {
|
|
95
|
+
simplePos?: {
|
|
96
|
+
x: number;
|
|
97
|
+
y: number;
|
|
98
|
+
};
|
|
69
99
|
hRelativeFrom?: AnchorHRelative;
|
|
70
100
|
alignH?: AnchorAlignH;
|
|
71
101
|
offsetH?: number;
|
|
72
102
|
}, columnIndex: number, columns: ColumnLayoutForAnchor, objectWidth: number, margins?: {
|
|
73
103
|
left?: number;
|
|
74
104
|
right?: number;
|
|
75
|
-
}, pageWidth?: number): number;
|
|
76
|
-
export {};
|
|
105
|
+
}, pageWidth?: number, context?: ResolveAnchoredGraphicXContext): number;
|
|
@@ -5,6 +5,26 @@
|
|
|
5
5
|
* every retained dependency that required the checkpoint; consumers reject
|
|
6
6
|
* empty, duplicate, or unknown lists instead of trusting a generic boolean.
|
|
7
7
|
*/
|
|
8
|
-
export type PageCheckpointDependencyClass = 'multiple-sections' | 'furniture-page-tokens' | 'non-balanceable-multi-column-sections' | 'body-anchored-objects' | 'footnotes' | 'page-references' | 'keep-constraints' | 'tables' | 'furniture-anchored-objects';
|
|
9
|
-
export declare const PAGE_CHECKPOINT_DEPENDENCY_CLASSES: readonly ["multiple-sections", "furniture-page-tokens", "non-balanceable-multi-column-sections", "body-anchored-objects", "footnotes", "page-references", "keep-constraints", "tables", "furniture-anchored-objects"];
|
|
8
|
+
export type PageCheckpointDependencyClass = 'multiple-sections' | 'furniture-page-tokens' | 'non-balanceable-multi-column-sections' | 'body-anchored-objects' | 'non-flowing-page-relative-body-anchors' | 'footnotes' | 'page-references' | 'keep-constraints' | 'tables' | 'furniture-anchored-objects';
|
|
9
|
+
export declare const PAGE_CHECKPOINT_DEPENDENCY_CLASSES: readonly ["multiple-sections", "furniture-page-tokens", "non-balanceable-multi-column-sections", "body-anchored-objects", "non-flowing-page-relative-body-anchors", "footnotes", "page-references", "keep-constraints", "tables", "furniture-anchored-objects"];
|
|
10
|
+
/**
|
|
11
|
+
* Exact retained-generation proof for page/margin-relative body anchors that
|
|
12
|
+
* cannot influence paragraph flow (`wrap=None`). The host builds this once
|
|
13
|
+
* from a canonical layout generation; warm consumers validate the epoch,
|
|
14
|
+
* inventory, identities, and page ownership before admitting bounded layout.
|
|
15
|
+
*/
|
|
16
|
+
export type NonFlowingPageRelativeAnchorDependencyProof = {
|
|
17
|
+
version: 1;
|
|
18
|
+
sourceLayoutEpoch: number;
|
|
19
|
+
inventoryFingerprint: string;
|
|
20
|
+
entries: readonly {
|
|
21
|
+
blockId: string;
|
|
22
|
+
carrierParagraphId: string;
|
|
23
|
+
sourcePageIndex: number;
|
|
24
|
+
sectionIndex: number;
|
|
25
|
+
geometryFingerprint: string;
|
|
26
|
+
measureFingerprint: string;
|
|
27
|
+
pageGeometryFingerprint: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
10
30
|
export declare function areValidPageCheckpointDependencyClasses(value: unknown): value is readonly PageCheckpointDependencyClass[];
|