@harbour-enterprises/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.
Files changed (27) hide show
  1. package/dist/chunks/{PdfViewer-CpRzjNks.cjs → PdfViewer-DTK306FZ.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BgQnzisJ.es.js → PdfViewer-P0cvxvjh.es.js} +1 -1
  3. package/dist/chunks/{index-Bw7VVDLD.cjs → index-BNGG0zf5.cjs} +3 -3
  4. package/dist/chunks/{index-Bjv0_slj-aY5T6UA7.es.js → index-Cixgd5bX-39fIJYpL.es.js} +1 -1
  5. package/dist/chunks/{index-Bjv0_slj-CIZ6x5_a.cjs → index-Cixgd5bX-ByqITVZq.cjs} +1 -1
  6. package/dist/chunks/{index-k63Akk_i.es.js → index-U-bzTPNb.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-PQo0jrvJ.es.js → super-editor.es-CIPQg4rG.es.js} +120 -25
  8. package/dist/chunks/{super-editor.es-CLrhh2DY.cjs → super-editor.es-DKbuo7ju.cjs} +120 -25
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-Ybdn8aYC.js → converter-BLNx019v.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-DkmZTQAw.js → docx-zipper-BfQBQQz_.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-pqbWS9yU.js → editor-5RSp-DNd.js} +222 -33
  13. package/dist/super-editor/chunks/{index-Bjv0_slj.js → index-Cixgd5bX.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-CSzCVKWZ.js → toolbar-Db_-z4Fa.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +122 -27
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -42327,7 +42327,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42327
42327
  static getStoredSuperdocVersion(docx) {
42328
42328
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42329
42329
  }
42330
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.66") {
42330
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.67") {
42331
42331
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42332
42332
  }
42333
42333
  /**
@@ -53496,7 +53496,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
53496
53496
  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);
53497
53497
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
53498
53498
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
53499
- 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, 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, 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;
53499
+ 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, 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, 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;
53500
53500
  var GOOD_LEAF_SIZE = 200;
53501
53501
  var RopeSequence = function RopeSequence2() {
53502
53502
  };
@@ -67373,7 +67373,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
67373
67373
  const shouldSkipNodeView = (editor) => {
67374
67374
  return isHeadless(editor);
67375
67375
  };
67376
- const summaryVersion = "1.0.0-beta.66";
67376
+ const summaryVersion = "1.0.0-beta.67";
67377
67377
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
67378
67378
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
67379
67379
  function mapAttributes(attrs) {
@@ -68162,7 +68162,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68162
68162
  { default: remarkStringify2 },
68163
68163
  { default: remarkGfm2 }
68164
68164
  ] = await Promise.all([
68165
- Promise.resolve().then(() => indexBjv0_slj),
68165
+ Promise.resolve().then(() => indexCixgd5bX),
68166
68166
  Promise.resolve().then(() => indexDRCvimau),
68167
68167
  Promise.resolve().then(() => indexC_x_N6Uh),
68168
68168
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -68367,7 +68367,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68367
68367
  * Process collaboration migrations
68368
68368
  */
68369
68369
  processCollaborationMigrations() {
68370
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.66");
68370
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.67");
68371
68371
  if (!this.options.ydoc) return;
68372
68372
  const metaMap = this.options.ydoc.getMap("meta");
68373
68373
  let docVersion = metaMap.get("version");
@@ -88819,9 +88819,17 @@ ${l}
88819
88819
  }
88820
88820
  const line = measure.lines[lineIndex];
88821
88821
  const isRTL = isRtlBlock(block);
88822
- const paraIndentLeft = block.attrs?.indent?.left ?? 0;
88823
- const paraIndentRight = block.attrs?.indent?.right ?? 0;
88824
- const availableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
88822
+ const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
88823
+ const indentRight = typeof block.attrs?.indent?.right === "number" ? block.attrs.indent.right : 0;
88824
+ const paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
88825
+ const paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
88826
+ const totalIndent = paraIndentLeft + paraIndentRight;
88827
+ const availableWidth = Math.max(0, fragment.width - totalIndent);
88828
+ if (totalIndent > fragment.width) {
88829
+ console.warn(
88830
+ `[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.`
88831
+ );
88832
+ }
88825
88833
  const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth);
88826
88834
  if (pos == null) {
88827
88835
  logClickStage("warn", "no-position", {
@@ -88853,9 +88861,17 @@ ${l}
88853
88861
  if (lineIndex != null) {
88854
88862
  const line = cellMeasure.lines[lineIndex];
88855
88863
  const isRTL = isRtlBlock(cellBlock);
88856
- const paraIndentLeft = cellBlock.attrs?.indent?.left ?? 0;
88857
- const paraIndentRight = cellBlock.attrs?.indent?.right ?? 0;
88858
- const availableWidth = Math.max(0, tableHit.fragment.width - (paraIndentLeft + paraIndentRight));
88864
+ const indentLeft = typeof cellBlock.attrs?.indent?.left === "number" ? cellBlock.attrs.indent.left : 0;
88865
+ const indentRight = typeof cellBlock.attrs?.indent?.right === "number" ? cellBlock.attrs.indent.right : 0;
88866
+ const paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
88867
+ const paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
88868
+ const totalIndent = paraIndentLeft + paraIndentRight;
88869
+ const availableWidth = Math.max(0, tableHit.fragment.width - totalIndent);
88870
+ if (totalIndent > tableHit.fragment.width) {
88871
+ console.warn(
88872
+ `[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.`
88873
+ );
88874
+ }
88859
88875
  const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth);
88860
88876
  if (pos != null) {
88861
88877
  logClickStage("log", "success", {
@@ -89414,9 +89430,21 @@ ${l}
89414
89430
  };
89415
89431
  const mapPmToX = (block, line, offset2, fragmentWidth) => {
89416
89432
  if (fragmentWidth <= 0 || line.width <= 0) return 0;
89417
- const paraIndentLeft = block.kind === "paragraph" ? block.attrs?.indent?.left ?? 0 : 0;
89418
- const paraIndentRight = block.kind === "paragraph" ? block.attrs?.indent?.right ?? 0 : 0;
89419
- const availableWidth = Math.max(0, fragmentWidth - (paraIndentLeft + paraIndentRight));
89433
+ let paraIndentLeft = 0;
89434
+ let paraIndentRight = 0;
89435
+ if (block.kind === "paragraph") {
89436
+ const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
89437
+ const indentRight = typeof block.attrs?.indent?.right === "number" ? block.attrs.indent.right : 0;
89438
+ paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
89439
+ paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
89440
+ }
89441
+ const totalIndent = paraIndentLeft + paraIndentRight;
89442
+ const availableWidth = Math.max(0, fragmentWidth - totalIndent);
89443
+ if (totalIndent > fragmentWidth) {
89444
+ console.warn(
89445
+ `[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.`
89446
+ );
89447
+ }
89420
89448
  return measureCharacterX(block, line, offset2, availableWidth);
89421
89449
  };
89422
89450
  const isRtlBlock = (block) => {
@@ -93240,8 +93268,16 @@ ${l}
93240
93268
  };
93241
93269
  const rawRects = layoutRectSource();
93242
93270
  if (!rawRects.length) return [];
93243
- const domCaretStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, start2);
93244
- const domCaretEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, end2);
93271
+ let domCaretStart = null;
93272
+ let domCaretEnd = null;
93273
+ try {
93274
+ domCaretStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, start2);
93275
+ domCaretEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, end2);
93276
+ } catch (error) {
93277
+ if (process$1$1.env.NODE_ENV === "development") {
93278
+ console.warn("[PresentationEditor] DOM caret computation failed in getRectsForRange:", error);
93279
+ }
93280
+ }
93245
93281
  const layoutCaretStart = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, start2, false);
93246
93282
  __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, end2, false);
93247
93283
  const pageDelta = {};
@@ -94756,6 +94792,19 @@ ${l}
94756
94792
  __privateSet(this, _layoutState, { blocks: blocks2, measures, layout, bookmarks, anchorMap });
94757
94793
  __privateSet(this, _headerLayoutResults, headerLayouts ?? null);
94758
94794
  __privateSet(this, _footerLayoutResults, footerLayouts ?? null);
94795
+ const pageWidth = layout.pageSize?.w ?? __privateGet$1(this, _layoutOptions).pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
94796
+ if (__privateGet$1(this, _painterHost)) {
94797
+ __privateGet$1(this, _painterHost).style.width = `${pageWidth}px`;
94798
+ __privateGet$1(this, _painterHost).style.marginLeft = "0";
94799
+ __privateGet$1(this, _painterHost).style.marginRight = "0";
94800
+ }
94801
+ if (__privateGet$1(this, _selectionOverlay2)) {
94802
+ __privateGet$1(this, _selectionOverlay2).style.width = `${pageWidth}px`;
94803
+ __privateGet$1(this, _selectionOverlay2).style.left = "0";
94804
+ __privateGet$1(this, _selectionOverlay2).style.right = "";
94805
+ __privateGet$1(this, _selectionOverlay2).style.marginLeft = "0";
94806
+ __privateGet$1(this, _selectionOverlay2).style.marginRight = "0";
94807
+ }
94759
94808
  await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
94760
94809
  __privateMethod$1(this, _PresentationEditor_instances, updateDecorationProviders_fn).call(this, layout);
94761
94810
  const painter = __privateMethod$1(this, _PresentationEditor_instances, ensurePainter_fn).call(this, blocks2, measures);
@@ -94896,7 +94945,7 @@ ${l}
94896
94945
  }
94897
94946
  try {
94898
94947
  __privateGet$1(this, _localSelectionLayer).innerHTML = "";
94899
- __privateMethod$1(this, _PresentationEditor_instances, renderCaretOverlay_fn).call(this, caretLayout, from2);
94948
+ __privateMethod$1(this, _PresentationEditor_instances, renderCaretOverlay_fn).call(this, caretLayout);
94900
94949
  } catch (error) {
94901
94950
  if (process$1$1.env.NODE_ENV === "development") {
94902
94951
  console.warn("[PresentationEditor] Failed to render caret overlay:", error);
@@ -94905,8 +94954,16 @@ ${l}
94905
94954
  return;
94906
94955
  }
94907
94956
  const rects = selectionToRects(layout, __privateGet$1(this, _layoutState).blocks, __privateGet$1(this, _layoutState).measures, from2, to) ?? [];
94908
- const domStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, from2);
94909
- const domEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, to);
94957
+ let domStart = null;
94958
+ let domEnd = null;
94959
+ try {
94960
+ domStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, from2);
94961
+ domEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, to);
94962
+ } catch (error) {
94963
+ if (process$1$1.env.NODE_ENV === "development") {
94964
+ console.warn("[PresentationEditor] DOM caret computation failed in #renderLocalSelection:", error);
94965
+ }
94966
+ }
94910
94967
  const correctedRects = __privateMethod$1(this, _PresentationEditor_instances, applyDomCorrectionToRects_fn).call(this, rects, domStart, domEnd);
94911
94968
  try {
94912
94969
  __privateGet$1(this, _localSelectionLayer).innerHTML = "";
@@ -95782,7 +95839,7 @@ ${l}
95782
95839
  __privateGet$1(this, _hoverTooltip).style.display = "none";
95783
95840
  }
95784
95841
  };
95785
- renderCaretOverlay_fn = function(caretLayout, pos) {
95842
+ renderCaretOverlay_fn = function(caretLayout) {
95786
95843
  if (!__privateGet$1(this, _localSelectionLayer)) {
95787
95844
  return;
95788
95845
  }
@@ -95968,6 +96025,20 @@ ${l}
95968
96025
  pageCount: layout.pages?.length ?? 0
95969
96026
  };
95970
96027
  };
96028
+ getPageOffsetX_fn = function(pageIndex) {
96029
+ if (!__privateGet$1(this, _painterHost) || !__privateGet$1(this, _viewportHost)) {
96030
+ return null;
96031
+ }
96032
+ const pageEl = __privateGet$1(this, _painterHost).querySelector(
96033
+ `.superdoc-page[data-page-index="${pageIndex}"]`
96034
+ );
96035
+ if (!pageEl) return null;
96036
+ const pageRect = pageEl.getBoundingClientRect();
96037
+ const viewportRect = __privateGet$1(this, _viewportHost).getBoundingClientRect();
96038
+ const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
96039
+ const offsetX = (pageRect.left - viewportRect.left) / zoom;
96040
+ return offsetX;
96041
+ };
95971
96042
  convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY) {
95972
96043
  if (!Number.isFinite(pageIndex) || pageIndex < 0) {
95973
96044
  console.warn(
@@ -95989,10 +96060,12 @@ ${l}
95989
96060
  }
95990
96061
  const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
95991
96062
  const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
95992
- return {
95993
- x: pageLocalX,
96063
+ const pageOffsetX = __privateMethod$1(this, _PresentationEditor_instances, getPageOffsetX_fn).call(this, pageIndex) ?? 0;
96064
+ const coords = {
96065
+ x: pageOffsetX + pageLocalX,
95994
96066
  y: pageIndex * (pageHeight + pageGap) + pageLocalY
95995
96067
  };
96068
+ return coords;
95996
96069
  };
95997
96070
  computeDomCaretPageLocal_fn = function(pos) {
95998
96071
  __privateGet$1(this, _viewportHost).querySelector(`.superdoc-page span[data-pm-start][data-pm-end]`) ? __privateGet$1(this, _viewportHost).querySelector(`.superdoc-page`) : null;
@@ -96042,9 +96115,24 @@ ${l}
96042
96115
  const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
96043
96116
  const scrollLeft = __privateGet$1(this, _visibleHost).scrollLeft ?? 0;
96044
96117
  const scrollTop = __privateGet$1(this, _visibleHost).scrollTop ?? 0;
96118
+ const baseX = (clientX - rect.left + scrollLeft) / zoom;
96119
+ const baseY = (clientY - rect.top + scrollTop) / zoom;
96120
+ let adjustedX = baseX;
96121
+ const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
96122
+ const hitChain = typeof doc2.elementsFromPoint === "function" ? doc2.elementsFromPoint(clientX, clientY) : [];
96123
+ const pageEl = Array.isArray(hitChain) ? hitChain.find((el) => el?.classList?.contains("superdoc-page")) : null;
96124
+ if (pageEl) {
96125
+ const pageIndex = Number(pageEl.dataset.pageIndex ?? "NaN");
96126
+ if (Number.isFinite(pageIndex)) {
96127
+ const pageOffsetX = __privateMethod$1(this, _PresentationEditor_instances, getPageOffsetX_fn).call(this, pageIndex);
96128
+ if (pageOffsetX != null) {
96129
+ adjustedX = baseX - pageOffsetX;
96130
+ }
96131
+ }
96132
+ }
96045
96133
  return {
96046
- x: (clientX - rect.left + scrollLeft) / zoom,
96047
- y: (clientY - rect.top + scrollTop) / zoom
96134
+ x: adjustedX,
96135
+ y: baseY
96048
96136
  };
96049
96137
  };
96050
96138
  computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
@@ -96130,7 +96218,14 @@ ${l}
96130
96218
  };
96131
96219
  computeCaretLayoutRect_fn = function(pos) {
96132
96220
  const geometry = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, pos, true);
96133
- const dom = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, pos);
96221
+ let dom = null;
96222
+ try {
96223
+ dom = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, pos);
96224
+ } catch (error) {
96225
+ if (process$1$1.env.NODE_ENV === "development") {
96226
+ console.warn("[PresentationEditor] DOM caret computation failed in #computeCaretLayoutRect:", error);
96227
+ }
96228
+ }
96134
96229
  if (dom && geometry) {
96135
96230
  return {
96136
96231
  pageIndex: dom.pageIndex,
@@ -150014,7 +150109,7 @@ ${style2}
150014
150109
  this.config.colors = shuffleArray(this.config.colors);
150015
150110
  this.userColorMap = /* @__PURE__ */ new Map();
150016
150111
  this.colorIndex = 0;
150017
- this.version = "1.0.0-beta.66";
150112
+ this.version = "1.0.0-beta.67";
150018
150113
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
150019
150114
  this.superdocId = config2.superdocId || v4();
150020
150115
  this.colors = this.config.colors;
@@ -152486,7 +152581,7 @@ ${style2}
152486
152581
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
152487
152582
  );
152488
152583
  }
152489
- const indexBjv0_slj = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152584
+ const indexCixgd5bX = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152490
152585
  __proto__: null,
152491
152586
  unified
152492
152587
  }, Symbol.toStringTag, { value: "Module" }));