@superdoc-dev/mcp 0.8.0-next.14 → 0.8.0-next.15

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 +65 -27
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51891,7 +51891,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
51891
51891
  emptyOptions2 = {};
51892
51892
  });
51893
51893
 
51894
- // ../../packages/superdoc/dist/chunks/SuperConverter-qtmGhHOJ.es.js
51894
+ // ../../packages/superdoc/dist/chunks/SuperConverter-1HMbTEKL.es.js
51895
51895
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
51896
51896
  const fieldValue = extension$1.config[field];
51897
51897
  if (typeof fieldValue === "function")
@@ -58449,6 +58449,8 @@ function executeAnchoredMetadataList(adapter, query) {
58449
58449
  throw new DocumentApiValidationError("INVALID_INPUT", `metadata.list 'namespace' must be a string when provided.`);
58450
58450
  if (query?.within !== undefined)
58451
58451
  validateWithin(query.within, "metadata.list");
58452
+ if (query?.resolvedOnly !== undefined && typeof query.resolvedOnly !== "boolean")
58453
+ throw new DocumentApiValidationError("INVALID_INPUT", `metadata.list 'resolvedOnly' must be a boolean when provided.`);
58452
58454
  return adapter.list(query);
58453
58455
  }
58454
58456
  function executeAnchoredMetadataGet(adapter, input) {
@@ -106754,7 +106756,7 @@ var isRegExp = (value) => {
106754
106756
  state.kern = kernNode.attributes["w:val"];
106755
106757
  }
106756
106758
  }, SuperConverter;
106757
- var init_SuperConverter_qtmGhHOJ_es = __esm(() => {
106759
+ var init_SuperConverter_1HMbTEKL_es = __esm(() => {
106758
106760
  init_rolldown_runtime_Bg48TavK_es();
106759
106761
  init_jszip_C49i9kUs_es();
106760
106762
  init_xml_js_CqGKpaft_es();
@@ -145068,7 +145070,7 @@ var init_SuperConverter_qtmGhHOJ_es = __esm(() => {
145068
145070
  };
145069
145071
  });
145070
145072
 
145071
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BAtdJwuZ.es.js
145073
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-Bd3oZr3v.es.js
145072
145074
  function parseSizeUnit(val = "0") {
145073
145075
  const length = val.toString() || "0";
145074
145076
  const value = Number.parseFloat(length);
@@ -155300,8 +155302,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
155300
155302
  }
155301
155303
  };
155302
155304
  };
155303
- var init_create_headless_toolbar_BAtdJwuZ_es = __esm(() => {
155304
- init_SuperConverter_qtmGhHOJ_es();
155305
+ var init_create_headless_toolbar_Bd3oZr3v_es = __esm(() => {
155306
+ init_SuperConverter_1HMbTEKL_es();
155305
155307
  init_uuid_qzgm05fK_es();
155306
155308
  init_constants_DrU4EASo_es();
155307
155309
  init_dist_B8HfvhaK_es();
@@ -210032,7 +210034,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
210032
210034
  init_remark_gfm_BhnWr3yf_es();
210033
210035
  });
210034
210036
 
210035
- // ../../packages/superdoc/dist/chunks/src-D659h75w.es.js
210037
+ // ../../packages/superdoc/dist/chunks/src-DC9lS58S.es.js
210036
210038
  function deleteProps(obj, propOrProps) {
210037
210039
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
210038
210040
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -242653,6 +242655,15 @@ function parseMetadataPart(convertedXml, partName) {
242653
242655
  function listMetadataParts(convertedXml) {
242654
242656
  return listCustomXmlParts(convertedXml).map((part) => parseMetadataPart(convertedXml, part.partName)).filter((part) => part !== null);
242655
242657
  }
242658
+ function buildFilteredMetadataXml(editor, convertedXml, options) {
242659
+ const filtered = {};
242660
+ const finalDoc = options?.finalDoc === true;
242661
+ for (const part of listMetadataParts(convertedXml)) {
242662
+ const resolvedEntries = finalDoc ? [] : part.entries.filter((entry) => hasAnchor(editor, entry.id));
242663
+ filtered[part.partName] = buildEnvelopeXml(part.namespace, resolvedEntries);
242664
+ }
242665
+ return filtered;
242666
+ }
242656
242667
  function findPartByNamespace(convertedXml, namespace) {
242657
242668
  return listMetadataParts(convertedXml).find((part) => part.namespace === namespace) ?? null;
242658
242669
  }
@@ -242707,7 +242718,7 @@ function findAnchorsById(editor, id2) {
242707
242718
  return findAllSdtNodes(editor.state.doc).filter((sdt) => sdt.kind === "inline" && sdt.node.attrs?.tag === id2);
242708
242719
  }
242709
242720
  function hasAnchor(editor, id2) {
242710
- return findAllSdtNodes(editor.state.doc).some((sdt) => sdt.node.attrs?.tag === id2);
242721
+ return findAnchorsById(editor, id2).length > 0;
242711
242722
  }
242712
242723
  function wrapRangeInAnchor(editor, target, id2) {
242713
242724
  const { absFrom, absTo } = resolveSelectionTarget(editor, target);
@@ -242842,11 +242853,12 @@ function removeEntry(editor, id2, dryRun) {
242842
242853
  markConverterDirty(editor);
242843
242854
  return true;
242844
242855
  }
242845
- function toSummary(entry) {
242856
+ function toSummary(entry, editor) {
242846
242857
  return {
242847
242858
  id: entry.id,
242848
242859
  namespace: entry.namespace,
242849
- partName: entry.partName
242860
+ partName: entry.partName,
242861
+ anchorStatus: hasAnchor(editor, entry.id) ? "resolved" : "orphan"
242850
242862
  };
242851
242863
  }
242852
242864
  function listEntries(editor, query) {
@@ -242855,11 +242867,13 @@ function listEntries(editor, query) {
242855
242867
  entries = entries.filter((entry) => entry.namespace === query.namespace);
242856
242868
  if (query?.within !== undefined)
242857
242869
  entries = entries.filter((entry) => anchorOverlaps(editor, entry.id, query.within));
242870
+ if (query?.resolvedOnly)
242871
+ entries = entries.filter((entry) => hasAnchor(editor, entry.id));
242858
242872
  return entries;
242859
242873
  }
242860
242874
  function metadataListWrapper(editor, query) {
242861
242875
  const { total, items } = paginate(listEntries(editor, query).map((entry) => {
242862
- const summary = toSummary(entry);
242876
+ const summary = toSummary(entry, editor);
242863
242877
  return buildDiscoveryItem(summary.id, buildResolvedHandle(`metadata:${summary.id}`, "ephemeral", "ext:anchoredMetadata"), summary);
242864
242878
  }), query?.offset, query?.limit);
242865
242879
  return buildDiscoveryResult({
@@ -242874,7 +242888,13 @@ function metadataListWrapper(editor, query) {
242874
242888
  });
242875
242889
  }
242876
242890
  function metadataGetWrapper(editor, input2) {
242877
- return findEntry(getConvertedXml2(editor), input2.id);
242891
+ const entry = findEntry(getConvertedXml2(editor), input2.id);
242892
+ if (!entry)
242893
+ return null;
242894
+ return {
242895
+ ...entry,
242896
+ anchorStatus: hasAnchor(editor, entry.id) ? "resolved" : "orphan"
242897
+ };
242878
242898
  }
242879
242899
  function metadataResolveWrapper(editor, input2) {
242880
242900
  if (!hasPayloadEntry(getConvertedXml2(editor), input2.id))
@@ -302734,13 +302754,13 @@ menclose::after {
302734
302754
  return;
302735
302755
  console.log(...args$1);
302736
302756
  }, 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;
302737
- var init_src_D659h75w_es = __esm(() => {
302757
+ var init_src_DC9lS58S_es = __esm(() => {
302738
302758
  init_rolldown_runtime_Bg48TavK_es();
302739
- init_SuperConverter_qtmGhHOJ_es();
302759
+ init_SuperConverter_1HMbTEKL_es();
302740
302760
  init_jszip_C49i9kUs_es();
302741
302761
  init_xml_js_CqGKpaft_es();
302742
302762
  init_uuid_qzgm05fK_es();
302743
- init_create_headless_toolbar_BAtdJwuZ_es();
302763
+ init_create_headless_toolbar_Bd3oZr3v_es();
302744
302764
  init_constants_DrU4EASo_es();
302745
302765
  init_dist_B8HfvhaK_es();
302746
302766
  init_unified_Dsuw2be5_es();
@@ -328511,6 +328531,11 @@ function print() { __p += __j.call(arguments, '') }
328511
328531
  if (partData?.elements?.[0])
328512
328532
  updatedDocs[path2] = String(this.converter.schemaToXml(partData.elements[0]));
328513
328533
  }
328534
+ if (isFinalDoc) {
328535
+ const filteredMetadataParts = buildFilteredMetadataXml(this, this.converter.convertedXml, { finalDoc: true });
328536
+ for (const [path2, xml2] of Object.entries(filteredMetadataParts))
328537
+ updatedDocs[path2] = xml2;
328538
+ }
328514
328539
  for (const path2 of Object.keys(this.converter.convertedXml)) {
328515
328540
  if (!path2.startsWith("customXml/"))
328516
328541
  continue;
@@ -340767,11 +340792,11 @@ function print() { __p += __j.call(arguments, '') }
340767
340792
  ]);
340768
340793
  });
340769
340794
 
340770
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BlXIZRF5.es.js
340795
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BObTHhKp.es.js
340771
340796
  var 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;
340772
- var init_create_super_doc_ui_BlXIZRF5_es = __esm(() => {
340773
- init_SuperConverter_qtmGhHOJ_es();
340774
- init_create_headless_toolbar_BAtdJwuZ_es();
340797
+ var init_create_super_doc_ui_BObTHhKp_es = __esm(() => {
340798
+ init_SuperConverter_1HMbTEKL_es();
340799
+ init_create_headless_toolbar_Bd3oZr3v_es();
340775
340800
  MOD_ALIASES = new Set([
340776
340801
  "Mod",
340777
340802
  "Meta",
@@ -340813,16 +340838,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
340813
340838
 
340814
340839
  // ../../packages/superdoc/dist/super-editor.es.js
340815
340840
  var init_super_editor_es = __esm(() => {
340816
- init_src_D659h75w_es();
340817
- init_SuperConverter_qtmGhHOJ_es();
340841
+ init_src_DC9lS58S_es();
340842
+ init_SuperConverter_1HMbTEKL_es();
340818
340843
  init_jszip_C49i9kUs_es();
340819
340844
  init_xml_js_CqGKpaft_es();
340820
- init_create_headless_toolbar_BAtdJwuZ_es();
340845
+ init_create_headless_toolbar_Bd3oZr3v_es();
340821
340846
  init_constants_DrU4EASo_es();
340822
340847
  init_dist_B8HfvhaK_es();
340823
340848
  init_unified_Dsuw2be5_es();
340824
340849
  init_DocxZipper_CZMPWpOp_es();
340825
- init_create_super_doc_ui_BlXIZRF5_es();
340850
+ init_create_super_doc_ui_BObTHhKp_es();
340826
340851
  init_ui_C5PAS9hY_es();
340827
340852
  init_eventemitter3_BnGqBE_Q_es();
340828
340853
  init_errors_CNaD6vcg_es();
@@ -359948,6 +359973,9 @@ function executeAnchoredMetadataList2(adapter, query2) {
359948
359973
  if (query2?.within !== undefined) {
359949
359974
  validateWithin2(query2.within, "metadata.list");
359950
359975
  }
359976
+ if (query2?.resolvedOnly !== undefined && typeof query2.resolvedOnly !== "boolean") {
359977
+ throw new DocumentApiValidationError3("INVALID_INPUT", `metadata.list 'resolvedOnly' must be a boolean when provided.`);
359978
+ }
359951
359979
  return adapter.list(query2);
359952
359980
  }
359953
359981
  function executeAnchoredMetadataGet2(adapter, input2) {
@@ -472989,7 +473017,7 @@ function findAnchorsById2(editor, id2) {
472989
473017
  return findAllSdtNodes2(editor.state.doc).filter((sdt) => sdt.kind === "inline" && sdt.node.attrs?.tag === id2);
472990
473018
  }
472991
473019
  function hasAnchor2(editor, id2) {
472992
- return findAllSdtNodes2(editor.state.doc).some((sdt) => sdt.node.attrs?.tag === id2);
473020
+ return findAnchorsById2(editor, id2).length > 0;
472993
473021
  }
472994
473022
  function wrapRangeInAnchor2(editor, target, id2) {
472995
473023
  const { absFrom, absTo } = resolveSelectionTarget2(editor, target);
@@ -473124,11 +473152,12 @@ function removeEntry2(editor, id2, dryRun) {
473124
473152
  markConverterDirty2(editor);
473125
473153
  return true;
473126
473154
  }
473127
- function toSummary3(entry) {
473155
+ function toSummary3(entry, editor) {
473128
473156
  return {
473129
473157
  id: entry.id,
473130
473158
  namespace: entry.namespace,
473131
- partName: entry.partName
473159
+ partName: entry.partName,
473160
+ anchorStatus: hasAnchor2(editor, entry.id) ? "resolved" : "orphan"
473132
473161
  };
473133
473162
  }
473134
473163
  function listEntries2(editor, query2) {
@@ -473139,11 +473168,14 @@ function listEntries2(editor, query2) {
473139
473168
  if (query2?.within !== undefined) {
473140
473169
  entries = entries.filter((entry) => anchorOverlaps2(editor, entry.id, query2.within));
473141
473170
  }
473171
+ if (query2?.resolvedOnly) {
473172
+ entries = entries.filter((entry) => hasAnchor2(editor, entry.id));
473173
+ }
473142
473174
  return entries;
473143
473175
  }
473144
473176
  function metadataListWrapper2(editor, query2) {
473145
473177
  const allItems = listEntries2(editor, query2).map((entry) => {
473146
- const summary = toSummary3(entry);
473178
+ const summary = toSummary3(entry, editor);
473147
473179
  return buildDiscoveryItem2(summary.id, buildResolvedHandle2(`metadata:${summary.id}`, "ephemeral", "ext:anchoredMetadata"), summary);
473148
473180
  });
473149
473181
  const { total, items } = paginate2(allItems, query2?.offset, query2?.limit);
@@ -473159,7 +473191,13 @@ function metadataListWrapper2(editor, query2) {
473159
473191
  });
473160
473192
  }
473161
473193
  function metadataGetWrapper2(editor, input2) {
473162
- return findEntry2(getConvertedXml5(editor), input2.id);
473194
+ const entry = findEntry2(getConvertedXml5(editor), input2.id);
473195
+ if (!entry)
473196
+ return null;
473197
+ return {
473198
+ ...entry,
473199
+ anchorStatus: hasAnchor2(editor, entry.id) ? "resolved" : "orphan"
473200
+ };
473163
473201
  }
473164
473202
  function metadataResolveWrapper2(editor, input2) {
473165
473203
  if (!hasPayloadEntry2(getConvertedXml5(editor), input2.id))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.8.0-next.14",
3
+ "version": "0.8.0-next.15",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"