superdoc 2.11.0-next.8 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -315,7 +315,7 @@ var shuffleArray = (array) => {
315
315
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
316
316
  function getSuperdocVersion() {
317
317
  try {
318
- return "2.11.0-next.8";
318
+ return "2.11.0";
319
319
  } catch {
320
320
  return "unknown";
321
321
  }
@@ -11678,7 +11678,7 @@ var _hoisted_3$20 = {
11678
11678
  class: "comments-dropdown__option-icon"
11679
11679
  };
11680
11680
  var _hoisted_4$13 = ["innerHTML"];
11681
- var _hoisted_5$9 = { class: "comments-dropdown__option-label" };
11681
+ var _hoisted_5$10 = { class: "comments-dropdown__option-label" };
11682
11682
  var CommentsDropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
11683
11683
  __name: "CommentsDropdown",
11684
11684
  props: {
@@ -11824,7 +11824,7 @@ var CommentsDropdown_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
11824
11824
  }, null, 8, _hoisted_4$13)) : (openBlock(), createBlock(unref(OptionIcon), {
11825
11825
  key: 1,
11826
11826
  option
11827
- }, null, 8, ["option"]))])) : createCommentVNode("", true), createElementVNode("span", _hoisted_5$9, toDisplayString(option.label), 1)], 10, _hoisted_2$24);
11827
+ }, null, 8, ["option"]))])) : createCommentVNode("", true), createElementVNode("span", _hoisted_5$10, toDisplayString(option.label), 1)], 10, _hoisted_2$24);
11828
11828
  }), 128))], 4)) : createCommentVNode("", true)]))]);
11829
11829
  };
11830
11830
  }
@@ -12091,11 +12091,11 @@ var _hoisted_1$28 = { class: "card-section comment-header" };
12091
12091
  var _hoisted_2$21 = { class: "comment-header-left" };
12092
12092
  var _hoisted_3$17 = { class: "user-info" };
12093
12093
  var _hoisted_4$11 = { class: "user-name" };
12094
- var _hoisted_5$8 = {
12094
+ var _hoisted_5$9 = {
12095
12095
  key: 0,
12096
12096
  class: "imported-tag"
12097
12097
  };
12098
- var _hoisted_6$7 = {
12098
+ var _hoisted_6$8 = {
12099
12099
  key: 0,
12100
12100
  class: "user-timestamp"
12101
12101
  };
@@ -12350,7 +12350,7 @@ var CommentHeader_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12350
12350
  return openBlock(), createElementBlock("div", _hoisted_1$28, [createElementVNode("div", _hoisted_2$21, [createVNode(Avatar_default, {
12351
12351
  user: getCurrentUser.value,
12352
12352
  class: "avatar"
12353
- }, null, 8, ["user"]), createElementVNode("div", _hoisted_3$17, [createElementVNode("div", _hoisted_4$11, [createTextVNode(toDisplayString(getCurrentUser.value.name), 1), isImported.value ? (openBlock(), createElementBlock("span", _hoisted_5$8, "IMPORTED")) : createCommentVNode("", true)]), props.comment.createdTime ? (openBlock(), createElementBlock("div", _hoisted_6$7, toDisplayString(unref(formatDate)(props.comment.createdTime)), 1)) : createCommentVNode("", true)])]), createElementVNode("div", { class: normalizeClass(["overflow-menu", { "is-visible": props.isActive }]) }, [
12353
+ }, null, 8, ["user"]), createElementVNode("div", _hoisted_3$17, [createElementVNode("div", _hoisted_4$11, [createTextVNode(toDisplayString(getCurrentUser.value.name), 1), isImported.value ? (openBlock(), createElementBlock("span", _hoisted_5$9, "IMPORTED")) : createCommentVNode("", true)]), props.comment.createdTime ? (openBlock(), createElementBlock("div", _hoisted_6$8, toDisplayString(unref(formatDate)(props.comment.createdTime)), 1)) : createCommentVNode("", true)])]), createElementVNode("div", { class: normalizeClass(["overflow-menu", { "is-visible": props.isActive }]) }, [
12354
12354
  allowResolve.value ? (openBlock(), createElementBlock("div", {
12355
12355
  key: 0,
12356
12356
  class: normalizeClass(["overflow-menu__icon", { "sd-is-disabled": Boolean(__props.resolveDisabledReason) }]),
@@ -12411,8 +12411,8 @@ var _hoisted_4$10 = [
12411
12411
  "data-sd-comment-mention-option",
12412
12412
  "onMousedown"
12413
12413
  ];
12414
- var _hoisted_5$7 = { class: "comment-mention-option__name" };
12415
- var _hoisted_6$6 = {
12414
+ var _hoisted_5$8 = { class: "comment-mention-option__name" };
12415
+ var _hoisted_6$7 = {
12416
12416
  key: 0,
12417
12417
  class: "comment-mention-option__email"
12418
12418
  };
@@ -12607,7 +12607,7 @@ var CommentInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12607
12607
  "aria-selected": index === highlightedMentionIndex.value,
12608
12608
  "data-sd-comment-mention-option": userKey(user),
12609
12609
  onMousedown: withModifiers(($event) => selectMention(user), ["prevent"])
12610
- }, [createElementVNode("span", _hoisted_5$7, toDisplayString(displayName(user)), 1), user.email ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(user.email), 1)) : createCommentVNode("", true)], 42, _hoisted_4$10);
12610
+ }, [createElementVNode("span", _hoisted_5$8, toDisplayString(displayName(user)), 1), user.email ? (openBlock(), createElementBlock("span", _hoisted_6$7, toDisplayString(user.email), 1)) : createCommentVNode("", true)], 42, _hoisted_4$10);
12611
12611
  }), 128))])) : createCommentVNode("", true)])], 2)]);
12612
12612
  };
12613
12613
  }
@@ -12627,8 +12627,8 @@ var _hoisted_2$19 = {
12627
12627
  };
12628
12628
  var _hoisted_3$15 = { class: "new-comment-input-wrapper" };
12629
12629
  var _hoisted_4$9 = { class: "reply-actions" };
12630
- var _hoisted_5$6 = ["disabled"];
12631
- var _hoisted_6$5 = {
12630
+ var _hoisted_5$7 = ["disabled"];
12631
+ var _hoisted_6$6 = {
12632
12632
  key: 0,
12633
12633
  class: "resolved-badge"
12634
12634
  };
@@ -13659,9 +13659,9 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
13659
13659
  class: normalizeClass(["sd-button primary reply-btn-primary", { "sd-is-disabled": !hasTextContent.value || isSubmittingNewComment.value }]),
13660
13660
  onClick: withModifiers(handleAddComment, ["stop", "prevent"]),
13661
13661
  disabled: !hasTextContent.value || isSubmittingNewComment.value
13662
- }, " Comment ", 10, _hoisted_5$6)])
13662
+ }, " Comment ", 10, _hoisted_5$7)])
13663
13663
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
13664
- resolvedBadgeLabel.value ? (openBlock(), createElementBlock("div", _hoisted_6$5, [createElementVNode("span", {
13664
+ resolvedBadgeLabel.value ? (openBlock(), createElementBlock("div", _hoisted_6$6, [createElementVNode("span", {
13665
13665
  class: "resolved-badge__icon",
13666
13666
  innerHTML: unref(superdocIcons).markDone
13667
13667
  }, null, 8, _hoisted_7$3), createTextVNode(" " + toDisplayString(resolvedBadgeLabel.value), 1)])) : createCommentVNode("", true),
@@ -16671,6 +16671,47 @@ function toV2BulkDecisionEvent(documentId, fact) {
16671
16671
  };
16672
16672
  }
16673
16673
  //#endregion
16674
+ //#region src/helpers/v2-keyboard-edit-rejection.js
16675
+ var KEYBOARD_DELETE_INPUT_KINDS = /* @__PURE__ */ new Set(["keydown", "beforeinput"]);
16676
+ var KEYBOARD_DELETE_COMMAND_KINDS = /* @__PURE__ */ new Set(["delete-backward", "delete-forward"]);
16677
+ var KEYBOARD_DELETE_FAILURE_SOURCES = /* @__PURE__ */ new Set(["shell", "receipt"]);
16678
+ var V2_EDIT_REJECTED_CODE = "edit-rejected";
16679
+ var V2_EDIT_REJECTED_MESSAGE = "This edit couldn’t be completed. Adjust the selection and try again.";
16680
+ function isV2KeyboardEditRejection(event) {
16681
+ return Boolean(event && event.type === "mutation:rejected" && event.origin === "document-surface" && KEYBOARD_DELETE_FAILURE_SOURCES.has(event.failureSource) && (event.inputKind === "cut" || KEYBOARD_DELETE_INPUT_KINDS.has(event.inputKind) && KEYBOARD_DELETE_COMMAND_KINDS.has(event.editableCommandKind)));
16682
+ }
16683
+ function createV2KeyboardEditRejectionException(documentId) {
16684
+ return {
16685
+ error: /* @__PURE__ */ new Error(V2_EDIT_REJECTED_MESSAGE),
16686
+ code: V2_EDIT_REJECTED_CODE,
16687
+ editor: null,
16688
+ ...typeof documentId === "string" && documentId.length > 0 ? { documentId } : {}
16689
+ };
16690
+ }
16691
+ function resolveV2MutationNoticeStatuses(scope, authorRequiredMessages, editRejectedMessages) {
16692
+ const authorRequired = authorRequiredMessages?.[scope] ?? null;
16693
+ return {
16694
+ authorRequired,
16695
+ editRejected: authorRequired ? null : editRejectedMessages?.[scope] ?? null
16696
+ };
16697
+ }
16698
+ function createV2KeyboardEditRejectionNotificationGate() {
16699
+ const notifiedScopes = /* @__PURE__ */ new Set();
16700
+ const keyFor = (scope) => typeof scope === "string" && scope.length > 0 ? scope : "__default__";
16701
+ return {
16702
+ shouldNotify(scope, event) {
16703
+ if (!isV2KeyboardEditRejection(event)) return false;
16704
+ const key = keyFor(scope);
16705
+ if (notifiedScopes.has(key)) return false;
16706
+ notifiedScopes.add(key);
16707
+ return true;
16708
+ },
16709
+ clear(scope) {
16710
+ notifiedScopes.delete(keyFor(scope));
16711
+ }
16712
+ };
16713
+ }
16714
+ //#endregion
16674
16715
  //#region src/helpers/v2-selection-sync.js
16675
16716
  /**
16676
16717
  * A logical v2 selection snapshot represents a non-empty range when its anchor
@@ -18168,11 +18209,11 @@ var _hoisted_4$8 = {
18168
18209
  key: 3,
18169
18210
  class: "link-title"
18170
18211
  };
18171
- var _hoisted_5$5 = {
18212
+ var _hoisted_5$6 = {
18172
18213
  key: 4,
18173
18214
  class: "link-input-wrapper"
18174
18215
  };
18175
- var _hoisted_6$4 = { class: "input-row text-input-row" };
18216
+ var _hoisted_6$5 = { class: "input-row text-input-row" };
18176
18217
  var _hoisted_7$2 = ["readonly", "onKeydown"];
18177
18218
  var _hoisted_8$2 = { class: "input-row url-input-row" };
18178
18219
  var _hoisted_9$1 = ["innerHTML"];
@@ -18366,8 +18407,8 @@ var LinkInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
18366
18407
  if (props.goToAnchor) props.goToAnchor(anchorUrl);
18367
18408
  };
18368
18409
  return (_ctx, _cache) => {
18369
- return openBlock(), createElementBlock("div", { class: normalizeClass(["link-input-ctn", { "high-contrast": unref(isHighContrastMode) }]) }, [isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_1$19, "Page anchor")) : isViewingMode.value ? (openBlock(), createElementBlock("div", _hoisted_2$15, "Link details")) : isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_3$12, "Edit link")) : (openBlock(), createElementBlock("div", _hoisted_4$8, "Add link")), __props.showInput && !isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
18370
- createElementVNode("div", _hoisted_6$4, [_cache[4] || (_cache[4] = createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)), withDirectives(createElementVNode("input", {
18410
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["link-input-ctn", { "high-contrast": unref(isHighContrastMode) }]) }, [isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_1$19, "Page anchor")) : isViewingMode.value ? (openBlock(), createElementBlock("div", _hoisted_2$15, "Link details")) : isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_3$12, "Edit link")) : (openBlock(), createElementBlock("div", _hoisted_4$8, "Add link")), __props.showInput && !isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
18411
+ createElementVNode("div", _hoisted_6$5, [_cache[4] || (_cache[4] = createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)), withDirectives(createElementVNode("input", {
18371
18412
  type: "text",
18372
18413
  name: "text",
18373
18414
  placeholder: "Text",
@@ -21349,9 +21390,19 @@ var _hoisted_1$16 = {
21349
21390
  "aria-live": "assertive",
21350
21391
  "data-superdoc-v2-author-required": ""
21351
21392
  };
21352
- var _hoisted_2$12 = ["innerHTML"];
21353
- var _hoisted_3$9 = { class: "superdoc__document document" };
21354
- var _hoisted_4$7 = { class: "floating-comments" };
21393
+ var _hoisted_2$12 = {
21394
+ key: 0,
21395
+ class: "superdoc__mutation-status"
21396
+ };
21397
+ var _hoisted_3$9 = {
21398
+ class: "superdoc__edit-rejected-status",
21399
+ role: "status",
21400
+ "aria-live": "polite",
21401
+ "data-superdoc-v2-edit-rejected": ""
21402
+ };
21403
+ var _hoisted_4$7 = ["innerHTML"];
21404
+ var _hoisted_5$5 = { class: "superdoc__document document" };
21405
+ var _hoisted_6$4 = { class: "floating-comments" };
21355
21406
  var TRACKED_CHANGE_CARRIERS_RESTAMPED_EVENT = "superdoc:v2-tracked-change-carriers-restamped";
21356
21407
  var UNAVAILABLE_COMMAND_RESULT = false;
21357
21408
  var V2_SELECTION_TOOLBAR_SYNC_RETRY_FRAMES = 3;
@@ -21683,6 +21734,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21683
21734
  adapter
21684
21735
  });
21685
21736
  proxy.$superdoc.setActiveRuntime(runtimeId, "v2-editor-ready");
21737
+ syncV2EditRejectedActiveDocument();
21686
21738
  return true;
21687
21739
  };
21688
21740
  const v2ReviewWindowController = resolvedEditorIntegration.createReviewWindowController({ applyReviewWindow: (ctx, result) => commentsStore.applyReviewWindowFromV2?.({
@@ -21708,10 +21760,9 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21708
21760
  const v2DiagnosticDedupe = createV2DiagnosticDedupe();
21709
21761
  const v2AuthorRequiredGate = createV2AuthorRequiredNotificationGate();
21710
21762
  const v2AuthorRequiredMessages = ref({});
21711
- const v2AuthorRequiredStatus = computed(() => Object.values(v2AuthorRequiredMessages.value)[0] ?? null);
21712
- const v2AuthorRequiredScope = (documentId) => typeof documentId === "string" && documentId.length > 0 ? `document:${documentId}` : "document:default";
21763
+ const v2MutationNoticeScope = (documentId) => typeof documentId === "string" && documentId.length > 0 ? `document:${documentId}` : "document:default";
21713
21764
  const clearV2AuthorRequired = (documentId) => {
21714
- const scope = v2AuthorRequiredScope(documentId);
21765
+ const scope = v2MutationNoticeScope(documentId);
21715
21766
  v2AuthorRequiredGate.clear(scope);
21716
21767
  if (!v2AuthorRequiredMessages.value[scope]) return;
21717
21768
  const next = { ...v2AuthorRequiredMessages.value };
@@ -21719,7 +21770,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21719
21770
  v2AuthorRequiredMessages.value = next;
21720
21771
  };
21721
21772
  const maybeNotifyV2AuthorRequired = (documentId, event) => {
21722
- const scope = v2AuthorRequiredScope(documentId);
21773
+ const scope = v2MutationNoticeScope(documentId);
21723
21774
  if (!v2AuthorRequiredGate.shouldNotify(scope, event)) return;
21724
21775
  v2AuthorRequiredMessages.value = {
21725
21776
  ...v2AuthorRequiredMessages.value,
@@ -21733,6 +21784,39 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21733
21784
  ...event.failureSource === "receipt" && event.failure ? { receipt: event.failure } : {}
21734
21785
  });
21735
21786
  };
21787
+ const v2EditRejectedGate = createV2KeyboardEditRejectionNotificationGate();
21788
+ const v2EditRejectedMessages = ref({});
21789
+ const v2EditRejectedActiveDocumentId = ref(null);
21790
+ const v2MutationNoticeStatuses = computed(() => resolveV2MutationNoticeStatuses(v2MutationNoticeScope(v2EditRejectedActiveDocumentId.value), v2AuthorRequiredMessages.value, v2EditRejectedMessages.value));
21791
+ const v2AuthorRequiredStatus = computed(() => v2MutationNoticeStatuses.value.authorRequired);
21792
+ const v2EditRejectedStatus = computed(() => v2MutationNoticeStatuses.value.editRejected);
21793
+ const syncV2EditRejectedActiveDocument = () => {
21794
+ const activeEditor = proxy.$superdoc?.activeEditor;
21795
+ if (activeEditor?.editorVersion !== 2) {
21796
+ v2EditRejectedActiveDocumentId.value = null;
21797
+ return;
21798
+ }
21799
+ const documentId = activeEditor.documentId ?? activeEditor.options?.documentId ?? null;
21800
+ v2EditRejectedActiveDocumentId.value = typeof documentId === "string" && documentId.length > 0 ? documentId : null;
21801
+ };
21802
+ const clearV2EditRejected = (documentId) => {
21803
+ const scope = v2MutationNoticeScope(documentId);
21804
+ v2EditRejectedGate.clear(scope);
21805
+ if (!v2EditRejectedMessages.value[scope]) return;
21806
+ const next = { ...v2EditRejectedMessages.value };
21807
+ delete next[scope];
21808
+ v2EditRejectedMessages.value = next;
21809
+ };
21810
+ const maybeNotifyV2EditRejected = (documentId, event) => {
21811
+ const scope = v2MutationNoticeScope(documentId);
21812
+ if (v2AuthorRequiredMessages.value[scope]) return;
21813
+ if (!v2EditRejectedGate.shouldNotify(scope, event)) return;
21814
+ v2EditRejectedMessages.value = {
21815
+ ...v2EditRejectedMessages.value,
21816
+ [scope]: V2_EDIT_REJECTED_MESSAGE
21817
+ };
21818
+ proxy.$superdoc.emit("exception", createV2KeyboardEditRejectionException(documentId));
21819
+ };
21736
21820
  const setV2EditorFailure = (documentId, failure) => {
21737
21821
  if (!documentId) return;
21738
21822
  v2EditorFailures.value = {
@@ -21751,6 +21835,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21751
21835
  const activeDocumentId = documentId ?? activeEditor?.documentId ?? activeEditor?.options?.documentId ?? null;
21752
21836
  if (!activeDocumentId) {
21753
21837
  if (activeEditor?.editorVersion === 2) proxy.$superdoc.setActiveEditor(null);
21838
+ syncV2EditRejectedActiveDocument();
21754
21839
  return;
21755
21840
  }
21756
21841
  if (documentId && activeEditor?.editorVersion === 2) {
@@ -21767,6 +21852,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21767
21852
  if (!hadRegisteredRuntime && activeEditor?.editorVersion === 2) {
21768
21853
  if ((activeEditor.documentId ?? activeEditor.options?.documentId ?? null) === activeDocumentId) proxy.$superdoc.setActiveEditor(null);
21769
21854
  }
21855
+ syncV2EditRejectedActiveDocument();
21770
21856
  };
21771
21857
  const createV2ExtensionsFacet = (host) => {
21772
21858
  const manager = typeof host?.getExtensionManager === "function" ? host.getExtensionManager() : null;
@@ -21798,6 +21884,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21798
21884
  if (!payload) return;
21799
21885
  clearV2EditorFailure(payload.documentId ?? null);
21800
21886
  clearV2AuthorRequired(payload.documentId ?? null);
21887
+ clearV2EditRejected(payload.documentId ?? null);
21801
21888
  const { host, mount, documentId, capabilities, editCommands, bindEditShortcuts, bindSessionShortcuts, commentsAdapter, trackedChangesAdapter, contextMenu, documentApi, documentMutationReadiness, documentApiUnavailableReason, pageMetrics, pageLayout, pageFurniture, presence, lock, fonts, replaceFile, upgradeToCollaboration, documentOpenToken } = payload;
21802
21889
  documentOpenTelemetry?.trackDocumentOpen(documentOpenToken ?? null, documentId ?? null);
21803
21890
  const saveV2Bytes = async (saveOptions = {}) => {
@@ -22103,7 +22190,10 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22103
22190
  host,
22104
22191
  mount,
22105
22192
  facade
22106
- })) proxy.$superdoc.setActiveEditor(facade);
22193
+ })) {
22194
+ proxy.$superdoc.setActiveEditor(facade);
22195
+ syncV2EditRejectedActiveDocument();
22196
+ }
22107
22197
  proxy.$superdoc.broadcastEditorCreate(facade);
22108
22198
  installV2CommandShortcutBinding({
22109
22199
  documentId,
@@ -22471,6 +22561,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22471
22561
  resetSelection();
22472
22562
  v2PageMetricsSnapshot.value = null;
22473
22563
  const clearedDocumentId = payload?.documentId == null ? null : String(payload.documentId);
22564
+ clearV2EditRejected(clearedDocumentId);
22474
22565
  commentsStore.cancelImportedTrackedChangeBootstrap?.(clearedDocumentId ?? void 0);
22475
22566
  if (clearedDocumentId) v2MountStagesByDocumentId.delete(clearedDocumentId);
22476
22567
  if (latestV2MountStage && (clearedDocumentId == null || latestV2MountStage.dataset?.superdocV2DocumentId === clearedDocumentId)) latestV2MountStage = null;
@@ -22521,13 +22612,17 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22521
22612
  resumeDomains: ["comments", "trackedChanges"],
22522
22613
  trackedRowCount: commentsStore.getV2TrackedChangeRowCount?.(documentId) ?? null
22523
22614
  });
22524
- maybeNotifyV2AuthorRequired(documentId, event);
22615
+ if (isV2AuthorRequiredRejection(event)) {
22616
+ clearV2EditRejected(documentId);
22617
+ maybeNotifyV2AuthorRequired(documentId, event);
22618
+ } else maybeNotifyV2EditRejected(documentId, event);
22525
22619
  return;
22526
22620
  }
22527
22621
  if (event.type === "mutation:committed") {
22528
22622
  clearV2AuthorRequired(documentId);
22529
22623
  const bulkDecisionEvent = toV2BulkDecisionEvent(documentId, event.trackedChangeBulkDecision);
22530
22624
  if (bulkDecisionEvent) proxy.$superdoc.emit("tracked-changes:bulk-decision", bulkDecisionEvent);
22625
+ clearV2EditRejected(documentId);
22531
22626
  emitV2EditorUpdate();
22532
22627
  }
22533
22628
  if (event.type !== "mutation:committed") return;
@@ -22709,6 +22804,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22709
22804
  };
22710
22805
  const activateRuntimeFromEvent = (event, reason) => {
22711
22806
  proxy.$superdoc?.activateRuntimeFromEventTarget?.(event.target, reason);
22807
+ syncV2EditRejectedActiveDocument();
22712
22808
  };
22713
22809
  const handleRuntimeFocusIn = (event) => activateRuntimeFromEvent(event, "focusin");
22714
22810
  const handleRuntimePointerDown = (event) => activateRuntimeFromEvent(event, "pointerdown");
@@ -23169,6 +23265,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
23169
23265
  document.addEventListener("selectionchange", handleDocumentSelectionChange);
23170
23266
  proxy.$superdoc?.on?.("document-mode-change", handleV2DocumentModeChange);
23171
23267
  proxy.$superdoc?.on?.("active-editor-change", syncV2RulerActiveEditor);
23268
+ proxy.$superdoc?.on?.("active-editor-change", syncV2EditRejectedActiveDocument);
23172
23269
  recalculateCompactCommentsMode();
23173
23270
  ensureCompactMeasurementObserver();
23174
23271
  });
@@ -23294,6 +23391,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
23294
23391
  document.removeEventListener("selectionchange", handleDocumentSelectionChange);
23295
23392
  proxy.$superdoc?.off?.("document-mode-change", handleV2DocumentModeChange);
23296
23393
  proxy.$superdoc?.off?.("active-editor-change", syncV2RulerActiveEditor);
23394
+ proxy.$superdoc?.off?.("active-editor-change", syncV2EditRejectedActiveDocument);
23297
23395
  });
23298
23396
  const selectionLayer = ref(null);
23299
23397
  const isDragging = ref(false);
@@ -23690,149 +23788,153 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
23690
23788
  ref_key: "layers",
23691
23789
  ref: layers,
23692
23790
  role: "group"
23693
- }, [showToolsFloatingMenu.value ? (openBlock(), createElementBlock("div", {
23694
- key: 0,
23695
- class: "superdoc__tools tools",
23696
- style: normalizeStyle(toolsMenuPosition)
23697
- }, [createElementVNode("div", {
23698
- class: "tools-item",
23699
- "data-id": "is-tool",
23700
- onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => handleToolClick("comments"), ["stop", "prevent"]))
23701
- }, [createElementVNode("div", {
23702
- class: "superdoc__tools-icon",
23703
- innerHTML: unref(superdocIcons).comment
23704
- }, null, 8, _hoisted_2$12)], 32)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$9, [
23705
- isCommentsEnabled.value ? (openBlock(), createElementBlock("div", {
23706
- key: 0,
23707
- class: "superdoc__selection-layer selection-layer",
23708
- onMousedown: handleSelectionStart,
23709
- onMouseup: handleDragEnd,
23710
- ref_key: "selectionLayer",
23711
- ref: selectionLayer
23712
- }, [unref(selectionPosition) && shouldShowSelection.value ? (openBlock(), createElementBlock("div", {
23713
- key: 0,
23714
- style: normalizeStyle(getSelectionPosition.value),
23715
- class: "superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"
23716
- }, null, 4)) : createCommentVNode("", true)], 544)) : createCommentVNode("", true),
23717
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(documents), (doc) => {
23718
- return openBlock(), createElementBlock("div", {
23719
- class: "superdoc__sub-document sub-document",
23720
- key: `${doc.id}:${doc.editorMountNonce}`,
23721
- ref_for: true,
23722
- ref: (el) => setSubDocumentRoot(doc, el)
23723
- }, [
23724
- doc.type === unref("application/pdf") ? (openBlock(), createBlock(unref(PdfViewer), {
23725
- key: 0,
23726
- file: doc.data,
23727
- "file-id": doc.id,
23728
- "initial-scale": (unref(activeZoom) ?? 100) / 100,
23729
- config: unref(pdfConfig),
23730
- onSelectionRaw: handlePdfSelectionRaw,
23731
- onBypassSelection: handlePdfClick,
23732
- onPageRendered: unref(handleWhiteboardPageReady),
23733
- onDocumentReady: _cache[1] || (_cache[1] = ({ documentId, viewerContainer }) => handleDocumentReady(documentId, viewerContainer)),
23734
- ref_for: true,
23735
- ref_key: "pdfViewerRef",
23736
- ref: pdfViewerRef
23737
- }, null, 8, [
23738
- "file",
23739
- "file-id",
23740
- "initial-scale",
23741
- "config",
23742
- "onPageRendered"
23743
- ])) : createCommentVNode("", true),
23744
- doc.type === unref("application/vnd.openxmlformats-officedocument.wordprocessingml.document") && unref(V2Ruler) && shouldShowV2Ruler(doc) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [resolvedRulerContainer.value ? (openBlock(), createBlock(Teleport, {
23745
- key: 0,
23746
- to: resolvedRulerContainer.value
23747
- }, [createElementVNode("div", {
23748
- class: "v2-ruler-host",
23749
- style: normalizeStyle(v2RulerHostStyle.value)
23750
- }, [createVNode(unref(V2Ruler), {
23751
- "page-layout": unref(proxy).$superdoc.activeEditor.pageLayout,
23752
- "measurement-unit": unref(measurementUnit),
23753
- onPageMarginsChange: (event) => handleV2PageMarginsChange(doc, event)
23754
- }, null, 8, [
23755
- "page-layout",
23756
- "measurement-unit",
23757
- "onPageMarginsChange"
23758
- ])], 4)], 8, ["to"])) : (openBlock(), createElementBlock("div", {
23759
- key: 1,
23760
- class: "v2-ruler-host",
23761
- style: normalizeStyle(v2RulerHostStyle.value)
23762
- }, [createVNode(unref(V2Ruler), {
23763
- "page-layout": unref(proxy).$superdoc.activeEditor.pageLayout,
23764
- "measurement-unit": unref(measurementUnit),
23765
- onPageMarginsChange: (event) => handleV2PageMarginsChange(doc, event)
23766
- }, null, 8, [
23767
- "page-layout",
23768
- "measurement-unit",
23769
- "onPageMarginsChange"
23770
- ])], 4))], 64)) : createCommentVNode("", true),
23771
- doc.type === unref("application/vnd.openxmlformats-officedocument.wordprocessingml.document") ? (openBlock(), createBlock(unref(V2DocumentEditor), {
23772
- key: 2,
23773
- "file-source": doc.data,
23774
- "document-id": doc.id,
23775
- options: editorOptions(doc),
23776
- "measurement-unit": unref(measurementUnit),
23777
- onV2EditorReady,
23778
- onV2EditorFailed,
23779
- onV2Render,
23780
- onV2RenderCleared,
23781
- onV2SelectionChanged,
23782
- onV2HostEvent: (event) => onV2HostEvent(doc, event),
23783
- onV2LinkClick,
23784
- onV2CommentCreated,
23785
- onV2PageMetrics,
23786
- onV2RenderReadiness: (payload) => onV2RenderReadiness(doc, payload),
23787
- onV2OpenDiagnostics: (payload) => onV2OpenDiagnostics(doc, payload)
23788
- }, null, 8, [
23789
- "file-source",
23790
- "document-id",
23791
- "options",
23792
- "measurement-unit",
23793
- "onV2HostEvent",
23794
- "onV2RenderReadiness",
23795
- "onV2OpenDiagnostics"
23796
- ])) : createCommentVNode("", true),
23797
- doc.type === unref("text/html") ? (openBlock(), createBlock(HtmlViewer_default, {
23798
- key: 3,
23799
- onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
23800
- onSelectionChange: handleSelectionChange,
23801
- "file-source": doc.data,
23802
- "document-id": doc.id
23803
- }, null, 8, ["file-source", "document-id"])) : createCommentVNode("", true)
23804
- ]);
23805
- }), 128)),
23806
- shouldRenderPdfWhiteboard.value ? (openBlock(), createBlock(WhiteboardLayer_default, {
23791
+ }, [
23792
+ v2EditRejectedStatus.value ? (openBlock(), createElementBlock("div", _hoisted_2$12, [createElementVNode("p", _hoisted_3$9, toDisplayString(v2EditRejectedStatus.value), 1)])) : createCommentVNode("", true),
23793
+ showToolsFloatingMenu.value ? (openBlock(), createElementBlock("div", {
23807
23794
  key: 1,
23808
- class: "superdoc__whiteboard-layer",
23809
- whiteboard: unref(whiteboard),
23810
- pages: unref(whiteboardPages),
23811
- "page-sizes": unref(whiteboardPageSizes),
23812
- "page-offsets": unref(whiteboardPageOffsets),
23813
- enabled: unref(whiteboardEnabled),
23814
- interactive: whiteboardInteractive.value,
23815
- opacity: unref(whiteboardOpacity)
23816
- }, null, 8, [
23817
- "whiteboard",
23818
- "pages",
23819
- "page-sizes",
23820
- "page-offsets",
23821
- "enabled",
23822
- "interactive",
23823
- "opacity"
23824
- ])) : createCommentVNode("", true),
23825
- shouldRenderPdfCommentAnchors.value ? (openBlock(), createBlock(PdfCommentsLayer_default, {
23826
- key: 2,
23827
- onAnchorActivate: handleHighlightClick
23828
- })) : createCommentVNode("", true)
23829
- ])], 512),
23795
+ class: "superdoc__tools tools",
23796
+ style: normalizeStyle(toolsMenuPosition)
23797
+ }, [createElementVNode("div", {
23798
+ class: "tools-item",
23799
+ "data-id": "is-tool",
23800
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => handleToolClick("comments"), ["stop", "prevent"]))
23801
+ }, [createElementVNode("div", {
23802
+ class: "superdoc__tools-icon",
23803
+ innerHTML: unref(superdocIcons).comment
23804
+ }, null, 8, _hoisted_4$7)], 32)], 4)) : createCommentVNode("", true),
23805
+ createElementVNode("div", _hoisted_5$5, [
23806
+ isCommentsEnabled.value ? (openBlock(), createElementBlock("div", {
23807
+ key: 0,
23808
+ class: "superdoc__selection-layer selection-layer",
23809
+ onMousedown: handleSelectionStart,
23810
+ onMouseup: handleDragEnd,
23811
+ ref_key: "selectionLayer",
23812
+ ref: selectionLayer
23813
+ }, [unref(selectionPosition) && shouldShowSelection.value ? (openBlock(), createElementBlock("div", {
23814
+ key: 0,
23815
+ style: normalizeStyle(getSelectionPosition.value),
23816
+ class: "superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"
23817
+ }, null, 4)) : createCommentVNode("", true)], 544)) : createCommentVNode("", true),
23818
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(documents), (doc) => {
23819
+ return openBlock(), createElementBlock("div", {
23820
+ class: "superdoc__sub-document sub-document",
23821
+ key: `${doc.id}:${doc.editorMountNonce}`,
23822
+ ref_for: true,
23823
+ ref: (el) => setSubDocumentRoot(doc, el)
23824
+ }, [
23825
+ doc.type === unref("application/pdf") ? (openBlock(), createBlock(unref(PdfViewer), {
23826
+ key: 0,
23827
+ file: doc.data,
23828
+ "file-id": doc.id,
23829
+ "initial-scale": (unref(activeZoom) ?? 100) / 100,
23830
+ config: unref(pdfConfig),
23831
+ onSelectionRaw: handlePdfSelectionRaw,
23832
+ onBypassSelection: handlePdfClick,
23833
+ onPageRendered: unref(handleWhiteboardPageReady),
23834
+ onDocumentReady: _cache[1] || (_cache[1] = ({ documentId, viewerContainer }) => handleDocumentReady(documentId, viewerContainer)),
23835
+ ref_for: true,
23836
+ ref_key: "pdfViewerRef",
23837
+ ref: pdfViewerRef
23838
+ }, null, 8, [
23839
+ "file",
23840
+ "file-id",
23841
+ "initial-scale",
23842
+ "config",
23843
+ "onPageRendered"
23844
+ ])) : createCommentVNode("", true),
23845
+ doc.type === unref("application/vnd.openxmlformats-officedocument.wordprocessingml.document") && unref(V2Ruler) && shouldShowV2Ruler(doc) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [resolvedRulerContainer.value ? (openBlock(), createBlock(Teleport, {
23846
+ key: 0,
23847
+ to: resolvedRulerContainer.value
23848
+ }, [createElementVNode("div", {
23849
+ class: "v2-ruler-host",
23850
+ style: normalizeStyle(v2RulerHostStyle.value)
23851
+ }, [createVNode(unref(V2Ruler), {
23852
+ "page-layout": unref(proxy).$superdoc.activeEditor.pageLayout,
23853
+ "measurement-unit": unref(measurementUnit),
23854
+ onPageMarginsChange: (event) => handleV2PageMarginsChange(doc, event)
23855
+ }, null, 8, [
23856
+ "page-layout",
23857
+ "measurement-unit",
23858
+ "onPageMarginsChange"
23859
+ ])], 4)], 8, ["to"])) : (openBlock(), createElementBlock("div", {
23860
+ key: 1,
23861
+ class: "v2-ruler-host",
23862
+ style: normalizeStyle(v2RulerHostStyle.value)
23863
+ }, [createVNode(unref(V2Ruler), {
23864
+ "page-layout": unref(proxy).$superdoc.activeEditor.pageLayout,
23865
+ "measurement-unit": unref(measurementUnit),
23866
+ onPageMarginsChange: (event) => handleV2PageMarginsChange(doc, event)
23867
+ }, null, 8, [
23868
+ "page-layout",
23869
+ "measurement-unit",
23870
+ "onPageMarginsChange"
23871
+ ])], 4))], 64)) : createCommentVNode("", true),
23872
+ doc.type === unref("application/vnd.openxmlformats-officedocument.wordprocessingml.document") ? (openBlock(), createBlock(unref(V2DocumentEditor), {
23873
+ key: 2,
23874
+ "file-source": doc.data,
23875
+ "document-id": doc.id,
23876
+ options: editorOptions(doc),
23877
+ "measurement-unit": unref(measurementUnit),
23878
+ onV2EditorReady,
23879
+ onV2EditorFailed,
23880
+ onV2Render,
23881
+ onV2RenderCleared,
23882
+ onV2SelectionChanged,
23883
+ onV2HostEvent: (event) => onV2HostEvent(doc, event),
23884
+ onV2LinkClick,
23885
+ onV2CommentCreated,
23886
+ onV2PageMetrics,
23887
+ onV2RenderReadiness: (payload) => onV2RenderReadiness(doc, payload),
23888
+ onV2OpenDiagnostics: (payload) => onV2OpenDiagnostics(doc, payload)
23889
+ }, null, 8, [
23890
+ "file-source",
23891
+ "document-id",
23892
+ "options",
23893
+ "measurement-unit",
23894
+ "onV2HostEvent",
23895
+ "onV2RenderReadiness",
23896
+ "onV2OpenDiagnostics"
23897
+ ])) : createCommentVNode("", true),
23898
+ doc.type === unref("text/html") ? (openBlock(), createBlock(HtmlViewer_default, {
23899
+ key: 3,
23900
+ onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
23901
+ onSelectionChange: handleSelectionChange,
23902
+ "file-source": doc.data,
23903
+ "document-id": doc.id
23904
+ }, null, 8, ["file-source", "document-id"])) : createCommentVNode("", true)
23905
+ ]);
23906
+ }), 128)),
23907
+ shouldRenderPdfWhiteboard.value ? (openBlock(), createBlock(WhiteboardLayer_default, {
23908
+ key: 1,
23909
+ class: "superdoc__whiteboard-layer",
23910
+ whiteboard: unref(whiteboard),
23911
+ pages: unref(whiteboardPages),
23912
+ "page-sizes": unref(whiteboardPageSizes),
23913
+ "page-offsets": unref(whiteboardPageOffsets),
23914
+ enabled: unref(whiteboardEnabled),
23915
+ interactive: whiteboardInteractive.value,
23916
+ opacity: unref(whiteboardOpacity)
23917
+ }, null, 8, [
23918
+ "whiteboard",
23919
+ "pages",
23920
+ "page-sizes",
23921
+ "page-offsets",
23922
+ "enabled",
23923
+ "interactive",
23924
+ "opacity"
23925
+ ])) : createCommentVNode("", true),
23926
+ shouldRenderPdfCommentAnchors.value ? (openBlock(), createBlock(PdfCommentsLayer_default, {
23927
+ key: 2,
23928
+ onAnchorActivate: handleHighlightClick
23929
+ })) : createCommentVNode("", true)
23930
+ ])
23931
+ ], 512),
23830
23932
  showCommentsSidebar.value ? (openBlock(), createElementBlock("div", {
23831
23933
  key: 1,
23832
23934
  ref_key: "rightSidebarRef",
23833
23935
  ref: rightSidebarRef,
23834
23936
  class: "superdoc__right-sidebar right-sidebar"
23835
- }, [createElementVNode("div", _hoisted_4$7, [unref(hasInitializedLocations) && (floatingComments.value.length > 0 || unref(pendingComment)) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(documentsWithConverations), (doc) => {
23937
+ }, [createElementVNode("div", _hoisted_6$4, [unref(hasInitializedLocations) && (floatingComments.value.length > 0 || unref(pendingComment)) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(documentsWithConverations), (doc) => {
23836
23938
  return openBlock(), createBlock(FloatingComments_default, {
23837
23939
  parent: layers.value,
23838
23940
  "current-document": doc
@@ -23850,7 +23952,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
23850
23952
  ], 38);
23851
23953
  };
23852
23954
  }
23853
- }, [["__scopeId", "data-v-31bb6dd9"]]);
23955
+ }, [["__scopeId", "data-v-01062725"]]);
23854
23956
  //#endregion
23855
23957
  //#region src/core/create-app.js
23856
23958
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -45017,7 +45119,7 @@ var SuperDoc = class extends import_eventemitter3.default {
45017
45119
  this.config.colors = shuffleArray(this.config.colors);
45018
45120
  this.userColorMap = /* @__PURE__ */ new Map();
45019
45121
  this.colorIndex = 0;
45020
- this.version = "2.11.0-next.8";
45122
+ this.version = "2.11.0";
45021
45123
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
45022
45124
  this.superdocId = config.superdocId || v4();
45023
45125
  this.colors = this.config.colors ?? [];