@harbour-enterprises/superdoc 1.3.0-next.4 → 1.3.0-next.5

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.
@@ -1,6 +1,6 @@
1
1
  import { B as Buffer$2 } from "./jszip-B1fkPkPJ.es.js";
2
2
  import { t as twipsToInches, i as inchesToTwips, p as ptToTwips, l as linesToTwips, a as twipsToLines, b as pixelsToTwips, h as halfPointToPoints, c as twipsToPixels$2, d as convertSizeToCSS, e as inchesToPixels } from "./helpers-C8e9wR5l.es.js";
3
- import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as _getReferencedTableStyles, a4 as decodeRPrFromMarks, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString } from "./SuperConverter-D62X6P1R.es.js";
3
+ import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as _getReferencedTableStyles, a4 as decodeRPrFromMarks, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString } from "./SuperConverter-DMbipzpl.es.js";
4
4
  import { p as process$1, r as ref, C as global$1, c as computed, E as createElementBlock, F as Fragment$1, S as renderList, O as withModifiers, G as openBlock, P as normalizeClass, M as createCommentVNode, H as toDisplayString, K as createBaseVNode, U as createApp, f as onMounted, X as onUnmounted, R as withDirectives, v as unref, Y as vModelText, y as nextTick, L as normalizeStyle, u as watch, Z as withKeys, _ as createTextVNode, I as createVNode, h, $ as readonly, s as getCurrentInstance, o as onBeforeUnmount, j as reactive, b as onBeforeMount, i as inject, a0 as onActivated, a1 as onDeactivated, a2 as Comment, d as defineComponent, a as provide, g as Teleport, t as toRef, a3 as renderSlot, a4 as isVNode, D as shallowRef, w as watchEffect, T as Transition, a5 as mergeProps, a6 as vShow, a7 as cloneVNode, a8 as Text$2, m as markRaw, N as createBlock, J as withCtx, a9 as useCssVars, V as resolveDynamicComponent, aa as normalizeProps, ab as guardReactiveProps } from "./vue-BnBKJwCW.es.js";
5
5
  import "./jszip.min-DCl8qkFO.es.js";
6
6
  import { E as EventEmitter$1 } from "./eventemitter3-CwrdEv8r.es.js";
@@ -15334,7 +15334,7 @@ const canUseDOM = () => {
15334
15334
  return false;
15335
15335
  }
15336
15336
  };
15337
- const summaryVersion = "1.3.0-next.4";
15337
+ const summaryVersion = "1.3.0-next.5";
15338
15338
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15339
15339
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15340
15340
  function mapAttributes(attrs) {
@@ -17967,7 +17967,7 @@ class Editor extends EventEmitter {
17967
17967
  * Process collaboration migrations
17968
17968
  */
17969
17969
  processCollaborationMigrations() {
17970
- console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.4");
17970
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.5");
17971
17971
  if (!this.options.ydoc) return;
17972
17972
  const metaMap = this.options.ydoc.getMap("meta");
17973
17973
  let docVersion = metaMap.get("version");
@@ -41229,6 +41229,19 @@ function tokenNodeToRun(node, positions, defaultFont, defaultSize, inheritedMark
41229
41229
  const effectiveMarks = nodeMarks.length > 0 ? nodeMarks : marksAsAttrs;
41230
41230
  const marks = [...effectiveMarks, ...inheritedMarks ?? []];
41231
41231
  applyMarksToRun(run, marks, hyperlinkConfig, themeColors);
41232
+ if (marksAsAttrs.length > 0) {
41233
+ run._explicitFont = true;
41234
+ }
41235
+ console.debug("[token-debug] tokenNodeToRun", {
41236
+ token,
41237
+ fontFamily: run.fontFamily,
41238
+ fontSize: run.fontSize,
41239
+ defaultFont,
41240
+ defaultSize,
41241
+ nodeMarksCount: nodeMarks.length,
41242
+ marksAsAttrsCount: marksAsAttrs.length,
41243
+ inheritedMarksCount: inheritedMarks?.length ?? 0
41244
+ });
41232
41245
  return run;
41233
41246
  }
41234
41247
  const EIGHTHS_PER_POINT = 8;
@@ -44977,6 +44990,10 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
44977
44990
  if (TOKEN_INLINE_TYPES.has(node.type)) {
44978
44991
  const tokenKind = TOKEN_INLINE_TYPES.get(node.type);
44979
44992
  if (tokenKind) {
44993
+ const marksAsAttrs = Array.isArray(node.attrs?.marksAsAttrs) ? node.attrs.marksAsAttrs : [];
44994
+ const nodeMarks = node.marks ?? [];
44995
+ const effectiveMarks = nodeMarks.length > 0 ? nodeMarks : marksAsAttrs;
44996
+ const mergedMarks = [...effectiveMarks, ...inheritedMarks ?? []];
44980
44997
  const tokenRun = tokenNodeToRun(
44981
44998
  node,
44982
44999
  positions,
@@ -44993,6 +45010,23 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
44993
45010
  const inlineStyleId = getInlineStyleId(inheritedMarks);
44994
45011
  applyRunStyles2(tokenRun, inlineStyleId, activeRunStyleId);
44995
45012
  applyBaseRunDefaults(tokenRun, baseRunDefaults, defaultFont, defaultSize);
45013
+ if (mergedMarks.length > 0) {
45014
+ applyMarksToRun(
45015
+ tokenRun,
45016
+ mergedMarks,
45017
+ hyperlinkConfig,
45018
+ themeColors,
45019
+ converterContext?.backgroundColor
45020
+ );
45021
+ }
45022
+ console.debug("[token-debug] paragraph-token-run", {
45023
+ token: tokenRun.token,
45024
+ fontFamily: tokenRun.fontFamily,
45025
+ fontSize: tokenRun.fontSize,
45026
+ inlineStyleId,
45027
+ runStyleId: activeRunStyleId,
45028
+ mergedMarksCount: mergedMarks.length
45029
+ });
44996
45030
  currentRuns.push(tokenRun);
44997
45031
  }
44998
45032
  return;
@@ -47977,6 +48011,77 @@ function isLineBreakRun(run) {
47977
48011
  function isFieldAnnotationRun(run) {
47978
48012
  return run.kind === "fieldAnnotation";
47979
48013
  }
48014
+ function measureTabAlignmentGroup(startRunIndex, runs, ctx2, decimalSeparator = ".") {
48015
+ const result = {
48016
+ totalWidth: 0,
48017
+ runs: [],
48018
+ endRunIndex: runs.length
48019
+ };
48020
+ let foundDecimal = false;
48021
+ for (let i = startRunIndex; i < runs.length; i++) {
48022
+ const run = runs[i];
48023
+ if (isTabRun(run)) {
48024
+ result.endRunIndex = i;
48025
+ break;
48026
+ }
48027
+ if (isLineBreakRun(run) || run.kind === "break" && run.breakType === "line") {
48028
+ result.endRunIndex = i;
48029
+ break;
48030
+ }
48031
+ if (run.kind === "text" || run.kind === void 0) {
48032
+ const textRun = run;
48033
+ const text = textRun.text || "";
48034
+ if (text.length > 0) {
48035
+ const { font } = buildFontString(textRun);
48036
+ const width = measureRunWidth(text, font, ctx2, textRun, 0);
48037
+ let beforeDecimalWidth;
48038
+ if (!foundDecimal) {
48039
+ const decimalIdx = text.indexOf(decimalSeparator);
48040
+ if (decimalIdx >= 0) {
48041
+ foundDecimal = true;
48042
+ const beforeText = text.slice(0, decimalIdx);
48043
+ beforeDecimalWidth = beforeText.length > 0 ? measureRunWidth(beforeText, font, ctx2, textRun, 0) : 0;
48044
+ result.beforeDecimalWidth = result.totalWidth + beforeDecimalWidth;
48045
+ }
48046
+ }
48047
+ result.runs.push({
48048
+ runIndex: i,
48049
+ width,
48050
+ text,
48051
+ beforeDecimalWidth
48052
+ });
48053
+ result.totalWidth += width;
48054
+ } else {
48055
+ result.runs.push({ runIndex: i, width: 0, text: "" });
48056
+ }
48057
+ continue;
48058
+ }
48059
+ if (isImageRun(run)) {
48060
+ const leftSpace = run.distLeft ?? 0;
48061
+ const rightSpace = run.distRight ?? 0;
48062
+ const imageWidth = run.width + leftSpace + rightSpace;
48063
+ result.runs.push({ runIndex: i, width: imageWidth });
48064
+ result.totalWidth += imageWidth;
48065
+ continue;
48066
+ }
48067
+ if (isFieldAnnotationRun(run)) {
48068
+ const fontSize2 = run.fontSize ?? DEFAULT_FIELD_ANNOTATION_FONT_SIZE;
48069
+ const { font } = buildFontString({
48070
+ fontFamily: run.fontFamily ?? "Arial",
48071
+ fontSize: fontSize2,
48072
+ bold: run.bold,
48073
+ italic: run.italic
48074
+ });
48075
+ const textWidth = run.displayLabel ? measureRunWidth(run.displayLabel, font, ctx2, run, 0) : 0;
48076
+ const pillWidth = textWidth + FIELD_ANNOTATION_PILL_PADDING;
48077
+ result.runs.push({ runIndex: i, width: pillWidth });
48078
+ result.totalWidth += pillWidth;
48079
+ continue;
48080
+ }
48081
+ result.runs.push({ runIndex: i, width: 0 });
48082
+ }
48083
+ return result;
48084
+ }
47980
48085
  async function measureBlock(block, constraints) {
47981
48086
  const normalized = normalizeConstraints(constraints);
47982
48087
  if (block.kind === "drawing") {
@@ -48100,6 +48205,7 @@ async function measureParagraphBlock(block, maxWidth) {
48100
48205
  let pendingTabAlignment = null;
48101
48206
  let lastAppliedTabAlign = null;
48102
48207
  const warnedTabVals = /* @__PURE__ */ new Set();
48208
+ let activeTabGroup = null;
48103
48209
  const validateTabStopVal = (stop) => {
48104
48210
  if (!ALLOWED_TAB_VALS.has(stop.val) && !warnedTabVals.has(stop.val)) {
48105
48211
  warnedTabVals.add(stop.val);
@@ -48279,6 +48385,7 @@ async function measureParagraphBlock(block, maxWidth) {
48279
48385
  continue;
48280
48386
  }
48281
48387
  if (isTabRun(run)) {
48388
+ activeTabGroup = null;
48282
48389
  if (!currentLine) {
48283
48390
  currentLine = {
48284
48391
  fromRun: runIndex,
@@ -48303,12 +48410,6 @@ async function measureParagraphBlock(block, maxWidth) {
48303
48410
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, 12);
48304
48411
  currentLine.toRun = runIndex;
48305
48412
  currentLine.toChar = 1;
48306
- if (stop) {
48307
- validateTabStopVal(stop);
48308
- pendingTabAlignment = { target: clampedTarget, val: stop.val };
48309
- } else {
48310
- pendingTabAlignment = null;
48311
- }
48312
48413
  if (stop && stop.leader && stop.leader !== "none") {
48313
48414
  const leaderStyle = stop.leader;
48314
48415
  const from3 = Math.min(originX, clampedTarget);
@@ -48316,6 +48417,36 @@ async function measureParagraphBlock(block, maxWidth) {
48316
48417
  if (!currentLine.leaders) currentLine.leaders = [];
48317
48418
  currentLine.leaders.push({ from: from3, to, style: leaderStyle });
48318
48419
  }
48420
+ if (stop) {
48421
+ validateTabStopVal(stop);
48422
+ if (stop.val === "end" || stop.val === "center" || stop.val === "decimal") {
48423
+ const groupMeasure = measureTabAlignmentGroup(runIndex + 1, runsToProcess, ctx2, decimalSeparator);
48424
+ if (groupMeasure.totalWidth > 0) {
48425
+ let groupStartX;
48426
+ if (stop.val === "end") {
48427
+ groupStartX = Math.max(0, clampedTarget - groupMeasure.totalWidth);
48428
+ } else if (stop.val === "center") {
48429
+ groupStartX = Math.max(0, clampedTarget - groupMeasure.totalWidth / 2);
48430
+ } else {
48431
+ const beforeDecimal = groupMeasure.beforeDecimalWidth ?? groupMeasure.totalWidth;
48432
+ groupStartX = Math.max(0, clampedTarget - beforeDecimal);
48433
+ }
48434
+ activeTabGroup = {
48435
+ measure: groupMeasure,
48436
+ startX: groupStartX,
48437
+ currentX: groupStartX,
48438
+ target: clampedTarget,
48439
+ val: stop.val
48440
+ };
48441
+ currentLine.width = roundValue(groupStartX);
48442
+ }
48443
+ pendingTabAlignment = null;
48444
+ } else {
48445
+ pendingTabAlignment = { target: clampedTarget, val: stop.val };
48446
+ }
48447
+ } else {
48448
+ pendingTabAlignment = null;
48449
+ }
48319
48450
  continue;
48320
48451
  }
48321
48452
  if (isImageRun(run)) {
@@ -48326,7 +48457,10 @@ async function measureParagraphBlock(block, maxWidth) {
48326
48457
  const bottomSpace = run.distBottom ?? 0;
48327
48458
  const imageHeight = run.height + topSpace + bottomSpace;
48328
48459
  let imageStartX;
48329
- if (pendingTabAlignment && currentLine) {
48460
+ if (activeTabGroup && currentLine) {
48461
+ imageStartX = activeTabGroup.currentX;
48462
+ activeTabGroup.currentX = roundValue(activeTabGroup.currentX + imageWidth);
48463
+ } else if (pendingTabAlignment && currentLine) {
48330
48464
  imageStartX = alignPendingTabForWidth(imageWidth);
48331
48465
  }
48332
48466
  if (!currentLine) {
@@ -48351,10 +48485,14 @@ async function measureParagraphBlock(block, maxWidth) {
48351
48485
  }
48352
48486
  ]
48353
48487
  };
48488
+ if (activeTabGroup && runIndex + 1 >= activeTabGroup.measure.endRunIndex) {
48489
+ activeTabGroup = null;
48490
+ }
48354
48491
  continue;
48355
48492
  }
48356
48493
  const appliedTabAlign = lastAppliedTabAlign;
48357
- if (currentLine.width + imageWidth > currentLine.maxWidth && currentLine.width > 0) {
48494
+ const skipFitCheck = activeTabGroup !== null;
48495
+ if (!skipFitCheck && currentLine.width + imageWidth > currentLine.maxWidth && currentLine.width > 0) {
48358
48496
  trimTrailingWrapSpaces(currentLine);
48359
48497
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
48360
48498
  const lineBase = currentLine;
@@ -48367,6 +48505,7 @@ async function measureParagraphBlock(block, maxWidth) {
48367
48505
  tabStopCursor = 0;
48368
48506
  pendingTabAlignment = null;
48369
48507
  lastAppliedTabAlign = null;
48508
+ activeTabGroup = null;
48370
48509
  currentLine = {
48371
48510
  fromRun: runIndex,
48372
48511
  fromChar: 0,
@@ -48399,6 +48538,9 @@ async function measureParagraphBlock(block, maxWidth) {
48399
48538
  ...imageStartX !== void 0 ? { x: imageStartX } : {}
48400
48539
  });
48401
48540
  }
48541
+ if (activeTabGroup && runIndex + 1 >= activeTabGroup.measure.endRunIndex) {
48542
+ activeTabGroup = null;
48543
+ }
48402
48544
  const tabAlign = appliedTabAlign;
48403
48545
  if (tabAlign && currentLine && tabAlign.val === "end") {
48404
48546
  currentLine.width = roundValue(tabAlign.target);
@@ -48574,7 +48716,11 @@ async function measureParagraphBlock(block, maxWidth) {
48574
48716
  }
48575
48717
  }
48576
48718
  let segmentStartX;
48577
- if (currentLine && pendingTabAlignment) {
48719
+ let inActiveTabGroup = false;
48720
+ if (activeTabGroup && currentLine) {
48721
+ segmentStartX = activeTabGroup.currentX;
48722
+ inActiveTabGroup = true;
48723
+ } else if (currentLine && pendingTabAlignment) {
48578
48724
  segmentStartX = alignSegmentAtTab(segment, font, run, charPosInRun);
48579
48725
  if (segmentStartX == null) {
48580
48726
  segmentStartX = currentLine.width;
@@ -48611,6 +48757,7 @@ async function measureParagraphBlock(block, maxWidth) {
48611
48757
  tabStopCursor = 0;
48612
48758
  pendingTabAlignment = null;
48613
48759
  lastAppliedTabAlign = null;
48760
+ activeTabGroup = null;
48614
48761
  currentLine = {
48615
48762
  fromRun: runIndex,
48616
48763
  fromChar: spaceStartChar,
@@ -48629,7 +48776,19 @@ async function measureParagraphBlock(block, maxWidth) {
48629
48776
  currentLine.width = roundValue(currentLine.width + boundarySpacing2 + singleSpaceWidth);
48630
48777
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run);
48631
48778
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, run.fontSize);
48632
- appendSegment(currentLine.segments, runIndex, spaceStartChar, spaceEndChar, singleSpaceWidth);
48779
+ let spaceExplicitX;
48780
+ if (inActiveTabGroup && activeTabGroup) {
48781
+ spaceExplicitX = activeTabGroup.currentX;
48782
+ activeTabGroup.currentX = roundValue(activeTabGroup.currentX + singleSpaceWidth);
48783
+ }
48784
+ appendSegment(
48785
+ currentLine.segments,
48786
+ runIndex,
48787
+ spaceStartChar,
48788
+ spaceEndChar,
48789
+ singleSpaceWidth,
48790
+ spaceExplicitX
48791
+ );
48633
48792
  currentLine.spaceCount += 1;
48634
48793
  }
48635
48794
  }
@@ -48777,7 +48936,7 @@ async function measureParagraphBlock(block, maxWidth) {
48777
48936
  const totalWidthWithWord = currentLine.width + boundarySpacing + wordCommitWidth + // Safe cast: only TextRuns produce word segments from split(), other run types are handled earlier
48778
48937
  (shouldIncludeDelimiterSpace ? run.letterSpacing ?? 0 : 0);
48779
48938
  const availableWidth = currentLine.maxWidth - WIDTH_FUDGE_PX2;
48780
- let shouldBreak = currentLine.width + boundarySpacing + wordOnlyWidth > availableWidth && currentLine.width > 0 && !isTocEntry;
48939
+ let shouldBreak = !inActiveTabGroup && currentLine.width + boundarySpacing + wordOnlyWidth > availableWidth && currentLine.width > 0 && !isTocEntry;
48781
48940
  let compressedWidth = null;
48782
48941
  if (shouldBreak && justifyAlignment) {
48783
48942
  const isLastNonEmptyWordInSegment = wordIndex === lastNonEmptyWordIndex;
@@ -48842,15 +49001,14 @@ async function measureParagraphBlock(block, maxWidth) {
48842
49001
  currentLine.width = roundValue(currentLine.width + boundarySpacing + wordOnlyWidth);
48843
49002
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run);
48844
49003
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, run.fontSize);
48845
- const useExplicitXHere = wordIndex === 0 && segmentStartX !== void 0;
48846
- appendSegment(
48847
- currentLine.segments,
48848
- runIndex,
48849
- wordStartChar,
48850
- wordEndNoSpace,
48851
- wordOnlyWidth,
48852
- useExplicitXHere ? segmentStartX : void 0
48853
- );
49004
+ let explicitXHere;
49005
+ if (inActiveTabGroup && activeTabGroup) {
49006
+ explicitXHere = activeTabGroup.currentX;
49007
+ activeTabGroup.currentX = roundValue(activeTabGroup.currentX + wordOnlyWidth);
49008
+ } else if (wordIndex === 0 && segmentStartX !== void 0) {
49009
+ explicitXHere = segmentStartX;
49010
+ }
49011
+ appendSegment(currentLine.segments, runIndex, wordStartChar, wordEndNoSpace, wordOnlyWidth, explicitXHere);
48854
49012
  trimTrailingWrapSpaces(currentLine);
48855
49013
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
48856
49014
  const lineBase = currentLine;
@@ -48865,8 +49023,13 @@ async function measureParagraphBlock(block, maxWidth) {
48865
49023
  }
48866
49024
  const newToChar = shouldIncludeDelimiterSpace ? wordEndWithSpace : wordEndNoSpace;
48867
49025
  currentLine.toChar = newToChar;
48868
- const useExplicitX = wordIndex === 0 && segmentStartX !== void 0;
48869
- const explicitX = useExplicitX ? segmentStartX : void 0;
49026
+ let explicitX;
49027
+ if (inActiveTabGroup && activeTabGroup) {
49028
+ explicitX = activeTabGroup.currentX;
49029
+ activeTabGroup.currentX = roundValue(activeTabGroup.currentX + wordCommitWidth);
49030
+ } else if (wordIndex === 0 && segmentStartX !== void 0) {
49031
+ explicitX = segmentStartX;
49032
+ }
48870
49033
  const targetWidth = compressedWidth != null ? compressedWidth : currentLine.width + boundarySpacing + wordCommitWidth + (shouldIncludeDelimiterSpace ? run.letterSpacing ?? 0 : 0);
48871
49034
  if (compressedWidth != null) {
48872
49035
  currentLine.naturalWidth = roundValue(totalWidthWithWord);
@@ -48888,6 +49051,12 @@ async function measureParagraphBlock(block, maxWidth) {
48888
49051
  }
48889
49052
  }
48890
49053
  lastAppliedTabAlign = null;
49054
+ if (activeTabGroup && runIndex + 1 >= activeTabGroup.measure.endRunIndex) {
49055
+ if (currentLine && activeTabGroup.val === "end") {
49056
+ currentLine.width = roundValue(activeTabGroup.target);
49057
+ }
49058
+ activeTabGroup = null;
49059
+ }
48891
49060
  if (!isLastSegment) {
48892
49061
  pendingTabAlignment = null;
48893
49062
  if (!currentLine) {
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../chunks/jszip-C8_CqJxM.cjs");
4
4
  require("../chunks/helpers-nOdwpmwb.cjs");
5
- const superEditor_converter = require("../chunks/SuperConverter-qB6m0K1X.cjs");
5
+ const superEditor_converter = require("../chunks/SuperConverter-tcg6NQjY.cjs");
6
6
  require("../chunks/uuid-R7L08bOx.cjs");
7
7
  exports.SuperConverter = superEditor_converter.SuperConverter;
@@ -1,6 +1,6 @@
1
1
  import "../chunks/jszip-B1fkPkPJ.es.js";
2
2
  import "../chunks/helpers-C8e9wR5l.es.js";
3
- import { S } from "../chunks/SuperConverter-D62X6P1R.es.js";
3
+ import { S } from "../chunks/SuperConverter-DMbipzpl.es.js";
4
4
  import "../chunks/uuid-CjlX8hrF.es.js";
5
5
  export {
6
6
  S as SuperConverter
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-Buh63pW6.cjs");
3
+ const index = require("./chunks/index-BHIGTNEQ.cjs");
4
4
  const superEditor_docxZipper = require("./super-editor/docx-zipper.cjs");
5
5
  const superEditor_fileZipper = require("./super-editor/file-zipper.cjs");
6
6
  const vue = require("./chunks/vue-De9wkgLl.cjs");
7
- const superEditor_converter = require("./chunks/SuperConverter-qB6m0K1X.cjs");
7
+ const superEditor_converter = require("./chunks/SuperConverter-tcg6NQjY.cjs");
8
8
  function isNodeType(node, name) {
9
9
  return node.type.name === name;
10
10
  }
@@ -1,9 +1,9 @@
1
- import { ax as Node, ay as Mark } from "./chunks/index-BgcNLeK9.es.js";
2
- import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-BgcNLeK9.es.js";
1
+ import { ax as Node, ay as Mark } from "./chunks/index-BSxlafD_.es.js";
2
+ import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-BSxlafD_.es.js";
3
3
  import { default as default2 } from "./super-editor/docx-zipper.es.js";
4
4
  import { createZip } from "./super-editor/file-zipper.es.js";
5
5
  import { d as defineComponent, E as createElementBlock, G as openBlock, K as createBaseVNode } from "./chunks/vue-BnBKJwCW.es.js";
6
- import { S, r } from "./chunks/SuperConverter-D62X6P1R.es.js";
6
+ import { S, r } from "./chunks/SuperConverter-DMbipzpl.es.js";
7
7
  function isNodeType(node, name) {
8
8
  return node.type.name === name;
9
9
  }
package/dist/superdoc.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-Buh63pW6.cjs");
4
- const superdoc = require("./chunks/index-Dtd_PFUu.cjs");
5
- const superEditor_converter = require("./chunks/SuperConverter-qB6m0K1X.cjs");
3
+ const index = require("./chunks/index-BHIGTNEQ.cjs");
4
+ const superdoc = require("./chunks/index-79lZpkMi.cjs");
5
+ const superEditor_converter = require("./chunks/SuperConverter-tcg6NQjY.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  require("./chunks/jszip-C8_CqJxM.cjs");
8
8
  require("./chunks/helpers-nOdwpmwb.cjs");
@@ -1,6 +1,6 @@
1
- import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-BgcNLeK9.es.js";
2
- import { D, H, P, S, c } from "./chunks/index-CiR7cacp.es.js";
3
- import { S as S2, r } from "./chunks/SuperConverter-D62X6P1R.es.js";
1
+ import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-BSxlafD_.es.js";
2
+ import { D, H, P, S, c } from "./chunks/index-B697vddF.es.js";
3
+ import { S as S2, r } from "./chunks/SuperConverter-DMbipzpl.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  import "./chunks/jszip-B1fkPkPJ.es.js";
6
6
  import "./chunks/helpers-C8e9wR5l.es.js";