@superdoc-dev/mcp 0.12.0-next.7 → 0.12.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.
Files changed (2) hide show
  1. package/dist/index.js +212 -100
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -52172,7 +52172,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
52172
52172
  emptyOptions2 = {};
52173
52173
  });
52174
52174
 
52175
- // ../../packages/superdoc/dist/chunks/SuperConverter-BaKhr4cp.es.js
52175
+ // ../../packages/superdoc/dist/chunks/SuperConverter-e4tY-2EB.es.js
52176
52176
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
52177
52177
  const fieldValue = extension$1.config[field];
52178
52178
  if (typeof fieldValue === "function")
@@ -88738,12 +88738,14 @@ function applyTocMetadata(blocks, metadata) {
88738
88738
  };
88739
88739
  if (metadata.instruction)
88740
88740
  block.attrs.tocInstruction = metadata.instruction;
88741
+ if (metadata.tocId)
88742
+ block.attrs.tocId = metadata.tocId;
88741
88743
  }
88742
88744
  });
88743
88745
  }
88744
88746
  function processTocChildren(children, metadata, context, outputArrays) {
88745
88747
  const paragraphConverter = context.converters.paragraphToFlowBlocks;
88746
- const { docPartGallery, docPartObjectId, tocInstruction } = metadata;
88748
+ const { docPartGallery, docPartObjectId, tocInstruction, tocId } = metadata;
88747
88749
  const { blocks, recordBlockKind } = outputArrays;
88748
88750
  children.forEach((child) => {
88749
88751
  if (child.type === "paragraph") {
@@ -88768,7 +88770,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
88768
88770
  applyTocMetadata(paragraphBlocks, {
88769
88771
  gallery: docPartGallery,
88770
88772
  uniqueId: docPartObjectId,
88771
- instruction: tocInstruction
88773
+ instruction: tocInstruction,
88774
+ tocId
88772
88775
  });
88773
88776
  applySdtMetadataToParagraphBlocks(paragraphBlocks.filter((b) => b.kind === "paragraph"), metadata.sdtMetadata);
88774
88777
  paragraphBlocks.forEach((block) => {
@@ -88783,7 +88786,8 @@ function processTocChildren(children, metadata, context, outputArrays) {
88783
88786
  docPartGallery,
88784
88787
  docPartObjectId,
88785
88788
  tocInstruction: finalInstruction,
88786
- sdtMetadata: metadata.sdtMetadata
88789
+ sdtMetadata: metadata.sdtMetadata,
88790
+ tocId
88787
88791
  }, context, outputArrays);
88788
88792
  }
88789
88793
  });
@@ -88791,7 +88795,11 @@ function processTocChildren(children, metadata, context, outputArrays) {
88791
88795
  function handleTableOfContentsNode(node2, context) {
88792
88796
  if (!Array.isArray(node2.content))
88793
88797
  return;
88794
- processTocChildren(node2.content, { tocInstruction: getNodeInstruction(node2) }, {
88798
+ const sdBlockId = node2.attrs?.sdBlockId;
88799
+ processTocChildren(node2.content, {
88800
+ tocInstruction: getNodeInstruction(node2),
88801
+ tocId: typeof sdBlockId === "string" ? sdBlockId : undefined
88802
+ }, {
88795
88803
  nextBlockId: context.nextBlockId,
88796
88804
  positions: context.positions,
88797
88805
  bookmarks: context.bookmarks,
@@ -89120,7 +89128,8 @@ function processDocumentPartObject(child, sectionMetadata, context, output, conv
89120
89128
  docPartGallery,
89121
89129
  docPartObjectId,
89122
89130
  tocInstruction,
89123
- sdtMetadata: docPartSdtMetadata
89131
+ sdtMetadata: docPartSdtMetadata,
89132
+ tocId: docPartObjectId ?? undefined
89124
89133
  }, {
89125
89134
  nextBlockId: context.nextBlockId,
89126
89135
  positions: context.positions,
@@ -89191,12 +89200,15 @@ function handleDocumentPartObjectNode(node2, context) {
89191
89200
  const tocInstruction = getNodeInstruction(node2);
89192
89201
  const docPartSdtMetadata = resolveNodeSdtMetadata(node2, "docPartObject");
89193
89202
  const paragraphToFlowBlocks$1 = converters$1.paragraphToFlowBlocks;
89203
+ const sdBlockId = node2.attrs?.sdBlockId;
89204
+ const tocId = docPartObjectId && docPartObjectId.length > 0 ? docPartObjectId : typeof sdBlockId === "string" && sdBlockId.length > 0 ? sdBlockId : undefined;
89194
89205
  if (docPartGallery === "Table of Contents")
89195
89206
  processTocChildren(Array.from(node2.content), {
89196
89207
  docPartGallery,
89197
89208
  docPartObjectId,
89198
89209
  tocInstruction,
89199
- sdtMetadata: docPartSdtMetadata
89210
+ sdtMetadata: docPartSdtMetadata,
89211
+ tocId
89200
89212
  }, {
89201
89213
  nextBlockId,
89202
89214
  positions,
@@ -89244,7 +89256,8 @@ function handleDocumentPartObjectNode(node2, context) {
89244
89256
  docPartGallery: docPartGallery ?? "",
89245
89257
  docPartObjectId,
89246
89258
  tocInstruction: getNodeInstruction(child) ?? tocInstruction,
89247
- sdtMetadata: docPartSdtMetadata
89259
+ sdtMetadata: docPartSdtMetadata,
89260
+ tocId
89248
89261
  };
89249
89262
  const tocContext = {
89250
89263
  nextBlockId,
@@ -118037,7 +118050,7 @@ var isRegExp = (value) => {
118037
118050
  state.kern = kernNode.attributes["w:val"];
118038
118051
  }
118039
118052
  }, SuperConverter;
118040
- var init_SuperConverter_BaKhr4cp_es = __esm(() => {
118053
+ var init_SuperConverter_e4tY_2EB_es = __esm(() => {
118041
118054
  init_rolldown_runtime_Bg48TavK_es();
118042
118055
  init_jszip_C49i9kUs_es();
118043
118056
  init_xml_js_CqGKpaft_es();
@@ -157821,7 +157834,7 @@ var init_SuperConverter_BaKhr4cp_es = __esm(() => {
157821
157834
  };
157822
157835
  });
157823
157836
 
157824
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-B3wNa0zb.es.js
157837
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-3iIgFoKe.es.js
157825
157838
  function parseSizeUnit(val = "0") {
157826
157839
  const length = val.toString() || "0";
157827
157840
  const value = Number.parseFloat(length);
@@ -168179,8 +168192,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
168179
168192
  }
168180
168193
  };
168181
168194
  };
168182
- var init_create_headless_toolbar_B3wNa0zb_es = __esm(() => {
168183
- init_SuperConverter_BaKhr4cp_es();
168195
+ var init_create_headless_toolbar_3iIgFoKe_es = __esm(() => {
168196
+ init_SuperConverter_e4tY_2EB_es();
168184
168197
  init_uuid_B2wVPhPi_es();
168185
168198
  init_constants_D9qj59G2_es();
168186
168199
  init_dist_B8HfvhaK_es();
@@ -222864,7 +222877,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
222864
222877
  init_remark_gfm_BhnWr3yf_es();
222865
222878
  });
222866
222879
 
222867
- // ../../packages/superdoc/dist/chunks/src-BKOC1-8-.es.js
222880
+ // ../../packages/superdoc/dist/chunks/src-M0JgzZDj.es.js
222868
222881
  function deleteProps(obj, propOrProps) {
222869
222882
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
222870
222883
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -231958,9 +231971,6 @@ function replaceCommand(wrap4, moveForward) {
231958
231971
  return true;
231959
231972
  };
231960
231973
  }
231961
- function buildSdtBlockSelector(escapedSdtId) {
231962
- return `.${DOM_CLASS_NAMES.BLOCK_SDT}[${DATA_ATTRS.SDT_ID}="${escapedSdtId}"]`;
231963
- }
231964
231974
  function buildAnnotationSelector() {
231965
231975
  return `.${DOM_CLASS_NAMES.ANNOTATION}[${DATA_ATTRS.PM_START}]`;
231966
231976
  }
@@ -302032,6 +302042,7 @@ var Node$13 = class Node$14 {
302032
302042
  this.syncInlineStyleLayers(options.editorState, options.domPositionIndex);
302033
302043
  this.applyProofingAnnotations(options.proofingAnnotations, options.rebuildDomPositionIndex);
302034
302044
  options.reapplyStructuredContentHover?.();
302045
+ options.reapplyTocGroupHover?.();
302035
302046
  }
302036
302047
  destroy() {
302037
302048
  this.#proofingDecorator.clear();
@@ -302041,6 +302052,83 @@ var Node$13 = class Node$14 {
302041
302052
  this.#commentHighlightDecorator.destroy();
302042
302053
  this.#decorationBridge.destroy();
302043
302054
  }
302055
+ }, HoverGroupCoordinator = class {
302056
+ #spec;
302057
+ #current = null;
302058
+ constructor(spec) {
302059
+ this.handleMouseEnter = (event) => {
302060
+ const entry = event.target?.closest?.(this.#spec.entrySelector);
302061
+ if (!entry)
302062
+ return;
302063
+ const id2 = this.#spec.getId(entry);
302064
+ if (!id2)
302065
+ return;
302066
+ this.#set(id2);
302067
+ };
302068
+ this.handleMouseLeave = (event) => {
302069
+ const entry = event.target?.closest?.(this.#spec.entrySelector);
302070
+ if (!entry)
302071
+ return;
302072
+ const id2 = this.#spec.getId(entry);
302073
+ if (!id2)
302074
+ return;
302075
+ const relatedTarget = event.relatedTarget;
302076
+ if (relatedTarget) {
302077
+ const nextEntry = relatedTarget.closest?.(this.#spec.entrySelector);
302078
+ if (nextEntry && this.#spec.getId(nextEntry) === id2)
302079
+ return;
302080
+ }
302081
+ this.clear();
302082
+ };
302083
+ this.#spec = spec;
302084
+ }
302085
+ reapply() {
302086
+ if (!this.#current)
302087
+ return;
302088
+ const { id: id2 } = this.#current;
302089
+ const elements = this.#spec.queryGroup(id2);
302090
+ if (elements.length === 0) {
302091
+ this.#current = null;
302092
+ return;
302093
+ }
302094
+ this.#applyClass(elements);
302095
+ this.#spec.onApply?.(elements);
302096
+ this.#current = {
302097
+ id: id2,
302098
+ elements
302099
+ };
302100
+ }
302101
+ clear() {
302102
+ if (!this.#current)
302103
+ return;
302104
+ for (const element3 of this.#current.elements) {
302105
+ element3.classList.remove(this.#spec.hoverClass);
302106
+ this.#spec.onClear?.(element3);
302107
+ }
302108
+ this.#current = null;
302109
+ }
302110
+ #set(id2) {
302111
+ if (this.#current?.id === id2)
302112
+ return;
302113
+ this.clear();
302114
+ const elements = this.#spec.queryGroup(id2);
302115
+ if (elements.length === 0)
302116
+ return;
302117
+ this.#applyClass(elements);
302118
+ this.#spec.onApply?.(elements);
302119
+ this.#current = {
302120
+ id: id2,
302121
+ elements
302122
+ };
302123
+ }
302124
+ #applyClass(elements) {
302125
+ const filter = this.#spec.shouldApplyTo;
302126
+ for (const element3 of elements) {
302127
+ if (filter && !filter(element3))
302128
+ continue;
302129
+ element3.classList.add(this.#spec.hoverClass);
302130
+ }
302131
+ }
302044
302132
  }, ProofingStore = class {
302045
302133
  #issuesBySegment = /* @__PURE__ */ new Map;
302046
302134
  addIssue(issue2) {
@@ -302651,6 +302739,9 @@ var Node$13 = class Node$14 {
302651
302739
  color: inherit !important;
302652
302740
  text-decoration: none !important;
302653
302741
  cursor: default;
302742
+ /* Disable native link drag so our pointer loop can run text-selection. */
302743
+ -webkit-user-drag: none;
302744
+ user-drag: none;
302654
302745
  }
302655
302746
 
302656
302747
  .superdoc-toc-entry .superdoc-link:hover {
@@ -302662,6 +302753,31 @@ var Node$13 = class Node$14 {
302662
302753
  outline: none;
302663
302754
  }
302664
302755
 
302756
+ /* TOC hover. .toc-group-hover is set by PresentationEditor on every entry
302757
+ sharing a data-toc-id so the whole TOC greys out together. The ::after
302758
+ stripe (height set via --toc-gap-below) fills the paragraph-spacing gap
302759
+ between adjacent entries so the hover reads as one continuous block. */
302760
+ .superdoc-toc-entry:hover,
302761
+ .superdoc-toc-entry.toc-group-hover {
302762
+ background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
302763
+ }
302764
+
302765
+ /* Pointer-events stay on (default) so the stripe extends the parent entry's
302766
+ hit-test area through the paragraph-spacing gap. Without this, moving the
302767
+ cursor between two adjacent entries fires mouseout on the upper entry with
302768
+ relatedTarget = the page (not a TOC entry), the coordinator drops the
302769
+ group-hover class, and the grey disappears for a frame before the next
302770
+ entry's mouseover restores it — visible as a flicker. */
302771
+ .superdoc-toc-entry.toc-group-hover::after {
302772
+ content: '';
302773
+ position: absolute;
302774
+ left: 0;
302775
+ right: 0;
302776
+ top: 100%;
302777
+ height: var(--toc-gap-below, 0px);
302778
+ background-color: var(--sd-content-controls-block-hover-bg, #f2f2f2);
302779
+ }
302780
+
302665
302781
  /* Remove focus outlines from layout engine elements */
302666
302782
  .superdoc-layout,
302667
302783
  .superdoc-page,
@@ -306639,8 +306755,12 @@ menclose::after {
306639
306755
  applyResolvedFragmentFrame(fragmentEl, resolvedItem, fragment);
306640
306756
  else
306641
306757
  applyFragmentFrame(fragmentEl, fragment);
306642
- if (isTocEntry)
306643
- fragmentEl.classList.add("superdoc-toc-entry");
306758
+ if (isTocEntry) {
306759
+ fragmentEl.classList.add(DOM_CLASS_NAMES.TOC_ENTRY);
306760
+ const tocId = block.attrs?.tocId;
306761
+ if (typeof tocId === "string" && tocId.length > 0)
306762
+ fragmentEl.dataset.tocId = tocId;
306763
+ }
306644
306764
  if (paraContinuesFromPrev)
306645
306765
  fragmentEl.dataset.continuesFromPrev = "true";
306646
306766
  if (paraContinuesOnNext)
@@ -314835,6 +314955,7 @@ menclose::after {
314835
314955
  #cellAnchor = null;
314836
314956
  #cellDragMode = "none";
314837
314957
  #pendingMarginClick = null;
314958
+ #pendingTocLinkNav = null;
314838
314959
  #lastSelectedImageBlockId = null;
314839
314960
  #suppressFocusInFromDraggable = false;
314840
314961
  #pendingStructuredContentLabelGesture = null;
@@ -315376,10 +315497,14 @@ menclose::after {
315376
315497
  return;
315377
315498
  }
315378
315499
  const linkEl = target?.closest?.("a.superdoc-link");
315379
- if (linkEl) {
315380
- this.#handleLinkClick(event, linkEl);
315381
- return;
315382
- }
315500
+ this.#pendingTocLinkNav = null;
315501
+ if (linkEl)
315502
+ if (linkEl.closest(`.${DOM_CLASS_NAMES.TOC_ENTRY}`))
315503
+ this.#pendingTocLinkNav = linkEl;
315504
+ else {
315505
+ this.#handleLinkClick(event, linkEl);
315506
+ return;
315507
+ }
315383
315508
  const annotationEl = target?.closest?.(buildAnnotationSelector());
315384
315509
  const isDraggableAnnotation = target?.closest?.(DRAGGABLE_SELECTOR) != null;
315385
315510
  const isNativeDragSource = target?.closest?.(DRAG_SOURCE_SELECTOR) != null;
@@ -315718,6 +315843,10 @@ menclose::after {
315718
315843
  event
315719
315844
  });
315720
315845
  this.#suppressFocusInFromDraggable = false;
315846
+ const pendingTocLink = this.#pendingTocLinkNav;
315847
+ this.#pendingTocLinkNav = null;
315848
+ if (pendingTocLink && !this.#dragThresholdExceeded)
315849
+ this.#handleLinkClick(event, pendingTocLink);
315721
315850
  if (!this.#isDragging) {
315722
315851
  this.#stopAutoScroll();
315723
315852
  return;
@@ -320192,13 +320321,13 @@ menclose::after {
320192
320321
  return;
320193
320322
  console.log(...args$1);
320194
320323
  }, 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;
320195
- var init_src_BKOC1_8_es = __esm(() => {
320324
+ var init_src_M0JgzZDj_es = __esm(() => {
320196
320325
  init_rolldown_runtime_Bg48TavK_es();
320197
- init_SuperConverter_BaKhr4cp_es();
320326
+ init_SuperConverter_e4tY_2EB_es();
320198
320327
  init_jszip_C49i9kUs_es();
320199
320328
  init_xml_js_CqGKpaft_es();
320200
320329
  init_uuid_B2wVPhPi_es();
320201
- init_create_headless_toolbar_B3wNa0zb_es();
320330
+ init_create_headless_toolbar_3iIgFoKe_es();
320202
320331
  init_constants_D9qj59G2_es();
320203
320332
  init_dist_B8HfvhaK_es();
320204
320333
  init_unified_Dsuw2be5_es();
@@ -339128,6 +339257,8 @@ function print() { __p += __j.call(arguments, '') }
339128
339257
  TABLE_FRAGMENT: "superdoc-table-fragment",
339129
339258
  DOCUMENT_SECTION: "superdoc-document-section",
339130
339259
  SDT_GROUP_HOVER: "sdt-group-hover",
339260
+ TOC_ENTRY: "superdoc-toc-entry",
339261
+ TOC_GROUP_HOVER: "toc-group-hover",
339131
339262
  IMAGE_FRAGMENT: "superdoc-image-fragment",
339132
339263
  INLINE_IMAGE: "superdoc-inline-image",
339133
339264
  LIST_MARKER: "superdoc-list-marker",
@@ -348653,7 +348784,8 @@ function print() { __p += __j.call(arguments, '') }
348653
348784
  #lastSelectedFieldAnnotation = null;
348654
348785
  #lastSelectedStructuredContentBlock = null;
348655
348786
  #lastSelectedStructuredContentInline = null;
348656
- #lastHoveredStructuredContentBlock = null;
348787
+ #sdtHoverCoordinator = null;
348788
+ #tocHoverCoordinator = null;
348657
348789
  #remoteCursorManager = null;
348658
348790
  #cursorUpdateTimer = null;
348659
348791
  #remoteCursorOverlay = null;
@@ -348724,8 +348856,11 @@ function print() { __p += __j.call(arguments, '') }
348724
348856
  ensureEditorNativeSelectionStyles(doc$12);
348725
348857
  ensureEditorFieldAnnotationInteractionStyles(doc$12);
348726
348858
  ensureEditorMovableObjectInteractionStyles(doc$12);
348727
- this.#painterHost.addEventListener("mouseover", this.#handleStructuredContentBlockMouseEnter);
348728
- this.#painterHost.addEventListener("mouseout", this.#handleStructuredContentBlockMouseLeave);
348859
+ this.#initializeHoverCoordinators();
348860
+ this.#painterHost.addEventListener("mouseover", this.#sdtHoverCoordinator.handleMouseEnter);
348861
+ this.#painterHost.addEventListener("mouseout", this.#sdtHoverCoordinator.handleMouseLeave);
348862
+ this.#painterHost.addEventListener("mouseover", this.#tocHoverCoordinator.handleMouseEnter);
348863
+ this.#painterHost.addEventListener("mouseout", this.#tocHoverCoordinator.handleMouseLeave);
348729
348864
  this.#domIndexObserverManager = new DomPositionIndexObserverManager({
348730
348865
  windowRoot: this.#visibleHost?.ownerDocument?.defaultView ?? window,
348731
348866
  getPainterHost: () => this.#painterHost,
@@ -352716,74 +352851,50 @@ function print() { __p += __j.call(arguments, '') }
352716
352851
  }
352717
352852
  this.#setSelectedStructuredContentBlockClass(elements, id2);
352718
352853
  }
352719
- #handleStructuredContentBlockMouseEnter = (event) => {
352720
- const block = event.target.closest(`.${DOM_CLASS_NAMES.BLOCK_SDT}`);
352721
- if (!block || !(block instanceof HTMLElement))
352854
+ #initializeHoverCoordinators() {
352855
+ if (this.#sdtHoverCoordinator || this.#tocHoverCoordinator)
352722
352856
  return;
352723
- if (block.classList.contains("ProseMirror-selectednode"))
352857
+ this.#sdtHoverCoordinator = new HoverGroupCoordinator({
352858
+ entrySelector: `.${DOM_CLASS_NAMES.BLOCK_SDT}`,
352859
+ getId: (entry) => entry.dataset.sdtId,
352860
+ queryGroup: (id2) => this.#painterAdapter.getStructuredContentBlockElementsById(id2),
352861
+ hoverClass: DOM_CLASS_NAMES.SDT_GROUP_HOVER,
352862
+ shouldApplyTo: (element3) => !element3.classList.contains("ProseMirror-selectednode")
352863
+ });
352864
+ this.#tocHoverCoordinator = new HoverGroupCoordinator({
352865
+ entrySelector: `.${DOM_CLASS_NAMES.TOC_ENTRY}`,
352866
+ getId: (entry) => entry.dataset.tocId,
352867
+ queryGroup: (id2) => this.#queryTocEntryElementsById(id2),
352868
+ hoverClass: DOM_CLASS_NAMES.TOC_GROUP_HOVER,
352869
+ onApply: (elements) => this.#applyTocGapFill(elements),
352870
+ onClear: (element3) => element3.style.removeProperty("--toc-gap-below")
352871
+ });
352872
+ }
352873
+ #applyTocGapFill(elements) {
352874
+ if (elements.length < 2)
352724
352875
  return;
352725
- const rawId = block.dataset.sdtId;
352726
- if (!rawId)
352727
- return;
352728
- this.#setHoveredStructuredContentBlockClass(rawId);
352729
- };
352730
- #handleStructuredContentBlockMouseLeave = (event) => {
352731
- const block = event.target.closest(`.${DOM_CLASS_NAMES.BLOCK_SDT}`);
352732
- if (!block)
352733
- return;
352734
- const relatedTarget = event.relatedTarget;
352735
- if (relatedTarget && block.dataset.sdtId) {
352736
- const escapedCheckId = typeof CSS !== "undefined" && CSS.escape ? CSS.escape(block.dataset.sdtId) : block.dataset.sdtId.replace(/"/g, "\\\"");
352737
- if (relatedTarget.closest(buildSdtBlockSelector(escapedCheckId)))
352738
- return;
352876
+ const measured = elements.map((element3) => ({
352877
+ element: element3,
352878
+ rect: element3.getBoundingClientRect()
352879
+ })).sort((a2, b$1) => a2.rect.top - b$1.rect.top);
352880
+ for (let i4 = 0;i4 < measured.length - 1; i4++) {
352881
+ const current = measured[i4];
352882
+ const next2 = measured[i4 + 1];
352883
+ const currentPage = current.element.closest("[data-page-index]");
352884
+ if (!currentPage || currentPage !== next2.element.closest("[data-page-index]"))
352885
+ continue;
352886
+ const rawGap = next2.rect.top - current.rect.bottom;
352887
+ const scaleY = current.rect.height && current.element.offsetHeight ? current.rect.height / current.element.offsetHeight : 1;
352888
+ const gap = scaleY > 0 ? rawGap / scaleY : rawGap;
352889
+ if (gap > 0)
352890
+ current.element.style.setProperty("--toc-gap-below", `${gap + 1}px`);
352739
352891
  }
352740
- this.#clearHoveredStructuredContentBlockClass();
352741
- };
352742
- #clearHoveredStructuredContentBlockClass() {
352743
- if (!this.#lastHoveredStructuredContentBlock)
352744
- return;
352745
- this.#lastHoveredStructuredContentBlock.elements.forEach((element3) => {
352746
- element3.classList.remove(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
352747
- });
352748
- this.#lastHoveredStructuredContentBlock = null;
352749
352892
  }
352750
- #setHoveredStructuredContentBlockClass(id2) {
352751
- if (this.#lastHoveredStructuredContentBlock?.id === id2)
352752
- return;
352753
- this.#clearHoveredStructuredContentBlockClass();
352893
+ #queryTocEntryElementsById(id2) {
352754
352894
  if (!this.#painterHost)
352755
- return;
352756
- const elements = this.#painterAdapter.getStructuredContentBlockElementsById(id2);
352757
- if (elements.length === 0)
352758
- return;
352759
- elements.forEach((element3) => {
352760
- if (!element3.classList.contains("ProseMirror-selectednode"))
352761
- element3.classList.add(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
352762
- });
352763
- this.#lastHoveredStructuredContentBlock = {
352764
- id: id2,
352765
- elements
352766
- };
352767
- }
352768
- #reapplySdtGroupHover() {
352769
- if (!this.#lastHoveredStructuredContentBlock || !this.#painterHost)
352770
- return;
352771
- const { id: id2 } = this.#lastHoveredStructuredContentBlock;
352772
- if (!id2)
352773
- return;
352774
- const elements = this.#painterAdapter.getStructuredContentBlockElementsById(id2);
352775
- if (elements.length === 0) {
352776
- this.#lastHoveredStructuredContentBlock = null;
352777
- return;
352778
- }
352779
- elements.forEach((element3) => {
352780
- if (!element3.classList.contains("ProseMirror-selectednode"))
352781
- element3.classList.add(DOM_CLASS_NAMES.SDT_GROUP_HOVER);
352782
- });
352783
- this.#lastHoveredStructuredContentBlock = {
352784
- id: id2,
352785
- elements
352786
- };
352895
+ return [];
352896
+ const escapedId = escapeAttrValue(id2);
352897
+ return Array.from(this.#painterHost.querySelectorAll(`.${DOM_CLASS_NAMES.TOC_ENTRY}[data-toc-id="${escapedId}"]`));
352787
352898
  }
352788
352899
  #refreshEditorDomAugmentations() {
352789
352900
  this.#postPaintPipeline.refreshAfterPaint({
@@ -352792,7 +352903,8 @@ function print() { __p += __j.call(arguments, '') }
352792
352903
  domPositionIndex: this.#domPositionIndex,
352793
352904
  proofingAnnotations: this.#buildProofingAnnotations(),
352794
352905
  rebuildDomPositionIndex: () => this.#rebuildDomPositionIndex(),
352795
- reapplyStructuredContentHover: () => this.#reapplySdtGroupHover()
352906
+ reapplyStructuredContentHover: () => this.#sdtHoverCoordinator?.reapply(),
352907
+ reapplyTocGroupHover: () => this.#tocHoverCoordinator?.reapply()
352796
352908
  });
352797
352909
  }
352798
352910
  #clearSelectedStructuredContentInlineClass() {
@@ -355180,11 +355292,11 @@ function print() { __p += __j.call(arguments, '') }
355180
355292
  ]);
355181
355293
  });
355182
355294
 
355183
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-ClaBD_rO.es.js
355295
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BbHhTe5g.es.js
355184
355296
  var headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
355185
- var init_create_super_doc_ui_ClaBD_rO_es = __esm(() => {
355186
- init_SuperConverter_BaKhr4cp_es();
355187
- init_create_headless_toolbar_B3wNa0zb_es();
355297
+ var init_create_super_doc_ui_BbHhTe5g_es = __esm(() => {
355298
+ init_SuperConverter_e4tY_2EB_es();
355299
+ init_create_headless_toolbar_3iIgFoKe_es();
355188
355300
  headlessToolbarConstants = {
355189
355301
  DEFAULT_TEXT_ALIGN_OPTIONS: [
355190
355302
  {
@@ -355466,16 +355578,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
355466
355578
 
355467
355579
  // ../../packages/superdoc/dist/super-editor.es.js
355468
355580
  var init_super_editor_es = __esm(() => {
355469
- init_src_BKOC1_8_es();
355470
- init_SuperConverter_BaKhr4cp_es();
355581
+ init_src_M0JgzZDj_es();
355582
+ init_SuperConverter_e4tY_2EB_es();
355471
355583
  init_jszip_C49i9kUs_es();
355472
355584
  init_xml_js_CqGKpaft_es();
355473
- init_create_headless_toolbar_B3wNa0zb_es();
355585
+ init_create_headless_toolbar_3iIgFoKe_es();
355474
355586
  init_constants_D9qj59G2_es();
355475
355587
  init_dist_B8HfvhaK_es();
355476
355588
  init_unified_Dsuw2be5_es();
355477
355589
  init_DocxZipper_FUsfThjV_es();
355478
- init_create_super_doc_ui_ClaBD_rO_es();
355590
+ init_create_super_doc_ui_BbHhTe5g_es();
355479
355591
  init_ui_C5PAS9hY_es();
355480
355592
  init_eventemitter3_BnGqBE_Q_es();
355481
355593
  init_errors_CNaD6vcg_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.12.0-next.7",
3
+ "version": "0.12.0-next.8",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -19,9 +19,9 @@
19
19
  "@types/bun": "^1.3.8",
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
+ "@superdoc/super-editor": "0.0.1",
22
23
  "@superdoc/document-api": "0.0.1",
23
- "superdoc": "1.39.0",
24
- "@superdoc/super-editor": "0.0.1"
24
+ "superdoc": "1.39.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"