@superdoc-dev/mcp 0.10.0-next.4 → 0.10.0-next.6

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 +250 -101
  2. package/package.json +3 -3
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-D6vKCaok.es.js
211381
+ // ../../packages/superdoc/dist/chunks/src-D1Zc7Jgj.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) => {
@@ -212729,12 +212729,80 @@ function findContainingBlockAncestor(element3) {
212729
212729
  }
212730
212730
  return null;
212731
212731
  }
212732
+ function isZeroWidthMarker(node2) {
212733
+ if (node2.type.name === "fieldAnnotation" && node2.attrs?.hidden === true)
212734
+ return true;
212735
+ return ZERO_WIDTH_MARKER_NODE_NAMES.has(node2.type.name);
212736
+ }
212737
+ function findFirstTextPosInNode(node2, nodePos) {
212738
+ if (node2.isText)
212739
+ return nodePos;
212740
+ for (let index2 = 0, offset$1 = 0;index2 < node2.childCount; index2 += 1) {
212741
+ const child = node2.child(index2);
212742
+ const found2 = findFirstTextPosInNode(child, nodePos + 1 + offset$1);
212743
+ if (found2 != null)
212744
+ return found2;
212745
+ offset$1 += child.nodeSize;
212746
+ }
212747
+ return null;
212748
+ }
212749
+ function findFirstContentCursorPosInNode(node2, nodePos) {
212750
+ if (isZeroWidthMarker(node2))
212751
+ return null;
212752
+ if (node2.isText || node2.isAtom)
212753
+ return nodePos;
212754
+ if (node2.isTextblock && node2.childCount === 0)
212755
+ return nodePos + 1;
212756
+ for (let index2 = 0, offset$1 = 0;index2 < node2.childCount; index2 += 1) {
212757
+ const child = node2.child(index2);
212758
+ const found2 = findFirstContentCursorPosInNode(child, nodePos + 1 + offset$1);
212759
+ if (found2 != null)
212760
+ return found2;
212761
+ offset$1 += child.nodeSize;
212762
+ }
212763
+ if (node2.isTextblock)
212764
+ return nodePos + 1;
212765
+ return null;
212766
+ }
212767
+ function findLastTextPosInNode(node2, nodePos) {
212768
+ if (node2.isText)
212769
+ return nodePos + (node2.text?.length ?? 0);
212770
+ for (let index2 = node2.childCount - 1, offset$1 = node2.content.size;index2 >= 0; index2 -= 1) {
212771
+ const child = node2.child(index2);
212772
+ offset$1 -= child.nodeSize;
212773
+ const found2 = findLastTextPosInNode(child, nodePos + 1 + offset$1);
212774
+ if (found2 != null)
212775
+ return found2;
212776
+ }
212777
+ return null;
212778
+ }
212779
+ function findLastContentCursorPosInNode(node2, nodePos) {
212780
+ if (isZeroWidthMarker(node2))
212781
+ return null;
212782
+ if (node2.isText)
212783
+ return nodePos + (node2.text?.length ?? 0);
212784
+ if (node2.isAtom)
212785
+ return node2.isInline ? nodePos + node2.nodeSize : nodePos;
212786
+ if (node2.isTextblock && node2.childCount === 0)
212787
+ return nodePos + 1;
212788
+ for (let index2 = node2.childCount - 1, offset$1 = node2.content.size;index2 >= 0; index2 -= 1) {
212789
+ const child = node2.child(index2);
212790
+ offset$1 -= child.nodeSize;
212791
+ const found2 = findLastContentCursorPosInNode(child, nodePos + 1 + offset$1);
212792
+ if (found2 != null)
212793
+ return found2;
212794
+ }
212795
+ if (node2.isTextblock)
212796
+ return nodePos + node2.nodeSize - 1;
212797
+ return null;
212798
+ }
212732
212799
  function collectSDTNodes(doc$12) {
212733
212800
  const sdtNodes = [];
212734
212801
  doc$12.descendants((node2, pos) => {
212735
212802
  if (node2.type.name === "structuredContent" || node2.type.name === "structuredContentBlock")
212736
212803
  sdtNodes.push({
212737
212804
  type: node2.type.name,
212805
+ node: node2,
212738
212806
  lockMode: node2.attrs.lockMode,
212739
212807
  pos,
212740
212808
  end: pos + node2.nodeSize
@@ -212790,6 +212858,15 @@ function isAtBlockSdtWrapperDeletePosition(state, sdt, pos) {
212790
212858
  return false;
212791
212859
  return $pos.before(textblockDepth) === $pos.start(sdtDepth);
212792
212860
  }
212861
+ function selectionCoversSdtContent(sdt, from$1, to) {
212862
+ if (from$1 === sdt.pos + 1 && to === sdt.end - 1)
212863
+ return true;
212864
+ if (sdt.type !== "structuredContentBlock")
212865
+ return false;
212866
+ const contentStart = findFirstContentCursorPosInNode(sdt.node, sdt.pos);
212867
+ const contentEnd = findLastContentCursorPosInNode(sdt.node, sdt.pos);
212868
+ return contentStart != null && contentEnd != null && from$1 === contentStart && to === contentEnd;
212869
+ }
212793
212870
  function createStructuredContentLockPlugin() {
212794
212871
  return new Plugin({
212795
212872
  key: STRUCTURED_CONTENT_LOCK_KEY,
@@ -212817,7 +212894,7 @@ function createStructuredContentLockPlugin() {
212817
212894
  if (sdtNodes.length === 0)
212818
212895
  return false;
212819
212896
  if (from$1 !== to && !(selection instanceof NodeSelection)) {
212820
- const exactContentSDT = sdtNodes.find((s2) => from$1 === s2.pos + 1 && to === s2.end - 1);
212897
+ const exactContentSDT = sdtNodes.find((s2) => selectionCoversSdtContent(s2, from$1, to));
212821
212898
  if (exactContentSDT) {
212822
212899
  const isContentLocked = exactContentSDT.lockMode === "contentLocked" || exactContentSDT.lockMode === "sdtContentLocked";
212823
212900
  const isWrapperDeletable = exactContentSDT.lockMode !== "sdtLocked" && exactContentSDT.lockMode !== "sdtContentLocked";
@@ -213950,80 +214027,70 @@ function shallowEqual$2(a2, b$1) {
213950
214027
  return false;
213951
214028
  return true;
213952
214029
  }
213953
- function isSdtContentFullyLocked(node2) {
213954
- return node2.attrs.lockMode === "sdtContentLocked";
213955
- }
213956
- function findAncestorDepth$2($pos, predicate) {
214030
+ function findAncestorDepth$3($pos, predicate) {
213957
214031
  for (let depth = $pos.depth;depth > 0; depth -= 1)
213958
214032
  if (predicate($pos.node(depth)))
213959
214033
  return depth;
213960
214034
  return null;
213961
214035
  }
213962
- function isZeroWidthMarker(node2) {
213963
- if (node2.type.name === "fieldAnnotation" && node2.attrs?.hidden === true)
213964
- return true;
213965
- return ZERO_WIDTH_MARKER_NODE_NAMES.has(node2.type.name);
213966
- }
213967
- function findFirstTextPosInNode(node2, nodePos) {
213968
- if (node2.isText)
213969
- return nodePos;
213970
- for (let index2 = 0, offset$1 = 0;index2 < node2.childCount; index2 += 1) {
213971
- const child = node2.child(index2);
213972
- const found2 = findFirstTextPosInNode(child, nodePos + 1 + offset$1);
213973
- if (found2 != null)
213974
- return found2;
213975
- offset$1 += child.nodeSize;
214036
+ function findSiblingAcrossHiddenMarkers$1(doc$12, pos, direction) {
214037
+ let currentPos = pos;
214038
+ let node2 = direction === "before" ? doc$12.resolve(currentPos).nodeBefore : doc$12.resolve(currentPos).nodeAfter;
214039
+ while (node2 && isZeroWidthMarker(node2)) {
214040
+ currentPos += direction === "before" ? -node2.nodeSize : node2.nodeSize;
214041
+ node2 = direction === "before" ? doc$12.resolve(currentPos).nodeBefore : doc$12.resolve(currentPos).nodeAfter;
213976
214042
  }
213977
- return null;
214043
+ return {
214044
+ node: node2,
214045
+ nodePos: direction === "before" && node2 ? currentPos - node2.nodeSize : currentPos
214046
+ };
213978
214047
  }
213979
- function findFirstContentCursorPosInNode(node2, nodePos) {
213980
- if (isZeroWidthMarker(node2))
214048
+ function isAtTextBlockBoundary($from, direction) {
214049
+ const textblockDepth = findAncestorDepth$3($from, (node2) => node2.isTextblock);
214050
+ if (textblockDepth == null)
213981
214051
  return null;
213982
- if (node2.isText || node2.isAtom)
213983
- return nodePos;
213984
- if (node2.isTextblock && node2.childCount === 0)
213985
- return nodePos + 1;
213986
- for (let index2 = 0, offset$1 = 0;index2 < node2.childCount; index2 += 1) {
213987
- const child = node2.child(index2);
213988
- const found2 = findFirstContentCursorPosInNode(child, nodePos + 1 + offset$1);
213989
- if (found2 != null)
213990
- return found2;
213991
- offset$1 += child.nodeSize;
213992
- }
213993
- if (node2.isTextblock)
213994
- return nodePos + 1;
213995
- return null;
214052
+ const textblock = $from.node(textblockDepth);
214053
+ const textblockPos = $from.before(textblockDepth);
214054
+ const boundary = direction === "before" ? findFirstContentCursorPosInNode(textblock, textblockPos) ?? $from.start(textblockDepth) : findLastContentCursorPosInNode(textblock, textblockPos) ?? $from.end(textblockDepth);
214055
+ if ($from.pos !== boundary)
214056
+ return null;
214057
+ return {
214058
+ textblockDepth,
214059
+ textblockPos
214060
+ };
213996
214061
  }
213997
- function findLastTextPosInNode(node2, nodePos) {
213998
- if (node2.isText)
213999
- return nodePos + (node2.text?.length ?? 0);
214000
- for (let index2 = node2.childCount - 1, offset$1 = node2.content.size;index2 >= 0; index2 -= 1) {
214001
- const child = node2.child(index2);
214002
- offset$1 -= child.nodeSize;
214003
- const found2 = findLastTextPosInNode(child, nodePos + 1 + offset$1);
214004
- if (found2 != null)
214005
- return found2;
214006
- }
214007
- return null;
214062
+ function selectAdjacentBlockSdtContent(direction) {
214063
+ return ({ state, dispatch }) => {
214064
+ const { selection } = state;
214065
+ if (!selection.empty)
214066
+ return false;
214067
+ const boundary = isAtTextBlockBoundary(selection.$from, direction);
214068
+ if (!boundary)
214069
+ return false;
214070
+ const siblingBoundaryPos = direction === "before" ? boundary.textblockPos : selection.$from.after(boundary.textblockDepth);
214071
+ const { node: node2, nodePos } = findSiblingAcrossHiddenMarkers$1(state.doc, siblingBoundaryPos, direction);
214072
+ if (node2?.type.name !== "structuredContentBlock")
214073
+ return false;
214074
+ if (node2.content.size === 0)
214075
+ return false;
214076
+ const contentStart = findFirstContentCursorPosInNode(node2, nodePos);
214077
+ const contentEnd = findLastContentCursorPosInNode(node2, nodePos);
214078
+ if (contentStart == null || contentEnd == null)
214079
+ return false;
214080
+ if (contentStart >= contentEnd)
214081
+ return false;
214082
+ if (dispatch)
214083
+ dispatch(state.tr.setSelection(TextSelection.create(state.doc, contentStart, contentEnd)).scrollIntoView());
214084
+ return true;
214085
+ };
214008
214086
  }
214009
- function findLastContentCursorPosInNode(node2, nodePos) {
214010
- if (isZeroWidthMarker(node2))
214011
- return null;
214012
- if (node2.isText)
214013
- return nodePos + (node2.text?.length ?? 0);
214014
- if (node2.isAtom)
214015
- return node2.isInline ? nodePos + node2.nodeSize : nodePos;
214016
- if (node2.isTextblock && node2.childCount === 0)
214017
- return nodePos + 1;
214018
- for (let index2 = node2.childCount - 1, offset$1 = node2.content.size;index2 >= 0; index2 -= 1) {
214019
- const child = node2.child(index2);
214020
- offset$1 -= child.nodeSize;
214021
- const found2 = findLastContentCursorPosInNode(child, nodePos + 1 + offset$1);
214022
- if (found2 != null)
214023
- return found2;
214024
- }
214025
- if (node2.isTextblock)
214026
- return nodePos + node2.nodeSize - 1;
214087
+ function isSdtContentFullyLocked(node2) {
214088
+ return node2.attrs.lockMode === "sdtContentLocked";
214089
+ }
214090
+ function findAncestorDepth$2($pos, predicate) {
214091
+ for (let depth = $pos.depth;depth > 0; depth -= 1)
214092
+ if (predicate($pos.node(depth)))
214093
+ return depth;
214027
214094
  return null;
214028
214095
  }
214029
214096
  function findAncestorDepth$1($pos, predicate) {
@@ -249854,7 +249921,7 @@ function getSdtSiblingBoundaries(containerKeys) {
249854
249921
  };
249855
249922
  });
249856
249923
  }
249857
- function applySdtContainerChrome(doc$12, container, sdt, containerSdt, boundaryOptions, options) {
249924
+ function applySdtContainerChrome(doc$12, container, sdt, containerSdt, boundaryOptions, options, chrome2) {
249858
249925
  if (!shouldRenderSdtContainerChrome(sdt, containerSdt, options))
249859
249926
  return false;
249860
249927
  const metadata = getSdtContainerMetadata(sdt, containerSdt);
@@ -249876,6 +249943,8 @@ function applySdtContainerChrome(doc$12, container, sdt, containerSdt, boundaryO
249876
249943
  container.style.setProperty("--sd-sdt-chrome-bottom-extension", `${boundaryOptions.paddingBottomOverride}px`);
249877
249944
  }
249878
249945
  if (boundaryOptions?.showLabel ?? isStart) {
249946
+ if (chrome2 === "none" && isStructuredContentMetadata(metadata))
249947
+ return true;
249879
249948
  const labelEl = doc$12.createElement("div");
249880
249949
  labelEl.className = config3.labelClassName;
249881
249950
  const labelText = doc$12.createElement("span");
@@ -250175,7 +250244,7 @@ function computeCellVisibleHeight(cell2, cellFrom, cellTo) {
250175
250244
  return cellVisHeight;
250176
250245
  }
250177
250246
  function renderPartialEmbeddedTable(params$1) {
250178
- const { doc: doc$12, block, blockMeasure: tableMeasure, cumulativeLineCount, globalFromLine, globalToLine, contentWidthPx, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome } = params$1;
250247
+ const { doc: doc$12, block, blockMeasure: tableMeasure, cumulativeLineCount, globalFromLine, globalToLine, contentWidthPx, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, chrome: chrome2, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome } = params$1;
250179
250248
  const rowSegmentCounts = tableMeasure.rows.map((row2) => getEmbeddedRowSegmentCount(row2));
250180
250249
  const totalTableSegments = rowSegmentCounts.reduce((s2, c) => s2 + c, 0);
250181
250250
  const tableStartSegment = cumulativeLineCount;
@@ -250261,6 +250330,7 @@ function renderPartialEmbeddedTable(params$1) {
250261
250330
  captureLineSnapshot,
250262
250331
  renderDrawingContent,
250263
250332
  applySdtDataset: applySdtDataset$1,
250333
+ chrome: chrome2,
250264
250334
  fromRow: embeddedFromRow,
250265
250335
  toRow: embeddedToRow,
250266
250336
  partialRow: partialRowInfo,
@@ -272699,7 +272769,7 @@ var Node$13 = class Node$14 {
272699
272769
  const transaction = view.state.tr.setSelection(selection);
272700
272770
  view.dispatch(transaction);
272701
272771
  }
272702
- }, StructuredContentInlineView, findChildren$12, SD_BLOCK_ID_ATTRIBUTE_NAME = "sdBlockId", SD_BLOCK_REV_ATTRIBUTE_NAME = "sdBlockRev", BLOCK_NODE_METADATA_UPDATE_META = "blockNodeMetadataUpdate", BlockNodePluginKey, BlockNode, nodeAllowsSdBlockIdAttr = (node2) => {
272772
+ }, StructuredContentInlineView, ZERO_WIDTH_MARKER_NODE_NAMES, findChildren$12, SD_BLOCK_ID_ATTRIBUTE_NAME = "sdBlockId", SD_BLOCK_REV_ATTRIBUTE_NAME = "sdBlockRev", BLOCK_NODE_METADATA_UPDATE_META = "blockNodeMetadataUpdate", BlockNodePluginKey, BlockNode, nodeAllowsSdBlockIdAttr = (node2) => {
272703
272773
  return !!(node2?.isBlock && node2?.type?.spec?.attrs?.[SD_BLOCK_ID_ATTRIBUTE_NAME]);
272704
272774
  }, nodeAllowsSdBlockRevAttr = (node2) => {
272705
272775
  return !!(node2?.isBlock && node2?.type?.spec?.attrs?.[SD_BLOCK_REV_ATTRIBUTE_NAME]);
@@ -274355,7 +274425,7 @@ var Node$13 = class Node$14 {
274355
274425
  dispatch(tr.scrollIntoView());
274356
274426
  }
274357
274427
  return true;
274358
- }, deleteBlockSdtAtTextBlockStart = () => ({ state, dispatch }) => {
274428
+ }, selectBlockSdtBeforeTextBlockStart = () => selectAdjacentBlockSdtContent("before"), selectBlockSdtAfterTextBlockEnd = () => selectAdjacentBlockSdtContent("after"), deleteBlockSdtAtTextBlockStart = () => ({ state, dispatch }) => {
274359
274429
  const { selection } = state;
274360
274430
  if (!selection.empty)
274361
274431
  return false;
@@ -274384,7 +274454,7 @@ var Node$13 = class Node$14 {
274384
274454
  dispatch(tr.setSelection(Selection.near(tr.doc.resolve(selectionPos), -1)).scrollIntoView());
274385
274455
  }
274386
274456
  return true;
274387
- }, ZERO_WIDTH_MARKER_NODE_NAMES, moveIntoBlockSdtBeforeTextBlockStart = () => moveIntoAdjacentBlockSdt("before"), moveIntoBlockSdtAfterTextBlockEnd = () => moveIntoAdjacentBlockSdt("after"), deleteSkipEmptyRun = () => ({ state, dispatch }) => {
274457
+ }, moveIntoBlockSdtBeforeTextBlockStart = () => moveIntoAdjacentBlockSdt("before"), moveIntoBlockSdtAfterTextBlockEnd = () => moveIntoAdjacentBlockSdt("after"), deleteSkipEmptyRun = () => ({ state, dispatch }) => {
274388
274458
  const sel = state.selection;
274389
274459
  if (!sel.empty)
274390
274460
  return false;
@@ -285751,6 +285821,7 @@ var Node$13 = class Node$14 {
285751
285821
  },
285752
285822
  () => commands$1.deleteBlockSdtAtTextBlockStart(),
285753
285823
  () => commands$1.selectInlineSdtBeforeRunStart(),
285824
+ () => commands$1.selectBlockSdtBeforeTextBlockStart(),
285754
285825
  () => commands$1.moveIntoBlockSdtBeforeTextBlockStart(),
285755
285826
  () => commands$1.backspaceEmptyRunParagraph(),
285756
285827
  () => commands$1.backspaceSkipEmptyRun(),
@@ -285769,6 +285840,7 @@ var Node$13 = class Node$14 {
285769
285840
  return editor.commands.first(({ commands: commands$1 }) => [
285770
285841
  () => commands$1.deleteBlockSdtAtTextBlockStart(),
285771
285842
  () => commands$1.selectInlineSdtAfterRunEnd(),
285843
+ () => commands$1.selectBlockSdtAfterTextBlockEnd(),
285772
285844
  () => commands$1.moveIntoBlockSdtAfterTextBlockEnd(),
285773
285845
  () => commands$1.deleteSkipEmptyRun(),
285774
285846
  () => commands$1.deleteAtomAfter(),
@@ -289784,6 +289856,35 @@ var Node$13 = class Node$14 {
289784
289856
  background-color: transparent;
289785
289857
  }
289786
289858
 
289859
+ /* Global content-control chrome opt-out: preserve SDT wrappers/datasets while
289860
+ * suppressing built-in visual chrome on structured-content controls. Their
289861
+ * label elements are not emitted by renderer/helpers when this class is
289862
+ * present (DOM non-emission), and these rules neutralize
289863
+ * border/padding/hover/selection visuals. documentSection chrome (e.g. the
289864
+ * locked-section tooltip) is intentionally preserved and not in scope. */
289865
+ .superdoc-cc-chrome-none .superdoc-structured-content-inline,
289866
+ .superdoc-cc-chrome-none .superdoc-structured-content-block {
289867
+ border: none;
289868
+ padding: 0;
289869
+ border-radius: 0;
289870
+ background: none;
289871
+ }
289872
+
289873
+ .superdoc-cc-chrome-none .superdoc-structured-content-inline:hover,
289874
+ .superdoc-cc-chrome-none .superdoc-structured-content-block:hover,
289875
+ .superdoc-cc-chrome-none .superdoc-structured-content-block.sdt-group-hover,
289876
+ .superdoc-cc-chrome-none .superdoc-structured-content-block[data-lock-mode].sdt-group-hover,
289877
+ .superdoc-cc-chrome-none .superdoc-structured-content-inline[data-lock-mode]:hover {
289878
+ border: none;
289879
+ background: none;
289880
+ }
289881
+
289882
+ .superdoc-cc-chrome-none .superdoc-structured-content-inline.ProseMirror-selectednode,
289883
+ .superdoc-cc-chrome-none .superdoc-structured-content-block.ProseMirror-selectednode {
289884
+ border-color: transparent;
289885
+ background: none;
289886
+ }
289887
+
289787
289888
  /* Hover highlight for SDT containers.
289788
289889
  * Hover adds background highlight and z-index boost.
289789
289890
  * Block SDTs use .sdt-group-hover class (event delegation for multi-fragment coordination).
@@ -289809,6 +289910,35 @@ var Node$13 = class Node$14 {
289809
289910
  background-color: var(--sd-content-controls-lock-hover-bg, rgba(98, 155, 231, 0.08));
289810
289911
  }
289811
289912
 
289913
+ /* Chrome opt-out for block SDTs. Main paints block chrome through ::before
289914
+ * (background) and ::after (border) pseudo-elements, which the element-level
289915
+ * .superdoc-cc-chrome-none rules above cannot reach. Suppress the pseudo
289916
+ * chrome directly, including the selected-node border and the lock-hover
289917
+ * ::before background. Declared after every chrome-showing pseudo rule so
289918
+ * source order resolves equal-specificity ties, the same way the
289919
+ * viewing-mode rules below do. */
289920
+ .superdoc-cc-chrome-none .superdoc-structured-content-block::before,
289921
+ .superdoc-cc-chrome-none .superdoc-structured-content-block:hover::before,
289922
+ .superdoc-cc-chrome-none .superdoc-structured-content-block.sdt-group-hover::before,
289923
+ .superdoc-cc-chrome-none .superdoc-structured-content-block[data-lock-mode].sdt-group-hover::before {
289924
+ background: none;
289925
+ }
289926
+
289927
+ .superdoc-cc-chrome-none .superdoc-structured-content-block::after,
289928
+ .superdoc-cc-chrome-none .superdoc-structured-content-block:hover::after,
289929
+ .superdoc-cc-chrome-none .superdoc-structured-content-block.sdt-group-hover::after,
289930
+ .superdoc-cc-chrome-none .superdoc-structured-content-block.ProseMirror-selectednode::after {
289931
+ border: none;
289932
+ }
289933
+
289934
+ /* Reset the lock-hover z-index boost so a suppressed SDT does not stack
289935
+ * above host-attached custom UI. Mirrors the base lock-hover selectors with
289936
+ * the chrome-none prefix so specificity stays above the boost rule. */
289937
+ .superdoc-cc-chrome-none .superdoc-structured-content-block[data-lock-mode].sdt-group-hover:not(.ProseMirror-selectednode),
289938
+ .superdoc-cc-chrome-none .superdoc-structured-content-inline[data-lock-mode]:hover:not(.ProseMirror-selectednode, [data-appearance='hidden']) {
289939
+ z-index: auto;
289940
+ }
289941
+
289812
289942
  /* Viewing mode: remove structured content affordances */
289813
289943
  .presentation-editor--viewing .superdoc-structured-content-block,
289814
289944
  .presentation-editor--viewing .superdoc-structured-content-inline {
@@ -291340,7 +291470,7 @@ menclose::after {
291340
291470
  if (element3.style.textIndent)
291341
291471
  element3.style.removeProperty("text-indent");
291342
291472
  }, INLINE_SDT_CHROME_EXTRA_WIDTH_PX = 4, renderParagraphContent = (params$1) => {
291343
- const { doc: doc$12, frameEl, block, measure, linesOverride, width, localStartLine, localEndLine, lineIndexOffset = 0, continuesFromPrev, continuesOnNext, resolvedContent, betweenInfo, sdtBoundary, spacingPolicy, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, renderDropCap: renderDropCap$1, lineTopOffset = 0 } = params$1;
291473
+ const { doc: doc$12, frameEl, block, measure, linesOverride, width, localStartLine, localEndLine, lineIndexOffset = 0, continuesFromPrev, continuesOnNext, resolvedContent, betweenInfo, sdtBoundary, spacingPolicy, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, contentControlsChrome, renderDropCap: renderDropCap$1, lineTopOffset = 0 } = params$1;
291344
291474
  applyParagraphBlockStyles(frameEl, block.attrs);
291345
291475
  const { shadingLayer, borderLayer } = createParagraphDecorationLayers(doc$12, width, block.attrs, betweenInfo);
291346
291476
  if (shadingLayer)
@@ -291361,7 +291491,7 @@ menclose::after {
291361
291491
  ancestorContainerSdts
291362
291492
  });
291363
291493
  if (applySdtChrome) {
291364
- if (applySdtContainerChrome(doc$12, frameEl, block.attrs?.sdt, block.attrs?.containerSdt, sdtBoundary))
291494
+ if (applySdtContainerChrome(doc$12, frameEl, block.attrs?.sdt, block.attrs?.containerSdt, sdtBoundary, undefined, contentControlsChrome))
291365
291495
  onSdtContainerChrome?.();
291366
291496
  }
291367
291497
  renderParagraphDropCap({
@@ -291760,7 +291890,7 @@ menclose::after {
291760
291890
  el.style[key2] = String(value);
291761
291891
  });
291762
291892
  }, renderEmbeddedTable = (params$1) => {
291763
- const { doc: doc$12, table: table2, measure, availableWidth, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, fromRow: paramFromRow, toRow: paramToRow, partialRow: paramPartialRow, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome } = params$1;
291893
+ const { doc: doc$12, table: table2, measure, availableWidth, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, chrome: chrome2, fromRow: paramFromRow, toRow: paramToRow, partialRow: paramPartialRow, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome } = params$1;
291764
291894
  const effectiveFromRow = paramFromRow ?? 0;
291765
291895
  const effectiveToRow = paramToRow ?? table2.rows.length;
291766
291896
  const visibleHeight = computeVisibleHeight(measure.rows, effectiveFromRow, effectiveToRow, paramPartialRow);
@@ -291801,6 +291931,7 @@ menclose::after {
291801
291931
  renderDrawingContent,
291802
291932
  applyFragmentFrame,
291803
291933
  applySdtDataset: applySdtDataset$1,
291934
+ chrome: chrome2,
291804
291935
  applyStyles: applyInlineStyles,
291805
291936
  sdtBoundary,
291806
291937
  ancestorContainerKey,
@@ -291815,7 +291946,7 @@ menclose::after {
291815
291946
  hasSdtContainerChrome
291816
291947
  };
291817
291948
  }, renderTableCell = (deps) => {
291818
- const { doc: doc$12, x, y: y$1, rowHeight, cellMeasure, cell: cell2, borders, useDefaultBorder, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, context, applySdtDataset: applySdtDataset$1, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, tableIndent, isRtl, cellWidth, fromLine, toLine } = deps;
291949
+ const { doc: doc$12, x, y: y$1, rowHeight, cellMeasure, cell: cell2, borders, useDefaultBorder, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, context, applySdtDataset: applySdtDataset$1, chrome: chrome2, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, tableIndent, isRtl, cellWidth, fromLine, toLine } = deps;
291819
291950
  const padding = cell2?.attrs?.padding || {
291820
291951
  top: 0,
291821
291952
  left: 4,
@@ -291902,6 +292033,7 @@ menclose::after {
291902
292033
  captureLineSnapshot,
291903
292034
  renderDrawingContent,
291904
292035
  applySdtDataset: applySdtDataset$1,
292036
+ chrome: chrome2,
291905
292037
  sdtBoundary: sdtBoundaries[i4],
291906
292038
  ancestorContainerKey,
291907
292039
  ancestorContainerSdt,
@@ -292064,6 +292196,7 @@ menclose::after {
292064
292196
  cellEl.style.overflow = "visible";
292065
292197
  onSdtContainerChrome?.();
292066
292198
  },
292199
+ contentControlsChrome: chrome2,
292067
292200
  applySdtDataset: applySdtDataset$1,
292068
292201
  renderLine: ({ block: block$1, line, lineIndex, isLastLine, resolvedListTextStartPx }) => renderLine$1(block$1, line, {
292069
292202
  ...context,
@@ -292241,7 +292374,7 @@ menclose::after {
292241
292374
  left: baseBorders.left
292242
292375
  };
292243
292376
  }, renderTableRow = (deps) => {
292244
- const { doc: doc$12, container, rowIndex, y: y$1, rowMeasure, row: row2, totalRows, tableBorders, columnWidths, allRowHeights, tableIndent, isRtl, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, continuesFromPrev, continuesOnNext, partialRow, cellSpacingPx = 0 } = deps;
292377
+ const { doc: doc$12, container, rowIndex, y: y$1, rowMeasure, row: row2, totalRows, tableBorders, columnWidths, allRowHeights, tableIndent, isRtl, context, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applySdtDataset: applySdtDataset$1, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, continuesFromPrev, continuesOnNext, partialRow, cellSpacingPx = 0, chrome: chrome2 } = deps;
292245
292378
  const totalCols = columnWidths.length;
292246
292379
  const calculateXPosition = (gridColumnStart) => {
292247
292380
  let x = cellSpacingPx;
@@ -292327,12 +292460,13 @@ menclose::after {
292327
292460
  toLine,
292328
292461
  tableIndent,
292329
292462
  isRtl,
292330
- cellWidth: computedCellWidth > 0 ? computedCellWidth : undefined
292463
+ cellWidth: computedCellWidth > 0 ? computedCellWidth : undefined,
292464
+ chrome: chrome2
292331
292465
  });
292332
292466
  container.appendChild(cellElement);
292333
292467
  }
292334
292468
  }, renderTableFragment = (deps) => {
292335
- const { doc: doc$12, fragment, block, measure, cellSpacingPx, effectiveColumnWidths, context, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applyFragmentFrame, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, applyStyles: applyStyles$3 } = deps;
292469
+ const { doc: doc$12, fragment, block, measure, cellSpacingPx, effectiveColumnWidths, chrome: chrome2, context, sdtBoundary, ancestorContainerKey, ancestorContainerSdt, ancestorContainerKeys, ancestorContainerSdts, onSdtContainerChrome, renderLine: renderLine$1, captureLineSnapshot, renderDrawingContent, applyFragmentFrame, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, applyStyles: applyStyles$3 } = deps;
292336
292470
  if (!doc$12) {
292337
292471
  console.error("DomPainter: document is not available");
292338
292472
  if (typeof document !== "undefined") {
@@ -292370,7 +292504,7 @@ menclose::after {
292370
292504
  ancestorContainerSdt,
292371
292505
  ancestorContainerKeys,
292372
292506
  ancestorContainerSdts
292373
- }))
292507
+ }, chrome2))
292374
292508
  onSdtContainerChrome?.();
292375
292509
  const tableContainerSdt = getSdtContainerMetadata(block.attrs?.sdt, block.attrs?.containerSdt);
292376
292510
  const tableContainerKey = getSdtContainerKey(block.attrs?.sdt, block.attrs?.containerSdt);
@@ -292511,6 +292645,7 @@ menclose::after {
292511
292645
  ancestorContainerKeys: nextAncestorContainerKeys,
292512
292646
  ancestorContainerSdts: nextAncestorContainerSdts,
292513
292647
  onSdtContainerChrome,
292648
+ chrome: chrome2,
292514
292649
  continuesFromPrev: false,
292515
292650
  continuesOnNext: false,
292516
292651
  cellSpacingPx
@@ -292627,6 +292762,7 @@ menclose::after {
292627
292762
  ancestorContainerKeys: nextAncestorContainerKeys,
292628
292763
  ancestorContainerSdts: nextAncestorContainerSdts,
292629
292764
  onSdtContainerChrome,
292765
+ chrome: chrome2,
292630
292766
  continuesFromPrev: isFirstRenderedBodyRow && fragment.continuesFromPrev === true,
292631
292767
  continuesOnNext: isLastRenderedBodyRow && fragment.continuesOnNext === true,
292632
292768
  partialRow: partialRowData,
@@ -292767,6 +292903,8 @@ menclose::after {
292767
292903
  wrapper.dataset.appearance = "hidden";
292768
292904
  return wrapper;
292769
292905
  }
292906
+ if (context.contentControlsChrome === "none")
292907
+ return wrapper;
292770
292908
  const alias = sdt?.alias || "Inline content";
292771
292909
  const labelEl = context.doc.createElement("span");
292772
292910
  labelEl.className = DOM_CLASS_NAMES.INLINE_SDT_LABEL;
@@ -292846,7 +292984,7 @@ menclose::after {
292846
292984
  else
292847
292985
  delete el.dataset.continuesOnNext;
292848
292986
  }, isMinimalWordLayout$2 = (value) => isMinimalWordLayout(value), renderParagraphFragment = (params$1) => {
292849
- const { doc: doc$12, fragment, sdtBoundary, betweenInfo, resolvedItem, applyStyles: applyStyles$3, applyResolvedFragmentFrame, applyFragmentFrame, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, renderLine: renderLine$1, captureLineSnapshot, createErrorPlaceholder } = params$1;
292987
+ const { doc: doc$12, fragment, sdtBoundary, betweenInfo, resolvedItem, applyStyles: applyStyles$3, applyResolvedFragmentFrame, applyFragmentFrame, applySdtDataset: applySdtDataset$1, applyContainerSdtDataset: applyContainerSdtDataset$1, renderLine: renderLine$1, captureLineSnapshot, createErrorPlaceholder, contentControlsChrome } = params$1;
292850
292988
  try {
292851
292989
  if (!doc$12)
292852
292990
  throw new Error("DomPainter: document is not available");
@@ -292913,7 +293051,8 @@ menclose::after {
292913
293051
  wrapperEl: fragmentEl
292914
293052
  });
292915
293053
  },
292916
- sourceAnchor: resolvedItem?.sourceAnchor
293054
+ sourceAnchor: resolvedItem?.sourceAnchor,
293055
+ contentControlsChrome
292917
293056
  });
292918
293057
  return fragmentEl;
292919
293058
  } catch (error48) {
@@ -294559,12 +294698,14 @@ menclose::after {
294559
294698
  this.mountedPageIndices = [];
294560
294699
  this.resolvedLayout = null;
294561
294700
  this.showFormattingMarks = false;
294701
+ this.contentControlsChrome = "default";
294562
294702
  this.options = options;
294563
294703
  this.layoutMode = options.layoutMode ?? "vertical";
294564
294704
  this.isSemanticFlow = (options.flowMode ?? "paginated") === "semantic";
294565
294705
  this.headerProvider = options.headerProvider;
294566
294706
  this.footerProvider = options.footerProvider;
294567
294707
  this.showFormattingMarks = options.showFormattingMarks === true;
294708
+ this.contentControlsChrome = options.contentControlsChrome ?? "default";
294568
294709
  const defaultGap = this.layoutMode === "horizontal" ? 20 : 24;
294569
294710
  this.pageGap = typeof options.pageGap === "number" && Number.isFinite(options.pageGap) ? Math.max(0, options.pageGap) : defaultGap;
294570
294711
  if (!this.isSemanticFlow && this.layoutMode === "vertical" && options.virtualization?.enabled) {
@@ -294595,6 +294736,7 @@ menclose::after {
294595
294736
  }
294596
294737
  applyFormattingMarksClass(mount = this.mount) {
294597
294738
  mount?.classList.toggle("superdoc-show-formatting-marks", this.showFormattingMarks);
294739
+ mount?.classList.toggle("superdoc-cc-chrome-none", this.contentControlsChrome === "none");
294598
294740
  }
294599
294741
  invalidateRenderedContent() {
294600
294742
  this.pageStates = [];
@@ -295725,6 +295867,7 @@ menclose::after {
295725
295867
  sourceAnchor: options?.sourceAnchor
295726
295868
  });
295727
295869
  },
295870
+ contentControlsChrome: this.contentControlsChrome,
295728
295871
  createErrorPlaceholder: this.createErrorPlaceholder.bind(this)
295729
295872
  });
295730
295873
  }
@@ -296459,6 +296602,7 @@ menclose::after {
296459
296602
  measure: tableRenderData.measure,
296460
296603
  cellSpacingPx: tableRenderData.cellSpacingPx,
296461
296604
  effectiveColumnWidths: tableRenderData.effectiveColumnWidths,
296605
+ chrome: this.contentControlsChrome,
296462
296606
  sdtBoundary,
296463
296607
  renderLine: renderLineForTableCell,
296464
296608
  captureLineSnapshot: (lineEl, lineContext, options) => {
@@ -296512,6 +296656,7 @@ menclose::after {
296512
296656
  doc: this.doc,
296513
296657
  layoutEpoch: this.layoutEpoch,
296514
296658
  showFormattingMarks: this.showFormattingMarks,
296659
+ contentControlsChrome: this.contentControlsChrome,
296515
296660
  pendingTooltips: this.pendingTooltips,
296516
296661
  getNextLinkId: () => `superdoc-link-${++this.linkIdCounter}`,
296517
296662
  applySdtDataset,
@@ -308284,7 +308429,7 @@ menclose::after {
308284
308429
  return;
308285
308430
  console.log(...args$1);
308286
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;
308287
- var init_src_D6vKCaok_es = __esm(() => {
308432
+ var init_src_D1Zc7Jgj_es = __esm(() => {
308288
308433
  init_rolldown_runtime_Bg48TavK_es();
308289
308434
  init_SuperConverter_C6hKp29w_es();
308290
308435
  init_jszip_C49i9kUs_es();
@@ -310042,6 +310187,22 @@ ${err.toString()}`);
310042
310187
  return true;
310043
310188
  }
310044
310189
  };
310190
+ ZERO_WIDTH_MARKER_NODE_NAMES = new Set([
310191
+ "bookmarkStart",
310192
+ "bookmarkEnd",
310193
+ "commentRangeStart",
310194
+ "commentRangeEnd",
310195
+ "commentReference",
310196
+ "permStart",
310197
+ "permEnd",
310198
+ "permStartBlock",
310199
+ "permEndBlock",
310200
+ "tableOfContentsEntry",
310201
+ "indexEntry",
310202
+ "authorityEntry",
310203
+ "passthroughInline",
310204
+ "passthroughBlock"
310205
+ ]);
310045
310206
  ({ findChildren: findChildren$12 } = helpers_exports);
310046
310207
  BlockNodePluginKey = new PluginKey("blockNodePlugin");
310047
310208
  BlockNode = Extension.create({
@@ -311310,22 +311471,6 @@ ${err.toString()}`);
311310
311471
  macBaseKeymap[key2] = pcBaseKeymap[key2];
311311
311472
  typeof navigator != "undefined" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os != "undefined" && os.platform && os.platform();
311312
311473
  DELETABLE_INLINE_ATOMS$1 = new Set(["noBreakHyphen"]);
311313
- ZERO_WIDTH_MARKER_NODE_NAMES = new Set([
311314
- "bookmarkStart",
311315
- "bookmarkEnd",
311316
- "commentRangeStart",
311317
- "commentRangeEnd",
311318
- "commentReference",
311319
- "permStart",
311320
- "permEnd",
311321
- "permStartBlock",
311322
- "permEndBlock",
311323
- "tableOfContentsEntry",
311324
- "indexEntry",
311325
- "authorityEntry",
311326
- "passthroughInline",
311327
- "passthroughBlock"
311328
- ]);
311329
311474
  DELETABLE_INLINE_ATOMS = new Set(["noBreakHyphen"]);
311330
311475
  commands_exports = /* @__PURE__ */ __export2({
311331
311476
  SELECT_INLINE_SDT_BEFORE_RUN_START_META: () => SELECT_INLINE_SDT_BEFORE_RUN_START_META,
@@ -311376,6 +311521,8 @@ ${err.toString()}`);
311376
311521
  resetAttributes: () => resetAttributes,
311377
311522
  restoreSelection: () => restoreSelection,
311378
311523
  selectAll: () => selectAll$1,
311524
+ selectBlockSdtAfterTextBlockEnd: () => selectBlockSdtAfterTextBlockEnd,
311525
+ selectBlockSdtBeforeTextBlockStart: () => selectBlockSdtBeforeTextBlockStart,
311379
311526
  selectInlineSdtAfterRunEnd: () => selectInlineSdtAfterRunEnd,
311380
311527
  selectInlineSdtBeforeRunStart: () => selectInlineSdtBeforeRunStart,
311381
311528
  selectNodeBackward: () => selectNodeBackward$1,
@@ -336417,7 +336564,8 @@ function print() { __p += __j.call(arguments, '') }
336417
336564
  enableCommentsInViewing: options.layoutEngineOptions?.enableCommentsInViewing,
336418
336565
  presence: validatedPresence,
336419
336566
  showBookmarks: options.layoutEngineOptions?.showBookmarks ?? false,
336420
- showFormattingMarks: options.layoutEngineOptions?.showFormattingMarks ?? false
336567
+ showFormattingMarks: options.layoutEngineOptions?.showFormattingMarks ?? false,
336568
+ contentControlsChrome: options.layoutEngineOptions?.contentControlsChrome
336421
336569
  };
336422
336570
  this.#trackedChangesOverrides = options.layoutEngineOptions?.trackedChanges;
336423
336571
  this.#viewportHost = doc$12.createElement("div");
@@ -339868,7 +340016,8 @@ function print() { __p += __j.call(arguments, '') }
339868
340016
  footerProvider: this.#headerFooterSession?.footerDecorationProvider,
339869
340017
  ruler: this.#layoutOptions.ruler,
339870
340018
  pageGap: this.#layoutState.layout?.pageGap ?? effectiveGap,
339871
- showFormattingMarks: this.#layoutOptions.showFormattingMarks ?? false
340019
+ showFormattingMarks: this.#layoutOptions.showFormattingMarks ?? false,
340020
+ contentControlsChrome: this.#layoutOptions.contentControlsChrome ?? "default"
339872
340021
  });
339873
340022
  const currentZoom = this.#layoutOptions.zoom ?? 1;
339874
340023
  if (currentZoom !== 1)
@@ -342535,7 +342684,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
342535
342684
 
342536
342685
  // ../../packages/superdoc/dist/super-editor.es.js
342537
342686
  var init_super_editor_es = __esm(() => {
342538
- init_src_D6vKCaok_es();
342687
+ init_src_D1Zc7Jgj_es();
342539
342688
  init_SuperConverter_C6hKp29w_es();
342540
342689
  init_jszip_C49i9kUs_es();
342541
342690
  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.4",
3
+ "version": "0.10.0-next.6",
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",
23
22
  "@superdoc/document-api": "0.0.1",
24
- "superdoc": "1.37.0"
23
+ "superdoc": "1.37.0",
24
+ "@superdoc/super-editor": "0.0.1"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"