@harbour-enterprises/superdoc 1.3.1-next.1 → 1.3.1-next.3

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.
@@ -35842,9 +35842,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35842
35842
  const updateCommentsExtendedXml = (comments = [], commentsExtendedXml) => {
35843
35843
  const xmlCopy = carbonCopy(commentsExtendedXml);
35844
35844
  const commentsEx = comments.map((comment2) => {
35845
+ const isResolved = comment2.resolvedTime || comment2.isDone;
35845
35846
  const attributes = {
35846
35847
  "w15:paraId": comment2.commentParaId,
35847
- "w15:done": comment2.resolvedTime ? "1" : "0"
35848
+ "w15:done": isResolved ? "1" : "0"
35848
35849
  };
35849
35850
  const parentId = comment2.parentCommentId;
35850
35851
  if (parentId) {
@@ -36435,7 +36436,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36435
36436
  static getStoredSuperdocVersion(docx) {
36436
36437
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
36437
36438
  }
36438
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.3.1-next.1") {
36439
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.3.1-next.3") {
36439
36440
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
36440
36441
  }
36441
36442
  /**
@@ -49888,6 +49889,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
49888
49889
  if (from2 === null || pos < from2) from2 = pos;
49889
49890
  if (to === null || pos + node2.nodeSize > to) to = pos + node2.nodeSize;
49890
49891
  }
49892
+ if (node2.type.name === "commentRangeStart" && node2.attrs["w:id"] === id) {
49893
+ from2 = pos;
49894
+ }
49895
+ if (node2.type.name === "commentRangeEnd" && node2.attrs["w:id"] === id) {
49896
+ to = pos;
49897
+ }
49891
49898
  });
49892
49899
  return from2 !== null && to !== null ? { from: from2, to } : null;
49893
49900
  }
@@ -62245,7 +62252,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62245
62252
  return false;
62246
62253
  }
62247
62254
  };
62248
- const summaryVersion = "1.3.1-next.1";
62255
+ const summaryVersion = "1.3.1-next.3";
62249
62256
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
62250
62257
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
62251
62258
  function mapAttributes(attrs) {
@@ -64878,7 +64885,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64878
64885
  * Process collaboration migrations
64879
64886
  */
64880
64887
  processCollaborationMigrations() {
64881
- console.debug("[checkVersionMigrations] Current editor version", "1.3.1-next.1");
64888
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.1-next.3");
64882
64889
  if (!this.options.ydoc) return;
64883
64890
  const metaMap = this.options.ydoc.getMap("meta");
64884
64891
  let docVersion = metaMap.get("version");
@@ -71894,6 +71901,7 @@ ${l}
71894
71901
  this.layoutVersion = 0;
71895
71902
  this.layoutEpoch = 0;
71896
71903
  this.processedLayoutVersion = -1;
71904
+ this.currentMapping = null;
71897
71905
  this.onScrollHandler = null;
71898
71906
  this.onWindowScrollHandler = null;
71899
71907
  this.onResizeHandler = null;
@@ -71999,7 +72007,7 @@ ${l}
71999
72007
  this.blockLookup = nextLookup;
72000
72008
  this.changedBlocks = changed;
72001
72009
  }
72002
- paint(layout, mount2) {
72010
+ paint(layout, mount2, mapping) {
72003
72011
  if (!(mount2 instanceof HTMLElement)) {
72004
72012
  throw new Error("DomPainter.paint requires a valid HTMLElement mount");
72005
72013
  }
@@ -72008,6 +72016,13 @@ ${l}
72008
72016
  throw new Error("DomPainter.paint requires a DOM-like document");
72009
72017
  }
72010
72018
  this.doc = doc2;
72019
+ const isSimpleTransaction = mapping && mapping.maps.length === 1;
72020
+ if (mapping && !isSimpleTransaction) {
72021
+ this.blockLookup.forEach((_2, id) => this.changedBlocks.add(id));
72022
+ this.currentMapping = null;
72023
+ } else {
72024
+ this.currentMapping = mapping ?? null;
72025
+ }
72011
72026
  ensurePrintStyles(doc2);
72012
72027
  ensureLinkStyles(doc2);
72013
72028
  ensureTrackChangeStyles(doc2);
@@ -72034,6 +72049,7 @@ ${l}
72034
72049
  this.currentLayout = layout;
72035
72050
  this.pageStates = [];
72036
72051
  this.changedBlocks.clear();
72052
+ this.currentMapping = null;
72037
72053
  return;
72038
72054
  }
72039
72055
  if (mode === "book") {
@@ -72042,6 +72058,7 @@ ${l}
72042
72058
  this.currentLayout = layout;
72043
72059
  this.pageStates = [];
72044
72060
  this.changedBlocks.clear();
72061
+ this.currentMapping = null;
72045
72062
  return;
72046
72063
  }
72047
72064
  applyStyles$2(mount2, containerStyles);
@@ -72050,6 +72067,7 @@ ${l}
72050
72067
  this.renderVirtualized(layout, mount2);
72051
72068
  this.currentLayout = layout;
72052
72069
  this.changedBlocks.clear();
72070
+ this.currentMapping = null;
72053
72071
  return;
72054
72072
  }
72055
72073
  mount2.style.gap = `${this.pageGap}px`;
@@ -72060,6 +72078,7 @@ ${l}
72060
72078
  }
72061
72079
  this.currentLayout = layout;
72062
72080
  this.changedBlocks.clear();
72081
+ this.currentMapping = null;
72063
72082
  }
72064
72083
  // ----------------
72065
72084
  // Virtualized path
@@ -72591,6 +72610,8 @@ ${l}
72591
72610
  pageEl.replaceChild(replacement, current.element);
72592
72611
  current.element = replacement;
72593
72612
  current.signature = fragmentSignature(fragment, this.blockLookup);
72613
+ } else if (this.currentMapping) {
72614
+ this.updatePositionAttributes(current.element, this.currentMapping);
72594
72615
  }
72595
72616
  this.updateFragmentElement(current.element, fragment, contextBase.section);
72596
72617
  current.fragment = fragment;
@@ -72619,6 +72640,45 @@ ${l}
72619
72640
  state.fragments = nextFragments;
72620
72641
  this.renderDecorationsForPage(pageEl, page);
72621
72642
  }
72643
+ /**
72644
+ * Updates data-pm-start/data-pm-end attributes on all elements within a fragment
72645
+ * using the transaction's mapping. Skips header/footer content (separate PM coordinate space).
72646
+ * Also skips fragments that end before the edit point (their positions don't change).
72647
+ */
72648
+ updatePositionAttributes(fragmentEl, mapping) {
72649
+ if (fragmentEl.closest(".superdoc-page-header, .superdoc-page-footer")) {
72650
+ return;
72651
+ }
72652
+ try {
72653
+ const fragEnd = fragmentEl.dataset.pmEnd;
72654
+ if (fragEnd !== void 0 && fragEnd !== "") {
72655
+ const endNum = Number(fragEnd);
72656
+ if (Number.isFinite(endNum) && mapping.map(endNum, -1) === endNum) {
72657
+ return;
72658
+ }
72659
+ }
72660
+ const elements = fragmentEl.querySelectorAll("[data-pm-start], [data-pm-end]");
72661
+ const allElements = [fragmentEl, ...Array.from(elements)];
72662
+ for (const el of allElements) {
72663
+ const oldStart = el.dataset.pmStart;
72664
+ const oldEnd = el.dataset.pmEnd;
72665
+ if (oldStart !== void 0 && oldStart !== "") {
72666
+ const num = Number(oldStart);
72667
+ if (Number.isFinite(num)) {
72668
+ el.dataset.pmStart = String(mapping.map(num));
72669
+ }
72670
+ }
72671
+ if (oldEnd !== void 0 && oldEnd !== "") {
72672
+ const num = Number(oldEnd);
72673
+ if (Number.isFinite(num)) {
72674
+ el.dataset.pmEnd = String(mapping.map(num, -1));
72675
+ }
72676
+ }
72677
+ }
72678
+ } catch (error) {
72679
+ console.error("Error updating position attributes with mapping:", error);
72680
+ }
72681
+ }
72622
72682
  createPageState(page, pageSize) {
72623
72683
  if (!this.doc) {
72624
72684
  throw new Error("DomPainter.createPageState requires a document");
@@ -74996,8 +75056,6 @@ ${l}
74996
75056
  base2,
74997
75057
  fragment.fromLine,
74998
75058
  fragment.toLine,
74999
- fragment.pmStart ?? "",
75000
- fragment.pmEnd ?? "",
75001
75059
  fragment.continuesFromPrev ? 1 : 0,
75002
75060
  fragment.continuesOnNext ? 1 : 0,
75003
75061
  fragment.markerWidth ?? ""
@@ -75089,16 +75147,15 @@ ${l}
75089
75147
  imgRun.distTop ?? "",
75090
75148
  imgRun.distBottom ?? "",
75091
75149
  imgRun.distLeft ?? "",
75092
- imgRun.distRight ?? "",
75093
- imgRun.pmStart ?? "",
75094
- imgRun.pmEnd ?? ""
75150
+ imgRun.distRight ?? ""
75151
+ // Note: pmStart/pmEnd intentionally excluded to prevent O(n) change detection
75095
75152
  ].join(",");
75096
75153
  }
75097
75154
  if (run2.kind === "lineBreak") {
75098
- return ["linebreak", run2.pmStart ?? "", run2.pmEnd ?? ""].join(",");
75155
+ return "linebreak";
75099
75156
  }
75100
75157
  if (run2.kind === "tab") {
75101
- return [run2.text ?? "", "tab", run2.pmStart ?? "", run2.pmEnd ?? ""].join(",");
75158
+ return [run2.text ?? "", "tab"].join(",");
75102
75159
  }
75103
75160
  const textRun = run2;
75104
75161
  return [
@@ -75114,8 +75171,7 @@ ${l}
75114
75171
  textRun.strike ? 1 : 0,
75115
75172
  textRun.highlight ?? "",
75116
75173
  textRun.letterSpacing != null ? textRun.letterSpacing : "",
75117
- textRun.pmStart ?? "",
75118
- textRun.pmEnd ?? "",
75174
+ // Note: pmStart/pmEnd intentionally excluded to prevent O(n) change detection
75119
75175
  textRun.token ?? "",
75120
75176
  // Tracked changes - force re-render when added or removed tracked change
75121
75177
  textRun.trackedChange ? 1 : 0,
@@ -75571,8 +75627,8 @@ ${l}
75571
75627
  ruler: options.ruler
75572
75628
  });
75573
75629
  return {
75574
- paint(layout, mount2) {
75575
- painter.paint(layout, mount2);
75630
+ paint(layout, mount2, mapping) {
75631
+ painter.paint(layout, mount2, mapping);
75576
75632
  },
75577
75633
  setData(blocks2, measures, headerBlocks, headerMeasures, footerBlocks, footerMeasures) {
75578
75634
  painter.setData(blocks2, measures, headerBlocks, headerMeasures, footerBlocks, footerMeasures);
@@ -78439,8 +78495,15 @@ ${l}
78439
78495
  } else if (vRelativeFrom === "paragraph") {
78440
78496
  const baseAnchorY = state.cursorY;
78441
78497
  const firstLineHeight = measure.lines?.[0]?.lineHeight ?? 0;
78442
- const paragraphAdjustment = firstLineHeight / 2;
78443
- anchorY = baseAnchorY + paragraphAdjustment + offsetV;
78498
+ if (alignV === "top") {
78499
+ anchorY = baseAnchorY + offsetV;
78500
+ } else if (alignV === "bottom") {
78501
+ anchorY = baseAnchorY + firstLineHeight - imageHeight + offsetV;
78502
+ } else if (alignV === "center") {
78503
+ anchorY = baseAnchorY + (firstLineHeight - imageHeight) / 2 + offsetV;
78504
+ } else {
78505
+ anchorY = baseAnchorY + offsetV;
78506
+ }
78444
78507
  } else {
78445
78508
  const baseAnchorY = state.cursorY;
78446
78509
  anchorY = baseAnchorY + offsetV;
@@ -79501,6 +79564,13 @@ ${l}
79501
79564
  function collectAnchoredDrawings(blocks2, measures) {
79502
79565
  const map2 = /* @__PURE__ */ new Map();
79503
79566
  const len = Math.min(blocks2.length, measures.length);
79567
+ const paragraphIndexById = /* @__PURE__ */ new Map();
79568
+ for (let i2 = 0; i2 < len; i2 += 1) {
79569
+ const block = blocks2[i2];
79570
+ if (block.kind === "paragraph") {
79571
+ paragraphIndexById.set(block.id, i2);
79572
+ }
79573
+ }
79504
79574
  const nearestPrevParagraph = (fromIndex) => {
79505
79575
  for (let i2 = fromIndex - 1; i2 >= 0; i2 -= 1) {
79506
79576
  if (blocks2[i2].kind === "paragraph") return i2;
@@ -79527,7 +79597,11 @@ ${l}
79527
79597
  if (isPageRelativeAnchor(drawingBlock)) {
79528
79598
  continue;
79529
79599
  }
79530
- let anchorParaIndex = nearestPrevParagraph(i2);
79600
+ const anchorParagraphId = typeof drawingBlock.attrs === "object" && drawingBlock.attrs ? drawingBlock.attrs.anchorParagraphId : void 0;
79601
+ let anchorParaIndex = typeof anchorParagraphId === "string" ? paragraphIndexById.get(anchorParagraphId) ?? null : null;
79602
+ if (anchorParaIndex == null) {
79603
+ anchorParaIndex = nearestPrevParagraph(i2);
79604
+ }
79531
79605
  if (anchorParaIndex == null) anchorParaIndex = nearestNextParagraph(i2);
79532
79606
  if (anchorParaIndex == null) continue;
79533
79607
  const list2 = map2.get(anchorParaIndex) ?? [];
@@ -79538,6 +79612,13 @@ ${l}
79538
79612
  }
79539
79613
  function collectAnchoredTables(blocks2, measures) {
79540
79614
  const map2 = /* @__PURE__ */ new Map();
79615
+ const paragraphIndexById = /* @__PURE__ */ new Map();
79616
+ for (let i2 = 0; i2 < blocks2.length; i2 += 1) {
79617
+ const block = blocks2[i2];
79618
+ if (block.kind === "paragraph") {
79619
+ paragraphIndexById.set(block.id, i2);
79620
+ }
79621
+ }
79541
79622
  const nearestPrevParagraph = (fromIndex) => {
79542
79623
  for (let i2 = fromIndex - 1; i2 >= 0; i2 -= 1) {
79543
79624
  if (blocks2[i2].kind === "paragraph") return i2;
@@ -79557,7 +79638,11 @@ ${l}
79557
79638
  const tableBlock = block;
79558
79639
  const tableMeasure = measure;
79559
79640
  if (!tableBlock.anchor?.isAnchored) continue;
79560
- let anchorParaIndex = nearestPrevParagraph(i2);
79641
+ const anchorParagraphId = typeof tableBlock.attrs === "object" && tableBlock.attrs ? tableBlock.attrs.anchorParagraphId : void 0;
79642
+ let anchorParaIndex = typeof anchorParagraphId === "string" ? paragraphIndexById.get(anchorParagraphId) ?? null : null;
79643
+ if (anchorParaIndex == null) {
79644
+ anchorParaIndex = nearestPrevParagraph(i2);
79645
+ }
79561
79646
  if (anchorParaIndex == null) anchorParaIndex = nearestNextParagraph(i2);
79562
79647
  if (anchorParaIndex == null) continue;
79563
79648
  const list2 = map2.get(anchorParaIndex) ?? [];
@@ -91907,6 +91992,20 @@ ${l}
91907
91992
  let partIndex = 0;
91908
91993
  let tabOrdinal = 0;
91909
91994
  const nextId = () => partIndex === 0 ? baseBlockId : `${baseBlockId}-${partIndex}`;
91995
+ const attachAnchorParagraphId = (block, anchorParagraphId) => {
91996
+ const applicableKinds = /* @__PURE__ */ new Set(["drawing", "image", "table"]);
91997
+ if (!applicableKinds.has(block.kind)) {
91998
+ return block;
91999
+ }
92000
+ const blockWithAttrs = block;
92001
+ return {
92002
+ ...blockWithAttrs,
92003
+ attrs: {
92004
+ ...blockWithAttrs.attrs ?? {},
92005
+ anchorParagraphId
92006
+ }
92007
+ };
92008
+ };
91910
92009
  const flushParagraph = () => {
91911
92010
  if (currentRuns.length === 0) {
91912
92011
  return;
@@ -92138,6 +92237,7 @@ ${l}
92138
92237
  }
92139
92238
  return;
92140
92239
  }
92240
+ const anchorParagraphId = nextId();
92141
92241
  flushParagraph();
92142
92242
  const mergedMarks = [...node2.marks ?? [], ...inheritedMarks ?? []];
92143
92243
  const trackedMeta = trackedChanges?.enabled ? collectTrackedChangeFromMarks(mergedMarks) : void 0;
@@ -92148,7 +92248,7 @@ ${l}
92148
92248
  const imageBlock = converters.imageNodeToBlock(node2, nextBlockId, positions, trackedMeta, trackedChanges);
92149
92249
  if (imageBlock && imageBlock.kind === "image") {
92150
92250
  annotateBlockWithTrackedChange(imageBlock, trackedMeta, trackedChanges);
92151
- blocks2.push(imageBlock);
92251
+ blocks2.push(attachAnchorParagraphId(imageBlock, anchorParagraphId));
92152
92252
  }
92153
92253
  }
92154
92254
  return;
@@ -92156,6 +92256,7 @@ ${l}
92156
92256
  if (node2.type === "contentBlock") {
92157
92257
  const attrs = node2.attrs ?? {};
92158
92258
  if (attrs.horizontalRule === true) {
92259
+ const anchorParagraphId = nextId();
92159
92260
  flushParagraph();
92160
92261
  const indent2 = paragraphAttrs?.indent;
92161
92262
  const hrIndentLeft = typeof indent2?.left === "number" ? indent2.left : void 0;
@@ -92165,52 +92266,57 @@ ${l}
92165
92266
  const convert2 = converters?.contentBlockNodeToDrawingBlock ?? contentBlockNodeToDrawingBlock;
92166
92267
  const drawingBlock = convert2(hrNode, nextBlockId, positions);
92167
92268
  if (drawingBlock) {
92168
- blocks2.push(drawingBlock);
92269
+ blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
92169
92270
  }
92170
92271
  }
92171
92272
  return;
92172
92273
  }
92173
92274
  if (node2.type === "vectorShape") {
92275
+ const anchorParagraphId = nextId();
92174
92276
  flushParagraph();
92175
92277
  if (converters?.vectorShapeNodeToDrawingBlock) {
92176
92278
  const drawingBlock = converters.vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions);
92177
92279
  if (drawingBlock) {
92178
- blocks2.push(drawingBlock);
92280
+ blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
92179
92281
  }
92180
92282
  }
92181
92283
  return;
92182
92284
  }
92183
92285
  if (node2.type === "shapeGroup") {
92286
+ const anchorParagraphId = nextId();
92184
92287
  flushParagraph();
92185
92288
  if (converters?.shapeGroupNodeToDrawingBlock) {
92186
92289
  const drawingBlock = converters.shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions);
92187
92290
  if (drawingBlock) {
92188
- blocks2.push(drawingBlock);
92291
+ blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
92189
92292
  }
92190
92293
  }
92191
92294
  return;
92192
92295
  }
92193
92296
  if (node2.type === "shapeContainer") {
92297
+ const anchorParagraphId = nextId();
92194
92298
  flushParagraph();
92195
92299
  if (converters?.shapeContainerNodeToDrawingBlock) {
92196
92300
  const drawingBlock = converters.shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions);
92197
92301
  if (drawingBlock) {
92198
- blocks2.push(drawingBlock);
92302
+ blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
92199
92303
  }
92200
92304
  }
92201
92305
  return;
92202
92306
  }
92203
92307
  if (node2.type === "shapeTextbox") {
92308
+ const anchorParagraphId = nextId();
92204
92309
  flushParagraph();
92205
92310
  if (converters?.shapeTextboxNodeToDrawingBlock) {
92206
92311
  const drawingBlock = converters.shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions);
92207
92312
  if (drawingBlock) {
92208
- blocks2.push(drawingBlock);
92313
+ blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
92209
92314
  }
92210
92315
  }
92211
92316
  return;
92212
92317
  }
92213
92318
  if (node2.type === "table") {
92319
+ const anchorParagraphId = nextId();
92214
92320
  flushParagraph();
92215
92321
  if (converters?.tableNodeToBlock) {
92216
92322
  const tableBlock = converters.tableNodeToBlock(
@@ -92227,7 +92333,7 @@ ${l}
92227
92333
  ...converterContext !== void 0 ? [converterContext] : []
92228
92334
  );
92229
92335
  if (tableBlock) {
92230
- blocks2.push(tableBlock);
92336
+ blocks2.push(attachAnchorParagraphId(tableBlock, anchorParagraphId));
92231
92337
  }
92232
92338
  }
92233
92339
  return;
@@ -96981,6 +97087,7 @@ ${l}
96981
97087
  #telemetryEmitter = null;
96982
97088
  #renderScheduled = false;
96983
97089
  #pendingDocChange = false;
97090
+ #pendingMapping = null;
96984
97091
  #isRerendering = false;
96985
97092
  #selectionSync = new SelectionSyncCoordinator();
96986
97093
  #remoteCursorUpdateScheduled = false;
@@ -98585,6 +98692,15 @@ ${l}
98585
98692
  }
98586
98693
  if (trackedChangesChanged || transaction?.docChanged) {
98587
98694
  this.#pendingDocChange = true;
98695
+ if (transaction?.docChanged) {
98696
+ if (this.#pendingMapping !== null) {
98697
+ const combined = this.#pendingMapping.slice();
98698
+ combined.appendMapping(transaction.mapping);
98699
+ this.#pendingMapping = combined;
98700
+ } else {
98701
+ this.#pendingMapping = transaction.mapping;
98702
+ }
98703
+ }
98588
98704
  this.#selectionSync.onLayoutStart();
98589
98705
  this.#scheduleRerender();
98590
98706
  }
@@ -100151,7 +100267,9 @@ ${l}
100151
100267
  footerMeasures.length > 0 ? footerMeasures : void 0
100152
100268
  );
100153
100269
  this.#domIndexObserverManager?.pause();
100154
- painter.paint(layout, this.#painterHost);
100270
+ const mapping = this.#pendingMapping;
100271
+ this.#pendingMapping = null;
100272
+ painter.paint(layout, this.#painterHost, mapping ?? void 0);
100155
100273
  this.#applyVertAlignToLayout();
100156
100274
  this.#rebuildDomPositionIndex();
100157
100275
  this.#domIndexObserverManager?.resume();
@@ -142380,12 +142498,13 @@ ${reason}`);
142380
142498
  return currentCommentText.value && currentCommentText.value !== "<p></p>";
142381
142499
  });
142382
142500
  const setFocus = () => {
142383
- if (props.comment.resolvedTime) return;
142384
142501
  const editor = proxy.$superdoc.activeEditor;
142385
- activeComment.value = props.comment.commentId;
142386
- props.comment.setActive(proxy.$superdoc);
142502
+ if (!props.comment.resolvedTime) {
142503
+ activeComment.value = props.comment.commentId;
142504
+ props.comment.setActive(proxy.$superdoc);
142505
+ }
142387
142506
  if (editor) {
142388
- const cursorId = props.comment.importedId || props.comment.commentId;
142507
+ const cursorId = props.comment.resolvedTime ? props.comment.commentId : props.comment.importedId || props.comment.commentId;
142389
142508
  editor.commands?.setCursorById(cursorId);
142390
142509
  }
142391
142510
  };
@@ -142621,7 +142740,7 @@ ${reason}`);
142621
142740
  };
142622
142741
  }
142623
142742
  };
142624
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-dc2a79b5"]]);
142743
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-d50fd675"]]);
142625
142744
  const _hoisted_1$b = { class: "comments-list" };
142626
142745
  const _hoisted_2$5 = { key: 0 };
142627
142746
  const _hoisted_3$3 = { class: "comment-item" };
@@ -144557,7 +144676,7 @@ ${reason}`);
144557
144676
  this.config.colors = shuffleArray(this.config.colors);
144558
144677
  this.userColorMap = /* @__PURE__ */ new Map();
144559
144678
  this.colorIndex = 0;
144560
- this.version = "1.3.1-next.1";
144679
+ this.version = "1.3.1-next.3";
144561
144680
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
144562
144681
  this.superdocId = config2.superdocId || v4();
144563
144682
  this.colors = this.config.colors;