@superdoc-dev/mcp 0.8.0-next.4 → 0.8.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 +249 -35
  2. package/package.json +3 -3
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-zMJ6NmqZ.es.js
51894
+ // ../../packages/superdoc/dist/chunks/SuperConverter-k7GHkV-c.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")
@@ -61026,6 +61026,10 @@ function resolveRunProperties(params, inlineRpr, resolvedPpr, tableInfo = null,
61026
61026
  inlineRpr = {};
61027
61027
  if (inlineRpr?.underline)
61028
61028
  delete inlineRpr.underline;
61029
+ if (inlineRpr?.vanish)
61030
+ delete inlineRpr.vanish;
61031
+ if (inlineRpr?.specVanish)
61032
+ delete inlineRpr.specVanish;
61029
61033
  styleChain = [
61030
61034
  ...defaultsChain,
61031
61035
  tableStyleProps,
@@ -80556,6 +80560,33 @@ function _getReferencedTableStyles(tableStyleReference, params) {
80556
80560
  ...styleProps
80557
80561
  };
80558
80562
  }
80563
+ function buildFieldResultRuns(params, outputMarks) {
80564
+ const { node: node2 } = params;
80565
+ const contentNodes = (node2.content ?? []).flatMap((child) => exportSchemaToJson({
80566
+ ...params,
80567
+ node: child
80568
+ }));
80569
+ if (contentNodes.length > 0)
80570
+ return contentNodes;
80571
+ const resolvedText = node2.attrs?.resolvedText;
80572
+ if (typeof resolvedText !== "string" || resolvedText.length === 0)
80573
+ return [];
80574
+ const textAttributes = /^\s|\s$/.test(resolvedText) ? { "xml:space": "preserve" } : undefined;
80575
+ return [{
80576
+ name: "w:r",
80577
+ elements: [{
80578
+ name: "w:rPr",
80579
+ elements: outputMarks
80580
+ }, {
80581
+ name: "w:t",
80582
+ attributes: textAttributes,
80583
+ elements: [{
80584
+ text: resolvedText,
80585
+ type: "text"
80586
+ }]
80587
+ }]
80588
+ }];
80589
+ }
80559
80590
  function parseTarget(instruction) {
80560
80591
  if (!instruction)
80561
80592
  return "";
@@ -80609,7 +80640,19 @@ function parseCitationSourceIds(instruction) {
80609
80640
  function extractResolvedText$1(content$2) {
80610
80641
  if (!Array.isArray(content$2))
80611
80642
  return "";
80612
- return content$2.filter((n) => n.type === "text").map((n) => n.text || "").join("");
80643
+ let out = "";
80644
+ const walk = (nodes) => {
80645
+ for (const node2 of nodes) {
80646
+ if (!node2)
80647
+ continue;
80648
+ if (node2.type === "text")
80649
+ out += node2.text || "";
80650
+ else if (Array.isArray(node2.content))
80651
+ walk(node2.content);
80652
+ }
80653
+ };
80654
+ walk(content$2);
80655
+ return out;
80613
80656
  }
80614
80657
  function parseTaInstruction(instruction) {
80615
80658
  let longCitation = "";
@@ -102762,10 +102805,7 @@ var isRegExp = (value) => {
102762
102805
  }, decode$20 = (params) => {
102763
102806
  const { node: node2 } = params;
102764
102807
  const outputMarks = processOutputMarks(node2.attrs?.marksAsAttrs || []);
102765
- const contentNodes = (node2.content ?? []).flatMap((n) => exportSchemaToJson({
102766
- ...params,
102767
- node: n
102768
- }));
102808
+ const contentNodes = buildFieldResultRuns(params, outputMarks);
102769
102809
  const instructionElements = buildInstructionElements(node2.attrs?.instruction, node2.attrs?.instructionTokens);
102770
102810
  return [
102771
102811
  {
@@ -102830,10 +102870,7 @@ var isRegExp = (value) => {
102830
102870
  }, decode$19 = (params) => {
102831
102871
  const { node: node2 } = params;
102832
102872
  const outputMarks = processOutputMarks(node2.attrs?.marksAsAttrs || []);
102833
- const contentNodes = (node2.content ?? []).flatMap((n) => exportSchemaToJson({
102834
- ...params,
102835
- node: n
102836
- }));
102873
+ const contentNodes = buildFieldResultRuns(params, outputMarks);
102837
102874
  const instructionElements = buildInstructionElements(node2.attrs?.instruction, node2.attrs?.instructionTokens);
102838
102875
  return [
102839
102876
  {
@@ -105973,7 +106010,7 @@ var isRegExp = (value) => {
105973
106010
  state.kern = kernNode.attributes["w:val"];
105974
106011
  }
105975
106012
  }, SuperConverter;
105976
- var init_SuperConverter_zMJ6NmqZ_es = __esm(() => {
106013
+ var init_SuperConverter_k7GHkV_c_es = __esm(() => {
105977
106014
  init_rolldown_runtime_Bg48TavK_es();
105978
106015
  init_jszip_C49i9kUs_es();
105979
106016
  init_xml_js_CqGKpaft_es();
@@ -144153,7 +144190,7 @@ var init_SuperConverter_zMJ6NmqZ_es = __esm(() => {
144153
144190
  };
144154
144191
  });
144155
144192
 
144156
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CoZdlJbj.es.js
144193
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-dycevpY9.es.js
144157
144194
  function parseSizeUnit(val = "0") {
144158
144195
  const length = val.toString() || "0";
144159
144196
  const value = Number.parseFloat(length);
@@ -154178,8 +154215,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
154178
154215
  }
154179
154216
  };
154180
154217
  };
154181
- var init_create_headless_toolbar_CoZdlJbj_es = __esm(() => {
154182
- init_SuperConverter_zMJ6NmqZ_es();
154218
+ var init_create_headless_toolbar_dycevpY9_es = __esm(() => {
154219
+ init_SuperConverter_k7GHkV_c_es();
154183
154220
  init_uuid_qzgm05fK_es();
154184
154221
  init_constants_DrU4EASo_es();
154185
154222
  init_dist_B8HfvhaK_es();
@@ -208905,7 +208942,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
208905
208942
  init_remark_gfm_BhnWr3yf_es();
208906
208943
  });
208907
208944
 
208908
- // ../../packages/superdoc/dist/chunks/src-QKGB098Q.es.js
208945
+ // ../../packages/superdoc/dist/chunks/src-AnmYYbEU.es.js
208909
208946
  function deleteProps(obj, propOrProps) {
208910
208947
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
208911
208948
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -210792,6 +210829,86 @@ function backfillCapability(metaMap, ydoc) {
210792
210829
  function createReplacer(data) {
210793
210830
  return ({ part }) => replacePartData(part, data);
210794
210831
  }
210832
+ function normalizeYjsFragmentForSchema(fragment) {
210833
+ if (!isTraversableYjsXml(fragment))
210834
+ return false;
210835
+ let changed = false;
210836
+ const normalize4 = () => {
210837
+ changed = stripSchemaAtomChildren(fragment) || changed;
210838
+ };
210839
+ if (fragment.doc)
210840
+ fragment.doc.transact(normalize4, NORMALIZE_YJS_FRAGMENT_ORIGIN);
210841
+ else
210842
+ normalize4();
210843
+ return changed;
210844
+ }
210845
+ function normalizeYjsFragmentEventsForSchema(events, fallbackFragment) {
210846
+ if (!Array.isArray(events) || events.length === 0)
210847
+ return normalizeYjsFragmentForSchema(fallbackFragment);
210848
+ if (events.some((event) => event?.transaction?.origin === NORMALIZE_YJS_FRAGMENT_ORIGIN))
210849
+ return false;
210850
+ let changed = false;
210851
+ const normalize4 = () => {
210852
+ const visited = /* @__PURE__ */ new Set;
210853
+ for (const event of events) {
210854
+ const target = findNormalizableEventTarget(event?.target);
210855
+ if (!isTraversableYjsXml(target) || visited.has(target))
210856
+ continue;
210857
+ visited.add(target);
210858
+ changed = stripSchemaAtomChildren(target) || changed;
210859
+ }
210860
+ };
210861
+ const doc$12 = fallbackFragment?.doc || findEventDoc(events);
210862
+ if (doc$12)
210863
+ doc$12.transact(normalize4, NORMALIZE_YJS_FRAGMENT_ORIGIN);
210864
+ else
210865
+ normalize4();
210866
+ return changed;
210867
+ }
210868
+ function stripSchemaAtomChildren(parent) {
210869
+ if (!isTraversableYjsXml(parent))
210870
+ return false;
210871
+ if (parent instanceof YXmlElement && SCHEMA_ATOM_NODE_NAMES.has(parent.nodeName)) {
210872
+ if (parent.length === 0)
210873
+ return false;
210874
+ parent.delete(0, parent.length);
210875
+ return true;
210876
+ }
210877
+ let changed = false;
210878
+ for (const child of parent.toArray()) {
210879
+ if (!(child instanceof YXmlElement))
210880
+ continue;
210881
+ if (SCHEMA_ATOM_NODE_NAMES.has(child.nodeName)) {
210882
+ if (child.length > 0) {
210883
+ child.delete(0, child.length);
210884
+ changed = true;
210885
+ }
210886
+ continue;
210887
+ }
210888
+ changed = stripSchemaAtomChildren(child) || changed;
210889
+ }
210890
+ return changed;
210891
+ }
210892
+ function findNormalizableEventTarget(target) {
210893
+ let current = target;
210894
+ while (current) {
210895
+ if (current instanceof YXmlElement && SCHEMA_ATOM_NODE_NAMES.has(current.nodeName))
210896
+ return current;
210897
+ current = current.parent;
210898
+ }
210899
+ return target;
210900
+ }
210901
+ function findEventDoc(events) {
210902
+ for (const event of events) {
210903
+ const doc$12 = event?.target?.doc;
210904
+ if (doc$12)
210905
+ return doc$12;
210906
+ }
210907
+ return null;
210908
+ }
210909
+ function isTraversableYjsXml(value) {
210910
+ return Boolean(value && typeof value.toArray === "function");
210911
+ }
210795
210912
  function getEditorSurfaceElement(editor) {
210796
210913
  if (!editor)
210797
210914
  return null;
@@ -260537,7 +260654,7 @@ function toFlowBlocks(pmDoc, options) {
260537
260654
  blockCounts,
260538
260655
  bookmarks: bookmarks.size
260539
260656
  });
260540
- const mergedBlocks = mergeDropCapParagraphs(hydrateImageBlocks(blocks2, options?.mediaFiles));
260657
+ const mergedBlocks = mergeFusedParagraphs(mergeDropCapParagraphs(hydrateImageBlocks(blocks2, options?.mediaFiles)));
260541
260658
  flowBlockCache?.commit();
260542
260659
  return {
260543
260660
  blocks: mergedBlocks,
@@ -260574,6 +260691,32 @@ function mergeDropCapParagraphs(blocks2) {
260574
260691
  }
260575
260692
  return result;
260576
260693
  }
260694
+ function mergeFusedParagraphs(blocks2) {
260695
+ const result = [];
260696
+ for (const block of blocks2) {
260697
+ const prev = result.length > 0 ? result[result.length - 1] : undefined;
260698
+ if (block.kind === "paragraph" && prev?.kind === "paragraph" && prev.attrs?.suppressParagraphBreak) {
260699
+ const head = prev;
260700
+ const tail = block;
260701
+ const mergedAttrs = { ...head.attrs };
260702
+ if (tail.attrs?.suppressParagraphBreak)
260703
+ mergedAttrs.suppressParagraphBreak = true;
260704
+ else
260705
+ delete mergedAttrs.suppressParagraphBreak;
260706
+ const merged = {
260707
+ kind: "paragraph",
260708
+ id: head.id,
260709
+ runs: [...head.runs, ...tail.runs],
260710
+ attrs: mergedAttrs,
260711
+ ...head.sourceAnchor ? { sourceAnchor: head.sourceAnchor } : {}
260712
+ };
260713
+ result[result.length - 1] = merged;
260714
+ continue;
260715
+ }
260716
+ result.push(block);
260717
+ }
260718
+ return result;
260719
+ }
260577
260720
  function normalizeConverterContext(context, defaultFont, defaultSize) {
260578
260721
  if (!context)
260579
260722
  context = {
@@ -268695,7 +268838,7 @@ var Node$13 = class Node$14 {
268695
268838
  let $pos = doc$12.resolve(this.pos);
268696
268839
  return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
268697
268840
  }
268698
- }, handleKeyDown2, Gapcursor, PARTS_MAP_KEY = "parts", META_MAP_KEY = "meta", META_PARTS_SCHEMA_VERSION_KEY = "partsSchemaVersion", META_PARTS_MIGRATION_KEY = "partsMigration", META_PARTS_LAST_HYDRATED_AT_KEY = "partsLastHydratedAt", META_PARTS_FALLBACK_MODE_KEY = "partsFallbackMode", META_PARTS_CAPABILITY_KEY = "partsCapability", SOURCE_COLLAB_REMOTE_PARTS = "collab:remote:parts", SOURCE_COLLAB_REMOTE_PREFIX = "collab:remote:", EXCLUDED_PART_IDS, CRITICAL_PART_IDS, isApplyingRemoteParts = false, headlessBindingStateByEditor, headlessCleanupRegisteredEditors, META_BODY_SECT_PR_KEY = "bodySectPr", BODY_SECT_PR_SYNC_META_KEY = "bodySectPrSync", collaborationCleanupByEditor, registerHeadlessBindingCleanup = (editor, cleanup) => {
268841
+ }, handleKeyDown2, Gapcursor, PARTS_MAP_KEY = "parts", META_MAP_KEY = "meta", META_PARTS_SCHEMA_VERSION_KEY = "partsSchemaVersion", META_PARTS_MIGRATION_KEY = "partsMigration", META_PARTS_LAST_HYDRATED_AT_KEY = "partsLastHydratedAt", META_PARTS_FALLBACK_MODE_KEY = "partsFallbackMode", META_PARTS_CAPABILITY_KEY = "partsCapability", SOURCE_COLLAB_REMOTE_PARTS = "collab:remote:parts", SOURCE_COLLAB_REMOTE_PREFIX = "collab:remote:", EXCLUDED_PART_IDS, CRITICAL_PART_IDS, isApplyingRemoteParts = false, SCHEMA_ATOM_NODE_NAMES, NORMALIZE_YJS_FRAGMENT_ORIGIN, headlessBindingStateByEditor, headlessCleanupRegisteredEditors, META_BODY_SECT_PR_KEY = "bodySectPr", BODY_SECT_PR_SYNC_META_KEY = "bodySectPrSync", collaborationCleanupByEditor, registerHeadlessBindingCleanup = (editor, cleanup) => {
268699
268842
  if (!cleanup || headlessCleanupRegisteredEditors.has(editor))
268700
268843
  return;
268701
268844
  headlessCleanupRegisteredEditors.add(editor);
@@ -268779,6 +268922,7 @@ var Node$13 = class Node$14 {
268779
268922
  if (!cleanup)
268780
268923
  return;
268781
268924
  cleanup.syncListenerCleanup?.();
268925
+ cleanup.fragmentNormalizeCleanup?.();
268782
268926
  cleanup.mediaMap?.unobserve?.(cleanup.mediaMapObserver);
268783
268927
  cleanup.metaMap?.unobserve?.(cleanup.metaMapObserver);
268784
268928
  cleanup.partSyncHandle?.destroy();
@@ -268789,12 +268933,23 @@ var Node$13 = class Node$14 {
268789
268933
  collaborationCleanupByEditor.delete(editor);
268790
268934
  }, createSyncPlugin = (ydoc, editor) => {
268791
268935
  const fragment = ydoc.getXmlFragment("supereditor");
268936
+ normalizeYjsFragmentForSchema(fragment);
268792
268937
  const onFirstRender = () => {
268793
268938
  if (!editor.options.isNewFile)
268794
268939
  return;
268795
268940
  initializeMetaMap(ydoc, editor);
268796
268941
  };
268797
268942
  return [ySyncPlugin(fragment, { onFirstRender }), fragment];
268943
+ }, registerYjsFragmentNormalizer = (fragment) => {
268944
+ if (!fragment || typeof fragment.observeDeep !== "function" || typeof fragment.unobserveDeep !== "function")
268945
+ return () => {};
268946
+ const normalize4 = (events) => {
268947
+ normalizeYjsFragmentEventsForSchema(events, fragment);
268948
+ };
268949
+ fragment.observeDeep(normalize4);
268950
+ return () => {
268951
+ fragment.unobserveDeep(normalize4);
268952
+ };
268798
268953
  }, initializeMetaMap = (ydoc, editor) => {
268799
268954
  seedPartsFromEditor(editor, ydoc);
268800
268955
  const mediaMap = ydoc.getMap("media");
@@ -290602,6 +290757,8 @@ menclose::after {
290602
290757
  pageBreakBefore: resolvedParagraphProperties.pageBreakBefore,
290603
290758
  directionContext
290604
290759
  };
290760
+ if (resolvedParagraphProperties.runProperties?.vanish === true || paragraphProperties.runProperties?.vanish === true)
290761
+ paragraphAttrs.suppressParagraphBreak = true;
290605
290762
  if (normalizedNumberingProperties && normalizedListRendering) {
290606
290763
  const markerRunAttrs = computeRunAttrs(resolveRunProperties(converterContext, resolvedParagraphProperties.runProperties, resolvedParagraphProperties, converterContext.tableInfo, true, Boolean(paragraphProperties.numberingProperties)), converterContext);
290607
290764
  let markerFontFallback;
@@ -297344,13 +297501,13 @@ menclose::after {
297344
297501
  return;
297345
297502
  console.log(...args$1);
297346
297503
  }, 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;
297347
- var init_src_QKGB098Q_es = __esm(() => {
297504
+ var init_src_AnmYYbEU_es = __esm(() => {
297348
297505
  init_rolldown_runtime_Bg48TavK_es();
297349
- init_SuperConverter_zMJ6NmqZ_es();
297506
+ init_SuperConverter_k7GHkV_c_es();
297350
297507
  init_jszip_C49i9kUs_es();
297351
297508
  init_xml_js_CqGKpaft_es();
297352
297509
  init_uuid_qzgm05fK_es();
297353
- init_create_headless_toolbar_CoZdlJbj_es();
297510
+ init_create_headless_toolbar_dycevpY9_es();
297354
297511
  init_constants_DrU4EASo_es();
297355
297512
  init_dist_B8HfvhaK_es();
297356
297513
  init_unified_Dsuw2be5_es();
@@ -298572,6 +298729,8 @@ ${err.toString()}`);
298572
298729
  "word/_rels/document.xml.rels",
298573
298730
  "[Content_Types].xml"
298574
298731
  ]);
298732
+ SCHEMA_ATOM_NODE_NAMES = new Set(["crossReference", "citation"]);
298733
+ NORMALIZE_YJS_FRAGMENT_ORIGIN = Symbol.for("superdoc/yjs-fragment-normalize");
298575
298734
  new PluginKey("collaboration");
298576
298735
  headlessBindingStateByEditor = /* @__PURE__ */ new WeakMap;
298577
298736
  headlessCleanupRegisteredEditors = /* @__PURE__ */ new WeakSet;
@@ -298599,6 +298758,7 @@ ${err.toString()}`);
298599
298758
  const syncListenerCleanup = initSyncListener(this.options.ydoc, this.editor, this);
298600
298759
  const [syncPlugin, fragment] = createSyncPlugin(this.options.ydoc, this.editor);
298601
298760
  this.options.fragment = fragment;
298761
+ const fragmentNormalizeCleanup = registerYjsFragmentNormalizer(fragment);
298602
298762
  const mediaMap = this.options.ydoc.getMap("media");
298603
298763
  const mediaMapObserver = (event) => {
298604
298764
  event.changes.keys.forEach((_$1, key2) => {
@@ -298613,6 +298773,7 @@ ${err.toString()}`);
298613
298773
  syncListenerCleanup,
298614
298774
  mediaMap,
298615
298775
  mediaMapObserver,
298776
+ fragmentNormalizeCleanup,
298616
298777
  metaMap: null,
298617
298778
  metaMapObserver: null,
298618
298779
  partSyncHandle: null,
@@ -321389,6 +321550,7 @@ function print() { __p += __j.call(arguments, '') }
321389
321550
  }
321390
321551
  #telemetry = null;
321391
321552
  #documentOpenTracked = false;
321553
+ #constructorFragment = null;
321392
321554
  constructor(options) {
321393
321555
  super();
321394
321556
  this.extensionStorage = {};
@@ -321494,6 +321656,7 @@ function print() { __p += __j.call(arguments, '') }
321494
321656
  resolvedOptions.element = null;
321495
321657
  resolvedOptions.selector = null;
321496
321658
  }
321659
+ this.#constructorFragment = resolvedOptions.fragment ?? null;
321497
321660
  this.#checkHeadless(resolvedOptions);
321498
321661
  this.setOptions(resolvedOptions);
321499
321662
  this.#renderer = resolvedOptions.renderer ?? (domAvailable ? new ProseMirrorRenderer : null);
@@ -321615,6 +321778,7 @@ function print() { __p += __j.call(arguments, '') }
321615
321778
  try {
321616
321779
  const resolvedMode = options?.mode ?? this.options.mode ?? "docx";
321617
321780
  const explicitIsNewFile = options?.isNewFile;
321781
+ const hasOpenFragment = Object.prototype.hasOwnProperty.call(options ?? {}, "fragment");
321618
321782
  const resolvedOptions = {
321619
321783
  ...this.options,
321620
321784
  mode: resolvedMode,
@@ -321623,7 +321787,8 @@ function print() { __p += __j.call(arguments, '') }
321623
321787
  documentMode: options?.documentMode ?? this.options.documentMode ?? "editing",
321624
321788
  html: options?.html,
321625
321789
  markdown: options?.markdown,
321626
- jsonOverride: options?.json ?? null
321790
+ jsonOverride: options?.json ?? null,
321791
+ fragment: hasOpenFragment ? options?.fragment ?? null : this.options.fragment ?? this.#constructorFragment
321627
321792
  };
321628
321793
  const loadOptions = options?.password ? { password: options.password } : undefined;
321629
321794
  if (typeof source === "string")
@@ -321757,6 +321922,7 @@ function print() { __p += __j.call(arguments, '') }
321757
321922
  this.options.initialState = null;
321758
321923
  this.options.content = "";
321759
321924
  this.options.fileSource = null;
321925
+ this.options.fragment = null;
321760
321926
  this._state = undefined;
321761
321927
  }
321762
321928
  #initProtectionState() {
@@ -322461,8 +322627,10 @@ function print() { __p += __j.call(arguments, '') }
322461
322627
  });
322462
322628
  else if (this.options.jsonOverride)
322463
322629
  doc$12 = this.schema.nodeFromJSON(this.options.jsonOverride);
322464
- if (fragment)
322630
+ if (fragment) {
322631
+ normalizeYjsFragmentForSchema(fragment);
322465
322632
  doc$12 = yXmlFragmentToProseMirrorRootNode(fragment, this.schema);
322633
+ }
322466
322634
  }
322467
322635
  else if (mode === "text" || mode === "html")
322468
322636
  if (loadFromSchema && hasJsonContent(content3))
@@ -323028,12 +323196,13 @@ function print() { __p += __j.call(arguments, '') }
323028
323196
  isHeadless: !(config3?.element != null || config3?.selector != null),
323029
323197
  ...config3
323030
323198
  };
323031
- const { html: html3, markdown, json: json2, isCommentsEnabled, suppressDefaultDocxStyles, documentMode, content: content3, mediaFiles, fonts, isNewFile, password, ...editorConfig } = resolvedConfig;
323199
+ const { html: html3, markdown, json: json2, fragment, isCommentsEnabled, suppressDefaultDocxStyles, documentMode, content: content3, mediaFiles, fonts, isNewFile, password, ...editorConfig } = resolvedConfig;
323032
323200
  const openOptions = {
323033
323201
  mode: resolvedConfig.mode,
323034
323202
  html: html3,
323035
323203
  markdown,
323036
323204
  json: json2,
323205
+ fragment,
323037
323206
  isCommentsEnabled,
323038
323207
  suppressDefaultDocxStyles,
323039
323208
  documentMode,
@@ -335147,11 +335316,11 @@ function print() { __p += __j.call(arguments, '') }
335147
335316
  ];
335148
335317
  });
335149
335318
 
335150
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DM_6uPhc.es.js
335319
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BLDU9pTd.es.js
335151
335320
  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;
335152
- var init_create_super_doc_ui_DM_6uPhc_es = __esm(() => {
335153
- init_SuperConverter_zMJ6NmqZ_es();
335154
- init_create_headless_toolbar_CoZdlJbj_es();
335321
+ var init_create_super_doc_ui_BLDU9pTd_es = __esm(() => {
335322
+ init_SuperConverter_k7GHkV_c_es();
335323
+ init_create_headless_toolbar_dycevpY9_es();
335155
335324
  MOD_ALIASES = new Set([
335156
335325
  "Mod",
335157
335326
  "Meta",
@@ -335193,16 +335362,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
335193
335362
 
335194
335363
  // ../../packages/superdoc/dist/super-editor.es.js
335195
335364
  var init_super_editor_es = __esm(() => {
335196
- init_src_QKGB098Q_es();
335197
- init_SuperConverter_zMJ6NmqZ_es();
335365
+ init_src_AnmYYbEU_es();
335366
+ init_SuperConverter_k7GHkV_c_es();
335198
335367
  init_jszip_C49i9kUs_es();
335199
335368
  init_xml_js_CqGKpaft_es();
335200
- init_create_headless_toolbar_CoZdlJbj_es();
335369
+ init_create_headless_toolbar_dycevpY9_es();
335201
335370
  init_constants_DrU4EASo_es();
335202
335371
  init_dist_B8HfvhaK_es();
335203
335372
  init_unified_Dsuw2be5_es();
335204
335373
  init_DocxZipper_CZMPWpOp_es();
335205
- init_create_super_doc_ui_DM_6uPhc_es();
335374
+ init_create_super_doc_ui_BLDU9pTd_es();
335206
335375
  init_ui_C5PAS9hY_es();
335207
335376
  init_eventemitter3_BnGqBE_Q_es();
335208
335377
  init_errors_CNaD6vcg_es();
@@ -376450,6 +376619,12 @@ function resolveRunProperties2(params3, inlineRpr, resolvedPpr, tableInfo = null
376450
376619
  if (inlineRpr?.underline) {
376451
376620
  delete inlineRpr.underline;
376452
376621
  }
376622
+ if (inlineRpr?.vanish) {
376623
+ delete inlineRpr.vanish;
376624
+ }
376625
+ if (inlineRpr?.specVanish) {
376626
+ delete inlineRpr.specVanish;
376627
+ }
376453
376628
  styleChain = [
376454
376629
  ...defaultsChain,
376455
376630
  tableStyleProps,
@@ -421758,8 +421933,34 @@ var buildInstructionElements2 = (instruction, instructionTokens) => {
421758
421933
  ];
421759
421934
  };
421760
421935
 
421936
+ // ../../packages/super-editor/src/editors/v1/core/super-converter/v3/handlers/sd/shared/build-field-result-runs.js
421937
+ function buildFieldResultRuns2(params3, outputMarks) {
421938
+ const { node: node4 } = params3;
421939
+ const contentNodes = (node4.content ?? []).flatMap((child) => exportSchemaToJson2({ ...params3, node: child }));
421940
+ if (contentNodes.length > 0)
421941
+ return contentNodes;
421942
+ const resolvedText = node4.attrs?.resolvedText;
421943
+ if (typeof resolvedText !== "string" || resolvedText.length === 0)
421944
+ return [];
421945
+ const textAttributes = /^\s|\s$/.test(resolvedText) ? { "xml:space": "preserve" } : undefined;
421946
+ return [
421947
+ {
421948
+ name: "w:r",
421949
+ elements: [
421950
+ { name: "w:rPr", elements: outputMarks },
421951
+ { name: "w:t", attributes: textAttributes, elements: [{ text: resolvedText, type: "text" }] }
421952
+ ]
421953
+ }
421954
+ ];
421955
+ }
421956
+ var init_build_field_result_runs = __esm(() => {
421957
+ init_exporter();
421958
+ });
421959
+
421761
421960
  // ../../packages/super-editor/src/editors/v1/core/super-converter/v3/handlers/sd/shared/index.js
421762
- var init_shared = () => {};
421961
+ var init_shared = __esm(() => {
421962
+ init_build_field_result_runs();
421963
+ });
421763
421964
 
421764
421965
  // ../../packages/super-editor/src/editors/v1/core/super-converter/v3/handlers/sd/crossReference/crossReference-translator.js
421765
421966
  function parseTarget3(instruction) {
@@ -421824,7 +422025,7 @@ var XML_NODE_NAME27 = "sd:crossReference", SD_NODE_NAME21 = "crossReference", en
421824
422025
  }, decode68 = (params3) => {
421825
422026
  const { node: node4 } = params3;
421826
422027
  const outputMarks = processOutputMarks2(node4.attrs?.marksAsAttrs || []);
421827
- const contentNodes = (node4.content ?? []).flatMap((n) => exportSchemaToJson2({ ...params3, node: n }));
422028
+ const contentNodes = buildFieldResultRuns2(params3, outputMarks);
421828
422029
  const instructionElements = buildInstructionElements2(node4.attrs?.instruction, node4.attrs?.instructionTokens);
421829
422030
  return [
421830
422031
  {
@@ -421887,7 +422088,20 @@ function parseCitationSourceIds2(instruction) {
421887
422088
  function extractResolvedText3(content4) {
421888
422089
  if (!Array.isArray(content4))
421889
422090
  return "";
421890
- return content4.filter((n) => n.type === "text").map((n) => n.text || "").join("");
422091
+ let out = "";
422092
+ const walk = (nodes) => {
422093
+ for (const node4 of nodes) {
422094
+ if (!node4)
422095
+ continue;
422096
+ if (node4.type === "text") {
422097
+ out += node4.text || "";
422098
+ } else if (Array.isArray(node4.content)) {
422099
+ walk(node4.content);
422100
+ }
422101
+ }
422102
+ };
422103
+ walk(content4);
422104
+ return out;
421891
422105
  }
421892
422106
  var XML_NODE_NAME28 = "sd:citation", SD_NODE_NAME22 = "citation", encode65 = (params3) => {
421893
422107
  const { nodes = [], nodeListHandler } = params3 || {};
@@ -421912,7 +422126,7 @@ var XML_NODE_NAME28 = "sd:citation", SD_NODE_NAME22 = "citation", encode65 = (pa
421912
422126
  }, decode69 = (params3) => {
421913
422127
  const { node: node4 } = params3;
421914
422128
  const outputMarks = processOutputMarks2(node4.attrs?.marksAsAttrs || []);
421915
- const contentNodes = (node4.content ?? []).flatMap((n) => exportSchemaToJson2({ ...params3, node: n }));
422129
+ const contentNodes = buildFieldResultRuns2(params3, outputMarks);
421916
422130
  const instructionElements = buildInstructionElements2(node4.attrs?.instruction, node4.attrs?.instructionTokens);
421917
422131
  return [
421918
422132
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.8.0-next.4",
3
+ "version": "0.8.0-next.6",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -20,8 +20,8 @@
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
22
  "@superdoc/document-api": "0.0.1",
23
- "superdoc": "1.35.0",
24
- "@superdoc/super-editor": "0.0.1"
23
+ "@superdoc/super-editor": "0.0.1",
24
+ "superdoc": "1.35.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"