@superdoc-dev/mcp 0.12.0-next.5 → 0.12.0-next.7

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 +50 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -222864,7 +222864,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
222864
222864
  init_remark_gfm_BhnWr3yf_es();
222865
222865
  });
222866
222866
 
222867
- // ../../packages/superdoc/dist/chunks/src-Btvk6jT1.es.js
222867
+ // ../../packages/superdoc/dist/chunks/src-BKOC1-8-.es.js
222868
222868
  function deleteProps(obj, propOrProps) {
222869
222869
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
222870
222870
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -274908,9 +274908,28 @@ function computeDomCaretPageLocal(options, pos) {
274908
274908
  const boundary = resolveTextBoundaryInElement(targetEl, pos, entry.pmStart, entry.pmEnd, "forward");
274909
274909
  if (!boundary) {
274910
274910
  const elRect = targetEl.getBoundingClientRect();
274911
+ if (targetEl.classList.contains("superdoc-line")) {
274912
+ const paddingLeft = parseFloat(targetEl.style.paddingLeft) || 0;
274913
+ const paddingRight = parseFloat(targetEl.style.paddingRight) || 0;
274914
+ const lineLeft = (elRect.left - pageRect.left) / zoom + paddingLeft;
274915
+ const lineRight = (elRect.right - pageRect.left) / zoom - paddingRight;
274916
+ const textAlign = targetEl.style.textAlign;
274917
+ let x;
274918
+ if (textAlign === "center")
274919
+ x = (lineLeft + lineRight) / 2;
274920
+ else if (textAlign === "right")
274921
+ x = lineRight;
274922
+ else
274923
+ x = lineLeft;
274924
+ return {
274925
+ pageIndex: Number(page.dataset.pageIndex ?? "0"),
274926
+ x,
274927
+ y: (elRect.top - pageRect.top) / zoom
274928
+ };
274929
+ }
274911
274930
  const isEmptySdtPlaceholder = targetEl.classList.contains("superdoc-empty-sdt-placeholder") || targetEl.classList.contains("superdoc-empty-inline-sdt-placeholder") || targetEl.classList.contains("superdoc-empty-block-sdt-placeholder");
274912
274931
  const atEnd = isEmptySdtPlaceholder ? pos > entry.pmEnd : pos >= entry.pmEnd;
274913
- const yRect = (isEmptySdtPlaceholder ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
274932
+ const yRect = (isEmptySdtPlaceholder || targetEl.classList.contains("superdoc-tab") ? targetEl.closest(".superdoc-line") : null)?.getBoundingClientRect() ?? elRect;
274914
274933
  return {
274915
274934
  pageIndex: Number(page.dataset.pageIndex ?? "0"),
274916
274935
  x: ((atEnd ? elRect.right : elRect.left) - pageRect.left) / zoom,
@@ -320173,7 +320192,7 @@ menclose::after {
320173
320192
  return;
320174
320193
  console.log(...args$1);
320175
320194
  }, 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;
320176
- var init_src_Btvk6jT1_es = __esm(() => {
320195
+ var init_src_BKOC1_8_es = __esm(() => {
320177
320196
  init_rolldown_runtime_Bg48TavK_es();
320178
320197
  init_SuperConverter_BaKhr4cp_es();
320179
320198
  init_jszip_C49i9kUs_es();
@@ -341422,7 +341441,8 @@ function print() { __p += __j.call(arguments, '') }
341422
341441
  const menuRef = exports_vue.ref(null);
341423
341442
  const menuPosition = exports_vue.ref({
341424
341443
  top: "0px",
341425
- left: "0px"
341444
+ left: "0px",
341445
+ maxHeight: "none"
341426
341446
  });
341427
341447
  const optionRefs = exports_vue.ref([]);
341428
341448
  const keyboardIndex = exports_vue.ref(-1);
@@ -341459,6 +341479,7 @@ function print() { __p += __j.call(arguments, '') }
341459
341479
  position: "fixed",
341460
341480
  top: menuPosition.value.top,
341461
341481
  left: menuPosition.value.left,
341482
+ maxHeight: menuPosition.value.maxHeight,
341462
341483
  zIndex: 2000
341463
341484
  };
341464
341485
  });
@@ -341474,17 +341495,30 @@ function print() { __p += __j.call(arguments, '') }
341474
341495
  if (!triggerRef.value)
341475
341496
  return;
341476
341497
  const rect = triggerRef.value.getBoundingClientRect();
341477
- const menuWidth = menuRef.value?.offsetWidth ?? 0;
341498
+ const menuEl = menuRef.value;
341499
+ const menuWidth = menuEl?.offsetWidth ?? 0;
341500
+ const menuHeight = menuEl?.scrollHeight ?? menuEl?.offsetHeight ?? 0;
341478
341501
  const viewportWidth = window.innerWidth || document.documentElement.clientWidth || 0;
341502
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
341479
341503
  const gutter = 8;
341504
+ const gap = 4;
341505
+ const belowTop = rect.bottom + gap;
341506
+ const aboveBottom = rect.top - gap;
341507
+ const availableBelow = Math.max(0, viewportHeight - belowTop - gutter);
341508
+ const availableAbove = Math.max(0, aboveBottom - gutter);
341509
+ const openAbove = availableBelow < menuHeight && availableAbove > availableBelow;
341510
+ const maxHeight = openAbove ? availableAbove : availableBelow;
341511
+ const menuRenderHeight = menuHeight ? Math.min(menuHeight, maxHeight) : maxHeight;
341512
+ const top$1 = openAbove ? Math.max(gutter, aboveBottom - menuRenderHeight) : belowTop;
341480
341513
  let left$1 = rect.left;
341481
341514
  if (props.placement === "bottom-end")
341482
341515
  left$1 = rect.right - menuWidth;
341483
341516
  const maxLeft = Math.max(gutter, viewportWidth - menuWidth - gutter);
341484
341517
  left$1 = Math.min(Math.max(gutter, left$1), maxLeft);
341485
341518
  menuPosition.value = {
341486
- top: `${rect.bottom + 4}px`,
341487
- left: `${left$1}px`
341519
+ top: `${top$1}px`,
341520
+ left: `${left$1}px`,
341521
+ maxHeight: `${maxHeight}px`
341488
341522
  };
341489
341523
  };
341490
341524
  const onTriggerClick = () => {
@@ -341550,8 +341584,13 @@ function print() { __p += __j.call(arguments, '') }
341550
341584
  el.setAttribute("tabindex", index2 === keyboardIndex.value ? "0" : "-1");
341551
341585
  });
341552
341586
  const target = optionRefs.value[keyboardIndex.value];
341553
- if (target && typeof target.focus === "function")
341587
+ if (target && typeof target.focus === "function") {
341554
341588
  target.focus();
341589
+ target.scrollIntoView?.({
341590
+ block: "nearest",
341591
+ inline: "nearest"
341592
+ });
341593
+ }
341555
341594
  };
341556
341595
  const moveKeyboardIndex = (direction) => {
341557
341596
  const navigableIndexes = getNavigableIndexes();
@@ -341686,6 +341725,7 @@ function print() { __p += __j.call(arguments, '') }
341686
341725
  if (hasRenderOptions.value)
341687
341726
  return;
341688
341727
  keyboardIndex.value = getInitialKeyboardIndex();
341728
+ await exports_vue.nextTick();
341689
341729
  focusKeyboardIndex();
341690
341730
  }, { immediate: true });
341691
341731
  exports_vue.watch(isOpen, (open) => {
@@ -341749,7 +341789,7 @@ function print() { __p += __j.call(arguments, '') }
341749
341789
  })]))]);
341750
341790
  };
341751
341791
  }
341752
- }, [["__scopeId", "data-v-302f7d86"]]);
341792
+ }, [["__scopeId", "data-v-69732782"]]);
341753
341793
  SdTooltip_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
341754
341794
  __name: "SdTooltip",
341755
341795
  props: {
@@ -355426,7 +355466,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
355426
355466
 
355427
355467
  // ../../packages/superdoc/dist/super-editor.es.js
355428
355468
  var init_super_editor_es = __esm(() => {
355429
- init_src_Btvk6jT1_es();
355469
+ init_src_BKOC1_8_es();
355430
355470
  init_SuperConverter_BaKhr4cp_es();
355431
355471
  init_jszip_C49i9kUs_es();
355432
355472
  init_xml_js_CqGKpaft_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.12.0-next.5",
3
+ "version": "0.12.0-next.7",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"