@superdoc-dev/mcp 0.6.0-next.1 → 0.6.0-next.11

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 +359 -95
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -147180,7 +147180,7 @@ var init_remark_stringify_6MMJfY0k_es = __esm(() => {
147180
147180
  eol = /\r?\n|\r/g;
147181
147181
  });
147182
147182
 
147183
- // ../../packages/superdoc/dist/chunks/detect-container-C1zjKeIM.es.js
147183
+ // ../../packages/superdoc/dist/chunks/detect-container-C6_bljPf.es.js
147184
147184
  function matchesMagic(bytes, magic) {
147185
147185
  if (bytes.length < magic.length)
147186
147186
  return false;
@@ -147198,7 +147198,7 @@ function detectContainerType(data) {
147198
147198
  return "unknown";
147199
147199
  }
147200
147200
  var ZIP_MAGIC, CFB_MAGIC;
147201
- var init_detect_container_C1zjKeIM_es = __esm(() => {
147201
+ var init_detect_container_C6_bljPf_es = __esm(() => {
147202
147202
  ZIP_MAGIC = [
147203
147203
  80,
147204
147204
  75,
@@ -147217,18 +147217,18 @@ var init_detect_container_C1zjKeIM_es = __esm(() => {
147217
147217
  ];
147218
147218
  });
147219
147219
 
147220
- // ../../packages/superdoc/dist/chunks/detect-container-Dpg_mpnM.es.js
147221
- var exports_detect_container_Dpg_mpnM_es = {};
147222
- __export(exports_detect_container_Dpg_mpnM_es, {
147220
+ // ../../packages/superdoc/dist/chunks/detect-container-CK5AEj_z.es.js
147221
+ var exports_detect_container_CK5AEj_z_es = {};
147222
+ __export(exports_detect_container_CK5AEj_z_es, {
147223
147223
  detectContainerType: () => detectContainerType
147224
147224
  });
147225
- var init_detect_container_Dpg_mpnM_es = __esm(() => {
147226
- init_detect_container_C1zjKeIM_es();
147225
+ var init_detect_container_CK5AEj_z_es = __esm(() => {
147226
+ init_detect_container_C6_bljPf_es();
147227
147227
  });
147228
147228
 
147229
- // ../../packages/superdoc/dist/chunks/errors-C_DoKMoN.es.js
147229
+ // ../../packages/superdoc/dist/chunks/errors-CNaD6vcg.es.js
147230
147230
  var EditorError, InvalidStateError, NoSourcePathError, FileSystemNotAvailableError, DocumentLoadError, DocxEncryptionErrorCode, DocxEncryptionError;
147231
- var init_errors_C_DoKMoN_es = __esm(() => {
147231
+ var init_errors_CNaD6vcg_es = __esm(() => {
147232
147232
  EditorError = class extends Error {
147233
147233
  constructor(message) {
147234
147234
  super(message);
@@ -147276,9 +147276,9 @@ var init_errors_C_DoKMoN_es = __esm(() => {
147276
147276
  };
147277
147277
  });
147278
147278
 
147279
- // ../../packages/superdoc/dist/chunks/decrypt-docx-4kQ488M9.es.js
147280
- var exports_decrypt_docx_4kQ488M9_es = {};
147281
- __export(exports_decrypt_docx_4kQ488M9_es, {
147279
+ // ../../packages/superdoc/dist/chunks/decrypt-docx-DaCAb_nX.es.js
147280
+ var exports_decrypt_docx_DaCAb_nX_es = {};
147281
+ __export(exports_decrypt_docx_DaCAb_nX_es, {
147282
147282
  decryptDocxIfNeeded: () => decryptDocxIfNeeded
147283
147283
  });
147284
147284
  function concatUint8Arrays(chunks) {
@@ -147819,10 +147819,10 @@ async function decryptDocxIfNeeded(data, options) {
147819
147819
  };
147820
147820
  }
147821
147821
  var CFB_SIGNATURE, CFB_END_OF_CHAIN = 4294967294, CFB_OBJECT_TYPE, utf16LeDecoder, AGILE_VERSION = 4, AGILE_RESERVED = 4, STANDARD_VERSION_3 = 3, STANDARD_VERSION_4 = 4, STANDARD_RESERVED = 3, MIN_HEADER_SIZE = 8, BLOCK_KEY_VERIFIER_INPUT, BLOCK_KEY_VERIFIER_VALUE, BLOCK_KEY_ENCRYPTED_KEY, BLOCK_KEY_HMAC_KEY, BLOCK_KEY_HMAC_VALUE, SEGMENT_SIZE = 4096, PACKAGE_HEADER_SIZE = 8;
147822
- var init_decrypt_docx_4kQ488M9_es = __esm(() => {
147822
+ var init_decrypt_docx_DaCAb_nX_es = __esm(() => {
147823
147823
  init_dist_B8HfvhaK_es();
147824
- init_errors_C_DoKMoN_es();
147825
- init_detect_container_C1zjKeIM_es();
147824
+ init_errors_CNaD6vcg_es();
147825
+ init_detect_container_C6_bljPf_es();
147826
147826
  CFB_SIGNATURE = new Uint8Array([
147827
147827
  208,
147828
147828
  207,
@@ -147891,7 +147891,7 @@ var init_decrypt_docx_4kQ488M9_es = __esm(() => {
147891
147891
  ]);
147892
147892
  });
147893
147893
 
147894
- // ../../packages/superdoc/dist/chunks/DocxZipper-Bphhij1P.es.js
147894
+ // ../../packages/superdoc/dist/chunks/DocxZipper-DoY5OEjc.es.js
147895
147895
  function sniffEncoding(u8) {
147896
147896
  if (u8.length >= 2) {
147897
147897
  const b0 = u8[0], b1 = u8[1];
@@ -148207,11 +148207,11 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
148207
148207
  return new Uint8Array(0);
148208
148208
  }
148209
148209
  async getDocxData(file2, isNode = false, options = {}) {
148210
- const { detectContainerType: detectContainerType2 } = await Promise.resolve().then(() => (init_detect_container_Dpg_mpnM_es(), exports_detect_container_Dpg_mpnM_es));
148210
+ const { detectContainerType: detectContainerType2 } = await Promise.resolve().then(() => (init_detect_container_CK5AEj_z_es(), exports_detect_container_CK5AEj_z_es));
148211
148211
  const containerType = detectContainerType2(await this.#peekBytes(file2, 8));
148212
148212
  let fileData = file2;
148213
148213
  if (containerType === "cfb") {
148214
- const { decryptDocxIfNeeded: decryptDocxIfNeeded2 } = await Promise.resolve().then(() => (init_decrypt_docx_4kQ488M9_es(), exports_decrypt_docx_4kQ488M9_es));
148214
+ const { decryptDocxIfNeeded: decryptDocxIfNeeded2 } = await Promise.resolve().then(() => (init_decrypt_docx_DaCAb_nX_es(), exports_decrypt_docx_DaCAb_nX_es));
148215
148215
  const result = await decryptDocxIfNeeded2(file2 instanceof Uint8Array ? file2 : file2 instanceof ArrayBuffer ? new Uint8Array(file2) : new Uint8Array(await file2.arrayBuffer()), { password: options.password });
148216
148216
  fileData = result.data;
148217
148217
  this.decryptedFileData = result.data;
@@ -148564,7 +148564,7 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
148564
148564
  return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
148565
148565
  }
148566
148566
  }, DocxZipper_default;
148567
- var init_DocxZipper_Bphhij1P_es = __esm(() => {
148567
+ var init_DocxZipper_DoY5OEjc_es = __esm(() => {
148568
148568
  init_rolldown_runtime_Bg48TavK_es();
148569
148569
  init_jszip_C49i9kUs_es();
148570
148570
  init_xml_js_CqGKpaft_es();
@@ -148630,18 +148630,18 @@ var init_DocxZipper_Bphhij1P_es = __esm(() => {
148630
148630
  DocxZipper_default = DocxZipper;
148631
148631
  });
148632
148632
 
148633
- // ../../packages/superdoc/dist/chunks/_plugin-vue_export-helper-HmhZBO0u.es.js
148633
+ // ../../packages/superdoc/dist/chunks/_plugin-vue_export-helper-5t5P5NuM.es.js
148634
148634
  var __plugin_vue_export_helper_default = (sfc, props) => {
148635
148635
  const target = sfc.__vccOpts || sfc;
148636
148636
  for (const [key2, val] of props)
148637
148637
  target[key2] = val;
148638
148638
  return target;
148639
148639
  };
148640
- var init__plugin_vue_export_helper_HmhZBO0u_es = () => {};
148640
+ var init__plugin_vue_export_helper_5t5P5NuM_es = () => {};
148641
148641
 
148642
- // ../../packages/superdoc/dist/chunks/eventemitter3-UwU_CLPU.es.js
148642
+ // ../../packages/superdoc/dist/chunks/eventemitter3-BnGqBE-Q.es.js
148643
148643
  var import_eventemitter3;
148644
- var init_eventemitter3_UwU_CLPU_es = __esm(() => {
148644
+ var init_eventemitter3_BnGqBE_Q_es = __esm(() => {
148645
148645
  init_rolldown_runtime_Bg48TavK_es();
148646
148646
  import_eventemitter3 = /* @__PURE__ */ __toESM2((/* @__PURE__ */ __commonJSMin((exports, module) => {
148647
148647
  var has = Object.prototype.hasOwnProperty, prefix = "~";
@@ -148810,8 +148810,8 @@ var init_eventemitter3_UwU_CLPU_es = __esm(() => {
148810
148810
  }))(), 1);
148811
148811
  });
148812
148812
 
148813
- // ../../packages/superdoc/dist/chunks/blank-docx-CDDHd6CH.es.js
148814
- var init_blank_docx_CDDHd6CH_es = () => {};
148813
+ // ../../packages/superdoc/dist/chunks/blank-docx-1Y-uWgjm.es.js
148814
+ var init_blank_docx_1Y_uWgjm_es = () => {};
148815
148815
 
148816
148816
  // ../../node_modules/.pnpm/lib0@0.2.117/node_modules/lib0/map.js
148817
148817
  var create = () => new Map, copy2 = (m) => {
@@ -189964,9 +189964,9 @@ var init_unified_vFnLRfAM_es = __esm(() => {
189964
189964
  init_unified_Dsuw2be5_es();
189965
189965
  });
189966
189966
 
189967
- // ../../packages/superdoc/dist/chunks/rehype-parse-DyKLXYD2.es.js
189968
- var exports_rehype_parse_DyKLXYD2_es = {};
189969
- __export(exports_rehype_parse_DyKLXYD2_es, {
189967
+ // ../../packages/superdoc/dist/chunks/rehype-parse-CD6KGerH.es.js
189968
+ var exports_rehype_parse_CD6KGerH_es = {};
189969
+ __export(exports_rehype_parse_CD6KGerH_es, {
189970
189970
  default: () => rehypeParse
189971
189971
  });
189972
189972
  function merge2(definitions, space) {
@@ -195915,7 +195915,7 @@ var Schema2 = class {
195915
195915
  }
195916
195916
  }
195917
195917
  }, TABLE_VOID_ELEMENTS, errors4, base2 = "https://html.spec.whatwg.org/multipage/parsing.html#parse-error-", dashToCamelRe, formatCRe, formatXRe, fatalities, emptyOptions3;
195918
- var init_rehype_parse_DyKLXYD2_es = __esm(() => {
195918
+ var init_rehype_parse_CD6KGerH_es = __esm(() => {
195919
195919
  init_rolldown_runtime_Bg48TavK_es();
195920
195920
  init_default_BqgWzMfR_es();
195921
195921
  init_lib_CYqLdG4z_es();
@@ -198660,9 +198660,9 @@ var init_rehype_parse_DyKLXYD2_es = __esm(() => {
198660
198660
  emptyOptions3 = {};
198661
198661
  });
198662
198662
 
198663
- // ../../packages/superdoc/dist/chunks/rehype-remark-DYihe9nj.es.js
198664
- var exports_rehype_remark_DYihe9nj_es = {};
198665
- __export(exports_rehype_remark_DYihe9nj_es, {
198663
+ // ../../packages/superdoc/dist/chunks/rehype-remark-B1RWSuTX.es.js
198664
+ var exports_rehype_remark_B1RWSuTX_es = {};
198665
+ __export(exports_rehype_remark_B1RWSuTX_es, {
198666
198666
  default: () => rehypeRemark
198667
198667
  });
198668
198668
  function anyFactory2(tests) {
@@ -200282,7 +200282,7 @@ var env, deserializer = ($2, _2) => {
200282
200282
  if (is(parent.children[index2], index2, parent))
200283
200283
  return parent.children[index2];
200284
200284
  }, searchLineFeeds, searchTabOrSpaces, br$1, cell, p$1, row, notRendered, blockOrCaption, prefix = "language-", defaultChecked = "[x]", defaultUnchecked = "[ ]", own$12, list$1, basic, meta3, defaultQuotes, nodeHandlers, handlers2, own6, emptyOptions4, defaults;
200285
- var init_rehype_remark_DYihe9nj_es = __esm(() => {
200285
+ var init_rehype_remark_B1RWSuTX_es = __esm(() => {
200286
200286
  init_lib_DEff_P2k_es();
200287
200287
  env = typeof self === "object" ? self : globalThis;
200288
200288
  ({ toString: toString$1 } = {});
@@ -200658,12 +200658,12 @@ var init_rehype_remark_DYihe9nj_es = __esm(() => {
200658
200658
  defaults = { document: true };
200659
200659
  });
200660
200660
 
200661
- // ../../packages/superdoc/dist/chunks/remark-stringify-Cb9EtkyK.es.js
200662
- var exports_remark_stringify_Cb9EtkyK_es = {};
200663
- __export(exports_remark_stringify_Cb9EtkyK_es, {
200661
+ // ../../packages/superdoc/dist/chunks/remark-stringify-B-orWEvD.es.js
200662
+ var exports_remark_stringify_B_orWEvD_es = {};
200663
+ __export(exports_remark_stringify_B_orWEvD_es, {
200664
200664
  default: () => remarkStringify
200665
200665
  });
200666
- var init_remark_stringify_Cb9EtkyK_es = __esm(() => {
200666
+ var init_remark_stringify_B_orWEvD_es = __esm(() => {
200667
200667
  init_remark_stringify_6MMJfY0k_es();
200668
200668
  });
200669
200669
 
@@ -200676,7 +200676,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
200676
200676
  init_remark_gfm_BhnWr3yf_es();
200677
200677
  });
200678
200678
 
200679
- // ../../packages/superdoc/dist/chunks/src-Jjjx6UC7.es.js
200679
+ // ../../packages/superdoc/dist/chunks/src-DnrLgjeO.es.js
200680
200680
  function deleteProps(obj, propOrProps) {
200681
200681
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
200682
200682
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -210988,6 +210988,8 @@ function shouldProcessEqualAsModification$1(oldParagraph, newParagraph) {
210988
210988
  return JSON.stringify(oldNormalized) !== JSON.stringify(newNormalized);
210989
210989
  }
210990
210990
  function paragraphComparator(oldParagraph, newParagraph) {
210991
+ if (oldParagraph?.depth !== newParagraph?.depth)
210992
+ return false;
210991
210993
  const oldId = oldParagraph?.node?.attrs?.paraId;
210992
210994
  const newId = newParagraph?.node?.attrs?.paraId;
210993
210995
  if (oldId && newId && oldId === newId)
@@ -211030,6 +211032,8 @@ function buildModifiedParagraphDiff(oldParagraph, newParagraph) {
211030
211032
  };
211031
211033
  }
211032
211034
  function canTreatAsModification(oldParagraph, newParagraph) {
211035
+ if (oldParagraph?.depth !== newParagraph?.depth)
211036
+ return false;
211033
211037
  if (paragraphComparator(oldParagraph, newParagraph))
211034
211038
  return true;
211035
211039
  const oldText = oldParagraph.fullText;
@@ -258151,12 +258155,8 @@ function tableNodeToBlock(node2, { nextBlockId, positions, storyKey, trackedChan
258151
258155
  const tableProperties = node2.attrs?.tableProperties;
258152
258156
  if (tableProperties && typeof tableProperties === "object")
258153
258157
  tableAttrs.tableProperties = tableProperties;
258154
- const styleResolvedTableProps = effectiveStyleId && converterContext?.translatedLinkedStyles ? resolveTableProperties(effectiveStyleId, converterContext.translatedLinkedStyles) : undefined;
258155
258158
  const inlineProps = rawTableProperties;
258156
- const styleProps = styleResolvedTableProps;
258157
- const inlineVisual = inlineProps?.rightToLeft ?? inlineProps?.bidiVisual;
258158
- const styleVisual = styleProps?.rightToLeft ?? styleProps?.bidiVisual;
258159
- tableAttrs.tableDirectionContext = resolveTableDirection({ rightToLeft: inlineVisual ?? styleVisual }, converterContext?.sectionDirectionContext ?? resolveSectionDirection(undefined));
258159
+ tableAttrs.tableDirectionContext = resolveTableDirection({ rightToLeft: inlineProps?.rightToLeft ?? inlineProps?.bidiVisual }, converterContext?.sectionDirectionContext ?? resolveSectionDirection(undefined));
258160
258160
  let columnWidths = undefined;
258161
258161
  const twipsToPixels$2 = (twips) => {
258162
258162
  return twips / 1440 * 96;
@@ -260109,6 +260109,7 @@ function lineHeightBeforeIndex(lines, fromLine, targetIndex) {
260109
260109
  function computeCaretLayoutRectGeometry({ layout, blocks: blocks2, measures, painterHost, viewportHost, visibleHost, zoom }, pos, includeDomFallback = true) {
260110
260110
  if (!layout)
260111
260111
  return null;
260112
+ const originalPos = pos;
260112
260113
  let effectivePos = pos;
260113
260114
  let hit = getFragmentAtPosition(layout, blocks2, measures, pos);
260114
260115
  if (!hit) {
@@ -260180,28 +260181,105 @@ function computeCaretLayoutRectGeometry({ layout, blocks: blocks2, measures, pai
260180
260181
  };
260181
260182
  const pageEl = getPageElementByIndex(painterHost ?? null, hit.pageIndex);
260182
260183
  const pageRect = pageEl?.getBoundingClientRect();
260184
+ if (includeDomFallback && pageRect) {
260185
+ const selection = pageEl?.ownerDocument?.getSelection();
260186
+ if (selection?.rangeCount && selection.isCollapsed) {
260187
+ const nativeRange = selection.getRangeAt(0);
260188
+ if (typeof nativeRange.getBoundingClientRect === "function") {
260189
+ const nativeRect = nativeRange.getBoundingClientRect();
260190
+ const inPageBounds = Number.isFinite(nativeRect.left) && Number.isFinite(nativeRect.top) && Number.isFinite(nativeRect.height) && nativeRect.height > 0 && nativeRect.left >= pageRect.left - 2 && nativeRect.left <= pageRect.right + 2 && nativeRect.top >= pageRect.top - 2 && nativeRect.top <= pageRect.bottom + 2;
260191
+ const nativeX = (nativeRect.left - pageRect.left) / zoom;
260192
+ const nativeY = (nativeRect.top - pageRect.top) / zoom;
260193
+ const withinGeometrySanity = Math.abs(nativeX - result.x) <= 80;
260194
+ if (inPageBounds && withinGeometrySanity)
260195
+ return {
260196
+ pageIndex: hit.pageIndex,
260197
+ x: nativeX,
260198
+ y: nativeY,
260199
+ height: line.lineHeight
260200
+ };
260201
+ }
260202
+ }
260203
+ }
260183
260204
  let domCaretX = null;
260184
260205
  let domCaretY = null;
260185
- const spanEls = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]");
260186
- for (const spanEl of Array.from(spanEls ?? [])) {
260187
- const pmStart = Number(spanEl.dataset.pmStart);
260188
- const pmEnd = Number(spanEl.dataset.pmEnd);
260189
- if (effectivePos >= pmStart && effectivePos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
260190
- const textNode = spanEl.firstChild;
260191
- const charIndex = Math.min(effectivePos - pmStart, textNode.length);
260192
- const rangeObj = document.createRange();
260193
- rangeObj.setStart(textNode, charIndex);
260194
- rangeObj.setEnd(textNode, charIndex);
260195
- if (typeof rangeObj.getBoundingClientRect !== "function")
260196
- break;
260197
- const rangeRect = rangeObj.getBoundingClientRect();
260198
- if (pageRect) {
260199
- domCaretX = (rangeRect.left - pageRect.left) / zoom;
260200
- domCaretY = (rangeRect.top - pageRect.top) / zoom;
260201
- }
260206
+ const spanCandidates = [];
260207
+ const pushUnique = (el) => {
260208
+ if (!spanCandidates.includes(el))
260209
+ spanCandidates.push(el);
260210
+ };
260211
+ const collectSpans = (root3) => {
260212
+ if (!root3)
260213
+ return;
260214
+ const spans = root3.querySelectorAll("span[data-pm-start][data-pm-end]");
260215
+ for (const span of Array.from(spans))
260216
+ if (span instanceof HTMLElement)
260217
+ pushUnique(span);
260218
+ };
260219
+ const lineEls = pageEl?.querySelectorAll(".superdoc-line[data-pm-start][data-pm-end]");
260220
+ let localLineEl = null;
260221
+ for (const lineEl of Array.from(lineEls ?? [])) {
260222
+ if (!(lineEl instanceof HTMLElement))
260223
+ continue;
260224
+ const lineStart = Number(lineEl.dataset.pmStart);
260225
+ const lineEnd = Number(lineEl.dataset.pmEnd);
260226
+ if (!Number.isFinite(lineStart) || !Number.isFinite(lineEnd))
260227
+ continue;
260228
+ if (effectivePos >= lineStart && effectivePos <= lineEnd) {
260229
+ localLineEl = lineEl;
260202
260230
  break;
260203
260231
  }
260204
260232
  }
260233
+ collectSpans(localLineEl);
260234
+ if (spanCandidates.length === 0) {
260235
+ const MAX_PM_DISTANCE = 8;
260236
+ const pageSpans = pageEl?.querySelectorAll("span[data-pm-start][data-pm-end]");
260237
+ for (const span of Array.from(pageSpans ?? [])) {
260238
+ if (!(span instanceof HTMLElement))
260239
+ continue;
260240
+ const pmStart = Number(span.dataset.pmStart);
260241
+ const pmEnd = Number(span.dataset.pmEnd);
260242
+ if (!Number.isFinite(pmStart) || !Number.isFinite(pmEnd))
260243
+ continue;
260244
+ if (effectivePos >= pmStart && effectivePos <= pmEnd) {
260245
+ pushUnique(span);
260246
+ continue;
260247
+ }
260248
+ if (Math.abs(pmStart - effectivePos) <= MAX_PM_DISTANCE || Math.abs(pmEnd - effectivePos) <= MAX_PM_DISTANCE)
260249
+ pushUnique(span);
260250
+ }
260251
+ }
260252
+ const domProbePositions = Array.from(new Set([
260253
+ originalPos,
260254
+ effectivePos,
260255
+ originalPos - 1,
260256
+ originalPos + 1
260257
+ ])).filter((candidate) => candidate >= 0);
260258
+ let resolved = false;
260259
+ for (const probePos of domProbePositions) {
260260
+ for (const spanEl of spanCandidates) {
260261
+ const pmStart = Number(spanEl.dataset.pmStart);
260262
+ const pmEnd = Number(spanEl.dataset.pmEnd);
260263
+ if (probePos >= pmStart && probePos <= pmEnd && spanEl.firstChild?.nodeType === Node.TEXT_NODE) {
260264
+ const textNode = spanEl.firstChild;
260265
+ const charIndex = Math.min(probePos - pmStart, textNode.length);
260266
+ const rangeObj = document.createRange();
260267
+ rangeObj.setStart(textNode, charIndex);
260268
+ rangeObj.setEnd(textNode, charIndex);
260269
+ if (typeof rangeObj.getBoundingClientRect !== "function")
260270
+ continue;
260271
+ const rangeRect = rangeObj.getBoundingClientRect();
260272
+ if (pageRect) {
260273
+ domCaretX = (rangeRect.left - pageRect.left) / zoom;
260274
+ domCaretY = (rangeRect.top - pageRect.top) / zoom;
260275
+ resolved = true;
260276
+ break;
260277
+ }
260278
+ }
260279
+ }
260280
+ if (resolved)
260281
+ break;
260282
+ }
260205
260283
  if (includeDomFallback && domCaretX != null && domCaretY != null)
260206
260284
  return {
260207
260285
  pageIndex: hit.pageIndex,
@@ -275760,7 +275838,148 @@ var Node$13 = class Node$14 {
275760
275838
  if (!allowedRanges?.length)
275761
275839
  return false;
275762
275840
  return allowedRanges.some((allowed) => range.from >= allowed.from && range.to <= allowed.to);
275763
- }, PermissionRanges, Protection, DOM_CLASS_NAMES, DATA_ATTRS, DATASET_KEYS, DRAGGABLE_SELECTOR, VerticalNavigationPluginKey, createDefaultState = () => ({ goalX: null }), VerticalNavigation, createPermissionBlockMarkerNode = ({ name, attributes }) => Node$13.create({
275841
+ }, PermissionRanges, Protection, DOM_CLASS_NAMES, DATA_ATTRS, DATASET_KEYS, DRAGGABLE_SELECTOR, VerticalNavigationPluginKey, createDefaultState = () => ({ goalX: null }), VerticalNavigation, STRONG_RTL_CHAR_RE$1, STRONG_LTR_CHAR_RE, isStrongRtl = (char) => STRONG_RTL_CHAR_RE$1.test(char), isStrongLtr = (char) => STRONG_LTR_CHAR_RE.test(char), hasMixedDirectionBoundary = (leftChar, rightChar) => isStrongRtl(leftChar) && isStrongLtr(rightChar) || isStrongLtr(leftChar) && isStrongRtl(rightChar), resolveCaretPoint = (doc$12, range) => {
275842
+ const rect = range.getBoundingClientRect();
275843
+ if (rect && Number.isFinite(rect.left) && Number.isFinite(rect.top)) {
275844
+ if (rect.width === 0 && rect.height === 0)
275845
+ return null;
275846
+ const midY = rect.height > 0 ? rect.top + rect.height / 2 : rect.top;
275847
+ return {
275848
+ x: rect.left,
275849
+ y: midY
275850
+ };
275851
+ }
275852
+ const node2 = range.startContainer?.nodeType === Node.TEXT_NODE ? range.startContainer.parentElement : range.startContainer;
275853
+ if (!node2 || !(node2 instanceof HTMLElement))
275854
+ return null;
275855
+ const fallbackRect = node2.getBoundingClientRect();
275856
+ if (!fallbackRect)
275857
+ return null;
275858
+ return {
275859
+ x: fallbackRect.left,
275860
+ y: fallbackRect.top + fallbackRect.height / 2
275861
+ };
275862
+ }, resolveLineElement = (doc$12, point5) => {
275863
+ return doc$12.elementsFromPoint(point5.x, point5.y).find((el) => el instanceof HTMLElement ? el.classList.contains("superdoc-line") : false);
275864
+ }, collectVisualChars = (lineEl, view, targetX = null) => {
275865
+ const doc$12 = lineEl.ownerDocument;
275866
+ const nodeFilter = doc$12.defaultView?.NodeFilter;
275867
+ if (!nodeFilter)
275868
+ return [];
275869
+ const chars = [];
275870
+ const walker = doc$12.createTreeWalker(lineEl, nodeFilter.SHOW_TEXT);
275871
+ const RANGE_WINDOW_PX = 96;
275872
+ const hasTargetX = Number.isFinite(targetX);
275873
+ let node2 = walker.nextNode();
275874
+ while (node2) {
275875
+ const textNode = node2;
275876
+ const text5 = textNode.textContent ?? "";
275877
+ for (let i4 = 0;i4 < text5.length; i4 += 1) {
275878
+ const char = text5[i4];
275879
+ if (!char || /\s/.test(char))
275880
+ continue;
275881
+ let pmStart;
275882
+ let pmEnd;
275883
+ try {
275884
+ pmStart = view.posAtDOM(textNode, i4);
275885
+ pmEnd = view.posAtDOM(textNode, i4 + 1);
275886
+ } catch {
275887
+ continue;
275888
+ }
275889
+ if (!Number.isFinite(pmStart) || !Number.isFinite(pmEnd) || pmEnd <= pmStart)
275890
+ continue;
275891
+ const range = doc$12.createRange();
275892
+ range.setStart(textNode, i4);
275893
+ range.setEnd(textNode, i4 + 1);
275894
+ const rect = range.getBoundingClientRect();
275895
+ if (rect.width <= 0 || rect.height <= 0)
275896
+ continue;
275897
+ if (hasTargetX && rect.right < targetX - RANGE_WINDOW_PX)
275898
+ continue;
275899
+ if (hasTargetX && rect.left > targetX + RANGE_WINDOW_PX)
275900
+ continue;
275901
+ chars.push({
275902
+ char,
275903
+ pmStart,
275904
+ pmEnd,
275905
+ centerX: rect.left + rect.width / 2,
275906
+ centerY: rect.top + rect.height / 2
275907
+ });
275908
+ }
275909
+ node2 = walker.nextNode();
275910
+ }
275911
+ return chars;
275912
+ }, resolveBoundaryChars = (chars, caretPoint) => {
275913
+ if (chars.length === 0)
275914
+ return null;
275915
+ const sameBand = chars.filter((c) => Math.abs(c.centerY - caretPoint.y) <= 8);
275916
+ const band = sameBand.length > 0 ? sameBand : chars;
275917
+ band.sort((a2, b$1) => a2.centerX - b$1.centerX);
275918
+ let left$1 = null;
275919
+ let right$1 = null;
275920
+ for (const c of band) {
275921
+ if (c.centerX < caretPoint.x) {
275922
+ left$1 = c;
275923
+ continue;
275924
+ }
275925
+ right$1 = c;
275926
+ break;
275927
+ }
275928
+ if (!left$1 || !right$1)
275929
+ return null;
275930
+ return {
275931
+ left: left$1,
275932
+ right: right$1
275933
+ };
275934
+ }, resolveMixedBidiBackspaceRange = ({ state, view }) => {
275935
+ const { selection } = state;
275936
+ if (!selection?.empty)
275937
+ return null;
275938
+ const doc$12 = view?.dom?.ownerDocument;
275939
+ const nativeSelection = doc$12?.getSelection?.();
275940
+ if (!nativeSelection || nativeSelection.rangeCount === 0)
275941
+ return null;
275942
+ const range = nativeSelection.getRangeAt(0);
275943
+ if (!range.collapsed)
275944
+ return null;
275945
+ const caretPoint = resolveCaretPoint(doc$12, range);
275946
+ if (!caretPoint)
275947
+ return null;
275948
+ const lineEl = resolveLineElement(doc$12, caretPoint);
275949
+ if (!lineEl)
275950
+ return null;
275951
+ const lineText = lineEl.textContent ?? "";
275952
+ const hasRtl = STRONG_RTL_CHAR_RE$1.test(lineText);
275953
+ const hasLtr = STRONG_LTR_CHAR_RE.test(lineText);
275954
+ if (!hasRtl || !hasLtr)
275955
+ return null;
275956
+ let chars = collectVisualChars(lineEl, view, caretPoint.x);
275957
+ if (chars.length < 2)
275958
+ chars = collectVisualChars(lineEl, view, null);
275959
+ const boundary = resolveBoundaryChars(chars, caretPoint);
275960
+ if (!boundary)
275961
+ return null;
275962
+ if (!hasMixedDirectionBoundary(boundary.left.char, boundary.right.char))
275963
+ return null;
275964
+ if (selection.from !== boundary.right.pmStart && selection.from !== boundary.left.pmEnd)
275965
+ return null;
275966
+ return {
275967
+ from: boundary.left.pmStart,
275968
+ to: boundary.left.pmEnd
275969
+ };
275970
+ }, mixedBidiBackspace = () => ({ state, view, tr, dispatch }) => {
275971
+ const range = resolveMixedBidiBackspaceRange({
275972
+ state,
275973
+ view
275974
+ });
275975
+ if (!range)
275976
+ return false;
275977
+ if (dispatch) {
275978
+ tr.delete(range.from, range.to);
275979
+ tr.scrollIntoView();
275980
+ }
275981
+ return true;
275982
+ }, MixedBidiBackspace, createPermissionBlockMarkerNode = ({ name, attributes }) => Node$13.create({
275764
275983
  name,
275765
275984
  group: "block",
275766
275985
  inline: false,
@@ -275956,6 +276175,7 @@ var Node$13 = class Node$14 {
275956
276175
  Image,
275957
276176
  NodeResizer,
275958
276177
  CustomSelection,
276178
+ MixedBidiBackspace,
275959
276179
  MathInline,
275960
276180
  MathBlock,
275961
276181
  PassthroughInline,
@@ -276055,6 +276275,7 @@ var Node$13 = class Node$14 {
276055
276275
  PermissionRanges,
276056
276276
  Protection,
276057
276277
  VerticalNavigation,
276278
+ MixedBidiBackspace,
276058
276279
  MathInline,
276059
276280
  MathBlock,
276060
276281
  PassthroughInline,
@@ -277581,6 +277802,7 @@ var Node$13 = class Node$14 {
277581
277802
  () => commands$1.backspaceAtomBefore(),
277582
277803
  () => commands$1.backspaceNextToRun(),
277583
277804
  () => commands$1.backspaceAcrossRuns(),
277805
+ () => commands$1.mixedBidiBackspace?.() ?? false,
277584
277806
  () => commands$1.deleteSelection(),
277585
277807
  () => commands$1.removeNumberingProperties(),
277586
277808
  () => commands$1.joinBackward(),
@@ -283049,7 +283271,27 @@ menclose::after {
283049
283271
  }
283050
283272
  element3.style.textAlign = resolveTextAlign(attrs?.alignment, rtl);
283051
283273
  return rtl;
283052
- }, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, MATHML_NS$19 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, STY_TO_VARIANT, SCR_TO_VARIANT, convertMathRun = (node2, doc$12) => {
283274
+ }, shouldUseSegmentPositioning = (hasExplicitPositioning, hasSegments, isRtl) => hasExplicitPositioning && hasSegments && !isRtl, RTL_DATE_LIKE_TOKEN_RE, STRONG_RTL_CHAR_RE, LATIN_DIGIT_NEUTRAL_ONLY_RE, RLM = "‏", normalizeRtlDateTokenForWordParity = (text5) => {
283275
+ if (!RTL_DATE_LIKE_TOKEN_RE.test(text5))
283276
+ return text5;
283277
+ return text5.replace(/[./-]/g, (separator) => `${RLM}${separator}${RLM}`);
283278
+ }, resolveRunDirectionAttribute = (opts) => {
283279
+ if (opts.isRtlTagged) {
283280
+ const sample = (opts.runText ?? opts.effectiveText).trim();
283281
+ if (!sample)
283282
+ return "rtl";
283283
+ if (RTL_DATE_LIKE_TOKEN_RE.test(sample))
283284
+ return "rtl";
283285
+ if (STRONG_RTL_CHAR_RE.test(sample))
283286
+ return "rtl";
283287
+ if (LATIN_DIGIT_NEUTRAL_ONLY_RE.test(sample))
283288
+ return null;
283289
+ return "rtl";
283290
+ }
283291
+ if (typeof opts.runText === "string" && RTL_DATE_LIKE_TOKEN_RE.test(opts.runText))
283292
+ return "ltr";
283293
+ return null;
283294
+ }, MATHML_NS$19 = "http://www.w3.org/1998/Math/MathML", OPERATOR_CHARS, STY_TO_VARIANT, SCR_TO_VARIANT, convertMathRun = (node2, doc$12) => {
283053
283295
  const text5 = extractText(node2);
283054
283296
  if (!text5)
283055
283297
  return null;
@@ -283839,10 +284081,6 @@ menclose::after {
283839
284081
  if (runToken === "totalPageCount")
283840
284082
  return context.totalPages ? String(context.totalPages) : run2.text ?? "";
283841
284083
  return run2.text ?? "";
283842
- }, RTL_DATE_LIKE_TOKEN_RE, RLM = "‏", normalizeRtlDateTokenForWordParity = (text5) => {
283843
- if (!RTL_DATE_LIKE_TOKEN_RE.test(text5))
283844
- return text5;
283845
- return text5.replace(/[./-]/g, (separator) => `${RLM}${separator}${RLM}`);
283846
284084
  }, createDomPainter = (options) => {
283847
284085
  const painter = new DomPainter(options);
283848
284086
  return {
@@ -292661,7 +292899,13 @@ menclose::after {
292661
292899
  #isCompositionKeyboardEvent(event) {
292662
292900
  return event.isComposing || event.keyCode === 229 || event.key === "Dead" || event.key === "Compose";
292663
292901
  }
292664
- }, isObject3 = (value) => typeof value === "object" && value !== null, INTERNAL_OBJECT_MIME_TYPE = "application/x-superdoc-internal-object", INTERNAL_MIME_TYPE = "application/x-field-annotation", FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation", IMAGE_EXTENSIONS, DragDropManager = class {
292902
+ }, isObject3 = (value) => typeof value === "object" && value !== null, shouldUseNativeCaretFallback = (selection, pos) => {
292903
+ if (!selection)
292904
+ return false;
292905
+ if (!selection.empty)
292906
+ return false;
292907
+ return selection.head === pos;
292908
+ }, INTERNAL_OBJECT_MIME_TYPE = "application/x-superdoc-internal-object", INTERNAL_MIME_TYPE = "application/x-field-annotation", FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation", IMAGE_EXTENSIONS, DragDropManager = class {
292665
292909
  #deps = null;
292666
292910
  #dragOverRaf = null;
292667
292911
  #pendingDragOver = null;
@@ -295201,7 +295445,7 @@ menclose::after {
295201
295445
  return;
295202
295446
  console.log(...args$1);
295203
295447
  }, 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;
295204
- var init_src_Jjjx6UC7_es = __esm(() => {
295448
+ var init_src_DnrLgjeO_es = __esm(() => {
295205
295449
  init_rolldown_runtime_Bg48TavK_es();
295206
295450
  init_SuperConverter_CnwfJPj6_es();
295207
295451
  init_jszip_C49i9kUs_es();
@@ -295213,11 +295457,11 @@ var init_src_Jjjx6UC7_es = __esm(() => {
295213
295457
  init_unified_Dsuw2be5_es();
295214
295458
  init_remark_gfm_BhnWr3yf_es();
295215
295459
  init_remark_stringify_6MMJfY0k_es();
295216
- init_DocxZipper_Bphhij1P_es();
295217
- init__plugin_vue_export_helper_HmhZBO0u_es();
295218
- init_eventemitter3_UwU_CLPU_es();
295219
- init_errors_C_DoKMoN_es();
295220
- init_blank_docx_CDDHd6CH_es();
295460
+ init_DocxZipper_DoY5OEjc_es();
295461
+ init__plugin_vue_export_helper_5t5P5NuM_es();
295462
+ init_eventemitter3_BnGqBE_Q_es();
295463
+ init_errors_CNaD6vcg_es();
295464
+ init_blank_docx_1Y_uWgjm_es();
295221
295465
  init_yjs();
295222
295466
  init_yjs();
295223
295467
  init_vue();
@@ -313767,6 +314011,14 @@ function print() { __p += __j.call(arguments, '') }
313767
314011
  })];
313768
314012
  }
313769
314013
  });
314014
+ STRONG_RTL_CHAR_RE$1 = /[\u0590-\u08FF\p{Script=Hebrew}\p{Script=Arabic}]/u;
314015
+ STRONG_LTR_CHAR_RE = /[A-Za-z\u00C0-\u024F]/;
314016
+ MixedBidiBackspace = Extension.create({
314017
+ name: "mixedBidiBackspace",
314018
+ addCommands() {
314019
+ return { mixedBidiBackspace };
314020
+ }
314021
+ });
313770
314022
  PermStart = Node$13.create({
313771
314023
  name: "permStart",
313772
314024
  group: "inline",
@@ -321032,9 +321284,9 @@ function print() { __p += __j.call(arguments, '') }
321032
321284
  try {
321033
321285
  const [{ unified: unified$1 }, { default: rehypeParse2 }, { default: rehypeRemark2 }, { default: remarkStringify$1 }, { default: remarkGfm$1 }] = await Promise.all([
321034
321286
  Promise.resolve().then(() => (init_unified_vFnLRfAM_es(), exports_unified_vFnLRfAM_es)),
321035
- Promise.resolve().then(() => (init_rehype_parse_DyKLXYD2_es(), exports_rehype_parse_DyKLXYD2_es)),
321036
- Promise.resolve().then(() => (init_rehype_remark_DYihe9nj_es(), exports_rehype_remark_DYihe9nj_es)),
321037
- Promise.resolve().then(() => (init_remark_stringify_Cb9EtkyK_es(), exports_remark_stringify_Cb9EtkyK_es)),
321287
+ Promise.resolve().then(() => (init_rehype_parse_CD6KGerH_es(), exports_rehype_parse_CD6KGerH_es)),
321288
+ Promise.resolve().then(() => (init_rehype_remark_B1RWSuTX_es(), exports_rehype_remark_B1RWSuTX_es)),
321289
+ Promise.resolve().then(() => (init_remark_stringify_B_orWEvD_es(), exports_remark_stringify_B_orWEvD_es)),
321038
321290
  Promise.resolve().then(() => (init_remark_gfm_eZN6yzWQ_es(), exports_remark_gfm_eZN6yzWQ_es))
321039
321291
  ]);
321040
321292
  const html3 = this.getHTML();
@@ -321871,6 +322123,9 @@ function print() { __p += __j.call(arguments, '') }
321871
322123
  "wave",
321872
322124
  "doubleWave"
321873
322125
  ]);
322126
+ RTL_DATE_LIKE_TOKEN_RE = /^-?\d+(?:[./-]\d+)+$/;
322127
+ STRONG_RTL_CHAR_RE = /[\u0590-\u08FF\p{Script=Hebrew}\p{Script=Arabic}]/u;
322128
+ LATIN_DIGIT_NEUTRAL_ONLY_RE = /^[\s0-9A-Za-z./\-_:,+()]+$/;
321874
322129
  OPERATOR_CHARS = new Set([
321875
322130
  "+",
321876
322131
  "-",
@@ -324889,10 +325144,13 @@ function print() { __p += __j.call(arguments, '') }
324889
325144
  this.pendingTooltips.set(elem, linkData.tooltip);
324890
325145
  }
324891
325146
  applyRunStyles(elem, run2, isActiveLink);
324892
- if (textRun.bidi?.rtl === true)
324893
- elem.setAttribute("dir", "rtl");
324894
- else if (typeof textRun.text === "string" && RTL_DATE_LIKE_TOKEN_RE.test(textRun.text))
324895
- elem.setAttribute("dir", "ltr");
325147
+ const dirAttr = resolveRunDirectionAttribute({
325148
+ runText: textRun.text,
325149
+ effectiveText,
325150
+ isRtlTagged: textRun.bidi?.rtl === true
325151
+ });
325152
+ if (dirAttr)
325153
+ elem.setAttribute("dir", dirAttr);
324896
325154
  const commentAnnotations = textRun.comments;
324897
325155
  if (!!commentAnnotations?.length) {
324898
325156
  elem.dataset.commentIds = commentAnnotations.map((c) => c.commentId).join(",");
@@ -326008,7 +326266,6 @@ function print() { __p += __j.call(arguments, '') }
326008
326266
  "path(",
326009
326267
  "rect("
326010
326268
  ];
326011
- RTL_DATE_LIKE_TOKEN_RE = /^-?\d+(?:[./-]\d+)+$/;
326012
326269
  CLIP_PATH_PREFIXES = [
326013
326270
  "inset(",
326014
326271
  "polygon(",
@@ -332934,7 +333191,8 @@ function print() { __p += __j.call(arguments, '') }
332934
333191
  }, pos, includeDomFallback);
332935
333192
  }
332936
333193
  #computeCaretLayoutRect(pos) {
332937
- const geometry = this.#computeCaretLayoutRectGeometry(pos, true);
333194
+ const useNativeFallback = shouldUseNativeCaretFallback(this.editor?.state?.selection, pos);
333195
+ const geometry = this.#computeCaretLayoutRectGeometry(pos, useNativeFallback);
332938
333196
  let dom = null;
332939
333197
  try {
332940
333198
  dom = this.#computeDomCaretPageLocal(pos);
@@ -333360,9 +333618,9 @@ function print() { __p += __j.call(arguments, '') }
333360
333618
  ];
333361
333619
  });
333362
333620
 
333363
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CkaOaJa5.es.js
333621
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BgATtiYQ.es.js
333364
333622
  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;
333365
- var init_create_super_doc_ui_CkaOaJa5_es = __esm(() => {
333623
+ var init_create_super_doc_ui_BgATtiYQ_es = __esm(() => {
333366
333624
  init_SuperConverter_CnwfJPj6_es();
333367
333625
  init_create_headless_toolbar_Btizo_Im_es();
333368
333626
  MOD_ALIASES = new Set([
@@ -333393,12 +333651,12 @@ var init_create_super_doc_ui_CkaOaJa5_es = __esm(() => {
333393
333651
  EMPTY_ACTIVE_IDS = Object.freeze([]);
333394
333652
  });
333395
333653
 
333396
- // ../../packages/superdoc/dist/chunks/ui-CGB3qmy3.es.js
333397
- var init_ui_CGB3qmy3_es = () => {};
333654
+ // ../../packages/superdoc/dist/chunks/ui-C5PAS9hY.es.js
333655
+ var init_ui_C5PAS9hY_es = () => {};
333398
333656
 
333399
- // ../../packages/superdoc/dist/chunks/zipper-BxRAi0-5.es.js
333657
+ // ../../packages/superdoc/dist/chunks/zipper-yaJVJ4z9.es.js
333400
333658
  var import_jszip_min2;
333401
- var init_zipper_BxRAi0_5_es = __esm(() => {
333659
+ var init_zipper_yaJVJ4z9_es = __esm(() => {
333402
333660
  init_rolldown_runtime_Bg48TavK_es();
333403
333661
  init_jszip_C49i9kUs_es();
333404
333662
  import_jszip_min2 = /* @__PURE__ */ __toESM2(require_jszip_min(), 1);
@@ -333406,7 +333664,7 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
333406
333664
 
333407
333665
  // ../../packages/superdoc/dist/super-editor.es.js
333408
333666
  var init_super_editor_es = __esm(() => {
333409
- init_src_Jjjx6UC7_es();
333667
+ init_src_DnrLgjeO_es();
333410
333668
  init_SuperConverter_CnwfJPj6_es();
333411
333669
  init_jszip_C49i9kUs_es();
333412
333670
  init_xml_js_CqGKpaft_es();
@@ -333414,12 +333672,12 @@ var init_super_editor_es = __esm(() => {
333414
333672
  init_constants_DrU4EASo_es();
333415
333673
  init_dist_B8HfvhaK_es();
333416
333674
  init_unified_Dsuw2be5_es();
333417
- init_DocxZipper_Bphhij1P_es();
333418
- init_create_super_doc_ui_CkaOaJa5_es();
333419
- init_ui_CGB3qmy3_es();
333420
- init_eventemitter3_UwU_CLPU_es();
333421
- init_errors_C_DoKMoN_es();
333422
- init_zipper_BxRAi0_5_es();
333675
+ init_DocxZipper_DoY5OEjc_es();
333676
+ init_create_super_doc_ui_BgATtiYQ_es();
333677
+ init_ui_C5PAS9hY_es();
333678
+ init_eventemitter3_BnGqBE_Q_es();
333679
+ init_errors_CNaD6vcg_es();
333680
+ init_zipper_yaJVJ4z9_es();
333423
333681
  });
333424
333682
 
333425
333683
  // ../../packages/super-editor/src/editors/v1/document-api-adapters/helpers/value-utils.ts
@@ -453940,6 +454198,9 @@ function shouldProcessEqualAsModification3(oldParagraph, newParagraph) {
453940
454198
  return JSON.stringify(oldNormalized) !== JSON.stringify(newNormalized);
453941
454199
  }
453942
454200
  function paragraphComparator2(oldParagraph, newParagraph) {
454201
+ if (oldParagraph?.depth !== newParagraph?.depth) {
454202
+ return false;
454203
+ }
453943
454204
  const oldId = oldParagraph?.node?.attrs?.paraId;
453944
454205
  const newId = newParagraph?.node?.attrs?.paraId;
453945
454206
  if (oldId && newId && oldId === newId) {
@@ -453986,6 +454247,9 @@ function buildModifiedParagraphDiff2(oldParagraph, newParagraph) {
453986
454247
  };
453987
454248
  }
453988
454249
  function canTreatAsModification2(oldParagraph, newParagraph) {
454250
+ if (oldParagraph?.depth !== newParagraph?.depth) {
454251
+ return false;
454252
+ }
453989
454253
  if (paragraphComparator2(oldParagraph, newParagraph)) {
453990
454254
  return true;
453991
454255
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/mcp",
3
- "version": "0.6.0-next.1",
3
+ "version": "0.6.0-next.11",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"