superdoc 2.4.0-next.2 → 2.4.0-next.21
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-Dx0llWqP.cjs → FindReplaceSurface-0p7EtMZh.cjs} +4 -4
- package/dist/chunks/{FindReplaceSurface-BEW-1NhM.es.js → FindReplaceSurface-40AnrqWk.es.js} +5 -4
- package/dist/chunks/{PasswordPromptSurface-BUUVC2ee.cjs → PasswordPromptSurface-31lYPcCK.cjs} +4 -3
- package/dist/chunks/{PasswordPromptSurface-BA6HHqEa.es.js → PasswordPromptSurface-CwYeO3iQ.es.js} +4 -2
- package/dist/chunks/{PdfViewer-CNOtyS-I.es.js → PdfViewer-D8h7LRZy.es.js} +103 -19
- package/dist/chunks/{PdfViewer-qpvzwYMz.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-D4kk9AjM.es.js → create-super-doc-ui-CFsY0uxw.es.js} +2177 -581
- package/dist/chunks/{create-super-doc-ui-DXdWuTzm.cjs → create-super-doc-ui-jSJQis_0.cjs} +1987 -619
- 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/comments/comments.types.d.ts +7 -0
- package/dist/document-api/src/types/track-changes.types.d.ts +1 -3
- package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +22 -2
- package/dist/layout-engine/contracts/src/index.d.ts +1 -1
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +2 -1
- package/dist/layout-engine/layout-bridge/src/index.d.ts +1 -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 +104 -69
- package/dist/style.layered.css +104 -69
- package/dist/superdoc/src/core/SuperDoc.d.ts +4 -0
- package/dist/superdoc/src/core/types/index.d.ts +505 -42
- package/dist/superdoc/src/helpers/comment-small-screen.d.ts +10 -0
- package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +1 -0
- package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +1 -1
- package/dist/superdoc/src/helpers/v2-typing-review-hydration.d.ts +16 -0
- 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 +22 -0
- package/dist/superdoc/src/public/index.d.ts +11 -0
- package/dist/superdoc/src/public/ui/types.d.ts +25 -1
- package/dist/superdoc/src/stores/comments-store.d.ts +100 -22
- package/dist/superdoc/src/stores/superdoc-store.d.ts +300 -66
- package/dist/superdoc.cjs +6678 -1391
- package/dist/superdoc.es.js +6556 -1268
- 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-BTwbGDKw.cjs +0 -11
- package/dist/chunks/_plugin-vue_export-helper-CInC0bKI.es.js +0 -6
- package/dist/chunks/constants-CY3R3_kF.es.js +0 -3
- package/dist/chunks/constants-sbCZ2O_A.cjs +0 -14
- package/dist/chunks/jszip-C8srOKAO.es.js +0 -4650
- package/dist/chunks/jszip-Cs9JBLlJ.cjs +0 -4691
|
@@ -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-next.
|
|
22
|
+
superdocVersion: "2.4.0-next.21",
|
|
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-next.
|
|
21
|
+
superdocVersion: "2.4.0-next.21",
|
|
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 };
|
|
@@ -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).
|
|
@@ -2,9 +2,7 @@ import { TextTarget, TrackedChangeAddress } from './address.js';
|
|
|
2
2
|
import { DiscoveryOutput } from './discovery.js';
|
|
3
3
|
import { StoryLocator } from './story.types.js';
|
|
4
4
|
/**
|
|
5
|
-
* Canonical v2 tracked-change broad-type vocabulary
|
|
6
|
-
* `../labs/tests/requirements/specs/tracked-changes-comments/tracked-changes-spec.md`
|
|
7
|
-
* §3 / §5.
|
|
5
|
+
* Canonical v2 tracked-change broad-type vocabulary.
|
|
8
6
|
*
|
|
9
7
|
* Public adapters MUST emit one of these values. Existing v1 emitters and
|
|
10
8
|
* tests still produce the legacy `insert` / `delete` / `format` strings; both
|
|
@@ -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[];
|
|
@@ -2455,5 +2455,5 @@ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) =>
|
|
|
2455
2455
|
export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
|
|
2456
2456
|
export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
|
|
2457
2457
|
export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
|
|
2458
|
-
export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
|
|
2458
|
+
export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type NonFlowingPageRelativeAnchorDependencyProof, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
|
|
2459
2459
|
export * as Engines from './engines/index.js';
|
|
@@ -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;
|
|
@@ -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';
|
package/dist/public/ui-react.cjs
CHANGED
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DXdWuTzm.cjs");
|
|
2
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-jSJQis_0.cjs");
|
|
4
3
|
let react = require("react");
|
|
4
|
+
//#region src/public/ui/react.ts
|
|
5
|
+
/**
|
|
6
|
+
* v2-native React bindings for the `superdoc/ui` controller.
|
|
7
|
+
*
|
|
8
|
+
* Provider + hooks over the SuperDoc-owned controller (`superdoc.ui`). For a
|
|
9
|
+
* real `SuperDoc` this layer never creates or destroys a controller; it binds
|
|
10
|
+
* to the one the instance already owns. It falls back to building (and then
|
|
11
|
+
* owning) one only for a structural host that carries no `ui`, since
|
|
12
|
+
* `SuperDocHost` leaves that property optional. Authored with
|
|
13
|
+
* `React.createElement` (no JSX) so the
|
|
14
|
+
* library build needs no JSX transform, and `react` stays an external/optional
|
|
15
|
+
* peer. No v1 editor or private v2 runtime imports.
|
|
16
|
+
*/
|
|
5
17
|
var SuperDocUIContext = (0, react.createContext)(null);
|
|
18
|
+
/**
|
|
19
|
+
* Destroy a controller this provider built itself. Controllers read off
|
|
20
|
+
* `superdoc.ui` are never passed here: the instance owns those.
|
|
21
|
+
*/
|
|
6
22
|
function disposeOwnedUi(ref) {
|
|
7
23
|
const ui = ref.current;
|
|
8
24
|
if (!ui) return;
|
|
9
25
|
ui.destroy();
|
|
10
26
|
ref.current = null;
|
|
11
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Root provider. Call {@link useSetSuperDoc} from your editor-mount
|
|
30
|
+
* component's ready callback to bind a running SuperDoc instance; the hooks
|
|
31
|
+
* below then read that instance's own controller (`superdoc.ui`).
|
|
32
|
+
*
|
|
33
|
+
* The provider is a consumer, not an owner. SuperDoc creates the controller
|
|
34
|
+
* and destroys it in `superdoc.destroy()`, so unmounting or rebinding the
|
|
35
|
+
* provider leaves it running for the built-in toolbar and any other consumer
|
|
36
|
+
* of the same instance. Every React hook therefore observes the same command
|
|
37
|
+
* state the rest of the application sees.
|
|
38
|
+
*/
|
|
12
39
|
function SuperDocUIProvider(props) {
|
|
13
40
|
const [ui, setUi] = (0, react.useState)(null);
|
|
14
41
|
const [host, setHost] = (0, react.useState)(null);
|
|
42
|
+
/** Only ever holds a controller this provider created for a host lacking one. */
|
|
15
43
|
const ownedUiRef = (0, react.useRef)(null);
|
|
16
44
|
const setSuperDoc = (0, react.useCallback)((superdoc) => {
|
|
17
45
|
const hostUi = superdoc.ui;
|
|
@@ -37,15 +65,33 @@ function useContextValue() {
|
|
|
37
65
|
if (!value) throw new Error("[superdoc/ui/react] hooks must be used within <SuperDocUIProvider>.");
|
|
38
66
|
return value;
|
|
39
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Read the controller, or `null` until a SuperDoc instance is bound.
|
|
70
|
+
*
|
|
71
|
+
* Borrowed: the bound instance owns teardown, so the returned type omits
|
|
72
|
+
* `destroy()`. A provider-built fallback controller is disposed by the provider.
|
|
73
|
+
*/
|
|
40
74
|
function useSuperDocUI() {
|
|
41
75
|
return useContextValue().ui;
|
|
42
76
|
}
|
|
77
|
+
/** Read the raw bound SuperDoc host, or `null` until one is bound. */
|
|
43
78
|
function useSuperDocHost() {
|
|
44
79
|
return useContextValue().host;
|
|
45
80
|
}
|
|
81
|
+
/** Get the stable callback used to bind a running SuperDoc instance. */
|
|
46
82
|
function useSetSuperDoc() {
|
|
47
83
|
return useContextValue().setSuperDoc;
|
|
48
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Normalize a `pick` result into a {@link SliceSource}. Domain handles and the
|
|
87
|
+
* command/font hooks already expose the snapshot-shaped contract
|
|
88
|
+
* (`getSnapshot` + `observe`) and pass through unchanged. A raw `ui.select(...)`
|
|
89
|
+
* {@link Subscribable} (`get` + `subscribe`) is adapted: it `subscribe`s FIRST,
|
|
90
|
+
* then emits the current value, so a synchronous recompute triggered by the
|
|
91
|
+
* first listener is not missed (the substrate's `subscribe` does not emit on
|
|
92
|
+
* attach). Exported for unit tests; not re-exported by the `superdoc/ui/react`
|
|
93
|
+
* facade, so it stays off the public surface.
|
|
94
|
+
*/
|
|
49
95
|
function toSliceSource(source) {
|
|
50
96
|
const candidate = source;
|
|
51
97
|
if (typeof candidate.getSnapshot === "function" && typeof candidate.observe === "function") return source;
|
|
@@ -59,6 +105,13 @@ function toSliceSource(source) {
|
|
|
59
105
|
}
|
|
60
106
|
};
|
|
61
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Subscribe to a derived slice of controller state. `pick` selects a value
|
|
110
|
+
* source from the controller: a domain handle / snapshot source
|
|
111
|
+
* ({@link SliceSource}) or a raw `ui.select(...)` {@link Subscribable}, both
|
|
112
|
+
* normalized via {@link toSliceSource}. `initial` is returned until the
|
|
113
|
+
* controller is bound.
|
|
114
|
+
*/
|
|
62
115
|
function useSuperDocSlice(pick, initial) {
|
|
63
116
|
const ui = useSuperDocUI();
|
|
64
117
|
const [value, setValue] = (0, react.useState)(() => ui ? toSliceSource(pick(ui)).getSnapshot() : initial);
|
|
@@ -83,9 +136,11 @@ var EMPTY_SELECTION = {
|
|
|
83
136
|
activeChangeIds: [],
|
|
84
137
|
quotedText: ""
|
|
85
138
|
};
|
|
139
|
+
/** Subscribe to the selection slice. */
|
|
86
140
|
function useSuperDocSelection() {
|
|
87
141
|
return useSuperDocSlice((ui) => ui.selection, EMPTY_SELECTION);
|
|
88
142
|
}
|
|
143
|
+
/** Subscribe to the comments slice. */
|
|
89
144
|
function useSuperDocComments() {
|
|
90
145
|
return useSuperDocSlice((ui) => ui.comments, {
|
|
91
146
|
status: "pending",
|
|
@@ -96,6 +151,7 @@ function useSuperDocComments() {
|
|
|
96
151
|
activeId: null
|
|
97
152
|
});
|
|
98
153
|
}
|
|
154
|
+
/** Subscribe to the content-controls slice. */
|
|
99
155
|
function useSuperDocContentControls() {
|
|
100
156
|
return useSuperDocSlice((ui) => ui.contentControls, {
|
|
101
157
|
status: "pending",
|
|
@@ -105,6 +161,7 @@ function useSuperDocContentControls() {
|
|
|
105
161
|
activeIds: []
|
|
106
162
|
});
|
|
107
163
|
}
|
|
164
|
+
/** Subscribe to the track-changes slice. */
|
|
108
165
|
function useSuperDocTrackChanges() {
|
|
109
166
|
return useSuperDocSlice((ui) => ui.trackChanges, {
|
|
110
167
|
status: "pending",
|
|
@@ -114,6 +171,7 @@ function useSuperDocTrackChanges() {
|
|
|
114
171
|
authors: []
|
|
115
172
|
});
|
|
116
173
|
}
|
|
174
|
+
/** Subscribe to the toolbar snapshot slice. */
|
|
117
175
|
function useSuperDocToolbar() {
|
|
118
176
|
return useSuperDocSlice((ui) => ui.toolbar, {
|
|
119
177
|
context: null,
|
|
@@ -121,6 +179,7 @@ function useSuperDocToolbar() {
|
|
|
121
179
|
copyFormatActive: false
|
|
122
180
|
});
|
|
123
181
|
}
|
|
182
|
+
/** Subscribe to a single command's enable/active state. */
|
|
124
183
|
function useSuperDocCommand(id) {
|
|
125
184
|
return useSuperDocSlice((ui) => ({
|
|
126
185
|
getSnapshot: () => ui.commands.get(id).getState(),
|
|
@@ -131,6 +190,7 @@ function useSuperDocCommand(id) {
|
|
|
131
190
|
supported: false
|
|
132
191
|
});
|
|
133
192
|
}
|
|
193
|
+
/** Subscribe to the document slice. */
|
|
134
194
|
function useSuperDocDocument() {
|
|
135
195
|
return useSuperDocSlice((ui) => ui.document, {
|
|
136
196
|
ready: false,
|
|
@@ -138,18 +198,21 @@ function useSuperDocDocument() {
|
|
|
138
198
|
dirty: false
|
|
139
199
|
});
|
|
140
200
|
}
|
|
201
|
+
/** Subscribe to available font-family options. */
|
|
141
202
|
function useSuperDocFontOptions() {
|
|
142
203
|
return useSuperDocSlice((ui) => ({
|
|
143
204
|
getSnapshot: () => ui.fonts.getFamilyOptions(),
|
|
144
205
|
observe: (cb) => ui.fonts.observe((slice) => cb(slice.options))
|
|
145
206
|
}), []);
|
|
146
207
|
}
|
|
208
|
+
/** Subscribe to available font-size options. */
|
|
147
209
|
function useSuperDocFontSizeOptions() {
|
|
148
210
|
return useSuperDocSlice((ui) => ({
|
|
149
211
|
getSnapshot: () => ui.fonts.getSizeOptions(),
|
|
150
212
|
observe: (cb) => ui.fonts.observe((slice) => cb(slice.sizeOptions))
|
|
151
213
|
}), []);
|
|
152
214
|
}
|
|
215
|
+
/** Subscribe to the zoom slice. */
|
|
153
216
|
function useSuperDocZoom() {
|
|
154
217
|
return useSuperDocSlice((ui) => ui.zoom, {
|
|
155
218
|
mode: null,
|
|
@@ -158,6 +221,7 @@ function useSuperDocZoom() {
|
|
|
158
221
|
max: 100
|
|
159
222
|
});
|
|
160
223
|
}
|
|
224
|
+
//#endregion
|
|
161
225
|
exports.SuperDocUIProvider = SuperDocUIProvider;
|
|
162
226
|
exports.useSetSuperDoc = useSetSuperDoc;
|
|
163
227
|
exports.useSuperDocCommand = useSuperDocCommand;
|