@harbour-enterprises/superdoc 1.0.0-beta.32 → 1.0.0-beta.34

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 (28) hide show
  1. package/dist/chunks/{PdfViewer-CTKbqDWv.cjs → PdfViewer-CMVOK_jD.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-edjIRb_p.es.js → PdfViewer-DSx1zQC5.es.js} +1 -1
  3. package/dist/chunks/{index-Pwv0a9G5.es.js → index-8_ijaxSz.es.js} +57 -32
  4. package/dist/chunks/{index-Cajp7-Xa.cjs → index-BqXrnRP8.cjs} +57 -32
  5. package/dist/chunks/{index-SGV4U12y-Dh5jaROA.cjs → index-CQeXM6oB-BAx-uLYb.cjs} +1 -1
  6. package/dist/chunks/{index-SGV4U12y-BPGxOtvI.es.js → index-CQeXM6oB-DjCz53Th.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-BbbbKgEs.cjs → super-editor.es-CgTVSX1p.cjs} +433 -124
  8. package/dist/chunks/{super-editor.es-CdGsYGU1.es.js → super-editor.es-TkKngzld.es.js} +433 -124
  9. package/dist/style.css +33 -33
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-CpuOoAUa.js → converter-Hv-kNdxI.js} +1 -1
  12. package/dist/super-editor/chunks/{docx-zipper-Dk99r397.js → docx-zipper-C6nUdlsw.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-CFv-RJI-.js → editor-uvvccWc5.js} +487 -117
  14. package/dist/super-editor/chunks/{index-SGV4U12y.js → index-CQeXM6oB.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-CQr3Xnx9.js → toolbar-BCWRHtW5.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/super-editor.es.js +10 -9
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.cjs +1 -1
  23. package/dist/super-editor.es.js +1 -1
  24. package/dist/superdoc.cjs +2 -2
  25. package/dist/superdoc.es.js +2 -2
  26. package/dist/superdoc.umd.js +489 -155
  27. package/dist/superdoc.umd.js.map +1 -1
  28. package/package.json +1 -1
@@ -18263,9 +18263,9 @@ const canMergeTextNodes = (nodeA, nodeB) => {
18263
18263
  const areAttrsEqual = (attrsA = {}, attrsB = {}) => {
18264
18264
  return objectIncludes(attrsA, attrsB);
18265
18265
  };
18266
- const TrackInsertMarkName = "trackInsert";
18267
- const TrackDeleteMarkName = "trackDelete";
18268
- const TrackFormatMarkName = "trackFormat";
18266
+ const TrackInsertMarkName$1 = "trackInsert";
18267
+ const TrackDeleteMarkName$1 = "trackDelete";
18268
+ const TrackFormatMarkName$1 = "trackFormat";
18269
18269
  const generateV2HandlerEntity = (handlerName, translator2) => ({
18270
18270
  handlerName,
18271
18271
  handler: (params2) => {
@@ -20031,7 +20031,7 @@ function handleStyleChangeMarksV2(rPrChange, currentMarks, params2) {
20031
20031
  const runProperties = translator$1N.encode({ ...params2, nodes: [rPr] });
20032
20032
  submarks = encodeMarksFromRPr(runProperties, params2?.docx);
20033
20033
  }
20034
- return [{ type: TrackFormatMarkName, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20034
+ return [{ type: TrackFormatMarkName$1, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20035
20035
  }
20036
20036
  function handleStyleChangeMarks(rPr, currentMarks) {
20037
20037
  const styleChangeMark = rPr.elements?.find((el) => el.name === "w:rPrChange");
@@ -20046,7 +20046,7 @@ function handleStyleChangeMarks(rPr, currentMarks) {
20046
20046
  authorEmail: attributes["w:authorEmail"]
20047
20047
  };
20048
20048
  const submarks = parseMarks(styleChangeMark);
20049
- return [{ type: TrackFormatMarkName, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20049
+ return [{ type: TrackFormatMarkName$1, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
20050
20050
  }
20051
20051
  function createImportMarks(marks) {
20052
20052
  const textStyleMarksToCombine = marks.filter((mark) => mark.type === "textStyle");
@@ -20484,7 +20484,7 @@ const cloneRuns = (runs = []) => runs.map((run2) => cloneNode(run2));
20484
20484
  const prepareRunTrackingContext = (node = {}) => {
20485
20485
  const marks = Array.isArray(node.marks) ? node.marks : [];
20486
20486
  const trackingMarks = marks.filter(
20487
- (mark) => mark?.type === TrackInsertMarkName || mark?.type === TrackDeleteMarkName
20487
+ (mark) => mark?.type === TrackInsertMarkName$1 || mark?.type === TrackDeleteMarkName$1
20488
20488
  );
20489
20489
  if (!trackingMarks.length) {
20490
20490
  return { runNode: node, trackingMarksByType: /* @__PURE__ */ new Map() };
@@ -20493,7 +20493,7 @@ const prepareRunTrackingContext = (node = {}) => {
20493
20493
  trackingMarks.forEach((mark) => {
20494
20494
  if (mark?.type) trackingMarksByType.set(mark.type, cloneMark(mark));
20495
20495
  });
20496
- const preservedMarks = marks.filter((mark) => mark?.type !== TrackInsertMarkName && mark?.type !== TrackDeleteMarkName).map((mark) => cloneMark(mark));
20496
+ const preservedMarks = marks.filter((mark) => mark?.type !== TrackInsertMarkName$1 && mark?.type !== TrackDeleteMarkName$1).map((mark) => cloneMark(mark));
20497
20497
  const clonedContent = Array.isArray(node.content) ? node.content.map((child) => {
20498
20498
  const childClone = cloneNode(child);
20499
20499
  const childMarks = Array.isArray(childClone.marks) ? childClone.marks.slice() : [];
@@ -20532,8 +20532,8 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
20532
20532
  return runs;
20533
20533
  }
20534
20534
  if (!trackingMarksByType.size) return runs;
20535
- if (trackingMarksByType.has(TrackInsertMarkName)) {
20536
- const mark = trackingMarksByType.get(TrackInsertMarkName);
20535
+ if (trackingMarksByType.has(TrackInsertMarkName$1)) {
20536
+ const mark = trackingMarksByType.get(TrackInsertMarkName$1);
20537
20537
  const clonedRuns = cloneRuns(runs);
20538
20538
  const wrapper = {
20539
20539
  name: "w:ins",
@@ -20550,8 +20550,8 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
20550
20550
  };
20551
20551
  return [wrapper];
20552
20552
  }
20553
- if (trackingMarksByType.has(TrackDeleteMarkName)) {
20554
- const mark = trackingMarksByType.get(TrackDeleteMarkName);
20553
+ if (trackingMarksByType.has(TrackDeleteMarkName$1)) {
20554
+ const mark = trackingMarksByType.get(TrackDeleteMarkName$1);
20555
20555
  const clonedRuns = cloneRuns(runs);
20556
20556
  clonedRuns.forEach(renameTextElementsForDeletion);
20557
20557
  const wrapper = {
@@ -41841,7 +41841,7 @@ const _SuperConverter = class _SuperConverter2 {
41841
41841
  static getStoredSuperdocVersion(docx) {
41842
41842
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
41843
41843
  }
41844
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.32") {
41844
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.34") {
41845
41845
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
41846
41846
  }
41847
41847
  /**
@@ -45147,7 +45147,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
45147
45147
  var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
45148
45148
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
45149
45149
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
45150
- var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
45150
+ var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupDragHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, computeAnchorMap_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
45151
45151
  var GOOD_LEAF_SIZE = 200;
45152
45152
  var RopeSequence = function RopeSequence2() {
45153
45153
  };
@@ -55999,13 +55999,13 @@ const findTrackedMarkBetween = ({
55999
55999
  return markFound;
56000
56000
  };
56001
56001
  const markInsertion = ({ tr, from: from2, to, user, date }) => {
56002
- tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackDeleteMarkName]);
56003
- tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackInsertMarkName]);
56002
+ tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackDeleteMarkName$1]);
56003
+ tr.removeMark(from2, to, tr.doc.type.schema.marks[TrackInsertMarkName$1]);
56004
56004
  let trackedMark = findTrackedMarkBetween({
56005
56005
  tr,
56006
56006
  from: from2,
56007
56007
  to,
56008
- markName: TrackInsertMarkName,
56008
+ markName: TrackInsertMarkName$1,
56009
56009
  attrs: { authorEmail: user.email }
56010
56010
  });
56011
56011
  let id;
@@ -56014,7 +56014,7 @@ const markInsertion = ({ tr, from: from2, to, user, date }) => {
56014
56014
  } else {
56015
56015
  id = v4();
56016
56016
  }
56017
- const insertionMark = tr.doc.type.schema.marks[TrackInsertMarkName].create({
56017
+ const insertionMark = tr.doc.type.schema.marks[TrackInsertMarkName$1].create({
56018
56018
  id,
56019
56019
  author: user.name,
56020
56020
  authorEmail: user.email,
@@ -56040,7 +56040,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56040
56040
  tr,
56041
56041
  from: from2,
56042
56042
  to,
56043
- markName: TrackDeleteMarkName,
56043
+ markName: TrackDeleteMarkName$1,
56044
56044
  attrs: { authorEmail: user.email }
56045
56045
  });
56046
56046
  let id;
@@ -56051,7 +56051,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56051
56051
  } else {
56052
56052
  id = v4();
56053
56053
  }
56054
- const deletionMark = tr.doc.type.schema.marks[TrackDeleteMarkName].create({
56054
+ const deletionMark = tr.doc.type.schema.marks[TrackDeleteMarkName$1].create({
56055
56055
  id,
56056
56056
  author: user.name,
56057
56057
  authorEmail: user.email,
@@ -56064,7 +56064,7 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56064
56064
  if (node.type.name.includes("table")) {
56065
56065
  return;
56066
56066
  }
56067
- if (node.isInline && node.marks.find((mark) => mark.type.name === TrackInsertMarkName && mark.attrs.authorEmail === user.email)) {
56067
+ if (node.isInline && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1 && mark.attrs.authorEmail === user.email)) {
56068
56068
  const removeStep = new ReplaceStep(
56069
56069
  deletionMap.map(Math.max(from2, pos)),
56070
56070
  deletionMap.map(Math.min(to, pos + node.nodeSize)),
@@ -56073,14 +56073,14 @@ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
56073
56073
  if (!tr.maybeStep(removeStep).failed) {
56074
56074
  deletionMap.appendMap(removeStep.getMap());
56075
56075
  }
56076
- } else if (node.isInline && !node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
56076
+ } else if (node.isInline && !node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
56077
56077
  nodes.push(node);
56078
56078
  tr.addMark(
56079
56079
  deletionMap.map(Math.max(from2, pos)),
56080
56080
  deletionMap.map(Math.min(to, pos + node.nodeSize)),
56081
56081
  deletionMark
56082
56082
  );
56083
- } else if (node.attrs.track && !node.attrs.track.find((trackAttr) => trackAttr.type === TrackDeleteMarkName) && !["bulletList", "orderedList"].includes(node.type.name)) ;
56083
+ } else if (node.attrs.track && !node.attrs.track.find((trackAttr) => trackAttr.type === TrackDeleteMarkName$1) && !["bulletList", "orderedList"].includes(node.type.name)) ;
56084
56084
  });
56085
56085
  return { deletionMark, deletionMap, nodes };
56086
56086
  };
@@ -56147,7 +56147,7 @@ const getTrackChanges = (state2, id = null) => {
56147
56147
  }
56148
56148
  allInlineNodes.forEach(({ node, pos }) => {
56149
56149
  const { marks } = node;
56150
- const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
56150
+ const trackedMarks = [TrackInsertMarkName$1, TrackDeleteMarkName$1, TrackFormatMarkName$1];
56151
56151
  if (marks.length > 0) {
56152
56152
  marks.forEach((mark) => {
56153
56153
  if (trackedMarks.includes(mark.type.name)) {
@@ -56260,7 +56260,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56260
56260
  return DecorationSet.empty;
56261
56261
  }
56262
56262
  trackedChanges.forEach(({ mark, from: from2, to }) => {
56263
- if (mark.type.name === TrackInsertMarkName) {
56263
+ if (mark.type.name === TrackInsertMarkName$1) {
56264
56264
  if (onlyOriginalShown) {
56265
56265
  const decoration = Decoration.inline(from2, to, {
56266
56266
  class: "track-insert-dec hidden"
@@ -56278,7 +56278,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56278
56278
  decorations.push(decoration);
56279
56279
  }
56280
56280
  }
56281
- if (mark.type.name === TrackDeleteMarkName) {
56281
+ if (mark.type.name === TrackDeleteMarkName$1) {
56282
56282
  if (onlyOriginalShown) {
56283
56283
  const decoration = Decoration.inline(from2, to, {
56284
56284
  class: "track-delete-dec normal"
@@ -56310,7 +56310,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56310
56310
  decorations.push(decorationWidget);
56311
56311
  }
56312
56312
  }
56313
- if (mark.type.name === TrackFormatMarkName) {
56313
+ if (mark.type.name === TrackFormatMarkName$1) {
56314
56314
  if (onlyOriginalShown) {
56315
56315
  const decoration = Decoration.inline(from2, to, {
56316
56316
  class: "track-format-dec before"
@@ -56331,7 +56331,7 @@ const getTrackChangesDecorations = (state2, onlyOriginalShown, onlyModifiedShown
56331
56331
  });
56332
56332
  return DecorationSet.create(state2.doc, decorations);
56333
56333
  };
56334
- const CommentMarkName = "commentMark";
56334
+ const CommentMarkName$1 = "commentMark";
56335
56335
  const resolveCommentMeta = ({ converter, importedId }) => {
56336
56336
  const comments = converter?.comments || [];
56337
56337
  const matchingImportedComment = comments.find((c2) => c2.importedId == importedId);
@@ -56362,7 +56362,7 @@ const ensureFallbackComment = ({ converter, matchingImportedComment, commentId,
56362
56362
  const removeCommentsById = ({ commentId, state: state2, tr, dispatch }) => {
56363
56363
  const positions = getCommentPositionsById(commentId, state2.doc);
56364
56364
  positions.forEach(({ from: from2, to }) => {
56365
- tr.removeMark(from2, to, state2.schema.marks[CommentMarkName]);
56365
+ tr.removeMark(from2, to, state2.schema.marks[CommentMarkName$1]);
56366
56366
  });
56367
56367
  dispatch(tr);
56368
56368
  };
@@ -56370,7 +56370,7 @@ const getCommentPositionsById = (commentId, doc2) => {
56370
56370
  const positions = [];
56371
56371
  doc2.descendants((node, pos) => {
56372
56372
  const { marks } = node;
56373
- const commentMark = marks.find((mark) => mark.type.name === CommentMarkName);
56373
+ const commentMark = marks.find((mark) => mark.type.name === CommentMarkName$1);
56374
56374
  if (commentMark) {
56375
56375
  const { attrs } = commentMark;
56376
56376
  const { commentId: currentCommentId } = attrs;
@@ -56390,7 +56390,7 @@ const prepareCommentsForExport = (doc2, tr, schema, comments = []) => {
56390
56390
  const endNodes = [];
56391
56391
  const seen = /* @__PURE__ */ new Set();
56392
56392
  doc2.descendants((node, pos) => {
56393
- const commentMarks = node.marks?.filter((mark) => mark.type.name === CommentMarkName) || [];
56393
+ const commentMarks = node.marks?.filter((mark) => mark.type.name === CommentMarkName$1) || [];
56394
56394
  commentMarks.forEach((commentMark) => {
56395
56395
  const { attrs = {} } = commentMark;
56396
56396
  const { commentId } = attrs;
@@ -56518,7 +56518,7 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
56518
56518
  importedId,
56519
56519
  internal: itemToMark.internal
56520
56520
  };
56521
- tr.addMark(start2, pos + 1, schema.marks[CommentMarkName].create(markAttrs));
56521
+ tr.addMark(start2, pos + 1, schema.marks[CommentMarkName$1].create(markAttrs));
56522
56522
  toDelete.push({ start: pos, end: pos + 1 });
56523
56523
  } else if (type2.name === "commentReference") {
56524
56524
  toDelete.push({ start: pos, end: pos + 1 });
@@ -56636,7 +56636,7 @@ const updatePosition = ({ allCommentPositions, threadId, pos, currentBounds, nod
56636
56636
  existing.bounds.bottom = Math.max(existing.bounds.bottom, currentBounds.bottom);
56637
56637
  }
56638
56638
  };
56639
- const TRACK_CHANGE_MARKS = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
56639
+ const TRACK_CHANGE_MARKS = [TrackInsertMarkName$1, TrackDeleteMarkName$1, TrackFormatMarkName$1];
56640
56640
  const CommentsPluginKey = new PluginKey("comments");
56641
56641
  const CommentsPlugin = Extension.create({
56642
56642
  name: "comments",
@@ -56652,7 +56652,7 @@ const CommentsPlugin = Extension.create({
56652
56652
  tr.addMark(
56653
56653
  $from.pos,
56654
56654
  $to.pos,
56655
- this.editor.schema.marks[CommentMarkName].create({
56655
+ this.editor.schema.marks[CommentMarkName$1].create({
56656
56656
  commentId: resolvedCommentId,
56657
56657
  internal: resolvedInternal
56658
56658
  })
@@ -56692,7 +56692,7 @@ const CommentsPlugin = Extension.create({
56692
56692
  doc2.descendants((node, pos) => {
56693
56693
  if (foundStartNode) return;
56694
56694
  const { marks = [] } = node;
56695
- const commentMark = marks.find((mark) => mark.type.name === CommentMarkName);
56695
+ const commentMark = marks.find((mark) => mark.type.name === CommentMarkName$1);
56696
56696
  if (commentMark) {
56697
56697
  const { attrs } = commentMark;
56698
56698
  const wid = attrs.commentId;
@@ -56706,7 +56706,7 @@ const CommentsPlugin = Extension.create({
56706
56706
  tr.addMark(
56707
56707
  foundPos,
56708
56708
  foundPos + foundStartNode.nodeSize,
56709
- this.editor.schema.marks[CommentMarkName].create({
56709
+ this.editor.schema.marks[CommentMarkName$1].create({
56710
56710
  commentId,
56711
56711
  internal: isInternal
56712
56712
  })
@@ -56835,10 +56835,10 @@ const CommentsPlugin = Extension.create({
56835
56835
  prevDoc = doc2;
56836
56836
  shouldUpdate = false;
56837
56837
  const decorations = [];
56838
- const allCommentPositions = onlyActiveThreadChanged ? prevAllCommentPositions : {};
56838
+ const allCommentPositions = {};
56839
56839
  doc2.descendants((node, pos) => {
56840
56840
  const { marks = [] } = node;
56841
- const commentMarks = marks.filter((mark) => mark.type.name === CommentMarkName);
56841
+ const commentMarks = marks.filter((mark) => mark.type.name === CommentMarkName$1);
56842
56842
  let hasActive = false;
56843
56843
  commentMarks.forEach((commentMark) => {
56844
56844
  const { attrs } = commentMark;
@@ -56964,7 +56964,7 @@ const getActiveCommentId = (doc2, selection) => {
56964
56964
  return;
56965
56965
  }
56966
56966
  const { marks = [] } = node;
56967
- const commentMark = marks.find((mark) => mark.type.name === CommentMarkName);
56967
+ const commentMark = marks.find((mark) => mark.type.name === CommentMarkName$1);
56968
56968
  if (commentMark) {
56969
56969
  overlaps.push({
56970
56970
  node,
@@ -56987,7 +56987,7 @@ const getActiveCommentId = (doc2, selection) => {
56987
56987
  }
56988
56988
  });
56989
56989
  const { marks: closestMarks = [] } = closestCommentRangeStart || {};
56990
- const closestCommentMark = closestMarks.find((mark) => mark.type.name === CommentMarkName);
56990
+ const closestCommentMark = closestMarks.find((mark) => mark.type.name === CommentMarkName$1);
56991
56991
  return closestCommentMark?.attrs?.commentId || closestCommentMark?.attrs?.importedId;
56992
56992
  };
56993
56993
  const findTrackedMark = ({
@@ -57037,7 +57037,7 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
57037
57037
  let nodes = step?.slice?.content?.content || [];
57038
57038
  if (!nodes.length) {
57039
57039
  newEditorState.doc.descendants((node) => {
57040
- const hasFormatMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
57040
+ const hasFormatMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
57041
57041
  if (hasFormatMark) {
57042
57042
  nodes = [node];
57043
57043
  return false;
@@ -57062,19 +57062,19 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
57062
57062
  const getTrackedChangeText = ({ nodes, mark, trackedChangeType, isDeletionInsertion }) => {
57063
57063
  let trackedChangeText = "";
57064
57064
  let deletionText = "";
57065
- if (trackedChangeType === TrackInsertMarkName) {
57065
+ if (trackedChangeType === TrackInsertMarkName$1) {
57066
57066
  trackedChangeText = nodes.reduce((acc, node) => {
57067
57067
  if (!node.marks.find((nodeMark) => nodeMark.type.name === mark.type.name)) return acc;
57068
57068
  acc += node?.text || node?.textContent || "";
57069
57069
  return acc;
57070
57070
  }, "");
57071
57071
  }
57072
- if (trackedChangeType === TrackFormatMarkName) {
57072
+ if (trackedChangeType === TrackFormatMarkName$1) {
57073
57073
  trackedChangeText = translateFormatChangesToEnglish(mark.attrs);
57074
57074
  }
57075
- if (trackedChangeType === TrackDeleteMarkName || isDeletionInsertion) {
57075
+ if (trackedChangeType === TrackDeleteMarkName$1 || isDeletionInsertion) {
57076
57076
  deletionText = nodes.reduce((acc, node) => {
57077
- if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)) return acc;
57077
+ if (!node.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName$1)) return acc;
57078
57078
  acc += node?.text || node?.textContent || "";
57079
57079
  return acc;
57080
57080
  }, "");
@@ -57140,7 +57140,7 @@ function findRangeById(doc2, id) {
57140
57140
  if (to === null || pos + node.nodeSize > to) to = pos + node.nodeSize;
57141
57141
  }
57142
57142
  const commentMark = node.marks.find(
57143
- (m2) => m2.type.name === CommentMarkName && (m2.attrs.commentId === id || m2.attrs.importedId === id)
57143
+ (m2) => m2.type.name === CommentMarkName$1 && (m2.attrs.commentId === id || m2.attrs.importedId === id)
57144
57144
  );
57145
57145
  if (commentMark) {
57146
57146
  if (from2 === null || pos < from2) from2 = pos;
@@ -57150,7 +57150,7 @@ function findRangeById(doc2, id) {
57150
57150
  return from2 !== null && to !== null ? { from: from2, to } : null;
57151
57151
  }
57152
57152
  const replaceStep = ({ state: state2, tr, step, newTr, map: map22, user, date, originalStep, originalStepIndex }) => {
57153
- const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName];
57153
+ const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName$1];
57154
57154
  const deletionMark = findMark(state2, deletionMarkSchema, false);
57155
57155
  const positionTo = deletionMark ? deletionMark.to : step.to;
57156
57156
  const newStep = new ReplaceStep(
@@ -57214,17 +57214,17 @@ const addMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) => {
57214
57214
  if (!node.isInline) {
57215
57215
  return;
57216
57216
  }
57217
- if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
57217
+ if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
57218
57218
  return false;
57219
57219
  }
57220
57220
  const existingChangeMark = node.marks.find(
57221
- (mark) => [TrackDeleteMarkName, TrackFormatMarkName].includes(mark.type.name)
57221
+ (mark) => [TrackDeleteMarkName$1, TrackFormatMarkName$1].includes(mark.type.name)
57222
57222
  );
57223
57223
  const wid = existingChangeMark ? existingChangeMark.attrs.id : v4();
57224
57224
  newTr.addMark(Math.max(step.from, pos), Math.min(step.to, pos + node.nodeSize), step.mark);
57225
57225
  const allowedMarks = ["bold", "italic", "strike", "underline", "textStyle"];
57226
57226
  if (allowedMarks.includes(step.mark.type.name) && !node.marks.find((mark) => mark.type === step.mark.type)) {
57227
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
57227
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
57228
57228
  let after = [];
57229
57229
  let before = [];
57230
57230
  if (formatChangeMark) {
@@ -57260,7 +57260,7 @@ const addMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) => {
57260
57260
  ];
57261
57261
  }
57262
57262
  if (after.length || before.length) {
57263
- const newFormatMark = state2.schema.marks[TrackFormatMarkName].create({
57263
+ const newFormatMark = state2.schema.marks[TrackFormatMarkName$1].create({
57264
57264
  id: wid,
57265
57265
  author: user.name,
57266
57266
  authorEmail: user.email,
@@ -57292,13 +57292,13 @@ const removeMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) =
57292
57292
  if (!node.isInline) {
57293
57293
  return true;
57294
57294
  }
57295
- if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
57295
+ if (node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
57296
57296
  return false;
57297
57297
  }
57298
57298
  newTr.removeMark(Math.max(step.from, pos), Math.min(step.to, pos + node.nodeSize), step.mark);
57299
57299
  const allowedMarks = ["bold", "italic", "strike", "underline", "textStyle"];
57300
57300
  if (allowedMarks.includes(step.mark.type.name) && node.marks.find((mark) => mark.type === step.mark.type)) {
57301
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
57301
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
57302
57302
  let after = [];
57303
57303
  let before = [];
57304
57304
  if (formatChangeMark) {
@@ -57326,7 +57326,7 @@ const removeMarkStep = ({ state: state2, step, newTr, doc: doc2, user, date }) =
57326
57326
  ];
57327
57327
  }
57328
57328
  if (after.length || before.length) {
57329
- const newFormatMark = state2.schema.marks[TrackFormatMarkName].create({
57329
+ const newFormatMark = state2.schema.marks[TrackFormatMarkName$1].create({
57330
57330
  id: v4(),
57331
57331
  author: user.name,
57332
57332
  authorEmail: user.email,
@@ -57407,7 +57407,7 @@ const trackedTransaction = ({ tr, state: state2, user }) => {
57407
57407
  newTr.setMeta("addToHistory", tr.getMeta("addToHistory"));
57408
57408
  }
57409
57409
  if (tr.selectionSet) {
57410
- const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName];
57410
+ const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName$1];
57411
57411
  const deletionMark = findMark(state2, deletionMarkSchema, false);
57412
57412
  if (tr.selection instanceof TextSelection$1 && (tr.selection.from < state2.selection.from || tr.getMeta("inputType") === "deleteContentBackward")) {
57413
57413
  const caretPos = map22.map(tr.selection.from, -1);
@@ -59014,7 +59014,7 @@ const isHeadless = (editor) => {
59014
59014
  const shouldSkipNodeView = (editor) => {
59015
59015
  return isHeadless(editor);
59016
59016
  };
59017
- const summaryVersion = "1.0.0-beta.32";
59017
+ const summaryVersion = "1.0.0-beta.34";
59018
59018
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59019
59019
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59020
59020
  function mapAttributes(attrs) {
@@ -59803,7 +59803,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
59803
59803
  { default: remarkStringify },
59804
59804
  { default: remarkGfm }
59805
59805
  ] = await Promise.all([
59806
- import("./index-SGV4U12y-BPGxOtvI.es.js"),
59806
+ import("./index-CQeXM6oB-DjCz53Th.es.js"),
59807
59807
  import("./index-DRCvimau-Cw339678.es.js"),
59808
59808
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
59809
59809
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -60008,7 +60008,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60008
60008
  * Process collaboration migrations
60009
60009
  */
60010
60010
  processCollaborationMigrations() {
60011
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.32");
60011
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.34");
60012
60012
  if (!this.options.ydoc) return;
60013
60013
  const metaMap = this.options.ydoc.getMap("meta");
60014
60014
  let docVersion = metaMap.get("version");
@@ -72805,7 +72805,7 @@ function hitTestFragment(layout, pageHit, blocks, measures, point) {
72805
72805
  });
72806
72806
  for (const fragment of fragments) {
72807
72807
  if (fragment.kind !== "para") continue;
72808
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
72808
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
72809
72809
  if (blockIndex === -1) continue;
72810
72810
  const block = blocks[blockIndex];
72811
72811
  const measure = measures[blockIndex];
@@ -72832,7 +72832,7 @@ const hitTestAtomicFragment = (pageHit, blocks, measures, point) => {
72832
72832
  const withinX = point.x >= fragment.x && point.x <= fragment.x + fragment.width;
72833
72833
  const withinY = point.y >= fragment.y && point.y <= fragment.y + fragment.height;
72834
72834
  if (!withinX || !withinY) continue;
72835
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
72835
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
72836
72836
  if (blockIndex === -1) continue;
72837
72837
  const block = blocks[blockIndex];
72838
72838
  const measure = measures[blockIndex];
@@ -72971,7 +72971,7 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
72971
72971
  blockId = fragment.blockId;
72972
72972
  pageIndex = pi;
72973
72973
  column = determineColumn(layout, fragment.x);
72974
- const blockIndex = blocks.findIndex((b2) => b2.id === fragment.blockId);
72974
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
72975
72975
  if (blockIndex !== -1) {
72976
72976
  const measure = measures[blockIndex];
72977
72977
  if (measure && measure.kind === "paragraph") {
@@ -73121,6 +73121,44 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
73121
73121
  });
73122
73122
  return null;
73123
73123
  }
73124
+ function findBlockIndexByFragmentId(blocks, fragmentBlockId, targetPmRange) {
73125
+ const index2 = blocks.findIndex(
73126
+ (block) => block.id === fragmentBlockId && block.kind !== "pageBreak" && block.kind !== "sectionBreak"
73127
+ );
73128
+ if (index2 !== -1) {
73129
+ return index2;
73130
+ }
73131
+ const baseBlockId = fragmentBlockId.replace(/-\d+$/, "");
73132
+ if (baseBlockId === fragmentBlockId) {
73133
+ return -1;
73134
+ }
73135
+ const matchingIndices = [];
73136
+ blocks.forEach((block, idx) => {
73137
+ if (block.id === baseBlockId && block.kind === "paragraph") {
73138
+ matchingIndices.push(idx);
73139
+ }
73140
+ });
73141
+ if (matchingIndices.length === 0) {
73142
+ return -1;
73143
+ }
73144
+ if (matchingIndices.length === 1) {
73145
+ return matchingIndices[0];
73146
+ }
73147
+ if (targetPmRange) {
73148
+ for (const idx of matchingIndices) {
73149
+ const block = blocks[idx];
73150
+ if (block.kind !== "paragraph") continue;
73151
+ const hasOverlap = block.runs.some((run2) => {
73152
+ if (run2.pmStart == null || run2.pmEnd == null) return false;
73153
+ return run2.pmEnd > targetPmRange.from && run2.pmStart < targetPmRange.to;
73154
+ });
73155
+ if (hasOverlap) {
73156
+ return idx;
73157
+ }
73158
+ }
73159
+ }
73160
+ return matchingIndices[0];
73161
+ }
73124
73162
  function selectionToRects(layout, blocks, measures, from2, to) {
73125
73163
  if (from2 === to) {
73126
73164
  return [];
@@ -73129,8 +73167,10 @@ function selectionToRects(layout, blocks, measures, from2, to) {
73129
73167
  layout.pages.forEach((page, pageIndex) => {
73130
73168
  page.fragments.forEach((fragment) => {
73131
73169
  if (fragment.kind === "para") {
73132
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
73133
- if (blockIndex === -1) return;
73170
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId, { from: from2, to });
73171
+ if (blockIndex === -1) {
73172
+ return;
73173
+ }
73134
73174
  const block = blocks[blockIndex];
73135
73175
  const measure = measures[blockIndex];
73136
73176
  if (!block || block.kind !== "paragraph" || measure?.kind !== "paragraph") {
@@ -73166,7 +73206,7 @@ function selectionToRects(layout, blocks, measures, from2, to) {
73166
73206
  return;
73167
73207
  }
73168
73208
  if (isAtomicFragment(fragment)) {
73169
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
73209
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId, { from: from2, to });
73170
73210
  if (blockIndex === -1) return;
73171
73211
  const block = blocks[blockIndex];
73172
73212
  const pmRange = getAtomicPmRange(fragment, block);
@@ -73187,7 +73227,7 @@ function getFragmentAtPosition(layout, blocks, measures, pos) {
73187
73227
  for (let pageIndex = 0; pageIndex < layout.pages.length; pageIndex += 1) {
73188
73228
  const page = layout.pages[pageIndex];
73189
73229
  for (const fragment of page.fragments) {
73190
- const blockIndex = blocks.findIndex((block2) => block2.id === fragment.blockId);
73230
+ const blockIndex = findBlockIndexByFragmentId(blocks, fragment.blockId);
73191
73231
  if (blockIndex === -1) {
73192
73232
  continue;
73193
73233
  }
@@ -82665,6 +82705,10 @@ function isInRegisteredSurface(event) {
82665
82705
  }
82666
82706
  return false;
82667
82707
  }
82708
+ const CommentMarkName = "commentMark";
82709
+ const TrackInsertMarkName = "trackInsert";
82710
+ const TrackDeleteMarkName = "trackDelete";
82711
+ const TrackFormatMarkName = "trackFormat";
82668
82712
  function isValidFieldAnnotationAttributes(attrs) {
82669
82713
  if (!attrs || typeof attrs !== "object") return false;
82670
82714
  const a = attrs;
@@ -82677,7 +82721,7 @@ const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
82677
82721
  const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
82678
82722
  const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
82679
82723
  const HEADER_FOOTER_INIT_BUDGET_MS = 200;
82680
- const SCROLL_DEBOUNCE_MS = 100;
82724
+ const SCROLL_DEBOUNCE_MS = 32;
82681
82725
  const MAX_ZOOM_WARNING_THRESHOLD = 10;
82682
82726
  const MAX_SELECTION_RECTS_PER_USER = 100;
82683
82727
  const DEFAULT_STALE_TIMEOUT_MS = 5 * 60 * 1e3;
@@ -82694,7 +82738,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
82694
82738
  __privateAdd$1(this, _selectionOverlay2);
82695
82739
  __privateAdd$1(this, _hiddenHost);
82696
82740
  __privateAdd$1(this, _layoutOptions);
82697
- __privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null });
82741
+ __privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null, bookmarks: /* @__PURE__ */ new Map() });
82698
82742
  __privateAdd$1(this, _domPainter, null);
82699
82743
  __privateAdd$1(this, _dragHandlerCleanup, null);
82700
82744
  __privateAdd$1(this, _layoutError, null);
@@ -82744,18 +82788,31 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
82744
82788
  __privateAdd$1(this, _isDragging, false);
82745
82789
  __privateAdd$1(this, _dragExtensionMode, "char");
82746
82790
  __privateAdd$1(this, _remoteCursorState, /* @__PURE__ */ new Map());
82791
+ __privateAdd$1(this, _remoteCursorElements, /* @__PURE__ */ new Map());
82747
82792
  __privateAdd$1(this, _remoteCursorDirty, false);
82748
82793
  __privateAdd$1(this, _remoteCursorOverlay, null);
82749
82794
  __privateAdd$1(this, _localSelectionLayer, null);
82750
82795
  __privateAdd$1(this, _awarenessCleanup, null);
82751
82796
  __privateAdd$1(this, _scrollCleanup, null);
82752
- __privateAdd$1(this, _remoteCursorRafHandle, null);
82753
82797
  __privateAdd$1(this, _scrollTimeout);
82798
+ __privateAdd$1(this, _lastRemoteCursorRenderTime, 0);
82799
+ __privateAdd$1(this, _remoteCursorThrottleTimeout, null);
82754
82800
  __privateAdd$1(this, _handlePointerDown, (event) => {
82755
82801
  if (event.button !== 0) {
82756
82802
  return;
82757
82803
  }
82758
82804
  const target = event.target;
82805
+ const linkEl = target?.closest?.("a.superdoc-link");
82806
+ if (linkEl) {
82807
+ const href = linkEl.getAttribute("href") ?? "";
82808
+ const isAnchorLink = href.startsWith("#") && href.length > 1;
82809
+ if (isAnchorLink) {
82810
+ event.preventDefault();
82811
+ event.stopPropagation();
82812
+ this.goToAnchor(href);
82813
+ return;
82814
+ }
82815
+ }
82759
82816
  const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
82760
82817
  if (!__privateGet$1(this, _layoutState).layout) {
82761
82818
  if (!isDraggableAnnotation) {
@@ -84015,12 +84072,11 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84015
84072
  __privateSet(this, _rafHandle, null);
84016
84073
  }, "Layout RAF");
84017
84074
  }
84018
- if (__privateGet$1(this, _remoteCursorRafHandle) !== null) {
84075
+ if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
84019
84076
  __privateMethod$1(this, _PresentationEditor_instances, safeCleanup_fn).call(this, () => {
84020
- const win = __privateGet$1(this, _visibleHost)?.ownerDocument?.defaultView ?? window;
84021
- win.cancelAnimationFrame(__privateGet$1(this, _remoteCursorRafHandle));
84022
- __privateSet(this, _remoteCursorRafHandle, null);
84023
- }, "Remote cursor RAF");
84077
+ clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
84078
+ __privateSet(this, _remoteCursorThrottleTimeout, null);
84079
+ }, "Remote cursor throttle");
84024
84080
  }
84025
84081
  __privateGet$1(this, _editorListeners).forEach(({ event, handler: handler2 }) => __privateGet$1(this, _editor3)?.off(event, handler2));
84026
84082
  __privateSet(this, _editorListeners, []);
@@ -84044,6 +84100,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84044
84100
  __privateSet(this, _scrollCleanup, null);
84045
84101
  }
84046
84102
  __privateGet$1(this, _remoteCursorState).clear();
84103
+ __privateGet$1(this, _remoteCursorElements).clear();
84047
84104
  __privateSet(this, _remoteCursorOverlay, null);
84048
84105
  if (__privateGet$1(this, _options)?.documentId) {
84049
84106
  __privateGet$1(_PresentationEditor2, _instances).delete(__privateGet$1(this, _options).documentId);
@@ -84086,6 +84143,94 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84086
84143
  __privateGet$1(this, _editor3).destroy();
84087
84144
  }
84088
84145
  }
84146
+ /**
84147
+ * Navigate to a bookmark/anchor in the current document (e.g., TOC links).
84148
+ *
84149
+ * This method performs asynchronous navigation to support virtualized page rendering:
84150
+ * 1. Normalizes the anchor by removing leading '#' if present
84151
+ * 2. Looks up the bookmark in the document's bookmark registry
84152
+ * 3. Determines which page contains the target position
84153
+ * 4. Scrolls the page into view (may be virtualized)
84154
+ * 5. Waits up to 2000ms for the page to mount in the DOM
84155
+ * 6. Moves the editor caret to the bookmark position
84156
+ *
84157
+ * @param anchor - Bookmark name or fragment identifier (with or without leading '#')
84158
+ * @returns Promise resolving to true if navigation succeeded, false otherwise
84159
+ *
84160
+ * @remarks
84161
+ * Navigation fails and returns false if:
84162
+ * - The anchor parameter is empty or becomes empty after normalization
84163
+ * - No layout has been computed yet
84164
+ * - The bookmark does not exist in the document
84165
+ * - The bookmark's page cannot be determined
84166
+ * - The page fails to mount within the timeout period (2000ms)
84167
+ *
84168
+ * Note: This method does not throw errors. All failures are logged and result in
84169
+ * a false return value. An 'error' event is emitted for unhandled exceptions.
84170
+ *
84171
+ * @throws Never throws directly - errors are caught, logged, and emitted as events
84172
+ */
84173
+ async goToAnchor(anchor) {
84174
+ try {
84175
+ if (!anchor) return false;
84176
+ const layout = __privateGet$1(this, _layoutState).layout;
84177
+ if (!layout) return false;
84178
+ const normalized = anchor.startsWith("#") ? anchor.slice(1) : anchor;
84179
+ if (!normalized) return false;
84180
+ const pmPos = __privateGet$1(this, _layoutState).bookmarks.get(normalized);
84181
+ if (pmPos == null) return false;
84182
+ const rects = selectionToRects(layout, __privateGet$1(this, _layoutState).blocks, __privateGet$1(this, _layoutState).measures, pmPos, pmPos + 1) ?? [];
84183
+ const rect = rects[0];
84184
+ let pageIndex = rect?.pageIndex ?? null;
84185
+ if (pageIndex == null) {
84186
+ let nextFragmentPage = null;
84187
+ let nextFragmentStart = null;
84188
+ for (const page of layout.pages) {
84189
+ for (const fragment of page.fragments) {
84190
+ if (fragment.kind !== "para") continue;
84191
+ const fragStart = fragment.pmStart;
84192
+ const fragEnd = fragment.pmEnd;
84193
+ if (fragStart == null || fragEnd == null) continue;
84194
+ if (pmPos >= fragStart && pmPos < fragEnd) {
84195
+ pageIndex = page.number - 1;
84196
+ break;
84197
+ }
84198
+ if (fragStart > pmPos && (nextFragmentStart === null || fragStart < nextFragmentStart)) {
84199
+ nextFragmentPage = page.number - 1;
84200
+ nextFragmentStart = fragStart;
84201
+ }
84202
+ }
84203
+ if (pageIndex != null) break;
84204
+ }
84205
+ if (pageIndex == null && nextFragmentPage != null) {
84206
+ pageIndex = nextFragmentPage;
84207
+ }
84208
+ }
84209
+ if (pageIndex == null) return false;
84210
+ __privateMethod$1(this, _PresentationEditor_instances, scrollPageIntoView_fn).call(this, pageIndex);
84211
+ await __privateMethod$1(this, _PresentationEditor_instances, waitForPageMount_fn).call(this, pageIndex, { timeout: _PresentationEditor2.ANCHOR_NAV_TIMEOUT_MS });
84212
+ const pageEl = __privateGet$1(this, _painterHost)?.querySelector(`[data-page-index="${pageIndex}"]`);
84213
+ if (pageEl) {
84214
+ pageEl.scrollIntoView({ behavior: "instant", block: "start" });
84215
+ }
84216
+ const activeEditor = this.getActiveEditor();
84217
+ if (activeEditor?.commands?.setTextSelection) {
84218
+ activeEditor.commands.setTextSelection({ from: pmPos, to: pmPos });
84219
+ } else {
84220
+ console.warn(
84221
+ "[PresentationEditor] goToAnchor: Navigation succeeded but could not move caret (editor commands unavailable)"
84222
+ );
84223
+ }
84224
+ return true;
84225
+ } catch (error) {
84226
+ console.error("[PresentationEditor] goToAnchor failed:", error);
84227
+ this.emit("error", {
84228
+ error,
84229
+ context: "goToAnchor"
84230
+ });
84231
+ return false;
84232
+ }
84233
+ }
84089
84234
  };
84090
84235
  _instances = /* @__PURE__ */ new WeakMap();
84091
84236
  _options = /* @__PURE__ */ new WeakMap();
@@ -84146,14 +84291,43 @@ _dragAnchor = /* @__PURE__ */ new WeakMap();
84146
84291
  _isDragging = /* @__PURE__ */ new WeakMap();
84147
84292
  _dragExtensionMode = /* @__PURE__ */ new WeakMap();
84148
84293
  _remoteCursorState = /* @__PURE__ */ new WeakMap();
84294
+ _remoteCursorElements = /* @__PURE__ */ new WeakMap();
84149
84295
  _remoteCursorDirty = /* @__PURE__ */ new WeakMap();
84150
84296
  _remoteCursorOverlay = /* @__PURE__ */ new WeakMap();
84151
84297
  _localSelectionLayer = /* @__PURE__ */ new WeakMap();
84152
84298
  _awarenessCleanup = /* @__PURE__ */ new WeakMap();
84153
84299
  _scrollCleanup = /* @__PURE__ */ new WeakMap();
84154
- _remoteCursorRafHandle = /* @__PURE__ */ new WeakMap();
84155
84300
  _scrollTimeout = /* @__PURE__ */ new WeakMap();
84301
+ _lastRemoteCursorRenderTime = /* @__PURE__ */ new WeakMap();
84302
+ _remoteCursorThrottleTimeout = /* @__PURE__ */ new WeakMap();
84156
84303
  _PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
84304
+ collectCommentPositions_fn = function() {
84305
+ const editorState = __privateGet$1(this, _editor3)?.state;
84306
+ if (!editorState) return {};
84307
+ const doc2 = editorState.doc;
84308
+ const trackChangeMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
84309
+ const pmPositions = {};
84310
+ doc2.descendants((node, pos) => {
84311
+ const marks = node.marks || [];
84312
+ for (const mark of marks) {
84313
+ let threadId;
84314
+ if (mark.type.name === CommentMarkName) {
84315
+ threadId = mark.attrs.commentId || mark.attrs.importedId;
84316
+ } else if (trackChangeMarks.includes(mark.type.name)) {
84317
+ threadId = mark.attrs.id;
84318
+ }
84319
+ if (!threadId) continue;
84320
+ const nodeEnd = pos + node.nodeSize;
84321
+ if (!pmPositions[threadId]) {
84322
+ pmPositions[threadId] = { threadId, start: pos, end: nodeEnd };
84323
+ } else {
84324
+ pmPositions[threadId].start = Math.min(pmPositions[threadId].start, pos);
84325
+ pmPositions[threadId].end = Math.max(pmPositions[threadId].end, nodeEnd);
84326
+ }
84327
+ }
84328
+ });
84329
+ return pmPositions;
84330
+ };
84157
84331
  aggregateLayoutBounds_fn = function(rects) {
84158
84332
  if (!rects.length) return null;
84159
84333
  const top2 = Math.min(...rects.map((rect) => rect.top));
@@ -84186,9 +84360,13 @@ setupEditorListeners_fn = function() {
84186
84360
  __privateSet(this, _pendingDocChange, true);
84187
84361
  __privateMethod$1(this, _PresentationEditor_instances, scheduleRerender_fn).call(this);
84188
84362
  }
84363
+ if (transaction?.docChanged) {
84364
+ __privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
84365
+ }
84189
84366
  };
84190
84367
  const handleSelection = () => {
84191
84368
  __privateMethod$1(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
84369
+ __privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
84192
84370
  };
84193
84371
  __privateGet$1(this, _editor3).on("update", handleUpdate);
84194
84372
  __privateGet$1(this, _editor3).on("selectionUpdate", handleSelection);
@@ -84258,6 +84436,29 @@ setupCollaborationCursors_fn = function() {
84258
84436
  });
84259
84437
  handleAwarenessChange();
84260
84438
  };
84439
+ updateLocalAwarenessCursor_fn = function() {
84440
+ const provider = __privateGet$1(this, _options).collaborationProvider;
84441
+ if (!provider?.awareness) return;
84442
+ if (typeof provider.awareness.setLocalStateField !== "function") {
84443
+ return;
84444
+ }
84445
+ const ystate = ySyncPluginKey.getState(__privateGet$1(this, _editor3).state);
84446
+ if (!ystate?.binding?.mapping) return;
84447
+ const { selection } = __privateGet$1(this, _editor3).state;
84448
+ const { anchor, head } = selection;
84449
+ try {
84450
+ const relAnchor = absolutePositionToRelativePosition(anchor, ystate.type, ystate.binding.mapping);
84451
+ const relHead = absolutePositionToRelativePosition(head, ystate.type, ystate.binding.mapping);
84452
+ if (relAnchor && relHead) {
84453
+ const cursorData = {
84454
+ anchor: relAnchor,
84455
+ head: relHead
84456
+ };
84457
+ provider.awareness.setLocalStateField("cursor", cursorData);
84458
+ }
84459
+ } catch {
84460
+ }
84461
+ };
84261
84462
  normalizeAwarenessStates_fn = function() {
84262
84463
  const provider = __privateGet$1(this, _options).collaborationProvider;
84263
84464
  if (!provider?.awareness) return /* @__PURE__ */ new Map();
@@ -84325,27 +84526,45 @@ scheduleRemoteCursorUpdate_fn = function() {
84325
84526
  if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
84326
84527
  if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
84327
84528
  __privateSet(this, _remoteCursorUpdateScheduled, true);
84328
- const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
84329
- __privateSet(this, _remoteCursorRafHandle, win.requestAnimationFrame(() => {
84330
- __privateSet(this, _remoteCursorUpdateScheduled, false);
84331
- __privateSet(this, _remoteCursorRafHandle, null);
84332
- __privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
84333
- }));
84529
+ queueMicrotask(() => {
84530
+ if (!__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
84531
+ const now = performance.now();
84532
+ const elapsed = now - __privateGet$1(this, _lastRemoteCursorRenderTime);
84533
+ const THROTTLE_MS = 16;
84534
+ if (elapsed >= THROTTLE_MS) {
84535
+ if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
84536
+ clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
84537
+ __privateSet(this, _remoteCursorThrottleTimeout, null);
84538
+ }
84539
+ __privateSet(this, _remoteCursorUpdateScheduled, false);
84540
+ __privateSet(this, _lastRemoteCursorRenderTime, now);
84541
+ __privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
84542
+ return;
84543
+ }
84544
+ const remaining = THROTTLE_MS - elapsed;
84545
+ __privateSet(this, _remoteCursorThrottleTimeout, window.setTimeout(() => {
84546
+ __privateSet(this, _remoteCursorUpdateScheduled, false);
84547
+ __privateSet(this, _remoteCursorThrottleTimeout, null);
84548
+ __privateSet(this, _lastRemoteCursorRenderTime, performance.now());
84549
+ __privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
84550
+ }, remaining));
84551
+ });
84334
84552
  };
84335
84553
  scheduleRemoteCursorReRender_fn = function() {
84336
84554
  if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
84337
84555
  if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
84338
84556
  __privateSet(this, _remoteCursorUpdateScheduled, true);
84339
84557
  const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
84340
- __privateSet(this, _remoteCursorRafHandle, win.requestAnimationFrame(() => {
84558
+ win.requestAnimationFrame(() => {
84341
84559
  __privateSet(this, _remoteCursorUpdateScheduled, false);
84342
- __privateSet(this, _remoteCursorRafHandle, null);
84560
+ __privateSet(this, _lastRemoteCursorRenderTime, performance.now());
84343
84561
  __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursors_fn).call(this);
84344
- }));
84562
+ });
84345
84563
  };
84346
84564
  updateRemoteCursors_fn = function() {
84347
84565
  if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) {
84348
84566
  __privateGet$1(this, _remoteCursorState).clear();
84567
+ __privateGet$1(this, _remoteCursorElements).clear();
84349
84568
  if (__privateGet$1(this, _remoteCursorOverlay)) {
84350
84569
  __privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
84351
84570
  }
@@ -84374,9 +84593,6 @@ updateRemoteCursors_fn = function() {
84374
84593
  }
84375
84594
  };
84376
84595
  renderRemoteCursors_fn = function() {
84377
- if (__privateGet$1(this, _remoteCursorOverlay)) {
84378
- __privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
84379
- }
84380
84596
  const layout = __privateGet$1(this, _layoutState)?.layout;
84381
84597
  const blocks = __privateGet$1(this, _layoutState)?.blocks;
84382
84598
  const measures = __privateGet$1(this, _layoutState)?.measures;
@@ -84385,37 +84601,63 @@ renderRemoteCursors_fn = function() {
84385
84601
  }
84386
84602
  const maxVisible = __privateGet$1(this, _layoutOptions).presence?.maxVisible ?? 20;
84387
84603
  const sortedCursors = Array.from(__privateGet$1(this, _remoteCursorState).values()).sort((a, b2) => b2.updatedAt - a.updatedAt).slice(0, maxVisible);
84604
+ const visibleClientIds = /* @__PURE__ */ new Set();
84388
84605
  sortedCursors.forEach((cursor) => {
84606
+ visibleClientIds.add(cursor.clientId);
84389
84607
  if (cursor.anchor === cursor.head) {
84390
84608
  __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCaret_fn).call(this, cursor);
84391
84609
  } else {
84392
84610
  __privateMethod$1(this, _PresentationEditor_instances, renderRemoteSelection_fn).call(this, cursor);
84393
84611
  }
84394
84612
  });
84613
+ __privateGet$1(this, _remoteCursorElements).forEach((element, clientId) => {
84614
+ if (!visibleClientIds.has(clientId)) {
84615
+ element.remove();
84616
+ __privateGet$1(this, _remoteCursorElements).delete(clientId);
84617
+ }
84618
+ });
84395
84619
  };
84396
84620
  renderRemoteCaret_fn = function(cursor) {
84397
84621
  const caretLayout = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRect_fn).call(this, cursor.head);
84398
- if (!caretLayout) return;
84399
- const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
84400
- if (!coords) return;
84401
84622
  const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
84402
84623
  const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
84403
84624
  const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
84404
- const caretEl = doc2.createElement("div");
84405
- caretEl.className = "presentation-editor__remote-caret";
84406
- caretEl.style.position = "absolute";
84407
- caretEl.style.left = `${coords.x}px`;
84408
- caretEl.style.top = `${coords.y}px`;
84409
- caretEl.style.width = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px`;
84625
+ let caretEl = __privateGet$1(this, _remoteCursorElements).get(cursor.clientId);
84626
+ const isNewElement = !caretEl;
84627
+ if (isNewElement) {
84628
+ caretEl = doc2.createElement("div");
84629
+ caretEl.className = "presentation-editor__remote-caret";
84630
+ caretEl.style.position = "absolute";
84631
+ caretEl.style.width = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px`;
84632
+ caretEl.style.borderLeft = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px solid ${color}`;
84633
+ caretEl.style.pointerEvents = "none";
84634
+ caretEl.style.transition = "transform 50ms ease-out, height 50ms ease-out, opacity 100ms ease-out";
84635
+ caretEl.style.willChange = "transform";
84636
+ caretEl.setAttribute("data-client-id", cursor.clientId.toString());
84637
+ caretEl.setAttribute("aria-hidden", "true");
84638
+ if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
84639
+ __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
84640
+ }
84641
+ __privateGet$1(this, _remoteCursorElements).set(cursor.clientId, caretEl);
84642
+ __privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
84643
+ }
84644
+ if (!caretLayout) {
84645
+ caretEl.style.opacity = "0";
84646
+ return;
84647
+ }
84648
+ const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
84649
+ if (!coords) {
84650
+ caretEl.style.opacity = "0";
84651
+ return;
84652
+ }
84653
+ caretEl.style.opacity = "1";
84654
+ caretEl.style.transform = `translate(${coords.x}px, ${coords.y}px)`;
84410
84655
  caretEl.style.height = `${Math.max(1, caretLayout.height * zoom)}px`;
84411
- caretEl.style.borderLeft = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px solid ${color}`;
84412
- caretEl.style.pointerEvents = "none";
84413
- caretEl.setAttribute("data-client-id", cursor.clientId.toString());
84414
- caretEl.setAttribute("aria-hidden", "true");
84415
- if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
84416
- __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
84656
+ caretEl.style.borderLeftColor = color;
84657
+ const labelEl = caretEl.querySelector(".presentation-editor__remote-label");
84658
+ if (labelEl) {
84659
+ labelEl.style.backgroundColor = color;
84417
84660
  }
84418
- __privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
84419
84661
  };
84420
84662
  renderRemoteCursorLabel_fn = function(caretEl, cursor) {
84421
84663
  const labelFormatter = __privateGet$1(this, _layoutOptions).presence?.labelFormatter;
@@ -84850,6 +85092,7 @@ rerender_fn = async function() {
84850
85092
  }
84851
85093
  const sectionMetadata = [];
84852
85094
  let blocks;
85095
+ let bookmarks = /* @__PURE__ */ new Map();
84853
85096
  try {
84854
85097
  const converter2 = __privateGet$1(this, _editor3).converter;
84855
85098
  const converterContext = converter2 ? {
@@ -84868,6 +85111,7 @@ rerender_fn = async function() {
84868
85111
  converterContext
84869
85112
  });
84870
85113
  blocks = result.blocks;
85114
+ bookmarks = result.bookmarks ?? /* @__PURE__ */ new Map();
84871
85115
  } catch (error) {
84872
85116
  __privateMethod$1(this, _PresentationEditor_instances, handleLayoutError_fn).call(this, "render", __privateMethod$1(this, _PresentationEditor_instances, decorateError_fn).call(this, error, "toFlowBlocks"));
84873
85117
  return;
@@ -84915,7 +85159,8 @@ rerender_fn = async function() {
84915
85159
  __privateSet(this, _sectionMetadata, sectionMetadata);
84916
85160
  const converter = __privateGet$1(this, _editor3).converter;
84917
85161
  __privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles));
84918
- __privateSet(this, _layoutState, { blocks, measures, layout });
85162
+ const anchorMap = __privateMethod$1(this, _PresentationEditor_instances, computeAnchorMap_fn).call(this, bookmarks, layout);
85163
+ __privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
84919
85164
  __privateSet(this, _headerLayoutResults, headerLayouts ?? null);
84920
85165
  __privateSet(this, _footerLayoutResults, footerLayouts ?? null);
84921
85166
  await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
@@ -84964,6 +85209,11 @@ rerender_fn = async function() {
84964
85209
  const payload = { layout, blocks, measures, metrics };
84965
85210
  this.emit("layoutUpdated", payload);
84966
85211
  this.emit("paginationUpdate", payload);
85212
+ const commentPositions = __privateMethod$1(this, _PresentationEditor_instances, collectCommentPositions_fn).call(this);
85213
+ const positionKeys = Object.keys(commentPositions);
85214
+ if (positionKeys.length > 0) {
85215
+ this.emit("commentPositions", { positions: commentPositions });
85216
+ }
84967
85217
  if (__privateGet$1(this, _telemetryEmitter) && metrics) {
84968
85218
  __privateGet$1(this, _telemetryEmitter).call(this, { type: "layout", data: { layout, blocks, measures, metrics } });
84969
85219
  }
@@ -85569,9 +85819,9 @@ emitHeaderFooterEditingContext_fn = function(editor) {
85569
85819
  __privateMethod$1(this, _PresentationEditor_instances, announce_fn).call(this, __privateGet$1(this, _session).mode === "body" ? "Exited header/footer edit mode." : `Editing ${__privateGet$1(this, _session).kind === "header" ? "Header" : "Footer"} (${__privateGet$1(this, _session).sectionType ?? "default"})`);
85570
85820
  };
85571
85821
  updateAwarenessSession_fn = function() {
85572
- const provider = __privateGet$1(this, _editor3).options?.collaborationProvider;
85822
+ const provider = __privateGet$1(this, _options).collaborationProvider;
85573
85823
  const awareness = provider?.awareness;
85574
- if (!awareness?.setLocalStateField) {
85824
+ if (!awareness || typeof awareness.setLocalStateField !== "function") {
85575
85825
  return;
85576
85826
  }
85577
85827
  if (__privateGet$1(this, _session).mode === "body") {
@@ -85680,6 +85930,62 @@ scrollPageIntoView_fn = function(pageIndex) {
85680
85930
  __privateGet$1(this, _visibleHost).scrollTop = yPosition;
85681
85931
  }
85682
85932
  };
85933
+ computeAnchorMap_fn = function(bookmarks, layout) {
85934
+ const anchorMap = /* @__PURE__ */ new Map();
85935
+ const blockPmRanges = /* @__PURE__ */ new Map();
85936
+ const computeBlockRange = (blockId) => {
85937
+ if (blockPmRanges.has(blockId)) {
85938
+ const cached = blockPmRanges.get(blockId);
85939
+ return { pmStart: cached.pmStart, pmEnd: cached.pmEnd };
85940
+ }
85941
+ const block = __privateGet$1(this, _layoutState).blocks.find((b2) => b2.id === blockId);
85942
+ if (!block || block.kind !== "paragraph") {
85943
+ blockPmRanges.set(blockId, { pmStart: null, pmEnd: null, hasFragmentPositions: false });
85944
+ return { pmStart: null, pmEnd: null };
85945
+ }
85946
+ let pmStart = null;
85947
+ let pmEnd = null;
85948
+ for (const run2 of block.runs) {
85949
+ if (run2.pmStart != null) {
85950
+ pmStart = pmStart == null ? run2.pmStart : Math.min(pmStart, run2.pmStart);
85951
+ }
85952
+ if (run2.pmEnd != null) {
85953
+ pmEnd = pmEnd == null ? run2.pmEnd : Math.max(pmEnd, run2.pmEnd);
85954
+ }
85955
+ }
85956
+ blockPmRanges.set(blockId, { pmStart, pmEnd, hasFragmentPositions: false });
85957
+ return { pmStart, pmEnd };
85958
+ };
85959
+ bookmarks.forEach((pmPosition, bookmarkName) => {
85960
+ for (const page of layout.pages) {
85961
+ for (const fragment of page.fragments) {
85962
+ if (fragment.kind !== "para") continue;
85963
+ let fragStart = fragment.pmStart;
85964
+ let fragEnd = fragment.pmEnd;
85965
+ if (fragStart == null || fragEnd == null) {
85966
+ const range2 = computeBlockRange(fragment.blockId);
85967
+ if (range2.pmStart != null && range2.pmEnd != null) {
85968
+ fragStart = range2.pmStart;
85969
+ fragEnd = range2.pmEnd;
85970
+ }
85971
+ } else {
85972
+ const cached = blockPmRanges.get(fragment.blockId);
85973
+ blockPmRanges.set(fragment.blockId, {
85974
+ pmStart: cached?.pmStart ?? fragStart,
85975
+ pmEnd: cached?.pmEnd ?? fragEnd,
85976
+ hasFragmentPositions: true
85977
+ });
85978
+ }
85979
+ if (fragStart == null || fragEnd == null) continue;
85980
+ if (pmPosition >= fragStart && pmPosition < fragEnd) {
85981
+ anchorMap.set(bookmarkName, page.number);
85982
+ return;
85983
+ }
85984
+ }
85985
+ }
85986
+ });
85987
+ return anchorMap;
85988
+ };
85683
85989
  waitForPageMount_fn = async function(pageIndex, options = {}) {
85684
85990
  const timeout2 = options.timeout ?? 2e3;
85685
85991
  const startTime = performance.now();
@@ -86299,6 +86605,7 @@ _PresentationEditor.CURSOR_STYLES = {
86299
86605
  SELECTION_BORDER_RADIUS: "2px",
86300
86606
  MAX_LABEL_LENGTH: 30
86301
86607
  };
86608
+ _PresentationEditor.ANCHOR_NAV_TIMEOUT_MS = 2e3;
86302
86609
  let PresentationEditor = _PresentationEditor;
86303
86610
  class PresentationInputBridge {
86304
86611
  /**
@@ -90430,6 +90737,7 @@ const Paragraph = OxmlNode.create({
90430
90737
  return ["p", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
90431
90738
  },
90432
90739
  addNodeView() {
90740
+ if (this.editor.options?.mode !== "docx" || !this.editor.converter) return null;
90433
90741
  if (shouldSkipNodeView(this.editor)) return null;
90434
90742
  return ({ node, editor, getPos, decorations, extensionAttrs }) => {
90435
90743
  return new ParagraphNodeView(node, editor, getPos, decorations, extensionAttrs);
@@ -90672,7 +90980,7 @@ const CommentReference = Node$1.create({
90672
90980
  }
90673
90981
  });
90674
90982
  const CommentsMark = Mark2.create({
90675
- name: CommentMarkName,
90983
+ name: CommentMarkName$1,
90676
90984
  group: "comments",
90677
90985
  excludes: "",
90678
90986
  addOptions() {
@@ -90691,10 +90999,10 @@ const CommentsMark = Mark2.create({
90691
90999
  };
90692
91000
  },
90693
91001
  parseDOM() {
90694
- return [{ tag: CommentMarkName }];
91002
+ return [{ tag: CommentMarkName$1 }];
90695
91003
  },
90696
91004
  renderDOM({ htmlAttributes }) {
90697
- return [CommentMarkName, Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
91005
+ return [CommentMarkName$1, Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
90698
91006
  }
90699
91007
  });
90700
91008
  let cache$2 = /* @__PURE__ */ new WeakMap();
@@ -100878,7 +101186,7 @@ function addLinkRelationship({ editor, href }) {
100878
101186
  }
100879
101187
  const trackInsertClass = "track-insert";
100880
101188
  const TrackInsert = Mark2.create({
100881
- name: TrackInsertMarkName,
101189
+ name: TrackInsertMarkName$1,
100882
101190
  group: "track",
100883
101191
  inclusive: false,
100884
101192
  addOptions() {
@@ -100955,7 +101263,7 @@ const TrackInsert = Mark2.create({
100955
101263
  });
100956
101264
  const trackDeleteClass = "track-delete";
100957
101265
  const TrackDelete = Mark2.create({
100958
- name: TrackDeleteMarkName,
101266
+ name: TrackDeleteMarkName$1,
100959
101267
  group: "track",
100960
101268
  inclusive: false,
100961
101269
  addOptions() {
@@ -101064,7 +101372,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
101064
101372
  }, Symbol.toStringTag, { value: "Module" }));
101065
101373
  const trackFormatClass = "track-format";
101066
101374
  const TrackFormat = Mark2.create({
101067
- name: TrackFormatMarkName,
101375
+ name: TrackFormatMarkName$1,
101068
101376
  group: "track",
101069
101377
  inclusive: false,
101070
101378
  addOptions() {
@@ -101278,7 +101586,7 @@ const TrackChanges = Extension.create({
101278
101586
  tr.setMeta("inputType", "acceptReject");
101279
101587
  const map22 = new Mapping();
101280
101588
  doc2.nodesBetween(from2, to, (node, pos) => {
101281
- if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
101589
+ if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
101282
101590
  const deletionStep = new ReplaceStep(
101283
101591
  map22.map(Math.max(pos, from2)),
101284
101592
  map22.map(Math.min(pos + node.nodeSize, to)),
@@ -101286,8 +101594,8 @@ const TrackChanges = Extension.create({
101286
101594
  );
101287
101595
  tr.step(deletionStep);
101288
101596
  map22.appendMap(deletionStep.getMap());
101289
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName)) {
101290
- const insertionMark = node.marks.find((mark) => mark.type.name === TrackInsertMarkName);
101597
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1)) {
101598
+ const insertionMark = node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1);
101291
101599
  tr.step(
101292
101600
  new RemoveMarkStep(
101293
101601
  map22.map(Math.max(pos, from2)),
@@ -101295,8 +101603,8 @@ const TrackChanges = Extension.create({
101295
101603
  insertionMark
101296
101604
  )
101297
101605
  );
101298
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName)) {
101299
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
101606
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1)) {
101607
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
101300
101608
  tr.step(
101301
101609
  new RemoveMarkStep(
101302
101610
  map22.map(Math.max(pos, from2)),
@@ -101318,8 +101626,8 @@ const TrackChanges = Extension.create({
101318
101626
  tr.setMeta("inputType", "acceptReject");
101319
101627
  const map22 = new Mapping();
101320
101628
  doc2.nodesBetween(from2, to, (node, pos) => {
101321
- if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName)) {
101322
- const deletionMark = node.marks.find((mark) => mark.type.name === TrackDeleteMarkName);
101629
+ if (node.marks && node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1)) {
101630
+ const deletionMark = node.marks.find((mark) => mark.type.name === TrackDeleteMarkName$1);
101323
101631
  tr.step(
101324
101632
  new RemoveMarkStep(
101325
101633
  map22.map(Math.max(pos, from2)),
@@ -101327,7 +101635,7 @@ const TrackChanges = Extension.create({
101327
101635
  deletionMark
101328
101636
  )
101329
101637
  );
101330
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName)) {
101638
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackInsertMarkName$1)) {
101331
101639
  const deletionStep = new ReplaceStep(
101332
101640
  map22.map(Math.max(pos, from2)),
101333
101641
  map22.map(Math.min(pos + node.nodeSize, to)),
@@ -101335,8 +101643,8 @@ const TrackChanges = Extension.create({
101335
101643
  );
101336
101644
  tr.step(deletionStep);
101337
101645
  map22.appendMap(deletionStep.getMap());
101338
- } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName)) {
101339
- const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName);
101646
+ } else if (node.marks && node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1)) {
101647
+ const formatChangeMark = node.marks.find((mark) => mark.type.name === TrackFormatMarkName$1);
101340
101648
  formatChangeMark.attrs.before.forEach((oldMark) => {
101341
101649
  tr.step(
101342
101650
  new AddMarkStep(
@@ -101512,7 +101820,7 @@ const getChangesByIdToResolve = (state2, id) => {
101512
101820
  const hasContentBetween = state2.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
101513
101821
  return !hasContentBetween;
101514
101822
  };
101515
- const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
101823
+ const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName$1 && secondType === TrackInsertMarkName$1 || firstType === TrackInsertMarkName$1 && secondType === TrackDeleteMarkName$1;
101516
101824
  const linkedBefore = [];
101517
101825
  const linkedAfter = [];
101518
101826
  const collectDirection = (direction, collection) => {
@@ -121878,7 +122186,8 @@ const _sfc_main$2 = {
121878
122186
  if (!surface) {
121879
122187
  return;
121880
122188
  }
121881
- moveCursorToMouseEvent(event.detail, props.editor);
122189
+ const detail = event?.detail ?? {};
122190
+ moveCursorToMouseEvent(detail, props.editor);
121882
122191
  setTimeout(() => {
121883
122192
  const currentState = props.editor.state;
121884
122193
  const hasLink = selectionHasNodeOrMark(currentState, "link", { requireEnds: true });
@@ -121893,8 +122202,8 @@ const _sfc_main$2 = {
121893
122202
  closePopover: props.closePopover
121894
122203
  },
121895
122204
  {
121896
- left: `${event.detail.clientX - surfaceRect.left}px`,
121897
- top: `${event.detail.clientY - surfaceRect.top + 15}px`
122205
+ left: `${detail.clientX - surfaceRect.left}px`,
122206
+ top: `${detail.clientY - surfaceRect.top + 15}px`
121898
122207
  }
121899
122208
  );
121900
122209
  }