@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.
- package/dist/chunks/{PdfViewer-1hoKlV0M.cjs → PdfViewer-CMVOK_jD.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CVrn4X-3.es.js → PdfViewer-DSx1zQC5.es.js} +1 -1
- package/dist/chunks/{index-BTDOWM_2.es.js → index-8_ijaxSz.es.js} +3 -3
- package/dist/chunks/{index-VKd9fPLu.cjs → index-BqXrnRP8.cjs} +3 -3
- package/dist/chunks/{index-hX4H5xPH-DfkQd7UH.cjs → index-CQeXM6oB-BAx-uLYb.cjs} +1 -1
- package/dist/chunks/{index-hX4H5xPH-ChjioDix.es.js → index-CQeXM6oB-DjCz53Th.es.js} +1 -1
- package/dist/chunks/{super-editor.es-Dzrm58hW.cjs → super-editor.es-CgTVSX1p.cjs} +280 -48
- package/dist/chunks/{super-editor.es-CpmC4G9F.es.js → super-editor.es-TkKngzld.es.js} +280 -48
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DZNL-ld-.js → converter-Hv-kNdxI.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-DukE72iM.js → docx-zipper-C6nUdlsw.js} +1 -1
- package/dist/super-editor/chunks/{editor-CJCGDp-l.js → editor-uvvccWc5.js} +334 -52
- package/dist/super-editor/chunks/{index-hX4H5xPH.js → index-CQeXM6oB.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-D6tqFv6-.js → toolbar-BCWRHtW5.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +10 -9
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +282 -50
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/superdoc.umd.js
CHANGED
|
@@ -41859,7 +41859,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41859
41859
|
static getStoredSuperdocVersion(docx) {
|
|
41860
41860
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
41861
41861
|
}
|
|
41862
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.
|
|
41862
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.34") {
|
|
41863
41863
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
41864
41864
|
}
|
|
41865
41865
|
/**
|
|
@@ -53022,7 +53022,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
53022
53022
|
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);
|
|
53023
53023
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
53024
53024
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
53025
|
-
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,
|
|
53025
|
+
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;
|
|
53026
53026
|
var GOOD_LEAF_SIZE = 200;
|
|
53027
53027
|
var RopeSequence = function RopeSequence2() {
|
|
53028
53028
|
};
|
|
@@ -66889,7 +66889,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
66889
66889
|
const shouldSkipNodeView = (editor) => {
|
|
66890
66890
|
return isHeadless(editor);
|
|
66891
66891
|
};
|
|
66892
|
-
const summaryVersion = "1.0.0-beta.
|
|
66892
|
+
const summaryVersion = "1.0.0-beta.34";
|
|
66893
66893
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
66894
66894
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
66895
66895
|
function mapAttributes(attrs) {
|
|
@@ -67678,7 +67678,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67678
67678
|
{ default: remarkStringify2 },
|
|
67679
67679
|
{ default: remarkGfm2 }
|
|
67680
67680
|
] = await Promise.all([
|
|
67681
|
-
Promise.resolve().then(() =>
|
|
67681
|
+
Promise.resolve().then(() => indexCQeXM6oB),
|
|
67682
67682
|
Promise.resolve().then(() => indexDRCvimau),
|
|
67683
67683
|
Promise.resolve().then(() => indexC_x_N6Uh),
|
|
67684
67684
|
Promise.resolve().then(() => indexD_sWOSiG),
|
|
@@ -67883,7 +67883,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67883
67883
|
* Process collaboration migrations
|
|
67884
67884
|
*/
|
|
67885
67885
|
processCollaborationMigrations() {
|
|
67886
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
67886
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.34");
|
|
67887
67887
|
if (!this.options.ydoc) return;
|
|
67888
67888
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
67889
67889
|
let docVersion = metaMap.get("version");
|
|
@@ -90596,7 +90596,7 @@ ${l}
|
|
|
90596
90596
|
const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
|
|
90597
90597
|
const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
|
|
90598
90598
|
const HEADER_FOOTER_INIT_BUDGET_MS = 200;
|
|
90599
|
-
const SCROLL_DEBOUNCE_MS =
|
|
90599
|
+
const SCROLL_DEBOUNCE_MS = 32;
|
|
90600
90600
|
const MAX_ZOOM_WARNING_THRESHOLD = 10;
|
|
90601
90601
|
const MAX_SELECTION_RECTS_PER_USER = 100;
|
|
90602
90602
|
const DEFAULT_STALE_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
@@ -90613,7 +90613,7 @@ ${l}
|
|
|
90613
90613
|
__privateAdd$1(this, _selectionOverlay2);
|
|
90614
90614
|
__privateAdd$1(this, _hiddenHost);
|
|
90615
90615
|
__privateAdd$1(this, _layoutOptions);
|
|
90616
|
-
__privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null });
|
|
90616
|
+
__privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null, bookmarks: /* @__PURE__ */ new Map() });
|
|
90617
90617
|
__privateAdd$1(this, _domPainter, null);
|
|
90618
90618
|
__privateAdd$1(this, _dragHandlerCleanup, null);
|
|
90619
90619
|
__privateAdd$1(this, _layoutError, null);
|
|
@@ -90663,18 +90663,31 @@ ${l}
|
|
|
90663
90663
|
__privateAdd$1(this, _isDragging, false);
|
|
90664
90664
|
__privateAdd$1(this, _dragExtensionMode, "char");
|
|
90665
90665
|
__privateAdd$1(this, _remoteCursorState, /* @__PURE__ */ new Map());
|
|
90666
|
+
__privateAdd$1(this, _remoteCursorElements, /* @__PURE__ */ new Map());
|
|
90666
90667
|
__privateAdd$1(this, _remoteCursorDirty, false);
|
|
90667
90668
|
__privateAdd$1(this, _remoteCursorOverlay, null);
|
|
90668
90669
|
__privateAdd$1(this, _localSelectionLayer, null);
|
|
90669
90670
|
__privateAdd$1(this, _awarenessCleanup, null);
|
|
90670
90671
|
__privateAdd$1(this, _scrollCleanup, null);
|
|
90671
|
-
__privateAdd$1(this, _remoteCursorRafHandle, null);
|
|
90672
90672
|
__privateAdd$1(this, _scrollTimeout);
|
|
90673
|
+
__privateAdd$1(this, _lastRemoteCursorRenderTime, 0);
|
|
90674
|
+
__privateAdd$1(this, _remoteCursorThrottleTimeout, null);
|
|
90673
90675
|
__privateAdd$1(this, _handlePointerDown, (event) => {
|
|
90674
90676
|
if (event.button !== 0) {
|
|
90675
90677
|
return;
|
|
90676
90678
|
}
|
|
90677
90679
|
const target = event.target;
|
|
90680
|
+
const linkEl = target?.closest?.("a.superdoc-link");
|
|
90681
|
+
if (linkEl) {
|
|
90682
|
+
const href = linkEl.getAttribute("href") ?? "";
|
|
90683
|
+
const isAnchorLink = href.startsWith("#") && href.length > 1;
|
|
90684
|
+
if (isAnchorLink) {
|
|
90685
|
+
event.preventDefault();
|
|
90686
|
+
event.stopPropagation();
|
|
90687
|
+
this.goToAnchor(href);
|
|
90688
|
+
return;
|
|
90689
|
+
}
|
|
90690
|
+
}
|
|
90678
90691
|
const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
|
|
90679
90692
|
if (!__privateGet$1(this, _layoutState).layout) {
|
|
90680
90693
|
if (!isDraggableAnnotation) {
|
|
@@ -91934,12 +91947,11 @@ ${l}
|
|
|
91934
91947
|
__privateSet(this, _rafHandle, null);
|
|
91935
91948
|
}, "Layout RAF");
|
|
91936
91949
|
}
|
|
91937
|
-
if (__privateGet$1(this,
|
|
91950
|
+
if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
|
|
91938
91951
|
__privateMethod$1(this, _PresentationEditor_instances, safeCleanup_fn).call(this, () => {
|
|
91939
|
-
|
|
91940
|
-
|
|
91941
|
-
|
|
91942
|
-
}, "Remote cursor RAF");
|
|
91952
|
+
clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
|
|
91953
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
91954
|
+
}, "Remote cursor throttle");
|
|
91943
91955
|
}
|
|
91944
91956
|
__privateGet$1(this, _editorListeners).forEach(({ event, handler: handler2 }) => __privateGet$1(this, _editor3)?.off(event, handler2));
|
|
91945
91957
|
__privateSet(this, _editorListeners, []);
|
|
@@ -91963,6 +91975,7 @@ ${l}
|
|
|
91963
91975
|
__privateSet(this, _scrollCleanup, null);
|
|
91964
91976
|
}
|
|
91965
91977
|
__privateGet$1(this, _remoteCursorState).clear();
|
|
91978
|
+
__privateGet$1(this, _remoteCursorElements).clear();
|
|
91966
91979
|
__privateSet(this, _remoteCursorOverlay, null);
|
|
91967
91980
|
if (__privateGet$1(this, _options)?.documentId) {
|
|
91968
91981
|
__privateGet$1(_PresentationEditor2, _instances).delete(__privateGet$1(this, _options).documentId);
|
|
@@ -92005,6 +92018,94 @@ ${l}
|
|
|
92005
92018
|
__privateGet$1(this, _editor3).destroy();
|
|
92006
92019
|
}
|
|
92007
92020
|
}
|
|
92021
|
+
/**
|
|
92022
|
+
* Navigate to a bookmark/anchor in the current document (e.g., TOC links).
|
|
92023
|
+
*
|
|
92024
|
+
* This method performs asynchronous navigation to support virtualized page rendering:
|
|
92025
|
+
* 1. Normalizes the anchor by removing leading '#' if present
|
|
92026
|
+
* 2. Looks up the bookmark in the document's bookmark registry
|
|
92027
|
+
* 3. Determines which page contains the target position
|
|
92028
|
+
* 4. Scrolls the page into view (may be virtualized)
|
|
92029
|
+
* 5. Waits up to 2000ms for the page to mount in the DOM
|
|
92030
|
+
* 6. Moves the editor caret to the bookmark position
|
|
92031
|
+
*
|
|
92032
|
+
* @param anchor - Bookmark name or fragment identifier (with or without leading '#')
|
|
92033
|
+
* @returns Promise resolving to true if navigation succeeded, false otherwise
|
|
92034
|
+
*
|
|
92035
|
+
* @remarks
|
|
92036
|
+
* Navigation fails and returns false if:
|
|
92037
|
+
* - The anchor parameter is empty or becomes empty after normalization
|
|
92038
|
+
* - No layout has been computed yet
|
|
92039
|
+
* - The bookmark does not exist in the document
|
|
92040
|
+
* - The bookmark's page cannot be determined
|
|
92041
|
+
* - The page fails to mount within the timeout period (2000ms)
|
|
92042
|
+
*
|
|
92043
|
+
* Note: This method does not throw errors. All failures are logged and result in
|
|
92044
|
+
* a false return value. An 'error' event is emitted for unhandled exceptions.
|
|
92045
|
+
*
|
|
92046
|
+
* @throws Never throws directly - errors are caught, logged, and emitted as events
|
|
92047
|
+
*/
|
|
92048
|
+
async goToAnchor(anchor) {
|
|
92049
|
+
try {
|
|
92050
|
+
if (!anchor) return false;
|
|
92051
|
+
const layout = __privateGet$1(this, _layoutState).layout;
|
|
92052
|
+
if (!layout) return false;
|
|
92053
|
+
const normalized = anchor.startsWith("#") ? anchor.slice(1) : anchor;
|
|
92054
|
+
if (!normalized) return false;
|
|
92055
|
+
const pmPos = __privateGet$1(this, _layoutState).bookmarks.get(normalized);
|
|
92056
|
+
if (pmPos == null) return false;
|
|
92057
|
+
const rects = selectionToRects(layout, __privateGet$1(this, _layoutState).blocks, __privateGet$1(this, _layoutState).measures, pmPos, pmPos + 1) ?? [];
|
|
92058
|
+
const rect = rects[0];
|
|
92059
|
+
let pageIndex = rect?.pageIndex ?? null;
|
|
92060
|
+
if (pageIndex == null) {
|
|
92061
|
+
let nextFragmentPage = null;
|
|
92062
|
+
let nextFragmentStart = null;
|
|
92063
|
+
for (const page of layout.pages) {
|
|
92064
|
+
for (const fragment of page.fragments) {
|
|
92065
|
+
if (fragment.kind !== "para") continue;
|
|
92066
|
+
const fragStart = fragment.pmStart;
|
|
92067
|
+
const fragEnd = fragment.pmEnd;
|
|
92068
|
+
if (fragStart == null || fragEnd == null) continue;
|
|
92069
|
+
if (pmPos >= fragStart && pmPos < fragEnd) {
|
|
92070
|
+
pageIndex = page.number - 1;
|
|
92071
|
+
break;
|
|
92072
|
+
}
|
|
92073
|
+
if (fragStart > pmPos && (nextFragmentStart === null || fragStart < nextFragmentStart)) {
|
|
92074
|
+
nextFragmentPage = page.number - 1;
|
|
92075
|
+
nextFragmentStart = fragStart;
|
|
92076
|
+
}
|
|
92077
|
+
}
|
|
92078
|
+
if (pageIndex != null) break;
|
|
92079
|
+
}
|
|
92080
|
+
if (pageIndex == null && nextFragmentPage != null) {
|
|
92081
|
+
pageIndex = nextFragmentPage;
|
|
92082
|
+
}
|
|
92083
|
+
}
|
|
92084
|
+
if (pageIndex == null) return false;
|
|
92085
|
+
__privateMethod$1(this, _PresentationEditor_instances, scrollPageIntoView_fn).call(this, pageIndex);
|
|
92086
|
+
await __privateMethod$1(this, _PresentationEditor_instances, waitForPageMount_fn).call(this, pageIndex, { timeout: _PresentationEditor2.ANCHOR_NAV_TIMEOUT_MS });
|
|
92087
|
+
const pageEl = __privateGet$1(this, _painterHost)?.querySelector(`[data-page-index="${pageIndex}"]`);
|
|
92088
|
+
if (pageEl) {
|
|
92089
|
+
pageEl.scrollIntoView({ behavior: "instant", block: "start" });
|
|
92090
|
+
}
|
|
92091
|
+
const activeEditor = this.getActiveEditor();
|
|
92092
|
+
if (activeEditor?.commands?.setTextSelection) {
|
|
92093
|
+
activeEditor.commands.setTextSelection({ from: pmPos, to: pmPos });
|
|
92094
|
+
} else {
|
|
92095
|
+
console.warn(
|
|
92096
|
+
"[PresentationEditor] goToAnchor: Navigation succeeded but could not move caret (editor commands unavailable)"
|
|
92097
|
+
);
|
|
92098
|
+
}
|
|
92099
|
+
return true;
|
|
92100
|
+
} catch (error) {
|
|
92101
|
+
console.error("[PresentationEditor] goToAnchor failed:", error);
|
|
92102
|
+
this.emit("error", {
|
|
92103
|
+
error,
|
|
92104
|
+
context: "goToAnchor"
|
|
92105
|
+
});
|
|
92106
|
+
return false;
|
|
92107
|
+
}
|
|
92108
|
+
}
|
|
92008
92109
|
};
|
|
92009
92110
|
_instances = /* @__PURE__ */ new WeakMap();
|
|
92010
92111
|
_options = /* @__PURE__ */ new WeakMap();
|
|
@@ -92065,13 +92166,15 @@ ${l}
|
|
|
92065
92166
|
_isDragging = /* @__PURE__ */ new WeakMap();
|
|
92066
92167
|
_dragExtensionMode = /* @__PURE__ */ new WeakMap();
|
|
92067
92168
|
_remoteCursorState = /* @__PURE__ */ new WeakMap();
|
|
92169
|
+
_remoteCursorElements = /* @__PURE__ */ new WeakMap();
|
|
92068
92170
|
_remoteCursorDirty = /* @__PURE__ */ new WeakMap();
|
|
92069
92171
|
_remoteCursorOverlay = /* @__PURE__ */ new WeakMap();
|
|
92070
92172
|
_localSelectionLayer = /* @__PURE__ */ new WeakMap();
|
|
92071
92173
|
_awarenessCleanup = /* @__PURE__ */ new WeakMap();
|
|
92072
92174
|
_scrollCleanup = /* @__PURE__ */ new WeakMap();
|
|
92073
|
-
_remoteCursorRafHandle = /* @__PURE__ */ new WeakMap();
|
|
92074
92175
|
_scrollTimeout = /* @__PURE__ */ new WeakMap();
|
|
92176
|
+
_lastRemoteCursorRenderTime = /* @__PURE__ */ new WeakMap();
|
|
92177
|
+
_remoteCursorThrottleTimeout = /* @__PURE__ */ new WeakMap();
|
|
92075
92178
|
_PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
|
|
92076
92179
|
collectCommentPositions_fn = function() {
|
|
92077
92180
|
const editorState = __privateGet$1(this, _editor3)?.state;
|
|
@@ -92132,9 +92235,13 @@ ${l}
|
|
|
92132
92235
|
__privateSet(this, _pendingDocChange, true);
|
|
92133
92236
|
__privateMethod$1(this, _PresentationEditor_instances, scheduleRerender_fn).call(this);
|
|
92134
92237
|
}
|
|
92238
|
+
if (transaction?.docChanged) {
|
|
92239
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
|
|
92240
|
+
}
|
|
92135
92241
|
};
|
|
92136
92242
|
const handleSelection = () => {
|
|
92137
92243
|
__privateMethod$1(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
|
|
92244
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
|
|
92138
92245
|
};
|
|
92139
92246
|
__privateGet$1(this, _editor3).on("update", handleUpdate);
|
|
92140
92247
|
__privateGet$1(this, _editor3).on("selectionUpdate", handleSelection);
|
|
@@ -92204,6 +92311,29 @@ ${l}
|
|
|
92204
92311
|
});
|
|
92205
92312
|
handleAwarenessChange();
|
|
92206
92313
|
};
|
|
92314
|
+
updateLocalAwarenessCursor_fn = function() {
|
|
92315
|
+
const provider2 = __privateGet$1(this, _options).collaborationProvider;
|
|
92316
|
+
if (!provider2?.awareness) return;
|
|
92317
|
+
if (typeof provider2.awareness.setLocalStateField !== "function") {
|
|
92318
|
+
return;
|
|
92319
|
+
}
|
|
92320
|
+
const ystate = ySyncPluginKey.getState(__privateGet$1(this, _editor3).state);
|
|
92321
|
+
if (!ystate?.binding?.mapping) return;
|
|
92322
|
+
const { selection } = __privateGet$1(this, _editor3).state;
|
|
92323
|
+
const { anchor, head } = selection;
|
|
92324
|
+
try {
|
|
92325
|
+
const relAnchor = absolutePositionToRelativePosition(anchor, ystate.type, ystate.binding.mapping);
|
|
92326
|
+
const relHead = absolutePositionToRelativePosition(head, ystate.type, ystate.binding.mapping);
|
|
92327
|
+
if (relAnchor && relHead) {
|
|
92328
|
+
const cursorData = {
|
|
92329
|
+
anchor: relAnchor,
|
|
92330
|
+
head: relHead
|
|
92331
|
+
};
|
|
92332
|
+
provider2.awareness.setLocalStateField("cursor", cursorData);
|
|
92333
|
+
}
|
|
92334
|
+
} catch {
|
|
92335
|
+
}
|
|
92336
|
+
};
|
|
92207
92337
|
normalizeAwarenessStates_fn = function() {
|
|
92208
92338
|
const provider2 = __privateGet$1(this, _options).collaborationProvider;
|
|
92209
92339
|
if (!provider2?.awareness) return /* @__PURE__ */ new Map();
|
|
@@ -92271,27 +92401,45 @@ ${l}
|
|
|
92271
92401
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
|
|
92272
92402
|
if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
92273
92403
|
__privateSet(this, _remoteCursorUpdateScheduled, true);
|
|
92274
|
-
|
|
92275
|
-
|
|
92276
|
-
|
|
92277
|
-
|
|
92278
|
-
|
|
92279
|
-
|
|
92404
|
+
queueMicrotask(() => {
|
|
92405
|
+
if (!__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
92406
|
+
const now = performance.now();
|
|
92407
|
+
const elapsed = now - __privateGet$1(this, _lastRemoteCursorRenderTime);
|
|
92408
|
+
const THROTTLE_MS = 16;
|
|
92409
|
+
if (elapsed >= THROTTLE_MS) {
|
|
92410
|
+
if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
|
|
92411
|
+
clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
|
|
92412
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
92413
|
+
}
|
|
92414
|
+
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
92415
|
+
__privateSet(this, _lastRemoteCursorRenderTime, now);
|
|
92416
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
|
|
92417
|
+
return;
|
|
92418
|
+
}
|
|
92419
|
+
const remaining = THROTTLE_MS - elapsed;
|
|
92420
|
+
__privateSet(this, _remoteCursorThrottleTimeout, window.setTimeout(() => {
|
|
92421
|
+
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
92422
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
92423
|
+
__privateSet(this, _lastRemoteCursorRenderTime, performance.now());
|
|
92424
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateRemoteCursors_fn).call(this);
|
|
92425
|
+
}, remaining));
|
|
92426
|
+
});
|
|
92280
92427
|
};
|
|
92281
92428
|
scheduleRemoteCursorReRender_fn = function() {
|
|
92282
92429
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
|
|
92283
92430
|
if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
92284
92431
|
__privateSet(this, _remoteCursorUpdateScheduled, true);
|
|
92285
92432
|
const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
|
|
92286
|
-
|
|
92433
|
+
win.requestAnimationFrame(() => {
|
|
92287
92434
|
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
92288
|
-
__privateSet(this,
|
|
92435
|
+
__privateSet(this, _lastRemoteCursorRenderTime, performance.now());
|
|
92289
92436
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursors_fn).call(this);
|
|
92290
|
-
})
|
|
92437
|
+
});
|
|
92291
92438
|
};
|
|
92292
92439
|
updateRemoteCursors_fn = function() {
|
|
92293
92440
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) {
|
|
92294
92441
|
__privateGet$1(this, _remoteCursorState).clear();
|
|
92442
|
+
__privateGet$1(this, _remoteCursorElements).clear();
|
|
92295
92443
|
if (__privateGet$1(this, _remoteCursorOverlay)) {
|
|
92296
92444
|
__privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
|
|
92297
92445
|
}
|
|
@@ -92320,9 +92468,6 @@ ${l}
|
|
|
92320
92468
|
}
|
|
92321
92469
|
};
|
|
92322
92470
|
renderRemoteCursors_fn = function() {
|
|
92323
|
-
if (__privateGet$1(this, _remoteCursorOverlay)) {
|
|
92324
|
-
__privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
|
|
92325
|
-
}
|
|
92326
92471
|
const layout = __privateGet$1(this, _layoutState)?.layout;
|
|
92327
92472
|
const blocks2 = __privateGet$1(this, _layoutState)?.blocks;
|
|
92328
92473
|
const measures = __privateGet$1(this, _layoutState)?.measures;
|
|
@@ -92331,37 +92476,63 @@ ${l}
|
|
|
92331
92476
|
}
|
|
92332
92477
|
const maxVisible = __privateGet$1(this, _layoutOptions).presence?.maxVisible ?? 20;
|
|
92333
92478
|
const sortedCursors = Array.from(__privateGet$1(this, _remoteCursorState).values()).sort((a2, b2) => b2.updatedAt - a2.updatedAt).slice(0, maxVisible);
|
|
92479
|
+
const visibleClientIds = /* @__PURE__ */ new Set();
|
|
92334
92480
|
sortedCursors.forEach((cursor) => {
|
|
92481
|
+
visibleClientIds.add(cursor.clientId);
|
|
92335
92482
|
if (cursor.anchor === cursor.head) {
|
|
92336
92483
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCaret_fn).call(this, cursor);
|
|
92337
92484
|
} else {
|
|
92338
92485
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteSelection_fn).call(this, cursor);
|
|
92339
92486
|
}
|
|
92340
92487
|
});
|
|
92488
|
+
__privateGet$1(this, _remoteCursorElements).forEach((element2, clientId) => {
|
|
92489
|
+
if (!visibleClientIds.has(clientId)) {
|
|
92490
|
+
element2.remove();
|
|
92491
|
+
__privateGet$1(this, _remoteCursorElements).delete(clientId);
|
|
92492
|
+
}
|
|
92493
|
+
});
|
|
92341
92494
|
};
|
|
92342
92495
|
renderRemoteCaret_fn = function(cursor) {
|
|
92343
92496
|
const caretLayout = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRect_fn).call(this, cursor.head);
|
|
92344
|
-
if (!caretLayout) return;
|
|
92345
|
-
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
|
|
92346
|
-
if (!coords) return;
|
|
92347
92497
|
const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
92348
92498
|
const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
|
|
92349
92499
|
const color2 = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
|
|
92350
|
-
|
|
92351
|
-
|
|
92352
|
-
|
|
92353
|
-
|
|
92354
|
-
|
|
92355
|
-
|
|
92500
|
+
let caretEl = __privateGet$1(this, _remoteCursorElements).get(cursor.clientId);
|
|
92501
|
+
const isNewElement = !caretEl;
|
|
92502
|
+
if (isNewElement) {
|
|
92503
|
+
caretEl = doc2.createElement("div");
|
|
92504
|
+
caretEl.className = "presentation-editor__remote-caret";
|
|
92505
|
+
caretEl.style.position = "absolute";
|
|
92506
|
+
caretEl.style.width = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px`;
|
|
92507
|
+
caretEl.style.borderLeft = `${_PresentationEditor.CURSOR_STYLES.CARET_WIDTH}px solid ${color2}`;
|
|
92508
|
+
caretEl.style.pointerEvents = "none";
|
|
92509
|
+
caretEl.style.transition = "transform 50ms ease-out, height 50ms ease-out, opacity 100ms ease-out";
|
|
92510
|
+
caretEl.style.willChange = "transform";
|
|
92511
|
+
caretEl.setAttribute("data-client-id", cursor.clientId.toString());
|
|
92512
|
+
caretEl.setAttribute("aria-hidden", "true");
|
|
92513
|
+
if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
|
|
92514
|
+
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
|
|
92515
|
+
}
|
|
92516
|
+
__privateGet$1(this, _remoteCursorElements).set(cursor.clientId, caretEl);
|
|
92517
|
+
__privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
|
|
92518
|
+
}
|
|
92519
|
+
if (!caretLayout) {
|
|
92520
|
+
caretEl.style.opacity = "0";
|
|
92521
|
+
return;
|
|
92522
|
+
}
|
|
92523
|
+
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
|
|
92524
|
+
if (!coords) {
|
|
92525
|
+
caretEl.style.opacity = "0";
|
|
92526
|
+
return;
|
|
92527
|
+
}
|
|
92528
|
+
caretEl.style.opacity = "1";
|
|
92529
|
+
caretEl.style.transform = `translate(${coords.x}px, ${coords.y}px)`;
|
|
92356
92530
|
caretEl.style.height = `${Math.max(1, caretLayout.height * zoom)}px`;
|
|
92357
|
-
caretEl.style.
|
|
92358
|
-
|
|
92359
|
-
|
|
92360
|
-
|
|
92361
|
-
if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
|
|
92362
|
-
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursorLabel_fn).call(this, caretEl, cursor);
|
|
92531
|
+
caretEl.style.borderLeftColor = color2;
|
|
92532
|
+
const labelEl = caretEl.querySelector(".presentation-editor__remote-label");
|
|
92533
|
+
if (labelEl) {
|
|
92534
|
+
labelEl.style.backgroundColor = color2;
|
|
92363
92535
|
}
|
|
92364
|
-
__privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
|
|
92365
92536
|
};
|
|
92366
92537
|
renderRemoteCursorLabel_fn = function(caretEl, cursor) {
|
|
92367
92538
|
const labelFormatter = __privateGet$1(this, _layoutOptions).presence?.labelFormatter;
|
|
@@ -92796,6 +92967,7 @@ ${l}
|
|
|
92796
92967
|
}
|
|
92797
92968
|
const sectionMetadata = [];
|
|
92798
92969
|
let blocks2;
|
|
92970
|
+
let bookmarks = /* @__PURE__ */ new Map();
|
|
92799
92971
|
try {
|
|
92800
92972
|
const converter2 = __privateGet$1(this, _editor3).converter;
|
|
92801
92973
|
const converterContext = converter2 ? {
|
|
@@ -92814,6 +92986,7 @@ ${l}
|
|
|
92814
92986
|
converterContext
|
|
92815
92987
|
});
|
|
92816
92988
|
blocks2 = result.blocks;
|
|
92989
|
+
bookmarks = result.bookmarks ?? /* @__PURE__ */ new Map();
|
|
92817
92990
|
} catch (error) {
|
|
92818
92991
|
__privateMethod$1(this, _PresentationEditor_instances, handleLayoutError_fn).call(this, "render", __privateMethod$1(this, _PresentationEditor_instances, decorateError_fn).call(this, error, "toFlowBlocks"));
|
|
92819
92992
|
return;
|
|
@@ -92861,7 +93034,8 @@ ${l}
|
|
|
92861
93034
|
__privateSet(this, _sectionMetadata, sectionMetadata);
|
|
92862
93035
|
const converter = __privateGet$1(this, _editor3).converter;
|
|
92863
93036
|
__privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles));
|
|
92864
|
-
|
|
93037
|
+
const anchorMap = __privateMethod$1(this, _PresentationEditor_instances, computeAnchorMap_fn).call(this, bookmarks, layout);
|
|
93038
|
+
__privateSet(this, _layoutState, { blocks: blocks2, measures, layout, bookmarks, anchorMap });
|
|
92865
93039
|
__privateSet(this, _headerLayoutResults, headerLayouts ?? null);
|
|
92866
93040
|
__privateSet(this, _footerLayoutResults, footerLayouts ?? null);
|
|
92867
93041
|
await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
|
|
@@ -93520,9 +93694,9 @@ ${l}
|
|
|
93520
93694
|
__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"})`);
|
|
93521
93695
|
};
|
|
93522
93696
|
updateAwarenessSession_fn = function() {
|
|
93523
|
-
const provider2 = __privateGet$1(this,
|
|
93697
|
+
const provider2 = __privateGet$1(this, _options).collaborationProvider;
|
|
93524
93698
|
const awareness = provider2?.awareness;
|
|
93525
|
-
if (!awareness
|
|
93699
|
+
if (!awareness || typeof awareness.setLocalStateField !== "function") {
|
|
93526
93700
|
return;
|
|
93527
93701
|
}
|
|
93528
93702
|
if (__privateGet$1(this, _session).mode === "body") {
|
|
@@ -93631,6 +93805,62 @@ ${l}
|
|
|
93631
93805
|
__privateGet$1(this, _visibleHost).scrollTop = yPosition;
|
|
93632
93806
|
}
|
|
93633
93807
|
};
|
|
93808
|
+
computeAnchorMap_fn = function(bookmarks, layout) {
|
|
93809
|
+
const anchorMap = /* @__PURE__ */ new Map();
|
|
93810
|
+
const blockPmRanges = /* @__PURE__ */ new Map();
|
|
93811
|
+
const computeBlockRange = (blockId) => {
|
|
93812
|
+
if (blockPmRanges.has(blockId)) {
|
|
93813
|
+
const cached = blockPmRanges.get(blockId);
|
|
93814
|
+
return { pmStart: cached.pmStart, pmEnd: cached.pmEnd };
|
|
93815
|
+
}
|
|
93816
|
+
const block = __privateGet$1(this, _layoutState).blocks.find((b2) => b2.id === blockId);
|
|
93817
|
+
if (!block || block.kind !== "paragraph") {
|
|
93818
|
+
blockPmRanges.set(blockId, { pmStart: null, pmEnd: null, hasFragmentPositions: false });
|
|
93819
|
+
return { pmStart: null, pmEnd: null };
|
|
93820
|
+
}
|
|
93821
|
+
let pmStart = null;
|
|
93822
|
+
let pmEnd = null;
|
|
93823
|
+
for (const run2 of block.runs) {
|
|
93824
|
+
if (run2.pmStart != null) {
|
|
93825
|
+
pmStart = pmStart == null ? run2.pmStart : Math.min(pmStart, run2.pmStart);
|
|
93826
|
+
}
|
|
93827
|
+
if (run2.pmEnd != null) {
|
|
93828
|
+
pmEnd = pmEnd == null ? run2.pmEnd : Math.max(pmEnd, run2.pmEnd);
|
|
93829
|
+
}
|
|
93830
|
+
}
|
|
93831
|
+
blockPmRanges.set(blockId, { pmStart, pmEnd, hasFragmentPositions: false });
|
|
93832
|
+
return { pmStart, pmEnd };
|
|
93833
|
+
};
|
|
93834
|
+
bookmarks.forEach((pmPosition, bookmarkName) => {
|
|
93835
|
+
for (const page of layout.pages) {
|
|
93836
|
+
for (const fragment of page.fragments) {
|
|
93837
|
+
if (fragment.kind !== "para") continue;
|
|
93838
|
+
let fragStart = fragment.pmStart;
|
|
93839
|
+
let fragEnd = fragment.pmEnd;
|
|
93840
|
+
if (fragStart == null || fragEnd == null) {
|
|
93841
|
+
const range2 = computeBlockRange(fragment.blockId);
|
|
93842
|
+
if (range2.pmStart != null && range2.pmEnd != null) {
|
|
93843
|
+
fragStart = range2.pmStart;
|
|
93844
|
+
fragEnd = range2.pmEnd;
|
|
93845
|
+
}
|
|
93846
|
+
} else {
|
|
93847
|
+
const cached = blockPmRanges.get(fragment.blockId);
|
|
93848
|
+
blockPmRanges.set(fragment.blockId, {
|
|
93849
|
+
pmStart: cached?.pmStart ?? fragStart,
|
|
93850
|
+
pmEnd: cached?.pmEnd ?? fragEnd,
|
|
93851
|
+
hasFragmentPositions: true
|
|
93852
|
+
});
|
|
93853
|
+
}
|
|
93854
|
+
if (fragStart == null || fragEnd == null) continue;
|
|
93855
|
+
if (pmPosition >= fragStart && pmPosition < fragEnd) {
|
|
93856
|
+
anchorMap.set(bookmarkName, page.number);
|
|
93857
|
+
return;
|
|
93858
|
+
}
|
|
93859
|
+
}
|
|
93860
|
+
}
|
|
93861
|
+
});
|
|
93862
|
+
return anchorMap;
|
|
93863
|
+
};
|
|
93634
93864
|
waitForPageMount_fn = async function(pageIndex, options = {}) {
|
|
93635
93865
|
const timeout2 = options.timeout ?? 2e3;
|
|
93636
93866
|
const startTime = performance.now();
|
|
@@ -94250,6 +94480,7 @@ ${l}
|
|
|
94250
94480
|
SELECTION_BORDER_RADIUS: "2px",
|
|
94251
94481
|
MAX_LABEL_LENGTH: 30
|
|
94252
94482
|
};
|
|
94483
|
+
_PresentationEditor.ANCHOR_NAV_TIMEOUT_MS = 2e3;
|
|
94253
94484
|
let PresentationEditor = _PresentationEditor;
|
|
94254
94485
|
class PresentationInputBridge {
|
|
94255
94486
|
/**
|
|
@@ -129803,7 +130034,8 @@ ${style2}
|
|
|
129803
130034
|
if (!surface) {
|
|
129804
130035
|
return;
|
|
129805
130036
|
}
|
|
129806
|
-
|
|
130037
|
+
const detail = event?.detail ?? {};
|
|
130038
|
+
moveCursorToMouseEvent(detail, props.editor);
|
|
129807
130039
|
setTimeout(() => {
|
|
129808
130040
|
const currentState = props.editor.state;
|
|
129809
130041
|
const hasLink = selectionHasNodeOrMark(currentState, "link", { requireEnds: true });
|
|
@@ -129818,8 +130050,8 @@ ${style2}
|
|
|
129818
130050
|
closePopover: props.closePopover
|
|
129819
130051
|
},
|
|
129820
130052
|
{
|
|
129821
|
-
left: `${
|
|
129822
|
-
top: `${
|
|
130053
|
+
left: `${detail.clientX - surfaceRect.left}px`,
|
|
130054
|
+
top: `${detail.clientY - surfaceRect.top + 15}px`
|
|
129823
130055
|
}
|
|
129824
130056
|
);
|
|
129825
130057
|
}
|
|
@@ -147502,7 +147734,7 @@ ${style2}
|
|
|
147502
147734
|
this.config.colors = shuffleArray(this.config.colors);
|
|
147503
147735
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
147504
147736
|
this.colorIndex = 0;
|
|
147505
|
-
this.version = "1.0.0-beta.
|
|
147737
|
+
this.version = "1.0.0-beta.34";
|
|
147506
147738
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
147507
147739
|
this.superdocId = config2.superdocId || v4();
|
|
147508
147740
|
this.colors = this.config.colors;
|
|
@@ -149946,7 +150178,7 @@ ${style2}
|
|
|
149946
150178
|
value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
|
|
149947
150179
|
);
|
|
149948
150180
|
}
|
|
149949
|
-
const
|
|
150181
|
+
const indexCQeXM6oB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
149950
150182
|
__proto__: null,
|
|
149951
150183
|
unified
|
|
149952
150184
|
}, Symbol.toStringTag, { value: "Module" }));
|