@superdoc-dev/mcp 0.7.0-next.21 → 0.7.0-next.23

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 +44 -33
  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-UqLu6KQU.es.js
51894
+ // ../../packages/superdoc/dist/chunks/SuperConverter-BptSHzcb.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")
@@ -72409,7 +72409,7 @@ function generateNewListDefinition(numbering, options) {
72409
72409
  }
72410
72410
  if (level != null && start != null && text$2 != null && fmt != null) {
72411
72411
  if (numbering.definitions[numId]) {
72412
- const abstractId = numbering.definitions[numId]?.elements[0]?.attributes["w:val"];
72412
+ const abstractId = numbering.definitions[numId]?.elements?.[0]?.attributes?.["w:val"];
72413
72413
  newAbstractId = abstractId;
72414
72414
  newAbstractDef = { ...numbering.abstracts[abstractId] };
72415
72415
  skipAddingNewAbstract = true;
@@ -105867,7 +105867,7 @@ var isRegExp = (value) => {
105867
105867
  state.kern = kernNode.attributes["w:val"];
105868
105868
  }
105869
105869
  }, SuperConverter;
105870
- var init_SuperConverter_UqLu6KQU_es = __esm(() => {
105870
+ var init_SuperConverter_BptSHzcb_es = __esm(() => {
105871
105871
  init_rolldown_runtime_Bg48TavK_es();
105872
105872
  init_jszip_C49i9kUs_es();
105873
105873
  init_xml_js_CqGKpaft_es();
@@ -144047,7 +144047,7 @@ var init_SuperConverter_UqLu6KQU_es = __esm(() => {
144047
144047
  };
144048
144048
  });
144049
144049
 
144050
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-QcQvy-nD.es.js
144050
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-nX0t772H.es.js
144051
144051
  function parseSizeUnit(val = "0") {
144052
144052
  const length = val.toString() || "0";
144053
144053
  const value = Number.parseFloat(length);
@@ -153241,6 +153241,10 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153241
153241
  if (typeof checker !== "function")
153242
153242
  return false;
153243
153243
  return Boolean(checker(attrs));
153244
+ }, hasFormattingAttrs = (entry) => {
153245
+ return typeof entry.attrs === "object" && entry.attrs !== null;
153246
+ }, getFormattingAttr = (entries, name, attr) => {
153247
+ return entries.filter((entry) => entry.name === name && hasFormattingAttrs(entry)).map((entry) => entry.attrs[attr]).filter((value) => value != null);
153244
153248
  }, normalizeFontSizeValue = (value) => {
153245
153249
  if (typeof value === "number")
153246
153250
  return `${value}pt`;
@@ -153269,7 +153273,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153269
153273
  return Boolean(linkedStyle?.definition?.styles && styleKey in linkedStyle.definition.styles);
153270
153274
  }, hasNegatedFormattingMark = (formatting, markName) => {
153271
153275
  const rawActiveMark = formatting.find((mark) => mark.name === markName);
153272
- return rawActiveMark ? isNegatedMark(rawActiveMark.name, rawActiveMark.attrs) : false;
153276
+ if (!rawActiveMark || !hasFormattingAttrs(rawActiveMark))
153277
+ return false;
153278
+ return isNegatedMark(rawActiveMark.name, rawActiveMark.attrs);
153273
153279
  }, isFormatCommandsStorage = (value) => {
153274
153280
  return typeof value === "object" && value !== null && "storedStyle" in value;
153275
153281
  }, hasStoredCopyFormat = (context) => {
@@ -153340,7 +153346,7 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153340
153346
  disabled: true,
153341
153347
  value: null
153342
153348
  };
153343
- const normalizedValues = formatting.filter((mark) => mark.name === "fontSize").map((mark) => mark.attrs?.fontSize).filter((value$1) => value$1 != null).map((value$1) => normalizeFontSizeValue(value$1));
153349
+ const normalizedValues = getFormattingAttr(formatting, "fontSize", "fontSize").map((value$1) => normalizeFontSizeValue(value$1));
153344
153350
  const uniqueValues = [...new Set(normalizedValues)];
153345
153351
  const hasDirectValue = uniqueValues.length > 0;
153346
153352
  const canUseLinkedStyle = !hasDirectValue && isFormattingActivatedFromLinkedStyle(context, "font-size");
@@ -153362,7 +153368,7 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153362
153368
  disabled: true,
153363
153369
  value: null
153364
153370
  };
153365
- const normalizedValues = formatting.filter((mark) => mark.name === "fontFamily").map((mark) => mark.attrs?.fontFamily).filter((value$1) => value$1 != null).map((value$1) => normalizeFontFamilyValue(value$1));
153371
+ const normalizedValues = getFormattingAttr(formatting, "fontFamily", "fontFamily").map((value$1) => normalizeFontFamilyValue(value$1));
153366
153372
  const uniqueValues = [...new Set(normalizedValues)];
153367
153373
  const canUseLinkedStyle = !(uniqueValues.length > 0) && isFormattingActivatedFromLinkedStyle(context, "font-family");
153368
153374
  const paragraphProps = canUseLinkedStyle ? getCurrentResolvedParagraphProperties(context) : null;
@@ -153383,7 +153389,7 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153383
153389
  disabled: true,
153384
153390
  value: null
153385
153391
  };
153386
- const values = formatting.filter((mark) => mark.name === "color").map((mark) => mark.attrs?.color).filter((value$1) => value$1 != null);
153392
+ const values = getFormattingAttr(formatting, "color", "color");
153387
153393
  const markNegated = hasNegatedFormattingMark(formatting, "color");
153388
153394
  const normalizedValues = values.map((value$1) => normalizeColorValue(value$1));
153389
153395
  const uniqueValues = [...new Set(normalizedValues)];
@@ -153402,7 +153408,7 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153402
153408
  disabled: true,
153403
153409
  value: null
153404
153410
  };
153405
- const values = formatting.filter((mark) => mark.name === "highlight").map((mark) => mark.attrs?.color).filter((value$1) => value$1 != null);
153411
+ const values = getFormattingAttr(formatting, "highlight", "color");
153406
153412
  const markNegated = hasNegatedFormattingMark(formatting, "highlight");
153407
153413
  const normalizedValues = values.map((value$1) => normalizeColorValue(value$1));
153408
153414
  const uniqueValues = [...new Set(normalizedValues)];
@@ -153421,7 +153427,7 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
153421
153427
  disabled: true,
153422
153428
  value: null
153423
153429
  };
153424
- const normalizedValues = formatting.filter((mark) => mark.name === "link").map((mark) => mark.attrs?.href).filter((value$1) => value$1 != null).map((value$1) => normalizeLinkHrefValue(value$1));
153430
+ const normalizedValues = getFormattingAttr(formatting, "link", "href").map((value$1) => normalizeLinkHrefValue(value$1));
153425
153431
  const uniqueValues = [...new Set(normalizedValues)];
153426
153432
  const value = uniqueValues.length === 1 ? uniqueValues[0] : null;
153427
153433
  return {
@@ -154064,8 +154070,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
154064
154070
  }
154065
154071
  };
154066
154072
  };
154067
- var init_create_headless_toolbar_QcQvy_nD_es = __esm(() => {
154068
- init_SuperConverter_UqLu6KQU_es();
154073
+ var init_create_headless_toolbar_nX0t772H_es = __esm(() => {
154074
+ init_SuperConverter_BptSHzcb_es();
154069
154075
  init_uuid_qzgm05fK_es();
154070
154076
  init_constants_DrU4EASo_es();
154071
154077
  init_dist_B8HfvhaK_es();
@@ -208791,7 +208797,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
208791
208797
  init_remark_gfm_BhnWr3yf_es();
208792
208798
  });
208793
208799
 
208794
- // ../../packages/superdoc/dist/chunks/src-DygNo4Zh.es.js
208800
+ // ../../packages/superdoc/dist/chunks/src-DOX3DoA2.es.js
208795
208801
  function deleteProps(obj, propOrProps) {
208796
208802
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
208797
208803
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -235482,15 +235488,16 @@ function getPayloadVersionForCoverage(coverage) {
235482
235488
  return coverage.headerFooters ? PAYLOAD_VERSION_V2 : PAYLOAD_VERSION_V1;
235483
235489
  }
235484
235490
  function createDiffAdapter(editor) {
235491
+ const diffEditor = editor;
235485
235492
  return {
235486
235493
  capture() {
235487
- return wrapServiceCall(() => captureSnapshot(editor));
235494
+ return wrapServiceCall(() => captureSnapshot(diffEditor));
235488
235495
  },
235489
235496
  compare(input2) {
235490
- return wrapServiceCall(() => compareToSnapshot(editor, input2.targetSnapshot));
235497
+ return wrapServiceCall(() => compareToSnapshot(diffEditor, input2.targetSnapshot));
235491
235498
  },
235492
235499
  apply(input2, options) {
235493
- const { result, tr } = wrapServiceCall(() => applyDiffPayload(editor, input2.diff, options));
235500
+ const { result, tr } = wrapServiceCall(() => applyDiffPayload(diffEditor, input2.diff, options));
235494
235501
  if (tr.docChanged || result.appliedOperations > 0)
235495
235502
  editor.dispatch(tr);
235496
235503
  editor.emit("commentsUpdate", { type: "replayCompleted" });
@@ -297180,13 +297187,13 @@ menclose::after {
297180
297187
  return;
297181
297188
  console.log(...args$1);
297182
297189
  }, 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;
297183
- var init_src_DygNo4Zh_es = __esm(() => {
297190
+ var init_src_DOX3DoA2_es = __esm(() => {
297184
297191
  init_rolldown_runtime_Bg48TavK_es();
297185
- init_SuperConverter_UqLu6KQU_es();
297192
+ init_SuperConverter_BptSHzcb_es();
297186
297193
  init_jszip_C49i9kUs_es();
297187
297194
  init_xml_js_CqGKpaft_es();
297188
297195
  init_uuid_qzgm05fK_es();
297189
- init_create_headless_toolbar_QcQvy_nD_es();
297196
+ init_create_headless_toolbar_nX0t772H_es();
297190
297197
  init_constants_DrU4EASo_es();
297191
297198
  init_dist_B8HfvhaK_es();
297192
297199
  init_unified_Dsuw2be5_es();
@@ -321388,7 +321395,7 @@ function print() { __p += __j.call(arguments, '') }
321388
321395
  if (!this.#telemetry || this.#documentOpenTracked)
321389
321396
  return;
321390
321397
  try {
321391
- const documentCreatedAt = this.converter?.getDocumentCreatedTimestamp?.() || null;
321398
+ const documentCreatedAt = this.converter?.getDocumentCreatedTimestamp?.() ?? null;
321392
321399
  this.#telemetry.trackDocumentOpen(documentId, documentCreatedAt);
321393
321400
  this.#documentOpenTracked = true;
321394
321401
  } catch {}
@@ -334959,11 +334966,11 @@ function print() { __p += __j.call(arguments, '') }
334959
334966
  ];
334960
334967
  });
334961
334968
 
334962
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BuJIur0F.es.js
334969
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DgOJ39d-.es.js
334963
334970
  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;
334964
- var init_create_super_doc_ui_BuJIur0F_es = __esm(() => {
334965
- init_SuperConverter_UqLu6KQU_es();
334966
- init_create_headless_toolbar_QcQvy_nD_es();
334971
+ var init_create_super_doc_ui_DgOJ39d_es = __esm(() => {
334972
+ init_SuperConverter_BptSHzcb_es();
334973
+ init_create_headless_toolbar_nX0t772H_es();
334967
334974
  MOD_ALIASES = new Set([
334968
334975
  "Mod",
334969
334976
  "Meta",
@@ -335005,16 +335012,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
335005
335012
 
335006
335013
  // ../../packages/superdoc/dist/super-editor.es.js
335007
335014
  var init_super_editor_es = __esm(() => {
335008
- init_src_DygNo4Zh_es();
335009
- init_SuperConverter_UqLu6KQU_es();
335015
+ init_src_DOX3DoA2_es();
335016
+ init_SuperConverter_BptSHzcb_es();
335010
335017
  init_jszip_C49i9kUs_es();
335011
335018
  init_xml_js_CqGKpaft_es();
335012
- init_create_headless_toolbar_QcQvy_nD_es();
335019
+ init_create_headless_toolbar_nX0t772H_es();
335013
335020
  init_constants_DrU4EASo_es();
335014
335021
  init_dist_B8HfvhaK_es();
335015
335022
  init_unified_Dsuw2be5_es();
335016
335023
  init_DocxZipper_CZMPWpOp_es();
335017
- init_create_super_doc_ui_BuJIur0F_es();
335024
+ init_create_super_doc_ui_DgOJ39d_es();
335018
335025
  init_ui_C5PAS9hY_es();
335019
335026
  init_eventemitter3_BnGqBE_Q_es();
335020
335027
  init_errors_CNaD6vcg_es();
@@ -418204,7 +418211,10 @@ class CommandService3 {
418204
418211
  can: () => this.createCan(tr),
418205
418212
  get commands() {
418206
418213
  return Object.fromEntries(Object.entries(rawCommands).map(([name, command2]) => {
418207
- return [name, (...args3) => command2(...args3)(props)];
418214
+ return [
418215
+ name,
418216
+ (...args3) => command2(...args3)(props)
418217
+ ];
418208
418218
  }));
418209
418219
  }
418210
418220
  };
@@ -435692,7 +435702,7 @@ function generateNewListDefinition2(numbering, options) {
435692
435702
  }
435693
435703
  if (level != null && start2 != null && text9 != null && fmt != null) {
435694
435704
  if (numbering.definitions[numId]) {
435695
- const abstractId = numbering.definitions[numId]?.elements[0]?.attributes["w:val"];
435705
+ const abstractId = numbering.definitions[numId]?.elements?.[0]?.attributes?.["w:val"];
435696
435706
  newAbstractId = abstractId;
435697
435707
  const abstract = numbering.abstracts[abstractId];
435698
435708
  newAbstractDef = { ...abstract };
@@ -458840,15 +458850,16 @@ var init_service = __esm(() => {
458840
458850
 
458841
458851
  // ../../packages/super-editor/src/editors/v1/document-api-adapters/diff-adapter.ts
458842
458852
  function createDiffAdapter2(editor) {
458853
+ const diffEditor = editor;
458843
458854
  return {
458844
458855
  capture() {
458845
- return wrapServiceCall2(() => captureSnapshot2(editor));
458856
+ return wrapServiceCall2(() => captureSnapshot2(diffEditor));
458846
458857
  },
458847
458858
  compare(input2) {
458848
- return wrapServiceCall2(() => compareToSnapshot2(editor, input2.targetSnapshot));
458859
+ return wrapServiceCall2(() => compareToSnapshot2(diffEditor, input2.targetSnapshot));
458849
458860
  },
458850
458861
  apply(input2, options) {
458851
- const { result, tr } = wrapServiceCall2(() => applyDiffPayload2(editor, input2.diff, options));
458862
+ const { result, tr } = wrapServiceCall2(() => applyDiffPayload2(diffEditor, input2.diff, options));
458852
458863
  if (tr.docChanged || result.appliedOperations > 0) {
458853
458864
  editor.dispatch(tr);
458854
458865
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.7.0-next.21",
3
+ "version": "0.7.0-next.23",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -19,9 +19,9 @@
19
19
  "@types/bun": "^1.3.8",
20
20
  "@types/node": "22.19.2",
21
21
  "typescript": "^5.9.2",
22
- "@superdoc/document-api": "0.0.1",
22
+ "@superdoc/super-editor": "0.0.1",
23
23
  "superdoc": "1.34.0",
24
- "@superdoc/super-editor": "0.0.1"
24
+ "@superdoc/document-api": "0.0.1"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public"