@harbour-enterprises/superdoc 0.22.0-next.8 → 0.22.0-next.9

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
- const superdoc = require("./index-BkpP-c9A.cjs");
4
+ const superdoc = require("./index-BeVpZc19.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CJUwCOxd.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-ir6efMuz.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-D6u8E2n4.cjs");
2
+ const superEditor_es = require("./super-editor.es-CKfdmK-8.cjs");
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
4
  const jszip = require("./jszip-b7l8QkfH.cjs");
5
5
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
@@ -4178,7 +4178,7 @@ const groupChanges = (changes) => {
4178
4178
  const c1 = changes[i];
4179
4179
  const c2 = changes[i + 1];
4180
4180
  const c1Key = markMetaKeys[c1.mark.type.name];
4181
- if (c1 && c2 && c1.to === c2.from) {
4181
+ if (c1 && c2 && c1.to === c2.from && c1.mark.attrs.id === c2.mark.attrs.id) {
4182
4182
  const c2Key = markMetaKeys[c2.mark.type.name];
4183
4183
  grouped.push({
4184
4184
  from: c1.from,
@@ -4223,6 +4223,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4223
4223
  const isCommentsListVisible = vue.ref(false);
4224
4224
  const editorCommentIds = vue.ref([]);
4225
4225
  const editorCommentPositions = vue.ref({});
4226
+ const isCommentHighlighted = vue.ref(false);
4226
4227
  const floatingCommentsOffset = vue.ref(0);
4227
4228
  const sortedConversations = vue.ref([]);
4228
4229
  const visibleConversations = vue.ref([]);
@@ -4501,8 +4502,8 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4501
4502
  tr.setMeta(superEditor_es.CommentsPluginKey, { type: "forceTrackChanges" });
4502
4503
  tr.setMeta(superEditor_es.TrackChangesBasePluginKey, trackChangesPayload);
4503
4504
  }
4505
+ dispatch(tr);
4504
4506
  });
4505
- dispatch(tr);
4506
4507
  };
4507
4508
  const translateCommentsForExport = () => {
4508
4509
  const processedComments = [];
@@ -4572,6 +4573,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4572
4573
  try {
4573
4574
  const normalizedContent = normalizeCommentForEditor(commentTextJson);
4574
4575
  const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
4576
+ if (!schemaContent.content.length) return null;
4575
4577
  const editor = new superEditor_es.Editor({
4576
4578
  mode: "text",
4577
4579
  isHeadless: true,
@@ -4605,6 +4607,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4605
4607
  commentsParentElement,
4606
4608
  editorCommentPositions,
4607
4609
  hasInitializedLocations,
4610
+ isCommentHighlighted,
4608
4611
  // Floating comments
4609
4612
  floatingCommentsOffset,
4610
4613
  sortedConversations,
@@ -16131,7 +16134,8 @@ const _sfc_main$c = {
16131
16134
  currentCommentText,
16132
16135
  isDebugging,
16133
16136
  editingCommentId,
16134
- editorCommentPositions
16137
+ editorCommentPositions,
16138
+ isCommentHighlighted
16135
16139
  } = storeToRefs(commentsStore);
16136
16140
  const { activeZoom } = storeToRefs(superdocStore);
16137
16141
  const isInternal = vue.ref(true);
@@ -16193,13 +16197,14 @@ const _sfc_main$c = {
16193
16197
  "track-format",
16194
16198
  "track-format-dec"
16195
16199
  ];
16196
- if (excludedClasses.some((className) => e.target.classList.contains(className))) return;
16200
+ if (excludedClasses.some((className) => e.target.classList.contains(className)) || isCommentHighlighted.value) return;
16197
16201
  if (activeComment.value === props.comment.commentId) {
16198
16202
  floatingCommentsOffset.value = 0;
16199
16203
  emit("dialog-exit");
16200
16204
  }
16201
16205
  activeComment.value = null;
16202
16206
  commentsStore.setActiveComment(proxy.$superdoc, activeComment.value);
16207
+ isCommentHighlighted.value = false;
16203
16208
  };
16204
16209
  const handleAddComment = () => {
16205
16210
  const options = {
@@ -16412,7 +16417,7 @@ const _sfc_main$c = {
16412
16417
  };
16413
16418
  }
16414
16419
  };
16415
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-dc5e6675"]]);
16420
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e07f3426"]]);
16416
16421
  const _hoisted_1$a = { class: "comments-list" };
16417
16422
  const _hoisted_2$5 = { key: 0 };
16418
16423
  const _hoisted_3$3 = { class: "comment-item" };
@@ -17409,7 +17414,7 @@ const _sfc_main = {
17409
17414
  __name: "SuperDoc",
17410
17415
  emits: ["selection-update"],
17411
17416
  setup(__props, { emit: __emit }) {
17412
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BBQm50V3.cjs")));
17417
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DyWe33pN.cjs")));
17413
17418
  const superdocStore = useSuperdocStore();
17414
17419
  const commentsStore = useCommentsStore();
17415
17420
  const {
@@ -17435,7 +17440,8 @@ const _sfc_main = {
17435
17440
  getFloatingComments,
17436
17441
  hasSyncedCollaborationComments,
17437
17442
  editorCommentPositions,
17438
- hasInitializedLocations
17443
+ hasInitializedLocations,
17444
+ isCommentHighlighted
17439
17445
  } = storeToRefs(commentsStore);
17440
17446
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
17441
17447
  const { proxy } = vue.getCurrentInstance();
@@ -17630,6 +17636,7 @@ const _sfc_main = {
17630
17636
  vue.nextTick(() => {
17631
17637
  if (pendingComment.value) return;
17632
17638
  commentsStore.setActiveComment(proxy.$superdoc, activeCommentId);
17639
+ isCommentHighlighted.value = true;
17633
17640
  });
17634
17641
  if (typeof proxy.$superdoc.config.onCommentsUpdate === "function") {
17635
17642
  proxy.$superdoc.config.onCommentsUpdate(params2);
@@ -17952,7 +17959,7 @@ const _sfc_main = {
17952
17959
  };
17953
17960
  }
17954
17961
  };
17955
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dbfba5b9"]]);
17962
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f71b1bf"]]);
17956
17963
  const createSuperdocVueApp = () => {
17957
17964
  const app = vue.createApp(App);
17958
17965
  const pinia = createPinia();
@@ -1,4 +1,4 @@
1
- import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-Bg0-F_x5.es.js";
1
+ import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BwqYS285.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CXxsqYcP.es.js";
3
3
  import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
4
4
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
@@ -4161,7 +4161,7 @@ const groupChanges = (changes) => {
4161
4161
  const c1 = changes[i];
4162
4162
  const c2 = changes[i + 1];
4163
4163
  const c1Key = markMetaKeys[c1.mark.type.name];
4164
- if (c1 && c2 && c1.to === c2.from) {
4164
+ if (c1 && c2 && c1.to === c2.from && c1.mark.attrs.id === c2.mark.attrs.id) {
4165
4165
  const c2Key = markMetaKeys[c2.mark.type.name];
4166
4166
  grouped.push({
4167
4167
  from: c1.from,
@@ -4206,6 +4206,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4206
4206
  const isCommentsListVisible = ref(false);
4207
4207
  const editorCommentIds = ref([]);
4208
4208
  const editorCommentPositions = ref({});
4209
+ const isCommentHighlighted = ref(false);
4209
4210
  const floatingCommentsOffset = ref(0);
4210
4211
  const sortedConversations = ref([]);
4211
4212
  const visibleConversations = ref([]);
@@ -4484,8 +4485,8 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4484
4485
  tr.setMeta(CommentsPluginKey, { type: "forceTrackChanges" });
4485
4486
  tr.setMeta(TrackChangesBasePluginKey, trackChangesPayload);
4486
4487
  }
4488
+ dispatch(tr);
4487
4489
  });
4488
- dispatch(tr);
4489
4490
  };
4490
4491
  const translateCommentsForExport = () => {
4491
4492
  const processedComments = [];
@@ -4555,6 +4556,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4555
4556
  try {
4556
4557
  const normalizedContent = normalizeCommentForEditor(commentTextJson);
4557
4558
  const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
4559
+ if (!schemaContent.content.length) return null;
4558
4560
  const editor = new Editor({
4559
4561
  mode: "text",
4560
4562
  isHeadless: true,
@@ -4588,6 +4590,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4588
4590
  commentsParentElement,
4589
4591
  editorCommentPositions,
4590
4592
  hasInitializedLocations,
4593
+ isCommentHighlighted,
4591
4594
  // Floating comments
4592
4595
  floatingCommentsOffset,
4593
4596
  sortedConversations,
@@ -16114,7 +16117,8 @@ const _sfc_main$c = {
16114
16117
  currentCommentText,
16115
16118
  isDebugging,
16116
16119
  editingCommentId,
16117
- editorCommentPositions
16120
+ editorCommentPositions,
16121
+ isCommentHighlighted
16118
16122
  } = storeToRefs(commentsStore);
16119
16123
  const { activeZoom } = storeToRefs(superdocStore);
16120
16124
  const isInternal = ref(true);
@@ -16176,13 +16180,14 @@ const _sfc_main$c = {
16176
16180
  "track-format",
16177
16181
  "track-format-dec"
16178
16182
  ];
16179
- if (excludedClasses.some((className) => e.target.classList.contains(className))) return;
16183
+ if (excludedClasses.some((className) => e.target.classList.contains(className)) || isCommentHighlighted.value) return;
16180
16184
  if (activeComment.value === props.comment.commentId) {
16181
16185
  floatingCommentsOffset.value = 0;
16182
16186
  emit("dialog-exit");
16183
16187
  }
16184
16188
  activeComment.value = null;
16185
16189
  commentsStore.setActiveComment(proxy.$superdoc, activeComment.value);
16190
+ isCommentHighlighted.value = false;
16186
16191
  };
16187
16192
  const handleAddComment = () => {
16188
16193
  const options = {
@@ -16395,7 +16400,7 @@ const _sfc_main$c = {
16395
16400
  };
16396
16401
  }
16397
16402
  };
16398
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-dc5e6675"]]);
16403
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e07f3426"]]);
16399
16404
  const _hoisted_1$a = { class: "comments-list" };
16400
16405
  const _hoisted_2$5 = { key: 0 };
16401
16406
  const _hoisted_3$3 = { class: "comment-item" };
@@ -17392,7 +17397,7 @@ const _sfc_main = {
17392
17397
  __name: "SuperDoc",
17393
17398
  emits: ["selection-update"],
17394
17399
  setup(__props, { emit: __emit }) {
17395
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-C1tow4Hk.es.js"));
17400
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-HN-tp5RN.es.js"));
17396
17401
  const superdocStore = useSuperdocStore();
17397
17402
  const commentsStore = useCommentsStore();
17398
17403
  const {
@@ -17418,7 +17423,8 @@ const _sfc_main = {
17418
17423
  getFloatingComments,
17419
17424
  hasSyncedCollaborationComments,
17420
17425
  editorCommentPositions,
17421
- hasInitializedLocations
17426
+ hasInitializedLocations,
17427
+ isCommentHighlighted
17422
17428
  } = storeToRefs(commentsStore);
17423
17429
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
17424
17430
  const { proxy } = getCurrentInstance();
@@ -17613,6 +17619,7 @@ const _sfc_main = {
17613
17619
  nextTick(() => {
17614
17620
  if (pendingComment.value) return;
17615
17621
  commentsStore.setActiveComment(proxy.$superdoc, activeCommentId);
17622
+ isCommentHighlighted.value = true;
17616
17623
  });
17617
17624
  if (typeof proxy.$superdoc.config.onCommentsUpdate === "function") {
17618
17625
  proxy.$superdoc.config.onCommentsUpdate(params2);
@@ -17935,7 +17942,7 @@ const _sfc_main = {
17935
17942
  };
17936
17943
  }
17937
17944
  };
17938
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dbfba5b9"]]);
17945
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f71b1bf"]]);
17939
17946
  const createSuperdocVueApp = () => {
17940
17947
  const app = createApp(App);
17941
17948
  const pinia = createPinia();
@@ -48653,28 +48653,25 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
48653
48653
  if (emitParams) editor.emit("commentsUpdate", emitParams);
48654
48654
  return newTrackedChanges;
48655
48655
  };
48656
- const getTrackedChangeText = ({ state: state2, node, mark, marks, trackedChangeType, isDeletionInsertion }) => {
48656
+ const getTrackedChangeText = ({ state: state2, nodes, mark, marks, trackedChangeType, isDeletionInsertion }) => {
48657
48657
  let trackedChangeText = "";
48658
48658
  let deletionText = "";
48659
48659
  if (trackedChangeType === TrackInsertMarkName) {
48660
- trackedChangeText = node?.text ?? "";
48660
+ trackedChangeText = nodes.reduce((acc, node) => {
48661
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
48662
+ acc += node?.text || node?.textContent || "";
48663
+ return acc;
48664
+ }, "");
48661
48665
  }
48662
48666
  if (trackedChangeType === TrackFormatMarkName) {
48663
48667
  trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
48664
48668
  }
48665
48669
  if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
48666
- deletionText = node?.text ?? "";
48667
- if (isDeletionInsertion) {
48668
- let { id } = marks.deletionMark.attrs;
48669
- let deletionNode = findNode$1(state2.doc, (node2) => {
48670
- const { marks: marks2 = [] } = node2;
48671
- const changeMarks = marks2.filter((mark2) => TRACK_CHANGE_MARKS.includes(mark2.type.name));
48672
- if (!changeMarks.length) return false;
48673
- const hasMatchingId = changeMarks.find((mark2) => mark2.attrs.id === id);
48674
- if (hasMatchingId) return true;
48675
- });
48676
- deletionText = deletionNode?.node.text ?? "";
48677
- }
48670
+ deletionText = nodes.reduce((acc, node) => {
48671
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
48672
+ acc += node?.text || node?.textContent || "";
48673
+ return acc;
48674
+ }, "");
48678
48675
  }
48679
48676
  return {
48680
48677
  deletionText,
@@ -48689,18 +48686,17 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
48689
48686
  const id = attrs.id;
48690
48687
  const node = nodes[0];
48691
48688
  const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
48692
- let existingNode;
48689
+ let nodesWithMark = [];
48693
48690
  newEditorState.doc.descendants((node2) => {
48694
48691
  const { marks: marks2 = [] } = node2;
48695
48692
  const changeMarks = marks2.filter((mark) => TRACK_CHANGE_MARKS.includes(mark.type.name));
48696
48693
  if (!changeMarks.length) return;
48697
48694
  const hasMatchingId = changeMarks.find((mark) => mark.attrs.id === id);
48698
- if (hasMatchingId) existingNode = node2;
48699
- if (existingNode) return false;
48695
+ if (hasMatchingId) nodesWithMark.push(node2);
48700
48696
  });
48701
48697
  const { deletionText, trackedChangeText } = getTrackedChangeText({
48702
48698
  state: newEditorState,
48703
- node: existingNode || node,
48699
+ nodes: nodesWithMark.length ? nodesWithMark : [node],
48704
48700
  mark: trackedMark,
48705
48701
  marks,
48706
48702
  trackedChangeType,
@@ -48730,14 +48726,6 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
48730
48726
  else if (event === "update") params2.event = comments_module_events.UPDATE;
48731
48727
  return params2;
48732
48728
  };
48733
- function findNode$1(node, predicate) {
48734
- let found2 = null;
48735
- node.descendants((node2, pos) => {
48736
- if (predicate(node2)) found2 = { node: node2, pos };
48737
- if (found2) return false;
48738
- });
48739
- return found2;
48740
- }
48741
48729
  function findRangeById(doc2, id) {
48742
48730
  let from2 = null, to = null;
48743
48731
  doc2.descendants((node, pos) => {
@@ -48670,28 +48670,25 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
48670
48670
  if (emitParams) editor.emit("commentsUpdate", emitParams);
48671
48671
  return newTrackedChanges;
48672
48672
  };
48673
- const getTrackedChangeText = ({ state: state2, node, mark, marks, trackedChangeType, isDeletionInsertion }) => {
48673
+ const getTrackedChangeText = ({ state: state2, nodes, mark, marks, trackedChangeType, isDeletionInsertion }) => {
48674
48674
  let trackedChangeText = "";
48675
48675
  let deletionText = "";
48676
48676
  if (trackedChangeType === TrackInsertMarkName) {
48677
- trackedChangeText = node?.text ?? "";
48677
+ trackedChangeText = nodes.reduce((acc, node) => {
48678
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
48679
+ acc += node?.text || node?.textContent || "";
48680
+ return acc;
48681
+ }, "");
48678
48682
  }
48679
48683
  if (trackedChangeType === TrackFormatMarkName) {
48680
48684
  trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
48681
48685
  }
48682
48686
  if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
48683
- deletionText = node?.text ?? "";
48684
- if (isDeletionInsertion) {
48685
- let { id } = marks.deletionMark.attrs;
48686
- let deletionNode = findNode$1(state2.doc, (node2) => {
48687
- const { marks: marks2 = [] } = node2;
48688
- const changeMarks = marks2.filter((mark2) => TRACK_CHANGE_MARKS.includes(mark2.type.name));
48689
- if (!changeMarks.length) return false;
48690
- const hasMatchingId = changeMarks.find((mark2) => mark2.attrs.id === id);
48691
- if (hasMatchingId) return true;
48692
- });
48693
- deletionText = deletionNode?.node.text ?? "";
48694
- }
48687
+ deletionText = nodes.reduce((acc, node) => {
48688
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
48689
+ acc += node?.text || node?.textContent || "";
48690
+ return acc;
48691
+ }, "");
48695
48692
  }
48696
48693
  return {
48697
48694
  deletionText,
@@ -48706,18 +48703,17 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
48706
48703
  const id = attrs.id;
48707
48704
  const node = nodes[0];
48708
48705
  const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
48709
- let existingNode;
48706
+ let nodesWithMark = [];
48710
48707
  newEditorState.doc.descendants((node2) => {
48711
48708
  const { marks: marks2 = [] } = node2;
48712
48709
  const changeMarks = marks2.filter((mark) => TRACK_CHANGE_MARKS.includes(mark.type.name));
48713
48710
  if (!changeMarks.length) return;
48714
48711
  const hasMatchingId = changeMarks.find((mark) => mark.attrs.id === id);
48715
- if (hasMatchingId) existingNode = node2;
48716
- if (existingNode) return false;
48712
+ if (hasMatchingId) nodesWithMark.push(node2);
48717
48713
  });
48718
48714
  const { deletionText, trackedChangeText } = getTrackedChangeText({
48719
48715
  state: newEditorState,
48720
- node: existingNode || node,
48716
+ nodes: nodesWithMark.length ? nodesWithMark : [node],
48721
48717
  mark: trackedMark,
48722
48718
  marks,
48723
48719
  trackedChangeType,
@@ -48747,14 +48743,6 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
48747
48743
  else if (event === "update") params2.event = comments_module_events.UPDATE;
48748
48744
  return params2;
48749
48745
  };
48750
- function findNode$1(node, predicate) {
48751
- let found2 = null;
48752
- node.descendants((node2, pos) => {
48753
- if (predicate(node2)) found2 = { node: node2, pos };
48754
- if (found2) return false;
48755
- });
48756
- return found2;
48757
- }
48758
48746
  function findRangeById(doc2, id) {
48759
48747
  let from2 = null, to = null;
48760
48748
  doc2.descendants((node, pos) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/types/index.js"],"names":[],"mappings":";;;;;;;UAEc,MAAM;;;;WACN,MAAM;;;;YACN,MAAM,GAAG,IAAI;;;;;;;;;cAKb,OAAO;;;;iBACP,MAAM;;;;eACN,MAAM;;;;sBACN,MAAM;;;;;;SAKN,MAAM;;;;UACN,MAAM;;;;WACN,IAAI,GAAG,IAAI,GAAG,IAAI;;;;WAClB,MAAM;;;;UACN,MA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;;;;wBACP,CAAS,IAAI,EAAJ,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC;;;;eAC/B,IAAI;;;;aACJ,OAAO;;;;gCACP,OAAO;;;;;;;;yBAEP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;cACN,OAAO"}
@@ -29,6 +29,7 @@ export const useCommentsStore: import("pinia").StoreDefinition<"comments", Pick<
29
29
  commentsParentElement: import("vue").Ref<any, any>;
30
30
  editorCommentPositions: import("vue").Ref<{}, {}>;
31
31
  hasInitializedLocations: import("vue").Ref<boolean, boolean>;
32
+ isCommentHighlighted: import("vue").Ref<boolean, boolean>;
32
33
  floatingCommentsOffset: import("vue").Ref<number, number>;
33
34
  sortedConversations: import("vue").Ref<any[], any[]>;
34
35
  visibleConversations: import("vue").Ref<any[], any[]>;
@@ -79,7 +80,7 @@ export const useCommentsStore: import("pinia").StoreDefinition<"comments", Pick<
79
80
  superdoc: any;
80
81
  params: any;
81
82
  }) => void;
82
- }, "COMMENT_EVENTS" | "isDebugging" | "hasInitializedComments" | "hasSyncedCollaborationComments" | "editingCommentId" | "activeComment" | "commentDialogs" | "overlappingComments" | "overlappedIds" | "suppressInternalExternal" | "pendingComment" | "currentCommentText" | "commentsList" | "isCommentsListVisible" | "generalCommentIds" | "editorCommentIds" | "commentsParentElement" | "editorCommentPositions" | "hasInitializedLocations" | "floatingCommentsOffset" | "sortedConversations" | "visibleConversations" | "skipSelectionUpdate" | "isFloatingCommentsReady">, Pick<{
83
+ }, "COMMENT_EVENTS" | "isDebugging" | "hasInitializedComments" | "hasSyncedCollaborationComments" | "editingCommentId" | "activeComment" | "commentDialogs" | "overlappingComments" | "overlappedIds" | "suppressInternalExternal" | "pendingComment" | "currentCommentText" | "commentsList" | "isCommentsListVisible" | "generalCommentIds" | "editorCommentIds" | "commentsParentElement" | "editorCommentPositions" | "hasInitializedLocations" | "isCommentHighlighted" | "floatingCommentsOffset" | "sortedConversations" | "visibleConversations" | "skipSelectionUpdate" | "isFloatingCommentsReady">, Pick<{
83
84
  COMMENT_EVENTS: Readonly<{
84
85
  RESOLVED: "resolved";
85
86
  NEW: "new";
@@ -110,6 +111,7 @@ export const useCommentsStore: import("pinia").StoreDefinition<"comments", Pick<
110
111
  commentsParentElement: import("vue").Ref<any, any>;
111
112
  editorCommentPositions: import("vue").Ref<{}, {}>;
112
113
  hasInitializedLocations: import("vue").Ref<boolean, boolean>;
114
+ isCommentHighlighted: import("vue").Ref<boolean, boolean>;
113
115
  floatingCommentsOffset: import("vue").Ref<number, number>;
114
116
  sortedConversations: import("vue").Ref<any[], any[]>;
115
117
  visibleConversations: import("vue").Ref<any[], any[]>;
@@ -191,6 +193,7 @@ export const useCommentsStore: import("pinia").StoreDefinition<"comments", Pick<
191
193
  commentsParentElement: import("vue").Ref<any, any>;
192
194
  editorCommentPositions: import("vue").Ref<{}, {}>;
193
195
  hasInitializedLocations: import("vue").Ref<boolean, boolean>;
196
+ isCommentHighlighted: import("vue").Ref<boolean, boolean>;
194
197
  floatingCommentsOffset: import("vue").Ref<number, number>;
195
198
  sortedConversations: import("vue").Ref<any[], any[]>;
196
199
  visibleConversations: import("vue").Ref<any[], any[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"comments-store.d.ts","sourceRoot":"","sources":["../../src/stores/comments-store.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA2Ce,IAAI;qBAiBN,MAAM;0CAWN,MAAM,GAAG,SAAS,GAAG,IAAI,KACvB,IAAI;;;;;;gFAwLd;QAAuB,SAAS;QACT,UAAU;QACV,eAAe;KACtC;;wCAoDA;QAAuB,QAAQ;KAC/B,KAAU,IAAI;sCAyEJ,IAAI;;;;;6CAzFJ,IAAI;4EAsGd;QAAsB,QAAQ;QACP,UAAU;KACjC,KAAU,IAAI;;+DAwHJ,IAAI;sDAxad;QAAuB,QAAQ;QACR,MAAM;KAC7B,KAAU,IAAI;;;;;;;;;;;;;;;;;;;;;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