@superdoc-dev/mcp 0.10.0-next.8 → 0.10.0

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 +126 -42
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -14569,7 +14569,7 @@ function finalize(ctx, schema) {
14569
14569
  result.$schema = "http://json-schema.org/draft-07/schema#";
14570
14570
  } else if (ctx.target === "draft-04") {
14571
14571
  result.$schema = "http://json-schema.org/draft-04/schema#";
14572
- } else if (ctx.target === "openapi-3.0") {}
14572
+ } else if (ctx.target === "openapi-3.0") {} else {}
14573
14573
  if (ctx.external?.uri) {
14574
14574
  const id = ctx.external.registry.get(schema)?.id;
14575
14575
  if (!id)
@@ -14834,7 +14834,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
14834
14834
  if (val === undefined) {
14835
14835
  if (ctx.unrepresentable === "throw") {
14836
14836
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
14837
- }
14837
+ } else {}
14838
14838
  } else if (typeof val === "bigint") {
14839
14839
  if (ctx.unrepresentable === "throw") {
14840
14840
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -186102,7 +186102,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
186102
186102
  patchFlag |= 2048;
186103
186103
  }
186104
186104
  root2.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root2.children, patchFlag, undefined, undefined, true, undefined, false);
186105
- }
186105
+ } else
186106
+ ;
186106
186107
  }
186107
186108
  function traverseChildren(parent, context) {
186108
186109
  let i4 = 0;
@@ -211378,7 +211379,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
211378
211379
  init_remark_gfm_BhnWr3yf_es();
211379
211380
  });
211380
211381
 
211381
- // ../../packages/superdoc/dist/chunks/src-DQ_lu_9z.es.js
211382
+ // ../../packages/superdoc/dist/chunks/src-Bm7Xq4ys.es.js
211382
211383
  function deleteProps(obj, propOrProps) {
211383
211384
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
211384
211385
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -281070,7 +281071,7 @@ var Node$13 = class Node$14 {
281070
281071
  }
281071
281072
  });
281072
281073
  }
281073
- }, COMPOSITION_INPUT_TYPES, COMBINING_MARK_REGEX, graphemeSegmenter, DEAD_KEY_PLACEHOLDER_MARKS, getTextNodeAtPos = ({ doc: doc$12, pos }) => {
281074
+ }, COMPOSITION_INPUT_TYPES, COMBINING_MARK_REGEX, graphemeSegmenter, DEAD_KEY_PLACEHOLDER_MARKS, TRACKABLE_META_KEYS, PASSTHROUGH_META_KEYS, ALLOWED_META_KEYS, getTextNodeAtPos = ({ doc: doc$12, pos }) => {
281074
281075
  let found2 = null;
281075
281076
  doc$12.nodesBetween(Math.max(0, pos - 1), Math.min(doc$12.content.size, pos + 1), (node2, nodePos) => {
281076
281077
  if (found2 || !node2.isText || !node2.text)
@@ -281261,6 +281262,12 @@ var Node$13 = class Node$14 {
281261
281262
  ...existingMeta,
281262
281263
  ...extraMeta
281263
281264
  });
281265
+ }, copyPassthroughMeta = (sourceTr, targetTr) => {
281266
+ PASSTHROUGH_META_KEYS.forEach((key2) => {
281267
+ const value = sourceTr.getMeta(key2);
281268
+ if (value !== undefined)
281269
+ targetTr.setMeta(key2, value);
281270
+ });
281264
281271
  }, getPendingDeadKeyPlaceholder = ({ tr, newTr, user }) => {
281265
281272
  if (!isCompositionTransaction(tr) || tr.steps.length !== 1)
281266
281273
  return null;
@@ -281290,13 +281297,6 @@ var Node$13 = class Node$14 {
281290
281297
  authorEmail: user.email
281291
281298
  };
281292
281299
  }, trackedTransaction = ({ tr, state, user, replacements = "paired" }) => {
281293
- const onlyInputTypeMeta = [
281294
- "inputType",
281295
- "uiEvent",
281296
- "paste",
281297
- "pointer",
281298
- "composition"
281299
- ];
281300
281300
  const notAllowedMeta = [
281301
281301
  "historyUndo",
281302
281302
  "historyRedo",
@@ -281305,13 +281305,7 @@ var Node$13 = class Node$14 {
281305
281305
  const isProgrammaticInput = tr.getMeta("inputType") === "programmatic";
281306
281306
  const ySyncMeta = tr.getMeta(ySyncPluginKey);
281307
281307
  const pendingDeadKeyPlaceholder = TrackChangesBasePluginKey.getState(state)?.pendingDeadKeyPlaceholder ?? null;
281308
- const allowedMeta = new Set([
281309
- ...onlyInputTypeMeta,
281310
- ySyncPluginKey.key,
281311
- "forceTrackChanges",
281312
- "protectTrackedReviewState"
281313
- ]);
281314
- const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta4) => !allowedMeta.has(meta4));
281308
+ const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta4) => !ALLOWED_META_KEYS.has(meta4));
281315
281309
  if (ySyncMeta?.isChangeOrigin || !tr.steps.length || hasDisallowedMeta && !isProgrammaticInput || notAllowedMeta.includes(tr.getMeta("inputType")) || tr.getMeta(CommentsPluginKey)) {
281316
281310
  if (pendingDeadKeyPlaceholder && !isCompositionTransaction(tr))
281317
281311
  mergeTrackChangesMeta(tr, { pendingDeadKeyPlaceholder: null });
@@ -281386,14 +281380,7 @@ var Node$13 = class Node$14 {
281386
281380
  else
281387
281381
  newTr.step(step2);
281388
281382
  });
281389
- if (tr.getMeta("inputType"))
281390
- newTr.setMeta("inputType", tr.getMeta("inputType"));
281391
- if (tr.getMeta("uiEvent"))
281392
- newTr.setMeta("uiEvent", tr.getMeta("uiEvent"));
281393
- if (tr.getMeta("composition") !== undefined)
281394
- newTr.setMeta("composition", tr.getMeta("composition"));
281395
- if (tr.getMeta("addToHistory") !== undefined)
281396
- newTr.setMeta("addToHistory", tr.getMeta("addToHistory"));
281383
+ copyPassthroughMeta(tr, newTr);
281397
281384
  mergeTrackChangesMeta(newTr, { pendingDeadKeyPlaceholder: getPendingDeadKeyPlaceholder({
281398
281385
  tr,
281399
281386
  newTr,
@@ -308429,7 +308416,7 @@ menclose::after {
308429
308416
  return;
308430
308417
  console.log(...args$1);
308431
308418
  }, 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;
308432
- var init_src_DQ_lu_9z_es = __esm(() => {
308419
+ var init_src_Bm7Xq4ys_es = __esm(() => {
308433
308420
  init_rolldown_runtime_Bg48TavK_es();
308434
308421
  init_SuperConverter_C6hKp29w_es();
308435
308422
  init_jszip_C49i9kUs_es();
@@ -325420,6 +325407,26 @@ function print() { __p += __j.call(arguments, '') }
325420
325407
  ["~", "̃"],
325421
325408
  ["¨", "̈"]
325422
325409
  ]);
325410
+ TRACKABLE_META_KEYS = [
325411
+ "inputType",
325412
+ "uiEvent",
325413
+ "paste",
325414
+ "pointer",
325415
+ "composition",
325416
+ "superdocSlicePaste",
325417
+ "forceTrackChanges",
325418
+ "protectTrackedReviewState"
325419
+ ];
325420
+ PASSTHROUGH_META_KEYS = [
325421
+ "inputType",
325422
+ "uiEvent",
325423
+ "paste",
325424
+ "pointer",
325425
+ "composition",
325426
+ "addToHistory",
325427
+ "superdocSlicePaste"
325428
+ ];
325429
+ ALLOWED_META_KEYS = new Set([...TRACKABLE_META_KEYS, ySyncPluginKey.key]);
325423
325430
  TrackFormat = Mark3.create({
325424
325431
  name: TrackFormatMarkName,
325425
325432
  group: "track",
@@ -326698,8 +326705,13 @@ function print() { __p += __j.call(arguments, '') }
326698
326705
  if (dispatch)
326699
326706
  dispatch(tr);
326700
326707
  const presentationEditor = editor.presentationEditor;
326701
- if (!(presentationEditor?.scrollToPosition?.(from$1, { block: "center" }) ?? false)) {
326702
- Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, { block: "center" })).catch(() => {});
326708
+ const scrollOpts = {
326709
+ block: "center",
326710
+ ifNeeded: true,
326711
+ suppressSelectionSyncScroll: true
326712
+ };
326713
+ if (!(presentationEditor?.scrollToPosition?.(from$1, scrollOpts) ?? false)) {
326714
+ Promise.resolve(presentationEditor?.scrollToPositionAsync?.(from$1, scrollOpts)).catch(() => {});
326703
326715
  const { node: node2 } = editor.view.domAtPos(from$1);
326704
326716
  if (node2?.scrollIntoView)
326705
326717
  node2.scrollIntoView({
@@ -336559,6 +336571,7 @@ function print() { __p += __j.call(arguments, '') }
336559
336571
  #isRerendering = false;
336560
336572
  #selectionSync = new SelectionSyncCoordinator;
336561
336573
  #shouldScrollSelectionIntoView = false;
336574
+ #suppressSelectionScrollUntilRaf = false;
336562
336575
  #dragDropIndicatorPos = null;
336563
336576
  #epochMapper = new EpochPositionMapper;
336564
336577
  #layoutEpoch = 0;
@@ -338231,6 +338244,19 @@ function print() { __p += __j.call(arguments, '') }
338231
338244
  }
338232
338245
  return null;
338233
338246
  }
338247
+ #isElementFullyVisibleInScrollContainer(el) {
338248
+ const rect = el.getBoundingClientRect();
338249
+ const viewport$1 = this.#scrollContainer instanceof Window ? {
338250
+ top: 0,
338251
+ bottom: this.#scrollContainer.innerHeight
338252
+ } : this.#scrollContainer instanceof Element ? this.#scrollContainer.getBoundingClientRect() : this.#visibleHost?.ownerDocument?.defaultView ? {
338253
+ top: 0,
338254
+ bottom: this.#visibleHost.ownerDocument.defaultView.innerHeight
338255
+ } : null;
338256
+ if (!viewport$1)
338257
+ return false;
338258
+ return rect.top >= viewport$1.top && rect.bottom <= viewport$1.bottom;
338259
+ }
338234
338260
  scrollToPosition(pos, options = {}) {
338235
338261
  if (this.#focusScrollRafId != null) {
338236
338262
  const win = this.#visibleHost.ownerDocument?.defaultView;
@@ -338245,7 +338271,7 @@ function print() { __p += __j.call(arguments, '') }
338245
338271
  return false;
338246
338272
  const clampedPos = Math.max(0, Math.min(pos, doc$12.content.size));
338247
338273
  const behavior = options.behavior ?? "auto";
338248
- const block = options.block ?? "center";
338274
+ const requestedBlock = options.block ?? "center";
338249
338275
  const layout = this.#layoutState.layout;
338250
338276
  const sessionMode = this.#headerFooterSession?.session?.mode ?? "body";
338251
338277
  if (layout && sessionMode === "body") {
@@ -338265,7 +338291,9 @@ function print() { __p += __j.call(arguments, '') }
338265
338291
  if (pageIndex != null) {
338266
338292
  const pageEl = getPageElementByIndex(this.#viewportHost, pageIndex);
338267
338293
  if (pageEl) {
338268
- const elToScroll = this.#findElementAtPosition(pageEl, clampedPos) ?? pageEl;
338294
+ const targetEl = this.#findElementAtPosition(pageEl, clampedPos);
338295
+ const elToScroll = targetEl ?? pageEl;
338296
+ const block = options.ifNeeded && targetEl && this.#isElementFullyVisibleInScrollContainer(targetEl) ? "nearest" : requestedBlock;
338269
338297
  elToScroll.scrollIntoView({
338270
338298
  block,
338271
338299
  inline: "nearest",
@@ -338273,7 +338301,9 @@ function print() { __p += __j.call(arguments, '') }
338273
338301
  });
338274
338302
  this.#shouldScrollSelectionIntoView = false;
338275
338303
  const win = this.#visibleHost.ownerDocument?.defaultView;
338276
- if (win)
338304
+ if (win) {
338305
+ if (options.suppressSelectionSyncScroll)
338306
+ this.#suppressSelectionScrollUntilRaf = true;
338277
338307
  win.requestAnimationFrame(() => {
338278
338308
  elToScroll.scrollIntoView({
338279
338309
  block,
@@ -338281,7 +338311,9 @@ function print() { __p += __j.call(arguments, '') }
338281
338311
  behavior
338282
338312
  });
338283
338313
  this.#shouldScrollSelectionIntoView = false;
338314
+ this.#suppressSelectionScrollUntilRaf = false;
338284
338315
  });
338316
+ }
338285
338317
  return true;
338286
338318
  }
338287
338319
  }
@@ -338415,12 +338447,24 @@ function print() { __p += __j.call(arguments, '') }
338415
338447
  console.warn(`[PresentationEditor] scrollToPositionAsync: Page ${pageIndex} failed to mount within timeout`);
338416
338448
  return false;
338417
338449
  }
338418
- return this.scrollToPosition(pos, options);
338450
+ return this.scrollToPosition(pos, {
338451
+ ...options,
338452
+ ifNeeded: false
338453
+ });
338419
338454
  }
338420
338455
  async scrollContentControlIntoView(entityId, options = {}) {
338456
+ const pos = this.#resolveContentControlCaretPos(entityId);
338457
+ if (pos == null)
338458
+ return false;
338459
+ return this.scrollToPositionAsync(pos, {
338460
+ behavior: options.behavior ?? "smooth",
338461
+ block: options.block ?? "center"
338462
+ });
338463
+ }
338464
+ #resolveContentControlCaretPos(entityId) {
338421
338465
  const editor = this.#editor;
338422
338466
  if (!editor || typeof entityId !== "string" || entityId.length === 0)
338423
- return false;
338467
+ return null;
338424
338468
  let found2 = null;
338425
338469
  editor.state.doc.descendants((node2, pos) => {
338426
338470
  if (found2)
@@ -338436,7 +338480,7 @@ function print() { __p += __j.call(arguments, '') }
338436
338480
  return true;
338437
338481
  });
338438
338482
  if (!found2)
338439
- return false;
338483
+ return null;
338440
338484
  let contentPos = found2.pos + 1;
338441
338485
  let textFound = false;
338442
338486
  found2.node?.descendants((child, rel) => {
@@ -338449,10 +338493,48 @@ function print() { __p += __j.call(arguments, '') }
338449
338493
  }
338450
338494
  return true;
338451
338495
  });
338452
- return this.scrollToPositionAsync(contentPos, {
338496
+ return contentPos;
338497
+ }
338498
+ async focusContentControl(entityId, options = {}) {
338499
+ const editor = this.#editor;
338500
+ if (!editor)
338501
+ return {
338502
+ success: false,
338503
+ reason: "not-ready"
338504
+ };
338505
+ if (typeof entityId !== "string" || entityId.length === 0)
338506
+ return {
338507
+ success: false,
338508
+ reason: "invalid-id"
338509
+ };
338510
+ const pos = this.#resolveContentControlCaretPos(entityId);
338511
+ if (pos == null)
338512
+ return {
338513
+ success: false,
338514
+ reason: "not-found"
338515
+ };
338516
+ if (typeof editor.commands?.setTextSelection !== "function")
338517
+ return {
338518
+ success: false,
338519
+ reason: "not-ready"
338520
+ };
338521
+ if (!await this.scrollToPositionAsync(pos, {
338453
338522
  behavior: options.behavior ?? "smooth",
338454
338523
  block: options.block ?? "center"
338455
- });
338524
+ }))
338525
+ return {
338526
+ success: false,
338527
+ reason: "not-reachable"
338528
+ };
338529
+ if (!editor.commands.setTextSelection({
338530
+ from: pos,
338531
+ to: pos
338532
+ }))
338533
+ return {
338534
+ success: false,
338535
+ reason: "not-reachable"
338536
+ };
338537
+ return { success: true };
338456
338538
  }
338457
338539
  async scrollToPage(pageNumber, scrollBehavior = "smooth") {
338458
338540
  const layout = this.#layoutState.layout;
@@ -340642,6 +340724,8 @@ function print() { __p += __j.call(arguments, '') }
340642
340724
  }
340643
340725
  }
340644
340726
  #scrollActiveEndIntoView(pageIndex) {
340727
+ if (this.#suppressSelectionScrollUntilRaf)
340728
+ return;
340645
340729
  if (!!!this.#painterHost.querySelector(`[data-page-index="${pageIndex}"]`)) {
340646
340730
  this.#scrollPageIntoView(pageIndex);
340647
340731
  return;
@@ -342768,9 +342852,9 @@ function print() { __p += __j.call(arguments, '') }
342768
342852
  ]);
342769
342853
  });
342770
342854
 
342771
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-6F7aRTzy.es.js
342855
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DKJYU_qM.es.js
342772
342856
  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;
342773
- var init_create_super_doc_ui_6F7aRTzy_es = __esm(() => {
342857
+ var init_create_super_doc_ui_DKJYU_qM_es = __esm(() => {
342774
342858
  init_SuperConverter_C6hKp29w_es();
342775
342859
  init_create_headless_toolbar_ISx0N5AS_es();
342776
342860
  MOD_ALIASES = new Set([
@@ -342814,7 +342898,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
342814
342898
 
342815
342899
  // ../../packages/superdoc/dist/super-editor.es.js
342816
342900
  var init_super_editor_es = __esm(() => {
342817
- init_src_DQ_lu_9z_es();
342901
+ init_src_Bm7Xq4ys_es();
342818
342902
  init_SuperConverter_C6hKp29w_es();
342819
342903
  init_jszip_C49i9kUs_es();
342820
342904
  init_xml_js_CqGKpaft_es();
@@ -342823,7 +342907,7 @@ var init_super_editor_es = __esm(() => {
342823
342907
  init_dist_B8HfvhaK_es();
342824
342908
  init_unified_Dsuw2be5_es();
342825
342909
  init_DocxZipper_nv_KfOqb_es();
342826
- init_create_super_doc_ui_6F7aRTzy_es();
342910
+ init_create_super_doc_ui_DKJYU_qM_es();
342827
342911
  init_ui_C5PAS9hY_es();
342828
342912
  init_eventemitter3_BnGqBE_Q_es();
342829
342913
  init_errors_CNaD6vcg_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.10.0-next.8",
3
+ "version": "0.10.0",
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.37.0"
25
25
  },
26
26
  "publishConfig": {