@superdoc-dev/mcp 0.3.0-next.20 → 0.3.0-next.21

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 +71 -49
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -198749,7 +198749,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
198749
198749
  init_remark_gfm_BhnWr3yf_es();
198750
198750
  });
198751
198751
 
198752
- // ../../packages/superdoc/dist/chunks/src-pzodLUJ-.es.js
198752
+ // ../../packages/superdoc/dist/chunks/src-BA9o3DfT.es.js
198753
198753
  function deleteProps(obj, propOrProps) {
198754
198754
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
198755
198755
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -198811,21 +198811,35 @@ function computeTabStops$1(context) {
198811
198811
  const hanging = paragraphIndent.hanging ?? 0;
198812
198812
  const effectiveMinIndent = Math.max(0, leftIndent - hanging);
198813
198813
  const clearPositions = explicitStops.filter((stop) => stop.val === "clear").map((stop) => stop.pos);
198814
- const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent);
198814
+ const filteredExplicitStops = explicitStops.filter((stop) => stop.val !== "clear").filter((stop) => stop.pos >= effectiveMinIndent).map((stop) => ({
198815
+ ...stop,
198816
+ source: "explicit"
198817
+ }));
198815
198818
  const maxExplicit = filteredExplicitStops.reduce((max$2, stop) => Math.max(max$2, stop.pos), 0);
198816
198819
  const stops = [...filteredExplicitStops];
198817
- const defaultStart = !filteredExplicitStops.some((stop) => stop.val === "start") ? 0 : Math.max(maxExplicit, leftIndent);
198820
+ const hasStartAlignedExplicit = filteredExplicitStops.some((stop) => stop.val === "start");
198821
+ const hasExplicitStops = filteredExplicitStops.length > 0;
198822
+ const hasClearAtLeftIndent = clearPositions.some((clearPos) => Math.abs(clearPos - leftIndent) < TAB_POSITION_TOLERANCE_TWIPS);
198823
+ if (!hasExplicitStops && !hasClearAtLeftIndent && hanging > 0 && leftIndent > effectiveMinIndent)
198824
+ stops.push({
198825
+ val: "start",
198826
+ pos: leftIndent,
198827
+ leader: "none",
198828
+ source: "default"
198829
+ });
198830
+ const defaultStart = !hasStartAlignedExplicit ? 0 : Math.max(maxExplicit, leftIndent);
198818
198831
  let pos = defaultStart;
198819
198832
  const targetLimit = Math.max(defaultStart, leftIndent, maxExplicit) + 14400;
198820
198833
  while (pos < targetLimit) {
198821
198834
  pos += defaultTabInterval;
198822
- const hasExplicitStop = filteredExplicitStops.some((s2) => Math.abs(s2.pos - pos) < 20);
198823
- const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) < 20);
198824
- if (!hasExplicitStop && !hasClearStop && pos >= leftIndent)
198835
+ const hasExistingStop = stops.some((s2) => Math.abs(s2.pos - pos) < TAB_POSITION_TOLERANCE_TWIPS);
198836
+ const hasClearStop = clearPositions.some((clearPos) => Math.abs(clearPos - pos) < TAB_POSITION_TOLERANCE_TWIPS);
198837
+ if (!hasExistingStop && !hasClearStop && pos >= leftIndent)
198825
198838
  stops.push({
198826
198839
  val: "start",
198827
198840
  pos,
198828
- leader: "none"
198841
+ leader: "none",
198842
+ source: "default"
198829
198843
  });
198830
198844
  }
198831
198845
  return stops.sort((a2, b$1) => a2.pos - b$1.pos);
@@ -199037,12 +199051,13 @@ function getFragmentZIndex(block) {
199037
199051
  return resolveFloatingZIndex(block.anchor?.behindDoc === true, raw);
199038
199052
  }
199039
199053
  function shouldApplyJustify(params$1) {
199040
- const { alignment: alignment$1, hasExplicitPositioning, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride } = params$1;
199054
+ const { alignment: alignment$1, hasExplicitPositioning, hasExplicitTabStops, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride } = params$1;
199055
+ const lineHasExplicitTabStops = hasExplicitTabStops ?? hasExplicitPositioning ?? false;
199041
199056
  if (alignment$1 !== "justify" && alignment$1 !== "both")
199042
199057
  return false;
199043
199058
  if (skipJustifyOverride === true)
199044
199059
  return false;
199045
- if (hasExplicitPositioning)
199060
+ if (lineHasExplicitTabStops)
199046
199061
  return false;
199047
199062
  if (isLastLineOfParagraph && !paragraphEndsWithLineBreak)
199048
199063
  return false;
@@ -249468,7 +249483,12 @@ function sliceRunsForLine(block, line) {
249468
249483
  function measureCharacterX(block, line, charOffset, availableWidthOverride, alignmentOverride) {
249469
249484
  const ctx$1 = getMeasurementContext();
249470
249485
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
249471
- const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride, undefined, undefined, lineContainsManualTabWithoutSegments(block, line));
249486
+ const justify = getJustifyAdjustment({
249487
+ block,
249488
+ line,
249489
+ availableWidthOverride: availableWidth,
249490
+ alignmentOverride
249491
+ });
249472
249492
  const alignment$1 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : undefined);
249473
249493
  const renderedLineWidth = alignment$1 === "justify" && justify.extraPerSpace !== 0 ? availableWidth : line.width;
249474
249494
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
@@ -249600,7 +249620,12 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
249600
249620
  function findCharacterAtX(block, line, x, pmStart, availableWidthOverride, alignmentOverride) {
249601
249621
  const ctx$1 = getMeasurementContext();
249602
249622
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
249603
- const justify = getJustifyAdjustment(block, line, availableWidth, alignmentOverride, undefined, undefined, lineContainsManualTabWithoutSegments(block, line));
249623
+ const justify = getJustifyAdjustment({
249624
+ block,
249625
+ line,
249626
+ availableWidthOverride: availableWidth,
249627
+ alignmentOverride
249628
+ });
249604
249629
  const alignment$1 = alignmentOverride ?? (block.kind === "paragraph" ? block.attrs?.alignment : undefined);
249605
249630
  const renderedLineWidth = alignment$1 === "justify" ? line.width + Math.max(0, availableWidth - line.width) : line.width;
249606
249631
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
@@ -258951,6 +258976,8 @@ async function measureParagraphBlock(block, maxWidth) {
258951
258976
  const clampedTarget = Math.min(target, maxAbsWidth);
258952
258977
  const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
258953
258978
  currentLine.width = roundValue(currentLine.width + tabAdvance);
258979
+ if (stop?.source === "explicit")
258980
+ currentLine.hasExplicitTabStops = true;
258954
258981
  run2.width = tabAdvance;
258955
258982
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lastFontSize);
258956
258983
  currentLine.toRun = runIndex;
@@ -259709,6 +259736,8 @@ async function measureParagraphBlock(block, maxWidth) {
259709
259736
  const clampedTarget = Math.min(target, maxAbsWidth);
259710
259737
  const tabAdvance = Math.max(0, clampedTarget - absCurrentX);
259711
259738
  currentLine.width = roundValue(currentLine.width + tabAdvance);
259739
+ if (stop?.source === "explicit")
259740
+ currentLine.hasExplicitTabStops = true;
259712
259741
  currentLine.maxFontInfo = updateMaxFontInfo(currentLine.maxFontSize, currentLine.maxFontInfo, run2);
259713
259742
  currentLine.maxFontSize = Math.max(currentLine.maxFontSize, lineHeightFontSize(run2));
259714
259743
  currentLine.toRun = runIndex;
@@ -260797,7 +260826,7 @@ var Node$13 = class Node$14 {
260797
260826
  "iPhone",
260798
260827
  "iPod"
260799
260828
  ].includes(navigator.platform);
260800
- }, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX$3 = 15, isPlainObject$7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run2) => {
260829
+ }, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX$3 = 15, isPlainObject$7 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run2) => {
260801
260830
  if (!run2 || typeof run2 !== "object")
260802
260831
  return false;
260803
260832
  return typeof run2.src === "string";
@@ -265412,20 +265441,23 @@ var Node$13 = class Node$14 {
265412
265441
  segments,
265413
265442
  ranges: []
265414
265443
  };
265444
+ const sorted = [...segments].sort((a2, b$1) => a2.from - b$1.from);
265415
265445
  const ranges = [];
265416
- let active = null;
265417
- segments.forEach((seg) => {
265418
- if (!active) {
265419
- active = {
265420
- from: seg.from,
265421
- to: seg.to,
265422
- internal: !!seg.attrs?.internal
265423
- };
265424
- return;
265425
- }
265446
+ let active = {
265447
+ from: sorted[0].from,
265448
+ to: sorted[0].to,
265449
+ internal: !!sorted[0].attrs?.internal
265450
+ };
265451
+ for (let i4 = 1;i4 < sorted.length; i4 += 1) {
265452
+ const seg = sorted[i4];
265426
265453
  if (seg.from <= active.to) {
265427
- active.to = Math.max(active.to, seg.to);
265428
- return;
265454
+ if (seg.to > active.to)
265455
+ active.to = seg.to;
265456
+ continue;
265457
+ }
265458
+ if (!(doc$12.textBetween(active.to, seg.from, "", "").length > 0)) {
265459
+ active.to = seg.to;
265460
+ continue;
265429
265461
  }
265430
265462
  ranges.push(active);
265431
265463
  active = {
@@ -265433,9 +265465,8 @@ var Node$13 = class Node$14 {
265433
265465
  to: seg.to,
265434
265466
  internal: !!seg.attrs?.internal
265435
265467
  };
265436
- });
265437
- if (active)
265438
- ranges.push(active);
265468
+ }
265469
+ ranges.push(active);
265439
265470
  return {
265440
265471
  segments,
265441
265472
  ranges
@@ -281157,19 +281188,6 @@ menclose::after {
281157
281188
  return false;
281158
281189
  const code7 = char.charCodeAt(0);
281159
281190
  return code7 >= 48 && code7 <= 57 || code7 >= 65 && code7 <= 90 || code7 >= 97 && code7 <= 122 || char === "'";
281160
- }, lineContainsManualTabWithoutSegments = (block, line) => {
281161
- if (block.kind !== "paragraph")
281162
- return false;
281163
- if (line.segments?.some((seg) => seg.x !== undefined))
281164
- return false;
281165
- const fromRun = line.fromRun ?? 0;
281166
- const toRun = line.toRun ?? fromRun;
281167
- for (let runIndex = fromRun;runIndex <= toRun; runIndex += 1) {
281168
- const run2 = block.runs[runIndex];
281169
- if (run2 && isTabRun$1(run2))
281170
- return true;
281171
- }
281172
- return false;
281173
281191
  }, capitalizeText$3 = (text5) => {
281174
281192
  if (!text5)
281175
281193
  return text5;
@@ -281196,7 +281214,7 @@ menclose::after {
281196
281214
  if (SPACE_CHARS$1.has(text5[i4]))
281197
281215
  spaces += 1;
281198
281216
  return spaces;
281199
- }, getJustifyAdjustment = (block, line, availableWidthOverride, alignmentOverride, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride) => {
281217
+ }, getJustifyAdjustment = ({ block, line, availableWidthOverride, alignmentOverride, isLastLineOfParagraph, paragraphEndsWithLineBreak, skipJustifyOverride }) => {
281200
281218
  if (block.kind !== "paragraph")
281201
281219
  return {
281202
281220
  extraPerSpace: 0,
@@ -281208,7 +281226,6 @@ menclose::after {
281208
281226
  totalSpaces: 0
281209
281227
  };
281210
281228
  const alignment$1 = alignmentOverride ?? block.attrs?.alignment;
281211
- const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined) ?? false;
281212
281229
  const lastRunIndex = block.runs.length - 1;
281213
281230
  const lastRun = block.runs[lastRunIndex];
281214
281231
  const lastRunLength = getRunCharacterLength(lastRun);
@@ -281216,7 +281233,8 @@ menclose::after {
281216
281233
  const derivedEndsWithLineBreak = lastRun ? lastRun.kind === "lineBreak" : false;
281217
281234
  if (!shouldApplyJustify({
281218
281235
  alignment: alignment$1,
281219
- hasExplicitPositioning,
281236
+ hasExplicitPositioning: line.segments?.some((seg) => seg.x !== undefined) ?? false,
281237
+ hasExplicitTabStops: line.hasExplicitTabStops === true,
281220
281238
  isLastLineOfParagraph: isLastLineOfParagraph ?? derivedIsLastLine,
281221
281239
  paragraphEndsWithLineBreak: paragraphEndsWithLineBreak ?? derivedEndsWithLineBreak,
281222
281240
  skipJustifyOverride
@@ -282018,7 +282036,8 @@ menclose::after {
282018
282036
  }).map((stop) => ({
282019
282037
  pos: twipsToPx$1(stop.pos),
282020
282038
  val: stop.val,
282021
- leader: stop.leader
282039
+ leader: stop.leader,
282040
+ source: stop.source
282022
282041
  }));
282023
282042
  }, getNextTabStopPx$1 = (currentX, tabStops, startIndex) => {
282024
282043
  let index2 = startIndex;
@@ -282208,6 +282227,8 @@ menclose::after {
282208
282227
  const clampedTarget = Number.isFinite(maxAbsWidth) ? Math.min(target, maxAbsWidth) : target;
282209
282228
  const relativeTarget = clampedTarget - effectiveIndent;
282210
282229
  lineWidth = Math.max(lineWidth, relativeTarget);
282230
+ if (stop?.source === "explicit")
282231
+ line.hasExplicitTabStops = true;
282211
282232
  let currentLeader = null;
282212
282233
  if (stop?.leader && stop.leader !== "none") {
282213
282234
  currentLeader = {
@@ -288298,7 +288319,8 @@ menclose::after {
288298
288319
  }).map((stop) => ({
288299
288320
  pos: twipsToPx(stop.pos),
288300
288321
  val: stop.val,
288301
- leader: stop.leader
288322
+ leader: stop.leader,
288323
+ source: stop.source
288302
288324
  }));
288303
288325
  }, getNextTabStopPx = (currentX, tabStops, startIndex) => {
288304
288326
  let index2 = startIndex;
@@ -289956,7 +289978,7 @@ menclose::after {
289956
289978
  return;
289957
289979
  console.log(...args$1);
289958
289980
  }, 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;
289959
- var init_src_pzodLUJ_es = __esm(() => {
289981
+ var init_src_BA9o3DfT_es = __esm(() => {
289960
289982
  init_rolldown_runtime_Bg48TavK_es();
289961
289983
  init_SuperConverter_DklB_kc9_es();
289962
289984
  init_jszip_C49i9kUs_es();
@@ -319900,14 +319922,14 @@ function print() { __p += __j.call(arguments, '') }
319900
319922
  el.appendChild(barEl);
319901
319923
  });
319902
319924
  const hasExplicitPositioning = line.segments?.some((seg) => seg.x !== undefined);
319903
- const manualTabWithoutSegments = runsForLine.some((run2) => run2.kind === "tab") && !hasExplicitPositioning;
319904
319925
  const availableWidth = availableWidthOverride ?? line.maxWidth ?? line.width;
319905
319926
  const justifyShouldApply = shouldApplyJustify({
319906
319927
  alignment: block.attrs?.alignment,
319907
319928
  hasExplicitPositioning: hasExplicitPositioning ?? false,
319929
+ hasExplicitTabStops: line.hasExplicitTabStops === true,
319908
319930
  isLastLineOfParagraph: false,
319909
319931
  paragraphEndsWithLineBreak: false,
319910
- skipJustifyOverride: skipJustify || manualTabWithoutSegments
319932
+ skipJustifyOverride: skipJustify
319911
319933
  });
319912
319934
  const countSpaces$1 = (text5) => {
319913
319935
  let count = 0;
@@ -327368,7 +327390,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
327368
327390
 
327369
327391
  // ../../packages/superdoc/dist/super-editor.es.js
327370
327392
  var init_super_editor_es = __esm(() => {
327371
- init_src_pzodLUJ_es();
327393
+ init_src_BA9o3DfT_es();
327372
327394
  init_SuperConverter_DklB_kc9_es();
327373
327395
  init_jszip_C49i9kUs_es();
327374
327396
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.3.0-next.20",
3
+ "version": "0.3.0-next.21",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -20,8 +20,8 @@
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
22
  "@superdoc/document-api": "0.0.1",
23
- "@superdoc/super-editor": "0.0.1",
24
- "superdoc": "1.29.1"
23
+ "superdoc": "1.29.1",
24
+ "@superdoc/super-editor": "0.0.1"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"