@harbour-enterprises/superdoc 1.0.0-beta.33 → 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 (27) hide show
  1. package/dist/chunks/{PdfViewer-1hoKlV0M.cjs → PdfViewer-CMVOK_jD.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-CVrn4X-3.es.js → PdfViewer-DSx1zQC5.es.js} +1 -1
  3. package/dist/chunks/{index-BTDOWM_2.es.js → index-8_ijaxSz.es.js} +3 -3
  4. package/dist/chunks/{index-VKd9fPLu.cjs → index-BqXrnRP8.cjs} +3 -3
  5. package/dist/chunks/{index-hX4H5xPH-DfkQd7UH.cjs → index-CQeXM6oB-BAx-uLYb.cjs} +1 -1
  6. package/dist/chunks/{index-hX4H5xPH-ChjioDix.es.js → index-CQeXM6oB-DjCz53Th.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-Dzrm58hW.cjs → super-editor.es-CgTVSX1p.cjs} +280 -48
  8. package/dist/chunks/{super-editor.es-CpmC4G9F.es.js → super-editor.es-TkKngzld.es.js} +280 -48
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-DZNL-ld-.js → converter-Hv-kNdxI.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-DukE72iM.js → docx-zipper-C6nUdlsw.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-CJCGDp-l.js → editor-uvvccWc5.js} +334 -52
  13. package/dist/super-editor/chunks/{index-hX4H5xPH.js → index-CQeXM6oB.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-D6tqFv6-.js → toolbar-BCWRHtW5.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +10 -9
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +282 -50
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -41858,7 +41858,7 @@ const _SuperConverter = class _SuperConverter2 {
41858
41858
  static getStoredSuperdocVersion(docx) {
41859
41859
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
41860
41860
  }
41861
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.33") {
41861
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.34") {
41862
41862
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
41863
41863
  }
41864
41864
  /**
@@ -45164,7 +45164,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
45164
45164
  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);
45165
45165
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
45166
45166
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
45167
- 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, collectCommentPositions_fn, 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;
45167
+ 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;
45168
45168
  var GOOD_LEAF_SIZE = 200;
45169
45169
  var RopeSequence = function RopeSequence2() {
45170
45170
  };
@@ -59031,7 +59031,7 @@ const isHeadless = (editor) => {
59031
59031
  const shouldSkipNodeView = (editor) => {
59032
59032
  return isHeadless(editor);
59033
59033
  };
59034
- const summaryVersion = "1.0.0-beta.33";
59034
+ const summaryVersion = "1.0.0-beta.34";
59035
59035
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59036
59036
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59037
59037
  function mapAttributes(attrs) {
@@ -59820,7 +59820,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
59820
59820
  { default: remarkStringify },
59821
59821
  { default: remarkGfm }
59822
59822
  ] = await Promise.all([
59823
- Promise.resolve().then(() => require("./index-hX4H5xPH-DfkQd7UH.cjs")),
59823
+ Promise.resolve().then(() => require("./index-CQeXM6oB-BAx-uLYb.cjs")),
59824
59824
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
59825
59825
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
59826
59826
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -60025,7 +60025,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60025
60025
  * Process collaboration migrations
60026
60026
  */
60027
60027
  processCollaborationMigrations() {
60028
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.33");
60028
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.34");
60029
60029
  if (!this.options.ydoc) return;
60030
60030
  const metaMap = this.options.ydoc.getMap("meta");
60031
60031
  let docVersion = metaMap.get("version");
@@ -82738,7 +82738,7 @@ const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
82738
82738
  const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
82739
82739
  const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
82740
82740
  const HEADER_FOOTER_INIT_BUDGET_MS = 200;
82741
- const SCROLL_DEBOUNCE_MS = 100;
82741
+ const SCROLL_DEBOUNCE_MS = 32;
82742
82742
  const MAX_ZOOM_WARNING_THRESHOLD = 10;
82743
82743
  const MAX_SELECTION_RECTS_PER_USER = 100;
82744
82744
  const DEFAULT_STALE_TIMEOUT_MS = 5 * 60 * 1e3;
@@ -82755,7 +82755,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
82755
82755
  __privateAdd$1(this, _selectionOverlay2);
82756
82756
  __privateAdd$1(this, _hiddenHost);
82757
82757
  __privateAdd$1(this, _layoutOptions);
82758
- __privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null });
82758
+ __privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null, bookmarks: /* @__PURE__ */ new Map() });
82759
82759
  __privateAdd$1(this, _domPainter, null);
82760
82760
  __privateAdd$1(this, _dragHandlerCleanup, null);
82761
82761
  __privateAdd$1(this, _layoutError, null);
@@ -82805,18 +82805,31 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
82805
82805
  __privateAdd$1(this, _isDragging, false);
82806
82806
  __privateAdd$1(this, _dragExtensionMode, "char");
82807
82807
  __privateAdd$1(this, _remoteCursorState, /* @__PURE__ */ new Map());
82808
+ __privateAdd$1(this, _remoteCursorElements, /* @__PURE__ */ new Map());
82808
82809
  __privateAdd$1(this, _remoteCursorDirty, false);
82809
82810
  __privateAdd$1(this, _remoteCursorOverlay, null);
82810
82811
  __privateAdd$1(this, _localSelectionLayer, null);
82811
82812
  __privateAdd$1(this, _awarenessCleanup, null);
82812
82813
  __privateAdd$1(this, _scrollCleanup, null);
82813
- __privateAdd$1(this, _remoteCursorRafHandle, null);
82814
82814
  __privateAdd$1(this, _scrollTimeout);
82815
+ __privateAdd$1(this, _lastRemoteCursorRenderTime, 0);
82816
+ __privateAdd$1(this, _remoteCursorThrottleTimeout, null);
82815
82817
  __privateAdd$1(this, _handlePointerDown, (event) => {
82816
82818
  if (event.button !== 0) {
82817
82819
  return;
82818
82820
  }
82819
82821
  const target = event.target;
82822
+ const linkEl = target?.closest?.("a.superdoc-link");
82823
+ if (linkEl) {
82824
+ const href = linkEl.getAttribute("href") ?? "";
82825
+ const isAnchorLink = href.startsWith("#") && href.length > 1;
82826
+ if (isAnchorLink) {
82827
+ event.preventDefault();
82828
+ event.stopPropagation();
82829
+ this.goToAnchor(href);
82830
+ return;
82831
+ }
82832
+ }
82820
82833
  const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
82821
82834
  if (!__privateGet$1(this, _layoutState).layout) {
82822
82835
  if (!isDraggableAnnotation) {
@@ -84076,12 +84089,11 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84076
84089
  __privateSet(this, _rafHandle, null);
84077
84090
  }, "Layout RAF");
84078
84091
  }
84079
- if (__privateGet$1(this, _remoteCursorRafHandle) !== null) {
84092
+ if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
84080
84093
  __privateMethod$1(this, _PresentationEditor_instances, safeCleanup_fn).call(this, () => {
84081
- const win = __privateGet$1(this, _visibleHost)?.ownerDocument?.defaultView ?? window;
84082
- win.cancelAnimationFrame(__privateGet$1(this, _remoteCursorRafHandle));
84083
- __privateSet(this, _remoteCursorRafHandle, null);
84084
- }, "Remote cursor RAF");
84094
+ clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
84095
+ __privateSet(this, _remoteCursorThrottleTimeout, null);
84096
+ }, "Remote cursor throttle");
84085
84097
  }
84086
84098
  __privateGet$1(this, _editorListeners).forEach(({ event, handler: handler2 }) => __privateGet$1(this, _editor3)?.off(event, handler2));
84087
84099
  __privateSet(this, _editorListeners, []);
@@ -84105,6 +84117,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84105
84117
  __privateSet(this, _scrollCleanup, null);
84106
84118
  }
84107
84119
  __privateGet$1(this, _remoteCursorState).clear();
84120
+ __privateGet$1(this, _remoteCursorElements).clear();
84108
84121
  __privateSet(this, _remoteCursorOverlay, null);
84109
84122
  if (__privateGet$1(this, _options)?.documentId) {
84110
84123
  __privateGet$1(_PresentationEditor2, _instances).delete(__privateGet$1(this, _options).documentId);
@@ -84147,6 +84160,94 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
84147
84160
  __privateGet$1(this, _editor3).destroy();
84148
84161
  }
84149
84162
  }
84163
+ /**
84164
+ * Navigate to a bookmark/anchor in the current document (e.g., TOC links).
84165
+ *
84166
+ * This method performs asynchronous navigation to support virtualized page rendering:
84167
+ * 1. Normalizes the anchor by removing leading '#' if present
84168
+ * 2. Looks up the bookmark in the document's bookmark registry
84169
+ * 3. Determines which page contains the target position
84170
+ * 4. Scrolls the page into view (may be virtualized)
84171
+ * 5. Waits up to 2000ms for the page to mount in the DOM
84172
+ * 6. Moves the editor caret to the bookmark position
84173
+ *
84174
+ * @param anchor - Bookmark name or fragment identifier (with or without leading '#')
84175
+ * @returns Promise resolving to true if navigation succeeded, false otherwise
84176
+ *
84177
+ * @remarks
84178
+ * Navigation fails and returns false if:
84179
+ * - The anchor parameter is empty or becomes empty after normalization
84180
+ * - No layout has been computed yet
84181
+ * - The bookmark does not exist in the document
84182
+ * - The bookmark's page cannot be determined
84183
+ * - The page fails to mount within the timeout period (2000ms)
84184
+ *
84185
+ * Note: This method does not throw errors. All failures are logged and result in
84186
+ * a false return value. An 'error' event is emitted for unhandled exceptions.
84187
+ *
84188
+ * @throws Never throws directly - errors are caught, logged, and emitted as events
84189
+ */
84190
+ async goToAnchor(anchor) {
84191
+ try {
84192
+ if (!anchor) return false;
84193
+ const layout = __privateGet$1(this, _layoutState).layout;
84194
+ if (!layout) return false;
84195
+ const normalized = anchor.startsWith("#") ? anchor.slice(1) : anchor;
84196
+ if (!normalized) return false;
84197
+ const pmPos = __privateGet$1(this, _layoutState).bookmarks.get(normalized);
84198
+ if (pmPos == null) return false;
84199
+ const rects = selectionToRects(layout, __privateGet$1(this, _layoutState).blocks, __privateGet$1(this, _layoutState).measures, pmPos, pmPos + 1) ?? [];
84200
+ const rect = rects[0];
84201
+ let pageIndex = rect?.pageIndex ?? null;
84202
+ if (pageIndex == null) {
84203
+ let nextFragmentPage = null;
84204
+ let nextFragmentStart = null;
84205
+ for (const page of layout.pages) {
84206
+ for (const fragment of page.fragments) {
84207
+ if (fragment.kind !== "para") continue;
84208
+ const fragStart = fragment.pmStart;
84209
+ const fragEnd = fragment.pmEnd;
84210
+ if (fragStart == null || fragEnd == null) continue;
84211
+ if (pmPos >= fragStart && pmPos < fragEnd) {
84212
+ pageIndex = page.number - 1;
84213
+ break;
84214
+ }
84215
+ if (fragStart > pmPos && (nextFragmentStart === null || fragStart < nextFragmentStart)) {
84216
+ nextFragmentPage = page.number - 1;
84217
+ nextFragmentStart = fragStart;
84218
+ }
84219
+ }
84220
+ if (pageIndex != null) break;
84221
+ }
84222
+ if (pageIndex == null && nextFragmentPage != null) {
84223
+ pageIndex = nextFragmentPage;
84224
+ }
84225
+ }
84226
+ if (pageIndex == null) return false;
84227
+ __privateMethod$1(this, _PresentationEditor_instances, scrollPageIntoView_fn).call(this, pageIndex);
84228
+ await __privateMethod$1(this, _PresentationEditor_instances, waitForPageMount_fn).call(this, pageIndex, { timeout: _PresentationEditor2.ANCHOR_NAV_TIMEOUT_MS });
84229
+ const pageEl = __privateGet$1(this, _painterHost)?.querySelector(`[data-page-index="${pageIndex}"]`);
84230
+ if (pageEl) {
84231
+ pageEl.scrollIntoView({ behavior: "instant", block: "start" });
84232
+ }
84233
+ const activeEditor = this.getActiveEditor();
84234
+ if (activeEditor?.commands?.setTextSelection) {
84235
+ activeEditor.commands.setTextSelection({ from: pmPos, to: pmPos });
84236
+ } else {
84237
+ console.warn(
84238
+ "[PresentationEditor] goToAnchor: Navigation succeeded but could not move caret (editor commands unavailable)"
84239
+ );
84240
+ }
84241
+ return true;
84242
+ } catch (error) {
84243
+ console.error("[PresentationEditor] goToAnchor failed:", error);
84244
+ this.emit("error", {
84245
+ error,
84246
+ context: "goToAnchor"
84247
+ });
84248
+ return false;
84249
+ }
84250
+ }
84150
84251
  };
84151
84252
  _instances = /* @__PURE__ */ new WeakMap();
84152
84253
  _options = /* @__PURE__ */ new WeakMap();
@@ -84207,13 +84308,15 @@ _dragAnchor = /* @__PURE__ */ new WeakMap();
84207
84308
  _isDragging = /* @__PURE__ */ new WeakMap();
84208
84309
  _dragExtensionMode = /* @__PURE__ */ new WeakMap();
84209
84310
  _remoteCursorState = /* @__PURE__ */ new WeakMap();
84311
+ _remoteCursorElements = /* @__PURE__ */ new WeakMap();
84210
84312
  _remoteCursorDirty = /* @__PURE__ */ new WeakMap();
84211
84313
  _remoteCursorOverlay = /* @__PURE__ */ new WeakMap();
84212
84314
  _localSelectionLayer = /* @__PURE__ */ new WeakMap();
84213
84315
  _awarenessCleanup = /* @__PURE__ */ new WeakMap();
84214
84316
  _scrollCleanup = /* @__PURE__ */ new WeakMap();
84215
- _remoteCursorRafHandle = /* @__PURE__ */ new WeakMap();
84216
84317
  _scrollTimeout = /* @__PURE__ */ new WeakMap();
84318
+ _lastRemoteCursorRenderTime = /* @__PURE__ */ new WeakMap();
84319
+ _remoteCursorThrottleTimeout = /* @__PURE__ */ new WeakMap();
84217
84320
  _PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
84218
84321
  collectCommentPositions_fn = function() {
84219
84322
  const editorState = __privateGet$1(this, _editor3)?.state;
@@ -84274,9 +84377,13 @@ setupEditorListeners_fn = function() {
84274
84377
  __privateSet(this, _pendingDocChange, true);
84275
84378
  __privateMethod$1(this, _PresentationEditor_instances, scheduleRerender_fn).call(this);
84276
84379
  }
84380
+ if (transaction?.docChanged) {
84381
+ __privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
84382
+ }
84277
84383
  };
84278
84384
  const handleSelection = () => {
84279
84385
  __privateMethod$1(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
84386
+ __privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
84280
84387
  };
84281
84388
  __privateGet$1(this, _editor3).on("update", handleUpdate);
84282
84389
  __privateGet$1(this, _editor3).on("selectionUpdate", handleSelection);
@@ -84346,6 +84453,29 @@ setupCollaborationCursors_fn = function() {
84346
84453
  });
84347
84454
  handleAwarenessChange();
84348
84455
  };
84456
+ updateLocalAwarenessCursor_fn = function() {
84457
+ const provider = __privateGet$1(this, _options).collaborationProvider;
84458
+ if (!provider?.awareness) return;
84459
+ if (typeof provider.awareness.setLocalStateField !== "function") {
84460
+ return;
84461
+ }
84462
+ const ystate = ySyncPluginKey.getState(__privateGet$1(this, _editor3).state);
84463
+ if (!ystate?.binding?.mapping) return;
84464
+ const { selection } = __privateGet$1(this, _editor3).state;
84465
+ const { anchor, head } = selection;
84466
+ try {
84467
+ const relAnchor = absolutePositionToRelativePosition(anchor, ystate.type, ystate.binding.mapping);
84468
+ const relHead = absolutePositionToRelativePosition(head, ystate.type, ystate.binding.mapping);
84469
+ if (relAnchor && relHead) {
84470
+ const cursorData = {
84471
+ anchor: relAnchor,
84472
+ head: relHead
84473
+ };
84474
+ provider.awareness.setLocalStateField("cursor", cursorData);
84475
+ }
84476
+ } catch {
84477
+ }
84478
+ };
84349
84479
  normalizeAwarenessStates_fn = function() {
84350
84480
  const provider = __privateGet$1(this, _options).collaborationProvider;
84351
84481
  if (!provider?.awareness) return /* @__PURE__ */ new Map();
@@ -84413,27 +84543,45 @@ scheduleRemoteCursorUpdate_fn = function() {
84413
84543
  if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
84414
84544
  if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
84415
84545
  __privateSet(this, _remoteCursorUpdateScheduled, true);
84416
- const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
84417
- __privateSet(this, _remoteCursorRafHandle, win.requestAnimationFrame(() => {
84418
- __privateSet(this, _remoteCursorUpdateScheduled, false);
84419
- __privateSet(this, _remoteCursorRafHandle, null);
84420
- __privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
84421
- }));
84546
+ queueMicrotask(() => {
84547
+ if (!__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
84548
+ const now = performance.now();
84549
+ const elapsed = now - __privateGet$1(this, _lastRemoteCursorRenderTime);
84550
+ const THROTTLE_MS = 16;
84551
+ if (elapsed >= THROTTLE_MS) {
84552
+ if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
84553
+ clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
84554
+ __privateSet(this, _remoteCursorThrottleTimeout, null);
84555
+ }
84556
+ __privateSet(this, _remoteCursorUpdateScheduled, false);
84557
+ __privateSet(this, _lastRemoteCursorRenderTime, now);
84558
+ __privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
84559
+ return;
84560
+ }
84561
+ const remaining = THROTTLE_MS - elapsed;
84562
+ __privateSet(this, _remoteCursorThrottleTimeout, window.setTimeout(() => {
84563
+ __privateSet(this, _remoteCursorUpdateScheduled, false);
84564
+ __privateSet(this, _remoteCursorThrottleTimeout, null);
84565
+ __privateSet(this, _lastRemoteCursorRenderTime, performance.now());
84566
+ __privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
84567
+ }, remaining));
84568
+ });
84422
84569
  };
84423
84570
  scheduleRemoteCursorReRender_fn = function() {
84424
84571
  if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
84425
84572
  if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
84426
84573
  __privateSet(this, _remoteCursorUpdateScheduled, true);
84427
84574
  const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
84428
- __privateSet(this, _remoteCursorRafHandle, win.requestAnimationFrame(() => {
84575
+ win.requestAnimationFrame(() => {
84429
84576
  __privateSet(this, _remoteCursorUpdateScheduled, false);
84430
- __privateSet(this, _remoteCursorRafHandle, null);
84577
+ __privateSet(this, _lastRemoteCursorRenderTime, performance.now());
84431
84578
  __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursors_fn).call(this);
84432
- }));
84579
+ });
84433
84580
  };
84434
84581
  updateRemoteCursors_fn = function() {
84435
84582
  if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) {
84436
84583
  __privateGet$1(this, _remoteCursorState).clear();
84584
+ __privateGet$1(this, _remoteCursorElements).clear();
84437
84585
  if (__privateGet$1(this, _remoteCursorOverlay)) {
84438
84586
  __privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
84439
84587
  }
@@ -84462,9 +84610,6 @@ updateRemoteCursors_fn = function() {
84462
84610
  }
84463
84611
  };
84464
84612
  renderRemoteCursors_fn = function() {
84465
- if (__privateGet$1(this, _remoteCursorOverlay)) {
84466
- __privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
84467
- }
84468
84613
  const layout = __privateGet$1(this, _layoutState)?.layout;
84469
84614
  const blocks = __privateGet$1(this, _layoutState)?.blocks;
84470
84615
  const measures = __privateGet$1(this, _layoutState)?.measures;
@@ -84473,37 +84618,63 @@ renderRemoteCursors_fn = function() {
84473
84618
  }
84474
84619
  const maxVisible = __privateGet$1(this, _layoutOptions).presence?.maxVisible ?? 20;
84475
84620
  const sortedCursors = Array.from(__privateGet$1(this, _remoteCursorState).values()).sort((a, b2) => b2.updatedAt - a.updatedAt).slice(0, maxVisible);
84621
+ const visibleClientIds = /* @__PURE__ */ new Set();
84476
84622
  sortedCursors.forEach((cursor) => {
84623
+ visibleClientIds.add(cursor.clientId);
84477
84624
  if (cursor.anchor === cursor.head) {
84478
84625
  __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCaret_fn).call(this, cursor);
84479
84626
  } else {
84480
84627
  __privateMethod$1(this, _PresentationEditor_instances, renderRemoteSelection_fn).call(this, cursor);
84481
84628
  }
84482
84629
  });
84630
+ __privateGet$1(this, _remoteCursorElements).forEach((element, clientId) => {
84631
+ if (!visibleClientIds.has(clientId)) {
84632
+ element.remove();
84633
+ __privateGet$1(this, _remoteCursorElements).delete(clientId);
84634
+ }
84635
+ });
84483
84636
  };
84484
84637
  renderRemoteCaret_fn = function(cursor) {
84485
84638
  const caretLayout = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRect_fn).call(this, cursor.head);
84486
- if (!caretLayout) return;
84487
- const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
84488
- if (!coords) return;
84489
84639
  const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
84490
84640
  const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
84491
84641
  const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
84492
- const caretEl = doc2.createElement("div");
84493
- caretEl.className = "presentation-editor__remote-caret";
84494
- caretEl.style.position = "absolute";
84495
- caretEl.style.left = `${coords.x}px`;
84496
- caretEl.style.top = `${coords.y}px`;
84497
- caretEl.style.width = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px`;
84642
+ let caretEl = __privateGet$1(this, _remoteCursorElements).get(cursor.clientId);
84643
+ const isNewElement = !caretEl;
84644
+ if (isNewElement) {
84645
+ caretEl = doc2.createElement("div");
84646
+ caretEl.className = "presentation-editor__remote-caret";
84647
+ caretEl.style.position = "absolute";
84648
+ caretEl.style.width = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px`;
84649
+ caretEl.style.borderLeft = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px solid ${color}`;
84650
+ caretEl.style.pointerEvents = "none";
84651
+ caretEl.style.transition = "transform 50ms ease-out, height 50ms ease-out, opacity 100ms ease-out";
84652
+ caretEl.style.willChange = "transform";
84653
+ caretEl.setAttribute("data-client-id", cursor.clientId.toString());
84654
+ caretEl.setAttribute("aria-hidden", "true");
84655
+ if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
84656
+ __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
84657
+ }
84658
+ __privateGet$1(this, _remoteCursorElements).set(cursor.clientId, caretEl);
84659
+ __privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
84660
+ }
84661
+ if (!caretLayout) {
84662
+ caretEl.style.opacity = "0";
84663
+ return;
84664
+ }
84665
+ const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
84666
+ if (!coords) {
84667
+ caretEl.style.opacity = "0";
84668
+ return;
84669
+ }
84670
+ caretEl.style.opacity = "1";
84671
+ caretEl.style.transform = `translate(${coords.x}px, ${coords.y}px)`;
84498
84672
  caretEl.style.height = `${Math.max(1, caretLayout.height * zoom)}px`;
84499
- caretEl.style.borderLeft = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px solid ${color}`;
84500
- caretEl.style.pointerEvents = "none";
84501
- caretEl.setAttribute("data-client-id", cursor.clientId.toString());
84502
- caretEl.setAttribute("aria-hidden", "true");
84503
- if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
84504
- __privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
84673
+ caretEl.style.borderLeftColor = color;
84674
+ const labelEl = caretEl.querySelector(".presentation-editor__remote-label");
84675
+ if (labelEl) {
84676
+ labelEl.style.backgroundColor = color;
84505
84677
  }
84506
- __privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
84507
84678
  };
84508
84679
  renderRemoteCursorLabel_fn = function(caretEl, cursor) {
84509
84680
  const labelFormatter = __privateGet$1(this, _layoutOptions).presence?.labelFormatter;
@@ -84938,6 +85109,7 @@ rerender_fn = async function() {
84938
85109
  }
84939
85110
  const sectionMetadata = [];
84940
85111
  let blocks;
85112
+ let bookmarks = /* @__PURE__ */ new Map();
84941
85113
  try {
84942
85114
  const converter2 = __privateGet$1(this, _editor3).converter;
84943
85115
  const converterContext = converter2 ? {
@@ -84956,6 +85128,7 @@ rerender_fn = async function() {
84956
85128
  converterContext
84957
85129
  });
84958
85130
  blocks = result.blocks;
85131
+ bookmarks = result.bookmarks ?? /* @__PURE__ */ new Map();
84959
85132
  } catch (error) {
84960
85133
  __privateMethod$1(this, _PresentationEditor_instances, handleLayoutError_fn).call(this, "render", __privateMethod$1(this, _PresentationEditor_instances, decorateError_fn).call(this, error, "toFlowBlocks"));
84961
85134
  return;
@@ -85003,7 +85176,8 @@ rerender_fn = async function() {
85003
85176
  __privateSet(this, _sectionMetadata, sectionMetadata);
85004
85177
  const converter = __privateGet$1(this, _editor3).converter;
85005
85178
  __privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles));
85006
- __privateSet(this, _layoutState, { blocks, measures, layout });
85179
+ const anchorMap = __privateMethod$1(this, _PresentationEditor_instances, computeAnchorMap_fn).call(this, bookmarks, layout);
85180
+ __privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
85007
85181
  __privateSet(this, _headerLayoutResults, headerLayouts ?? null);
85008
85182
  __privateSet(this, _footerLayoutResults, footerLayouts ?? null);
85009
85183
  await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
@@ -85662,9 +85836,9 @@ emitHeaderFooterEditingContext_fn = function(editor) {
85662
85836
  __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"})`);
85663
85837
  };
85664
85838
  updateAwarenessSession_fn = function() {
85665
- const provider = __privateGet$1(this, _editor3).options?.collaborationProvider;
85839
+ const provider = __privateGet$1(this, _options).collaborationProvider;
85666
85840
  const awareness = provider?.awareness;
85667
- if (!awareness?.setLocalStateField) {
85841
+ if (!awareness || typeof awareness.setLocalStateField !== "function") {
85668
85842
  return;
85669
85843
  }
85670
85844
  if (__privateGet$1(this, _session).mode === "body") {
@@ -85773,6 +85947,62 @@ scrollPageIntoView_fn = function(pageIndex) {
85773
85947
  __privateGet$1(this, _visibleHost).scrollTop = yPosition;
85774
85948
  }
85775
85949
  };
85950
+ computeAnchorMap_fn = function(bookmarks, layout) {
85951
+ const anchorMap = /* @__PURE__ */ new Map();
85952
+ const blockPmRanges = /* @__PURE__ */ new Map();
85953
+ const computeBlockRange = (blockId) => {
85954
+ if (blockPmRanges.has(blockId)) {
85955
+ const cached = blockPmRanges.get(blockId);
85956
+ return { pmStart: cached.pmStart, pmEnd: cached.pmEnd };
85957
+ }
85958
+ const block = __privateGet$1(this, _layoutState).blocks.find((b2) => b2.id === blockId);
85959
+ if (!block || block.kind !== "paragraph") {
85960
+ blockPmRanges.set(blockId, { pmStart: null, pmEnd: null, hasFragmentPositions: false });
85961
+ return { pmStart: null, pmEnd: null };
85962
+ }
85963
+ let pmStart = null;
85964
+ let pmEnd = null;
85965
+ for (const run2 of block.runs) {
85966
+ if (run2.pmStart != null) {
85967
+ pmStart = pmStart == null ? run2.pmStart : Math.min(pmStart, run2.pmStart);
85968
+ }
85969
+ if (run2.pmEnd != null) {
85970
+ pmEnd = pmEnd == null ? run2.pmEnd : Math.max(pmEnd, run2.pmEnd);
85971
+ }
85972
+ }
85973
+ blockPmRanges.set(blockId, { pmStart, pmEnd, hasFragmentPositions: false });
85974
+ return { pmStart, pmEnd };
85975
+ };
85976
+ bookmarks.forEach((pmPosition, bookmarkName) => {
85977
+ for (const page of layout.pages) {
85978
+ for (const fragment of page.fragments) {
85979
+ if (fragment.kind !== "para") continue;
85980
+ let fragStart = fragment.pmStart;
85981
+ let fragEnd = fragment.pmEnd;
85982
+ if (fragStart == null || fragEnd == null) {
85983
+ const range2 = computeBlockRange(fragment.blockId);
85984
+ if (range2.pmStart != null && range2.pmEnd != null) {
85985
+ fragStart = range2.pmStart;
85986
+ fragEnd = range2.pmEnd;
85987
+ }
85988
+ } else {
85989
+ const cached = blockPmRanges.get(fragment.blockId);
85990
+ blockPmRanges.set(fragment.blockId, {
85991
+ pmStart: cached?.pmStart ?? fragStart,
85992
+ pmEnd: cached?.pmEnd ?? fragEnd,
85993
+ hasFragmentPositions: true
85994
+ });
85995
+ }
85996
+ if (fragStart == null || fragEnd == null) continue;
85997
+ if (pmPosition >= fragStart && pmPosition < fragEnd) {
85998
+ anchorMap.set(bookmarkName, page.number);
85999
+ return;
86000
+ }
86001
+ }
86002
+ }
86003
+ });
86004
+ return anchorMap;
86005
+ };
85776
86006
  waitForPageMount_fn = async function(pageIndex, options = {}) {
85777
86007
  const timeout2 = options.timeout ?? 2e3;
85778
86008
  const startTime = performance.now();
@@ -86392,6 +86622,7 @@ _PresentationEditor.CURSOR_STYLES = {
86392
86622
  SELECTION_BORDER_RADIUS: "2px",
86393
86623
  MAX_LABEL_LENGTH: 30
86394
86624
  };
86625
+ _PresentationEditor.ANCHOR_NAV_TIMEOUT_MS = 2e3;
86395
86626
  let PresentationEditor = _PresentationEditor;
86396
86627
  class PresentationInputBridge {
86397
86628
  /**
@@ -121972,7 +122203,8 @@ const _sfc_main$2 = {
121972
122203
  if (!surface) {
121973
122204
  return;
121974
122205
  }
121975
- moveCursorToMouseEvent(event.detail, props.editor);
122206
+ const detail = event?.detail ?? {};
122207
+ moveCursorToMouseEvent(detail, props.editor);
121976
122208
  setTimeout(() => {
121977
122209
  const currentState = props.editor.state;
121978
122210
  const hasLink = selectionHasNodeOrMark(currentState, "link", { requireEnds: true });
@@ -121987,8 +122219,8 @@ const _sfc_main$2 = {
121987
122219
  closePopover: props.closePopover
121988
122220
  },
121989
122221
  {
121990
- left: `${event.detail.clientX - surfaceRect.left}px`,
121991
- top: `${event.detail.clientY - surfaceRect.top + 15}px`
122222
+ left: `${detail.clientX - surfaceRect.left}px`,
122223
+ top: `${detail.clientY - surfaceRect.top + 15}px`
121992
122224
  }
121993
122225
  );
121994
122226
  }