superdoc 1.0.0-beta.66 → 1.0.0-beta.67
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-CpRzjNks.cjs → PdfViewer-DTK306FZ.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BgQnzisJ.es.js → PdfViewer-P0cvxvjh.es.js} +1 -1
- package/dist/chunks/{index-Bw7VVDLD.cjs → index-BNGG0zf5.cjs} +3 -3
- package/dist/chunks/{index-Bjv0_slj-aY5T6UA7.es.js → index-Cixgd5bX-39fIJYpL.es.js} +1 -1
- package/dist/chunks/{index-Bjv0_slj-CIZ6x5_a.cjs → index-Cixgd5bX-ByqITVZq.cjs} +1 -1
- package/dist/chunks/{index-k63Akk_i.es.js → index-U-bzTPNb.es.js} +3 -3
- package/dist/chunks/{super-editor.es-PQo0jrvJ.es.js → super-editor.es-CIPQg4rG.es.js} +120 -25
- package/dist/chunks/{super-editor.es-CLrhh2DY.cjs → super-editor.es-DKbuo7ju.cjs} +120 -25
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Ybdn8aYC.js → converter-BLNx019v.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-DkmZTQAw.js → docx-zipper-BfQBQQz_.js} +1 -1
- package/dist/super-editor/chunks/{editor-pqbWS9yU.js → editor-5RSp-DNd.js} +222 -33
- package/dist/super-editor/chunks/{index-Bjv0_slj.js → index-Cixgd5bX.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-CSzCVKWZ.js → toolbar-Db_-z4Fa.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 +6 -6
- 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 +122 -27
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,11 +9,11 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
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, hideDimmingOverlay_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, focusEditorAfterImageSelection_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, computeExpectedSectionType_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, applyDomCorrectionToRects_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, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_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;
|
|
12
|
+
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, hideDimmingOverlay_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, focusEditorAfterImageSelection_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, computeExpectedSectionType_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, applyDomCorrectionToRects_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, getPageOffsetX_fn, convertPageLocalToOverlayCoords_fn, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_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;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-
|
|
16
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName$1, $ as TrackInsertMarkName$1, a0 as v4, a1 as TrackFormatMarkName$1, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as resolveRunProperties, at as encodeCSSFromPPr, au as twipsToPixels$2, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-BLNx019v.js";
|
|
16
|
+
import { D as DocxZipper } from "./docx-zipper-BfQBQQz_.js";
|
|
17
17
|
import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
@@ -13923,7 +13923,7 @@ const isHeadless = (editor) => {
|
|
|
13923
13923
|
const shouldSkipNodeView = (editor) => {
|
|
13924
13924
|
return isHeadless(editor);
|
|
13925
13925
|
};
|
|
13926
|
-
const summaryVersion = "1.0.0-beta.
|
|
13926
|
+
const summaryVersion = "1.0.0-beta.67";
|
|
13927
13927
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
13928
13928
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
13929
13929
|
function mapAttributes(attrs) {
|
|
@@ -14715,7 +14715,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14715
14715
|
{ default: remarkStringify },
|
|
14716
14716
|
{ default: remarkGfm }
|
|
14717
14717
|
] = await Promise.all([
|
|
14718
|
-
import("./index-
|
|
14718
|
+
import("./index-Cixgd5bX.js"),
|
|
14719
14719
|
import("./index-DRCvimau.js"),
|
|
14720
14720
|
import("./index-C_x_N6Uh.js"),
|
|
14721
14721
|
import("./index-D_sWOSiG.js"),
|
|
@@ -14920,7 +14920,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14920
14920
|
* Process collaboration migrations
|
|
14921
14921
|
*/
|
|
14922
14922
|
processCollaborationMigrations() {
|
|
14923
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.
|
|
14923
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.67");
|
|
14924
14924
|
if (!this.options.ydoc) return;
|
|
14925
14925
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14926
14926
|
let docVersion = metaMap.get("version");
|
|
@@ -35460,9 +35460,17 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
35460
35460
|
}
|
|
35461
35461
|
const line = measure.lines[lineIndex];
|
|
35462
35462
|
const isRTL = isRtlBlock(block);
|
|
35463
|
-
const
|
|
35464
|
-
const
|
|
35465
|
-
const
|
|
35463
|
+
const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
|
|
35464
|
+
const indentRight = typeof block.attrs?.indent?.right === "number" ? block.attrs.indent.right : 0;
|
|
35465
|
+
const paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
|
|
35466
|
+
const paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
|
|
35467
|
+
const totalIndent = paraIndentLeft + paraIndentRight;
|
|
35468
|
+
const availableWidth = Math.max(0, fragment.width - totalIndent);
|
|
35469
|
+
if (totalIndent > fragment.width) {
|
|
35470
|
+
console.warn(
|
|
35471
|
+
`[clickToPosition] Paragraph indents (${totalIndent}px) exceed fragment width (${fragment.width}px) for block ${fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
35472
|
+
);
|
|
35473
|
+
}
|
|
35466
35474
|
const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth);
|
|
35467
35475
|
if (pos == null) {
|
|
35468
35476
|
logClickStage("warn", "no-position", {
|
|
@@ -35494,9 +35502,17 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
|
|
|
35494
35502
|
if (lineIndex != null) {
|
|
35495
35503
|
const line = cellMeasure.lines[lineIndex];
|
|
35496
35504
|
const isRTL = isRtlBlock(cellBlock);
|
|
35497
|
-
const
|
|
35498
|
-
const
|
|
35499
|
-
const
|
|
35505
|
+
const indentLeft = typeof cellBlock.attrs?.indent?.left === "number" ? cellBlock.attrs.indent.left : 0;
|
|
35506
|
+
const indentRight = typeof cellBlock.attrs?.indent?.right === "number" ? cellBlock.attrs.indent.right : 0;
|
|
35507
|
+
const paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
|
|
35508
|
+
const paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
|
|
35509
|
+
const totalIndent = paraIndentLeft + paraIndentRight;
|
|
35510
|
+
const availableWidth = Math.max(0, tableHit.fragment.width - totalIndent);
|
|
35511
|
+
if (totalIndent > tableHit.fragment.width) {
|
|
35512
|
+
console.warn(
|
|
35513
|
+
`[clickToPosition:table] Paragraph indents (${totalIndent}px) exceed fragment width (${tableHit.fragment.width}px) for block ${tableHit.fragment.blockId}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
35514
|
+
);
|
|
35515
|
+
}
|
|
35500
35516
|
const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth);
|
|
35501
35517
|
if (pos != null) {
|
|
35502
35518
|
logClickStage("log", "success", {
|
|
@@ -36055,9 +36071,21 @@ const mapPointToPm = (block, line, x, isRTL, availableWidthOverride) => {
|
|
|
36055
36071
|
};
|
|
36056
36072
|
const mapPmToX = (block, line, offset2, fragmentWidth) => {
|
|
36057
36073
|
if (fragmentWidth <= 0 || line.width <= 0) return 0;
|
|
36058
|
-
|
|
36059
|
-
|
|
36060
|
-
|
|
36074
|
+
let paraIndentLeft = 0;
|
|
36075
|
+
let paraIndentRight = 0;
|
|
36076
|
+
if (block.kind === "paragraph") {
|
|
36077
|
+
const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
|
|
36078
|
+
const indentRight = typeof block.attrs?.indent?.right === "number" ? block.attrs.indent.right : 0;
|
|
36079
|
+
paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
|
|
36080
|
+
paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
|
|
36081
|
+
}
|
|
36082
|
+
const totalIndent = paraIndentLeft + paraIndentRight;
|
|
36083
|
+
const availableWidth = Math.max(0, fragmentWidth - totalIndent);
|
|
36084
|
+
if (totalIndent > fragmentWidth) {
|
|
36085
|
+
console.warn(
|
|
36086
|
+
`[mapPmToX] Paragraph indents (${totalIndent}px) exceed fragment width (${fragmentWidth}px) for block ${block.id}. This may indicate a layout miscalculation. Available width clamped to 0.`
|
|
36087
|
+
);
|
|
36088
|
+
}
|
|
36061
36089
|
return measureCharacterX(block, line, offset2, availableWidth);
|
|
36062
36090
|
};
|
|
36063
36091
|
const isRtlBlock = (block) => {
|
|
@@ -40054,8 +40082,16 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
|
|
|
40054
40082
|
};
|
|
40055
40083
|
const rawRects = layoutRectSource();
|
|
40056
40084
|
if (!rawRects.length) return [];
|
|
40057
|
-
|
|
40058
|
-
|
|
40085
|
+
let domCaretStart = null;
|
|
40086
|
+
let domCaretEnd = null;
|
|
40087
|
+
try {
|
|
40088
|
+
domCaretStart = __privateMethod(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, start2);
|
|
40089
|
+
domCaretEnd = __privateMethod(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, end2);
|
|
40090
|
+
} catch (error) {
|
|
40091
|
+
if (process$1.env.NODE_ENV === "development") {
|
|
40092
|
+
console.warn("[PresentationEditor] DOM caret computation failed in getRectsForRange:", error);
|
|
40093
|
+
}
|
|
40094
|
+
}
|
|
40059
40095
|
const layoutCaretStart = __privateMethod(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, start2, false);
|
|
40060
40096
|
__privateMethod(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, end2, false);
|
|
40061
40097
|
const pageDelta = {};
|
|
@@ -41836,6 +41872,19 @@ rerender_fn = async function() {
|
|
|
41836
41872
|
__privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
|
|
41837
41873
|
__privateSet(this, _headerLayoutResults, headerLayouts ?? null);
|
|
41838
41874
|
__privateSet(this, _footerLayoutResults, footerLayouts ?? null);
|
|
41875
|
+
const pageWidth = layout.pageSize?.w ?? __privateGet(this, _layoutOptions).pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
|
|
41876
|
+
if (__privateGet(this, _painterHost)) {
|
|
41877
|
+
__privateGet(this, _painterHost).style.width = `${pageWidth}px`;
|
|
41878
|
+
__privateGet(this, _painterHost).style.marginLeft = "0";
|
|
41879
|
+
__privateGet(this, _painterHost).style.marginRight = "0";
|
|
41880
|
+
}
|
|
41881
|
+
if (__privateGet(this, _selectionOverlay2)) {
|
|
41882
|
+
__privateGet(this, _selectionOverlay2).style.width = `${pageWidth}px`;
|
|
41883
|
+
__privateGet(this, _selectionOverlay2).style.left = "0";
|
|
41884
|
+
__privateGet(this, _selectionOverlay2).style.right = "";
|
|
41885
|
+
__privateGet(this, _selectionOverlay2).style.marginLeft = "0";
|
|
41886
|
+
__privateGet(this, _selectionOverlay2).style.marginRight = "0";
|
|
41887
|
+
}
|
|
41839
41888
|
await __privateMethod(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
|
|
41840
41889
|
__privateMethod(this, _PresentationEditor_instances, updateDecorationProviders_fn).call(this, layout);
|
|
41841
41890
|
const painter = __privateMethod(this, _PresentationEditor_instances, ensurePainter_fn).call(this, blocks, measures);
|
|
@@ -42043,7 +42092,7 @@ updateSelection_fn = function() {
|
|
|
42043
42092
|
}
|
|
42044
42093
|
try {
|
|
42045
42094
|
__privateGet(this, _localSelectionLayer).innerHTML = "";
|
|
42046
|
-
__privateMethod(this, _PresentationEditor_instances, renderCaretOverlay_fn).call(this, caretLayout
|
|
42095
|
+
__privateMethod(this, _PresentationEditor_instances, renderCaretOverlay_fn).call(this, caretLayout);
|
|
42047
42096
|
} catch (error) {
|
|
42048
42097
|
if (process$1.env.NODE_ENV === "development") {
|
|
42049
42098
|
console.warn("[PresentationEditor] Failed to render caret overlay:", error);
|
|
@@ -42052,8 +42101,16 @@ updateSelection_fn = function() {
|
|
|
42052
42101
|
return;
|
|
42053
42102
|
}
|
|
42054
42103
|
const rects = selectionToRects(layout, __privateGet(this, _layoutState).blocks, __privateGet(this, _layoutState).measures, from2, to) ?? [];
|
|
42055
|
-
|
|
42056
|
-
|
|
42104
|
+
let domStart = null;
|
|
42105
|
+
let domEnd = null;
|
|
42106
|
+
try {
|
|
42107
|
+
domStart = __privateMethod(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, from2);
|
|
42108
|
+
domEnd = __privateMethod(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, to);
|
|
42109
|
+
} catch (error) {
|
|
42110
|
+
if (process$1.env.NODE_ENV === "development") {
|
|
42111
|
+
console.warn("[PresentationEditor] DOM caret computation failed in #renderLocalSelection:", error);
|
|
42112
|
+
}
|
|
42113
|
+
}
|
|
42057
42114
|
const correctedRects = __privateMethod(this, _PresentationEditor_instances, applyDomCorrectionToRects_fn).call(this, rects, domStart, domEnd);
|
|
42058
42115
|
try {
|
|
42059
42116
|
__privateGet(this, _localSelectionLayer).innerHTML = "";
|
|
@@ -42903,12 +42960,28 @@ getHeaderFooterPageHeight_fn = function() {
|
|
|
42903
42960
|
return context.layout.pageSize?.h ?? context.region.height ?? 1;
|
|
42904
42961
|
};
|
|
42905
42962
|
/**
|
|
42906
|
-
*
|
|
42907
|
-
*
|
|
42963
|
+
* Applies DOM-based position correction to layout-computed selection rectangles.
|
|
42964
|
+
*
|
|
42965
|
+
* This method ensures selection highlights align with actual rendered text positions
|
|
42966
|
+
* by correcting for CSS effects (padding, text-indent, word-spacing) that the painter
|
|
42967
|
+
* applies but the layout engine doesn't account for. Without this correction, selection
|
|
42968
|
+
* highlights would be misaligned with the visible text.
|
|
42969
|
+
*
|
|
42970
|
+
* Algorithm:
|
|
42971
|
+
* 1. Calculate per-page delta between DOM and layout positions at selection start
|
|
42972
|
+
* 2. Apply horizontal and vertical deltas to all rectangles on the same page
|
|
42973
|
+
* 3. For the first rectangle, override with exact DOM start position
|
|
42974
|
+
* 4. For the last rectangle, compute width from DOM end position
|
|
42908
42975
|
*
|
|
42909
|
-
* The
|
|
42910
|
-
*
|
|
42911
|
-
*
|
|
42976
|
+
* The correction is page-aware because multi-page selections may have different
|
|
42977
|
+
* rendering contexts on each page (e.g., different header/footer heights, column layouts).
|
|
42978
|
+
*
|
|
42979
|
+
* @param rects - Layout-computed selection rectangles to correct
|
|
42980
|
+
* @param domStart - DOM-measured start position {pageIndex, x, y} or null if unavailable
|
|
42981
|
+
* @param domEnd - DOM-measured end position {pageIndex, x, y} or null if unavailable
|
|
42982
|
+
* @returns Corrected selection rectangles with DOM-aligned positions
|
|
42983
|
+
*
|
|
42984
|
+
* @throws Never throws - gracefully handles null DOM positions by returning uncorrected rects
|
|
42912
42985
|
*/
|
|
42913
42986
|
applyDomCorrectionToRects_fn = function(rects, domStart, domEnd) {
|
|
42914
42987
|
if (rects.length === 0) return rects;
|
|
@@ -43007,7 +43080,7 @@ clearHoverRegion_fn = function() {
|
|
|
43007
43080
|
__privateGet(this, _hoverTooltip).style.display = "none";
|
|
43008
43081
|
}
|
|
43009
43082
|
};
|
|
43010
|
-
renderCaretOverlay_fn = function(caretLayout
|
|
43083
|
+
renderCaretOverlay_fn = function(caretLayout) {
|
|
43011
43084
|
if (!__privateGet(this, _localSelectionLayer)) {
|
|
43012
43085
|
return;
|
|
43013
43086
|
}
|
|
@@ -43220,6 +43293,20 @@ createLayoutMetrics_fn = function(perf, startMark, layout, blocks) {
|
|
|
43220
43293
|
*
|
|
43221
43294
|
* @private
|
|
43222
43295
|
*/
|
|
43296
|
+
getPageOffsetX_fn = function(pageIndex) {
|
|
43297
|
+
if (!__privateGet(this, _painterHost) || !__privateGet(this, _viewportHost)) {
|
|
43298
|
+
return null;
|
|
43299
|
+
}
|
|
43300
|
+
const pageEl = __privateGet(this, _painterHost).querySelector(
|
|
43301
|
+
`.superdoc-page[data-page-index="${pageIndex}"]`
|
|
43302
|
+
);
|
|
43303
|
+
if (!pageEl) return null;
|
|
43304
|
+
const pageRect = pageEl.getBoundingClientRect();
|
|
43305
|
+
const viewportRect = __privateGet(this, _viewportHost).getBoundingClientRect();
|
|
43306
|
+
const zoom = __privateGet(this, _layoutOptions).zoom ?? 1;
|
|
43307
|
+
const offsetX = (pageRect.left - viewportRect.left) / zoom;
|
|
43308
|
+
return offsetX;
|
|
43309
|
+
};
|
|
43223
43310
|
convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY) {
|
|
43224
43311
|
if (!Number.isFinite(pageIndex) || pageIndex < 0) {
|
|
43225
43312
|
console.warn(
|
|
@@ -43241,14 +43328,55 @@ convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY)
|
|
|
43241
43328
|
}
|
|
43242
43329
|
const pageHeight = __privateGet(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
|
|
43243
43330
|
const pageGap = __privateGet(this, _layoutState).layout?.pageGap ?? 0;
|
|
43244
|
-
|
|
43245
|
-
|
|
43331
|
+
const pageOffsetX = __privateMethod(this, _PresentationEditor_instances, getPageOffsetX_fn).call(this, pageIndex) ?? 0;
|
|
43332
|
+
const coords = {
|
|
43333
|
+
x: pageOffsetX + pageLocalX,
|
|
43246
43334
|
y: pageIndex * (pageHeight + pageGap) + pageLocalY
|
|
43247
43335
|
};
|
|
43336
|
+
return coords;
|
|
43248
43337
|
};
|
|
43249
43338
|
/**
|
|
43250
|
-
*
|
|
43251
|
-
*
|
|
43339
|
+
* Computes DOM-based caret position in page-local coordinates.
|
|
43340
|
+
*
|
|
43341
|
+
* This method queries the actual DOM to find the pixel-perfect caret position
|
|
43342
|
+
* for a given ProseMirror position. It's used as the source of truth for caret
|
|
43343
|
+
* rendering, as DOM measurements reflect the actual painted text (including CSS
|
|
43344
|
+
* effects like word-spacing, text-indent, and padding).
|
|
43345
|
+
*
|
|
43346
|
+
* Algorithm:
|
|
43347
|
+
* 1. Find all spans with data-pm-start and data-pm-end attributes
|
|
43348
|
+
* 2. Locate the span containing the target PM position
|
|
43349
|
+
* 3. Find the closest .superdoc-page ancestor to determine page context
|
|
43350
|
+
* 4. Create a DOM Range at the character index within the text node
|
|
43351
|
+
* 5. Measure the Range's bounding rect relative to the page
|
|
43352
|
+
* 6. Return page-local coordinates (adjusted for zoom)
|
|
43353
|
+
*
|
|
43354
|
+
* Fallback Behavior:
|
|
43355
|
+
* - If text node unavailable: Use span's bounding rect
|
|
43356
|
+
* - If no matching span found: Return null
|
|
43357
|
+
* - If page element not found: Return null
|
|
43358
|
+
*
|
|
43359
|
+
* Error Handling:
|
|
43360
|
+
* DOM operations can throw exceptions (invalid ranges, detached nodes, etc.).
|
|
43361
|
+
* Callers should wrap this method in try-catch to prevent crashes.
|
|
43362
|
+
*
|
|
43363
|
+
* @param pos - ProseMirror position to compute caret for
|
|
43364
|
+
* @returns Object with {pageIndex, x, y} in page-local coordinates, or null if DOM unavailable
|
|
43365
|
+
*
|
|
43366
|
+
* @throws May throw DOM exceptions (InvalidStateError, IndexSizeError) if DOM is in invalid state
|
|
43367
|
+
*
|
|
43368
|
+
* @example
|
|
43369
|
+
* ```typescript
|
|
43370
|
+
* try {
|
|
43371
|
+
* const caretPos = this.#computeDomCaretPageLocal(42);
|
|
43372
|
+
* if (caretPos) {
|
|
43373
|
+
* // Render caret at caretPos.x, caretPos.y on page caretPos.pageIndex
|
|
43374
|
+
* }
|
|
43375
|
+
* } catch (error) {
|
|
43376
|
+
* console.warn('DOM caret computation failed:', error);
|
|
43377
|
+
* // Fall back to geometry-based calculation
|
|
43378
|
+
* }
|
|
43379
|
+
* ```
|
|
43252
43380
|
*/
|
|
43253
43381
|
computeDomCaretPageLocal_fn = function(pos) {
|
|
43254
43382
|
__privateGet(this, _viewportHost).querySelector(`.superdoc-page span[data-pm-start][data-pm-end]`) ? __privateGet(this, _viewportHost).querySelector(`.superdoc-page`) : null;
|
|
@@ -43298,11 +43426,65 @@ normalizeClientPoint_fn = function(clientX, clientY) {
|
|
|
43298
43426
|
const zoom = __privateGet(this, _layoutOptions).zoom ?? 1;
|
|
43299
43427
|
const scrollLeft = __privateGet(this, _visibleHost).scrollLeft ?? 0;
|
|
43300
43428
|
const scrollTop = __privateGet(this, _visibleHost).scrollTop ?? 0;
|
|
43429
|
+
const baseX = (clientX - rect.left + scrollLeft) / zoom;
|
|
43430
|
+
const baseY = (clientY - rect.top + scrollTop) / zoom;
|
|
43431
|
+
let adjustedX = baseX;
|
|
43432
|
+
const doc2 = __privateGet(this, _visibleHost).ownerDocument ?? document;
|
|
43433
|
+
const hitChain = typeof doc2.elementsFromPoint === "function" ? doc2.elementsFromPoint(clientX, clientY) : [];
|
|
43434
|
+
const pageEl = Array.isArray(hitChain) ? hitChain.find((el) => el?.classList?.contains("superdoc-page")) : null;
|
|
43435
|
+
if (pageEl) {
|
|
43436
|
+
const pageIndex = Number(pageEl.dataset.pageIndex ?? "NaN");
|
|
43437
|
+
if (Number.isFinite(pageIndex)) {
|
|
43438
|
+
const pageOffsetX = __privateMethod(this, _PresentationEditor_instances, getPageOffsetX_fn).call(this, pageIndex);
|
|
43439
|
+
if (pageOffsetX != null) {
|
|
43440
|
+
adjustedX = baseX - pageOffsetX;
|
|
43441
|
+
}
|
|
43442
|
+
}
|
|
43443
|
+
}
|
|
43301
43444
|
return {
|
|
43302
|
-
x:
|
|
43303
|
-
y:
|
|
43445
|
+
x: adjustedX,
|
|
43446
|
+
y: baseY
|
|
43304
43447
|
};
|
|
43305
43448
|
};
|
|
43449
|
+
/**
|
|
43450
|
+
* Computes caret layout rectangle using geometry-based calculations.
|
|
43451
|
+
*
|
|
43452
|
+
* This method calculates the caret position and height from layout engine data
|
|
43453
|
+
* (fragments, blocks, measures) without querying the DOM. It's used as a fallback
|
|
43454
|
+
* when DOM-based measurements are unavailable or as a primary source in non-interactive
|
|
43455
|
+
* scenarios (e.g., headless rendering, PDF export).
|
|
43456
|
+
*
|
|
43457
|
+
* The geometry-based calculation accounts for:
|
|
43458
|
+
* - List markers (offset caret by marker width)
|
|
43459
|
+
* - Paragraph indents (left, right, first-line, hanging)
|
|
43460
|
+
* - Justified text alignment (extra space distributed across spaces)
|
|
43461
|
+
* - Multi-column layouts
|
|
43462
|
+
* - Table cell content
|
|
43463
|
+
*
|
|
43464
|
+
* Algorithm:
|
|
43465
|
+
* 1. Find the fragment containing the PM position
|
|
43466
|
+
* 2. Handle table fragments separately (delegate to #computeTableCaretLayoutRect)
|
|
43467
|
+
* 3. For paragraph fragments:
|
|
43468
|
+
* a. Find the line containing the position
|
|
43469
|
+
* b. Convert PM position to character offset
|
|
43470
|
+
* c. Measure X coordinate using Canvas-based text measurement
|
|
43471
|
+
* d. Apply marker width and indent adjustments
|
|
43472
|
+
* e. Calculate Y offset from line heights
|
|
43473
|
+
* f. Return page-local coordinates with line height
|
|
43474
|
+
*
|
|
43475
|
+
* @param pos - ProseMirror position to compute caret for
|
|
43476
|
+
* @param includeDomFallback - Whether to compare with DOM measurements for debugging (default: true).
|
|
43477
|
+
* When true, logs geometry vs DOM deltas for analysis. Has no effect on return value.
|
|
43478
|
+
* @returns Object with {pageIndex, x, y, height} in page-local coordinates, or null if position not found
|
|
43479
|
+
*
|
|
43480
|
+
* @example
|
|
43481
|
+
* ```typescript
|
|
43482
|
+
* const caretGeometry = this.#computeCaretLayoutRectGeometry(42, false);
|
|
43483
|
+
* if (caretGeometry) {
|
|
43484
|
+
* // Render caret at caretGeometry.x, caretGeometry.y with height caretGeometry.height
|
|
43485
|
+
* }
|
|
43486
|
+
* ```
|
|
43487
|
+
*/
|
|
43306
43488
|
computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
43307
43489
|
const layout = __privateGet(this, _layoutState).layout;
|
|
43308
43490
|
if (!layout) return null;
|
|
@@ -43389,7 +43571,14 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
|
|
|
43389
43571
|
*/
|
|
43390
43572
|
computeCaretLayoutRect_fn = function(pos) {
|
|
43391
43573
|
const geometry = __privateMethod(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, pos, true);
|
|
43392
|
-
|
|
43574
|
+
let dom = null;
|
|
43575
|
+
try {
|
|
43576
|
+
dom = __privateMethod(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, pos);
|
|
43577
|
+
} catch (error) {
|
|
43578
|
+
if (process$1.env.NODE_ENV === "development") {
|
|
43579
|
+
console.warn("[PresentationEditor] DOM caret computation failed in #computeCaretLayoutRect:", error);
|
|
43580
|
+
}
|
|
43581
|
+
}
|
|
43393
43582
|
if (dom && geometry) {
|
|
43394
43583
|
return {
|
|
43395
43584
|
pageIndex: dom.pageIndex,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, readonly, watch, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-BLNx019v.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-5RSp-DNd.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-5RSp-DNd.js";
|
|
2
|
+
import "./chunks/converter-BLNx019v.js";
|
|
3
|
+
import "./chunks/docx-zipper-BfQBQQz_.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
11
|
var _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
|
|
12
|
-
import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { ac, i, a9, aQ } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { F, I, G, T, B, H, C } from "./chunks/editor-
|
|
12
|
+
import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-BLNx019v.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-BLNx019v.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as getEditorSurfaceElement, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-5RSp-DNd.js";
|
|
15
|
+
import { F, I, G, T, B, H, C } from "./chunks/editor-5RSp-DNd.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, defineComponent, reactive, onUnmounted, renderSlot, useCssVars, shallowRef, createBlock, Teleport, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-Db_-z4Fa.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-BfQBQQz_.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-DKbuo7ju.cjs");
|
|
4
4
|
require("./chunks/vue-jWLMl8Ts.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-CIPQg4rG.es.js";
|
|
2
2
|
import "./chunks/vue-Dysv_7z5.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-DKbuo7ju.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-BNGG0zf5.cjs");
|
|
5
5
|
const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
|
7
7
|
exports.Editor = superEditor_es.Editor;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CIPQg4rG.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-U-bzTPNb.es.js";
|
|
3
3
|
import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
export {
|
|
5
5
|
a as AnnotatorHelpers,
|