@superdoc-dev/cli 0.8.0-next.79 → 0.8.0-next.80

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 (2) hide show
  1. package/dist/index.js +148 -48
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -207687,7 +207687,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
207687
207687
  init_remark_gfm_BhnWr3yf_es();
207688
207688
  });
207689
207689
 
207690
- // ../../packages/superdoc/dist/chunks/src-ItIaPxzW.es.js
207690
+ // ../../packages/superdoc/dist/chunks/src-C-jV2TZI.es.js
207691
207691
  function deleteProps(obj, propOrProps) {
207692
207692
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
207693
207693
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -207744,9 +207744,11 @@ function cssColorToHex(cssColor) {
207744
207744
  return trimmed;
207745
207745
  }
207746
207746
  function computeTabStops$1(context) {
207747
- const { explicitStops, defaultTabInterval, paragraphIndent } = context;
207747
+ const { explicitStops, defaultTabInterval, paragraphIndent, rawParagraphIndent } = context;
207748
207748
  const leftIndent = paragraphIndent.left ?? 0;
207749
207749
  const hanging = paragraphIndent.hanging ?? 0;
207750
+ const rawLeftIndent = rawParagraphIndent?.left ?? leftIndent;
207751
+ const rawHanging = rawParagraphIndent?.hanging ?? hanging;
207750
207752
  const effectiveMinIndent = Math.max(0, leftIndent - hanging);
207751
207753
  const clearPositions = explicitStops.filter((stop) => stop.val === "clear").map((stop) => stop.pos);
207752
207754
  const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent).map((stop) => ({
@@ -207757,6 +207759,7 @@ function computeTabStops$1(context) {
207757
207759
  const stops = [...filteredExplicitStops];
207758
207760
  const hasStartAlignedExplicit = filteredExplicitStops.some((stop) => stop.val === "start");
207759
207761
  const hasExplicitStops = filteredExplicitStops.length > 0;
207762
+ const hasClearAtPosition = (position4) => clearPositions.some((clearPos) => Math.abs(clearPos - position4) < TAB_POSITION_TOLERANCE_TWIPS);
207760
207763
  const hasClearAtLeftIndent = clearPositions.some((clearPos) => Math.abs(clearPos - leftIndent) < TAB_POSITION_TOLERANCE_TWIPS);
207761
207764
  if (!hasExplicitStops && !hasClearAtLeftIndent && hanging > 0 && leftIndent > effectiveMinIndent)
207762
207765
  stops.push({
@@ -207765,6 +207768,22 @@ function computeTabStops$1(context) {
207765
207768
  leader: "none",
207766
207769
  source: "default"
207767
207770
  });
207771
+ const firstLineOrigin = rawLeftIndent - rawHanging;
207772
+ if (firstLineOrigin < 0 && !hasClearAtPosition(0) && !stops.some((stop) => Math.abs(stop.pos) < TAB_POSITION_TOLERANCE_TWIPS))
207773
+ stops.push({
207774
+ val: "start",
207775
+ pos: 0,
207776
+ leader: "none",
207777
+ source: "default"
207778
+ });
207779
+ const leftIndentStop = Math.abs(rawLeftIndent);
207780
+ if (rawHanging > 0 && leftIndentStop > 0 && firstLineOrigin < leftIndentStop && !hasClearAtPosition(leftIndentStop) && !stops.some((stop) => Math.abs(stop.pos - leftIndentStop) < TAB_POSITION_TOLERANCE_TWIPS))
207781
+ stops.push({
207782
+ val: "start",
207783
+ pos: leftIndentStop,
207784
+ leader: "none",
207785
+ source: "default"
207786
+ });
207768
207787
  const defaultStart = !hasStartAlignedExplicit ? 0 : Math.max(maxExplicit, leftIndent);
207769
207788
  let pos = defaultStart;
207770
207789
  const targetLimit = Math.max(defaultStart, leftIndent, maxExplicit) + 14400;
@@ -251728,7 +251747,8 @@ function resolveParagraphContent(fragment2, block, measure) {
251728
251747
  if (!hasExplicitSegmentPositioning)
251729
251748
  textIndentPx = firstLineOffset;
251730
251749
  }
251731
- availableWidth = adjustAvailableWidthForTextIndent(availableWidth, textIndentPx, line.maxWidth);
251750
+ const availableWidthIndentOffset = isFirstLine && !isListFirstLine && line.hasExplicitTabStops !== true ? firstLineOffset : textIndentPx;
251751
+ availableWidth = adjustAvailableWidthForTextIndent(availableWidth, availableWidthIndentOffset, line.maxWidth);
251732
251752
  const indentLeft = paraIndent?.left ?? 0;
251733
251753
  const firstLine = paraIndent?.firstLine ?? 0;
251734
251754
  const hanging = paraIndent?.hanging ?? 0;
@@ -257597,8 +257617,8 @@ function remeasureParagraph(block, maxWidth, firstLineIndent = 0) {
257597
257617
  const wordLayout = attrs?.wordLayout;
257598
257618
  const rawIndentLeft = typeof indent2?.left === "number" && Number.isFinite(indent2.left) ? indent2.left : 0;
257599
257619
  const rawIndentRight = typeof indent2?.right === "number" && Number.isFinite(indent2.right) ? indent2.right : 0;
257600
- const indentLeft = Math.max(0, rawIndentLeft);
257601
- const indentRight = Math.max(0, rawIndentRight);
257620
+ const indentLeft = rawIndentLeft;
257621
+ const indentRight = rawIndentRight;
257602
257622
  const indentFirstLine = Math.max(0, indent2?.firstLine ?? 0);
257603
257623
  const indentHanging = Math.max(0, indent2?.hanging ?? 0);
257604
257624
  const baseFirstLineOffset = attrs?.suppressFirstLineIndent === true ? 0 : firstLineIndent || indentFirstLine - indentHanging;
@@ -268100,6 +268120,7 @@ async function measureParagraphBlock(block, maxWidth) {
268100
268120
  let hasSeenTextRun = false;
268101
268121
  let tabStopCursor = 0;
268102
268122
  let pendingTabAlignment = null;
268123
+ let pendingSegmentPrecedingTabEndX;
268103
268124
  let pendingLeader = null;
268104
268125
  let pendingRunSpacing = 0;
268105
268126
  let lastAppliedTabAlign = null;
@@ -268122,7 +268143,7 @@ async function measureParagraphBlock(block, maxWidth) {
268122
268143
  return;
268123
268144
  if (segmentWidth < 0)
268124
268145
  segmentWidth = 0;
268125
- const { target, val } = pendingTabAlignment;
268146
+ const { target, val, compensateNegativeLeft } = pendingTabAlignment;
268126
268147
  let startX = currentLine.width;
268127
268148
  if (val === "decimal") {
268128
268149
  const beforeWidth = beforeDecimalWidth ?? 0;
@@ -268133,10 +268154,9 @@ async function measureParagraphBlock(block, maxWidth) {
268133
268154
  startX = Math.max(0, target - segmentWidth / 2);
268134
268155
  else
268135
268156
  startX = Math.max(0, target);
268136
- if (pendingLeader) {
268137
- const effectiveIndent = lines.length === 0 ? indentLeft + rawFirstLineOffset : indentLeft;
268157
+ const effectiveIndent = lines.length === 0 ? indentLeft + rawFirstLineOffset : indentLeft;
268158
+ if (pendingLeader)
268138
268159
  pendingLeader.to = startX + effectiveIndent;
268139
- }
268140
268160
  currentLine.width = roundValue(startX);
268141
268161
  lastAppliedTabAlign = {
268142
268162
  target,
@@ -268144,7 +268164,17 @@ async function measureParagraphBlock(block, maxWidth) {
268144
268164
  };
268145
268165
  pendingTabAlignment = null;
268146
268166
  pendingLeader = null;
268147
- return startX;
268167
+ const shouldCompensateNegativeLeft = compensateNegativeLeft === true;
268168
+ pendingSegmentPrecedingTabEndX = shouldCompensateNegativeLeft ? startX : undefined;
268169
+ return shouldCompensateNegativeLeft ? startX - Math.min(effectiveIndent, 0) : startX;
268170
+ };
268171
+ const consumePendingPrecedingTabEndX = () => {
268172
+ const value = pendingSegmentPrecedingTabEndX;
268173
+ pendingSegmentPrecedingTabEndX = undefined;
268174
+ return value;
268175
+ };
268176
+ const clearPendingPrecedingTabEndX = () => {
268177
+ pendingSegmentPrecedingTabEndX = undefined;
268148
268178
  };
268149
268179
  const alignSegmentAtTab = (segmentText, font, runContext, segmentStartChar) => {
268150
268180
  if (!pendingTabAlignment || !currentLine)
@@ -268485,7 +268515,8 @@ async function measureParagraphBlock(block, maxWidth) {
268485
268515
  } else
268486
268516
  pendingTabAlignment = {
268487
268517
  target: clampedTarget - effectiveIndent,
268488
- val: stop.val
268518
+ val: stop.val,
268519
+ compensateNegativeLeft: stop.val === "start" && indentLeft < 0 && effectiveIndent === indentLeft && stop.source !== "explicit"
268489
268520
  };
268490
268521
  } else {
268491
268522
  pendingTabAlignment = null;
@@ -268507,6 +268538,7 @@ async function measureParagraphBlock(block, maxWidth) {
268507
268538
  activeTabGroup.currentX = roundValue(activeTabGroup.currentX + imageWidth);
268508
268539
  } else if (pendingTabAlignment && currentLine)
268509
268540
  imageStartX = alignPendingTabForWidth(imageWidth);
268541
+ const imagePrecedingTabEndX = imageStartX !== undefined ? consumePendingPrecedingTabEndX() : undefined;
268510
268542
  if (!currentLine) {
268511
268543
  currentLine = {
268512
268544
  fromRun: runIndex,
@@ -268523,7 +268555,8 @@ async function measureParagraphBlock(block, maxWidth) {
268523
268555
  fromChar: 0,
268524
268556
  toChar: 1,
268525
268557
  width: imageWidth,
268526
- ...imageStartX !== undefined ? { x: imageStartX } : {}
268558
+ ...imageStartX !== undefined ? { x: imageStartX } : {},
268559
+ ...imagePrecedingTabEndX !== undefined ? { precedingTabEndX: imagePrecedingTabEndX } : {}
268527
268560
  }]
268528
268561
  };
268529
268562
  pendingRunSpacing = 0;
@@ -268575,7 +268608,8 @@ async function measureParagraphBlock(block, maxWidth) {
268575
268608
  fromChar: 0,
268576
268609
  toChar: 1,
268577
268610
  width: imageWidth,
268578
- ...imageStartX !== undefined ? { x: imageStartX } : {}
268611
+ ...imageStartX !== undefined ? { x: imageStartX } : {},
268612
+ ...imagePrecedingTabEndX !== undefined ? { precedingTabEndX: imagePrecedingTabEndX } : {}
268579
268613
  });
268580
268614
  }
268581
268615
  if (activeTabGroup && runIndex + 1 >= activeTabGroup.measure.endRunIndex)
@@ -268650,6 +268684,7 @@ async function measureParagraphBlock(block, maxWidth) {
268650
268684
  let annotationStartX;
268651
268685
  if (pendingTabAlignment && currentLine)
268652
268686
  annotationStartX = alignPendingTabForWidth(annotationWidth);
268687
+ const annotationPrecedingTabEndX = annotationStartX !== undefined ? consumePendingPrecedingTabEndX() : undefined;
268653
268688
  if (!currentLine) {
268654
268689
  currentLine = {
268655
268690
  fromRun: runIndex,
@@ -268665,7 +268700,8 @@ async function measureParagraphBlock(block, maxWidth) {
268665
268700
  fromChar: 0,
268666
268701
  toChar: 1,
268667
268702
  width: annotationWidth,
268668
- ...annotationStartX !== undefined ? { x: annotationStartX } : {}
268703
+ ...annotationStartX !== undefined ? { x: annotationStartX } : {},
268704
+ ...annotationPrecedingTabEndX !== undefined ? { precedingTabEndX: annotationPrecedingTabEndX } : {}
268669
268705
  }]
268670
268706
  };
268671
268707
  pendingRunSpacing = 0;
@@ -268712,7 +268748,8 @@ async function measureParagraphBlock(block, maxWidth) {
268712
268748
  fromChar: 0,
268713
268749
  toChar: 1,
268714
268750
  width: annotationWidth,
268715
- ...annotationStartX !== undefined ? { x: annotationStartX } : {}
268751
+ ...annotationStartX !== undefined ? { x: annotationStartX } : {},
268752
+ ...annotationPrecedingTabEndX !== undefined ? { precedingTabEndX: annotationPrecedingTabEndX } : {}
268716
268753
  });
268717
268754
  }
268718
268755
  const tabAlign = lastAppliedTabAlign;
@@ -268820,6 +268857,18 @@ async function measureParagraphBlock(block, maxWidth) {
268820
268857
  if (segmentStartX == null)
268821
268858
  segmentStartX = currentLine.width;
268822
268859
  }
268860
+ let hasPendingSegmentTabGeometry = segmentStartX !== undefined;
268861
+ const consumeSegmentPrecedingTabEndX = () => {
268862
+ if (!hasPendingSegmentTabGeometry)
268863
+ return;
268864
+ hasPendingSegmentTabGeometry = false;
268865
+ return consumePendingPrecedingTabEndX();
268866
+ };
268867
+ const clearWrapState = () => {
268868
+ segmentStartX = undefined;
268869
+ hasPendingSegmentTabGeometry = false;
268870
+ clearPendingPrecedingTabEndX();
268871
+ };
268823
268872
  for (let wordIndex = 0;wordIndex < words.length; wordIndex++) {
268824
268873
  const word$1 = words[wordIndex];
268825
268874
  if (word$1 === "") {
@@ -268861,6 +268910,7 @@ async function measureParagraphBlock(block, maxWidth) {
268861
268910
  pendingLeader = null;
268862
268911
  lastAppliedTabAlign = null;
268863
268912
  activeTabGroup = null;
268913
+ clearWrapState();
268864
268914
  currentLine = {
268865
268915
  fromRun: runIndex,
268866
268916
  fromChar: spaceStartChar,
@@ -268885,11 +268935,15 @@ async function measureParagraphBlock(block, maxWidth) {
268885
268935
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
268886
268936
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lineHeightFontSize(run2));
268887
268937
  let spaceExplicitX;
268938
+ let spacePrecedingTabEndX;
268888
268939
  if (inActiveTabGroup && activeTabGroup) {
268889
268940
  spaceExplicitX = activeTabGroup.currentX;
268890
268941
  activeTabGroup.currentX = roundValue(activeTabGroup.currentX + singleSpaceWidth);
268942
+ } else if (wordIndex === 0 && segmentStartX !== undefined) {
268943
+ spaceExplicitX = segmentStartX;
268944
+ spacePrecedingTabEndX = consumeSegmentPrecedingTabEndX();
268891
268945
  }
268892
- appendSegment(currentLine.segments, runIndex, spaceStartChar, spaceEndChar, singleSpaceWidth, spaceExplicitX);
268946
+ appendSegment(currentLine.segments, runIndex, spaceStartChar, spaceEndChar, singleSpaceWidth, spaceExplicitX, spacePrecedingTabEndX);
268893
268947
  currentLine.spaceCount += 1;
268894
268948
  }
268895
268949
  }
@@ -268917,6 +268971,7 @@ async function measureParagraphBlock(block, maxWidth) {
268917
268971
  pendingTabAlignment = null;
268918
268972
  pendingLeader = null;
268919
268973
  currentLine = null;
268974
+ clearWrapState();
268920
268975
  }
268921
268976
  const lineMaxWidth = getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
268922
268977
  const hasTabOnlyLine = currentLine && currentLine.segments && currentLine.segments.length === 0 && currentLine.width > 0;
@@ -268962,6 +269017,7 @@ async function measureParagraphBlock(block, maxWidth) {
268962
269017
  pendingTabAlignment = null;
268963
269018
  pendingLeader = null;
268964
269019
  currentLine = null;
269020
+ clearWrapState();
268965
269021
  }
268966
269022
  } else if (isLastChunk) {
268967
269023
  currentLine = {
@@ -269009,6 +269065,7 @@ async function measureParagraphBlock(block, maxWidth) {
269009
269065
  };
269010
269066
  addBarTabsToLine(chunkLine);
269011
269067
  lines.push(chunkLine);
269068
+ clearWrapState();
269012
269069
  }
269013
269070
  chunkCharOffset = chunkEndChar;
269014
269071
  }
@@ -269070,6 +269127,8 @@ async function measureParagraphBlock(block, maxWidth) {
269070
269127
  }
269071
269128
  }
269072
269129
  if (shouldBreak) {
269130
+ if (wordIndex === 0 && hasPendingSegmentTabGeometry)
269131
+ clearWrapState();
269073
269132
  trimTrailingWrapSpaces(currentLine);
269074
269133
  const metrics = finalizeLineMetrics(currentLine, spacing);
269075
269134
  const completedLine = {
@@ -269122,7 +269181,7 @@ async function measureParagraphBlock(block, maxWidth) {
269122
269181
  activeTabGroup.currentX = roundValue(activeTabGroup.currentX + wordOnlyWidth);
269123
269182
  } else if (wordIndex === 0 && segmentStartX !== undefined)
269124
269183
  explicitXHere = segmentStartX;
269125
- appendSegment(currentLine.segments, runIndex, wordStartChar, wordEndNoSpace, wordOnlyWidth, explicitXHere);
269184
+ appendSegment(currentLine.segments, runIndex, wordStartChar, wordEndNoSpace, wordOnlyWidth, explicitXHere, wordIndex === 0 ? consumeSegmentPrecedingTabEndX() : undefined);
269126
269185
  trimTrailingWrapSpaces(currentLine);
269127
269186
  const metrics = finalizeLineMetrics(currentLine, spacing);
269128
269187
  const completedLine = {
@@ -269152,7 +269211,7 @@ async function measureParagraphBlock(block, maxWidth) {
269152
269211
  currentLine.width = roundValue(targetWidth);
269153
269212
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
269154
269213
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lineHeightFontSize(run2));
269155
- appendSegment(currentLine.segments, runIndex, wordStartChar, newToChar, wordCommitWidth, explicitX);
269214
+ appendSegment(currentLine.segments, runIndex, wordStartChar, newToChar, wordCommitWidth, explicitX, wordIndex === 0 ? consumeSegmentPrecedingTabEndX() : undefined);
269156
269215
  if (shouldIncludeDelimiterSpace)
269157
269216
  currentLine.spaceCount += 1;
269158
269217
  }
@@ -269205,7 +269264,8 @@ async function measureParagraphBlock(block, maxWidth) {
269205
269264
  validateTabStopVal(stop);
269206
269265
  pendingTabAlignment = {
269207
269266
  target: clampedTarget - effectiveIndent,
269208
- val: stop.val
269267
+ val: stop.val,
269268
+ compensateNegativeLeft: stop.val === "start" && indentLeft < 0 && effectiveIndent === indentLeft && stop.source !== "explicit"
269209
269269
  };
269210
269270
  } else {
269211
269271
  pendingTabAlignment = null;
@@ -290385,7 +290445,7 @@ menclose::after {
290385
290445
  if (transform === "capitalize")
290386
290446
  return capitalizeText$2(text5, fullText, startOffset);
290387
290447
  return text5;
290388
- }, DEFAULT_TAB_INTERVAL_TWIPS$2 = 720, TWIPS_PER_PX$2, TAB_EPSILON$1 = 0.1, WIDTH_FUDGE_PX = 0.5, twipsToPx$2 = (twips) => twips / TWIPS_PER_PX$2, pxToTwips$1 = (px) => Math.round(px * TWIPS_PER_PX$2), sanitizeIndent$1 = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : 0, sanitizeDecimalSeparator$1 = (value) => value === "," ? "," : ".", getRunWidth = (run2) => {
290448
+ }, DEFAULT_TAB_INTERVAL_TWIPS$2 = 720, TWIPS_PER_PX$2, TAB_EPSILON$1 = 0.1, WIDTH_FUDGE_PX = 0.5, twipsToPx$2 = (twips) => twips / TWIPS_PER_PX$2, pxToTwips$1 = (px) => Math.round(px * TWIPS_PER_PX$2), sanitizeIndent$1 = (value) => typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : 0, sanitizeRawIndent = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0, sanitizeDecimalSeparator$1 = (value) => value === "," ? "," : ".", getRunWidth = (run2) => {
290389
290449
  const width = run2.width;
290390
290450
  return typeof width === "number" ? width : 0;
290391
290451
  }, isLineBreakRun$1 = (run2) => run2.kind === "lineBreak" || run2.kind === "break" && run2.breakType === "line", markerFontString = (run2) => {
@@ -290399,10 +290459,17 @@ menclose::after {
290399
290459
  firstLine: pxToTwips$1(sanitizeIndent$1(indent2?.firstLine)),
290400
290460
  hanging: pxToTwips$1(sanitizeIndent$1(indent2?.hanging))
290401
290461
  };
290462
+ const rawParagraphIndentTwips = {
290463
+ left: pxToTwips$1(sanitizeRawIndent(indent2?.left)),
290464
+ right: pxToTwips$1(sanitizeRawIndent(indent2?.right)),
290465
+ firstLine: pxToTwips$1(sanitizeRawIndent(indent2?.firstLine)),
290466
+ hanging: pxToTwips$1(sanitizeIndent$1(indent2?.hanging))
290467
+ };
290402
290468
  return computeTabStops$1({
290403
290469
  explicitStops: tabs ?? [],
290404
290470
  defaultTabInterval: tabIntervalTwips ?? DEFAULT_TAB_INTERVAL_TWIPS$2,
290405
- paragraphIndent: paragraphIndentTwips
290471
+ paragraphIndent: paragraphIndentTwips,
290472
+ rawParagraphIndent: rawParagraphIndentTwips
290406
290473
  }).map((stop) => ({
290407
290474
  pos: twipsToPx$2(stop.pos),
290408
290475
  val: stop.val,
@@ -290627,6 +290694,10 @@ menclose::after {
290627
290694
  }
290628
290695
  const clampedTarget = Number.isFinite(maxAbsWidth) ? Math.min(target, maxAbsWidth) : target;
290629
290696
  const relativeTarget = clampedTarget - effectiveIndent;
290697
+ const stopVal = stop?.val ?? "start";
290698
+ const shouldCompensateNegativeLeft = stopVal === "start" && indentLeft < 0 && effectiveIndent === indentLeft && stop?.source !== "explicit";
290699
+ const paintTarget = shouldCompensateNegativeLeft ? relativeTarget - Math.min(effectiveIndent, 0) : relativeTarget;
290700
+ const precedingTabEndX = shouldCompensateNegativeLeft ? relativeTarget : undefined;
290630
290701
  lineWidth = Math.max(lineWidth, relativeTarget);
290631
290702
  if (stop?.source === "explicit")
290632
290703
  line.hasExplicitTabStops = true;
@@ -290639,7 +290710,6 @@ menclose::after {
290639
290710
  };
290640
290711
  leaders.push(currentLeader);
290641
290712
  }
290642
- const stopVal = stop?.val ?? "start";
290643
290713
  if (stopVal === "end" || stopVal === "center" || stopVal === "decimal") {
290644
290714
  const groupMeasure = measureTabAlignmentGroupInLine(runs2, line, startRunIndex, startChar, decimalSeparator);
290645
290715
  if (groupMeasure.totalWidth > 0) {
@@ -290654,14 +290724,28 @@ menclose::after {
290654
290724
  }
290655
290725
  if (currentLeader)
290656
290726
  currentLeader.to = groupStartX + effectiveIndent;
290657
- pendingTabAlignStartX = groupStartX;
290727
+ pendingTabAlignStartX = {
290728
+ layoutX: groupStartX,
290729
+ paintX: groupStartX
290730
+ };
290658
290731
  } else
290659
290732
  cursorX = Math.max(cursorX, relativeTarget);
290660
- } else
290733
+ } else {
290661
290734
  cursorX = Math.max(cursorX, relativeTarget);
290735
+ pendingTabAlignStartX = {
290736
+ layoutX: relativeTarget,
290737
+ paintX: paintTarget,
290738
+ ...precedingTabEndX !== undefined ? { precedingTabEndX } : {}
290739
+ };
290740
+ }
290662
290741
  if (run2 && run2.kind === "tab")
290663
290742
  run2.width = Math.max(0, relativeTarget - originX);
290664
290743
  };
290744
+ const consumePendingTabAlignStart = () => {
290745
+ const pending = pendingTabAlignStartX;
290746
+ pendingTabAlignStartX = null;
290747
+ return pending;
290748
+ };
290665
290749
  for (let runIndex = line.fromRun;runIndex <= line.toRun; runIndex += 1) {
290666
290750
  const run2 = runs2[runIndex];
290667
290751
  if (!run2)
@@ -290693,10 +290777,12 @@ menclose::after {
290693
290777
  toChar: i4,
290694
290778
  width: segmentWidth
290695
290779
  };
290696
- if (pendingTabAlignStartX != null) {
290697
- segment.x = pendingTabAlignStartX;
290698
- cursorX = pendingTabAlignStartX + segmentWidth;
290699
- pendingTabAlignStartX = null;
290780
+ const pendingTabAlign = consumePendingTabAlignStart();
290781
+ if (pendingTabAlign != null) {
290782
+ segment.x = pendingTabAlign.paintX;
290783
+ if (pendingTabAlign.precedingTabEndX !== undefined)
290784
+ segment.precedingTabEndX = pendingTabAlign.precedingTabEndX;
290785
+ cursorX = pendingTabAlign.layoutX + segmentWidth;
290700
290786
  } else
290701
290787
  cursorX += segmentWidth;
290702
290788
  lineWidth = Math.max(lineWidth, cursorX);
@@ -290714,10 +290800,12 @@ menclose::after {
290714
290800
  toChar: sliceEnd,
290715
290801
  width: segmentWidth
290716
290802
  };
290717
- if (pendingTabAlignStartX != null) {
290718
- segment.x = pendingTabAlignStartX;
290719
- cursorX = pendingTabAlignStartX + segmentWidth;
290720
- pendingTabAlignStartX = null;
290803
+ const pendingTabAlign = consumePendingTabAlignStart();
290804
+ if (pendingTabAlign != null) {
290805
+ segment.x = pendingTabAlign.paintX;
290806
+ if (pendingTabAlign.precedingTabEndX !== undefined)
290807
+ segment.precedingTabEndX = pendingTabAlign.precedingTabEndX;
290808
+ cursorX = pendingTabAlign.layoutX + segmentWidth;
290721
290809
  } else
290722
290810
  cursorX += segmentWidth;
290723
290811
  lineWidth = Math.max(lineWidth, cursorX);
@@ -298079,11 +298167,11 @@ menclose::after {
298079
298167
  width: currentWidth
298080
298168
  });
298081
298169
  return chunks;
298082
- }, appendSegment = (segments, runIndex, fromChar, toChar, width, x) => {
298170
+ }, appendSegment = (segments, runIndex, fromChar, toChar, width, x, precedingTabEndX) => {
298083
298171
  if (!segments)
298084
298172
  return;
298085
298173
  const last2 = segments[segments.length - 1];
298086
- if (last2 && last2.runIndex === runIndex && last2.toChar === fromChar && x === undefined) {
298174
+ if (last2 && last2.runIndex === runIndex && last2.toChar === fromChar && last2.x === undefined && last2.precedingTabEndX === undefined && x === undefined && precedingTabEndX === undefined) {
298087
298175
  last2.toChar = toChar;
298088
298176
  last2.width += width;
298089
298177
  return;
@@ -298093,7 +298181,8 @@ menclose::after {
298093
298181
  fromChar,
298094
298182
  toChar,
298095
298183
  width,
298096
- x
298184
+ ...x !== undefined ? { x } : {},
298185
+ ...precedingTabEndX !== undefined ? { precedingTabEndX } : {}
298097
298186
  });
298098
298187
  }, resolveLineHeight = (spacing, fontSize, maxHeight = -1) => {
298099
298188
  let computedHeight = spacing?.line ?? WORD_SINGLE_LINE_SPACING_MULTIPLIER;
@@ -298143,10 +298232,17 @@ menclose::after {
298143
298232
  firstLine: pxToTwips(sanitizePositive(indent2?.firstLine)),
298144
298233
  hanging: pxToTwips(sanitizePositive(indent2?.hanging))
298145
298234
  };
298235
+ const rawParagraphIndentTwips = {
298236
+ left: pxToTwips(sanitizeIndent(indent2?.left)),
298237
+ right: pxToTwips(sanitizeIndent(indent2?.right)),
298238
+ firstLine: pxToTwips(sanitizeIndent(indent2?.firstLine)),
298239
+ hanging: pxToTwips(sanitizePositive(indent2?.hanging))
298240
+ };
298146
298241
  return computeTabStops({
298147
298242
  explicitStops: tabs ?? [],
298148
298243
  defaultTabInterval: tabIntervalTwips ?? DEFAULT_TAB_INTERVAL_TWIPS,
298149
- paragraphIndent: paragraphIndentTwips
298244
+ paragraphIndent: paragraphIndentTwips,
298245
+ rawParagraphIndent: rawParagraphIndentTwips
298150
298246
  }).map((stop) => ({
298151
298247
  pos: twipsToPx(stop.pos),
298152
298248
  val: stop.val,
@@ -299813,7 +299909,7 @@ menclose::after {
299813
299909
  return;
299814
299910
  console.log(...args$1);
299815
299911
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
299816
- var init_src_ItIaPxzW_es = __esm(() => {
299912
+ var init_src_C_jV2TZI_es = __esm(() => {
299817
299913
  init_rolldown_runtime_Bg48TavK_es();
299818
299914
  init_SuperConverter_D1o6_yKI_es();
299819
299915
  init_jszip_C49i9kUs_es();
@@ -327689,7 +327785,7 @@ function print() { __p += __j.call(arguments, '') }
327689
327785
  availableWidthOverride = fragment2.width - listFirstLineTextStartPx - Math.max(0, paraIndentRight);
327690
327786
  const isFirstLine = index2 === 0 && !paraContinuesFromPrev;
327691
327787
  const isListFirstLine = Boolean(hasListFirstLineMarker && fragment2.markerTextWidth);
327692
- if (isFirstLine && !isListFirstLine && !hasExplicitSegmentPositioning)
327788
+ if (isFirstLine && !isListFirstLine && line.hasExplicitTabStops !== true)
327693
327789
  availableWidthOverride = adjustAvailableWidthForTextIndent(availableWidthOverride, firstLineOffset, line.maxWidth);
327694
327790
  const shouldSkipJustifyForLastLine = index2 === lines.length - 1 && !paraContinuesOnNext && !paragraphEndsWithLineBreak;
327695
327791
  const lineEl = this.renderLine(block, line, context, availableWidthOverride, fragment2.fromLine + index2, shouldSkipJustifyForLastLine, expandedRunsForBlock, shouldUseResolvedListTextStart ? listFirstLineTextStartPx : undefined);
@@ -329483,6 +329579,7 @@ function print() { __p += __j.call(arguments, '') }
329483
329579
  el.appendChild(barEl);
329484
329580
  });
329485
329581
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
329582
+ const hasMultipleExplicitPositionedSegments = (line.segments?.filter((seg) => seg.x !== undefined).length ?? 0) > 1;
329486
329583
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
329487
329584
  const justifyShouldApply = shouldApplyJustify({
329488
329585
  alignment: block.attrs?.alignment,
@@ -329490,7 +329587,7 @@ function print() { __p += __j.call(arguments, '') }
329490
329587
  hasExplicitTabStops: line.hasExplicitTabStops === true,
329491
329588
  isLastLineOfParagraph: false,
329492
329589
  paragraphEndsWithLineBreak: false,
329493
- skipJustifyOverride: skipJustify
329590
+ skipJustifyOverride: skipJustify || hasMultipleExplicitPositionedSegments
329494
329591
  });
329495
329592
  const countSpaces$1 = (text5) => {
329496
329593
  let count2 = 0;
@@ -329657,12 +329754,14 @@ function print() { __p += __j.call(arguments, '') }
329657
329754
  else
329658
329755
  segmentsByRun.set(segment.runIndex, [segment]);
329659
329756
  });
329660
- const findImmediateNextSegmentX = (fromRunIndex) => {
329757
+ const findImmediateNextSegment = (fromRunIndex) => {
329661
329758
  const nextRunIdx = fromRunIndex + 1;
329662
329759
  if (nextRunIdx <= line.toRun) {
329663
329760
  const nextSegments = segmentsByRun.get(nextRunIdx);
329664
- if (nextSegments && nextSegments.length > 0)
329665
- return nextSegments[0].x;
329761
+ if (nextSegments && nextSegments.length > 0) {
329762
+ const firstSegment = nextSegments[0];
329763
+ return firstSegment.x !== undefined || firstSegment.precedingTabEndX !== undefined ? firstSegment : undefined;
329764
+ }
329666
329765
  }
329667
329766
  };
329668
329767
  let geoSdtWrapper = null;
@@ -329706,9 +329805,10 @@ function print() { __p += __j.call(arguments, '') }
329706
329805
  if (!baseRun)
329707
329806
  continue;
329708
329807
  if (baseRun.kind === "tab") {
329709
- const immediateNextX = findImmediateNextSegmentX(runIndex);
329808
+ const immediateNextSegment = findImmediateNextSegment(runIndex);
329710
329809
  const tabStartX = cumulativeX;
329711
- const tabEndX = immediateNextX !== undefined ? immediateNextX : tabStartX + (baseRun.width ?? 0);
329810
+ const measuredTabEndX = tabStartX + (baseRun.width ?? 0);
329811
+ const tabEndX = immediateNextSegment?.precedingTabEndX ?? immediateNextSegment?.x ?? measuredTabEndX;
329712
329812
  const actualTabWidth = tabEndX - tabStartX;
329713
329813
  const tabEl = this.doc.createElement("span");
329714
329814
  tabEl.style.position = "absolute";
@@ -329818,10 +329918,10 @@ function print() { __p += __j.call(arguments, '') }
329818
329918
  elem.style.position = "absolute";
329819
329919
  elem.style.left = `${xPos}px`;
329820
329920
  appendToLineGeo(elem, segmentRun, xPos, segment.width);
329821
- const width = segment.width;
329822
- cumulativeX = baseX + width;
329921
+ const visualWidth = segment.width + (spacingPerSpace !== 0 ? spacingPerSpace * countSpaces$1(segmentText) : 0);
329922
+ cumulativeX = baseX + visualWidth;
329823
329923
  if (geoSdtWrapper)
329824
- geoSdtMaxRight = Math.max(geoSdtMaxRight, xPos + width);
329924
+ geoSdtMaxRight = Math.max(geoSdtMaxRight, xPos + visualWidth);
329825
329925
  }
329826
329926
  });
329827
329927
  }
@@ -337451,7 +337551,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
337451
337551
 
337452
337552
  // ../../packages/superdoc/dist/super-editor.es.js
337453
337553
  var init_super_editor_es = __esm(() => {
337454
- init_src_ItIaPxzW_es();
337554
+ init_src_C_jV2TZI_es();
337455
337555
  init_SuperConverter_D1o6_yKI_es();
337456
337556
  init_jszip_C49i9kUs_es();
337457
337557
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.8.0-next.79",
3
+ "version": "0.8.0-next.80",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -26,19 +26,19 @@
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
28
  "@superdoc/pm-adapter": "0.0.0",
29
- "@superdoc/super-editor": "0.0.1",
30
- "superdoc": "1.31.0"
29
+ "superdoc": "1.31.0",
30
+ "@superdoc/super-editor": "0.0.1"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.79",
38
- "@superdoc-dev/cli-darwin-x64": "0.8.0-next.79",
39
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.79",
40
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.79",
41
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.79"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.80",
38
+ "@superdoc-dev/cli-darwin-x64": "0.8.0-next.80",
39
+ "@superdoc-dev/cli-linux-x64": "0.8.0-next.80",
40
+ "@superdoc-dev/cli-linux-arm64": "0.8.0-next.80",
41
+ "@superdoc-dev/cli-windows-x64": "0.8.0-next.80"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",