superdoc 2.25.0-next.16 → 2.25.0-next.18

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 (29) 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/layout-engine/layout-bridge/src/index.d.ts +2 -0
  11. package/dist/layout-engine/layout-bridge/src/neutral-segment-geometry.d.ts +18 -1
  12. package/dist/layout-engine/layout-bridge/src/visual-bidi-geometry.d.ts +37 -0
  13. package/dist/public/ui-react.cjs +1 -1
  14. package/dist/public/ui-react.es.js +1 -1
  15. package/dist/public/ui-vue.cjs +1 -1
  16. package/dist/public/ui-vue.es.js +1 -1
  17. package/dist/public/ui.cjs +1 -1
  18. package/dist/public/ui.es.js +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/style.layered.css +1 -1
  21. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +7 -0
  22. package/dist/superdoc/src/stores/comments-store.d.ts +9 -3
  23. package/dist/superdoc/src/stores/superdoc-store.d.ts +27 -9
  24. package/dist/superdoc.cjs +98 -12
  25. package/dist/superdoc.es.js +98 -12
  26. package/dist-cdn/style.layered.css +1 -1
  27. package/dist-cdn/superdoc.min.css +1 -1
  28. package/dist-cdn/superdoc.min.js +42 -42
  29. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { i as __toESM$2 } from "./chunks/rolldown-runtime-0pSA04fp.es.js";
2
2
  import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
3
- import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, g as recordInteraction, h as isWorkflowRecordingEnabled, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as getWorkflowRecording, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-Cr_04XnJ.es.js";
3
+ import { _ as recordInteraction, a as registerFirstPartyCommandMutation, c as getV2TrackedChangeMutationImpact, f as DOM_CLASS_NAMES, g as isWorkflowRecordingEnabled, h as getWorkflowRecording, i as readFirstPartyPageNumbers, l as createImageFilePicker, m as createInteractionHistory, n as executeFirstPartyCommandAsync, p as closeInteractionHistory, r as executeFirstPartyShortcutAsync, s as applyV2CommentInvalidationFromMutation, t as createSuperDocUI, u as resolveImageSrc } from "./chunks/create-super-doc-ui-DqCrc6Vw.es.js";
4
4
  import { t as import_eventemitter3 } from "./chunks/eventemitter3-DEIiXiH2.es.js";
5
5
  import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
6
6
  import { $ as vModelText, A as onActivated, B as renderSlot, C as isRef$1, D as normalizeClass, E as nextTick, F as openBlock, G as toRaw$2, H as resolveDynamicComponent, I as provide$1, J as unref, K as toRef, L as reactive, M as onDeactivated, N as onMounted, O as normalizeProps, P as onScopeDispose$1, Q as vModelSelect, R as ref, S as isReactive$1, T as mergeProps, U as shallowRef$1, V as resolveDirective, W as toDisplayString, X as useSlots, Y as useAttrs, Z as vModelCheckbox, _ as getCurrentInstance, a as computed$1, b as hasInjectionContext, c as createCommentVNode, d as createStaticVNode, et as watch$1, f as createTextVNode, g as effectScope, h as defineComponent, i as Transition, it as withModifiers, j as onBeforeUnmount, k as normalizeStyle, l as createElementBlock, m as defineAsyncComponent, n as Fragment, nt as withDirectives, o as createApp, p as createVNode, q as toRefs, r as Teleport, rt as withKeys, s as createBlock, t as _plugin_vue_export_helper_default, tt as withCtx, u as createElementVNode, v as getCurrentScope, w as markRaw, x as inject$1, y as h, z as renderList } from "./chunks/_plugin-vue_export-helper-7ZiLY07t.es.js";
@@ -302,7 +302,7 @@ var awarenessStatesToArray = (context, states) => {
302
302
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
303
303
  function getSuperdocVersion() {
304
304
  try {
305
- return "2.25.0-next.16";
305
+ return "2.25.0-next.18";
306
306
  } catch {
307
307
  return "unknown";
308
308
  }
@@ -9961,6 +9961,7 @@ var useCommentsStore = defineStore("comments", () => {
9961
9961
  ])
9962
9962
  ].map((value) => normalizeCommentId(value)).filter(Boolean));
9963
9963
  patch(() => {
9964
+ const previousPreparedPresentation = committedReviewPresentations.value[normalizedDocumentId] ?? null;
9964
9965
  if (preparedReview?.presentation) committedReviewPresentations.value = {
9965
9966
  ...committedReviewPresentations.value,
9966
9967
  [normalizedDocumentId]: preparedReview.presentation
@@ -9971,6 +9972,8 @@ var useCommentsStore = defineStore("comments", () => {
9971
9972
  documentId: normalizedDocumentId,
9972
9973
  items: trackedChangeItems,
9973
9974
  preparedParams,
9975
+ preparedPresentation: preparedReview?.presentation ?? null,
9976
+ previousPreparedPresentation,
9974
9977
  pruneStale: false
9975
9978
  });
9976
9979
  reconcileCommentsFromV2({
@@ -10984,6 +10987,8 @@ var useCommentsStore = defineStore("comments", () => {
10984
10987
  if (!fromId || !toId || fromId === toId) continue;
10985
10988
  const comment = commentsList.value.find((row) => matchesRemapSource(row, fromId));
10986
10989
  if (!comment) continue;
10990
+ const presentation = committedReviewPresentations.value[normalizedDocumentId];
10991
+ if (normalizeCommentId(comment.fileId) === normalizedDocumentId && presentation && Object.prototype.hasOwnProperty.call(presentation.rowVersions ?? {}, String(comment.commentId))) continue;
10987
10992
  const previousCommentId = normalizeCommentId(comment.commentId);
10988
10993
  const previousCanonicalId = normalizeCommentId(comment.trackedChangeCanonicalId);
10989
10994
  const previousPositionEntry = resolveCommentPositionEntry(comment).entry;
@@ -11351,7 +11356,7 @@ var useCommentsStore = defineStore("comments", () => {
11351
11356
  }
11352
11357
  };
11353
11358
  };
11354
- const reconcileTrackedChangesFromV2 = ({ superdoc, adapter, documentId, items, pruneStale = true, preparedParams = null, liveIds: suppliedLiveIds = null, liveAnchorKeys: suppliedLiveAnchorKeys = null, hydrationGeneration } = {}) => withInteractionSpan("store.trackedChanges.reconcile", "store-reconciliation", {
11359
+ 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", {
11355
11360
  documentId: documentId ?? null,
11356
11361
  itemCount: Array.isArray(items) ? items.length : null,
11357
11362
  pruneStale,
@@ -11369,6 +11374,22 @@ var useCommentsStore = defineStore("comments", () => {
11369
11374
  try {
11370
11375
  for (const params of paramsList) {
11371
11376
  if (!params) continue;
11377
+ if (preparedPresentation) {
11378
+ if (preparedPresentation !== committedReviewPresentations.value[String(effectiveDocumentId)]) continue;
11379
+ if (params.documentId != null && String(params.documentId) !== String(effectiveDocumentId)) continue;
11380
+ const id = normalizeCommentId(params.changeId);
11381
+ const version = preparedPresentation.rowVersions?.[id];
11382
+ if (!id || !Number.isSafeInteger(version) || version < 1) continue;
11383
+ const existing = [...trackedChangeIdentityIndex.candidates({ changeId: id })].filter((row) => String(row.fileId) === String(effectiveDocumentId) && String(row.commentId) === id);
11384
+ if (existing.length > 1) continue;
11385
+ const row = existing[0];
11386
+ if (row && row.trackedChangeCanonicalId !== params.trackedChangeCanonicalId) {
11387
+ const previousVersion = previousPreparedPresentation?.rowVersions?.[id];
11388
+ 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;
11389
+ row.trackedChangeCanonicalId = params.trackedChangeCanonicalId;
11390
+ row.updateIdentityValues?.({ trackedChangeCanonicalId: params.trackedChangeCanonicalId });
11391
+ }
11392
+ }
11372
11393
  if (params.event === "omit") {
11373
11394
  if (params.changeId != null) liveIds.add(String(params.changeId));
11374
11395
  continue;
@@ -13412,8 +13433,7 @@ var _hoisted_50 = {
13412
13433
  var _hoisted_51 = { class: "reply-input-wrapper" };
13413
13434
  var _hoisted_52 = { class: "reply-actions" };
13414
13435
  var _hoisted_53 = ["disabled", "data-disabled-reason"];
13415
- var CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
13416
- var TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
13436
+ var commentEditSessions = /* @__PURE__ */ new WeakMap();
13417
13437
  var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
13418
13438
  __name: "CommentDialog",
13419
13439
  props: {
@@ -13462,12 +13482,17 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
13462
13482
  const { proxy } = getCurrentInstance();
13463
13483
  const superdocStore = useSuperdocStore();
13464
13484
  const commentsStore = useCommentsStore();
13485
+ const editSessionOwner = {};
13486
+ const retireOwnEditSession = () => {
13487
+ if (commentEditSessions.get(commentsStore)?.owner === editSessionOwner) commentEditSessions.delete(commentsStore);
13488
+ };
13465
13489
  const { addComment, cancelComment, deleteComment, getCommentAliasIds, removePendingComment, getCommentDocumentId, requestInstantSidebarAlignment, resolveCommentPositionEntry, clearInstantSidebarAlignment, setActiveFloatingCommentInstance } = commentsStore;
13466
13490
  const { suppressInternalExternal, getConfig, activeComment, activeFloatingCommentInstanceId, floatingCommentsOffset, pendingComment, currentCommentText, currentCommentMentions, isDebugging, editingCommentId, editorCommentPositions, isCommentHighlighted } = storeToRefs(commentsStore);
13467
13491
  const isInternal = ref(true);
13468
13492
  const commentInput = ref(null);
13469
13493
  const editCommentInputs = ref(/* @__PURE__ */ new Map());
13470
13494
  const trackedChangeDecisionFailure = ref(null);
13495
+ const CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
13471
13496
  const CLICK_OUTSIDE_HIT_SAMPLE_OFFSETS = [
13472
13497
  [0, 0],
13473
13498
  [-3, 0],
@@ -13475,6 +13500,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
13475
13500
  [0, -3],
13476
13501
  [0, CLICK_OUTSIDE_HIT_TOLERANCE_PX]
13477
13502
  ];
13503
+ const TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
13478
13504
  const trackedChangeImagePreviewStyle = (preview) => {
13479
13505
  const width = typeof preview?.width === "number" && Number.isFinite(preview.width) ? preview.width : null;
13480
13506
  const height = typeof preview?.height === "number" && Number.isFinite(preview.height) ? preview.height : null;
@@ -14236,6 +14262,10 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14236
14262
  if (commentsAreReadOnly()) return readOnlyMutationOutcome();
14237
14263
  switch (value) {
14238
14264
  case "edit":
14265
+ commentEditSessions.set(commentsStore, {
14266
+ owner: editSessionOwner,
14267
+ submission: null
14268
+ });
14239
14269
  currentCommentText.value = comment?.commentText?.value ?? comment?.commentText ?? "";
14240
14270
  currentCommentMentions.value = Array.isArray(comment?.mentions) ? [...comment.mentions] : [];
14241
14271
  activeComment.value = props.comment.commentId;
@@ -14257,12 +14287,23 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14257
14287
  const handleCommentUpdate = async (comment) => {
14258
14288
  if (commentsAreReadOnly()) return readOnlyMutationOutcome();
14259
14289
  if (isV2Mode.value && v2CommentsAdapter.value) {
14290
+ const session = commentEditSessions.get(commentsStore);
14291
+ const submission = Symbol("comment-edit-submission");
14292
+ if (session?.owner === editSessionOwner) session.submission = submission;
14293
+ const editor = proxy.$superdoc.activeEditor;
14294
+ const adapter = editor.v2Comments;
14295
+ const documentId = adapter.documentId;
14296
+ const document = editor.doc;
14297
+ const thread = props.comment;
14298
+ const draft = currentCommentText.value;
14260
14299
  const outcome = await commentsStore.editCommentV2({
14261
14300
  superdoc: proxy.$superdoc,
14262
14301
  commentId: comment.commentId,
14263
- text: currentCommentText.value
14302
+ text: draft
14264
14303
  });
14265
14304
  if (!outcome?.ok) return outcome;
14305
+ 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;
14306
+ retireOwnEditSession();
14266
14307
  editingCommentId.value = null;
14267
14308
  removePendingComment(proxy.$superdoc);
14268
14309
  return outcome;
@@ -14293,6 +14334,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14293
14334
  return typeof timestamp === "string" ? new Date(timestamp).getTime() : timestamp;
14294
14335
  };
14295
14336
  const handleCancel = (comment) => {
14337
+ retireOwnEditSession();
14296
14338
  editingCommentId.value = null;
14297
14339
  isReplying.value = false;
14298
14340
  cancelComment(proxy.$superdoc);
@@ -14318,6 +14360,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14318
14360
  });
14319
14361
  });
14320
14362
  onBeforeUnmount(() => {
14363
+ retireOwnEditSession();
14321
14364
  proxy.$superdoc?.off?.("active-editor-change", refreshActiveEditor);
14322
14365
  });
14323
14366
  watch$1(showInputSection, (isVisible) => {
@@ -14566,7 +14609,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14566
14609
  ], 64))], 14, _hoisted_1$26)), [[_directive_click_outside, handleClickOutside]]);
14567
14610
  };
14568
14611
  }
14569
- }, [["__scopeId", "data-v-5ace8cef"]]);
14612
+ }, [["__scopeId", "data-v-b16fc5d0"]]);
14570
14613
  //#endregion
14571
14614
  //#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
14572
14615
  var _hoisted_1$25 = [
@@ -15481,6 +15524,7 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
15481
15524
  const sidebarOffsetY = ref(0);
15482
15525
  const disableInstantLayoutTransitions = ref(false);
15483
15526
  const directDecisionContinuityTargetId = ref(null);
15527
+ const workerDecisionContinuity = ref(null);
15484
15528
  const viewportRevision = ref(0);
15485
15529
  const isPendingThread = (commentOrId) => {
15486
15530
  const pendingId = pendingComment.value?.commentId;
@@ -15744,7 +15788,7 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
15744
15788
  resolveCollisions(collisionPositions, activeIndex, 15);
15745
15789
  return positions;
15746
15790
  });
15747
- watch$1(() => {
15791
+ const measuredReviewContext = computed$1(() => {
15748
15792
  const presentation = committedPresentation.value, container = floatingCommentsContainer.value;
15749
15793
  if (!presentation || !container) return null;
15750
15794
  viewportRevision.value;
@@ -15754,7 +15798,11 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
15754
15798
  const stage = typeof presentation.readPaintOrigin === "function" ? presentation.readPaintOrigin() : props.parent?.getBoundingClientRect?.();
15755
15799
  if (!stage || !Number.isFinite(stage.left) || !Number.isFinite(stage.top)) return null;
15756
15800
  const instances = committedInstances.value ?? [];
15801
+ const captured = workerDecisionContinuity.value;
15802
+ const coordinate = presentation.coordinate;
15803
+ const target = captured && instances.find((instance) => instance.id === captured.request.targetInstanceId);
15757
15804
  return {
15805
+ 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,
15758
15806
  activeThreadId: activeComment.value == null ? null : String(activeComment.value),
15759
15807
  activeInstanceId: activeCommentInstanceId.value == null ? null : String(activeCommentInstanceId.value),
15760
15808
  editingRowId: editingCommentId.value == null ? null : String(editingCommentId.value),
@@ -15780,7 +15828,8 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
15780
15828
  height: measuredHeights.value[instance.id]
15781
15829
  }))
15782
15830
  };
15783
- }, (input) => {
15831
+ });
15832
+ watch$1(measuredReviewContext, (input) => {
15784
15833
  if (input) committedPresentation.value?.updateContext(input);
15785
15834
  }, { immediate: true });
15786
15835
  const wrapperMinHeight = computed$1(() => {
@@ -15902,8 +15951,15 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
15902
15951
  directDecisionContinuity = null;
15903
15952
  directDecisionSourceId = null;
15904
15953
  directDecisionContinuityTargetId.value = null;
15954
+ workerDecisionContinuity.value = null;
15905
15955
  setInstantLayoutTransitionsDisabled(false);
15906
15956
  };
15957
+ watch$1([
15958
+ () => props.currentDocument?.id,
15959
+ () => committedPresentation.value?.coordinate?.documentEpoch,
15960
+ () => committedPresentation.value?.coordinate?.mountId,
15961
+ () => commentsStore.viewingVisibility?.documentMode
15962
+ ], () => releaseDirectDecisionContinuity());
15907
15963
  const releaseDirectDecisionContinuityForUnrelatedPointer = (event) => {
15908
15964
  if (!directDecisionContinuity) return;
15909
15965
  const actionElement = (event?.target instanceof Element ? event.target : null)?.closest?.("[data-comment-action]");
@@ -16077,6 +16133,27 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
16077
16133
  directDecisionSourceId = removedKey;
16078
16134
  directDecisionContinuityTargetId.value = targetKey;
16079
16135
  setInstantLayoutTransitionsDisabled(true);
16136
+ const presentation = committedPresentation.value;
16137
+ const coordinate = presentation?.coordinate;
16138
+ const removed = committedInstances.value?.find((instance) => instance.id === removedKey);
16139
+ const target = committedInstances.value?.find((instance) => instance.id === targetKey);
16140
+ const origin = presentation?.readPaintOrigin?.();
16141
+ 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)) {
16142
+ workerDecisionContinuity.value = {
16143
+ documentId: String(props.currentDocument.id),
16144
+ documentMode: commentsStore.viewingVisibility?.documentMode,
16145
+ request: {
16146
+ ...coordinate,
16147
+ removedInstanceId: removedKey,
16148
+ removedRowVersion: removed.rowVersion,
16149
+ targetInstanceId: targetKey,
16150
+ targetRowVersion: target.rowVersion,
16151
+ top: targetClientY - floatingCommentsContainer.value.getBoundingClientRect().top
16152
+ }
16153
+ };
16154
+ const input = measuredReviewContext.value;
16155
+ if (input) presentation.updateContext(input);
16156
+ }
16080
16157
  };
16081
16158
  watch$1(activeCommentInstanceId, (newKey, oldKey) => {
16082
16159
  clearDeferredRemeasureTimers();
@@ -16340,7 +16417,7 @@ var FloatingComments_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
16340
16417
  }), 128))], 4)], 36);
16341
16418
  };
16342
16419
  }
16343
- }, [["__scopeId", "data-v-028441bf"]]);
16420
+ }, [["__scopeId", "data-v-ac790145"]]);
16344
16421
  //#endregion
16345
16422
  //#region src/components/CommentsLayer/PdfCommentsLayer.vue
16346
16423
  var _hoisted_1$22 = {
@@ -22563,6 +22640,10 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22563
22640
  if (!ui) return Promise.resolve(UNAVAILABLE_COMMAND_RESULT);
22564
22641
  return executeFirstPartyCommandAsync(ui, commandId, payload);
22565
22642
  },
22643
+ executeAfterSelection: (commandId, payload) => {
22644
+ const ui = getSuperDocUI();
22645
+ return ui ? executeFirstPartyShortcutAsync(ui, commandId, payload) : Promise.resolve(UNAVAILABLE_COMMAND_RESULT);
22646
+ },
22566
22647
  getState: (commandId) => getSuperDocUI()?.commands.get(commandId).getState() ?? UNAVAILABLE_COMMAND_STATE
22567
22648
  },
22568
22649
  ...openLinkWorkflow ? { openLinkWorkflow } : {}
@@ -24536,6 +24617,11 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
24536
24617
  const activeDocumentId = getActiveV2DocumentId();
24537
24618
  const stage = activeDocumentId == null ? latestV2MountStage : v2MountStagesByDocumentId.get(String(activeDocumentId)) ?? null;
24538
24619
  if (!stage?.isConnected) return null;
24620
+ const workerRoots = stage.querySelectorAll("[data-sd-worker-dom-root]");
24621
+ if (workerRoots.length) {
24622
+ if (workerRoots.length !== 1) return null;
24623
+ return workerRoots[0].querySelector(`.superdoc-page[data-worker-page-id][data-page-index="${v2RulerActivePageIndex}"]`)?.getBoundingClientRect() ?? null;
24624
+ }
24539
24625
  const wrapper = Array.from(stage.children).find((element) => element.dataset?.v2PaintWrapper === "true") ?? stage;
24540
24626
  const pages = Array.from(wrapper.children).filter((element) => element.classList?.contains("superdoc-page"));
24541
24627
  return (pages.find((element) => Number(element.dataset?.pageIndex) === v2RulerActivePageIndex) ?? pages[0] ?? wrapper).getBoundingClientRect();
@@ -24903,7 +24989,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
24903
24989
  ], 46, _hoisted_1$17);
24904
24990
  };
24905
24991
  }
24906
- }, [["__scopeId", "data-v-ae3beeba"]]);
24992
+ }, [["__scopeId", "data-v-a5d7d136"]]);
24907
24993
  //#endregion
24908
24994
  //#region src/core/create-app.js
24909
24995
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -46688,7 +46774,7 @@ var SuperDoc = class extends import_eventemitter3.default {
46688
46774
  }
46689
46775
  this.userColorMap = /* @__PURE__ */ new Map();
46690
46776
  this.colorIndex = 0;
46691
- this.version = "2.25.0-next.16";
46777
+ this.version = "2.25.0-next.18";
46692
46778
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46693
46779
  this.superdocId = config.superdocId || v4();
46694
46780
  this.colors = this.config.colors ?? [];