superdoc 2.4.0-next.9 → 2.4.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/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-DBXOhHdW.es.js → create-super-doc-ui-CmOSA_lN.es.js} +2030 -1086
- package/dist/chunks/{create-super-doc-ui-ByvmsAAG.cjs → create-super-doc-ui-CqGmoMMA.cjs} +1841 -1137
- package/dist/chunks/{eventemitter3-DqY4aSMf.cjs → eventemitter3-C_TAnXOl.cjs} +125 -16
- package/dist/chunks/{eventemitter3-Bt2s0X0a.es.js → eventemitter3-DEIiXiH2.es.js} +124 -16
- package/dist/chunks/jszip-BzJ3CyxR.es.js +4717 -0
- package/dist/chunks/jszip-D8mAFF-r.cjs +4758 -0
- package/dist/chunks/{rolldown-runtime-D7PMmH3s.es.js → rolldown-runtime-0pSA04fp.es.js} +12 -3
- package/dist/chunks/{rolldown-runtime-1Y-nnZJ3.cjs → rolldown-runtime-74VwNCz7.cjs} +11 -2
- 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/layout-engine/contracts/src/incremental-dependency.d.ts +22 -2
- package/dist/layout-engine/contracts/src/index.d.ts +74 -2
- 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/layout-bridge/src/incrementalLayout.d.ts +4 -1
- package/dist/layout-engine/layout-bridge/src/index.d.ts +1 -0
- package/dist/layout-engine/layout-bridge/src/inline-box-key.d.ts +3 -0
- package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +5 -1
- 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/painters/dom/src/runs/inline-box.d.ts +8 -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/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 +399 -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 +6667 -2090
- package/dist/superdoc.es.js +6540 -1963
- 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 -14
- 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];
|
|
@@ -22,6 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
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];
|
|
@@ -20,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
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.4.0
|
|
22
|
+
superdocVersion: "2.4.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.4.0
|
|
21
|
+
superdocVersion: "2.4.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
|
}
|
|
@@ -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[];
|
|
@@ -120,7 +120,7 @@ export type DocPartMetadata = {
|
|
|
120
120
|
* - Doc parts: special objects like tables of contents
|
|
121
121
|
*/
|
|
122
122
|
export type SdtMetadata = FieldAnnotationMetadata | StructuredContentMetadata | DocumentSectionMetadata | DocPartMetadata;
|
|
123
|
-
export declare const CONTRACTS_VERSION = "1.
|
|
123
|
+
export declare const CONTRACTS_VERSION = "1.2.0";
|
|
124
124
|
/** Unique identifier for a block in the document. Format: `${pos}-${type}`. */
|
|
125
125
|
export type BlockId = string;
|
|
126
126
|
/**
|
|
@@ -655,12 +655,58 @@ export type MathRun = {
|
|
|
655
655
|
sdt?: SdtMetadata;
|
|
656
656
|
};
|
|
657
657
|
export type Run = TextRun | TabRun | ImageRun | LineBreakRun | BreakRun | FieldAnnotationRun | MathRun;
|
|
658
|
+
/** Layout-affecting inline-box values, resolved to logical CSS pixel sides. */
|
|
659
|
+
export type ResolvedInlineBoxLayout = {
|
|
660
|
+
paddingInlineStart: number;
|
|
661
|
+
paddingInlineEnd: number;
|
|
662
|
+
paddingBlockStart: number;
|
|
663
|
+
paddingBlockEnd: number;
|
|
664
|
+
gapBefore: number;
|
|
665
|
+
gapAfter: number;
|
|
666
|
+
borderWidth: number;
|
|
667
|
+
};
|
|
668
|
+
/** Sanitized, paint-only inline-box appearance. */
|
|
669
|
+
export type ResolvedInlineBoxAppearance = {
|
|
670
|
+
backgroundColor?: string;
|
|
671
|
+
borderColor?: string;
|
|
672
|
+
borderStyle?: 'solid' | 'dashed' | 'dotted';
|
|
673
|
+
borderRadius?: number;
|
|
674
|
+
color?: string;
|
|
675
|
+
};
|
|
676
|
+
/** Paint-ready inline-box style emitted on measured line slices. */
|
|
677
|
+
export type ResolvedInlineBoxStyle = ResolvedInlineBoxLayout & ResolvedInlineBoxAppearance;
|
|
678
|
+
/**
|
|
679
|
+
* An internal, layout-aware presentation over a paragraph-visible text range.
|
|
680
|
+
*
|
|
681
|
+
* The proof uses leaf styling (D1): measurement creates box-edge segment
|
|
682
|
+
* boundaries and the painter styles the canonical text leaves. The fallback
|
|
683
|
+
* sibling layer was not needed. Extension-authored boxes reach this internal
|
|
684
|
+
* layout contract through the v2 host bridge. RTL input is ignored (D12), and
|
|
685
|
+
* the synchronous paragraph remeasurer does not consume this field (D14).
|
|
686
|
+
*/
|
|
687
|
+
export type InlineBoxSpan = {
|
|
688
|
+
id: string;
|
|
689
|
+
/**
|
|
690
|
+
* UTF-16 offsets over the paragraph's flattened visible text. Every
|
|
691
|
+
* non-text run contributes one placeholder character. These offsets never
|
|
692
|
+
* alter run PM ranges, run indices, source anchors, or document identity.
|
|
693
|
+
*/
|
|
694
|
+
from: number;
|
|
695
|
+
to: number;
|
|
696
|
+
layout: ResolvedInlineBoxLayout;
|
|
697
|
+
appearance: ResolvedInlineBoxAppearance;
|
|
698
|
+
className?: string;
|
|
699
|
+
data?: Record<string, string>;
|
|
700
|
+
cursor?: 'default' | 'pointer' | 'text' | 'help';
|
|
701
|
+
};
|
|
658
702
|
export type ParagraphBlock = {
|
|
659
703
|
kind: 'paragraph';
|
|
660
704
|
id: BlockId;
|
|
661
705
|
runs: Run[];
|
|
662
706
|
attrs?: ParagraphAttrs;
|
|
663
707
|
sourceAnchor?: SourceAnchor;
|
|
708
|
+
/** @internal Layout-aware presentation projected from the extension API by the v2 host. */
|
|
709
|
+
inlineBoxes?: InlineBoxSpan[];
|
|
664
710
|
};
|
|
665
711
|
/** Border style (subset of OOXML ST_Border). */
|
|
666
712
|
export type BorderStyle = 'none' | 'single' | 'double' | 'dashed' | 'dotted' | 'thick' | 'triple' | 'dotDash' | 'dotDotDash' | 'wave' | 'doubleWave';
|
|
@@ -1813,6 +1859,28 @@ export type LineInlineImageAlignment = {
|
|
|
1813
1859
|
runIndex: number;
|
|
1814
1860
|
verticalAlign: ImageRunVerticalAlign;
|
|
1815
1861
|
};
|
|
1862
|
+
/**
|
|
1863
|
+
* Paint-ready geometry for one inline-box slice on a measured line.
|
|
1864
|
+
*
|
|
1865
|
+
* Measurement owns the slice geometry and resolved style. The painter consumes
|
|
1866
|
+
* these values directly and never normalizes logical sides or measures the DOM.
|
|
1867
|
+
*/
|
|
1868
|
+
export type LineInlineBox = {
|
|
1869
|
+
id: string;
|
|
1870
|
+
/** Line-relative UTF-16 offsets covered by this slice. */
|
|
1871
|
+
from: number;
|
|
1872
|
+
to: number;
|
|
1873
|
+
x: number;
|
|
1874
|
+
width: number;
|
|
1875
|
+
top: number;
|
|
1876
|
+
height: number;
|
|
1877
|
+
startsRange: boolean;
|
|
1878
|
+
endsRange: boolean;
|
|
1879
|
+
style: ResolvedInlineBoxStyle;
|
|
1880
|
+
className?: string;
|
|
1881
|
+
data?: Record<string, string>;
|
|
1882
|
+
cursor?: 'default' | 'pointer' | 'text' | 'help';
|
|
1883
|
+
};
|
|
1816
1884
|
export type Line = {
|
|
1817
1885
|
fromRun: number;
|
|
1818
1886
|
fromChar: number;
|
|
@@ -1843,6 +1911,8 @@ export type Line = {
|
|
|
1843
1911
|
* wins over the entry here.
|
|
1844
1912
|
*/
|
|
1845
1913
|
inlineImageAlignments?: LineInlineImageAlignment[];
|
|
1914
|
+
/** Paint-ready inline-box slices emitted by measurement. */
|
|
1915
|
+
inlineBoxes?: LineInlineBox[];
|
|
1846
1916
|
/**
|
|
1847
1917
|
* Measured tab widths keyed by tab run `pmStart`, stored alongside the
|
|
1848
1918
|
* `ParagraphMeasure` so the painter can read them even after FlowBlock
|
|
@@ -2455,5 +2525,7 @@ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) =>
|
|
|
2455
2525
|
export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
|
|
2456
2526
|
export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
|
|
2457
2527
|
export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
|
|
2458
|
-
export {
|
|
2528
|
+
export { INLINE_OBJECT_REPLACEMENT_CHARACTER, flattenParagraphVisibleText, mapVisibleRangeToRunSlices, type ParagraphVisibleRunSlice, } from './paragraph-visible-text.js';
|
|
2529
|
+
export { inlineBoxStyleSignature, isFiniteNonNegativeInteger, normalizeInlineBoxLogicalSides, type InlineBoxLogicalSides, type ResolvedInlineBoxLogicalSides, } from './inline-box.js';
|
|
2530
|
+
export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type NonFlowingPageRelativeAnchorDependencyProof, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
|
|
2459
2531
|
export * as Engines from './engines/index.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResolvedInlineBoxStyle } from './index.js';
|
|
2
|
+
export type InlineBoxLogicalSides = number | {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
};
|
|
6
|
+
export type ResolvedInlineBoxLogicalSides = {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
/** True for finite, non-negative integer CSS pixel values. */
|
|
11
|
+
export declare const isFiniteNonNegativeInteger: (value: unknown) => value is number;
|
|
12
|
+
/**
|
|
13
|
+
* Expands a scalar logical value into explicit start/end values.
|
|
14
|
+
*
|
|
15
|
+
* Undefined resolves to zero. Invalid or non-integer input fails closed.
|
|
16
|
+
*/
|
|
17
|
+
export declare const normalizeInlineBoxLogicalSides: (value: InlineBoxLogicalSides | undefined) => ResolvedInlineBoxLogicalSides | null;
|
|
18
|
+
/** Stable signature for every metric and appearance value consumed by paint. */
|
|
19
|
+
export declare const inlineBoxStyleSignature: (style: ResolvedInlineBoxStyle) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ParagraphBlock } from './index.js';
|
|
2
|
+
export declare const INLINE_OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
|
|
3
|
+
export type ParagraphVisibleRunSlice = {
|
|
4
|
+
runIndex: number;
|
|
5
|
+
fromChar: number;
|
|
6
|
+
toChar: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Flattens a paragraph into Document API visible-text coordinates.
|
|
10
|
+
*
|
|
11
|
+
* Text is preserved verbatim in UTF-16. Every non-text run contributes one
|
|
12
|
+
* U+FFFC object-replacement character, regardless of its rendered label.
|
|
13
|
+
*/
|
|
14
|
+
export declare const flattenParagraphVisibleText: (block: ParagraphBlock) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Maps a validated visible-text range to slices in the paragraph's run space.
|
|
17
|
+
* Returns null for non-integer, reversed, negative, or out-of-bounds ranges.
|
|
18
|
+
*/
|
|
19
|
+
export declare const mapVisibleRangeToRunSlices: (block: ParagraphBlock, from: number, to: number) => ParagraphVisibleRunSlice[] | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PageCheckpointDependencyClass, FlowBlock, Layout, Measure, HeaderFooterLayout, ParagraphBlock, ParagraphMeasure, ColumnLayout } from '../../contracts/src/index.js';
|
|
1
|
+
import { NonFlowingPageRelativeAnchorDependencyProof, PageCheckpointDependencyClass, FlowBlock, Layout, Measure, HeaderFooterLayout, ParagraphBlock, ParagraphMeasure, ColumnLayout } from '../../contracts/src/index.js';
|
|
2
2
|
import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
|
|
3
3
|
import { LayoutOptions, HeaderFooterConstraints } from '../../layout-engine/src/index.js';
|
|
4
4
|
import { computeDirtyRegions } from './diff.js';
|
|
@@ -207,6 +207,7 @@ export type IncrementalPaginationProof = IncrementalPaginationProofBase & ({
|
|
|
207
207
|
globalDependenciesAbsent: false;
|
|
208
208
|
globalDependenciesFencedByPageCheckpoint: true;
|
|
209
209
|
admittedDependencyClasses: readonly PageCheckpointDependencyClass[];
|
|
210
|
+
nonFlowingPageRelativeAnchorDependency?: NonFlowingPageRelativeAnchorDependencyProof;
|
|
210
211
|
localKeepDependencyClosure?: {
|
|
211
212
|
checkpointPageIndex: number;
|
|
212
213
|
checkpointBlockId: string | null;
|
|
@@ -280,6 +281,8 @@ export interface IncrementalLayoutExecutionControl {
|
|
|
280
281
|
yieldToHost?: () => Promise<void>;
|
|
281
282
|
/** Checkpoint cadence for the block measurement loop. Defaults to 32. */
|
|
282
283
|
yieldEveryBlocks?: number;
|
|
284
|
+
/** Time-aware mounted probe. Null is the allocation-free under-budget path. */
|
|
285
|
+
checkpointIfDue?: () => Promise<void> | null;
|
|
283
286
|
}
|
|
284
287
|
export declare function incrementalLayout(previousBlocks: FlowBlock[], _previousLayout: Layout | null, nextBlocks: FlowBlock[], options: LayoutOptions, measureBlock: (block: FlowBlock, constraints: {
|
|
285
288
|
maxWidth: number;
|
|
@@ -12,6 +12,7 @@ export type { BoundaryRange } from './text-boundaries.js';
|
|
|
12
12
|
export { buildSectionAwareHeaderFooterLayoutKey, buildSectionContentWidth, buildEffectiveHeaderFooterRefsBySection, collectReferencedHeaderFooterRIds, buildSectionAwareHeaderFooterMeasurementGroups, } from './sectionAwareHeaderFooter.js';
|
|
13
13
|
export type { HeaderFooterSectionKind, HeaderFooterRefs, SectionAwareHeaderFooterMeasurementGroup, } from './sectionAwareHeaderFooter.js';
|
|
14
14
|
export { clearIncrementalModuleState, incrementalLayout, measureCache, normalizeMargin, hydrateTableTextboxMeasures, } from './incrementalLayout.js';
|
|
15
|
+
export { hashMeasureContent } from './cache.js';
|
|
15
16
|
export type { HeaderFooterLayoutResult, IncrementalLayoutBridgeTiming, IncrementalLayoutResult, IncrementalMeasureReuseProof, IncrementalLayoutReuseOptions, IncrementalLayoutReuseSummary, IncrementalSectionPageNumberTransform, IncrementalLayoutTailAdoption, IncrementalLayoutTailDisposition, IncrementalPaginationProof, LayoutPositionTransform, FootnoteReserveSeed, } from './incrementalLayout.js';
|
|
16
17
|
export { collectFootnoteLedgers, getPreferredReserveCandidates, getPreferredReserveTrialTargets, isMandatoryOnlyFootnotePage, scoreFootnoteWindow, summarizeFootnoteWindow, } from './footnote-scorer.js';
|
|
17
18
|
export type { FootnotePreferredReserveCandidate, FootnoteWindowScoreInput, FootnoteWindowScoreReason, FootnoteWindowScoreResult, FootnoteWindowStats, } from './footnote-scorer.js';
|
|
@@ -28,6 +28,10 @@ export type PageResolver = (pageNumber: number) => {
|
|
|
28
28
|
chapterNumberText?: string;
|
|
29
29
|
chapterSeparator?: PageNumberChapterSeparator;
|
|
30
30
|
};
|
|
31
|
+
/** Optional cooperative execution hook for browser-owned furniture builds. */
|
|
32
|
+
export interface HeaderFooterLayoutExecution {
|
|
33
|
+
checkpointIfDue?: () => Promise<void> | null;
|
|
34
|
+
}
|
|
31
35
|
/**
|
|
32
36
|
* Digit bucket for page number caching strategy.
|
|
33
37
|
* Different digit lengths require different measurements due to width changes.
|
|
@@ -120,4 +124,4 @@ export declare function invalidateHeaderFooterMeasureCache(blockIds: string[]):
|
|
|
120
124
|
* @param pageResolver - Callback to resolve display page info for a physical page number
|
|
121
125
|
* @returns Batch result with layouts, blocks, and measures for each variant
|
|
122
126
|
*/
|
|
123
|
-
export declare function layoutHeaderFooterWithCache(sections: HeaderFooterBatch, constraints: HeaderFooterConstraints, measureBlock: MeasureResolver, cache?: HeaderFooterLayoutCache, totalPages?: number, pageResolver?: PageResolver, kind?: 'header' | 'footer', fontSignature?: string, remeasureParagraph?: (block: ParagraphBlock, maxWidth: number, firstLineIndent?: number) => ParagraphMeasure, options?: ResolveHeaderFooterTokensOptions): Promise<HeaderFooterBatchResult>;
|
|
127
|
+
export declare function layoutHeaderFooterWithCache(sections: HeaderFooterBatch, constraints: HeaderFooterConstraints, measureBlock: MeasureResolver, cache?: HeaderFooterLayoutCache, totalPages?: number, pageResolver?: PageResolver, kind?: 'header' | 'footer', fontSignature?: string, remeasureParagraph?: (block: ParagraphBlock, maxWidth: number, firstLineIndent?: number) => ParagraphMeasure, options?: ResolveHeaderFooterTokensOptions, execution?: HeaderFooterLayoutExecution): Promise<HeaderFooterBatchResult>;
|
|
@@ -5,6 +5,8 @@ import { Run } from '../../contracts/src/index.js';
|
|
|
5
5
|
* Include every run property that affects text measurement or painted output but is not
|
|
6
6
|
* covered elsewhere (e.g. tracked-change / comment keys). When adding a new visual
|
|
7
7
|
* property, update this function only — `cache.ts` and `diff.ts` both depend on it.
|
|
8
|
+
* Paragraph-scoped inline boxes are deliberately keyed by `inline-box-key.ts`,
|
|
9
|
+
* not by this run-scoped helper.
|
|
8
10
|
*
|
|
9
11
|
* @param run - Flow run (text, tab, image, etc.); unknown fields are ignored safely.
|
|
10
12
|
* @returns Stable string encoding bold/italic/underline/strike/color/font/highlight/link.
|
|
@@ -7,18 +7,6 @@ import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
|
|
|
7
7
|
* @returns CSS font string (e.g., "italic bold 16px Arial")
|
|
8
8
|
*/
|
|
9
9
|
export declare function getRunFontString(run: Run, fontContext?: FontMeasureContext): string;
|
|
10
|
-
/**
|
|
11
|
-
* Measure the X position for a specific character offset within a line.
|
|
12
|
-
* Uses Canvas measureText for pixel-perfect accuracy.
|
|
13
|
-
*
|
|
14
|
-
* @param block - The paragraph block containing the line
|
|
15
|
-
* @param line - The line to measure within
|
|
16
|
-
* @param charOffset - Character offset from the start of the line (0-based)
|
|
17
|
-
* @param availableWidthOverride - Optional override for available width
|
|
18
|
-
* @param alignmentOverride - Optional override for text alignment (e.g., 'left' for list items
|
|
19
|
-
* which are always rendered left-aligned in the DOM regardless of paragraph alignment)
|
|
20
|
-
* @returns The X coordinate (in pixels) from the start of the line
|
|
21
|
-
*/
|
|
22
10
|
export declare function measureCharacterX(block: FlowBlock, line: Line, charOffset: number, availableWidthOverride?: number, alignmentOverride?: string, fontContext?: FontMeasureContext): number;
|
|
23
11
|
/**
|
|
24
12
|
* Convert a character offset within a line back to a ProseMirror position.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Line, LineInlineBox, ParagraphBlock, Run, TextRun } from '../../../../contracts/src/index.js';
|
|
2
|
+
export declare const markInlineBoxRun: (run: TextRun, lineFrom: number, lineTo: number) => TextRun;
|
|
3
|
+
/** Splits text runs at the segment boundaries emitted for inline-box edges. */
|
|
4
|
+
export declare const splitInlineBoxRuns: (block: ParagraphBlock, line: Line) => Run[] | null;
|
|
5
|
+
/** Returns the resolved inline advance preceding an explicitly positioned text segment. */
|
|
6
|
+
export declare const inlineBoxAdvanceBeforeOffset: (boxes: readonly LineInlineBox[] | undefined, offset: number) => number;
|
|
7
|
+
/** Paints measured LTR inline-box slices on the canonical text leaves. */
|
|
8
|
+
export declare const paintInlineBoxes: (boxes: readonly LineInlineBox[] | undefined, lineElement: HTMLElement, isRtl: boolean) => void;
|