@harbour-enterprises/superdoc 1.3.0-next.6 → 1.3.0-next.8

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
  "use strict";
2
- const index = require("./index-C4RVDXKX.cjs");
3
- require("./SuperConverter-BdOf8skU.cjs");
2
+ const index = require("./index-DzCJy9Bf.cjs");
3
+ require("./SuperConverter-d7nvQrVD.cjs");
4
4
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
5
5
  const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
6
6
  const provider = require("@hocuspocus/provider");
@@ -7461,7 +7461,7 @@ const _sfc_main = {
7461
7461
  __name: "SuperDoc",
7462
7462
  emits: ["selection-update"],
7463
7463
  setup(__props, { emit: __emit }) {
7464
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-0pJuKd1x.cjs")));
7464
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-fF1B6H-9.cjs")));
7465
7465
  const superdocStore = useSuperdocStore();
7466
7466
  const commentsStore = useCommentsStore();
7467
7467
  const {
@@ -8367,7 +8367,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
8367
8367
  this.config.colors = shuffleArray(this.config.colors);
8368
8368
  this.userColorMap = /* @__PURE__ */ new Map();
8369
8369
  this.colorIndex = 0;
8370
- this.version = "1.3.0-next.6";
8370
+ this.version = "1.3.0-next.8";
8371
8371
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8372
8372
  this.superdocId = config.superdocId || uuid.v4();
8373
8373
  this.colors = this.config.colors;
@@ -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-S9b1fFw5.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-DwLhA2mM.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.6";
15337
+ const summaryVersion = "1.3.0-next.8";
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.6");
17970
+ console.debug("[checkVersionMigrations] Current editor version", "1.3.0-next.8");
17971
17971
  if (!this.options.ydoc) return;
17972
17972
  const metaMap = this.options.ydoc.getMap("meta");
17973
17973
  let docVersion = metaMap.get("version");
@@ -25551,7 +25551,28 @@ class DomPainter {
25551
25551
  section: kind,
25552
25552
  pageNumberText: page.numberText
25553
25553
  };
25554
- data.fragments.forEach((fragment) => {
25554
+ const behindDocFragments = [];
25555
+ const normalFragments = [];
25556
+ for (const fragment of data.fragments) {
25557
+ const isBehindDoc = (fragment.kind === "image" || fragment.kind === "drawing") && "zIndex" in fragment && fragment.zIndex === 0;
25558
+ if (isBehindDoc) {
25559
+ behindDocFragments.push(fragment);
25560
+ } else {
25561
+ normalFragments.push(fragment);
25562
+ }
25563
+ }
25564
+ const behindDocSelector = `[data-behind-doc-section="${kind}"]`;
25565
+ pageEl.querySelectorAll(behindDocSelector).forEach((el) => el.remove());
25566
+ behindDocFragments.forEach((fragment) => {
25567
+ const fragEl = this.renderFragment(fragment, context);
25568
+ const pageY = effectiveOffset + fragment.y + (kind === "footer" ? footerYOffset : 0);
25569
+ fragEl.style.top = `${pageY}px`;
25570
+ fragEl.style.left = `${marginLeft + fragment.x}px`;
25571
+ fragEl.style.zIndex = "0";
25572
+ fragEl.dataset.behindDocSection = kind;
25573
+ pageEl.insertBefore(fragEl, pageEl.firstChild);
25574
+ });
25575
+ normalFragments.forEach((fragment) => {
25555
25576
  const fragEl = this.renderFragment(fragment, context);
25556
25577
  if (footerYOffset > 0) {
25557
25578
  const currentTop = parseFloat(fragEl.style.top) || fragment.y;
@@ -33879,10 +33900,6 @@ function layoutHeaderFooter(blocks, measures, constraints) {
33879
33900
  if (!Number.isFinite(height) || height <= 0) {
33880
33901
  return { pages: [], height: 0 };
33881
33902
  }
33882
- const overflowBase = typeof constraints.overflowBaseHeight === "number" && Number.isFinite(constraints.overflowBaseHeight) && constraints.overflowBaseHeight > 0 ? constraints.overflowBaseHeight : height;
33883
- const maxBehindDocOverflow = Math.max(192, overflowBase * 4);
33884
- const minBehindDocY = -maxBehindDocOverflow;
33885
- const maxBehindDocY = height + maxBehindDocOverflow;
33886
33903
  const marginLeft = constraints.margins?.left ?? 0;
33887
33904
  const transformedBlocks = marginLeft > 0 ? blocks.map((block) => {
33888
33905
  const hasPageRelativeAnchor = (block.kind === "image" || block.kind === "drawing") && block.anchor?.hRelativeFrom === "page" && block.anchor.offsetH != null;
@@ -33921,7 +33938,7 @@ function layoutHeaderFooter(blocks, measures, constraints) {
33921
33938
  );
33922
33939
  }
33923
33940
  const anchoredBlock = block;
33924
- if (anchoredBlock.anchor?.behindDoc && (fragment.y < minBehindDocY || fragment.y > maxBehindDocY)) {
33941
+ if (anchoredBlock.anchor?.behindDoc) {
33925
33942
  continue;
33926
33943
  }
33927
33944
  }
@@ -44836,6 +44853,12 @@ const applyBaseRunDefaults = (run, defaults, uiDisplayFallbackFont, fallbackSize
44836
44853
  run.letterSpacing = defaults.letterSpacing;
44837
44854
  }
44838
44855
  };
44856
+ const applyInlineRunProperties = (run, runProperties) => {
44857
+ if (!runProperties) return;
44858
+ if (runProperties?.letterSpacing != null) {
44859
+ run.letterSpacing = twipsToPx$1(runProperties.letterSpacing);
44860
+ }
44861
+ };
44839
44862
  function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defaultSize, styleContext, listCounterContext, trackedChanges, bookmarks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG$1, themeColors, converters, converterContext) {
44840
44863
  const baseBlockId = nextBlockId("paragraph");
44841
44864
  const paragraphProps = typeof para.attrs?.paragraphProperties === "object" && para.attrs.paragraphProperties !== null ? para.attrs.paragraphProperties : {};
@@ -44988,7 +45011,7 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
44988
45011
  runStyleId
44989
45012
  });
44990
45013
  };
44991
- const visitNode = (node, inheritedMarks = [], activeSdt, activeRunStyleId = null) => {
45014
+ const visitNode = (node, inheritedMarks = [], activeSdt, activeRunStyleId = null, activeRunProperties) => {
44992
45015
  if (node.type === "text" && node.text) {
44993
45016
  const run = textNodeToRun(
44994
45017
  node,
@@ -45004,6 +45027,7 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
45004
45027
  const inlineStyleId = getInlineStyleId(inheritedMarks);
45005
45028
  applyRunStyles2(run, inlineStyleId, activeRunStyleId);
45006
45029
  applyBaseRunDefaults(run, baseRunDefaults, defaultFont, defaultSize);
45030
+ applyInlineRunProperties(run, activeRunProperties);
45007
45031
  applyMarksToRun(
45008
45032
  run,
45009
45033
  [...node.marks ?? [], ...inheritedMarks ?? []],
@@ -45016,14 +45040,16 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
45016
45040
  }
45017
45041
  if (node.type === "run" && Array.isArray(node.content)) {
45018
45042
  const mergedMarks = [...node.marks ?? [], ...inheritedMarks ?? []];
45019
- const nextRunStyleId = extractRunStyleId(node.attrs?.runProperties) ?? activeRunStyleId;
45020
- node.content.forEach((child) => visitNode(child, mergedMarks, activeSdt, nextRunStyleId));
45043
+ const runProperties = typeof node.attrs?.runProperties === "object" && node.attrs.runProperties !== null ? node.attrs.runProperties : null;
45044
+ const nextRunStyleId = extractRunStyleId(runProperties) ?? activeRunStyleId;
45045
+ const nextRunProperties = runProperties ?? activeRunProperties;
45046
+ node.content.forEach((child) => visitNode(child, mergedMarks, activeSdt, nextRunStyleId, nextRunProperties));
45021
45047
  return;
45022
45048
  }
45023
45049
  if (node.type === "structuredContent" && Array.isArray(node.content)) {
45024
45050
  const inlineMetadata = resolveNodeSdtMetadata(node, "structuredContent");
45025
45051
  const nextSdt = inlineMetadata ?? activeSdt;
45026
- node.content.forEach((child) => visitNode(child, inheritedMarks, nextSdt, activeRunStyleId));
45052
+ node.content.forEach((child) => visitNode(child, inheritedMarks, nextSdt, activeRunStyleId, activeRunProperties));
45027
45053
  return;
45028
45054
  }
45029
45055
  if (node.type === "fieldAnnotation") {
@@ -45077,6 +45103,7 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
45077
45103
  const inlineStyleId = getInlineStyleId(mergedMarks);
45078
45104
  applyRunStyles2(tokenRun, inlineStyleId, activeRunStyleId);
45079
45105
  applyBaseRunDefaults(tokenRun, baseRunDefaults, defaultFont, defaultSize);
45106
+ applyInlineRunProperties(tokenRun, activeRunProperties);
45080
45107
  if (pageRefPos) {
45081
45108
  tokenRun.pmStart = pageRefPos.start;
45082
45109
  tokenRun.pmEnd = pageRefPos.end;
@@ -45091,7 +45118,9 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
45091
45118
  }
45092
45119
  currentRuns.push(tokenRun);
45093
45120
  } else if (Array.isArray(node.content)) {
45094
- node.content.forEach((child) => visitNode(child, mergedMarks, activeSdt));
45121
+ node.content.forEach(
45122
+ (child) => visitNode(child, mergedMarks, activeSdt, activeRunStyleId, activeRunProperties)
45123
+ );
45095
45124
  }
45096
45125
  return;
45097
45126
  }
@@ -45105,7 +45134,9 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
45105
45134
  }
45106
45135
  }
45107
45136
  if (Array.isArray(node.content)) {
45108
- node.content.forEach((child) => visitNode(child, inheritedMarks, activeSdt));
45137
+ node.content.forEach(
45138
+ (child) => visitNode(child, inheritedMarks, activeSdt, activeRunStyleId, activeRunProperties)
45139
+ );
45109
45140
  }
45110
45141
  return;
45111
45142
  }
@@ -45157,6 +45188,7 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
45157
45188
  runStyleId: activeRunStyleId,
45158
45189
  mergedMarksCount: mergedMarks.length
45159
45190
  });
45191
+ applyInlineRunProperties(tokenRun, activeRunProperties);
45160
45192
  currentRuns.push(tokenRun);
45161
45193
  }
45162
45194
  return;
@@ -48333,6 +48365,7 @@ async function measureParagraphBlock(block, maxWidth) {
48333
48365
  let lastFontSize = 12;
48334
48366
  let tabStopCursor = 0;
48335
48367
  let pendingTabAlignment = null;
48368
+ let pendingRunSpacing = 0;
48336
48369
  let lastAppliedTabAlign = null;
48337
48370
  const warnedTabVals = /* @__PURE__ */ new Set();
48338
48371
  let activeTabGroup = null;
@@ -48343,6 +48376,10 @@ async function measureParagraphBlock(block, maxWidth) {
48343
48376
  }
48344
48377
  return true;
48345
48378
  };
48379
+ const resolveBoundarySpacing = (lineWidth, isRunStart, run) => {
48380
+ if (lineWidth <= 0) return 0;
48381
+ return isRunStart ? pendingRunSpacing : run.letterSpacing ?? 0;
48382
+ };
48346
48383
  const alignPendingTabForWidth = (segmentWidth, beforeDecimalWidth) => {
48347
48384
  if (!pendingTabAlignment || !currentLine) return void 0;
48348
48385
  if (segmentWidth < 0) {
@@ -48470,6 +48507,7 @@ async function measureParagraphBlock(block, maxWidth) {
48470
48507
  tabStopCursor = 0;
48471
48508
  pendingTabAlignment = null;
48472
48509
  lastAppliedTabAlign = null;
48510
+ pendingRunSpacing = 0;
48473
48511
  continue;
48474
48512
  }
48475
48513
  if (isLineBreakRun(run)) {
@@ -48512,6 +48550,7 @@ async function measureParagraphBlock(block, maxWidth) {
48512
48550
  tabStopCursor = 0;
48513
48551
  pendingTabAlignment = null;
48514
48552
  lastAppliedTabAlign = null;
48553
+ pendingRunSpacing = 0;
48515
48554
  continue;
48516
48555
  }
48517
48556
  if (isTabRun(run)) {
@@ -48577,6 +48616,7 @@ async function measureParagraphBlock(block, maxWidth) {
48577
48616
  } else {
48578
48617
  pendingTabAlignment = null;
48579
48618
  }
48619
+ pendingRunSpacing = 0;
48580
48620
  continue;
48581
48621
  }
48582
48622
  if (isImageRun(run)) {
@@ -48615,6 +48655,7 @@ async function measureParagraphBlock(block, maxWidth) {
48615
48655
  }
48616
48656
  ]
48617
48657
  };
48658
+ pendingRunSpacing = 0;
48618
48659
  if (activeTabGroup && runIndex + 1 >= activeTabGroup.measure.endRunIndex) {
48619
48660
  activeTabGroup = null;
48620
48661
  }
@@ -48676,6 +48717,7 @@ async function measureParagraphBlock(block, maxWidth) {
48676
48717
  currentLine.width = roundValue(tabAlign.target);
48677
48718
  }
48678
48719
  lastAppliedTabAlign = null;
48720
+ pendingRunSpacing = 0;
48679
48721
  continue;
48680
48722
  }
48681
48723
  if (isFieldAnnotationRun(run)) {
@@ -48715,6 +48757,7 @@ async function measureParagraphBlock(block, maxWidth) {
48715
48757
  }
48716
48758
  ]
48717
48759
  };
48760
+ pendingRunSpacing = 0;
48718
48761
  continue;
48719
48762
  }
48720
48763
  if (currentLine.width + annotationWidth > currentLine.maxWidth && currentLine.width > 0) {
@@ -48767,9 +48810,11 @@ async function measureParagraphBlock(block, maxWidth) {
48767
48810
  currentLine.width = roundValue(tabAlign.target);
48768
48811
  }
48769
48812
  lastAppliedTabAlign = null;
48813
+ pendingRunSpacing = 0;
48770
48814
  continue;
48771
48815
  }
48772
48816
  if (!("text" in run) || !("fontSize" in run)) {
48817
+ pendingRunSpacing = 0;
48773
48818
  continue;
48774
48819
  }
48775
48820
  lastFontSize = run.fontSize;
@@ -48780,6 +48825,7 @@ async function measureParagraphBlock(block, maxWidth) {
48780
48825
  const segment = tabSegments[segmentIndex];
48781
48826
  const isLastSegment = segmentIndex === tabSegments.length - 1;
48782
48827
  if (/^[ ]+$/.test(segment)) {
48828
+ const isRunStart = charPosInRun === 0 && segmentIndex === 0;
48783
48829
  const spacesLength = segment.length;
48784
48830
  const spacesStartChar = charPosInRun;
48785
48831
  const spacesEndChar = charPosInRun + spacesLength;
@@ -48798,7 +48844,7 @@ async function measureParagraphBlock(block, maxWidth) {
48798
48844
  spaceCount: spacesLength
48799
48845
  };
48800
48846
  } else {
48801
- const boundarySpacing = currentLine.width > 0 ? run.letterSpacing ?? 0 : 0;
48847
+ const boundarySpacing = resolveBoundarySpacing(currentLine.width, isRunStart, run);
48802
48848
  if (currentLine.width + boundarySpacing + spacesWidth > currentLine.maxWidth - WIDTH_FUDGE_PX2 && currentLine.width > 0) {
48803
48849
  trimTrailingWrapSpaces(currentLine);
48804
48850
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
@@ -48862,6 +48908,7 @@ async function measureParagraphBlock(block, maxWidth) {
48862
48908
  const spaceStartChar = charPosInRun;
48863
48909
  const spaceEndChar = charPosInRun + 1;
48864
48910
  const singleSpaceWidth = measureRunWidth(" ", font, ctx2, run, spaceStartChar);
48911
+ const isRunStart2 = charPosInRun === 0 && segmentIndex === 0 && wordIndex === 0;
48865
48912
  if (!currentLine) {
48866
48913
  currentLine = {
48867
48914
  fromRun: runIndex,
@@ -48876,7 +48923,7 @@ async function measureParagraphBlock(block, maxWidth) {
48876
48923
  spaceCount: 1
48877
48924
  };
48878
48925
  } else {
48879
- const boundarySpacing2 = currentLine.width > 0 ? run.letterSpacing ?? 0 : 0;
48926
+ const boundarySpacing2 = resolveBoundarySpacing(currentLine.width, isRunStart2, run);
48880
48927
  if (currentLine.width + boundarySpacing2 + singleSpaceWidth > currentLine.maxWidth - WIDTH_FUDGE_PX2 && currentLine.width > 0) {
48881
48928
  trimTrailingWrapSpaces(currentLine);
48882
48929
  const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
@@ -49061,7 +49108,8 @@ async function measureParagraphBlock(block, maxWidth) {
49061
49108
  continue;
49062
49109
  }
49063
49110
  const isTocEntry = block.attrs?.isTocEntry;
49064
- const boundarySpacing = currentLine.width > 0 ? run.letterSpacing ?? 0 : 0;
49111
+ const isRunStart = charPosInRun === 0 && segmentIndex === 0 && wordIndex === 0;
49112
+ const boundarySpacing = resolveBoundarySpacing(currentLine.width, isRunStart, run);
49065
49113
  const justifyAlignment = block.attrs?.alignment === "justify";
49066
49114
  const totalWidthWithWord = currentLine.width + boundarySpacing + wordCommitWidth + // Safe cast: only TextRuns produce word segments from split(), other run types are handled earlier
49067
49115
  (shouldIncludeDelimiterSpace ? run.letterSpacing ?? 0 : 0);
@@ -49229,6 +49277,7 @@ async function measureParagraphBlock(block, maxWidth) {
49229
49277
  }
49230
49278
  }
49231
49279
  }
49280
+ pendingRunSpacing = run.letterSpacing ?? 0;
49232
49281
  }
49233
49282
  if (!currentLine && lines.length === 0) {
49234
49283
  const uiDisplayFallbackFontSize = (block.runs[0]?.kind === "text" ? block.runs[0].fontSize : void 0) ?? 12;
@@ -50032,6 +50081,7 @@ class PresentationEditor extends EventEmitter {
50032
50081
  #dragLastPointer = null;
50033
50082
  #dragLastRawHit = null;
50034
50083
  #dragUsedPageNotMountedFallback = false;
50084
+ #suppressFocusInFromDraggable = false;
50035
50085
  // Cell selection drag state
50036
50086
  // Tracks cell-specific context when drag starts in a table for multi-cell selection
50037
50087
  #cellAnchor = null;
@@ -52015,6 +52065,7 @@ class PresentationEditor extends EventEmitter {
52015
52065
  return;
52016
52066
  }
52017
52067
  const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
52068
+ this.#suppressFocusInFromDraggable = isDraggableAnnotation;
52018
52069
  if (!this.#layoutState.layout) {
52019
52070
  if (!isDraggableAnnotation) {
52020
52071
  event.preventDefault();
@@ -52771,6 +52822,10 @@ class PresentationEditor extends EventEmitter {
52771
52822
  if (isInRegisteredSurface(event)) {
52772
52823
  return;
52773
52824
  }
52825
+ if (this.#suppressFocusInFromDraggable) {
52826
+ this.#suppressFocusInFromDraggable = false;
52827
+ return;
52828
+ }
52774
52829
  const target = event.target;
52775
52830
  const activeTarget = this.#getActiveDomTarget();
52776
52831
  if (!activeTarget) {
@@ -52797,6 +52852,7 @@ class PresentationEditor extends EventEmitter {
52797
52852
  }
52798
52853
  };
52799
52854
  #handlePointerUp = (event) => {
52855
+ this.#suppressFocusInFromDraggable = false;
52800
52856
  if (!this.#isDragging) return;
52801
52857
  if (typeof this.#viewportHost.hasPointerCapture === "function" && typeof this.#viewportHost.releasePointerCapture === "function" && this.#viewportHost.hasPointerCapture(event.pointerId)) {
52802
52858
  this.#viewportHost.releasePointerCapture(event.pointerId);
@@ -60544,16 +60600,7 @@ const Table = Node$1.create({
60544
60600
  * @param {import("./tableHelpers/createTableBorders.js").TableBorders} [borders] - Border styling for this table
60545
60601
  */
60546
60602
  borders: {
60547
- default: {},
60548
- renderDOM({ borders }) {
60549
- if (!borders) return {};
60550
- const style2 = Object.entries(borders).reduce((acc, [key2, { size: size2, color }]) => {
60551
- return `${acc}border-${key2}: ${Math.ceil(size2)}px solid ${color || "black"};`;
60552
- }, "");
60553
- return {
60554
- style: style2
60555
- };
60556
- }
60603
+ default: {}
60557
60604
  },
60558
60605
  /**
60559
60606
  * @category Attribute