@superdoc-dev/mcp 0.3.0-next.87 → 0.3.0-next.88

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 +116 -54
  2. package/package.json +2 -2
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-5Idv4fhC.es.js
51894
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CbX9ZPI9.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")
@@ -91625,25 +91625,62 @@ var isRegExp = (value) => {
91625
91625
  node2._vMergeConsumed = true;
91626
91626
  }, getTableCellMargins = (inlineMargins, referencedStyles) => {
91627
91627
  const { cellMargins = {} } = referencedStyles;
91628
- return [
91629
- "left",
91630
- "right",
91631
- "top",
91632
- "bottom"
91633
- ].reduce((acc, direction) => {
91634
- const key = `margin${direction.charAt(0).toUpperCase() + direction.slice(1)}`;
91635
- const inlineValue = inlineMargins ? inlineMargins?.[key]?.value : null;
91636
- const styleValue = cellMargins ? cellMargins[key] : null;
91637
- if (inlineValue != null)
91638
- acc[direction] = twipsToPixels(inlineValue);
91639
- else if (styleValue == null)
91640
- acc[direction] = undefined;
91641
- else if (typeof styleValue === "object")
91642
- acc[direction] = twipsToPixels(styleValue.value);
91628
+ const readMargin = (source, key) => {
91629
+ if (!source)
91630
+ return null;
91631
+ const v = source[key];
91632
+ if (v == null)
91633
+ return null;
91634
+ if (typeof v === "number")
91635
+ return v;
91636
+ if (typeof v === "object" && typeof v.value === "number")
91637
+ return v.value;
91638
+ return null;
91639
+ };
91640
+ const sides = [
91641
+ {
91642
+ physical: "top",
91643
+ physicalKey: "marginTop",
91644
+ logicalKey: null
91645
+ },
91646
+ {
91647
+ physical: "bottom",
91648
+ physicalKey: "marginBottom",
91649
+ logicalKey: null
91650
+ },
91651
+ {
91652
+ physical: "left",
91653
+ physicalKey: "marginLeft",
91654
+ logicalKey: "marginStart"
91655
+ },
91656
+ {
91657
+ physical: "right",
91658
+ physicalKey: "marginRight",
91659
+ logicalKey: "marginEnd"
91660
+ }
91661
+ ];
91662
+ const result = {};
91663
+ for (const { physical, physicalKey, logicalKey } of sides) {
91664
+ const inlinePhysical = readMargin(inlineMargins, physicalKey);
91665
+ const inlineLogical = logicalKey ? readMargin(inlineMargins, logicalKey) : null;
91666
+ if (inlinePhysical != null) {
91667
+ result[physical] = twipsToPixels(inlinePhysical);
91668
+ continue;
91669
+ }
91670
+ if (inlineLogical != null) {
91671
+ result[physical] = twipsToPixels(inlineLogical);
91672
+ continue;
91673
+ }
91674
+ const stylePhysical = readMargin(cellMargins, physicalKey);
91675
+ const styleLogical = logicalKey ? readMargin(cellMargins, logicalKey) : null;
91676
+ if (stylePhysical != null)
91677
+ result[physical] = twipsToPixels(stylePhysical);
91678
+ else if (styleLogical != null)
91679
+ result[physical] = twipsToPixels(styleLogical);
91643
91680
  else
91644
- acc[direction] = twipsToPixels(styleValue);
91645
- return acc;
91646
- }, {});
91681
+ result[physical] = undefined;
91682
+ }
91683
+ return result;
91647
91684
  }, PX_PER_PT$1, pxToEighthPoints = (px) => Math.round(px / PX_PER_PT$1 * 8), SIDES, XML_NODE_NAME$30 = "w:tc", SD_NODE_NAME$29 = "tableCell", validXmlAttributes$8, config$29, translator$6, propertyTranslators$9, translator$154, translator$51, translator$68, translator$69, translator$74, translator$157, translator$160, translator$172, translator$177, translator$178, propertyTranslators$8, translator$173, createPlaceholderCell = (gridWidth, reason) => {
91648
91685
  const safeWidth = Number.isFinite(gridWidth) ? gridWidth : 0;
91649
91686
  const noBorder = {
@@ -105344,7 +105381,7 @@ var isRegExp = (value) => {
105344
105381
  state.kern = kernNode.attributes["w:val"];
105345
105382
  }
105346
105383
  }, SuperConverter;
105347
- var init_SuperConverter_5Idv4fhC_es = __esm(() => {
105384
+ var init_SuperConverter_CbX9ZPI9_es = __esm(() => {
105348
105385
  init_rolldown_runtime_Bg48TavK_es();
105349
105386
  init_jszip_C49i9kUs_es();
105350
105387
  init_xml_js_CqGKpaft_es();
@@ -143213,7 +143250,7 @@ var init_SuperConverter_5Idv4fhC_es = __esm(() => {
143213
143250
  };
143214
143251
  });
143215
143252
 
143216
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CEUTigkM.es.js
143253
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CbUkXBcM.es.js
143217
143254
  function parseSizeUnit(val = "0") {
143218
143255
  const length = val.toString() || "0";
143219
143256
  const value = Number.parseFloat(length);
@@ -145935,8 +145972,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
145935
145972
  }
145936
145973
  };
145937
145974
  };
145938
- var init_create_headless_toolbar_CEUTigkM_es = __esm(() => {
145939
- init_SuperConverter_5Idv4fhC_es();
145975
+ var init_create_headless_toolbar_CbUkXBcM_es = __esm(() => {
145976
+ init_SuperConverter_CbX9ZPI9_es();
145940
145977
  init_constants_DrU4EASo_es();
145941
145978
  init_dist_B8HfvhaK_es();
145942
145979
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -200154,7 +200191,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
200154
200191
  init_remark_gfm_BhnWr3yf_es();
200155
200192
  });
200156
200193
 
200157
- // ../../packages/superdoc/dist/chunks/src-OZOxpRA7.es.js
200194
+ // ../../packages/superdoc/dist/chunks/src-BVPPjYkZ.es.js
200158
200195
  function deleteProps(obj, propOrProps) {
200159
200196
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
200160
200197
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -288357,11 +288394,10 @@ menclose::after {
288357
288394
  }, EMPTY_CHART_DATA, hydrateTableStyleAttrs = (tableNode, context, effectiveStyleId) => {
288358
288395
  const hydration = {};
288359
288396
  const tableProps = tableNode.attrs?.tableProperties ?? null;
288360
- const isRtlTable$1 = tableProps?.rightToLeft === true;
288361
288397
  let inlineBorders;
288362
288398
  let inlinePadding;
288363
288399
  if (tableProps) {
288364
- const padding = convertCellMarginsToPx(tableProps.cellMargins, isRtlTable$1);
288400
+ const padding = convertCellMarginsToPx(tableProps.cellMargins);
288365
288401
  if (padding)
288366
288402
  inlinePadding = normalizeCellPaddingTopBottom(padding);
288367
288403
  if (tableProps.borders && typeof tableProps.borders === "object")
@@ -288392,7 +288428,7 @@ menclose::after {
288392
288428
  } else if (inlineBorders)
288393
288429
  hydration.borders = inlineBorders;
288394
288430
  if (resolved.cellMargins) {
288395
- const stylePadding = convertCellMarginsToPx(resolved.cellMargins, isRtlTable$1);
288431
+ const stylePadding = convertCellMarginsToPx(resolved.cellMargins);
288396
288432
  if (stylePadding) {
288397
288433
  const normalizedStylePadding = normalizeCellPaddingTopBottom(stylePadding);
288398
288434
  hydration.cellPadding = inlinePadding ? {
@@ -288458,7 +288494,7 @@ menclose::after {
288458
288494
  ...border,
288459
288495
  size: size$1
288460
288496
  } : border;
288461
- }, convertCellMarginsToPx = (margins, isRtlTable$1 = false) => {
288497
+ }, convertCellMarginsToPx = (margins) => {
288462
288498
  if (!margins || typeof margins !== "object")
288463
288499
  return;
288464
288500
  const spacing = {};
@@ -288471,8 +288507,8 @@ menclose::after {
288471
288507
  marginBottom: "bottom",
288472
288508
  marginLeft: "left",
288473
288509
  marginRight: "right",
288474
- marginStart: isRtlTable$1 ? "right" : "left",
288475
- marginEnd: isRtlTable$1 ? "left" : "right"
288510
+ marginStart: "left",
288511
+ marginEnd: "right"
288476
288512
  };
288477
288513
  Object.entries(margins).forEach(([key2, value]) => {
288478
288514
  const side = keyMap[key2];
@@ -293958,12 +293994,12 @@ menclose::after {
293958
293994
  return;
293959
293995
  console.log(...args$1);
293960
293996
  }, 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;
293961
- var init_src_OZOxpRA7_es = __esm(() => {
293997
+ var init_src_BVPPjYkZ_es = __esm(() => {
293962
293998
  init_rolldown_runtime_Bg48TavK_es();
293963
- init_SuperConverter_5Idv4fhC_es();
293999
+ init_SuperConverter_CbX9ZPI9_es();
293964
294000
  init_jszip_C49i9kUs_es();
293965
294001
  init_uuid_qzgm05fK_es();
293966
- init_create_headless_toolbar_CEUTigkM_es();
294002
+ init_create_headless_toolbar_CbUkXBcM_es();
293967
294003
  init_constants_DrU4EASo_es();
293968
294004
  init_dist_B8HfvhaK_es();
293969
294005
  init_unified_Dsuw2be5_es();
@@ -332004,11 +332040,11 @@ function print() { __p += __j.call(arguments, '') }
332004
332040
  ];
332005
332041
  });
332006
332042
 
332007
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BGYHCZ5O.es.js
332043
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CkcWwDom.es.js
332008
332044
  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;
332009
- var init_create_super_doc_ui_BGYHCZ5O_es = __esm(() => {
332010
- init_SuperConverter_5Idv4fhC_es();
332011
- init_create_headless_toolbar_CEUTigkM_es();
332045
+ var init_create_super_doc_ui_CkcWwDom_es = __esm(() => {
332046
+ init_SuperConverter_CbX9ZPI9_es();
332047
+ init_create_headless_toolbar_CbUkXBcM_es();
332012
332048
  MOD_ALIASES = new Set([
332013
332049
  "Mod",
332014
332050
  "Meta",
@@ -332050,16 +332086,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
332050
332086
 
332051
332087
  // ../../packages/superdoc/dist/super-editor.es.js
332052
332088
  var init_super_editor_es = __esm(() => {
332053
- init_src_OZOxpRA7_es();
332054
- init_SuperConverter_5Idv4fhC_es();
332089
+ init_src_BVPPjYkZ_es();
332090
+ init_SuperConverter_CbX9ZPI9_es();
332055
332091
  init_jszip_C49i9kUs_es();
332056
332092
  init_xml_js_CqGKpaft_es();
332057
- init_create_headless_toolbar_CEUTigkM_es();
332093
+ init_create_headless_toolbar_CbUkXBcM_es();
332058
332094
  init_constants_DrU4EASo_es();
332059
332095
  init_dist_B8HfvhaK_es();
332060
332096
  init_unified_Dsuw2be5_es();
332061
332097
  init_DocxZipper_Dh4RtvcE_es();
332062
- init_create_super_doc_ui_BGYHCZ5O_es();
332098
+ init_create_super_doc_ui_CkcWwDom_es();
332063
332099
  init_ui_CGB3qmy3_es();
332064
332100
  init_eventemitter3_UwU_CLPU_es();
332065
332101
  init_errors_C_DoKMoN_es();
@@ -395476,21 +395512,47 @@ var getTableCellVMerge2 = (node4) => {
395476
395512
  }
395477
395513
  }, getTableCellMargins2 = (inlineMargins, referencedStyles) => {
395478
395514
  const { cellMargins = {} } = referencedStyles;
395479
- return ["left", "right", "top", "bottom"].reduce((acc, direction) => {
395480
- const key2 = `margin${direction.charAt(0).toUpperCase() + direction.slice(1)}`;
395481
- const inlineValue = inlineMargins ? inlineMargins?.[key2]?.value : null;
395482
- const styleValue = cellMargins ? cellMargins[key2] : null;
395483
- if (inlineValue != null) {
395484
- acc[direction] = twipsToPixels4(inlineValue);
395485
- } else if (styleValue == null) {
395486
- acc[direction] = undefined;
395487
- } else if (typeof styleValue === "object") {
395488
- acc[direction] = twipsToPixels4(styleValue.value);
395515
+ const readMargin = (source, key2) => {
395516
+ if (!source)
395517
+ return null;
395518
+ const v = source[key2];
395519
+ if (v == null)
395520
+ return null;
395521
+ if (typeof v === "number")
395522
+ return v;
395523
+ if (typeof v === "object" && typeof v.value === "number")
395524
+ return v.value;
395525
+ return null;
395526
+ };
395527
+ const sides = [
395528
+ { physical: "top", physicalKey: "marginTop", logicalKey: null },
395529
+ { physical: "bottom", physicalKey: "marginBottom", logicalKey: null },
395530
+ { physical: "left", physicalKey: "marginLeft", logicalKey: "marginStart" },
395531
+ { physical: "right", physicalKey: "marginRight", logicalKey: "marginEnd" }
395532
+ ];
395533
+ const result = {};
395534
+ for (const { physical, physicalKey, logicalKey } of sides) {
395535
+ const inlinePhysical = readMargin(inlineMargins, physicalKey);
395536
+ const inlineLogical = logicalKey ? readMargin(inlineMargins, logicalKey) : null;
395537
+ if (inlinePhysical != null) {
395538
+ result[physical] = twipsToPixels4(inlinePhysical);
395539
+ continue;
395540
+ }
395541
+ if (inlineLogical != null) {
395542
+ result[physical] = twipsToPixels4(inlineLogical);
395543
+ continue;
395544
+ }
395545
+ const stylePhysical = readMargin(cellMargins, physicalKey);
395546
+ const styleLogical = logicalKey ? readMargin(cellMargins, logicalKey) : null;
395547
+ if (stylePhysical != null) {
395548
+ result[physical] = twipsToPixels4(stylePhysical);
395549
+ } else if (styleLogical != null) {
395550
+ result[physical] = twipsToPixels4(styleLogical);
395489
395551
  } else {
395490
- acc[direction] = twipsToPixels4(styleValue);
395552
+ result[physical] = undefined;
395491
395553
  }
395492
- return acc;
395493
- }, {});
395554
+ }
395555
+ return result;
395494
395556
  };
395495
395557
  var init_legacy_handle_table_cell_node = __esm(() => {
395496
395558
  init_helpers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.3.0-next.87",
3
+ "version": "0.3.0-next.88",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -19,8 +19,8 @@
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",
23
+ "@superdoc/super-editor": "0.0.1",
24
24
  "superdoc": "1.32.0"
25
25
  },
26
26
  "publishConfig": {