@harbour-enterprises/superdoc 1.0.0-beta.72 → 1.0.0-beta.73

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-Dg-qiC1A.es.js → PdfViewer-A6N1Ilp8.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BxCLl7Q6.cjs → PdfViewer-DBqcgXRQ.cjs} +1 -1
  3. package/dist/chunks/{index-qXb-Hmel-BPsIpdLY.cjs → index-DZuRXtuO-BP5GzZkJ.cjs} +1 -1
  4. package/dist/chunks/{index-qXb-Hmel-DwJhkxdW.es.js → index-DZuRXtuO-BpEV348M.es.js} +1 -1
  5. package/dist/chunks/{index-CAQDtLex.cjs → index-Dc6FhKsA.cjs} +3 -3
  6. package/dist/chunks/{index-B1AqHbuy.es.js → index-YCkhH3qs.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-DxG6ckVG.cjs → super-editor.es-CrRRbz3_.cjs} +40 -30
  8. package/dist/chunks/{super-editor.es-DPl3-zTR.es.js → super-editor.es-rYLAMF97.es.js} +40 -30
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-JlOFMM88.js → converter-Czwp6T-t.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-BVmpz1K_.js → docx-zipper-BT3IILnA.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-CNzx36Ms.js → editor-DaiVtTXo.js} +41 -31
  13. package/dist/super-editor/chunks/{index-qXb-Hmel.js → index-DZuRXtuO.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-DAhwzyFV.js → toolbar-DuPPWgDF.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 +42 -32
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -12,8 +12,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
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-JlOFMM88.js";
16
- import { D as DocxZipper } from "./docx-zipper-BVmpz1K_.js";
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-Czwp6T-t.js";
16
+ import { D as DocxZipper } from "./docx-zipper-BT3IILnA.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.72";
13926
+ const summaryVersion = "1.0.0-beta.73";
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-qXb-Hmel.js"),
14718
+ import("./index-DZuRXtuO.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.72");
14923
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.73");
14924
14924
  if (!this.options.ydoc) return;
14925
14925
  const metaMap = this.options.ydoc.getMap("meta");
14926
14926
  let docVersion = metaMap.get("version");
@@ -22539,11 +22539,11 @@ const countSpaces = (text) => {
22539
22539
  }
22540
22540
  return spaces;
22541
22541
  };
22542
- const getJustifyAdjustment = (block, line, availableWidthOverride) => {
22542
+ const getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride) => {
22543
22543
  if (block.kind !== "paragraph") {
22544
22544
  return { extraPerSpace: 0, totalSpaces: 0 };
22545
22545
  }
22546
- const alignment = block.attrs?.alignment;
22546
+ const alignment = alignmentOverride ?? block.attrs?.alignment;
22547
22547
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
22548
22548
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
22549
22549
  const slack = Math.max(0, availableWidth - line.width);
@@ -22622,13 +22622,13 @@ function sliceRunsForLine$1(block, line) {
22622
22622
  }
22623
22623
  return result;
22624
22624
  }
22625
- function measureCharacterX(block, line, charOffset, availableWidthOverride) {
22625
+ function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
22626
22626
  const ctx2 = getMeasurementContext();
22627
22627
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: if no maxWidth, approximate available width as line width (no slack)
22628
22628
  line.width;
22629
- const justify = getJustifyAdjustment(block, line, availableWidth);
22630
- const renderedLineWidth = line.width + Math.max(0, availableWidth - line.width);
22631
- const alignment = block.kind === "paragraph" ? block.attrs?.alignment : void 0;
22629
+ const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
22630
+ const alignment = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
22631
+ const renderedLineWidth = alignment === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
22632
22632
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
22633
22633
  const alignmentOffset = !hasExplicitPositioning && alignment === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
22634
22634
  if (hasExplicitPositioning && line.segments && ctx2) {
@@ -22757,13 +22757,13 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
22757
22757
  }
22758
22758
  return lastPm;
22759
22759
  }
22760
- function findCharacterAtX(block, line, x, pmStart, availableWidthOverride) {
22760
+ function findCharacterAtX(block, line, x, pmStart, availableWidthOverride, alignmentOverride) {
22761
22761
  const ctx2 = getMeasurementContext();
22762
22762
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: approximate with line width when no maxWidth is present
22763
22763
  line.width;
22764
- const justify = getJustifyAdjustment(block, line, availableWidth);
22765
- const renderedLineWidth = line.width + Math.max(0, availableWidth - line.width);
22766
- const alignment = block.kind === "paragraph" ? block.attrs?.alignment : void 0;
22764
+ const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
22765
+ const alignment = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
22766
+ const renderedLineWidth = alignment === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
22767
22767
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
22768
22768
  const alignmentOffset = !hasExplicitPositioning && alignment === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
22769
22769
  if (!ctx2) {
@@ -35471,7 +35471,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
35471
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
35472
  );
35473
35473
  }
35474
- const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth);
35474
+ const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
35475
+ const isListItem = markerWidth > 0;
35476
+ const alignmentOverride = isListItem ? "left" : void 0;
35477
+ const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
35475
35478
  if (pos == null) {
35476
35479
  logClickStage("warn", "no-position", {
35477
35480
  blockId: fragment.blockId
@@ -35513,7 +35516,10 @@ function clickToPosition(layout, blocks, measures, containerPoint, domContainer,
35513
35516
  `[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
35517
  );
35515
35518
  }
35516
- const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth);
35519
+ const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
35520
+ const isListItem = cellMarkerWidth > 0;
35521
+ const alignmentOverride = isListItem ? "left" : void 0;
35522
+ const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
35517
35523
  if (pos != null) {
35518
35524
  logClickStage("log", "success", {
35519
35525
  blockId: tableHit.fragment.blockId,
@@ -35669,18 +35675,19 @@ function selectionToRects(layout, blocks, measures, from2, to) {
35669
35675
  if (sliceFrom >= sliceTo) return;
35670
35676
  const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
35671
35677
  const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
35672
- const startX = mapPmToX(block, line, charOffsetFrom, fragment.width);
35673
- const endX = mapPmToX(block, line, charOffsetTo, fragment.width);
35674
35678
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
35679
+ const isListItem = markerWidth > 0;
35680
+ const alignmentOverride = isListItem ? "left" : void 0;
35681
+ const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
35682
+ const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
35675
35683
  const paraIndentLeft = block.attrs?.indent?.left ?? 0;
35676
35684
  const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
35677
35685
  const isFirstLine = index2 === fragment.fromLine;
35678
- const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && (fragment.markerWidth ?? 0) > 0;
35679
- let indentAdjust = 0;
35680
- if (!isListFirstLine) {
35681
- indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
35686
+ let indentAdjust = paraIndentLeft;
35687
+ if (isFirstLine && !isListItem) {
35688
+ indentAdjust += firstLineOffset;
35682
35689
  }
35683
- const rectX = fragment.x + markerWidth + indentAdjust + Math.min(startX, endX);
35690
+ const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
35684
35691
  const rectWidth = Math.max(1, Math.abs(endX - startX));
35685
35692
  const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
35686
35693
  const rectY = fragment.y + lineOffset;
@@ -35782,6 +35789,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
35782
35789
  let blockTopCursor = padding.top + verticalOffset;
35783
35790
  renderedBlocks.forEach((info) => {
35784
35791
  const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
35792
+ const isListItem = paragraphMarkerWidth > 0;
35793
+ const alignmentOverride = isListItem ? "left" : void 0;
35794
+ const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
35785
35795
  const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
35786
35796
  intersectingLines.forEach(({ line, index: index2 }) => {
35787
35797
  if (index2 < info.startLine || index2 >= info.endLine) {
@@ -35795,9 +35805,9 @@ function selectionToRects(layout, blocks, measures, from2, to) {
35795
35805
  const charOffsetFrom = pmPosToCharOffset(info.block, line, sliceFrom);
35796
35806
  const charOffsetTo = pmPosToCharOffset(info.block, line, sliceTo);
35797
35807
  const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
35798
- const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth);
35799
- const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth);
35800
- const rectX = fragment.x + cellX + padding.left + paragraphMarkerWidth + Math.min(startX, endX);
35808
+ const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
35809
+ const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
35810
+ const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
35801
35811
  const rectWidth = Math.max(1, Math.abs(endX - startX));
35802
35812
  const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
35803
35813
  const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
@@ -36056,11 +36066,11 @@ const lineHeightBeforeIndex = (measure, absoluteLineIndex) => {
36056
36066
  }
36057
36067
  return height;
36058
36068
  };
36059
- const mapPointToPm = (block, line, x, isRTL, availableWidthOverride) => {
36069
+ const mapPointToPm = (block, line, x, isRTL, availableWidthOverride, alignmentOverride) => {
36060
36070
  if (block.kind !== "paragraph") return null;
36061
36071
  const range = computeLinePmRange(block, line);
36062
36072
  if (range.pmStart == null || range.pmEnd == null) return null;
36063
- const result = findCharacterAtX(block, line, x, range.pmStart, availableWidthOverride);
36073
+ const result = findCharacterAtX(block, line, x, range.pmStart, availableWidthOverride, alignmentOverride);
36064
36074
  if (isRTL) {
36065
36075
  const charOffset = result.charOffset;
36066
36076
  const charsInLine = Math.max(1, line.toChar - line.fromChar);
@@ -36069,7 +36079,7 @@ const mapPointToPm = (block, line, x, isRTL, availableWidthOverride) => {
36069
36079
  }
36070
36080
  return result.pmPosition;
36071
36081
  };
36072
- const mapPmToX = (block, line, offset2, fragmentWidth) => {
36082
+ const mapPmToX = (block, line, offset2, fragmentWidth, alignmentOverride) => {
36073
36083
  if (fragmentWidth <= 0 || line.width <= 0) return 0;
36074
36084
  let paraIndentLeft = 0;
36075
36085
  let paraIndentRight = 0;
@@ -36086,7 +36096,7 @@ const mapPmToX = (block, line, offset2, fragmentWidth) => {
36086
36096
  `[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
36097
  );
36088
36098
  }
36089
- return measureCharacterX(block, line, offset2, availableWidth);
36099
+ return measureCharacterX(block, line, offset2, availableWidth, alignmentOverride);
36090
36100
  };
36091
36101
  const isRtlBlock = (block) => {
36092
36102
  if (block.kind !== "paragraph") return false;
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-JlOFMM88.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-Czwp6T-t.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -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-JlOFMM88.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CNzx36Ms.js";
2
+ import { p as process$1 } from "./converter-Czwp6T-t.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DaiVtTXo.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { ac } from "./chunks/converter-JlOFMM88.js";
1
+ import { ac } from "./chunks/converter-Czwp6T-t.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-JlOFMM88.js";
2
- import { D } from "./chunks/docx-zipper-BVmpz1K_.js";
1
+ import "./chunks/converter-Czwp6T-t.js";
2
+ import { D } from "./chunks/docx-zipper-BT3IILnA.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-CNzx36Ms.js";
2
- import "./chunks/converter-JlOFMM88.js";
3
- import "./chunks/docx-zipper-BVmpz1K_.js";
1
+ import { E } from "./chunks/editor-DaiVtTXo.js";
2
+ import "./chunks/converter-Czwp6T-t.js";
3
+ import "./chunks/docx-zipper-BT3IILnA.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BVmpz1K_.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BT3IILnA.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -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-JlOFMM88.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-JlOFMM88.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-CNzx36Ms.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-CNzx36Ms.js";
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-Czwp6T-t.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-Czwp6T-t.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-DaiVtTXo.js";
15
+ import { F, I, G, T, B, H, C } from "./chunks/editor-DaiVtTXo.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-DAhwzyFV.js";
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-DuPPWgDF.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BVmpz1K_.js";
19
+ import { D } from "./chunks/docx-zipper-BT3IILnA.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-DAhwzyFV.js";
3
- import "./chunks/editor-CNzx36Ms.js";
2
+ import { T } from "./chunks/toolbar-DuPPWgDF.js";
3
+ import "./chunks/editor-DaiVtTXo.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -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-DxG6ckVG.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CrRRbz3_.cjs");
4
4
  require("./chunks/vue-jWLMl8Ts.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -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-DPl3-zTR.es.js";
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-rYLAMF97.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-DxG6ckVG.cjs");
4
- const superdoc = require("./chunks/index-CAQDtLex.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CrRRbz3_.cjs");
4
+ const superdoc = require("./chunks/index-Dc6FhKsA.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;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DPl3-zTR.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-B1AqHbuy.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-rYLAMF97.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-YCkhH3qs.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -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.72") {
42330
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.73") {
42331
42331
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42332
42332
  }
42333
42333
  /**
@@ -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.72";
67376
+ const summaryVersion = "1.0.0-beta.73";
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(() => indexQXbHmel),
68165
+ Promise.resolve().then(() => indexDZuRXtuO),
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.72");
68370
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.73");
68371
68371
  if (!this.options.ydoc) return;
68372
68372
  const metaMap = this.options.ydoc.getMap("meta");
68373
68373
  let docVersion = metaMap.get("version");
@@ -75898,11 +75898,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
75898
75898
  }
75899
75899
  return spaces;
75900
75900
  };
75901
- const getJustifyAdjustment = (block, line, availableWidthOverride) => {
75901
+ const getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride) => {
75902
75902
  if (block.kind !== "paragraph") {
75903
75903
  return { extraPerSpace: 0, totalSpaces: 0 };
75904
75904
  }
75905
- const alignment2 = block.attrs?.alignment;
75905
+ const alignment2 = alignmentOverride ?? block.attrs?.alignment;
75906
75906
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
75907
75907
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
75908
75908
  const slack = Math.max(0, availableWidth - line.width);
@@ -75981,13 +75981,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
75981
75981
  }
75982
75982
  return result;
75983
75983
  }
75984
- function measureCharacterX(block, line, charOffset, availableWidthOverride) {
75984
+ function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
75985
75985
  const ctx2 = getMeasurementContext();
75986
75986
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: if no maxWidth, approximate available width as line width (no slack)
75987
75987
  line.width;
75988
- const justify = getJustifyAdjustment(block, line, availableWidth);
75989
- const renderedLineWidth = line.width + Math.max(0, availableWidth - line.width);
75990
- const alignment2 = block.kind === "paragraph" ? block.attrs?.alignment : void 0;
75988
+ const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
75989
+ const alignment2 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
75990
+ const renderedLineWidth = alignment2 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
75991
75991
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
75992
75992
  const alignmentOffset = !hasExplicitPositioning && alignment2 === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment2 === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
75993
75993
  if (hasExplicitPositioning && line.segments && ctx2) {
@@ -76116,13 +76116,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
76116
76116
  }
76117
76117
  return lastPm;
76118
76118
  }
76119
- function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride) {
76119
+ function findCharacterAtX(block, line, x2, pmStart, availableWidthOverride, alignmentOverride) {
76120
76120
  const ctx2 = getMeasurementContext();
76121
76121
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? // Fallback: approximate with line width when no maxWidth is present
76122
76122
  line.width;
76123
- const justify = getJustifyAdjustment(block, line, availableWidth);
76124
- const renderedLineWidth = line.width + Math.max(0, availableWidth - line.width);
76125
- const alignment2 = block.kind === "paragraph" ? block.attrs?.alignment : void 0;
76123
+ const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride);
76124
+ const alignment2 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : void 0);
76125
+ const renderedLineWidth = alignment2 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
76126
76126
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== void 0);
76127
76127
  const alignmentOffset = !hasExplicitPositioning && alignment2 === "center" ? Math.max(0, (availableWidth - renderedLineWidth) / 2) : !hasExplicitPositioning && alignment2 === "right" ? Math.max(0, availableWidth - renderedLineWidth) : 0;
76128
76128
  if (!ctx2) {
@@ -88830,7 +88830,10 @@ ${l}
88830
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
88831
  );
88832
88832
  }
88833
- const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth);
88833
+ const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
88834
+ const isListItem = markerWidth > 0;
88835
+ const alignmentOverride = isListItem ? "left" : void 0;
88836
+ const pos = mapPointToPm(block, line, pageRelativePoint.x - fragment.x, isRTL, availableWidth, alignmentOverride);
88834
88837
  if (pos == null) {
88835
88838
  logClickStage("warn", "no-position", {
88836
88839
  blockId: fragment.blockId
@@ -88872,7 +88875,10 @@ ${l}
88872
88875
  `[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
88876
  );
88874
88877
  }
88875
- const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth);
88878
+ const cellMarkerWidth = cellMeasure.marker?.markerWidth ?? 0;
88879
+ const isListItem = cellMarkerWidth > 0;
88880
+ const alignmentOverride = isListItem ? "left" : void 0;
88881
+ const pos = mapPointToPm(cellBlock, line, localX, isRTL, availableWidth, alignmentOverride);
88876
88882
  if (pos != null) {
88877
88883
  logClickStage("log", "success", {
88878
88884
  blockId: tableHit.fragment.blockId,
@@ -89028,18 +89034,19 @@ ${l}
89028
89034
  if (sliceFrom >= sliceTo) return;
89029
89035
  const charOffsetFrom = pmPosToCharOffset(block, line, sliceFrom);
89030
89036
  const charOffsetTo = pmPosToCharOffset(block, line, sliceTo);
89031
- const startX = mapPmToX(block, line, charOffsetFrom, fragment.width);
89032
- const endX = mapPmToX(block, line, charOffsetTo, fragment.width);
89033
89037
  const markerWidth = fragment.markerWidth ?? measure.marker?.markerWidth ?? 0;
89038
+ const isListItem = markerWidth > 0;
89039
+ const alignmentOverride = isListItem ? "left" : void 0;
89040
+ const startX = mapPmToX(block, line, charOffsetFrom, fragment.width, alignmentOverride);
89041
+ const endX = mapPmToX(block, line, charOffsetTo, fragment.width, alignmentOverride);
89034
89042
  const paraIndentLeft = block.attrs?.indent?.left ?? 0;
89035
89043
  const firstLineOffset = (block.attrs?.indent?.firstLine ?? 0) - (block.attrs?.indent?.hanging ?? 0);
89036
89044
  const isFirstLine = index2 === fragment.fromLine;
89037
- const isListFirstLine = isFirstLine && !fragment.continuesFromPrev && (fragment.markerWidth ?? 0) > 0;
89038
- let indentAdjust = 0;
89039
- if (!isListFirstLine) {
89040
- indentAdjust = paraIndentLeft + (isFirstLine ? firstLineOffset : 0);
89045
+ let indentAdjust = paraIndentLeft;
89046
+ if (isFirstLine && !isListItem) {
89047
+ indentAdjust += firstLineOffset;
89041
89048
  }
89042
- const rectX = fragment.x + markerWidth + indentAdjust + Math.min(startX, endX);
89049
+ const rectX = fragment.x + indentAdjust + Math.min(startX, endX);
89043
89050
  const rectWidth = Math.max(1, Math.abs(endX - startX));
89044
89051
  const lineOffset = lineHeightBeforeIndex(measure, index2) - lineHeightBeforeIndex(measure, fragment.fromLine);
89045
89052
  const rectY = fragment.y + lineOffset;
@@ -89141,6 +89148,9 @@ ${l}
89141
89148
  let blockTopCursor = padding.top + verticalOffset;
89142
89149
  renderedBlocks.forEach((info) => {
89143
89150
  const paragraphMarkerWidth = info.measure.marker?.markerWidth ?? 0;
89151
+ const isListItem = paragraphMarkerWidth > 0;
89152
+ const alignmentOverride = isListItem ? "left" : void 0;
89153
+ const paraIndentLeft = info.block.kind === "paragraph" ? info.block.attrs?.indent?.left ?? 0 : 0;
89144
89154
  const intersectingLines = findLinesIntersectingRange(info.block, info.measure, from2, to);
89145
89155
  intersectingLines.forEach(({ line, index: index2 }) => {
89146
89156
  if (index2 < info.startLine || index2 >= info.endLine) {
@@ -89154,9 +89164,9 @@ ${l}
89154
89164
  const charOffsetFrom = pmPosToCharOffset(info.block, line, sliceFrom);
89155
89165
  const charOffsetTo = pmPosToCharOffset(info.block, line, sliceTo);
89156
89166
  const availableWidth = Math.max(1, cellMeasure.width - padding.left - padding.right);
89157
- const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth);
89158
- const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth);
89159
- const rectX = fragment.x + cellX + padding.left + paragraphMarkerWidth + Math.min(startX, endX);
89167
+ const startX = mapPmToX(info.block, line, charOffsetFrom, availableWidth, alignmentOverride);
89168
+ const endX = mapPmToX(info.block, line, charOffsetTo, availableWidth, alignmentOverride);
89169
+ const rectX = fragment.x + cellX + padding.left + paraIndentLeft + Math.min(startX, endX);
89160
89170
  const rectWidth = Math.max(1, Math.abs(endX - startX));
89161
89171
  const lineOffset = lineHeightBeforeIndex(info.measure, index2) - lineHeightBeforeIndex(info.measure, info.startLine);
89162
89172
  const rectY = fragment.y + rowOffset + blockTopCursor + lineOffset;
@@ -89415,11 +89425,11 @@ ${l}
89415
89425
  }
89416
89426
  return height;
89417
89427
  };
89418
- const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride) => {
89428
+ const mapPointToPm = (block, line, x2, isRTL, availableWidthOverride, alignmentOverride) => {
89419
89429
  if (block.kind !== "paragraph") return null;
89420
89430
  const range2 = computeLinePmRange(block, line);
89421
89431
  if (range2.pmStart == null || range2.pmEnd == null) return null;
89422
- const result = findCharacterAtX(block, line, x2, range2.pmStart, availableWidthOverride);
89432
+ const result = findCharacterAtX(block, line, x2, range2.pmStart, availableWidthOverride, alignmentOverride);
89423
89433
  if (isRTL) {
89424
89434
  const charOffset = result.charOffset;
89425
89435
  const charsInLine = Math.max(1, line.toChar - line.fromChar);
@@ -89428,7 +89438,7 @@ ${l}
89428
89438
  }
89429
89439
  return result.pmPosition;
89430
89440
  };
89431
- const mapPmToX = (block, line, offset2, fragmentWidth) => {
89441
+ const mapPmToX = (block, line, offset2, fragmentWidth, alignmentOverride) => {
89432
89442
  if (fragmentWidth <= 0 || line.width <= 0) return 0;
89433
89443
  let paraIndentLeft = 0;
89434
89444
  let paraIndentRight = 0;
@@ -89445,7 +89455,7 @@ ${l}
89445
89455
  `[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
89456
  );
89447
89457
  }
89448
- return measureCharacterX(block, line, offset2, availableWidth);
89458
+ return measureCharacterX(block, line, offset2, availableWidth, alignmentOverride);
89449
89459
  };
89450
89460
  const isRtlBlock = (block) => {
89451
89461
  if (block.kind !== "paragraph") return false;
@@ -150388,7 +150398,7 @@ ${style2}
150388
150398
  this.config.colors = shuffleArray(this.config.colors);
150389
150399
  this.userColorMap = /* @__PURE__ */ new Map();
150390
150400
  this.colorIndex = 0;
150391
- this.version = "1.0.0-beta.72";
150401
+ this.version = "1.0.0-beta.73";
150392
150402
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
150393
150403
  this.superdocId = config2.superdocId || v4();
150394
150404
  this.colors = this.config.colors;
@@ -152860,7 +152870,7 @@ ${style2}
152860
152870
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
152861
152871
  );
152862
152872
  }
152863
- const indexQXbHmel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152873
+ const indexDZuRXtuO = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152864
152874
  __proto__: null,
152865
152875
  unified
152866
152876
  }, Symbol.toStringTag, { value: "Module" }));