@harbour-enterprises/superdoc 0.22.0-next.7 → 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.
Files changed (29) hide show
  1. package/dist/chunks/{PdfViewer-Db-KJKqC.cjs → PdfViewer-DyWe33pN.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-DUbqS8Es.es.js → PdfViewer-HN-tp5RN.es.js} +1 -1
  3. package/dist/chunks/{index-CUTF_PqT.cjs → index-BeVpZc19.cjs} +16 -9
  4. package/dist/chunks/{index-BobTY60h.es.js → index-ir6efMuz.es.js} +16 -9
  5. package/dist/chunks/{super-editor.es-68D48VWo.es.js → super-editor.es-BwqYS285.es.js} +23 -28
  6. package/dist/chunks/{super-editor.es-Csy-KPwx.cjs → super-editor.es-CKfdmK-8.cjs} +23 -28
  7. package/dist/core/types/index.d.ts.map +1 -1
  8. package/dist/stores/comments-store.d.ts +4 -1
  9. package/dist/stores/comments-store.d.ts.map +1 -1
  10. package/dist/style.css +47 -44
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-D9kK7Smo.js → converter-BgedUNCW.js} +9 -2
  13. package/dist/super-editor/chunks/{docx-zipper-D8HnWWpv.js → docx-zipper-ByLK3trM.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-IHdqoVXS.js → editor-CFqh_xBx.js} +16 -28
  15. package/dist/super-editor/chunks/{toolbar-CZuqQ0AA.js → toolbar-DdfyWgZF.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/style.css +3 -0
  21. package/dist/super-editor/super-editor.es.js +6 -6
  22. package/dist/super-editor/toolbar.es.js +2 -2
  23. package/dist/super-editor.cjs +1 -1
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.cjs +2 -2
  26. package/dist/superdoc.es.js +2 -2
  27. package/dist/superdoc.umd.js +37 -35
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
@@ -39980,8 +39980,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39980
39980
  return { nodes: [], consumed: 0 };
39981
39981
  }
39982
39982
  const [pNode] = nodes;
39983
- const run2 = pNode.elements?.find((el) => el.name === "w:r");
39984
- const pict = run2?.elements?.find((el) => el.name === "w:pict");
39983
+ const runs = pNode.elements?.filter((el) => el.name === "w:r") || [];
39984
+ let pict = null;
39985
+ for (const run2 of runs) {
39986
+ const foundPict = run2.elements?.find((el) => el.name === "w:pict");
39987
+ if (foundPict) {
39988
+ pict = foundPict;
39989
+ break;
39990
+ }
39991
+ }
39985
39992
  if (!pict) {
39986
39993
  return { nodes: [], consumed: 0 };
39987
39994
  }
@@ -56361,28 +56368,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56361
56368
  if (emitParams) editor.emit("commentsUpdate", emitParams);
56362
56369
  return newTrackedChanges;
56363
56370
  };
56364
- const getTrackedChangeText = ({ state: state2, node, mark, marks, trackedChangeType, isDeletionInsertion }) => {
56371
+ const getTrackedChangeText = ({ state: state2, nodes, mark, marks, trackedChangeType, isDeletionInsertion }) => {
56365
56372
  let trackedChangeText = "";
56366
56373
  let deletionText = "";
56367
56374
  if (trackedChangeType === TrackInsertMarkName) {
56368
- trackedChangeText = node?.text ?? "";
56375
+ trackedChangeText = nodes.reduce((acc, node) => {
56376
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
56377
+ acc += node?.text || node?.textContent || "";
56378
+ return acc;
56379
+ }, "");
56369
56380
  }
56370
56381
  if (trackedChangeType === TrackFormatMarkName) {
56371
56382
  trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
56372
56383
  }
56373
56384
  if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
56374
- deletionText = node?.text ?? "";
56375
- if (isDeletionInsertion) {
56376
- let { id } = marks.deletionMark.attrs;
56377
- let deletionNode = findNode$1(state2.doc, (node2) => {
56378
- const { marks: marks2 = [] } = node2;
56379
- const changeMarks = marks2.filter((mark2) => TRACK_CHANGE_MARKS.includes(mark2.type.name));
56380
- if (!changeMarks.length) return false;
56381
- const hasMatchingId = changeMarks.find((mark2) => mark2.attrs.id === id);
56382
- if (hasMatchingId) return true;
56383
- });
56384
- deletionText = deletionNode?.node.text ?? "";
56385
- }
56385
+ deletionText = nodes.reduce((acc, node) => {
56386
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
56387
+ acc += node?.text || node?.textContent || "";
56388
+ return acc;
56389
+ }, "");
56386
56390
  }
56387
56391
  return {
56388
56392
  deletionText,
@@ -56397,18 +56401,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56397
56401
  const id = attrs.id;
56398
56402
  const node = nodes[0];
56399
56403
  const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
56400
- let existingNode;
56404
+ let nodesWithMark = [];
56401
56405
  newEditorState.doc.descendants((node2) => {
56402
56406
  const { marks: marks2 = [] } = node2;
56403
56407
  const changeMarks = marks2.filter((mark) => TRACK_CHANGE_MARKS.includes(mark.type.name));
56404
56408
  if (!changeMarks.length) return;
56405
56409
  const hasMatchingId = changeMarks.find((mark) => mark.attrs.id === id);
56406
- if (hasMatchingId) existingNode = node2;
56407
- if (existingNode) return false;
56410
+ if (hasMatchingId) nodesWithMark.push(node2);
56408
56411
  });
56409
56412
  const { deletionText, trackedChangeText } = getTrackedChangeText({
56410
56413
  state: newEditorState,
56411
- node: existingNode || node,
56414
+ nodes: nodesWithMark.length ? nodesWithMark : [node],
56412
56415
  mark: trackedMark,
56413
56416
  marks,
56414
56417
  trackedChangeType,
@@ -56438,14 +56441,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56438
56441
  else if (event === "update") params2.event = comments_module_events$1.UPDATE;
56439
56442
  return params2;
56440
56443
  };
56441
- function findNode$1(node, predicate) {
56442
- let found2 = null;
56443
- node.descendants((node2, pos) => {
56444
- if (predicate(node2)) found2 = { node: node2, pos };
56445
- if (found2) return false;
56446
- });
56447
- return found2;
56448
- }
56449
56444
  function findRangeById(doc2, id) {
56450
56445
  let from2 = null, to = null;
56451
56446
  doc2.descendants((node, pos) => {
@@ -96731,7 +96726,7 @@ ${reason}`);
96731
96726
  const c1 = changes[i2];
96732
96727
  const c2 = changes[i2 + 1];
96733
96728
  const c1Key = markMetaKeys[c1.mark.type.name];
96734
- if (c1 && c2 && c1.to === c2.from) {
96729
+ if (c1 && c2 && c1.to === c2.from && c1.mark.attrs.id === c2.mark.attrs.id) {
96735
96730
  const c2Key = markMetaKeys[c2.mark.type.name];
96736
96731
  grouped.push({
96737
96732
  from: c1.from,
@@ -96776,6 +96771,7 @@ ${reason}`);
96776
96771
  const isCommentsListVisible = ref$1(false);
96777
96772
  const editorCommentIds = ref$1([]);
96778
96773
  const editorCommentPositions = ref$1({});
96774
+ const isCommentHighlighted = ref$1(false);
96779
96775
  const floatingCommentsOffset = ref$1(0);
96780
96776
  const sortedConversations = ref$1([]);
96781
96777
  const visibleConversations = ref$1([]);
@@ -97054,8 +97050,8 @@ ${reason}`);
97054
97050
  tr.setMeta(CommentsPluginKey, { type: "forceTrackChanges" });
97055
97051
  tr.setMeta(TrackChangesBasePluginKey, trackChangesPayload);
97056
97052
  }
97053
+ dispatch(tr);
97057
97054
  });
97058
- dispatch(tr);
97059
97055
  };
97060
97056
  const translateCommentsForExport = () => {
97061
97057
  const processedComments = [];
@@ -97125,6 +97121,7 @@ ${reason}`);
97125
97121
  try {
97126
97122
  const normalizedContent = normalizeCommentForEditor(commentTextJson);
97127
97123
  const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
97124
+ if (!schemaContent.content.length) return null;
97128
97125
  const editor = new Editor({
97129
97126
  mode: "text",
97130
97127
  isHeadless: true,
@@ -97158,6 +97155,7 @@ ${reason}`);
97158
97155
  commentsParentElement,
97159
97156
  editorCommentPositions,
97160
97157
  hasInitializedLocations,
97158
+ isCommentHighlighted,
97161
97159
  // Floating comments
97162
97160
  floatingCommentsOffset,
97163
97161
  sortedConversations,
@@ -108852,7 +108850,8 @@ ${style2}
108852
108850
  currentCommentText,
108853
108851
  isDebugging: isDebugging2,
108854
108852
  editingCommentId,
108855
- editorCommentPositions
108853
+ editorCommentPositions,
108854
+ isCommentHighlighted
108856
108855
  } = storeToRefs(commentsStore);
108857
108856
  const { activeZoom } = storeToRefs(superdocStore);
108858
108857
  const isInternal = ref$1(true);
@@ -108914,13 +108913,14 @@ ${style2}
108914
108913
  "track-format",
108915
108914
  "track-format-dec"
108916
108915
  ];
108917
- if (excludedClasses.some((className) => e.target.classList.contains(className))) return;
108916
+ if (excludedClasses.some((className) => e.target.classList.contains(className)) || isCommentHighlighted.value) return;
108918
108917
  if (activeComment.value === props.comment.commentId) {
108919
108918
  floatingCommentsOffset.value = 0;
108920
108919
  emit2("dialog-exit");
108921
108920
  }
108922
108921
  activeComment.value = null;
108923
108922
  commentsStore.setActiveComment(proxy.$superdoc, activeComment.value);
108923
+ isCommentHighlighted.value = false;
108924
108924
  };
108925
108925
  const handleAddComment = () => {
108926
108926
  const options = {
@@ -109133,7 +109133,7 @@ ${style2}
109133
109133
  };
109134
109134
  }
109135
109135
  };
109136
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-dc5e6675"]]);
109136
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-e07f3426"]]);
109137
109137
  const _hoisted_1$b = { class: "comments-list" };
109138
109138
  const _hoisted_2$5 = { key: 0 };
109139
109139
  const _hoisted_3$3 = { class: "comment-item" };
@@ -110156,7 +110156,8 @@ ${style2}
110156
110156
  getFloatingComments,
110157
110157
  hasSyncedCollaborationComments,
110158
110158
  editorCommentPositions,
110159
- hasInitializedLocations
110159
+ hasInitializedLocations,
110160
+ isCommentHighlighted
110160
110161
  } = storeToRefs(commentsStore);
110161
110162
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
110162
110163
  const { proxy } = getCurrentInstance();
@@ -110351,6 +110352,7 @@ ${style2}
110351
110352
  nextTick(() => {
110352
110353
  if (pendingComment.value) return;
110353
110354
  commentsStore.setActiveComment(proxy.$superdoc, activeCommentId);
110355
+ isCommentHighlighted.value = true;
110354
110356
  });
110355
110357
  if (typeof proxy.$superdoc.config.onCommentsUpdate === "function") {
110356
110358
  proxy.$superdoc.config.onCommentsUpdate(params2);
@@ -110673,7 +110675,7 @@ ${style2}
110673
110675
  };
110674
110676
  }
110675
110677
  };
110676
- const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-dbfba5b9"]]);
110678
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3f71b1bf"]]);
110677
110679
  const createSuperdocVueApp = () => {
110678
110680
  const app = createApp(App);
110679
110681
  const pinia = createPinia();