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

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 +291 -33
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -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-DTrWuNvy.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) => {
@@ -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_DTrWuNvy_es = __esm(() => {
295205
295449
  init_rolldown_runtime_Bg48TavK_es();
295206
295450
  init_SuperConverter_CnwfJPj6_es();
295207
295451
  init_jszip_C49i9kUs_es();
@@ -313767,6 +314011,14 @@ function print() { __p += __j.call(arguments, '') }
313767
314011
  })];
313768
314012
  }
313769
314013
  });
314014
+ STRONG_RTL_CHAR_RE$1 = /[\u0590-\u08FF]/;
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",
@@ -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]/;
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);
@@ -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_DTrWuNvy_es();
333410
333668
  init_SuperConverter_CnwfJPj6_es();
333411
333669
  init_jszip_C49i9kUs_es();
333412
333670
  init_xml_js_CqGKpaft_es();
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.2",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=20"