superdoc 1.0.0-beta.6 → 1.0.0-beta.7

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 (30) hide show
  1. package/dist/chunks/{PdfViewer-DmPiOFJ8.cjs → PdfViewer-T4fTm1XF.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-CdGAVn-4.es.js → PdfViewer-hAYAlKzI.es.js} +1 -1
  3. package/dist/chunks/{index-QulG3CF7.cjs → index-CYQjWGo5.cjs} +3 -3
  4. package/dist/chunks/{index-nXifzD54.es.js → index-DGYP5Xod.es.js} +3 -3
  5. package/dist/chunks/{index-hjUbJ86s-BMiwCR8J.es.js → index-DV613LhK-BY095UD2.es.js} +1 -1
  6. package/dist/chunks/{index-hjUbJ86s-BLl65XJn.cjs → index-DV613LhK-CqFLIBmd.cjs} +1 -1
  7. package/dist/chunks/{super-editor.es-BYVEYLjl.es.js → super-editor.es-CcaD69pQ.es.js} +135 -48
  8. package/dist/chunks/{super-editor.es-0GatZWs9.cjs → super-editor.es-DmhQckCV.cjs} +135 -48
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/style.css +9 -9
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-CZF9SnYh.js → converter-BM6gXTRC.js} +1 -1
  13. package/dist/super-editor/chunks/{docx-zipper-DWypbE0V.js → docx-zipper-fwXPJGKu.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-BdXHlHt-.js → editor-RPTrfArg.js} +192 -45
  15. package/dist/super-editor/chunks/{index-hjUbJ86s.js → index-DV613LhK.js} +1 -1
  16. package/dist/super-editor/chunks/{toolbar-CmelvLTd.js → toolbar-DacKXz_n.js} +5 -4
  17. package/dist/super-editor/converter.es.js +1 -1
  18. package/dist/super-editor/docx-zipper.es.js +2 -2
  19. package/dist/super-editor/editor.es.js +3 -3
  20. package/dist/super-editor/file-zipper.es.js +1 -1
  21. package/dist/super-editor/style.css +9 -9
  22. package/dist/super-editor/super-editor.es.js +9 -8
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.cjs +1 -1
  25. package/dist/super-editor.es.js +1 -1
  26. package/dist/superdoc.cjs +2 -2
  27. package/dist/superdoc.es.js +2 -2
  28. package/dist/superdoc.umd.js +137 -50
  29. package/dist/superdoc.umd.js.map +1 -1
  30. package/package.json +1 -1
@@ -35581,7 +35581,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35581
35581
  static getStoredSuperdocVersion(docx) {
35582
35582
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35583
35583
  }
35584
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.6") {
35584
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.7") {
35585
35585
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35586
35586
  }
35587
35587
  /**
@@ -46562,7 +46562,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
46562
46562
  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);
46563
46563
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
46564
46564
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
46565
- 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, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_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, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_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, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _visibleHost2, _getTargetDom, _onTargetChanged, _listeners, _currentTarget, _destroyed, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, updateHTMLAttributes_fn, updateDOMStyles_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;
46565
+ 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, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_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, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_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, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _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, updateHTMLAttributes_fn, updateDOMStyles_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;
46566
46566
  var GOOD_LEAF_SIZE = 200;
46567
46567
  var RopeSequence = function RopeSequence2() {
46568
46568
  };
@@ -60069,7 +60069,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
60069
60069
  const shouldSkipNodeView = (editor) => {
60070
60070
  return isHeadless(editor);
60071
60071
  };
60072
- const summaryVersion = "1.0.0-beta.6";
60072
+ const summaryVersion = "1.0.0-beta.7";
60073
60073
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
60074
60074
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
60075
60075
  function mapAttributes(attrs) {
@@ -60848,7 +60848,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
60848
60848
  { default: remarkStringify2 },
60849
60849
  { default: remarkGfm2 }
60850
60850
  ] = await Promise.all([
60851
- Promise.resolve().then(() => indexHjUbJ86s),
60851
+ Promise.resolve().then(() => indexDV613LhK),
60852
60852
  Promise.resolve().then(() => indexDRCvimau),
60853
60853
  Promise.resolve().then(() => indexC_x_N6Uh),
60854
60854
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -61053,7 +61053,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61053
61053
  * Process collaboration migrations
61054
61054
  */
61055
61055
  processCollaborationMigrations() {
61056
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.6");
61056
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.7");
61057
61057
  if (!this.options.ydoc) return;
61058
61058
  const metaMap = this.options.ydoc.getMap("meta");
61059
61059
  let docVersion = metaMap.get("version");
@@ -76765,6 +76765,24 @@ ${l}
76765
76765
  }
76766
76766
  return Object.keys(context).length > 0 ? context : void 0;
76767
76767
  };
76768
+ const uiSurfaces = /* @__PURE__ */ new WeakSet();
76769
+ function isInRegisteredSurface(event) {
76770
+ const path2 = typeof event.composedPath === "function" ? event.composedPath() : [];
76771
+ if (path2.length > 0) {
76772
+ for (const node22 of path2) {
76773
+ if (uiSurfaces.has(node22)) return true;
76774
+ if (node22?.hasAttribute?.("data-editor-ui-surface")) return true;
76775
+ }
76776
+ return false;
76777
+ }
76778
+ let node2 = event.target;
76779
+ while (node2) {
76780
+ if (uiSurfaces.has(node2)) return true;
76781
+ if (node2.hasAttribute?.("data-editor-ui-surface")) return true;
76782
+ node2 = node2.parentElement;
76783
+ }
76784
+ return false;
76785
+ }
76768
76786
  const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
76769
76787
  const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
76770
76788
  const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
@@ -79541,39 +79559,49 @@ ${l}
79541
79559
  };
79542
79560
  let PresentationEditor = _PresentationEditor;
79543
79561
  class PresentationInputBridge {
79544
- constructor(windowRoot, visibleHost, getTargetDom, onTargetChanged) {
79562
+ constructor(windowRoot, layoutSurface, getTargetDom, onTargetChanged, options) {
79545
79563
  __privateAdd$1(this, _PresentationInputBridge_instances);
79546
79564
  __privateAdd$1(this, _windowRoot);
79547
- __privateAdd$1(this, _visibleHost2);
79565
+ __privateAdd$1(this, _layoutSurfaces);
79548
79566
  __privateAdd$1(this, _getTargetDom);
79549
79567
  __privateAdd$1(this, _onTargetChanged);
79550
79568
  __privateAdd$1(this, _listeners);
79551
79569
  __privateAdd$1(this, _currentTarget, null);
79552
79570
  __privateAdd$1(this, _destroyed, false);
79571
+ __privateAdd$1(this, _useWindowFallback);
79553
79572
  __privateSet(this, _windowRoot, windowRoot);
79554
- __privateSet(this, _visibleHost2, visibleHost);
79573
+ __privateSet(this, _layoutSurfaces, /* @__PURE__ */ new Set([layoutSurface]));
79555
79574
  __privateSet(this, _getTargetDom, getTargetDom);
79556
79575
  __privateSet(this, _onTargetChanged, onTargetChanged);
79557
79576
  __privateSet(this, _listeners, []);
79577
+ __privateSet(this, _useWindowFallback, options?.useWindowFallback ?? false);
79558
79578
  }
79559
79579
  bind() {
79560
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "keydown", __privateMethod$1(this, _PresentationInputBridge_instances, forwardKeyboardEvent_fn), __privateGet$1(this, _windowRoot));
79561
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "keypress", __privateMethod$1(this, _PresentationInputBridge_instances, forwardKeyboardEvent_fn), __privateGet$1(this, _windowRoot));
79562
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "keyup", __privateMethod$1(this, _PresentationInputBridge_instances, forwardKeyboardEvent_fn), __privateGet$1(this, _windowRoot));
79563
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "compositionstart", __privateMethod$1(this, _PresentationInputBridge_instances, forwardCompositionEvent_fn), __privateGet$1(this, _windowRoot));
79564
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "compositionupdate", __privateMethod$1(this, _PresentationInputBridge_instances, forwardCompositionEvent_fn), __privateGet$1(this, _windowRoot));
79565
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "compositionend", __privateMethod$1(this, _PresentationInputBridge_instances, forwardCompositionEvent_fn), __privateGet$1(this, _windowRoot));
79566
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "contextmenu", __privateMethod$1(this, _PresentationInputBridge_instances, forwardContextMenu_fn), __privateGet$1(this, _windowRoot));
79567
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "beforeinput", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), __privateGet$1(this, _visibleHost2));
79568
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "input", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), __privateGet$1(this, _visibleHost2));
79569
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "textInput", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), __privateGet$1(this, _visibleHost2));
79570
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "beforeinput", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), __privateGet$1(this, _windowRoot));
79571
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "input", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), __privateGet$1(this, _windowRoot));
79572
- __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "textInput", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), __privateGet$1(this, _windowRoot));
79580
+ const keyboardTargets = __privateMethod$1(this, _PresentationInputBridge_instances, getListenerTargets_fn).call(this);
79581
+ keyboardTargets.forEach((target) => {
79582
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "keydown", __privateMethod$1(this, _PresentationInputBridge_instances, forwardKeyboardEvent_fn), target);
79583
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "keyup", __privateMethod$1(this, _PresentationInputBridge_instances, forwardKeyboardEvent_fn), target);
79584
+ });
79585
+ const compositionTargets = __privateMethod$1(this, _PresentationInputBridge_instances, getListenerTargets_fn).call(this);
79586
+ compositionTargets.forEach((target) => {
79587
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "compositionstart", __privateMethod$1(this, _PresentationInputBridge_instances, forwardCompositionEvent_fn), target);
79588
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "compositionupdate", __privateMethod$1(this, _PresentationInputBridge_instances, forwardCompositionEvent_fn), target);
79589
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "compositionend", __privateMethod$1(this, _PresentationInputBridge_instances, forwardCompositionEvent_fn), target);
79590
+ });
79591
+ const textTargets = __privateMethod$1(this, _PresentationInputBridge_instances, getListenerTargets_fn).call(this);
79592
+ textTargets.forEach((target) => {
79593
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "beforeinput", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), target);
79594
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "input", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), target);
79595
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "textInput", __privateMethod$1(this, _PresentationInputBridge_instances, forwardTextEvent_fn), target);
79596
+ });
79597
+ const contextTargets = __privateMethod$1(this, _PresentationInputBridge_instances, getListenerTargets_fn).call(this);
79598
+ contextTargets.forEach((target) => {
79599
+ __privateMethod$1(this, _PresentationInputBridge_instances, addListener_fn).call(this, "contextmenu", __privateMethod$1(this, _PresentationInputBridge_instances, forwardContextMenu_fn), target);
79600
+ });
79573
79601
  }
79574
79602
  destroy() {
79575
- __privateGet$1(this, _listeners).forEach(({ type: type2, handler: handler2, target }) => {
79576
- target.removeEventListener(type2, handler2, true);
79603
+ __privateGet$1(this, _listeners).forEach(({ type: type2, handler: handler2, target, useCapture }) => {
79604
+ target.removeEventListener(type2, handler2, useCapture);
79577
79605
  });
79578
79606
  __privateSet(this, _listeners, []);
79579
79607
  __privateSet(this, _currentTarget, null);
@@ -79608,17 +79636,18 @@ ${l}
79608
79636
  }
79609
79637
  }
79610
79638
  _windowRoot = /* @__PURE__ */ new WeakMap();
79611
- _visibleHost2 = /* @__PURE__ */ new WeakMap();
79639
+ _layoutSurfaces = /* @__PURE__ */ new WeakMap();
79612
79640
  _getTargetDom = /* @__PURE__ */ new WeakMap();
79613
79641
  _onTargetChanged = /* @__PURE__ */ new WeakMap();
79614
79642
  _listeners = /* @__PURE__ */ new WeakMap();
79615
79643
  _currentTarget = /* @__PURE__ */ new WeakMap();
79616
79644
  _destroyed = /* @__PURE__ */ new WeakMap();
79645
+ _useWindowFallback = /* @__PURE__ */ new WeakMap();
79617
79646
  _PresentationInputBridge_instances = /* @__PURE__ */ new WeakSet();
79618
- addListener_fn = function(type2, handler2, target) {
79647
+ addListener_fn = function(type2, handler2, target, useCapture = false) {
79619
79648
  const bound = handler2.bind(this);
79620
- __privateGet$1(this, _listeners).push({ type: type2, handler: bound, target });
79621
- target.addEventListener(type2, bound, true);
79649
+ __privateGet$1(this, _listeners).push({ type: type2, handler: bound, target, useCapture });
79650
+ target.addEventListener(type2, bound, useCapture);
79622
79651
  };
79623
79652
  dispatchToTarget_fn = function(originalEvent, synthetic) {
79624
79653
  if (__privateGet$1(this, _destroyed)) return;
@@ -79639,7 +79668,16 @@ ${l}
79639
79668
  }
79640
79669
  };
79641
79670
  forwardKeyboardEvent_fn = function(event) {
79642
- if (__privateMethod$1(this, _PresentationInputBridge_instances, isEventOnActiveTarget_fn).call(this, event)) {
79671
+ if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
79672
+ return;
79673
+ }
79674
+ if (event.defaultPrevented) {
79675
+ return;
79676
+ }
79677
+ if (event.isComposing || event.keyCode === 229) {
79678
+ return;
79679
+ }
79680
+ if (__privateMethod$1(this, _PresentationInputBridge_instances, isPlainCharacterKey_fn).call(this, event)) {
79643
79681
  return;
79644
79682
  }
79645
79683
  const synthetic = new KeyboardEvent(event.type, {
@@ -79657,26 +79695,40 @@ ${l}
79657
79695
  __privateMethod$1(this, _PresentationInputBridge_instances, dispatchToTarget_fn).call(this, event, synthetic);
79658
79696
  };
79659
79697
  forwardTextEvent_fn = function(event) {
79660
- if (__privateMethod$1(this, _PresentationInputBridge_instances, isEventOnActiveTarget_fn).call(this, event)) {
79698
+ if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
79661
79699
  return;
79662
79700
  }
79663
- let synthetic;
79664
- if (typeof InputEvent !== "undefined") {
79665
- synthetic = new InputEvent(event.type, {
79666
- data: event.data ?? event.data ?? null,
79667
- inputType: event.inputType ?? "insertText",
79668
- dataTransfer: event.dataTransfer ?? null,
79669
- isComposing: event.isComposing ?? false,
79670
- bubbles: true,
79671
- cancelable: true
79672
- });
79673
- } else {
79674
- synthetic = new Event(event.type, { bubbles: true, cancelable: true });
79701
+ if (event.defaultPrevented) {
79702
+ return;
79675
79703
  }
79676
- __privateMethod$1(this, _PresentationInputBridge_instances, dispatchToTarget_fn).call(this, event, synthetic);
79704
+ if (event.isComposing) {
79705
+ return;
79706
+ }
79707
+ queueMicrotask(() => {
79708
+ if (event.defaultPrevented) {
79709
+ return;
79710
+ }
79711
+ let synthetic;
79712
+ if (typeof InputEvent !== "undefined") {
79713
+ synthetic = new InputEvent(event.type, {
79714
+ data: event.data ?? event.data ?? null,
79715
+ inputType: event.inputType ?? "insertText",
79716
+ dataTransfer: event.dataTransfer ?? null,
79717
+ isComposing: event.isComposing ?? false,
79718
+ bubbles: true,
79719
+ cancelable: true
79720
+ });
79721
+ } else {
79722
+ synthetic = new Event(event.type, { bubbles: true, cancelable: true });
79723
+ }
79724
+ __privateMethod$1(this, _PresentationInputBridge_instances, dispatchToTarget_fn).call(this, event, synthetic);
79725
+ });
79677
79726
  };
79678
79727
  forwardCompositionEvent_fn = function(event) {
79679
- if (__privateMethod$1(this, _PresentationInputBridge_instances, isEventOnActiveTarget_fn).call(this, event)) {
79728
+ if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
79729
+ return;
79730
+ }
79731
+ if (event.defaultPrevented) {
79680
79732
  return;
79681
79733
  }
79682
79734
  let synthetic;
@@ -79692,7 +79744,10 @@ ${l}
79692
79744
  __privateMethod$1(this, _PresentationInputBridge_instances, dispatchToTarget_fn).call(this, event, synthetic);
79693
79745
  };
79694
79746
  forwardContextMenu_fn = function(event) {
79695
- if (__privateMethod$1(this, _PresentationInputBridge_instances, isEventOnActiveTarget_fn).call(this, event)) {
79747
+ if (__privateMethod$1(this, _PresentationInputBridge_instances, shouldSkipSurface_fn).call(this, event)) {
79748
+ return;
79749
+ }
79750
+ if (event.defaultPrevented) {
79696
79751
  return;
79697
79752
  }
79698
79753
  const synthetic = new MouseEvent("contextmenu", {
@@ -79726,6 +79781,36 @@ ${l}
79726
79781
  }
79727
79782
  return false;
79728
79783
  };
79784
+ shouldSkipSurface_fn = function(event) {
79785
+ if (__privateMethod$1(this, _PresentationInputBridge_instances, isEventOnActiveTarget_fn).call(this, event)) {
79786
+ return true;
79787
+ }
79788
+ if (!__privateMethod$1(this, _PresentationInputBridge_instances, isInLayoutSurface_fn).call(this, event)) {
79789
+ return true;
79790
+ }
79791
+ if (isInRegisteredSurface(event)) {
79792
+ return true;
79793
+ }
79794
+ return false;
79795
+ };
79796
+ isInLayoutSurface_fn = function(event) {
79797
+ const path2 = typeof event.composedPath === "function" ? event.composedPath() : [];
79798
+ if (path2.length) {
79799
+ return path2.some((node2) => __privateGet$1(this, _layoutSurfaces).has(node2));
79800
+ }
79801
+ const origin = event.target;
79802
+ return origin ? __privateGet$1(this, _layoutSurfaces).has(origin) : false;
79803
+ };
79804
+ getListenerTargets_fn = function() {
79805
+ const targets = new Set(__privateGet$1(this, _layoutSurfaces));
79806
+ if (__privateGet$1(this, _useWindowFallback)) {
79807
+ targets.add(__privateGet$1(this, _windowRoot));
79808
+ }
79809
+ return Array.from(targets);
79810
+ };
79811
+ isPlainCharacterKey_fn = function(event) {
79812
+ return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
79813
+ };
79729
79814
  const Color = Extension.create({
79730
79815
  name: "color",
79731
79816
  addOptions() {
@@ -108113,7 +108198,8 @@ ${style2}
108113
108198
  class: "superdoc-toolbar",
108114
108199
  key: unref(toolbarKey),
108115
108200
  role: "toolbar",
108116
- "aria-label": "Toolbar"
108201
+ "aria-label": "Toolbar",
108202
+ "data-editor-ui-surface": ""
108117
108203
  }, [
108118
108204
  unref(showLeftSide) ? (openBlock(), createBlock(ButtonGroup, {
108119
108205
  key: 0,
@@ -108145,7 +108231,7 @@ ${style2}
108145
108231
  };
108146
108232
  }
108147
108233
  };
108148
- const Toolbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-639f50b4"]]);
108234
+ const Toolbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-3f5ec271"]]);
108149
108235
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
108150
108236
  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: ";
108151
108237
  async function baseInsightsFetch(payload, options = {}) {
@@ -109157,7 +109243,8 @@ ${style2}
109157
109243
  const DocumentMode = /* @__PURE__ */ _export_sfc$1(_sfc_main$e$1, [["__scopeId", "data-v-8730b752"]]);
109158
109244
  const _hoisted_1$c$1 = {
109159
109245
  key: 0,
109160
- class: "linked-style-buttons"
109246
+ class: "linked-style-buttons",
109247
+ "data-editor-ui-surface": ""
109161
109248
  };
109162
109249
  const _hoisted_2$8$1 = ["onClick", "onKeydown", "aria-label"];
109163
109250
  const _sfc_main$d$1 = {
@@ -109236,7 +109323,7 @@ ${style2}
109236
109323
  };
109237
109324
  }
109238
109325
  };
109239
- const LinkedStyle = /* @__PURE__ */ _export_sfc$1(_sfc_main$d$1, [["__scopeId", "data-v-b53508a8"]]);
109326
+ const LinkedStyle = /* @__PURE__ */ _export_sfc$1(_sfc_main$d$1, [["__scopeId", "data-v-ecb78965"]]);
109240
109327
  const _hoisted_1$b$1 = {
109241
109328
  key: 0,
109242
109329
  class: "link-title"
@@ -131443,7 +131530,7 @@ ${style2}
131443
131530
  this.config.colors = shuffleArray(this.config.colors);
131444
131531
  this.userColorMap = /* @__PURE__ */ new Map();
131445
131532
  this.colorIndex = 0;
131446
- this.version = "1.0.0-beta.6";
131533
+ this.version = "1.0.0-beta.7";
131447
131534
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
131448
131535
  this.superdocId = config2.superdocId || v4();
131449
131536
  this.colors = this.config.colors;
@@ -133886,7 +133973,7 @@ ${style2}
133886
133973
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
133887
133974
  );
133888
133975
  }
133889
- const indexHjUbJ86s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
133976
+ const indexDV613LhK = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
133890
133977
  __proto__: null,
133891
133978
  unified
133892
133979
  }, Symbol.toStringTag, { value: "Module" }));