@superdoc-dev/mcp 0.12.0-next.12 → 0.12.0-next.13

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 +75 -30
  2. package/package.json +1 -1
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-DLdwVEPh.es.js
52175
+ // ../../packages/superdoc/dist/chunks/SuperConverter-d9QeIy9-.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")
@@ -67739,16 +67739,31 @@ function preProcessXeInstruction(nodesToCombine, instrText, options = {}) {
67739
67739
  }];
67740
67740
  }
67741
67741
  function preProcessTcInstruction(nodesToCombine, instrText, options = {}) {
67742
+ const before = [];
67743
+ const after = [];
67744
+ const entryElements = [];
67742
67745
  const instructionTokens = options.instructionTokens ?? null;
67743
- return [{
67744
- name: "sd:tableOfContentsEntry",
67745
- type: "element",
67746
- attributes: {
67747
- instruction: instrText,
67748
- ...instructionTokens ? { instructionTokens } : {}
67746
+ let seenContent = false;
67747
+ for (const node2 of nodesToCombine)
67748
+ if (node2?.name === "w:bookmarkStart" || node2?.name === "w:bookmarkEnd")
67749
+ (seenContent ? after : before).push(node2);
67750
+ else {
67751
+ seenContent = true;
67752
+ entryElements.push(node2);
67753
+ }
67754
+ return [
67755
+ ...before,
67756
+ {
67757
+ name: "sd:tableOfContentsEntry",
67758
+ type: "element",
67759
+ attributes: {
67760
+ instruction: instrText,
67761
+ ...instructionTokens ? { instructionTokens } : {}
67762
+ },
67763
+ elements: entryElements
67749
67764
  },
67750
- elements: nodesToCombine
67751
- }];
67765
+ ...after
67766
+ ];
67752
67767
  }
67753
67768
  function preProcessRefInstruction(nodesToCombine, instrText, options = {}) {
67754
67769
  return [{
@@ -118157,7 +118172,7 @@ var isRegExp = (value) => {
118157
118172
  state.kern = kernNode.attributes["w:val"];
118158
118173
  }
118159
118174
  }, SuperConverter;
118160
- var init_SuperConverter_DLdwVEPh_es = __esm(() => {
118175
+ var init_SuperConverter_d9QeIy9_es = __esm(() => {
118161
118176
  init_rolldown_runtime_Bg48TavK_es();
118162
118177
  init_jszip_C49i9kUs_es();
118163
118178
  init_xml_js_CqGKpaft_es();
@@ -158277,7 +158292,7 @@ var init_SuperConverter_DLdwVEPh_es = __esm(() => {
158277
158292
  };
158278
158293
  });
158279
158294
 
158280
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BxKMAAgQ.es.js
158295
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-l5QB6sQY.es.js
158281
158296
  function parseSizeUnit(val = "0") {
158282
158297
  const length = val.toString() || "0";
158283
158298
  const value = Number.parseFloat(length);
@@ -168635,8 +168650,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
168635
168650
  }
168636
168651
  };
168637
168652
  };
168638
- var init_create_headless_toolbar_BxKMAAgQ_es = __esm(() => {
168639
- init_SuperConverter_DLdwVEPh_es();
168653
+ var init_create_headless_toolbar_l5QB6sQY_es = __esm(() => {
168654
+ init_SuperConverter_d9QeIy9_es();
168640
168655
  init_uuid_B2wVPhPi_es();
168641
168656
  init_constants_D9qj59G2_es();
168642
168657
  init_dist_B8HfvhaK_es();
@@ -223320,7 +223335,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
223320
223335
  init_remark_gfm_BhnWr3yf_es();
223321
223336
  });
223322
223337
 
223323
- // ../../packages/superdoc/dist/chunks/src-Bq_Yxqun.es.js
223338
+ // ../../packages/superdoc/dist/chunks/src-LeQVnrcZ.es.js
223324
223339
  function deleteProps(obj, propOrProps) {
223325
223340
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
223326
223341
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -278147,6 +278162,9 @@ async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks
278147
278162
  let nextFragmentPage = null;
278148
278163
  let nextFragmentStart = null;
278149
278164
  let nextFragmentY = null;
278165
+ let prevFragmentPage = null;
278166
+ let prevFragmentEnd = null;
278167
+ let prevFragmentY = null;
278150
278168
  for (const page of layout.pages) {
278151
278169
  for (const fragment of page.fragments) {
278152
278170
  if (fragment.kind !== "para")
@@ -278165,13 +278183,25 @@ async function goToAnchor({ anchor, layout, blocks: blocks2, measures, bookmarks
278165
278183
  nextFragmentStart = fragStart;
278166
278184
  nextFragmentY = fragment.y;
278167
278185
  }
278186
+ if (fragEnd <= pmPos && (prevFragmentEnd === null || fragEnd > prevFragmentEnd)) {
278187
+ prevFragmentPage = page.number - 1;
278188
+ prevFragmentEnd = fragEnd;
278189
+ prevFragmentY = fragment.y;
278190
+ }
278168
278191
  }
278169
278192
  if (pageIndex != null)
278170
278193
  break;
278171
278194
  }
278172
- if (pageIndex == null && nextFragmentPage != null) {
278173
- pageIndex = nextFragmentPage;
278174
- fragmentY = nextFragmentY;
278195
+ if (pageIndex == null) {
278196
+ const prevGap = prevFragmentEnd != null ? pmPos - prevFragmentEnd : Infinity;
278197
+ const nextGap = nextFragmentStart != null ? nextFragmentStart - pmPos : Infinity;
278198
+ if (prevFragmentPage != null && prevGap < nextGap) {
278199
+ pageIndex = prevFragmentPage;
278200
+ fragmentY = prevFragmentY;
278201
+ } else if (nextFragmentPage != null) {
278202
+ pageIndex = nextFragmentPage;
278203
+ fragmentY = nextFragmentY;
278204
+ }
278175
278205
  }
278176
278206
  }
278177
278207
  if (pageIndex == null)
@@ -320778,13 +320808,13 @@ menclose::after {
320778
320808
  return;
320779
320809
  console.log(...args$1);
320780
320810
  }, 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;
320781
- var init_src_Bq_Yxqun_es = __esm(() => {
320811
+ var init_src_LeQVnrcZ_es = __esm(() => {
320782
320812
  init_rolldown_runtime_Bg48TavK_es();
320783
- init_SuperConverter_DLdwVEPh_es();
320813
+ init_SuperConverter_d9QeIy9_es();
320784
320814
  init_jszip_C49i9kUs_es();
320785
320815
  init_xml_js_CqGKpaft_es();
320786
320816
  init_uuid_B2wVPhPi_es();
320787
- init_create_headless_toolbar_BxKMAAgQ_es();
320817
+ init_create_headless_toolbar_l5QB6sQY_es();
320788
320818
  init_constants_D9qj59G2_es();
320789
320819
  init_dist_B8HfvhaK_es();
320790
320820
  init_unified_Dsuw2be5_es();
@@ -355749,11 +355779,11 @@ function print() { __p += __j.call(arguments, '') }
355749
355779
  ]);
355750
355780
  });
355751
355781
 
355752
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-gS4xi9O7.es.js
355782
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-uuXftA9o.es.js
355753
355783
  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;
355754
- var init_create_super_doc_ui_gS4xi9O7_es = __esm(() => {
355755
- init_SuperConverter_DLdwVEPh_es();
355756
- init_create_headless_toolbar_BxKMAAgQ_es();
355784
+ var init_create_super_doc_ui_uuXftA9o_es = __esm(() => {
355785
+ init_SuperConverter_d9QeIy9_es();
355786
+ init_create_headless_toolbar_l5QB6sQY_es();
355757
355787
  headlessToolbarConstants = {
355758
355788
  DEFAULT_TEXT_ALIGN_OPTIONS: [
355759
355789
  {
@@ -356035,16 +356065,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
356035
356065
 
356036
356066
  // ../../packages/superdoc/dist/super-editor.es.js
356037
356067
  var init_super_editor_es = __esm(() => {
356038
- init_src_Bq_Yxqun_es();
356039
- init_SuperConverter_DLdwVEPh_es();
356068
+ init_src_LeQVnrcZ_es();
356069
+ init_SuperConverter_d9QeIy9_es();
356040
356070
  init_jszip_C49i9kUs_es();
356041
356071
  init_xml_js_CqGKpaft_es();
356042
- init_create_headless_toolbar_BxKMAAgQ_es();
356072
+ init_create_headless_toolbar_l5QB6sQY_es();
356043
356073
  init_constants_D9qj59G2_es();
356044
356074
  init_dist_B8HfvhaK_es();
356045
356075
  init_unified_Dsuw2be5_es();
356046
356076
  init_DocxZipper_FUsfThjV_es();
356047
- init_create_super_doc_ui_gS4xi9O7_es();
356077
+ init_create_super_doc_ui_uuXftA9o_es();
356048
356078
  init_ui_C5PAS9hY_es();
356049
356079
  init_eventemitter3_BnGqBE_Q_es();
356050
356080
  init_errors_CNaD6vcg_es();
@@ -443116,8 +443146,22 @@ function preProcessXeInstruction2(nodesToCombine, instrText, options = {}) {
443116
443146
 
443117
443147
  // ../../packages/super-editor/src/editors/v1/core/super-converter/field-references/fld-preprocessors/tc-preprocessor.js
443118
443148
  function preProcessTcInstruction2(nodesToCombine, instrText, options = {}) {
443149
+ const before = [];
443150
+ const after = [];
443151
+ const entryElements = [];
443119
443152
  const instructionTokens = options.instructionTokens ?? null;
443153
+ let seenContent = false;
443154
+ for (const node4 of nodesToCombine) {
443155
+ const isBookmarkMarker = node4?.name === "w:bookmarkStart" || node4?.name === "w:bookmarkEnd";
443156
+ if (isBookmarkMarker) {
443157
+ (seenContent ? after : before).push(node4);
443158
+ } else {
443159
+ seenContent = true;
443160
+ entryElements.push(node4);
443161
+ }
443162
+ }
443120
443163
  return [
443164
+ ...before,
443121
443165
  {
443122
443166
  name: "sd:tableOfContentsEntry",
443123
443167
  type: "element",
@@ -443125,8 +443169,9 @@ function preProcessTcInstruction2(nodesToCombine, instrText, options = {}) {
443125
443169
  instruction: instrText,
443126
443170
  ...instructionTokens ? { instructionTokens } : {}
443127
443171
  },
443128
- elements: nodesToCombine
443129
- }
443172
+ elements: entryElements
443173
+ },
443174
+ ...after
443130
443175
  ];
443131
443176
  }
443132
443177
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.12.0-next.12",
3
+ "version": "0.12.0-next.13",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"