@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
@@ -42326,7 +42326,7 @@ const _SuperConverter = class _SuperConverter2 {
42326
42326
  static getStoredSuperdocVersion(docx) {
42327
42327
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42328
42328
  }
42329
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.66") {
42329
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.67") {
42330
42330
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42331
42331
  }
42332
42332
  /**
@@ -45638,7 +45638,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
45638
45638
  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);
45639
45639
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
45640
45640
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
45641
- 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;
45641
+ 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;
45642
45642
  var GOOD_LEAF_SIZE = 200;
45643
45643
  var RopeSequence = function RopeSequence2() {
45644
45644
  };
@@ -59515,7 +59515,7 @@ const isHeadless = (editor) => {
59515
59515
  const shouldSkipNodeView = (editor) => {
59516
59516
  return isHeadless(editor);
59517
59517
  };
59518
- const summaryVersion = "1.0.0-beta.66";
59518
+ const summaryVersion = "1.0.0-beta.67";
59519
59519
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59520
59520
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59521
59521
  function mapAttributes(attrs) {
@@ -60304,7 +60304,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60304
60304
  { default: remarkStringify },
60305
60305
  { default: remarkGfm }
60306
60306
  ] = await Promise.all([
60307
- Promise.resolve().then(() => require("./index-Bjv0_slj-CIZ6x5_a.cjs")),
60307
+ Promise.resolve().then(() => require("./index-Cixgd5bX-ByqITVZq.cjs")),
60308
60308
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
60309
60309
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
60310
60310
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -60509,7 +60509,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60509
60509
  * Process collaboration migrations
60510
60510
  */
60511
60511
  processCollaborationMigrations() {
60512
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.66");
60512
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.67");
60513
60513
  if (!this.options.ydoc) return;
60514
60514
  const metaMap = this.options.ydoc.getMap("meta");
60515
60515
  let docVersion = metaMap.get("version");
@@ -80961,9 +80961,17 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
80961
80961
  }
80962
80962
  const line = measure.lines[lineIndex];
80963
80963
  const isRTL = isRtlBlock(block);
80964
- const paraIndentLeft = block.attrs?.indent?.left ?? 0;
80965
- const paraIndentRight = block.attrs?.indent?.right ?? 0;
80966
- const availableWidth = Math.max(0, fragment.width - (paraIndentLeft + paraIndentRight));
80964
+ const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
80965
+ const indentRight = typeof block.attrs?.indent?.right === "number" ? block.attrs.indent.right : 0;
80966
+ const paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
80967
+ const paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
80968
+ const totalIndent = paraIndentLeft + paraIndentRight;
80969
+ const availableWidth = Math.max(0, fragment.width - totalIndent);
80970
+ if (totalIndent > fragment.width) {
80971
+ console.warn(
80972
+ `[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.`
80973
+ );
80974
+ }
80967
80975
  const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth);
80968
80976
  if (pos == null) {
80969
80977
  logClickStage("warn", "no-position", {
@@ -80995,9 +81003,17 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
80995
81003
  if (lineIndex != null) {
80996
81004
  const line = cellMeasure.lines[lineIndex];
80997
81005
  const isRTL = isRtlBlock(cellBlock);
80998
- const paraIndentLeft = cellBlock.attrs?.indent?.left ?? 0;
80999
- const paraIndentRight = cellBlock.attrs?.indent?.right ?? 0;
81000
- const availableWidth = Math.max(0, tableHit.fragment.width - (paraIndentLeft + paraIndentRight));
81006
+ const indentLeft = typeof cellBlock.attrs?.indent?.left === "number" ? cellBlock.attrs.indent.left : 0;
81007
+ const indentRight = typeof cellBlock.attrs?.indent?.right === "number" ? cellBlock.attrs.indent.right : 0;
81008
+ const paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
81009
+ const paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
81010
+ const totalIndent = paraIndentLeft + paraIndentRight;
81011
+ const availableWidth = Math.max(0, tableHit.fragment.width - totalIndent);
81012
+ if (totalIndent > tableHit.fragment.width) {
81013
+ console.warn(
81014
+ `[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.`
81015
+ );
81016
+ }
81001
81017
  const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth);
81002
81018
  if (pos != null) {
81003
81019
  logClickStage("log", "success", {
@@ -81556,9 +81572,21 @@ const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride) => {
81556
81572
  };
81557
81573
  const mapPmToX = (block, line, offset2, fragmentWidth) => {
81558
81574
  if (fragmentWidth <= 0 || line.width <= 0) return 0;
81559
- const paraIndentLeft = block.kind === "paragraph" ? block.attrs?.indent?.left ?? 0 : 0;
81560
- const paraIndentRight = block.kind === "paragraph" ? block.attrs?.indent?.right ?? 0 : 0;
81561
- const availableWidth = Math.max(0, fragmentWidth - (paraIndentLeft + paraIndentRight));
81575
+ let paraIndentLeft = 0;
81576
+ let paraIndentRight = 0;
81577
+ if (block.kind === "paragraph") {
81578
+ const indentLeft = typeof block.attrs?.indent?.left === "number" ? block.attrs.indent.left : 0;
81579
+ const indentRight = typeof block.attrs?.indent?.right === "number" ? block.attrs.indent.right : 0;
81580
+ paraIndentLeft = Number.isFinite(indentLeft) ? indentLeft : 0;
81581
+ paraIndentRight = Number.isFinite(indentRight) ? indentRight : 0;
81582
+ }
81583
+ const totalIndent = paraIndentLeft + paraIndentRight;
81584
+ const availableWidth = Math.max(0, fragmentWidth - totalIndent);
81585
+ if (totalIndent > fragmentWidth) {
81586
+ console.warn(
81587
+ `[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.`
81588
+ );
81589
+ }
81562
81590
  return measureCharacterX(block, line, offset2, availableWidth);
81563
81591
  };
81564
81592
  const isRtlBlock = (block) => {
@@ -85382,8 +85410,16 @@ const _PresentationEditor = class _PresentationEditor2 extends EventEmitter$1 {
85382
85410
  };
85383
85411
  const rawRects = layoutRectSource();
85384
85412
  if (!rawRects.length) return [];
85385
- const domCaretStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, start2);
85386
- const domCaretEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, end2);
85413
+ let domCaretStart = null;
85414
+ let domCaretEnd = null;
85415
+ try {
85416
+ domCaretStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, start2);
85417
+ domCaretEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, end2);
85418
+ } catch (error) {
85419
+ if (process$1$1.env.NODE_ENV === "development") {
85420
+ console.warn("[PresentationEditor] DOM caret computation failed in getRectsForRange:", error);
85421
+ }
85422
+ }
85387
85423
  const layoutCaretStart = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, start2, false);
85388
85424
  __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, end2, false);
85389
85425
  const pageDelta = {};
@@ -86898,6 +86934,19 @@ rerender_fn = async function() {
86898
86934
  __privateSet(this, _layoutState, { blocks, measures, layout, bookmarks, anchorMap });
86899
86935
  __privateSet(this, _headerLayoutResults, headerLayouts ?? null);
86900
86936
  __privateSet(this, _footerLayoutResults, footerLayouts ?? null);
86937
+ const pageWidth = layout.pageSize?.w ?? __privateGet$1(this, _layoutOptions).pageSize?.w ?? DEFAULT_PAGE_SIZE.w;
86938
+ if (__privateGet$1(this, _painterHost)) {
86939
+ __privateGet$1(this, _painterHost).style.width = `${pageWidth}px`;
86940
+ __privateGet$1(this, _painterHost).style.marginLeft = "0";
86941
+ __privateGet$1(this, _painterHost).style.marginRight = "0";
86942
+ }
86943
+ if (__privateGet$1(this, _selectionOverlay2)) {
86944
+ __privateGet$1(this, _selectionOverlay2).style.width = `${pageWidth}px`;
86945
+ __privateGet$1(this, _selectionOverlay2).style.left = "0";
86946
+ __privateGet$1(this, _selectionOverlay2).style.right = "";
86947
+ __privateGet$1(this, _selectionOverlay2).style.marginLeft = "0";
86948
+ __privateGet$1(this, _selectionOverlay2).style.marginRight = "0";
86949
+ }
86901
86950
  await __privateMethod$1(this, _PresentationEditor_instances, layoutPerRIdHeaderFooters_fn).call(this, headerFooterInput, layout, sectionMetadata);
86902
86951
  __privateMethod$1(this, _PresentationEditor_instances, updateDecorationProviders_fn).call(this, layout);
86903
86952
  const painter = __privateMethod$1(this, _PresentationEditor_instances, ensurePainter_fn).call(this, blocks, measures);
@@ -87038,7 +87087,7 @@ updateSelection_fn = function() {
87038
87087
  }
87039
87088
  try {
87040
87089
  __privateGet$1(this, _localSelectionLayer).innerHTML = "";
87041
- __privateMethod$1(this, _PresentationEditor_instances, renderCaretOverlay_fn).call(this, caretLayout, from2);
87090
+ __privateMethod$1(this, _PresentationEditor_instances, renderCaretOverlay_fn).call(this, caretLayout);
87042
87091
  } catch (error) {
87043
87092
  if (process$1$1.env.NODE_ENV === "development") {
87044
87093
  console.warn("[PresentationEditor] Failed to render caret overlay:", error);
@@ -87047,8 +87096,16 @@ updateSelection_fn = function() {
87047
87096
  return;
87048
87097
  }
87049
87098
  const rects = selectionToRects(layout, __privateGet$1(this, _layoutState).blocks, __privateGet$1(this, _layoutState).measures, from2, to) ?? [];
87050
- const domStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, from2);
87051
- const domEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, to);
87099
+ let domStart = null;
87100
+ let domEnd = null;
87101
+ try {
87102
+ domStart = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, from2);
87103
+ domEnd = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, to);
87104
+ } catch (error) {
87105
+ if (process$1$1.env.NODE_ENV === "development") {
87106
+ console.warn("[PresentationEditor] DOM caret computation failed in #renderLocalSelection:", error);
87107
+ }
87108
+ }
87052
87109
  const correctedRects = __privateMethod$1(this, _PresentationEditor_instances, applyDomCorrectionToRects_fn).call(this, rects, domStart, domEnd);
87053
87110
  try {
87054
87111
  __privateGet$1(this, _localSelectionLayer).innerHTML = "";
@@ -87924,7 +87981,7 @@ clearHoverRegion_fn = function() {
87924
87981
  __privateGet$1(this, _hoverTooltip).style.display = "none";
87925
87982
  }
87926
87983
  };
87927
- renderCaretOverlay_fn = function(caretLayout, pos) {
87984
+ renderCaretOverlay_fn = function(caretLayout) {
87928
87985
  if (!__privateGet$1(this, _localSelectionLayer)) {
87929
87986
  return;
87930
87987
  }
@@ -88110,6 +88167,20 @@ createLayoutMetrics_fn = function(perf, startMark, layout, blocks) {
88110
88167
  pageCount: layout.pages?.length ?? 0
88111
88168
  };
88112
88169
  };
88170
+ getPageOffsetX_fn = function(pageIndex) {
88171
+ if (!__privateGet$1(this, _painterHost) || !__privateGet$1(this, _viewportHost)) {
88172
+ return null;
88173
+ }
88174
+ const pageEl = __privateGet$1(this, _painterHost).querySelector(
88175
+ `.superdoc-page[data-page-index="${pageIndex}"]`
88176
+ );
88177
+ if (!pageEl) return null;
88178
+ const pageRect = pageEl.getBoundingClientRect();
88179
+ const viewportRect = __privateGet$1(this, _viewportHost).getBoundingClientRect();
88180
+ const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
88181
+ const offsetX = (pageRect.left - viewportRect.left) / zoom;
88182
+ return offsetX;
88183
+ };
88113
88184
  convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY) {
88114
88185
  if (!Number.isFinite(pageIndex) || pageIndex < 0) {
88115
88186
  console.warn(
@@ -88131,10 +88202,12 @@ convertPageLocalToOverlayCoords_fn = function(pageIndex, pageLocalX, pageLocalY)
88131
88202
  }
88132
88203
  const pageHeight = __privateGet$1(this, _layoutOptions).pageSize?.h ?? DEFAULT_PAGE_SIZE.h;
88133
88204
  const pageGap = __privateGet$1(this, _layoutState).layout?.pageGap ?? 0;
88134
- return {
88135
- x: pageLocalX,
88205
+ const pageOffsetX = __privateMethod$1(this, _PresentationEditor_instances, getPageOffsetX_fn).call(this, pageIndex) ?? 0;
88206
+ const coords = {
88207
+ x: pageOffsetX + pageLocalX,
88136
88208
  y: pageIndex * (pageHeight + pageGap) + pageLocalY
88137
88209
  };
88210
+ return coords;
88138
88211
  };
88139
88212
  computeDomCaretPageLocal_fn = function(pos) {
88140
88213
  __privateGet$1(this, _viewportHost).querySelector(`.superdoc-page span[data-pm-start][data-pm-end]`) ? __privateGet$1(this, _viewportHost).querySelector(`.superdoc-page`) : null;
@@ -88184,9 +88257,24 @@ normalizeClientPoint_fn = function(clientX, clientY) {
88184
88257
  const zoom = __privateGet$1(this, _layoutOptions).zoom ?? 1;
88185
88258
  const scrollLeft = __privateGet$1(this, _visibleHost).scrollLeft ?? 0;
88186
88259
  const scrollTop = __privateGet$1(this, _visibleHost).scrollTop ?? 0;
88260
+ const baseX = (clientX - rect.left + scrollLeft) / zoom;
88261
+ const baseY = (clientY - rect.top + scrollTop) / zoom;
88262
+ let adjustedX = baseX;
88263
+ const doc2 = __privateGet$1(this, _visibleHost).ownerDocument ?? document;
88264
+ const hitChain = typeof doc2.elementsFromPoint === "function" ? doc2.elementsFromPoint(clientX, clientY) : [];
88265
+ const pageEl = Array.isArray(hitChain) ? hitChain.find((el) => el?.classList?.contains("superdoc-page")) : null;
88266
+ if (pageEl) {
88267
+ const pageIndex = Number(pageEl.dataset.pageIndex ?? "NaN");
88268
+ if (Number.isFinite(pageIndex)) {
88269
+ const pageOffsetX = __privateMethod$1(this, _PresentationEditor_instances, getPageOffsetX_fn).call(this, pageIndex);
88270
+ if (pageOffsetX != null) {
88271
+ adjustedX = baseX - pageOffsetX;
88272
+ }
88273
+ }
88274
+ }
88187
88275
  return {
88188
- x: (clientX - rect.left + scrollLeft) / zoom,
88189
- y: (clientY - rect.top + scrollTop) / zoom
88276
+ x: adjustedX,
88277
+ y: baseY
88190
88278
  };
88191
88279
  };
88192
88280
  computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
@@ -88272,7 +88360,14 @@ computeCaretLayoutRectGeometry_fn = function(pos, includeDomFallback = true) {
88272
88360
  };
88273
88361
  computeCaretLayoutRect_fn = function(pos) {
88274
88362
  const geometry = __privateMethod$1(this, _PresentationEditor_instances, computeCaretLayoutRectGeometry_fn).call(this, pos, true);
88275
- const dom = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, pos);
88363
+ let dom = null;
88364
+ try {
88365
+ dom = __privateMethod$1(this, _PresentationEditor_instances, computeDomCaretPageLocal_fn).call(this, pos);
88366
+ } catch (error) {
88367
+ if (process$1$1.env.NODE_ENV === "development") {
88368
+ console.warn("[PresentationEditor] DOM caret computation failed in #computeCaretLayoutRect:", error);
88369
+ }
88370
+ }
88276
88371
  if (dom && geometry) {
88277
88372
  return {
88278
88373
  pageIndex: dom.pageIndex,
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-Ybdn8aYC.js";
3
- import { _ as _export_sfc } from "./chunks/editor-pqbWS9yU.js";
2
+ import { T as TextSelection } from "./chunks/converter-BLNx019v.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-5RSp-DNd.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -42626,7 +42626,7 @@ const _SuperConverter = class _SuperConverter {
42626
42626
  static getStoredSuperdocVersion(docx) {
42627
42627
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
42628
42628
  }
42629
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.66") {
42629
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.67") {
42630
42630
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
42631
42631
  }
42632
42632
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-Ybdn8aYC.js";
1
+ import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-BLNx019v.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }