@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
|
@@ -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.
|
|
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,
|
|
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
|
};
|
|
@@ -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.
|
|
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-
|
|
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.
|
|
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");
|
|
@@ -82721,7 +82721,7 @@ const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
|
|
|
82721
82721
|
const MULTI_CLICK_TIME_THRESHOLD_MS = 400;
|
|
82722
82722
|
const MULTI_CLICK_DISTANCE_THRESHOLD_PX = 5;
|
|
82723
82723
|
const HEADER_FOOTER_INIT_BUDGET_MS = 200;
|
|
82724
|
-
const SCROLL_DEBOUNCE_MS =
|
|
82724
|
+
const SCROLL_DEBOUNCE_MS = 32;
|
|
82725
82725
|
const MAX_ZOOM_WARNING_THRESHOLD = 10;
|
|
82726
82726
|
const MAX_SELECTION_RECTS_PER_USER = 100;
|
|
82727
82727
|
const DEFAULT_STALE_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
@@ -82738,7 +82738,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
82738
82738
|
__privateAdd$1(this, _selectionOverlay2);
|
|
82739
82739
|
__privateAdd$1(this, _hiddenHost);
|
|
82740
82740
|
__privateAdd$1(this, _layoutOptions);
|
|
82741
|
-
__privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null });
|
|
82741
|
+
__privateAdd$1(this, _layoutState, { blocks: [], measures: [], layout: null, bookmarks: /* @__PURE__ */ new Map() });
|
|
82742
82742
|
__privateAdd$1(this, _domPainter, null);
|
|
82743
82743
|
__privateAdd$1(this, _dragHandlerCleanup, null);
|
|
82744
82744
|
__privateAdd$1(this, _layoutError, null);
|
|
@@ -82788,18 +82788,31 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
82788
82788
|
__privateAdd$1(this, _isDragging, false);
|
|
82789
82789
|
__privateAdd$1(this, _dragExtensionMode, "char");
|
|
82790
82790
|
__privateAdd$1(this, _remoteCursorState, /* @__PURE__ */ new Map());
|
|
82791
|
+
__privateAdd$1(this, _remoteCursorElements, /* @__PURE__ */ new Map());
|
|
82791
82792
|
__privateAdd$1(this, _remoteCursorDirty, false);
|
|
82792
82793
|
__privateAdd$1(this, _remoteCursorOverlay, null);
|
|
82793
82794
|
__privateAdd$1(this, _localSelectionLayer, null);
|
|
82794
82795
|
__privateAdd$1(this, _awarenessCleanup, null);
|
|
82795
82796
|
__privateAdd$1(this, _scrollCleanup, null);
|
|
82796
|
-
__privateAdd$1(this, _remoteCursorRafHandle, null);
|
|
82797
82797
|
__privateAdd$1(this, _scrollTimeout);
|
|
82798
|
+
__privateAdd$1(this, _lastRemoteCursorRenderTime, 0);
|
|
82799
|
+
__privateAdd$1(this, _remoteCursorThrottleTimeout, null);
|
|
82798
82800
|
__privateAdd$1(this, _handlePointerDown, (event) => {
|
|
82799
82801
|
if (event.button !== 0) {
|
|
82800
82802
|
return;
|
|
82801
82803
|
}
|
|
82802
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
|
+
}
|
|
82803
82816
|
const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
|
|
82804
82817
|
if (!__privateGet$1(this, _layoutState).layout) {
|
|
82805
82818
|
if (!isDraggableAnnotation) {
|
|
@@ -84059,12 +84072,11 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84059
84072
|
__privateSet(this, _rafHandle, null);
|
|
84060
84073
|
}, "Layout RAF");
|
|
84061
84074
|
}
|
|
84062
|
-
if (__privateGet$1(this,
|
|
84075
|
+
if (__privateGet$1(this, _remoteCursorThrottleTimeout) !== null) {
|
|
84063
84076
|
__privateMethod$1(this, _PresentationEditor_instances, safeCleanup_fn).call(this, () => {
|
|
84064
|
-
|
|
84065
|
-
|
|
84066
|
-
|
|
84067
|
-
}, "Remote cursor RAF");
|
|
84077
|
+
clearTimeout(__privateGet$1(this, _remoteCursorThrottleTimeout));
|
|
84078
|
+
__privateSet(this, _remoteCursorThrottleTimeout, null);
|
|
84079
|
+
}, "Remote cursor throttle");
|
|
84068
84080
|
}
|
|
84069
84081
|
__privateGet$1(this, _editorListeners).forEach(({ event, handler: handler2 }) => __privateGet$1(this, _editor3)?.off(event, handler2));
|
|
84070
84082
|
__privateSet(this, _editorListeners, []);
|
|
@@ -84088,6 +84100,7 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84088
84100
|
__privateSet(this, _scrollCleanup, null);
|
|
84089
84101
|
}
|
|
84090
84102
|
__privateGet$1(this, _remoteCursorState).clear();
|
|
84103
|
+
__privateGet$1(this, _remoteCursorElements).clear();
|
|
84091
84104
|
__privateSet(this, _remoteCursorOverlay, null);
|
|
84092
84105
|
if (__privateGet$1(this, _options)?.documentId) {
|
|
84093
84106
|
__privateGet$1(_PresentationEditor2, _instances).delete(__privateGet$1(this, _options).documentId);
|
|
@@ -84130,6 +84143,94 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
|
|
|
84130
84143
|
__privateGet$1(this, _editor3).destroy();
|
|
84131
84144
|
}
|
|
84132
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
|
+
}
|
|
84133
84234
|
};
|
|
84134
84235
|
_instances = /* @__PURE__ */ new WeakMap();
|
|
84135
84236
|
_options = /* @__PURE__ */ new WeakMap();
|
|
@@ -84190,13 +84291,15 @@ _dragAnchor = /* @__PURE__ */ new WeakMap();
|
|
|
84190
84291
|
_isDragging = /* @__PURE__ */ new WeakMap();
|
|
84191
84292
|
_dragExtensionMode = /* @__PURE__ */ new WeakMap();
|
|
84192
84293
|
_remoteCursorState = /* @__PURE__ */ new WeakMap();
|
|
84294
|
+
_remoteCursorElements = /* @__PURE__ */ new WeakMap();
|
|
84193
84295
|
_remoteCursorDirty = /* @__PURE__ */ new WeakMap();
|
|
84194
84296
|
_remoteCursorOverlay = /* @__PURE__ */ new WeakMap();
|
|
84195
84297
|
_localSelectionLayer = /* @__PURE__ */ new WeakMap();
|
|
84196
84298
|
_awarenessCleanup = /* @__PURE__ */ new WeakMap();
|
|
84197
84299
|
_scrollCleanup = /* @__PURE__ */ new WeakMap();
|
|
84198
|
-
_remoteCursorRafHandle = /* @__PURE__ */ new WeakMap();
|
|
84199
84300
|
_scrollTimeout = /* @__PURE__ */ new WeakMap();
|
|
84301
|
+
_lastRemoteCursorRenderTime = /* @__PURE__ */ new WeakMap();
|
|
84302
|
+
_remoteCursorThrottleTimeout = /* @__PURE__ */ new WeakMap();
|
|
84200
84303
|
_PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
|
|
84201
84304
|
collectCommentPositions_fn = function() {
|
|
84202
84305
|
const editorState = __privateGet$1(this, _editor3)?.state;
|
|
@@ -84257,9 +84360,13 @@ setupEditorListeners_fn = function() {
|
|
|
84257
84360
|
__privateSet(this, _pendingDocChange, true);
|
|
84258
84361
|
__privateMethod$1(this, _PresentationEditor_instances, scheduleRerender_fn).call(this);
|
|
84259
84362
|
}
|
|
84363
|
+
if (transaction?.docChanged) {
|
|
84364
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
|
|
84365
|
+
}
|
|
84260
84366
|
};
|
|
84261
84367
|
const handleSelection = () => {
|
|
84262
84368
|
__privateMethod$1(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
|
|
84369
|
+
__privateMethod$1(this, _PresentationEditor_instances, updateLocalAwarenessCursor_fn).call(this);
|
|
84263
84370
|
};
|
|
84264
84371
|
__privateGet$1(this, _editor3).on("update", handleUpdate);
|
|
84265
84372
|
__privateGet$1(this, _editor3).on("selectionUpdate", handleSelection);
|
|
@@ -84329,6 +84436,29 @@ setupCollaborationCursors_fn = function() {
|
|
|
84329
84436
|
});
|
|
84330
84437
|
handleAwarenessChange();
|
|
84331
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
|
+
};
|
|
84332
84462
|
normalizeAwarenessStates_fn = function() {
|
|
84333
84463
|
const provider = __privateGet$1(this, _options).collaborationProvider;
|
|
84334
84464
|
if (!provider?.awareness) return /* @__PURE__ */ new Map();
|
|
@@ -84396,27 +84526,45 @@ scheduleRemoteCursorUpdate_fn = function() {
|
|
|
84396
84526
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
|
|
84397
84527
|
if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
84398
84528
|
__privateSet(this, _remoteCursorUpdateScheduled, true);
|
|
84399
|
-
|
|
84400
|
-
|
|
84401
|
-
|
|
84402
|
-
|
|
84403
|
-
|
|
84404
|
-
|
|
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
|
+
});
|
|
84405
84552
|
};
|
|
84406
84553
|
scheduleRemoteCursorReRender_fn = function() {
|
|
84407
84554
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) return;
|
|
84408
84555
|
if (__privateGet$1(this, _remoteCursorUpdateScheduled)) return;
|
|
84409
84556
|
__privateSet(this, _remoteCursorUpdateScheduled, true);
|
|
84410
84557
|
const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView ?? window;
|
|
84411
|
-
|
|
84558
|
+
win.requestAnimationFrame(() => {
|
|
84412
84559
|
__privateSet(this, _remoteCursorUpdateScheduled, false);
|
|
84413
|
-
__privateSet(this,
|
|
84560
|
+
__privateSet(this, _lastRemoteCursorRenderTime, performance.now());
|
|
84414
84561
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCursors_fn).call(this);
|
|
84415
|
-
})
|
|
84562
|
+
});
|
|
84416
84563
|
};
|
|
84417
84564
|
updateRemoteCursors_fn = function() {
|
|
84418
84565
|
if (__privateGet$1(this, _layoutOptions).presence?.enabled === false) {
|
|
84419
84566
|
__privateGet$1(this, _remoteCursorState).clear();
|
|
84567
|
+
__privateGet$1(this, _remoteCursorElements).clear();
|
|
84420
84568
|
if (__privateGet$1(this, _remoteCursorOverlay)) {
|
|
84421
84569
|
__privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
|
|
84422
84570
|
}
|
|
@@ -84445,9 +84593,6 @@ updateRemoteCursors_fn = function() {
|
|
|
84445
84593
|
}
|
|
84446
84594
|
};
|
|
84447
84595
|
renderRemoteCursors_fn = function() {
|
|
84448
|
-
if (__privateGet$1(this, _remoteCursorOverlay)) {
|
|
84449
|
-
__privateGet$1(this, _remoteCursorOverlay).innerHTML = "";
|
|
84450
|
-
}
|
|
84451
84596
|
const layout = __privateGet$1(this, _layoutState)?.layout;
|
|
84452
84597
|
const blocks = __privateGet$1(this, _layoutState)?.blocks;
|
|
84453
84598
|
const measures = __privateGet$1(this, _layoutState)?.measures;
|
|
@@ -84456,37 +84601,63 @@ renderRemoteCursors_fn = function() {
|
|
|
84456
84601
|
}
|
|
84457
84602
|
const maxVisible = __privateGet$1(this, _layoutOptions).presence?.maxVisible ?? 20;
|
|
84458
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();
|
|
84459
84605
|
sortedCursors.forEach((cursor) => {
|
|
84606
|
+
visibleClientIds.add(cursor.clientId);
|
|
84460
84607
|
if (cursor.anchor === cursor.head) {
|
|
84461
84608
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteCaret_fn).call(this, cursor);
|
|
84462
84609
|
} else {
|
|
84463
84610
|
__privateMethod$1(this, _PresentationEditor_instances, renderRemoteSelection_fn).call(this, cursor);
|
|
84464
84611
|
}
|
|
84465
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
|
+
});
|
|
84466
84619
|
};
|
|
84467
84620
|
renderRemoteCaret_fn = function(cursor) {
|
|
84468
84621
|
const caretLayout = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRect_fn).call(this, cursor.head);
|
|
84469
|
-
if (!caretLayout) return;
|
|
84470
|
-
const coords = __privateMethod$1(this, _PresentationEditor_instances, convertPageLocalToOverlayCoords_fn).call(this, caretLayout.pageIndex, caretLayout.x, caretLayout.y);
|
|
84471
|
-
if (!coords) return;
|
|
84472
84622
|
const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
|
|
84473
84623
|
const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
|
|
84474
84624
|
const color = __privateMethod$1(this, _PresentationEditor_instances, getValidatedColor_fn).call(this, cursor);
|
|
84475
|
-
|
|
84476
|
-
|
|
84477
|
-
|
|
84478
|
-
|
|
84479
|
-
|
|
84480
|
-
|
|
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)`;
|
|
84481
84655
|
caretEl.style.height = `${Math.max(1, caretLayout.height * zoom)}px`;
|
|
84482
|
-
caretEl.style.
|
|
84483
|
-
|
|
84484
|
-
|
|
84485
|
-
|
|
84486
|
-
if (__privateGet$1(this, _layoutOptions).presence?.showLabels !== false) {
|
|
84487
|
-
__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;
|
|
84488
84660
|
}
|
|
84489
|
-
__privateGet$1(this, _remoteCursorOverlay)?.appendChild(caretEl);
|
|
84490
84661
|
};
|
|
84491
84662
|
renderRemoteCursorLabel_fn = function(caretEl, cursor) {
|
|
84492
84663
|
const labelFormatter = __privateGet$1(this, _layoutOptions).presence?.labelFormatter;
|
|
@@ -84921,6 +85092,7 @@ rerender_fn = async function() {
|
|
|
84921
85092
|
}
|
|
84922
85093
|
const sectionMetadata = [];
|
|
84923
85094
|
let blocks;
|
|
85095
|
+
let bookmarks = /* @__PURE__ */ new Map();
|
|
84924
85096
|
try {
|
|
84925
85097
|
const converter2 = __privateGet$1(this, _editor3).converter;
|
|
84926
85098
|
const converterContext = converter2 ? {
|
|
@@ -84939,6 +85111,7 @@ rerender_fn = async function() {
|
|
|
84939
85111
|
converterContext
|
|
84940
85112
|
});
|
|
84941
85113
|
blocks = result.blocks;
|
|
85114
|
+
bookmarks = result.bookmarks ?? /* @__PURE__ */ new Map();
|
|
84942
85115
|
} catch (error) {
|
|
84943
85116
|
__privateMethod$1(this, _PresentationEditor_instances, handleLayoutError_fn).call(this, "render", __privateMethod$1(this, _PresentationEditor_instances, decorateError_fn).call(this, error, "toFlowBlocks"));
|
|
84944
85117
|
return;
|
|
@@ -84986,7 +85159,8 @@ rerender_fn = async function() {
|
|
|
84986
85159
|
__privateSet(this, _sectionMetadata, sectionMetadata);
|
|
84987
85160
|
const converter = __privateGet$1(this, _editor3).converter;
|
|
84988
85161
|
__privateSet(this, _multiSectionIdentifier, buildMultiSectionIdentifier(sectionMetadata, converter?.pageStyles));
|
|
84989
|
-
|
|
85162
|
+
const anchorMap = __privateMethod$1(this, _PresentationEditor_instances, computeAnchorMap_fn).call(this, bookmarks, layout);
|
|
85163
|
+
__privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
|
|
84990
85164
|
__privateSet(this, _headerLayoutResults, headerLayouts ?? null);
|
|
84991
85165
|
__privateSet(this, _footerLayoutResults, footerLayouts ?? null);
|
|
84992
85166
|
await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
|
|
@@ -85645,9 +85819,9 @@ emitHeaderFooterEditingContext_fn = function(editor) {
|
|
|
85645
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"})`);
|
|
85646
85820
|
};
|
|
85647
85821
|
updateAwarenessSession_fn = function() {
|
|
85648
|
-
const provider = __privateGet$1(this,
|
|
85822
|
+
const provider = __privateGet$1(this, _options).collaborationProvider;
|
|
85649
85823
|
const awareness = provider?.awareness;
|
|
85650
|
-
if (!awareness
|
|
85824
|
+
if (!awareness || typeof awareness.setLocalStateField !== "function") {
|
|
85651
85825
|
return;
|
|
85652
85826
|
}
|
|
85653
85827
|
if (__privateGet$1(this, _session).mode === "body") {
|
|
@@ -85756,6 +85930,62 @@ scrollPageIntoView_fn = function(pageIndex) {
|
|
|
85756
85930
|
__privateGet$1(this, _visibleHost).scrollTop = yPosition;
|
|
85757
85931
|
}
|
|
85758
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
|
+
};
|
|
85759
85989
|
waitForPageMount_fn = async function(pageIndex, options = {}) {
|
|
85760
85990
|
const timeout2 = options.timeout ?? 2e3;
|
|
85761
85991
|
const startTime = performance.now();
|
|
@@ -86375,6 +86605,7 @@ _PresentationEditor.CURSOR_STYLES = {
|
|
|
86375
86605
|
SELECTION_BORDER_RADIUS: "2px",
|
|
86376
86606
|
MAX_LABEL_LENGTH: 30
|
|
86377
86607
|
};
|
|
86608
|
+
_PresentationEditor.ANCHOR_NAV_TIMEOUT_MS = 2e3;
|
|
86378
86609
|
let PresentationEditor = _PresentationEditor;
|
|
86379
86610
|
class PresentationInputBridge {
|
|
86380
86611
|
/**
|
|
@@ -121955,7 +122186,8 @@ const _sfc_main$2 = {
|
|
|
121955
122186
|
if (!surface) {
|
|
121956
122187
|
return;
|
|
121957
122188
|
}
|
|
121958
|
-
|
|
122189
|
+
const detail = event?.detail ?? {};
|
|
122190
|
+
moveCursorToMouseEvent(detail, props.editor);
|
|
121959
122191
|
setTimeout(() => {
|
|
121960
122192
|
const currentState = props.editor.state;
|
|
121961
122193
|
const hasLink = selectionHasNodeOrMark(currentState, "link", { requireEnds: true });
|
|
@@ -121970,8 +122202,8 @@ const _sfc_main$2 = {
|
|
|
121970
122202
|
closePopover: props.closePopover
|
|
121971
122203
|
},
|
|
121972
122204
|
{
|
|
121973
|
-
left: `${
|
|
121974
|
-
top: `${
|
|
122205
|
+
left: `${detail.clientX - surfaceRect.left}px`,
|
|
122206
|
+
top: `${detail.clientY - surfaceRect.top + 15}px`
|
|
121975
122207
|
}
|
|
121976
122208
|
);
|
|
121977
122209
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-Hv-kNdxI.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-uvvccWc5.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -42122,7 +42122,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
42122
42122
|
static getStoredSuperdocVersion(docx) {
|
|
42123
42123
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42124
42124
|
}
|
|
42125
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.
|
|
42125
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.34") {
|
|
42126
42126
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
42127
42127
|
}
|
|
42128
42128
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-Hv-kNdxI.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|