superdoc 2.25.0-next.15 → 2.25.0-next.17

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 (36) hide show
  1. package/dist/chunks/{create-super-doc-ui-BbTRF-Z9.cjs → create-super-doc-ui-DZIB6Pd4.cjs} +317 -165
  2. package/dist/chunks/{create-super-doc-ui-Cr_04XnJ.es.js → create-super-doc-ui-DqCrc6Vw.es.js} +312 -166
  3. package/dist/collaboration-upgrade-engine.cjs +1 -1
  4. package/dist/collaboration-upgrade-engine.es.js +1 -1
  5. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  6. package/dist/document-api/src/customXml/customXml.types.d.ts +1 -1
  7. package/dist/document-api/src/lists/lists.types.d.ts +2 -0
  8. package/dist/document-api/src/metadata/anchored-metadata.types.d.ts +1 -1
  9. package/dist/document-api/src/types/mutation-plan.types.d.ts +4 -2
  10. package/dist/document-api/src/types/receipt.d.ts +10 -0
  11. package/dist/layout-engine/layout-bridge/src/index.d.ts +2 -0
  12. package/dist/layout-engine/layout-bridge/src/neutral-segment-geometry.d.ts +18 -1
  13. package/dist/layout-engine/layout-bridge/src/visual-bidi-geometry.d.ts +37 -0
  14. package/dist/public/ui-react.cjs +1 -1
  15. package/dist/public/ui-react.es.js +1 -1
  16. package/dist/public/ui-vue.cjs +1 -1
  17. package/dist/public/ui-vue.es.js +1 -1
  18. package/dist/public/ui.cjs +16 -1
  19. package/dist/public/ui.es.js +16 -2
  20. package/dist/style.css +1 -1
  21. package/dist/style.layered.css +1 -1
  22. package/dist/superdoc/src/core/SuperDoc.d.ts +1 -1
  23. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +7 -0
  24. package/dist/superdoc/src/public/ui/rejection-reasons.d.ts +1 -0
  25. package/dist/superdoc/src/public/ui/types.d.ts +1 -1
  26. package/dist/superdoc/src/public/ui.d.cts +9 -0
  27. package/dist/superdoc/src/public/ui.d.ts +2 -1
  28. package/dist/superdoc/src/stores/comments-store.d.ts +9 -3
  29. package/dist/superdoc/src/stores/superdoc-store.d.ts +27 -9
  30. package/dist/superdoc.cjs +175 -161
  31. package/dist/superdoc.es.js +155 -140
  32. package/dist-cdn/style.layered.css +1 -1
  33. package/dist-cdn/superdoc.min.css +1 -1
  34. package/dist-cdn/superdoc.min.js +42 -42
  35. package/package.json +2 -2
  36. package/dist/superdoc/src/components/HtmlViewer/HtmlViewer.vue.d.ts +0 -10
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-74VwNCz7.cjs");
3
3
  const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
4
- const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-BbTRF-Z9.cjs");
4
+ const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-DZIB6Pd4.cjs");
5
5
  const require_eventemitter3 = require("./chunks/eventemitter3-C_TAnXOl.cjs");
6
6
  const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
7
7
  const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-BUdjGKyl.cjs");
@@ -304,7 +304,7 @@ var awarenessStatesToArray = (context, states) => {
304
304
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
305
305
  function getSuperdocVersion() {
306
306
  try {
307
- return "2.25.0-next.15";
307
+ return "2.25.0-next.17";
308
308
  } catch {
309
309
  return "unknown";
310
310
  }
@@ -6787,6 +6787,11 @@ var useSuperdocStore = defineStore("superdoc", () => {
6787
6787
  */
6788
6788
  const _initializeDocumentData = async (doc) => {
6789
6789
  doc = normalizeDocumentEntry(doc);
6790
+ const documentType = doc.data?.type || doc.type;
6791
+ if (typeof documentType === "string") {
6792
+ const mimeType = documentType.split(";", 1)[0].trim().toLowerCase();
6793
+ if (mimeType === "text/html" || mimeType === "html") throw new Error("SuperDoc: HTML document viewing is not supported. Open a DOCX or PDF document.");
6794
+ }
6790
6795
  if (currentConfig.value?.html) doc.html = currentConfig.value.html;
6791
6796
  if (!doc.data && doc.url && !doc.type) doc.type = DOCX;
6792
6797
  if (currentConfig.value?.modules.collaboration && !doc.isNewFile) return {
@@ -9958,6 +9963,7 @@ var useCommentsStore = defineStore("comments", () => {
9958
9963
  ])
9959
9964
  ].map((value) => normalizeCommentId(value)).filter(Boolean));
9960
9965
  patch(() => {
9966
+ const previousPreparedPresentation = committedReviewPresentations.value[normalizedDocumentId] ?? null;
9961
9967
  if (preparedReview?.presentation) committedReviewPresentations.value = {
9962
9968
  ...committedReviewPresentations.value,
9963
9969
  [normalizedDocumentId]: preparedReview.presentation
@@ -9968,6 +9974,8 @@ var useCommentsStore = defineStore("comments", () => {
9968
9974
  documentId: normalizedDocumentId,
9969
9975
  items: trackedChangeItems,
9970
9976
  preparedParams,
9977
+ preparedPresentation: preparedReview?.presentation ?? null,
9978
+ previousPreparedPresentation,
9971
9979
  pruneStale: false
9972
9980
  });
9973
9981
  reconcileCommentsFromV2({
@@ -10981,6 +10989,8 @@ var useCommentsStore = defineStore("comments", () => {
10981
10989
  if (!fromId || !toId || fromId === toId) continue;
10982
10990
  const comment = commentsList.value.find((row) => matchesRemapSource(row, fromId));
10983
10991
  if (!comment) continue;
10992
+ const presentation = committedReviewPresentations.value[normalizedDocumentId];
10993
+ if (normalizeCommentId(comment.fileId) === normalizedDocumentId && presentation && Object.prototype.hasOwnProperty.call(presentation.rowVersions ?? {}, String(comment.commentId))) continue;
10984
10994
  const previousCommentId = normalizeCommentId(comment.commentId);
10985
10995
  const previousCanonicalId = normalizeCommentId(comment.trackedChangeCanonicalId);
10986
10996
  const previousPositionEntry = resolveCommentPositionEntry(comment).entry;
@@ -11348,7 +11358,7 @@ var useCommentsStore = defineStore("comments", () => {
11348
11358
  }
11349
11359
  };
11350
11360
  };
11351
- const reconcileTrackedChangesFromV2 = ({ superdoc, adapter, documentId, items, pruneStale = true, preparedParams = null, liveIds: suppliedLiveIds = null, liveAnchorKeys: suppliedLiveAnchorKeys = null, hydrationGeneration } = {}) => withInteractionSpan("store.trackedChanges.reconcile", "store-reconciliation", {
11361
+ const reconcileTrackedChangesFromV2 = ({ superdoc, adapter, documentId, items, pruneStale = true, preparedParams = null, preparedPresentation = null, previousPreparedPresentation = null, liveIds: suppliedLiveIds = null, liveAnchorKeys: suppliedLiveAnchorKeys = null, hydrationGeneration } = {}) => withInteractionSpan("store.trackedChanges.reconcile", "store-reconciliation", {
11352
11362
  documentId: documentId ?? null,
11353
11363
  itemCount: Array.isArray(items) ? items.length : null,
11354
11364
  pruneStale,
@@ -11366,6 +11376,22 @@ var useCommentsStore = defineStore("comments", () => {
11366
11376
  try {
11367
11377
  for (const params of paramsList) {
11368
11378
  if (!params) continue;
11379
+ if (preparedPresentation) {
11380
+ if (preparedPresentation !== committedReviewPresentations.value[String(effectiveDocumentId)]) continue;
11381
+ if (params.documentId != null && String(params.documentId) !== String(effectiveDocumentId)) continue;
11382
+ const id = normalizeCommentId(params.changeId);
11383
+ const version = preparedPresentation.rowVersions?.[id];
11384
+ if (!id || !Number.isSafeInteger(version) || version < 1) continue;
11385
+ const existing = [...trackedChangeIdentityIndex.candidates({ changeId: id })].filter((row) => String(row.fileId) === String(effectiveDocumentId) && String(row.commentId) === id);
11386
+ if (existing.length > 1) continue;
11387
+ const row = existing[0];
11388
+ if (row && row.trackedChangeCanonicalId !== params.trackedChangeCanonicalId) {
11389
+ const previousVersion = previousPreparedPresentation?.rowVersions?.[id];
11390
+ if (!row.trackedChange || params.event !== "add" || typeof params.trackedChangeCanonicalId !== "string" || !params.trackedChangeCanonicalId || !Number.isSafeInteger(previousVersion) || previousVersion < 1 || version <= previousVersion || getTrackedChangeStoryKey(row) !== parseTrackedChangeAnchorKey(params.trackedChangeAnchorKey)?.storyKey || row.trackedChangeType !== params.trackedChangeType || row.trackedChangeDisplayType !== params.trackedChangeDisplayType) continue;
11391
+ row.trackedChangeCanonicalId = params.trackedChangeCanonicalId;
11392
+ row.updateIdentityValues?.({ trackedChangeCanonicalId: params.trackedChangeCanonicalId });
11393
+ }
11394
+ }
11369
11395
  if (params.event === "omit") {
11370
11396
  if (params.changeId != null) liveIds.add(String(params.changeId));
11371
11397
  continue;
@@ -12238,15 +12264,15 @@ function useUiFontFamily() {
12238
12264
  }
12239
12265
  //#endregion
12240
12266
  //#region src/components/CommentsLayer/CommentsDropdown.vue
12241
- var _hoisted_1$32 = { class: "comments-dropdown" };
12242
- var _hoisted_2$25 = ["onClick"];
12243
- var _hoisted_3$21 = {
12267
+ var _hoisted_1$31 = { class: "comments-dropdown" };
12268
+ var _hoisted_2$24 = ["onClick"];
12269
+ var _hoisted_3$20 = {
12244
12270
  key: 0,
12245
12271
  class: "comments-dropdown__option-icon"
12246
12272
  };
12247
12273
  var _hoisted_4$14 = ["innerHTML"];
12248
12274
  var _hoisted_5$11 = { class: "comments-dropdown__option-label" };
12249
- var _sfc_main$39 = {
12275
+ var _sfc_main$38 = {
12250
12276
  __name: "CommentsDropdown",
12251
12277
  props: {
12252
12278
  options: {
@@ -12369,7 +12395,7 @@ var _sfc_main$39 = {
12369
12395
  window.removeEventListener("scroll", updateMenuPosition, true);
12370
12396
  });
12371
12397
  return (_ctx, _cache) => {
12372
- return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$32, [require__plugin_vue_export_helper.createElementVNode("div", {
12398
+ return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$31, [require__plugin_vue_export_helper.createElementVNode("div", {
12373
12399
  ref_key: "triggerRef",
12374
12400
  ref: triggerRef,
12375
12401
  class: "comments-dropdown__trigger",
@@ -12385,25 +12411,25 @@ var _sfc_main$39 = {
12385
12411
  key: option.key,
12386
12412
  class: require__plugin_vue_export_helper.normalizeClass(["comments-dropdown__option", { "sd-disabled": option.disabled }]),
12387
12413
  onClick: ($event) => onOptionClick(option)
12388
- }, [hasIcon(option) ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_3$21, [option.iconString ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", {
12414
+ }, [hasIcon(option) ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_3$20, [option.iconString ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", {
12389
12415
  key: 0,
12390
12416
  innerHTML: option.iconString
12391
12417
  }, null, 8, _hoisted_4$14)) : (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(require__plugin_vue_export_helper.unref(OptionIcon), {
12392
12418
  key: 1,
12393
12419
  option
12394
- }, null, 8, ["option"]))])) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_5$11, require__plugin_vue_export_helper.toDisplayString(option.label), 1)], 10, _hoisted_2$25);
12420
+ }, null, 8, ["option"]))])) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_5$11, require__plugin_vue_export_helper.toDisplayString(option.label), 1)], 10, _hoisted_2$24);
12395
12421
  }), 128))], 4)) : require__plugin_vue_export_helper.createCommentVNode("", true)]))]);
12396
12422
  };
12397
12423
  }
12398
12424
  };
12399
- var CommentsDropdown_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$39, [["__scopeId", "data-v-7eced80a"]]);
12425
+ var CommentsDropdown_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$38, [["__scopeId", "data-v-7eced80a"]]);
12400
12426
  //#endregion
12401
12427
  //#region src/components/CommentsLayer/InternalDropdown.vue
12402
- var _hoisted_1$31 = { class: "sd-comment-option" };
12403
- var _hoisted_2$24 = ["innerHTML"];
12404
- var _hoisted_3$20 = { class: "sd-option-state" };
12428
+ var _hoisted_1$30 = { class: "sd-comment-option" };
12429
+ var _hoisted_2$23 = ["innerHTML"];
12430
+ var _hoisted_3$19 = { class: "sd-option-state" };
12405
12431
  var _hoisted_4$13 = ["innerHTML"];
12406
- var _sfc_main$38 = {
12432
+ var _sfc_main$37 = {
12407
12433
  __name: "InternalDropdown",
12408
12434
  props: {
12409
12435
  state: {
@@ -12470,12 +12496,12 @@ var _sfc_main$38 = {
12470
12496
  disabled: __props.isDisabled,
12471
12497
  "content-style": { fontFamily: require__plugin_vue_export_helper.unref(uiFontFamily) }
12472
12498
  }, {
12473
- default: require__plugin_vue_export_helper.withCtx(() => [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_1$31, [
12499
+ default: require__plugin_vue_export_helper.withCtx(() => [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_1$30, [
12474
12500
  require__plugin_vue_export_helper.createElementVNode("div", {
12475
12501
  class: "sd-active-icon",
12476
12502
  innerHTML: activeIcon.value
12477
- }, null, 8, _hoisted_2$24),
12478
- require__plugin_vue_export_helper.createElementVNode("div", _hoisted_3$20, require__plugin_vue_export_helper.toDisplayString(getState.value), 1),
12503
+ }, null, 8, _hoisted_2$23),
12504
+ require__plugin_vue_export_helper.createElementVNode("div", _hoisted_3$19, require__plugin_vue_export_helper.toDisplayString(getState.value), 1),
12479
12505
  require__plugin_vue_export_helper.createElementVNode("div", {
12480
12506
  class: "sd-dropdown-caret",
12481
12507
  innerHTML: require__plugin_vue_export_helper.unref(superdocIcons).caretDown
@@ -12486,7 +12512,7 @@ var _sfc_main$38 = {
12486
12512
  };
12487
12513
  }
12488
12514
  };
12489
- var InternalDropdown_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$38, [["__scopeId", "data-v-138d641e"]]);
12515
+ var InternalDropdown_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$37, [["__scopeId", "data-v-138d641e"]]);
12490
12516
  //#endregion
12491
12517
  //#region src/components/CommentsLayer/helpers.js
12492
12518
  /**
@@ -12636,13 +12662,13 @@ var isAllowed = (permission, role, isInternal, context = {}) => {
12636
12662
  };
12637
12663
  //#endregion
12638
12664
  //#region src/components/general/Avatar.vue
12639
- var _hoisted_1$30 = { class: "user-container" };
12640
- var _hoisted_2$23 = ["src"];
12641
- var _hoisted_3$19 = {
12665
+ var _hoisted_1$29 = { class: "user-container" };
12666
+ var _hoisted_2$22 = ["src"];
12667
+ var _hoisted_3$18 = {
12642
12668
  key: 1,
12643
12669
  class: "user-bg"
12644
12670
  };
12645
- var _sfc_main$37 = {
12671
+ var _sfc_main$36 = {
12646
12672
  __name: "Avatar",
12647
12673
  props: { user: {
12648
12674
  type: Object,
@@ -12659,20 +12685,20 @@ var _sfc_main$37 = {
12659
12685
  return email?.substring(0, 1)?.toUpperCase() || null;
12660
12686
  };
12661
12687
  return (_ctx, _cache) => {
12662
- return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$30, [__props.user.image ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("img", {
12688
+ return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$29, [__props.user.image ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("img", {
12663
12689
  key: 0,
12664
12690
  class: "user-bg",
12665
12691
  src: __props.user.image.startsWith("http") ? __props.user.image : `data:image/png;base64,${__props.user.image}`
12666
- }, null, 8, _hoisted_2$23)) : (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_3$19, require__plugin_vue_export_helper.toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))]);
12692
+ }, null, 8, _hoisted_2$22)) : (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_3$18, require__plugin_vue_export_helper.toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))]);
12667
12693
  };
12668
12694
  }
12669
12695
  };
12670
- var Avatar_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$37, [["__scopeId", "data-v-c95b2073"]]);
12696
+ var Avatar_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$36, [["__scopeId", "data-v-c95b2073"]]);
12671
12697
  //#endregion
12672
12698
  //#region src/components/CommentsLayer/CommentHeader.vue
12673
- var _hoisted_1$29 = { class: "card-section comment-header" };
12674
- var _hoisted_2$22 = { class: "comment-header-left" };
12675
- var _hoisted_3$18 = { class: "user-info" };
12699
+ var _hoisted_1$28 = { class: "card-section comment-header" };
12700
+ var _hoisted_2$21 = { class: "comment-header-left" };
12701
+ var _hoisted_3$17 = { class: "user-info" };
12676
12702
  var _hoisted_4$12 = { class: "user-name" };
12677
12703
  var _hoisted_5$10 = {
12678
12704
  key: 0,
@@ -12699,7 +12725,7 @@ var _hoisted_9$4 = [
12699
12725
  ];
12700
12726
  var _hoisted_10$4 = { class: "overflow-menu__icon" };
12701
12727
  var _hoisted_11$4 = ["innerHTML"];
12702
- var _sfc_main$36 = {
12728
+ var _sfc_main$35 = {
12703
12729
  __name: "CommentHeader",
12704
12730
  props: {
12705
12731
  timestamp: {
@@ -12930,10 +12956,10 @@ var _sfc_main$36 = {
12930
12956
  return user;
12931
12957
  });
12932
12958
  return (_ctx, _cache) => {
12933
- return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$29, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_2$22, [require__plugin_vue_export_helper.createVNode(Avatar_default, {
12959
+ return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$28, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_2$21, [require__plugin_vue_export_helper.createVNode(Avatar_default, {
12934
12960
  user: getCurrentUser.value,
12935
12961
  class: "avatar"
12936
- }, null, 8, ["user"]), require__plugin_vue_export_helper.createElementVNode("div", _hoisted_3$18, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_4$12, [require__plugin_vue_export_helper.createTextVNode(require__plugin_vue_export_helper.toDisplayString(getCurrentUser.value.name), 1), isImported.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_5$10, "IMPORTED")) : require__plugin_vue_export_helper.createCommentVNode("", true)]), props.comment.createdTime ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_6$8, require__plugin_vue_export_helper.toDisplayString(require__plugin_vue_export_helper.unref(formatDate)(props.comment.createdTime)), 1)) : require__plugin_vue_export_helper.createCommentVNode("", true)])]), require__plugin_vue_export_helper.createElementVNode("div", { class: require__plugin_vue_export_helper.normalizeClass(["overflow-menu", { "is-visible": props.isActive }]) }, [
12962
+ }, null, 8, ["user"]), require__plugin_vue_export_helper.createElementVNode("div", _hoisted_3$17, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_4$12, [require__plugin_vue_export_helper.createTextVNode(require__plugin_vue_export_helper.toDisplayString(getCurrentUser.value.name), 1), isImported.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_5$10, "IMPORTED")) : require__plugin_vue_export_helper.createCommentVNode("", true)]), props.comment.createdTime ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_6$8, require__plugin_vue_export_helper.toDisplayString(require__plugin_vue_export_helper.unref(formatDate)(props.comment.createdTime)), 1)) : require__plugin_vue_export_helper.createCommentVNode("", true)])]), require__plugin_vue_export_helper.createElementVNode("div", { class: require__plugin_vue_export_helper.normalizeClass(["overflow-menu", { "is-visible": props.isActive }]) }, [
12937
12963
  allowResolve.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", {
12938
12964
  key: 0,
12939
12965
  class: require__plugin_vue_export_helper.normalizeClass(["overflow-menu__icon", { "sd-is-disabled": Boolean(__props.resolveDisabledReason) }]),
@@ -12979,12 +13005,12 @@ var _sfc_main$36 = {
12979
13005
  };
12980
13006
  }
12981
13007
  };
12982
- var CommentHeader_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$36, [["__scopeId", "data-v-f2f11c96"]]);
13008
+ var CommentHeader_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$35, [["__scopeId", "data-v-f2f11c96"]]);
12983
13009
  //#endregion
12984
13010
  //#region src/components/CommentsLayer/CommentInput.vue
12985
- var _hoisted_1$28 = { class: "input-section" };
12986
- var _hoisted_2$21 = { class: "comment-composer" };
12987
- var _hoisted_3$17 = [
13011
+ var _hoisted_1$27 = { class: "input-section" };
13012
+ var _hoisted_2$20 = { class: "comment-composer" };
13013
+ var _hoisted_3$16 = [
12988
13014
  "aria-expanded",
12989
13015
  "aria-controls",
12990
13016
  "aria-activedescendant"
@@ -13001,7 +13027,7 @@ var _hoisted_6$7 = {
13001
13027
  class: "comment-mention-option__email"
13002
13028
  };
13003
13029
  var commentInputSequence = 0;
13004
- var _sfc_main$35 = {
13030
+ var _sfc_main$34 = {
13005
13031
  __name: "CommentInput",
13006
13032
  props: {
13007
13033
  users: {
@@ -13156,12 +13182,12 @@ var _sfc_main$35 = {
13156
13182
  require__plugin_vue_export_helper.watch(currentCommentText, scheduleInputHeightSync);
13157
13183
  __expose({ focus });
13158
13184
  return (_ctx, _cache) => {
13159
- return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$28, [__props.includeHeader ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(CommentHeader_default, {
13185
+ return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$27, [__props.includeHeader ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(CommentHeader_default, {
13160
13186
  key: 0,
13161
13187
  config: __props.config,
13162
13188
  comment: __props.comment,
13163
13189
  "is-pending-input": true
13164
- }, null, 8, ["config", "comment"])) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("div", { class: require__plugin_vue_export_helper.normalizeClass(["comment-entry", { "sd-input-active": __props.isFocused }]) }, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_2$21, [require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("textarea", {
13190
+ }, null, 8, ["config", "comment"])) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("div", { class: require__plugin_vue_export_helper.normalizeClass(["comment-entry", { "sd-input-active": __props.isFocused }]) }, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_2$20, [require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("textarea", {
13165
13191
  ref_key: "inputRef",
13166
13192
  ref: inputRef,
13167
13193
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => commentDraft.value = $event),
@@ -13179,7 +13205,7 @@ var _sfc_main$35 = {
13179
13205
  onKeydown,
13180
13206
  onFocus: _cache[1] || (_cache[1] = ($event) => handleFocusChange(true)),
13181
13207
  onBlur: _cache[2] || (_cache[2] = ($event) => handleFocusChange(false))
13182
- }, null, 40, _hoisted_3$17), [[require__plugin_vue_export_helper.vModelText, commentDraft.value]]), mentionListOpen.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", {
13208
+ }, null, 40, _hoisted_3$16), [[require__plugin_vue_export_helper.vModelText, commentDraft.value]]), mentionListOpen.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", {
13183
13209
  key: 0,
13184
13210
  id: mentionListId,
13185
13211
  class: "comment-mention-list",
@@ -13200,7 +13226,7 @@ var _sfc_main$35 = {
13200
13226
  };
13201
13227
  }
13202
13228
  };
13203
- var CommentInput_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$35, [["__scopeId", "data-v-0720a671"]]);
13229
+ var CommentInput_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$34, [["__scopeId", "data-v-0720a671"]]);
13204
13230
  //#endregion
13205
13231
  //#region src/internal/toolbar/built-in/url-safety.js
13206
13232
  /**
@@ -13311,18 +13337,18 @@ function renderCommentHtml(value) {
13311
13337
  }
13312
13338
  //#endregion
13313
13339
  //#region src/components/CommentsLayer/CommentDialog.vue
13314
- var _hoisted_1$27 = [
13340
+ var _hoisted_1$26 = [
13315
13341
  "aria-label",
13316
13342
  "data-comment-instance-id",
13317
13343
  "data-comment-thread-id",
13318
13344
  "data-comment-position-key",
13319
13345
  "data-comment-page-index"
13320
13346
  ];
13321
- var _hoisted_2$20 = {
13347
+ var _hoisted_2$19 = {
13322
13348
  key: 0,
13323
13349
  class: "existing-internal-input"
13324
13350
  };
13325
- var _hoisted_3$16 = { class: "new-comment-input-wrapper" };
13351
+ var _hoisted_3$15 = { class: "new-comment-input-wrapper" };
13326
13352
  var _hoisted_4$10 = { class: "reply-actions" };
13327
13353
  var _hoisted_5$8 = ["disabled"];
13328
13354
  var _hoisted_6$6 = {
@@ -13414,9 +13440,8 @@ var _hoisted_50 = {
13414
13440
  var _hoisted_51 = { class: "reply-input-wrapper" };
13415
13441
  var _hoisted_52 = { class: "reply-actions" };
13416
13442
  var _hoisted_53 = ["disabled", "data-disabled-reason"];
13417
- var CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
13418
- var TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
13419
- var _sfc_main$34 = {
13443
+ var commentEditSessions = /* @__PURE__ */ new WeakMap();
13444
+ var _sfc_main$33 = {
13420
13445
  __name: "CommentDialog",
13421
13446
  props: {
13422
13447
  comment: {
@@ -13464,12 +13489,17 @@ var _sfc_main$34 = {
13464
13489
  const { proxy } = require__plugin_vue_export_helper.getCurrentInstance();
13465
13490
  const superdocStore = useSuperdocStore();
13466
13491
  const commentsStore = useCommentsStore();
13492
+ const editSessionOwner = {};
13493
+ const retireOwnEditSession = () => {
13494
+ if (commentEditSessions.get(commentsStore)?.owner === editSessionOwner) commentEditSessions.delete(commentsStore);
13495
+ };
13467
13496
  const { addComment, cancelComment, deleteComment, getCommentAliasIds, removePendingComment, getCommentDocumentId, requestInstantSidebarAlignment, resolveCommentPositionEntry, clearInstantSidebarAlignment, setActiveFloatingCommentInstance } = commentsStore;
13468
13497
  const { suppressInternalExternal, getConfig, activeComment, activeFloatingCommentInstanceId, floatingCommentsOffset, pendingComment, currentCommentText, currentCommentMentions, isDebugging, editingCommentId, editorCommentPositions, isCommentHighlighted } = storeToRefs(commentsStore);
13469
13498
  const isInternal = require__plugin_vue_export_helper.ref(true);
13470
13499
  const commentInput = require__plugin_vue_export_helper.ref(null);
13471
13500
  const editCommentInputs = require__plugin_vue_export_helper.ref(/* @__PURE__ */ new Map());
13472
13501
  const trackedChangeDecisionFailure = require__plugin_vue_export_helper.ref(null);
13502
+ const CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
13473
13503
  const CLICK_OUTSIDE_HIT_SAMPLE_OFFSETS = [
13474
13504
  [0, 0],
13475
13505
  [-3, 0],
@@ -13477,6 +13507,7 @@ var _sfc_main$34 = {
13477
13507
  [0, -3],
13478
13508
  [0, CLICK_OUTSIDE_HIT_TOLERANCE_PX]
13479
13509
  ];
13510
+ const TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
13480
13511
  const trackedChangeImagePreviewStyle = (preview) => {
13481
13512
  const width = typeof preview?.width === "number" && Number.isFinite(preview.width) ? preview.width : null;
13482
13513
  const height = typeof preview?.height === "number" && Number.isFinite(preview.height) ? preview.height : null;
@@ -14238,6 +14269,10 @@ var _sfc_main$34 = {
14238
14269
  if (commentsAreReadOnly()) return readOnlyMutationOutcome();
14239
14270
  switch (value) {
14240
14271
  case "edit":
14272
+ commentEditSessions.set(commentsStore, {
14273
+ owner: editSessionOwner,
14274
+ submission: null
14275
+ });
14241
14276
  currentCommentText.value = comment?.commentText?.value ?? comment?.commentText ?? "";
14242
14277
  currentCommentMentions.value = Array.isArray(comment?.mentions) ? [...comment.mentions] : [];
14243
14278
  activeComment.value = props.comment.commentId;
@@ -14259,12 +14294,23 @@ var _sfc_main$34 = {
14259
14294
  const handleCommentUpdate = async (comment) => {
14260
14295
  if (commentsAreReadOnly()) return readOnlyMutationOutcome();
14261
14296
  if (isV2Mode.value && v2CommentsAdapter.value) {
14297
+ const session = commentEditSessions.get(commentsStore);
14298
+ const submission = Symbol("comment-edit-submission");
14299
+ if (session?.owner === editSessionOwner) session.submission = submission;
14300
+ const editor = proxy.$superdoc.activeEditor;
14301
+ const adapter = editor.v2Comments;
14302
+ const documentId = adapter.documentId;
14303
+ const document = editor.doc;
14304
+ const thread = props.comment;
14305
+ const draft = currentCommentText.value;
14262
14306
  const outcome = await commentsStore.editCommentV2({
14263
14307
  superdoc: proxy.$superdoc,
14264
14308
  commentId: comment.commentId,
14265
- text: currentCommentText.value
14309
+ text: draft
14266
14310
  });
14267
14311
  if (!outcome?.ok) return outcome;
14312
+ if (session?.owner !== editSessionOwner || commentEditSessions.get(commentsStore) !== session || session.submission !== submission || proxy.$superdoc.activeEditor !== editor || editor.v2Comments !== adapter || adapter.documentId !== documentId || editor.doc !== document || props.comment !== thread || editingCommentId.value !== comment.commentId || currentCommentText.value !== draft) return outcome;
14313
+ retireOwnEditSession();
14268
14314
  editingCommentId.value = null;
14269
14315
  removePendingComment(proxy.$superdoc);
14270
14316
  return outcome;
@@ -14295,6 +14341,7 @@ var _sfc_main$34 = {
14295
14341
  return typeof timestamp === "string" ? new Date(timestamp).getTime() : timestamp;
14296
14342
  };
14297
14343
  const handleCancel = (comment) => {
14344
+ retireOwnEditSession();
14298
14345
  editingCommentId.value = null;
14299
14346
  isReplying.value = false;
14300
14347
  cancelComment(proxy.$superdoc);
@@ -14320,6 +14367,7 @@ var _sfc_main$34 = {
14320
14367
  });
14321
14368
  });
14322
14369
  require__plugin_vue_export_helper.onBeforeUnmount(() => {
14370
+ retireOwnEditSession();
14323
14371
  proxy.$superdoc?.off?.("active-editor-change", refreshActiveEditor);
14324
14372
  });
14325
14373
  require__plugin_vue_export_helper.watch(showInputSection, (isVisible) => {
@@ -14368,7 +14416,7 @@ var _sfc_main$34 = {
14368
14416
  "data-comment-position-key": props.comment.trackedChangeAnchorKey ?? "",
14369
14417
  "data-comment-page-index": Number.isFinite(props.floatingPageIndex) ? props.floatingPageIndex : ""
14370
14418
  }, [isPendingNewComment.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, { key: 0 }, [
14371
- shouldShowInternalExternal.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_2$20, [require__plugin_vue_export_helper.createVNode(InternalDropdown_default, {
14419
+ shouldShowInternalExternal.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_2$19, [require__plugin_vue_export_helper.createVNode(InternalDropdown_default, {
14372
14420
  onClick: _cache[0] || (_cache[0] = require__plugin_vue_export_helper.withModifiers(() => {}, ["stop", "prevent"])),
14373
14421
  class: "sd-internal-dropdown",
14374
14422
  "is-disabled": false,
@@ -14380,7 +14428,7 @@ var _sfc_main$34 = {
14380
14428
  comment: props.comment,
14381
14429
  "is-pending-input": true
14382
14430
  }, null, 8, ["config", "comment"]),
14383
- require__plugin_vue_export_helper.createElementVNode("div", _hoisted_3$16, [require__plugin_vue_export_helper.createVNode(CommentInput_default, {
14431
+ require__plugin_vue_export_helper.createElementVNode("div", _hoisted_3$15, [require__plugin_vue_export_helper.createVNode(CommentInput_default, {
14384
14432
  ref_key: "commentInput",
14385
14433
  ref: commentInput,
14386
14434
  users: usersFiltered.value,
@@ -14565,14 +14613,14 @@ var _sfc_main$34 = {
14565
14613
  disabled: !hasTextContent.value || isV2WriteDisabled.value || isSubmittingReply.value,
14566
14614
  "data-disabled-reason": v2ReplyDisabledReason.value
14567
14615
  }, " Reply ", 10, _hoisted_53)])]))], 64)) : require__plugin_vue_export_helper.createCommentVNode("", true)
14568
- ], 64))], 14, _hoisted_1$27)), [[_directive_click_outside, handleClickOutside]]);
14616
+ ], 64))], 14, _hoisted_1$26)), [[_directive_click_outside, handleClickOutside]]);
14569
14617
  };
14570
14618
  }
14571
14619
  };
14572
- var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$34, [["__scopeId", "data-v-5ace8cef"]]);
14620
+ var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$33, [["__scopeId", "data-v-b16fc5d0"]]);
14573
14621
  //#endregion
14574
14622
  //#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
14575
- var _hoisted_1$26 = [
14623
+ var _hoisted_1$25 = [
14576
14624
  "tabindex",
14577
14625
  "aria-posinset",
14578
14626
  "aria-setsize",
@@ -14583,7 +14631,7 @@ var _hoisted_1$26 = [
14583
14631
  "data-comment-page-index",
14584
14632
  "data-review-directory-index"
14585
14633
  ];
14586
- var _sfc_main$33 = {
14634
+ var _sfc_main$32 = {
14587
14635
  __name: "ReviewDirectoryListItem",
14588
14636
  props: {
14589
14637
  item: {
@@ -14710,18 +14758,18 @@ var _sfc_main$33 = {
14710
14758
  "floating-page-index",
14711
14759
  "floating-position-entry",
14712
14760
  "is-floating-instance-active"
14713
- ])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 44, _hoisted_1$26);
14761
+ ])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 44, _hoisted_1$25);
14714
14762
  };
14715
14763
  }
14716
14764
  };
14717
- var ReviewDirectoryListItem_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$33, [["__scopeId", "data-v-29650a06"]]);
14765
+ var ReviewDirectoryListItem_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$32, [["__scopeId", "data-v-29650a06"]]);
14718
14766
  //#endregion
14719
14767
  //#region src/components/CommentsLayer/commentsList/commentsList.vue
14720
- var _hoisted_1$25 = ["aria-busy"];
14721
- var _hoisted_2$19 = { key: 0 };
14722
- var _hoisted_3$15 = { key: 1 };
14768
+ var _hoisted_1$24 = ["aria-busy"];
14769
+ var _hoisted_2$18 = { key: 0 };
14770
+ var _hoisted_3$14 = { key: 1 };
14723
14771
  var REPEATED_HEADER_FOOTER_STORY_TYPE = "headerFooterPart";
14724
- var _sfc_main$32 = {
14772
+ var _sfc_main$31 = {
14725
14773
  __name: "commentsList",
14726
14774
  props: {
14727
14775
  showMainComments: {
@@ -14848,7 +14896,7 @@ var _sfc_main$32 = {
14848
14896
  class: "comments-list",
14849
14897
  role: "list",
14850
14898
  "aria-busy": require__plugin_vue_export_helper.unref(isReviewDirectoryActive) && require__plugin_vue_export_helper.unref(isReviewDirectoryLoading) ? "true" : "false"
14851
- }, [__props.showMainComments ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_2$19, [(require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(parentCommentDisplayItems.value, (item, index) => {
14899
+ }, [__props.showMainComments ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_2$18, [(require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(parentCommentDisplayItems.value, (item, index) => {
14852
14900
  return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(ReviewDirectoryListItem_default, {
14853
14901
  key: item.id,
14854
14902
  item,
@@ -14863,7 +14911,7 @@ var _sfc_main$32 = {
14863
14911
  "total",
14864
14912
  "tab-index"
14865
14913
  ]);
14866
- }), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true), shouldShowResolvedComments.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_3$15, [_cache[2] || (_cache[2] = require__plugin_vue_export_helper.createElementVNode("div", { class: "comment-title" }, "Resolved", -1)), (require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(resolvedCommentDisplayItems.value, (item, index) => {
14914
+ }), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true), shouldShowResolvedComments.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_3$14, [_cache[2] || (_cache[2] = require__plugin_vue_export_helper.createElementVNode("div", { class: "comment-title" }, "Resolved", -1)), (require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(resolvedCommentDisplayItems.value, (item, index) => {
14867
14915
  return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(ReviewDirectoryListItem_default, {
14868
14916
  key: item.id,
14869
14917
  item,
@@ -14878,11 +14926,11 @@ var _sfc_main$32 = {
14878
14926
  "total",
14879
14927
  "tab-index"
14880
14928
  ]);
14881
- }), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 8, _hoisted_1$25);
14929
+ }), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 8, _hoisted_1$24);
14882
14930
  };
14883
14931
  }
14884
14932
  };
14885
- var commentsList_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$32, [["__scopeId", "data-v-89244745"]]);
14933
+ var commentsList_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$31, [["__scopeId", "data-v-89244745"]]);
14886
14934
  //#endregion
14887
14935
  //#region src/components/CommentsLayer/commentsList/super-comments-list.js
14888
14936
  /**
@@ -15404,7 +15452,7 @@ var resolveRemovedReviewCardContinuityTarget = ({ previousIds, currentIds, remov
15404
15452
  };
15405
15453
  //#endregion
15406
15454
  //#region src/components/CommentsLayer/FloatingComments.vue
15407
- var _hoisted_1$24 = [
15455
+ var _hoisted_1$23 = [
15408
15456
  "data-comment-id",
15409
15457
  "data-comment-instance-id",
15410
15458
  "data-comment-thread-id",
@@ -15412,7 +15460,7 @@ var _hoisted_1$24 = [
15412
15460
  "data-comment-page-index"
15413
15461
  ];
15414
15462
  var _heightsCache = {};
15415
- var _sfc_main$31 = {
15463
+ var _sfc_main$30 = {
15416
15464
  __name: "FloatingComments",
15417
15465
  props: {
15418
15466
  currentDocument: {
@@ -15486,6 +15534,7 @@ var _sfc_main$31 = {
15486
15534
  const sidebarOffsetY = require__plugin_vue_export_helper.ref(0);
15487
15535
  const disableInstantLayoutTransitions = require__plugin_vue_export_helper.ref(false);
15488
15536
  const directDecisionContinuityTargetId = require__plugin_vue_export_helper.ref(null);
15537
+ const workerDecisionContinuity = require__plugin_vue_export_helper.ref(null);
15489
15538
  const viewportRevision = require__plugin_vue_export_helper.ref(0);
15490
15539
  const isPendingThread = (commentOrId) => {
15491
15540
  const pendingId = pendingComment.value?.commentId;
@@ -15749,7 +15798,7 @@ var _sfc_main$31 = {
15749
15798
  resolveCollisions(collisionPositions, activeIndex, 15);
15750
15799
  return positions;
15751
15800
  });
15752
- require__plugin_vue_export_helper.watch(() => {
15801
+ const measuredReviewContext = require__plugin_vue_export_helper.computed(() => {
15753
15802
  const presentation = committedPresentation.value, container = floatingCommentsContainer.value;
15754
15803
  if (!presentation || !container) return null;
15755
15804
  viewportRevision.value;
@@ -15759,7 +15808,11 @@ var _sfc_main$31 = {
15759
15808
  const stage = typeof presentation.readPaintOrigin === "function" ? presentation.readPaintOrigin() : props.parent?.getBoundingClientRect?.();
15760
15809
  if (!stage || !Number.isFinite(stage.left) || !Number.isFinite(stage.top)) return null;
15761
15810
  const instances = committedInstances.value ?? [];
15811
+ const captured = workerDecisionContinuity.value;
15812
+ const coordinate = presentation.coordinate;
15813
+ const target = captured && instances.find((instance) => instance.id === captured.request.targetInstanceId);
15762
15814
  return {
15815
+ decisionContinuity: captured && coordinate && target && captured.documentId === String(props.currentDocument.id) && captured.documentMode === commentsStore.viewingVisibility?.documentMode && coordinate.documentEpoch === captured.request.documentEpoch && coordinate.mountId === captured.request.mountId && coordinate.commitSequence >= captured.request.commitSequence && coordinate.commitSequence <= captured.request.commitSequence + 1 && target.rowVersion === captured.request.targetRowVersion ? { ...captured.request } : null,
15763
15816
  activeThreadId: activeComment.value == null ? null : String(activeComment.value),
15764
15817
  activeInstanceId: activeCommentInstanceId.value == null ? null : String(activeCommentInstanceId.value),
15765
15818
  editingRowId: editingCommentId.value == null ? null : String(editingCommentId.value),
@@ -15785,7 +15838,8 @@ var _sfc_main$31 = {
15785
15838
  height: measuredHeights.value[instance.id]
15786
15839
  }))
15787
15840
  };
15788
- }, (input) => {
15841
+ });
15842
+ require__plugin_vue_export_helper.watch(measuredReviewContext, (input) => {
15789
15843
  if (input) committedPresentation.value?.updateContext(input);
15790
15844
  }, { immediate: true });
15791
15845
  const wrapperMinHeight = require__plugin_vue_export_helper.computed(() => {
@@ -15907,8 +15961,15 @@ var _sfc_main$31 = {
15907
15961
  directDecisionContinuity = null;
15908
15962
  directDecisionSourceId = null;
15909
15963
  directDecisionContinuityTargetId.value = null;
15964
+ workerDecisionContinuity.value = null;
15910
15965
  setInstantLayoutTransitionsDisabled(false);
15911
15966
  };
15967
+ require__plugin_vue_export_helper.watch([
15968
+ () => props.currentDocument?.id,
15969
+ () => committedPresentation.value?.coordinate?.documentEpoch,
15970
+ () => committedPresentation.value?.coordinate?.mountId,
15971
+ () => commentsStore.viewingVisibility?.documentMode
15972
+ ], () => releaseDirectDecisionContinuity());
15912
15973
  const releaseDirectDecisionContinuityForUnrelatedPointer = (event) => {
15913
15974
  if (!directDecisionContinuity) return;
15914
15975
  const actionElement = (event?.target instanceof Element ? event.target : null)?.closest?.("[data-comment-action]");
@@ -16082,6 +16143,27 @@ var _sfc_main$31 = {
16082
16143
  directDecisionSourceId = removedKey;
16083
16144
  directDecisionContinuityTargetId.value = targetKey;
16084
16145
  setInstantLayoutTransitionsDisabled(true);
16146
+ const presentation = committedPresentation.value;
16147
+ const coordinate = presentation?.coordinate;
16148
+ const removed = committedInstances.value?.find((instance) => instance.id === removedKey);
16149
+ const target = committedInstances.value?.find((instance) => instance.id === targetKey);
16150
+ const origin = presentation?.readPaintOrigin?.();
16151
+ if (coordinate && typeof coordinate.documentEpoch === "string" && coordinate.documentEpoch && typeof coordinate.mountId === "string" && coordinate.mountId && Number.isSafeInteger(coordinate.commitSequence) && coordinate.commitSequence >= 0 && Number.isSafeInteger(coordinate.reviewVersion) && coordinate.reviewVersion > 0 && removed && target && Number.isSafeInteger(removed.rowVersion) && removed.rowVersion > 0 && Number.isSafeInteger(target.rowVersion) && target.rowVersion > 0 && origin && Number.isFinite(origin.left) && Number.isFinite(origin.top)) {
16152
+ workerDecisionContinuity.value = {
16153
+ documentId: String(props.currentDocument.id),
16154
+ documentMode: commentsStore.viewingVisibility?.documentMode,
16155
+ request: {
16156
+ ...coordinate,
16157
+ removedInstanceId: removedKey,
16158
+ removedRowVersion: removed.rowVersion,
16159
+ targetInstanceId: targetKey,
16160
+ targetRowVersion: target.rowVersion,
16161
+ top: targetClientY - floatingCommentsContainer.value.getBoundingClientRect().top
16162
+ }
16163
+ };
16164
+ const input = measuredReviewContext.value;
16165
+ if (input) presentation.updateContext(input);
16166
+ }
16085
16167
  };
16086
16168
  require__plugin_vue_export_helper.watch(activeCommentInstanceId, (newKey, oldKey) => {
16087
16169
  clearDeferredRemeasureTimers();
@@ -16341,19 +16423,19 @@ var _sfc_main$31 = {
16341
16423
  "floating-page-index",
16342
16424
  "floating-position-entry",
16343
16425
  "is-floating-instance-active"
16344
- ])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 14, _hoisted_1$24);
16426
+ ])) : require__plugin_vue_export_helper.createCommentVNode("", true)], 14, _hoisted_1$23);
16345
16427
  }), 128))], 4)], 36);
16346
16428
  };
16347
16429
  }
16348
16430
  };
16349
- var FloatingComments_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$31, [["__scopeId", "data-v-028441bf"]]);
16431
+ var FloatingComments_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$30, [["__scopeId", "data-v-ac790145"]]);
16350
16432
  //#endregion
16351
16433
  //#region src/components/CommentsLayer/PdfCommentsLayer.vue
16352
- var _hoisted_1$23 = {
16434
+ var _hoisted_1$22 = {
16353
16435
  class: "superdoc__pdf-comments-layer pdf-comments-layer",
16354
16436
  "aria-hidden": "false"
16355
16437
  };
16356
- var _hoisted_2$18 = [
16438
+ var _hoisted_2$17 = [
16357
16439
  "data-id",
16358
16440
  "data-comment-id",
16359
16441
  "data-page-number",
@@ -16455,7 +16537,7 @@ var PdfCommentsLayer_default = /*#__PURE__*/ require__plugin_vue_export_helper._
16455
16537
  emit("anchor-activate", anchor.commentId);
16456
16538
  };
16457
16539
  return (_ctx, _cache) => {
16458
- return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$23, [(require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(pdfCommentAnchors.value, (anchor) => {
16540
+ return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$22, [(require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(pdfCommentAnchors.value, (anchor) => {
16459
16541
  return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", {
16460
16542
  key: anchor.commentId,
16461
16543
  class: "sd-comment-anchor sd-highlight",
@@ -16467,7 +16549,7 @@ var PdfCommentsLayer_default = /*#__PURE__*/ require__plugin_vue_export_helper._
16467
16549
  style: require__plugin_vue_export_helper.normalizeStyle(getAnchorStyle(anchor)),
16468
16550
  onClick: require__plugin_vue_export_helper.withModifiers(($event) => activateAnchor(anchor), ["stop", "prevent"]),
16469
16551
  onKeydown: [require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(($event) => activateAnchor(anchor), ["stop", "prevent"]), ["enter"]), require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(($event) => activateAnchor(anchor), ["stop", "prevent"]), ["space"])]
16470
- }, null, 44, _hoisted_2$18);
16552
+ }, null, 44, _hoisted_2$17);
16471
16553
  }), 128))]);
16472
16554
  };
16473
16555
  }
@@ -16624,8 +16706,8 @@ var useWhiteboard = ({ proxy, layers, documents, modules }) => {
16624
16706
  };
16625
16707
  //#endregion
16626
16708
  //#region src/components/Whiteboard/WhiteboardPage.vue
16627
- var _hoisted_1$22 = ["data-page-index"];
16628
- var _sfc_main$29 = {
16709
+ var _hoisted_1$21 = ["data-page-index"];
16710
+ var _sfc_main$28 = {
16629
16711
  __name: "WhiteboardPage",
16630
16712
  props: {
16631
16713
  whiteboard: {
@@ -16756,14 +16838,14 @@ var _sfc_main$29 = {
16756
16838
  height: (__props.pageSize?.height ?? __props.page.size?.height) + "px",
16757
16839
  transform: `translate(${__props.pageOffset?.left ?? 0}px, ${__props.pageOffset?.top ?? 0}px)`
16758
16840
  })
16759
- }, null, 44, _hoisted_1$22);
16841
+ }, null, 44, _hoisted_1$21);
16760
16842
  };
16761
16843
  }
16762
16844
  };
16763
- var WhiteboardPage_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$29, [["__scopeId", "data-v-c876c9b5"]]);
16845
+ var WhiteboardPage_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$28, [["__scopeId", "data-v-c876c9b5"]]);
16764
16846
  //#endregion
16765
16847
  //#region src/components/Whiteboard/WhiteboardLayer.vue
16766
- var _sfc_main$28 = {
16848
+ var _sfc_main$27 = {
16767
16849
  __name: "WhiteboardLayer",
16768
16850
  props: {
16769
16851
  whiteboard: {
@@ -16832,68 +16914,7 @@ var _sfc_main$28 = {
16832
16914
  };
16833
16915
  }
16834
16916
  };
16835
- var WhiteboardLayer_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$28, [["__scopeId", "data-v-54546c3d"]]);
16836
- //#endregion
16837
- //#region src/components/HtmlViewer/HtmlViewer.vue
16838
- var _hoisted_1$21 = { class: "superdoc-html-viewer" };
16839
- var _hoisted_2$17 = { class: "superdoc-html-viewer__document" };
16840
- var _hoisted_3$14 = ["innerHTML"];
16841
- var _sfc_main$27 = {
16842
- __name: "HtmlViewer",
16843
- props: {
16844
- fileSource: {
16845
- type: [File, Blob],
16846
- required: true
16847
- },
16848
- documentId: {
16849
- type: String,
16850
- required: true
16851
- }
16852
- },
16853
- emits: ["ready", "selection-change"],
16854
- setup(__props, { emit: __emit }) {
16855
- const props = __props;
16856
- const documentContent = require__plugin_vue_export_helper.ref("");
16857
- const emit = __emit;
16858
- const handleSelectionChange = () => {
16859
- const selection = window.getSelection();
16860
- console.debug("selection from html viewer", selection);
16861
- emit("selection-change", selection);
16862
- };
16863
- const getDocumentHtml = (fileSource) => {
16864
- return new Promise((resolve, reject) => {
16865
- const reader = new FileReader();
16866
- reader.onload = (e) => {
16867
- const htmlString = e.target.result;
16868
- resolve(htmlString);
16869
- };
16870
- reader.onerror = (e) => reject(e);
16871
- reader.readAsText(fileSource);
16872
- });
16873
- };
16874
- const initViewer = async () => {
16875
- try {
16876
- const documentHtml = await getDocumentHtml(props.fileSource);
16877
- documentContent.value = documentHtml;
16878
- emit("ready", props.documentId);
16879
- } catch (error) {
16880
- emit("error", error);
16881
- console.error("Error loading document", error);
16882
- }
16883
- };
16884
- require__plugin_vue_export_helper.onMounted(() => {
16885
- initViewer();
16886
- });
16887
- return (_ctx, _cache) => {
16888
- return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$21, [require__plugin_vue_export_helper.createElementVNode("div", _hoisted_2$17, [require__plugin_vue_export_helper.createElementVNode("div", {
16889
- class: "superdoc-html-viewer__content",
16890
- innerHTML: documentContent.value,
16891
- onMouseup: handleSelectionChange
16892
- }, null, 40, _hoisted_3$14)])]);
16893
- };
16894
- }
16895
- };
16896
- var HtmlViewer_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$27, [["__scopeId", "data-v-da3494ba"]]);
16917
+ var WhiteboardLayer_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$27, [["__scopeId", "data-v-54546c3d"]]);
16897
16918
  //#endregion
16898
16919
  //#region src/components/CommentsLayer/collect-removed-comment-ids.js
16899
16920
  /**
@@ -22659,6 +22680,10 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
22659
22680
  if (!ui) return Promise.resolve(UNAVAILABLE_COMMAND_RESULT);
22660
22681
  return require_create_super_doc_ui.executeFirstPartyCommandAsync(ui, commandId, payload);
22661
22682
  },
22683
+ executeAfterSelection: (commandId, payload) => {
22684
+ const ui = getSuperDocUI();
22685
+ return ui ? require_create_super_doc_ui.executeFirstPartyShortcutAsync(ui, commandId, payload) : Promise.resolve(UNAVAILABLE_COMMAND_RESULT);
22686
+ },
22662
22687
  getState: (commandId) => getSuperDocUI()?.commands.get(commandId).getState() ?? UNAVAILABLE_COMMAND_STATE
22663
22688
  },
22664
22689
  ...openLinkWorkflow ? { openLinkWorkflow } : {}
@@ -24632,6 +24657,11 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24632
24657
  const activeDocumentId = getActiveV2DocumentId();
24633
24658
  const stage = activeDocumentId == null ? latestV2MountStage : v2MountStagesByDocumentId.get(String(activeDocumentId)) ?? null;
24634
24659
  if (!stage?.isConnected) return null;
24660
+ const workerRoots = stage.querySelectorAll("[data-sd-worker-dom-root]");
24661
+ if (workerRoots.length) {
24662
+ if (workerRoots.length !== 1) return null;
24663
+ return workerRoots[0].querySelector(`.superdoc-page[data-worker-page-id][data-page-index="${v2RulerActivePageIndex}"]`)?.getBoundingClientRect() ?? null;
24664
+ }
24635
24665
  const wrapper = Array.from(stage.children).find((element) => element.dataset?.v2PaintWrapper === "true") ?? stage;
24636
24666
  const pages = Array.from(wrapper.children).filter((element) => element.classList?.contains("superdoc-page"));
24637
24667
  return (pages.find((element) => Number(element.dataset?.pageIndex) === v2RulerActivePageIndex) ?? pages[0] ?? wrapper).getBoundingClientRect();
@@ -24949,14 +24979,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24949
24979
  "onV2HostEvent",
24950
24980
  "onV2RenderReadiness",
24951
24981
  "onV2OpenDiagnostics"
24952
- ])) : require__plugin_vue_export_helper.createCommentVNode("", true),
24953
- doc.type === require__plugin_vue_export_helper.unref("text/html") ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(HtmlViewer_default, {
24954
- key: 3,
24955
- onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
24956
- onSelectionChange: handleSelectionChange,
24957
- "file-source": doc.data,
24958
- "document-id": doc.id
24959
- }, null, 8, ["file-source", "document-id"])) : require__plugin_vue_export_helper.createCommentVNode("", true)
24982
+ ])) : require__plugin_vue_export_helper.createCommentVNode("", true)
24960
24983
  ]);
24961
24984
  }), 128)),
24962
24985
  shouldRenderPdfWhiteboard.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createBlock(WhiteboardLayer_default, {
@@ -25006,7 +25029,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
25006
25029
  ], 46, _hoisted_1$17);
25007
25030
  };
25008
25031
  }
25009
- }, [["__scopeId", "data-v-c843616f"]]);
25032
+ }, [["__scopeId", "data-v-a5d7d136"]]);
25010
25033
  //#endregion
25011
25034
  //#region src/core/create-app.js
25012
25035
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -46502,11 +46525,7 @@ function getActiveFontRuntime(editor) {
46502
46525
  */
46503
46526
  var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default {
46504
46527
  static {
46505
- this.allowedTypes = [
46506
- DOCX,
46507
- PDF,
46508
- HTML
46509
- ];
46528
+ this.allowedTypes = [DOCX, PDF];
46510
46529
  }
46511
46530
  #destroyed;
46512
46531
  #diagnostics;
@@ -46825,7 +46844,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
46825
46844
  }
46826
46845
  this.userColorMap = /* @__PURE__ */ new Map();
46827
46846
  this.colorIndex = 0;
46828
- this.version = "2.25.0-next.15";
46847
+ this.version = "2.25.0-next.17";
46829
46848
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46830
46849
  this.superdocId = config.superdocId || require_uuid.v4();
46831
46850
  this.colors = this.config.colors ?? [];
@@ -48265,11 +48284,6 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
48265
48284
  feature: "pdf.viewer",
48266
48285
  status: "supported",
48267
48286
  reason: "editorVersion ignored for PDF documents"
48268
- },
48269
- {
48270
- feature: "html.viewer",
48271
- status: "supported",
48272
- reason: "editorVersion ignored for HTML documents"
48273
48287
  }
48274
48288
  ];
48275
48289
  }