superdoc 2.4.0-next.4 → 2.4.0-next.41

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.
Files changed (91) hide show
  1. package/AGENTS.md +13 -13
  2. package/README.md +19 -22
  3. package/dist/chunks/{FindReplaceSurface-Dx0llWqP.cjs → FindReplaceSurface-0p7EtMZh.cjs} +4 -4
  4. package/dist/chunks/{FindReplaceSurface-BEW-1NhM.es.js → FindReplaceSurface-40AnrqWk.es.js} +5 -4
  5. package/dist/chunks/{PasswordPromptSurface-BUUVC2ee.cjs → PasswordPromptSurface-31lYPcCK.cjs} +4 -3
  6. package/dist/chunks/{PasswordPromptSurface-BA6HHqEa.es.js → PasswordPromptSurface-CwYeO3iQ.es.js} +4 -2
  7. package/dist/chunks/{PdfViewer-CNOtyS-I.es.js → PdfViewer-D8h7LRZy.es.js} +103 -19
  8. package/dist/chunks/{PdfViewer-qpvzwYMz.cjs → PdfViewer-Dug6yDRC.cjs} +105 -20
  9. package/dist/chunks/_plugin-vue_export-helper-BOaGB7Aw.es.js +8 -0
  10. package/dist/chunks/_plugin-vue_export-helper-SDR04tiH.cjs +13 -0
  11. package/dist/chunks/{blank-docx-DP8RUPW-.cjs → blank-docx-BuFAbRjs.cjs} +2 -0
  12. package/dist/chunks/{blank-docx-XRX6Ker2.es.js → blank-docx-DzQccOlW.es.js} +2 -0
  13. package/dist/chunks/constants-B6VBlmKp.es.js +4 -0
  14. package/dist/chunks/constants-DpXuDx_g.cjs +9 -0
  15. package/dist/chunks/{create-super-doc-ui-Dli6Wq70.es.js → create-super-doc-ui-B5SqT0gL.es.js} +2114 -1146
  16. package/dist/chunks/{create-super-doc-ui-BHMQEL2y.cjs → create-super-doc-ui-Dmv8Hjs6.cjs} +1924 -1190
  17. package/dist/chunks/{eventemitter3-Bt2s0X0a.es.js → eventemitter3-CMOjDs74.es.js} +124 -16
  18. package/dist/chunks/{eventemitter3-DqY4aSMf.cjs → eventemitter3-D38u8ta_.cjs} +125 -16
  19. package/dist/chunks/jszip-RC64TPzL.cjs +4758 -0
  20. package/dist/chunks/jszip-VxCFV9YS.es.js +4717 -0
  21. package/dist/chunks/{rolldown-runtime-D7PMmH3s.es.js → rolldown-runtime-B5TtN50X.es.js} +13 -4
  22. package/dist/chunks/{rolldown-runtime-1Y-nnZJ3.cjs → rolldown-runtime-DtsSbkrh.cjs} +12 -3
  23. package/dist/chunks/{uuid-CFp0WGVU.cjs → uuid-BhG0ngwk.cjs} +10 -6
  24. package/dist/chunks/{uuid-B2Sqk-3p.es.js → uuid-H0Xcmmhy.es.js} +8 -3
  25. package/dist/collaboration-upgrade-engine.cjs +34 -9
  26. package/dist/collaboration-upgrade-engine.es.js +30 -5
  27. package/dist/document-api/src/citations/citations.types.d.ts +9 -0
  28. package/dist/document-api/src/comments/comments.types.d.ts +7 -0
  29. package/dist/document-api/src/types/receipt.d.ts +9 -5
  30. package/dist/document-api/src/types/track-changes.types.d.ts +18 -3
  31. package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +22 -2
  32. package/dist/layout-engine/contracts/src/index.d.ts +83 -2
  33. package/dist/layout-engine/contracts/src/inline-box.d.ts +19 -0
  34. package/dist/layout-engine/contracts/src/paragraph-visible-text.d.ts +19 -0
  35. package/dist/layout-engine/layout-bridge/src/hydrateTableTextboxMeasures.d.ts +9 -0
  36. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +28 -10
  37. package/dist/layout-engine/layout-bridge/src/index.d.ts +4 -2
  38. package/dist/layout-engine/layout-bridge/src/inline-box-key.d.ts +3 -0
  39. package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +10 -3
  40. package/dist/layout-engine/layout-bridge/src/run-visual-marks.d.ts +2 -0
  41. package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +0 -12
  42. package/dist/layout-engine/layout-engine/src/anchors.d.ts +4 -0
  43. package/dist/layout-engine/layout-engine/src/execution.d.ts +21 -0
  44. package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +2 -0
  45. package/dist/layout-engine/layout-engine/src/footnote-anchor-index.d.ts +17 -0
  46. package/dist/layout-engine/layout-engine/src/index.d.ts +10 -7
  47. package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +3 -41
  48. package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +2 -0
  49. package/dist/layout-engine/layout-engine/src/section-props.d.ts +5 -0
  50. package/dist/layout-engine/painters/dom/src/runs/inline-box.d.ts +8 -0
  51. package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +6 -4
  52. package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +6 -0
  53. package/dist/public/ui-react.cjs +66 -2
  54. package/dist/public/ui-react.es.js +66 -1
  55. package/dist/public/ui.cjs +1 -1
  56. package/dist/public/ui.es.js +1 -1
  57. package/dist/style.css +174 -138
  58. package/dist/style.layered.css +174 -138
  59. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +2 -0
  60. package/dist/superdoc/src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue.d.ts +16 -0
  61. package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +3 -1
  62. package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +12 -0
  63. package/dist/superdoc/src/core/SuperDoc.d.ts +10 -7
  64. package/dist/superdoc/src/core/extensions/index.d.ts +1 -1
  65. package/dist/superdoc/src/core/extensions/types.d.ts +63 -5
  66. package/dist/superdoc/src/core/types/index.d.ts +535 -42
  67. package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +3 -3
  68. package/dist/superdoc/src/helpers/comment-small-screen.d.ts +10 -0
  69. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +3 -5
  70. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +4 -4
  71. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +11 -0
  72. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +1 -1
  73. package/dist/superdoc/src/public/index.d.cts +28 -0
  74. package/dist/superdoc/src/public/index.d.ts +14 -0
  75. package/dist/superdoc/src/public/ui/types.d.ts +30 -6
  76. package/dist/superdoc/src/stores/comments-store.d.ts +81 -78
  77. package/dist/superdoc/src/stores/superdoc-store.d.ts +243 -234
  78. package/dist/superdoc.cjs +6790 -2159
  79. package/dist/superdoc.es.js +6663 -2032
  80. package/dist-cdn/style.layered.css +1 -1
  81. package/dist-cdn/superdoc.min.css +1 -1
  82. package/dist-cdn/superdoc.min.js +37 -37
  83. package/package.json +14 -14
  84. package/dist/chunks/_plugin-vue_export-helper-BTwbGDKw.cjs +0 -11
  85. package/dist/chunks/_plugin-vue_export-helper-CInC0bKI.es.js +0 -6
  86. package/dist/chunks/constants-CY3R3_kF.es.js +0 -3
  87. package/dist/chunks/constants-sbCZ2O_A.cjs +0 -14
  88. package/dist/chunks/jszip-C8srOKAO.es.js +0 -4650
  89. package/dist/chunks/jszip-Cs9JBLlJ.cjs +0 -4691
  90. package/dist/superdoc/src/helpers/v2-remote-review-hydration.d.ts +0 -12
  91. 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) => () => (fn && (res = fn(fn = 0)), res);
8
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
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) => () => (fn && (res = fn(fn = 0)), res);
8
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
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 randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
16
- var native_default = { randomUUID };
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
- var v4_default = v4;
33
- Object.defineProperty(exports, "v4_default", {
36
+ //#endregion
37
+ Object.defineProperty(exports, "v4", {
34
38
  enumerable: true,
35
39
  get: function() {
36
- return v4_default;
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
- var v4_default = v4;
32
- export { v4_default as t };
36
+ //#endregion
37
+ export { v4 as t };
@@ -1,33 +1,58 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let __superdoc_docx_engine_collaboration_upgrade_engine = require("@superdoc/docx-engine/collaboration-upgrade-engine");
3
- const COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION = 1;
4
- const SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS = Object.freeze([1]);
5
- const SUPPORTED_V1_READER_CONTRACT_VERSIONS = Object.freeze([1]);
6
- const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
7
- var PRIVATE_ENGINE_INFO = (0, __superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
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.4",
22
+ superdocVersion: "2.4.0-next.41",
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, __superdoc_docx_engine_collaboration_upgrade_engine.buildV2CollaborationUpgradeArtifactFromBundle)(input);
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, __superdoc_docx_engine_collaboration_upgrade_engine.validateV2CollaborationUpgradeTarget)(input);
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
- const COLLABORATION_UPGRADE_ENGINE_PROTOCOL_VERSION = 1;
3
- const SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS = Object.freeze([1]);
4
- const SUPPORTED_V1_READER_CONTRACT_VERSIONS = Object.freeze([1]);
5
- const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
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.4",
21
+ superdocVersion: "2.4.0-next.41",
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
- * - Any caller-held text address whose `range.start` is `>= atChar` in the
46
- * same `story` gets `range.start += delta` (and similarly `range.end`).
47
- * - Any caller-held text address whose range straddles `atChar` is
48
- * *invalidated* the kernel already lists those in `invalidatedRefs`.
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 as separate entries.
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
  }
@@ -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 defined by
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
@@ -459,6 +457,16 @@ export interface TrackChangeNavigationTarget {
459
457
  blockId: string;
460
458
  role: 'primary' | 'move-source' | 'move-destination' | 'formatting-carrier' | 'structural-carrier';
461
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
+ }
462
470
  export interface TrackChangeInfo {
463
471
  address: TrackedChangeAddress;
464
472
  /** Stable SuperDoc logical tracked-change id (spec §3 / §4). */
@@ -571,6 +579,11 @@ export interface TrackChangeInfo {
571
579
  * tracked changes. Absent when the change is standalone.
572
580
  */
573
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[];
574
587
  }
575
588
  export interface TrackChangesListQuery {
576
589
  limit?: number;
@@ -696,6 +709,8 @@ export interface TrackChangeDomain {
696
709
  * stack without an extra `trackChanges.get` round trip.
697
710
  */
698
711
  overlap?: TrackChangeOverlapInfo;
712
+ /** Unknown extension attributes attached to the contributing OOXML revision carriers. */
713
+ readonly customAttributes?: readonly TrackChangeCustomAttribute[];
699
714
  }
700
715
  /**
701
716
  * Standardized discovery output for `trackChanges.list`.
@@ -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.1.0";
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';
@@ -1645,6 +1691,8 @@ export type ParagraphAttrs = {
1645
1691
  tabIntervalTwips?: number;
1646
1692
  keepNext?: boolean;
1647
1693
  keepLines?: boolean;
1694
+ /** Prevent a single first or last paragraph line from appearing alone on a page. Defaults to true. */
1695
+ widowControl?: boolean;
1648
1696
  pageBreakBefore?: boolean;
1649
1697
  trackedChangesMode?: TrackedChangesMode;
1650
1698
  trackedChangesEnabled?: boolean;
@@ -1761,6 +1809,13 @@ export declare const isForcedSectPrSectionBreak: (block: FlowBlock | undefined)
1761
1809
  * accepted only when their source/anchor proves they belong to the same filler
1762
1810
  * run.
1763
1811
  */
1812
+ export type SectionBoundaryFillerScanCheckpoint = {
1813
+ index: number;
1814
+ total: number;
1815
+ };
1816
+ export declare function collectSectionBoundaryFillerBlockIdsSteps(blocks: readonly FlowBlock[], options?: {
1817
+ isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
1818
+ }, checkpointEveryBlocks?: number | null): Generator<SectionBoundaryFillerScanCheckpoint, ReadonlySet<string>, void>;
1764
1819
  export declare const collectSectionBoundaryFillerBlockIds: (blocks: readonly FlowBlock[], options?: {
1765
1820
  isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
1766
1821
  }) => ReadonlySet<string>;
@@ -1813,6 +1868,28 @@ export type LineInlineImageAlignment = {
1813
1868
  runIndex: number;
1814
1869
  verticalAlign: ImageRunVerticalAlign;
1815
1870
  };
1871
+ /**
1872
+ * Paint-ready geometry for one inline-box slice on a measured line.
1873
+ *
1874
+ * Measurement owns the slice geometry and resolved style. The painter consumes
1875
+ * these values directly and never normalizes logical sides or measures the DOM.
1876
+ */
1877
+ export type LineInlineBox = {
1878
+ id: string;
1879
+ /** Line-relative UTF-16 offsets covered by this slice. */
1880
+ from: number;
1881
+ to: number;
1882
+ x: number;
1883
+ width: number;
1884
+ top: number;
1885
+ height: number;
1886
+ startsRange: boolean;
1887
+ endsRange: boolean;
1888
+ style: ResolvedInlineBoxStyle;
1889
+ className?: string;
1890
+ data?: Record<string, string>;
1891
+ cursor?: 'default' | 'pointer' | 'text' | 'help';
1892
+ };
1816
1893
  export type Line = {
1817
1894
  fromRun: number;
1818
1895
  fromChar: number;
@@ -1843,6 +1920,8 @@ export type Line = {
1843
1920
  * wins over the entry here.
1844
1921
  */
1845
1922
  inlineImageAlignments?: LineInlineImageAlignment[];
1923
+ /** Paint-ready inline-box slices emitted by measurement. */
1924
+ inlineBoxes?: LineInlineBox[];
1846
1925
  /**
1847
1926
  * Measured tab widths keyed by tab run `pmStart`, stored alongside the
1848
1927
  * `ParagraphMeasure` so the painter can read them even after FlowBlock
@@ -2455,5 +2534,7 @@ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) =>
2455
2534
  export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
2456
2535
  export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
2457
2536
  export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
2458
- export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
2537
+ export { INLINE_OBJECT_REPLACEMENT_CHARACTER, flattenParagraphVisibleText, mapVisibleRangeToRunSlices, type ParagraphVisibleRunSlice, } from './paragraph-visible-text.js';
2538
+ export { inlineBoxStyleSignature, isFiniteNonNegativeInteger, normalizeInlineBoxLogicalSides, type InlineBoxLogicalSides, type ResolvedInlineBoxLogicalSides, } from './inline-box.js';
2539
+ export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type NonFlowingPageRelativeAnchorDependencyProof, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
2459
2540
  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;
@@ -0,0 +1,9 @@
1
+ import { FlowBlock, ParagraphBlock, ParagraphMeasure } from '../../contracts/src/index.js';
2
+ type TextboxRemeasure = (block: ParagraphBlock, maxWidth: number) => ParagraphMeasure;
3
+ /**
4
+ * Derives table-cell textbox measurements without mutating the projection
5
+ * plane supplied by the caller. Only the textbox and its table ancestry are
6
+ * copied; documents without table textboxes retain their original identities.
7
+ */
8
+ export declare function hydrateTableTextboxMeasures(blocks: FlowBlock[], remeasure: TextboxRemeasure): FlowBlock[];
9
+ export {};