@superdoc-dev/mcp 0.3.0-next.69 → 0.3.0-next.70

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 +224 -100
  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-C9I74vtg.es.js
51894
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CjDkqrj8.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")
@@ -62809,6 +62809,18 @@ function handleDocPartObj(params) {
62809
62809
  const sdtPr = node2.elements.find((el) => el.name === "w:sdtPr");
62810
62810
  const docPartGalleryType = sdtPr?.elements.find((el) => el.name === "w:docPartObj")?.elements.find((el) => el.name === "w:docPartGallery")?.attributes?.["w:val"] ?? null;
62811
62811
  const content$2 = node2?.elements.find((el) => el.name === "w:sdtContent");
62812
+ const isInsideParagraph = (params.path || []).some((p) => p?.name === "w:p");
62813
+ const hasBlockChild = !!content$2?.elements?.some((el) => el?.name === "w:p" || el?.name === "w:tbl");
62814
+ if (isInsideParagraph && !hasBlockChild)
62815
+ return inlineDocPartHandler({
62816
+ ...params,
62817
+ nodes: [content$2],
62818
+ extraParams: {
62819
+ ...params.extraParams || {},
62820
+ sdtPr,
62821
+ docPartGalleryType
62822
+ }
62823
+ });
62812
62824
  return (validGalleryTypeMap[docPartGalleryType] || genericDocPartHandler)({
62813
62825
  ...params,
62814
62826
  nodes: [content$2],
@@ -91606,6 +91618,27 @@ var isRegExp = (value) => {
91606
91618
  attrs,
91607
91619
  marks
91608
91620
  };
91621
+ }, inlineDocPartHandler = (params) => {
91622
+ const node2 = params.nodes[0];
91623
+ const translatedContent = params.nodeListHandler.handler({
91624
+ ...params,
91625
+ nodes: node2?.elements || [],
91626
+ path: [...params.path || [], node2]
91627
+ });
91628
+ const sdtPr = params.extraParams.sdtPr;
91629
+ const docPartGalleryType = params.extraParams.docPartGalleryType;
91630
+ const id = sdtPr?.elements?.find((el) => el.name === "w:id")?.attributes?.["w:val"] || null;
91631
+ const docPartObj = sdtPr?.elements.find((el) => el.name === "w:docPartObj");
91632
+ return {
91633
+ type: "structuredContent",
91634
+ content: translatedContent,
91635
+ attrs: {
91636
+ id,
91637
+ docPartGallery: docPartGalleryType ?? docPartObj?.elements?.find((el) => el.name === "w:docPartGallery")?.attributes?.["w:val"] ?? null,
91638
+ docPartUnique: docPartObj?.elements?.some((el) => el.name === "w:docPartUnique") ?? false,
91639
+ sdtPr
91640
+ }
91641
+ };
91609
91642
  }, tableOfContentsHandler = (params) => {
91610
91643
  const node2 = params.nodes[0];
91611
91644
  const normalizedContent = normalizeDocPartContent(translateTocSdtContent(node2, params));
@@ -104893,7 +104926,7 @@ var isRegExp = (value) => {
104893
104926
  state.kern = kernNode.attributes["w:val"];
104894
104927
  }
104895
104928
  }, SuperConverter;
104896
- var init_SuperConverter_C9I74vtg_es = __esm(() => {
104929
+ var init_SuperConverter_CjDkqrj8_es = __esm(() => {
104897
104930
  init_rolldown_runtime_Bg48TavK_es();
104898
104931
  init_jszip_C49i9kUs_es();
104899
104932
  init_xml_js_CqGKpaft_es();
@@ -142753,7 +142786,7 @@ var init_SuperConverter_C9I74vtg_es = __esm(() => {
142753
142786
  };
142754
142787
  });
142755
142788
 
142756
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-B7nufamW.es.js
142789
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-pGestihw.es.js
142757
142790
  function parseSizeUnit(val = "0") {
142758
142791
  const length = val.toString() || "0";
142759
142792
  const value = Number.parseFloat(length);
@@ -145420,8 +145453,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
145420
145453
  }
145421
145454
  };
145422
145455
  };
145423
- var init_create_headless_toolbar_B7nufamW_es = __esm(() => {
145424
- init_SuperConverter_C9I74vtg_es();
145456
+ var init_create_headless_toolbar_pGestihw_es = __esm(() => {
145457
+ init_SuperConverter_CjDkqrj8_es();
145425
145458
  init_constants_DrU4EASo_es();
145426
145459
  init_dist_B8HfvhaK_es();
145427
145460
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -199640,7 +199673,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
199640
199673
  init_remark_gfm_BhnWr3yf_es();
199641
199674
  });
199642
199675
 
199643
- // ../../packages/superdoc/dist/chunks/src-BE-DiVIy.es.js
199676
+ // ../../packages/superdoc/dist/chunks/src-tOywM1hR.es.js
199644
199677
  function deleteProps(obj, propOrProps) {
199645
199678
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
199646
199679
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -247301,26 +247334,26 @@ function resolvePageNumberTokens(layout, blocks2, measures, numberingCtx) {
247301
247334
  continue;
247302
247335
  }
247303
247336
  const displayPageText = displayPageInfo.displayText;
247304
- for (const fragment of page.fragments) {
247305
- if (fragment.kind !== "para")
247306
- continue;
247307
- const blockId = fragment.blockId;
247308
- if (processedBlocks.has(blockId))
247309
- continue;
247310
- if (blockHasTokensFlags.get(blockId) === false)
247311
- continue;
247312
- const block = blockMap.get(blockId);
247313
- if (!block || block.kind !== "paragraph")
247314
- continue;
247315
- if (!hasPageTokens$1(block)) {
247337
+ for (const fragment of page.fragments)
247338
+ if (fragment.kind === "para") {
247339
+ const blockId = fragment.blockId;
247340
+ if (processedBlocks.has(blockId))
247341
+ continue;
247342
+ if (blockHasTokensFlags.get(blockId) === false)
247343
+ continue;
247344
+ const block = blockMap.get(blockId);
247345
+ if (!block || block.kind !== "paragraph")
247346
+ continue;
247347
+ if (!hasPageTokens$1(block)) {
247348
+ processedBlocks.add(blockId);
247349
+ continue;
247350
+ }
247351
+ const clonedBlock = cloneBlockWithResolvedTokens(block, displayPageText, totalPagesStr);
247352
+ updatedBlocks.set(blockId, clonedBlock);
247353
+ affectedBlockIds.add(blockId);
247316
247354
  processedBlocks.add(blockId);
247317
247355
  continue;
247318
247356
  }
247319
- const clonedBlock = cloneBlockWithResolvedTokens(block, displayPageText, totalPagesStr);
247320
- updatedBlocks.set(blockId, clonedBlock);
247321
- affectedBlockIds.add(blockId);
247322
- processedBlocks.add(blockId);
247323
- }
247324
247357
  }
247325
247358
  return {
247326
247359
  affectedBlockIds,
@@ -249417,6 +249450,20 @@ function isBorderSpec(value) {
249417
249450
  function hasComments$1(run2) {
249418
249451
  return "comments" in run2 && Array.isArray(run2.comments) && run2.comments.length > 0;
249419
249452
  }
249453
+ function forEachParagraphBlock(blocks2, visit2) {
249454
+ for (const block of blocks2)
249455
+ if (block.kind === "paragraph")
249456
+ visit2(block);
249457
+ else if (block.kind === "table") {
249458
+ const table2 = block;
249459
+ for (const row2 of table2.rows ?? [])
249460
+ for (const cell2 of row2.cells ?? [])
249461
+ if (cell2.blocks && cell2.blocks.length > 0)
249462
+ forEachParagraphBlock(cell2.blocks, visit2);
249463
+ else if (cell2.paragraph)
249464
+ forEachParagraphBlock([cell2.paragraph], visit2);
249465
+ }
249466
+ }
249420
249467
  function resolveHeaderFooterTokens(blocks2, pageNumber, totalPages, pageNumberText) {
249421
249468
  if (!blocks2 || blocks2.length === 0)
249422
249469
  return;
@@ -249430,10 +249477,7 @@ function resolveHeaderFooterTokens(blocks2, pageNumber, totalPages, pageNumberTe
249430
249477
  }
249431
249478
  const pageNumberStr = pageNumberText ?? String(pageNumber);
249432
249479
  const totalPagesStr = String(totalPages);
249433
- for (const block of blocks2) {
249434
- if (block.kind !== "paragraph")
249435
- continue;
249436
- const paraBlock = block;
249480
+ forEachParagraphBlock(blocks2, (paraBlock) => {
249437
249481
  for (const run2 of paraBlock.runs)
249438
249482
  if ("token" in run2 && run2.token) {
249439
249483
  if (run2.token === "pageNumber")
@@ -249441,22 +249485,37 @@ function resolveHeaderFooterTokens(blocks2, pageNumber, totalPages, pageNumberTe
249441
249485
  else if (run2.token === "totalPageCount")
249442
249486
  run2.text = totalPagesStr;
249443
249487
  }
249444
- }
249488
+ });
249445
249489
  }
249446
249490
  function cloneHeaderFooterBlocks(blocks2) {
249447
249491
  if (!blocks2 || blocks2.length === 0)
249448
249492
  return [];
249449
- return blocks2.map((block) => {
249450
- if (block.kind === "paragraph") {
249451
- const paraBlock = block;
249452
- return {
249453
- ...paraBlock,
249454
- runs: paraBlock.runs.map((run2) => ({ ...run2 })),
249455
- attrs: paraBlock.attrs ? { ...paraBlock.attrs } : undefined
249456
- };
249457
- }
249458
- return { ...block };
249459
- });
249493
+ return blocks2.map(cloneHeaderFooterBlock);
249494
+ }
249495
+ function cloneHeaderFooterBlock(block) {
249496
+ if (block.kind === "paragraph") {
249497
+ const paraBlock = block;
249498
+ return {
249499
+ ...paraBlock,
249500
+ runs: paraBlock.runs.map((run2) => ({ ...run2 })),
249501
+ attrs: paraBlock.attrs ? { ...paraBlock.attrs } : undefined
249502
+ };
249503
+ }
249504
+ if (block.kind === "table") {
249505
+ const table2 = block;
249506
+ return {
249507
+ ...table2,
249508
+ rows: (table2.rows ?? []).map((row2) => ({
249509
+ ...row2,
249510
+ cells: (row2.cells ?? []).map((cell2) => ({
249511
+ ...cell2,
249512
+ paragraph: cell2.paragraph ? cloneHeaderFooterBlock(cell2.paragraph) : cell2.paragraph,
249513
+ blocks: cell2.blocks ? cell2.blocks.map(cloneHeaderFooterBlock) : cell2.blocks
249514
+ }))
249515
+ }))
249516
+ };
249517
+ }
249518
+ return { ...block };
249460
249519
  }
249461
249520
  function isEnabled(envVar, defaultValue) {
249462
249521
  if (typeof process$1 === "undefined" || typeof process$1.env === "undefined")
@@ -249489,14 +249548,24 @@ function getBucketRepresentative(bucket) {
249489
249548
  return 5000;
249490
249549
  }
249491
249550
  }
249551
+ function paragraphHasPageToken(para) {
249552
+ for (const run2 of para.runs)
249553
+ if ("token" in run2 && (run2.token === "pageNumber" || run2.token === "totalPageCount"))
249554
+ return true;
249555
+ return false;
249556
+ }
249492
249557
  function hasPageTokens(blocks2) {
249493
- for (const block of blocks2) {
249494
- if (block.kind !== "paragraph")
249495
- continue;
249496
- for (const run2 of block.runs)
249497
- if ("token" in run2 && (run2.token === "pageNumber" || run2.token === "totalPageCount"))
249558
+ for (const block of blocks2)
249559
+ if (block.kind === "paragraph") {
249560
+ if (paragraphHasPageToken(block))
249498
249561
  return true;
249499
- }
249562
+ } else if (block.kind === "table") {
249563
+ const table2 = block;
249564
+ for (const row2 of table2.rows ?? [])
249565
+ for (const cell2 of row2.cells ?? [])
249566
+ if (hasPageTokens(cell2.blocks ? cell2.blocks : cell2.paragraph ? [cell2.paragraph] : []))
249567
+ return true;
249568
+ }
249500
249569
  return false;
249501
249570
  }
249502
249571
  async function layoutHeaderFooterWithCache(sections, constraints, measureBlock$1, cache$2 = sharedHeaderFooterCache, totalPages, pageResolver, kind) {
@@ -254574,7 +254643,7 @@ function handleStructuredContentBlockNode(node2, context) {
254574
254643
  const { blocks: blocks2, recordBlockKind, nextBlockId, positions, trackedChangesConfig, bookmarks, hyperlinkConfig, converters: converters$1, converterContext, enableComments, themeColors } = context;
254575
254644
  const structuredContentMetadata = resolveNodeSdtMetadata(node2, "structuredContentBlock");
254576
254645
  const paragraphToFlowBlocks$1 = converters$1.paragraphToFlowBlocks;
254577
- node2.content.forEach((child) => {
254646
+ const visitChild = (child) => {
254578
254647
  if (child.type === "paragraph") {
254579
254648
  const paragraphBlocks = paragraphToFlowBlocks$1({
254580
254649
  para: child,
@@ -254593,7 +254662,9 @@ function handleStructuredContentBlockNode(node2, context) {
254593
254662
  blocks2.push(block);
254594
254663
  recordBlockKind?.(block.kind);
254595
254664
  });
254596
- } else if (child.type === "table") {
254665
+ return;
254666
+ }
254667
+ if (child.type === "table") {
254597
254668
  const tableNodeToBlock$1 = converters$1?.tableNodeToBlock;
254598
254669
  if (tableNodeToBlock$1) {
254599
254670
  const tableBlock = tableNodeToBlock$1(child, {
@@ -254613,8 +254684,12 @@ function handleStructuredContentBlockNode(node2, context) {
254613
254684
  recordBlockKind?.(tableBlock.kind);
254614
254685
  }
254615
254686
  }
254687
+ return;
254616
254688
  }
254617
- });
254689
+ if (child.type === "documentPartObject" && Array.isArray(child.content))
254690
+ child.content.forEach(visitChild);
254691
+ };
254692
+ node2.content.forEach(visitChild);
254618
254693
  }
254619
254694
  function processParagraphChild(child, sectionMetadata, context, output, converters$1) {
254620
254695
  const paragraphBlocks = converters$1.paragraphToFlowBlocks({
@@ -287379,6 +287454,58 @@ menclose::after {
287379
287454
  blocks2.push(block);
287380
287455
  });
287381
287456
  };
287457
+ const flattenSdtWrappersIntoCell = (wrapperNode, inheritedSdtMetadata) => {
287458
+ if (!Array.isArray(wrapperNode.content))
287459
+ return;
287460
+ for (const nestedNode of wrapperNode.content) {
287461
+ if (nestedNode.type === "paragraph") {
287462
+ if (!paragraphToFlowBlocks$1)
287463
+ continue;
287464
+ appendParagraphBlocks(paragraphToFlowBlocks$1({
287465
+ para: nestedNode,
287466
+ nextBlockId: context.nextBlockId,
287467
+ positions: context.positions,
287468
+ storyKey: context.storyKey,
287469
+ trackedChangesConfig: context.trackedChangesConfig,
287470
+ bookmarks: context.bookmarks,
287471
+ hyperlinkConfig: context.hyperlinkConfig,
287472
+ themeColors: context.themeColors,
287473
+ converterContext: cellConverterContext,
287474
+ converters: context.converters,
287475
+ enableComments: context.enableComments
287476
+ }), inheritedSdtMetadata);
287477
+ continue;
287478
+ }
287479
+ if (nestedNode.type === "table" && tableNodeToBlock$1) {
287480
+ const tableBlock = tableNodeToBlock$1(nestedNode, {
287481
+ nextBlockId: context.nextBlockId,
287482
+ positions: context.positions,
287483
+ storyKey: context.storyKey,
287484
+ trackedChangesConfig: context.trackedChangesConfig,
287485
+ bookmarks: context.bookmarks,
287486
+ hyperlinkConfig: context.hyperlinkConfig,
287487
+ themeColors: context.themeColors,
287488
+ converterContext: context.converterContext,
287489
+ converters: context.converters,
287490
+ enableComments: context.enableComments
287491
+ });
287492
+ if (tableBlock && tableBlock.kind === "table") {
287493
+ if (inheritedSdtMetadata)
287494
+ applySdtMetadataToTableBlock(tableBlock, inheritedSdtMetadata);
287495
+ blocks2.push(tableBlock);
287496
+ }
287497
+ continue;
287498
+ }
287499
+ if (nestedNode.type === "documentPartObject") {
287500
+ flattenSdtWrappersIntoCell(nestedNode, inheritedSdtMetadata);
287501
+ continue;
287502
+ }
287503
+ if (nestedNode.type === "structuredContentBlock") {
287504
+ flattenSdtWrappersIntoCell(nestedNode, inheritedSdtMetadata ?? resolveNodeSdtMetadata(nestedNode, "structuredContentBlock"));
287505
+ continue;
287506
+ }
287507
+ }
287508
+ };
287382
287509
  for (const childNode of cellNode.content) {
287383
287510
  if (childNode.type === "paragraph") {
287384
287511
  if (!paragraphToFlowBlocks$1)
@@ -287399,46 +287526,7 @@ menclose::after {
287399
287526
  continue;
287400
287527
  }
287401
287528
  if (childNode.type === "structuredContentBlock" && Array.isArray(childNode.content)) {
287402
- const structuredContentMetadata = resolveNodeSdtMetadata(childNode, "structuredContentBlock");
287403
- for (const nestedNode of childNode.content) {
287404
- if (nestedNode.type === "paragraph") {
287405
- if (!paragraphToFlowBlocks$1)
287406
- continue;
287407
- appendParagraphBlocks(paragraphToFlowBlocks$1({
287408
- para: nestedNode,
287409
- nextBlockId: context.nextBlockId,
287410
- positions: context.positions,
287411
- storyKey: context.storyKey,
287412
- trackedChangesConfig: context.trackedChangesConfig,
287413
- bookmarks: context.bookmarks,
287414
- hyperlinkConfig: context.hyperlinkConfig,
287415
- themeColors: context.themeColors,
287416
- converterContext: cellConverterContext,
287417
- converters: context.converters,
287418
- enableComments: context.enableComments
287419
- }), structuredContentMetadata);
287420
- continue;
287421
- }
287422
- if (nestedNode.type === "table" && tableNodeToBlock$1) {
287423
- const tableBlock = tableNodeToBlock$1(nestedNode, {
287424
- nextBlockId: context.nextBlockId,
287425
- positions: context.positions,
287426
- storyKey: context.storyKey,
287427
- trackedChangesConfig: context.trackedChangesConfig,
287428
- bookmarks: context.bookmarks,
287429
- hyperlinkConfig: context.hyperlinkConfig,
287430
- themeColors: context.themeColors,
287431
- converterContext: context.converterContext,
287432
- converters: context.converters,
287433
- enableComments: context.enableComments
287434
- });
287435
- if (tableBlock && tableBlock.kind === "table") {
287436
- applySdtMetadataToTableBlock(tableBlock, structuredContentMetadata);
287437
- blocks2.push(tableBlock);
287438
- }
287439
- continue;
287440
- }
287441
- }
287529
+ flattenSdtWrappersIntoCell(childNode, resolveNodeSdtMetadata(childNode, "structuredContentBlock"));
287442
287530
  continue;
287443
287531
  }
287444
287532
  if (childNode.type === "table" && tableNodeToBlock$1) {
@@ -287458,6 +287546,10 @@ menclose::after {
287458
287546
  blocks2.push(tableBlock);
287459
287547
  continue;
287460
287548
  }
287549
+ if (childNode.type === "documentPartObject" && Array.isArray(childNode.content)) {
287550
+ flattenSdtWrappersIntoCell(childNode, undefined);
287551
+ continue;
287552
+ }
287461
287553
  if (childNode.type === "image" && context.converters?.imageNodeToBlock) {
287462
287554
  const mergedMarks = [...childNode.marks ?? []];
287463
287555
  const trackedMeta = context.trackedChangesConfig ? collectTrackedChangeFromMarks(mergedMarks, context.storyKey) : undefined;
@@ -292673,12 +292765,12 @@ menclose::after {
292673
292765
  return;
292674
292766
  console.log(...args$1);
292675
292767
  }, 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;
292676
- var init_src_BE_DiVIy_es = __esm(() => {
292768
+ var init_src_tOywM1hR_es = __esm(() => {
292677
292769
  init_rolldown_runtime_Bg48TavK_es();
292678
- init_SuperConverter_C9I74vtg_es();
292770
+ init_SuperConverter_CjDkqrj8_es();
292679
292771
  init_jszip_C49i9kUs_es();
292680
292772
  init_uuid_qzgm05fK_es();
292681
- init_create_headless_toolbar_B7nufamW_es();
292773
+ init_create_headless_toolbar_pGestihw_es();
292682
292774
  init_constants_DrU4EASo_es();
292683
292775
  init_dist_B8HfvhaK_es();
292684
292776
  init_unified_Dsuw2be5_es();
@@ -330422,11 +330514,11 @@ function print() { __p += __j.call(arguments, '') }
330422
330514
  ];
330423
330515
  });
330424
330516
 
330425
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CmG_8rWP.es.js
330517
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-Cj3mqS9_.es.js
330426
330518
  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;
330427
- var init_create_super_doc_ui_CmG_8rWP_es = __esm(() => {
330428
- init_SuperConverter_C9I74vtg_es();
330429
- init_create_headless_toolbar_B7nufamW_es();
330519
+ var init_create_super_doc_ui_Cj3mqS9__es = __esm(() => {
330520
+ init_SuperConverter_CjDkqrj8_es();
330521
+ init_create_headless_toolbar_pGestihw_es();
330430
330522
  MOD_ALIASES = new Set([
330431
330523
  "Mod",
330432
330524
  "Meta",
@@ -330468,16 +330560,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
330468
330560
 
330469
330561
  // ../../packages/superdoc/dist/super-editor.es.js
330470
330562
  var init_super_editor_es = __esm(() => {
330471
- init_src_BE_DiVIy_es();
330472
- init_SuperConverter_C9I74vtg_es();
330563
+ init_src_tOywM1hR_es();
330564
+ init_SuperConverter_CjDkqrj8_es();
330473
330565
  init_jszip_C49i9kUs_es();
330474
330566
  init_xml_js_CqGKpaft_es();
330475
- init_create_headless_toolbar_B7nufamW_es();
330567
+ init_create_headless_toolbar_pGestihw_es();
330476
330568
  init_constants_DrU4EASo_es();
330477
330569
  init_dist_B8HfvhaK_es();
330478
330570
  init_unified_Dsuw2be5_es();
330479
330571
  init_DocxZipper_Dh4RtvcE_es();
330480
- init_create_super_doc_ui_CmG_8rWP_es();
330572
+ init_create_super_doc_ui_Cj3mqS9__es();
330481
330573
  init_ui_CGB3qmy3_es();
330482
330574
  init_eventemitter3_UwU_CLPU_es();
330483
330575
  init_errors_C_DoKMoN_es();
@@ -394829,6 +394921,15 @@ function handleDocPartObj2(params3) {
394829
394921
  const docPartGallery = docPartObj?.elements.find((el) => el.name === "w:docPartGallery");
394830
394922
  const docPartGalleryType = docPartGallery?.attributes?.["w:val"] ?? null;
394831
394923
  const content4 = node4?.elements.find((el) => el.name === "w:sdtContent");
394924
+ const isInsideParagraph = (params3.path || []).some((p3) => p3?.name === "w:p");
394925
+ const hasBlockChild = !!content4?.elements?.some((el) => el?.name === "w:p" || el?.name === "w:tbl");
394926
+ if (isInsideParagraph && !hasBlockChild) {
394927
+ return inlineDocPartHandler2({
394928
+ ...params3,
394929
+ nodes: [content4],
394930
+ extraParams: { ...params3.extraParams || {}, sdtPr, docPartGalleryType }
394931
+ });
394932
+ }
394832
394933
  const handler2 = validGalleryTypeMap2[docPartGalleryType] || genericDocPartHandler2;
394833
394934
  const result = handler2({
394834
394935
  ...params3,
@@ -394837,7 +394938,30 @@ function handleDocPartObj2(params3) {
394837
394938
  });
394838
394939
  return result;
394839
394940
  }
394840
- var tableOfContentsHandler2 = (params3) => {
394941
+ var inlineDocPartHandler2 = (params3) => {
394942
+ const node4 = params3.nodes[0];
394943
+ const translatedContent = params3.nodeListHandler.handler({
394944
+ ...params3,
394945
+ nodes: node4?.elements || [],
394946
+ path: [...params3.path || [], node4]
394947
+ });
394948
+ const sdtPr = params3.extraParams.sdtPr;
394949
+ const docPartGalleryType = params3.extraParams.docPartGalleryType;
394950
+ const id2 = sdtPr?.elements?.find((el) => el.name === "w:id")?.attributes?.["w:val"] || null;
394951
+ const docPartObj = sdtPr?.elements.find((el) => el.name === "w:docPartObj");
394952
+ const docPartGallery = docPartGalleryType ?? docPartObj?.elements?.find((el) => el.name === "w:docPartGallery")?.attributes?.["w:val"] ?? null;
394953
+ const docPartUnique = docPartObj?.elements?.some((el) => el.name === "w:docPartUnique") ?? false;
394954
+ return {
394955
+ type: "structuredContent",
394956
+ content: translatedContent,
394957
+ attrs: {
394958
+ id: id2,
394959
+ docPartGallery,
394960
+ docPartUnique,
394961
+ sdtPr
394962
+ }
394963
+ };
394964
+ }, tableOfContentsHandler2 = (params3) => {
394841
394965
  const node4 = params3.nodes[0];
394842
394966
  const translatedContent = translateTocSdtContent2(node4, params3);
394843
394967
  const normalizedContent = normalizeDocPartContent2(translatedContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.3.0-next.69",
3
+ "version": "0.3.0-next.70",
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.31.0",
24
- "@superdoc/super-editor": "0.0.1"
23
+ "@superdoc/super-editor": "0.0.1",
24
+ "superdoc": "1.31.0"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"