@superdoc-dev/mcp 0.10.0-next.10 → 0.10.0-next.11

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 +39 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -211378,7 +211378,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
211378
211378
  init_remark_gfm_BhnWr3yf_es();
211379
211379
  });
211380
211380
 
211381
- // ../../packages/superdoc/dist/chunks/src-DxXn8f3n.es.js
211381
+ // ../../packages/superdoc/dist/chunks/src-BmITdkcx.es.js
211382
211382
  function deleteProps(obj, propOrProps) {
211383
211383
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
211384
211384
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -308429,7 +308429,7 @@ menclose::after {
308429
308429
  return;
308430
308430
  console.log(...args$1);
308431
308431
  }, 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, TRACKED_MARK_NAMES;
308432
- var init_src_DxXn8f3n_es = __esm(() => {
308432
+ var init_src_BmITdkcx_es = __esm(() => {
308433
308433
  init_rolldown_runtime_Bg48TavK_es();
308434
308434
  init_SuperConverter_C6hKp29w_es();
308435
308435
  init_jszip_C49i9kUs_es();
@@ -326698,8 +326698,13 @@ function print() { __p += __j.call(arguments, '') }
326698
326698
  if (dispatch)
326699
326699
  dispatch(tr);
326700
326700
  const presentationEditor = editor.presentationEditor;
326701
- if (!(presentationEditor?.scrollToPosition?.(from$1, { block: "center" }) ?? false)) {
326702
- Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, { block: "center" })).catch(() => {});
326701
+ const scrollOpts = {
326702
+ block: "center",
326703
+ ifNeeded: true,
326704
+ suppressSelectionSyncScroll: true
326705
+ };
326706
+ if (!(presentationEditor?.scrollToPosition?.(from$1, scrollOpts) ?? false)) {
326707
+ Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, scrollOpts)).catch(() => {});
326703
326708
  const { node: node2 } = editor.view.domAtPos(from$1);
326704
326709
  if (node2?.scrollIntoView)
326705
326710
  node2.scrollIntoView({
@@ -336559,6 +336564,7 @@ function print() { __p += __j.call(arguments, '') }
336559
336564
  #isRerendering = false;
336560
336565
  #selectionSync = new SelectionSyncCoordinator;
336561
336566
  #shouldScrollSelectionIntoView = false;
336567
+ #suppressSelectionScrollUntilRaf = false;
336562
336568
  #dragDropIndicatorPos = null;
336563
336569
  #epochMapper = new EpochPositionMapper;
336564
336570
  #layoutEpoch = 0;
@@ -338231,6 +338237,19 @@ function print() { __p += __j.call(arguments, '') }
338231
338237
  }
338232
338238
  return null;
338233
338239
  }
338240
+ #isElementFullyVisibleInScrollContainer(el) {
338241
+ const rect = el.getBoundingClientRect();
338242
+ const viewport$1 = this.#scrollContainer instanceof Window ? {
338243
+ top: 0,
338244
+ bottom: this.#scrollContainer.innerHeight
338245
+ } : this.#scrollContainer instanceof Element ? this.#scrollContainer.getBoundingClientRect() : this.#visibleHost?.ownerDocument?.defaultView ? {
338246
+ top: 0,
338247
+ bottom: this.#visibleHost.ownerDocument.defaultView.innerHeight
338248
+ } : null;
338249
+ if (!viewport$1)
338250
+ return false;
338251
+ return rect.top >= viewport$1.top && rect.bottom <= viewport$1.bottom;
338252
+ }
338234
338253
  scrollToPosition(pos, options = {}) {
338235
338254
  if (this.#focusScrollRafId != null) {
338236
338255
  const win = this.#visibleHost.ownerDocument?.defaultView;
@@ -338245,7 +338264,7 @@ function print() { __p += __j.call(arguments, '') }
338245
338264
  return false;
338246
338265
  const clampedPos = Math.max(0, Math.min(pos, doc$12.content.size));
338247
338266
  const behavior = options.behavior ?? "auto";
338248
- const block = options.block ?? "center";
338267
+ const requestedBlock = options.block ?? "center";
338249
338268
  const layout = this.#layoutState.layout;
338250
338269
  const sessionMode = this.#headerFooterSession?.session?.mode ?? "body";
338251
338270
  if (layout && sessionMode === "body") {
@@ -338265,7 +338284,9 @@ function print() { __p += __j.call(arguments, '') }
338265
338284
  if (pageIndex != null) {
338266
338285
  const pageEl = getPageElementByIndex(this.#viewportHost, pageIndex);
338267
338286
  if (pageEl) {
338268
- const elToScroll = this.#findElementAtPosition(pageEl, clampedPos) ?? pageEl;
338287
+ const targetEl = this.#findElementAtPosition(pageEl, clampedPos);
338288
+ const elToScroll = targetEl ?? pageEl;
338289
+ const block = options.ifNeeded && targetEl && this.#isElementFullyVisibleInScrollContainer(targetEl) ? "nearest" : requestedBlock;
338269
338290
  elToScroll.scrollIntoView({
338270
338291
  block,
338271
338292
  inline: "nearest",
@@ -338273,7 +338294,9 @@ function print() { __p += __j.call(arguments, '') }
338273
338294
  });
338274
338295
  this.#shouldScrollSelectionIntoView = false;
338275
338296
  const win = this.#visibleHost.ownerDocument?.defaultView;
338276
- if (win)
338297
+ if (win) {
338298
+ if (options.suppressSelectionSyncScroll)
338299
+ this.#suppressSelectionScrollUntilRaf = true;
338277
338300
  win.requestAnimationFrame(() => {
338278
338301
  elToScroll.scrollIntoView({
338279
338302
  block,
@@ -338281,7 +338304,9 @@ function print() { __p += __j.call(arguments, '') }
338281
338304
  behavior
338282
338305
  });
338283
338306
  this.#shouldScrollSelectionIntoView = false;
338307
+ this.#suppressSelectionScrollUntilRaf = false;
338284
338308
  });
338309
+ }
338285
338310
  return true;
338286
338311
  }
338287
338312
  }
@@ -338415,7 +338440,10 @@ function print() { __p += __j.call(arguments, '') }
338415
338440
  console.warn(`[PresentationEditor] scrollToPositionAsync: Page ${pageIndex} failed to mount within timeout`);
338416
338441
  return false;
338417
338442
  }
338418
- return this.scrollToPosition(pos, options);
338443
+ return this.scrollToPosition(pos, {
338444
+ ...options,
338445
+ ifNeeded: false
338446
+ });
338419
338447
  }
338420
338448
  async scrollContentControlIntoView(entityId, options = {}) {
338421
338449
  const pos = this.#resolveContentControlCaretPos(entityId);
@@ -340689,6 +340717,8 @@ function print() { __p += __j.call(arguments, '') }
340689
340717
  }
340690
340718
  }
340691
340719
  #scrollActiveEndIntoView(pageIndex) {
340720
+ if (this.#suppressSelectionScrollUntilRaf)
340721
+ return;
340692
340722
  if (!!!this.#painterHost.querySelector(`[data-page-index="${pageIndex}"]`)) {
340693
340723
  this.#scrollPageIntoView(pageIndex);
340694
340724
  return;
@@ -342861,7 +342891,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
342861
342891
 
342862
342892
  // ../../packages/superdoc/dist/super-editor.es.js
342863
342893
  var init_super_editor_es = __esm(() => {
342864
- init_src_DxXn8f3n_es();
342894
+ init_src_BmITdkcx_es();
342865
342895
  init_SuperConverter_C6hKp29w_es();
342866
342896
  init_jszip_C49i9kUs_es();
342867
342897
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.10.0-next.10",
3
+ "version": "0.10.0-next.11",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"