@mx-space/cli 0.14.0 → 0.14.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 (52) hide show
  1. package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-CtGmYDoh.mjs} +770 -271
  2. package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-8sRFmq2X.mjs} +15 -5
  3. package/dist/Lexical.prod-D-VfeKDz.mjs +7200 -0
  4. package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CzQ15z6E.mjs} +6 -6
  5. package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-D4gMGws6.mjs} +2 -2
  6. package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-CltkQpzS.mjs} +10 -8
  7. package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DkYBZRGB.mjs} +11 -9
  8. package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-COc3_QL8.mjs} +178 -167
  9. package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-Dv5_WUae.mjs} +3 -3
  10. package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-DgjrmWkd.mjs} +2 -2
  11. package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-DnpbDe-_.mjs} +5 -4
  12. package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-JMH_6-OZ.mjs} +73 -52
  13. package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-BUozzx4t.mjs} +4 -2
  14. package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-UiyDgmou.mjs} +370 -347
  15. package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-BfLGciiX.mjs} +2 -2
  16. package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-CWF7edmQ.mjs} +2 -2
  17. package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-D5EF5PGW.mjs} +13 -11
  18. package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-BYbzHNVe.mjs} +4 -4
  19. package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-D_FfkvVD.mjs} +330 -299
  20. package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-D3Pgh6ik.mjs} +53 -23
  21. package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-XZoAYVYD.mjs} +217 -198
  22. package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B5d3ObhB.mjs} +49 -44
  23. package/dist/LexicalList.prod-OQDpVAEb.mjs +967 -0
  24. package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-BkM8G3DG.mjs} +61 -42
  25. package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-DcVXCex6.mjs} +254 -202
  26. package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-DppD7IrA.mjs} +337 -52
  27. package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-CPSn7dkg.mjs} +12 -8
  28. package/dist/LexicalRichText.prod-h7JPxFNp.mjs +718 -0
  29. package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-CD0SLbxP.mjs} +48 -17
  30. package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-CGlJgUlZ.mjs} +5 -4
  31. package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-DbVZN5AV.mjs} +101 -92
  32. package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-D0HU14UV.mjs} +340 -138
  33. package/dist/LexicalTable.prod-BcPNSrxP.mjs +2468 -0
  34. package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-iKy_TrRT.mjs} +15 -19
  35. package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-CIgMS8cG.mjs} +6 -6
  36. package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-DIAsKJzu.mjs} +155 -159
  37. package/dist/bin/mxs.mjs +1 -1
  38. package/dist/esm-CH7CrOvh.mjs +2 -0
  39. package/dist/{esm-BNu4sUWV.mjs → esm-CwXl1N0a.mjs} +1801 -6013
  40. package/dist/index.d.mts +57 -62
  41. package/dist/index.mjs +1 -1
  42. package/dist/{mxs-BUqt-N3N.mjs → mxs-iW9DgqSZ.mjs} +14960 -9235
  43. package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
  44. package/dist/vendor/litexml/cli.mjs +6693 -5762
  45. package/dist/vendor/litexml/litexml-html-preview-client.js +11912 -8698
  46. package/package.json +31 -30
  47. package/LICENSE +0 -33
  48. package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
  49. package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
  50. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
  51. package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
  52. package/dist/esm-jbwcVZth.mjs +0 -2
@@ -1,5 +1,5 @@
1
- import { H as $getPreviousSelection, I as $getEditor, Ir as getStyleObjectFromCSS$1, Mt as $setSelection, Ot as $selectAll, Pr as getRootOwnerDocument, Q as $hasAncestor, Sn as INTERNAL_$isBlock, St as $isTokenOrSegmented, W as $getSelection, a as $caretRangeFromSelection, at as $isElementNode, b as $findMatchingParent, bt as $isTextNode, ct as $isLeafNode, ht as $isRootOrShadowRoot, i as $caretFromPoint, k as $getCharacterOffsets, mt as $isRootNode, nt as $isChildCaret, o as $cloneWithProperties, ot as $isExtendableTextPointCaret, pt as $isRangeSelection, rt as $isDecoratorNode, s as $cloneWithPropertiesEphemeral, v as $createTextNode, y as $extendCaretToRange, z as $getNodeByKey } from "./Lexical.node-BlCLnfA6.mjs";
2
- //#region ../../node_modules/.pnpm/@lexical+selection@0.46.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.dev.mjs
1
+ import { $ as $hasAncestor, B as $getNodeByKey, Br as getRootOwnerDocument, Ct as $isTextPointCaret, Dr as flipDirection, En as INTERNAL_$isBlock, Ft as $setSelection, G as $getSelection, Hr as getStyleObjectFromCSS$1, L as $getEditor, St as $isTextNode, U as $getPreviousSelection, a as $caretRangeFromSelection, b as $findMatchingParent, gt as $isRootOrShadowRoot, ht as $isRootNode, i as $caretFromPoint, it as $isDecoratorNode, jt as $selectAll, k as $getCharacterOffsets, lt as $isLeafNode, mt as $isRangeSelection, o as $cloneWithProperties, ot as $isElementNode, rt as $isChildCaret, s as $cloneWithPropertiesEphemeral, st as $isExtendableTextPointCaret, v as $createTextNode, wt as $isTokenOrSegmented, xt as $isTabNode, y as $extendCaretToRange } from "./Lexical.node-8sRFmq2X.mjs";
2
+ //#region ../../node_modules/.pnpm/@lexical+selection@0.48.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.dev.mjs
3
3
  /**
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -401,17 +401,43 @@ function $copyBlockFormatIndent(srcNode, destNode) {
401
401
  if (format !== destNode.getFormatType()) destNode.setFormat(format);
402
402
  if (indent !== destNode.getIndent()) destNode.setIndent(indent);
403
403
  }
404
- function $isPointAtBlockStart(point, block) {
405
- if (point.offset !== 0) return false;
406
- let node = point.getNode();
407
- if ($isElementNode(node) && node.isEmpty()) return false;
408
- while (!node.is(block)) {
409
- if (node.getPreviousSibling() !== null) return false;
410
- const parent = node.getParent();
411
- if (parent === null) return false;
412
- node = parent;
404
+ /**
405
+ * Determine whether a point sits at the leading ('previous') or trailing
406
+ * ('next') edge of `element`'s content — i.e. there is no content between the
407
+ * point and that edge of the element.
408
+ *
409
+ * This is the caret-based generalization of {@link $isAtNodeEnd}. An empty
410
+ * `element` is considered to be at both of its edges. `@lexical/utils`
411
+ * re-exports this as the direction-specific `$isAtStartOfNode` /
412
+ * `$isAtEndOfNode` helpers.
413
+ *
414
+ * @param point - The point to test.
415
+ * @param element - The ancestor element whose edge is tested.
416
+ * @param direction - 'previous' for the start of `element`, 'next' for the end.
417
+ */
418
+ function $isAtEdgeOfElement(point, element, direction) {
419
+ let caret = $caretFromPoint(point, direction);
420
+ if ($isExtendableTextPointCaret(caret)) return false;
421
+ for (; caret; caret = caret.getParentCaret()) {
422
+ const parent = caret.getParentAtCaret();
423
+ if (!parent || caret.getNodeAtCaret()) return false;
424
+ if (element.is(parent)) return true;
413
425
  }
414
- return true;
426
+ return false;
427
+ }
428
+ /**
429
+ * Determine whether a point sits at the edge of a block in the given
430
+ * direction: 'previous' for the start of the block, 'next' for the end.
431
+ *
432
+ * Unlike {@link $isAtEdgeOfElement}, an empty block is treated as not being at
433
+ * the edge: when an ElementNode is empty it's not possible to distinguish if
434
+ * the selection's intent is the entire block or the edge so we consider it to
435
+ * be the entire block.
436
+ */
437
+ function $isPointAtBlockEdge(point, block, direction) {
438
+ const node = point.getNode();
439
+ if ($isElementNode(node) && node.isEmpty()) return false;
440
+ return $isAtEdgeOfElement(point, block, direction);
415
441
  }
416
442
  /**
417
443
  * Converts all nodes in the selection that are of one block type to another.
@@ -422,19 +448,20 @@ function $isPointAtBlockStart(point, block) {
422
448
  function $setBlocksType(selection, $createElement, $afterCreateElement = $copyBlockFormatIndent) {
423
449
  if (!selection) return;
424
450
  const anchorAndFocus = selection.getStartEndPoints();
425
- let skipFocusAtBlockStart = false;
451
+ let skipFocus = false;
426
452
  let focusBlock = null;
427
453
  const blockMap = /* @__PURE__ */ new Map();
428
454
  if (anchorAndFocus) {
429
455
  const [anchor, focus] = anchorAndFocus;
430
456
  const anchorBlock = $findMatchingParent(anchor.getNode(), INTERNAL_$isBlock);
431
457
  focusBlock = $findMatchingParent(focus.getNode(), INTERNAL_$isBlock);
432
- skipFocusAtBlockStart = $isElementNode(focusBlock) && !focusBlock.is(anchorBlock) && $isPointAtBlockStart(focus, focusBlock);
458
+ const direction = selection.isBackward() ? "previous" : "next";
459
+ skipFocus = $isElementNode(focusBlock) && !focusBlock.is(anchorBlock) && $isPointAtBlockEdge(focus, focusBlock, flipDirection(direction));
433
460
  if ($isElementNode(anchorBlock)) blockMap.set(anchorBlock.getKey(), anchorBlock);
434
- if ($isElementNode(focusBlock) && !skipFocusAtBlockStart) blockMap.set(focusBlock.getKey(), focusBlock);
461
+ if ($isElementNode(focusBlock) && !skipFocus) blockMap.set(focusBlock.getKey(), focusBlock);
435
462
  }
436
463
  for (const node of selection.getNodes()) if ($isElementNode(node) && INTERNAL_$isBlock(node)) {
437
- if (skipFocusAtBlockStart && node.is(focusBlock)) continue;
464
+ if (skipFocus && node.is(focusBlock)) continue;
438
465
  blockMap.set(node.getKey(), node);
439
466
  } else if (!anchorAndFocus) {
440
467
  const ancestorBlock = $findMatchingParent(node, INTERNAL_$isBlock);
@@ -627,6 +654,10 @@ function $shouldOverrideDefaultCharacterSelection(selection, isBackward) {
627
654
  if ($isParentElementRTL(selection)) adjustedIsBackward = !adjustedIsBackward;
628
655
  const focusCaret = $caretFromPoint(selection.focus, adjustedIsBackward ? "previous" : "next");
629
656
  if ($isExtendableTextPointCaret(focusCaret)) return false;
657
+ if ($isTextPointCaret(focusCaret) && !$isTabNode(focusCaret.origin) && focusCaret.origin.isUnmergeable()) {
658
+ const sibling = focusCaret.getNodeAtCaret();
659
+ if ($isTextNode(sibling) && !$isTabNode(sibling)) return true;
660
+ }
630
661
  for (const nextCaret of $extendCaretToRange(focusCaret)) {
631
662
  if ($isChildCaret(nextCaret)) return !nextCaret.origin.isInline();
632
663
  else if ($isElementNode(nextCaret.origin)) continue;
@@ -733,4 +764,4 @@ const getStyleObjectFromCSS = getStyleObjectFromCSS$1;
733
764
  /** @deprecated renamed to {@link $trimTextContentFromAnchor} by @lexical/eslint-plugin rules-of-lexical */
734
765
  const trimTextContentFromAnchor = $trimTextContentFromAnchor;
735
766
  //#endregion
736
- export { $addNodeStyle, $cloneWithProperties, $copyBlockFormatIndent, $ensureForwardRangeSelection, $forEachSelectedTextNode, $getComputedStyleForElement, $getComputedStyleForParent, $getSelectionStyleValueForProperty, $isAtNodeEnd, $isParentElementRTL, $isParentRTL, $moveCaretSelection, $moveCharacter, $patchStyleText, $selectAll, $setBlocksType, $shouldOverrideDefaultCharacterSelection, $sliceSelectedTextNodeContent, $trimTextContentFromAnchor, $wrapNodes, createDOMRange, createRectsFromDOMRange, getCSSFromStyleObject, getStyleObjectFromCSS, trimTextContentFromAnchor };
767
+ export { $addNodeStyle, $cloneWithProperties, $copyBlockFormatIndent, $ensureForwardRangeSelection, $forEachSelectedTextNode, $getComputedStyleForElement, $getComputedStyleForParent, $getSelectionStyleValueForProperty, $isAtEdgeOfElement, $isAtNodeEnd, $isParentElementRTL, $isParentRTL, $moveCaretSelection, $moveCharacter, $patchStyleText, $selectAll, $setBlocksType, $shouldOverrideDefaultCharacterSelection, $sliceSelectedTextNodeContent, $trimTextContentFromAnchor, $wrapNodes, createDOMRange, createRectsFromDOMRange, getCSSFromStyleObject, getStyleObjectFromCSS, trimTextContentFromAnchor };
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@lexical+selection@0.46.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.node.mjs
1
+ //#region ../../node_modules/.pnpm/@lexical+selection@0.48.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.node.mjs
2
2
  /**
3
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
4
4
  *
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  *
8
8
  */
9
- const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalSelection.dev-C4L7l8OB.mjs") : import("./LexicalSelection.prod-DzFqpTlw.mjs"));
9
+ const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalSelection.dev-CD0SLbxP.mjs") : import("./LexicalSelection.prod-DbVZN5AV.mjs"));
10
10
  mod.$addNodeStyle;
11
11
  mod.$cloneWithProperties;
12
12
  mod.$copyBlockFormatIndent;
@@ -15,7 +15,8 @@ mod.$forEachSelectedTextNode;
15
15
  mod.$getComputedStyleForElement;
16
16
  mod.$getComputedStyleForParent;
17
17
  mod.$getSelectionStyleValueForProperty;
18
- const $isAtNodeEnd = mod.$isAtNodeEnd;
18
+ const $isAtEdgeOfElement = mod.$isAtEdgeOfElement;
19
+ mod.$isAtNodeEnd;
19
20
  mod.$isParentElementRTL;
20
21
  const $isParentRTL = mod.$isParentRTL;
21
22
  mod.$moveCaretSelection;
@@ -33,4 +34,4 @@ mod.getCSSFromStyleObject;
33
34
  mod.getStyleObjectFromCSS;
34
35
  mod.trimTextContentFromAnchor;
35
36
  //#endregion
36
- export { $sliceSelectedTextNodeContent as a, $shouldOverrideDefaultCharacterSelection as i, $isParentRTL as n, createRectsFromDOMRange as o, $moveCharacter as r, $isAtNodeEnd as t };
37
+ export { $sliceSelectedTextNodeContent as a, $shouldOverrideDefaultCharacterSelection as i, $isParentRTL as n, createRectsFromDOMRange as o, $moveCharacter as r, $isAtEdgeOfElement as t };
@@ -1,5 +1,5 @@
1
- import { H as $getPreviousSelection, I as $getEditor, Ir as getStyleObjectFromCSS, Mt as $setSelection, Ot as $selectAll, Pr as getRootOwnerDocument, Q as $hasAncestor, Sn as INTERNAL_$isBlock, St as $isTokenOrSegmented, W as $getSelection, a as $caretRangeFromSelection, at as $isElementNode, b as $findMatchingParent, bt as $isTextNode, ct as $isLeafNode, ht as $isRootOrShadowRoot, i as $caretFromPoint, k as $getCharacterOffsets, mt as $isRootNode, nt as $isChildCaret, o as $cloneWithProperties, ot as $isExtendableTextPointCaret, pt as $isRangeSelection, rt as $isDecoratorNode, s as $cloneWithPropertiesEphemeral, v as $createTextNode, y as $extendCaretToRange, z as $getNodeByKey } from "./Lexical.node-BlCLnfA6.mjs";
2
- //#region ../../node_modules/.pnpm/@lexical+selection@0.46.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.prod.mjs
1
+ import { $ as $hasAncestor, B as $getNodeByKey, Br as getRootOwnerDocument, Ct as $isTextPointCaret, Dr as flipDirection, En as INTERNAL_$isBlock, Ft as $setSelection, G as $getSelection, Hr as getStyleObjectFromCSS, L as $getEditor, St as $isTextNode, U as $getPreviousSelection, a as $caretRangeFromSelection, b as $findMatchingParent, gt as $isRootOrShadowRoot, ht as $isRootNode, i as $caretFromPoint, it as $isDecoratorNode, jt as $selectAll, k as $getCharacterOffsets, lt as $isLeafNode, mt as $isRangeSelection, o as $cloneWithProperties, ot as $isElementNode, rt as $isChildCaret, s as $cloneWithPropertiesEphemeral, st as $isExtendableTextPointCaret, v as $createTextNode, wt as $isTokenOrSegmented, xt as $isTabNode, y as $extendCaretToRange } from "./Lexical.node-8sRFmq2X.mjs";
2
+ //#region ../../node_modules/.pnpm/@lexical+selection@0.48.0_typescript@6.0.3/node_modules/@lexical/selection/dist/LexicalSelection.prod.mjs
3
3
  /**
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -7,13 +7,13 @@ import { H as $getPreviousSelection, I as $getEditor, Ir as getStyleObjectFromCS
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  *
9
9
  */
10
- function K(e, ...t) {
10
+ function B(e, ...t) {
11
11
  const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
12
12
  o.append("code", e);
13
13
  for (const e of t) o.append("v", e);
14
14
  throw n.search = o.toString(), Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
15
15
  }
16
- function E(e) {
16
+ function k(e) {
17
17
  let t = e;
18
18
  for (; null != t;) {
19
19
  if (t.nodeType === Node.TEXT_NODE) return t;
@@ -21,26 +21,26 @@ function E(e) {
21
21
  }
22
22
  return null;
23
23
  }
24
- function I(e) {
24
+ function F(e) {
25
25
  const t = e.parentNode;
26
26
  if (null == t) throw new Error("Should never happen");
27
27
  return [t, Array.from(t.childNodes).indexOf(e)];
28
28
  }
29
- function B(n, o, l, r, i) {
29
+ function b(n, o, l, r, i) {
30
30
  const s = o.getKey(), c = r.getKey(), f = getRootOwnerDocument(n.getRootElement()).createRange();
31
- let u = n.getElementByKey(s), g = n.getElementByKey(c), d = l, a = i;
32
- if ($isTextNode(o) && (u = E(u)), $isTextNode(r) && (g = E(g)), void 0 === o || void 0 === r || null === u || null === g) return null;
33
- "BR" === u.nodeName && ([u, d] = I(u)), "BR" === g.nodeName && ([g, a] = I(g));
31
+ let u = n.getElementByKey(s), g = n.getElementByKey(c), a = l, d = i;
32
+ if ($isTextNode(o) && (u = k(u)), $isTextNode(r) && (g = k(g)), void 0 === o || void 0 === r || null === u || null === g) return null;
33
+ "BR" === u.nodeName && ([u, a] = F(u)), "BR" === g.nodeName && ([g, d] = F(g));
34
34
  const p = u.firstChild;
35
- u === g && null != p && "BR" === p.nodeName && 0 === d && 0 === a && (a = 1);
35
+ u === g && null != p && "BR" === p.nodeName && 0 === a && 0 === d && (d = 1);
36
36
  try {
37
- f.setStart(u, d), f.setEnd(g, a);
37
+ f.setStart(u, a), f.setEnd(g, d);
38
38
  } catch (e) {
39
39
  return null;
40
40
  }
41
- return !f.collapsed || d === a && s === c || (f.setStart(g, a), f.setEnd(u, d)), f;
41
+ return !f.collapsed || a === d && s === c || (f.setStart(g, d), f.setEnd(u, a)), f;
42
42
  }
43
- function F(e, t) {
43
+ function z(e, t) {
44
44
  const n = e.getRootElement();
45
45
  if (null === n) return [];
46
46
  const o = n.getBoundingClientRect(), l = getComputedStyle(n), r = parseFloat(l.paddingLeft) + parseFloat(l.paddingRight), i = Array.from(t.getClientRects());
@@ -55,46 +55,46 @@ function F(e, t) {
55
55
  }
56
56
  return i;
57
57
  }
58
- function b(e) {
58
+ function A(e) {
59
59
  let t = "";
60
60
  for (const n in e) n && (t += `${n}: ${e[n]};`);
61
61
  return t;
62
62
  }
63
- function k(e) {
63
+ function R(e) {
64
64
  const t = $getEditor().getElementByKey(e.getKey());
65
65
  if (null === t) return null;
66
66
  const o = t.ownerDocument.defaultView;
67
67
  return null === o ? null : o.getComputedStyle(t);
68
68
  }
69
- function z(e) {
70
- return k($isRootNode(e) ? e : e.getParentOrThrow());
69
+ function O(e) {
70
+ return R($isRootNode(e) ? e : e.getParentOrThrow());
71
71
  }
72
- function R(e) {
73
- const t = z(e);
72
+ function _(e) {
73
+ const t = O(e);
74
74
  return null !== t && "rtl" === t.direction;
75
75
  }
76
- function O(e, t, n = "self") {
76
+ function L(e, t, n = "self") {
77
77
  const o = e.getStartEndPoints();
78
78
  if (t.isSelected(e) && !$isTokenOrSegmented(t) && null !== o) {
79
- const [l, r] = o, i = e.isBackward(), s = l.getNode(), c = r.getNode(), g = t.is(s), d = t.is(c);
80
- if (g || d) {
81
- const [o, l] = $getCharacterOffsets(e), r = s.is(c), g = t.is(i ? c : s), d = t.is(i ? s : c);
82
- let a, p = 0;
83
- if (r) p = o > l ? l : o, a = o > l ? o : l;
84
- else if (g) p = i ? l : o, a = void 0;
85
- else if (d) p = 0, a = i ? o : l;
86
- const h = t.__text.slice(p, a);
79
+ const [l, r] = o, i = e.isBackward(), s = l.getNode(), c = r.getNode(), g = t.is(s), a = t.is(c);
80
+ if (g || a) {
81
+ const [o, l] = $getCharacterOffsets(e), r = s.is(c), g = t.is(i ? c : s), a = t.is(i ? s : c);
82
+ let d, p = 0;
83
+ if (r) p = o > l ? l : o, d = o > l ? o : l;
84
+ else if (g) p = i ? l : o, d = void 0;
85
+ else if (a) p = 0, d = i ? o : l;
86
+ const h = t.__text.slice(p, d);
87
87
  h !== t.__text && ("clone" === n && (t = $cloneWithPropertiesEphemeral(t)), t.__text = h);
88
88
  }
89
89
  }
90
90
  return t;
91
91
  }
92
- function A(e) {
92
+ function M(e) {
93
93
  if ("text" === e.type) return e.offset === e.getNode().getTextContentSize();
94
94
  const t = e.getNode();
95
- return $isElementNode(t) || K(177), e.offset === t.getChildrenSize();
95
+ return $isElementNode(t) || B(177), e.offset === t.getChildrenSize();
96
96
  }
97
- function _(e, n, l) {
97
+ function $(e, n, l) {
98
98
  let i = n.getNode(), s = l;
99
99
  if ($isElementNode(i)) {
100
100
  const e = i.getDescendantByIndex(n.offset);
@@ -160,20 +160,20 @@ function _(e, n, l) {
160
160
  }
161
161
  }
162
162
  }
163
- const L = () => {};
164
- function M(e, n) {
165
- ($isRangeSelection(e) ? e.isCollapsed() : $isTextNode(e) || $isElementNode(e)) || K(280);
166
- const o = getStyleObjectFromCSS($isRangeSelection(e) ? e.style : $isTextNode(e) ? e.getStyle() : e.getTextStyle()), l = b(Object.entries(n).reduce((t, [n, l]) => ("function" == typeof l ? t[n] = l(o[n], e) : null === l ? delete t[n] : t[n] = l, t), { ...o }));
163
+ const D = () => {};
164
+ function U(e, n) {
165
+ ($isRangeSelection(e) ? e.isCollapsed() : $isTextNode(e) || $isElementNode(e)) || B(280);
166
+ const o = getStyleObjectFromCSS($isRangeSelection(e) ? e.style : $isTextNode(e) ? e.getStyle() : e.getTextStyle()), l = A(Object.entries(n).reduce((t, [n, l]) => ("function" == typeof l ? t[n] = l(o[n], e) : null === l ? delete t[n] : t[n] = l, t), { ...o }));
167
167
  $isRangeSelection(e) || $isTextNode(e) ? e.setStyle(l) : e.setTextStyle(l);
168
168
  }
169
- function $(e, t) {
169
+ function j(e, t) {
170
170
  if ($isRangeSelection(e) && e.isCollapsed()) {
171
- M(e, t);
171
+ U(e, t);
172
172
  const n = e.anchor.getNode();
173
- $isElementNode(n) && n.isEmpty() && M(n, t);
173
+ $isElementNode(n) && n.isEmpty() && U(n, t);
174
174
  }
175
- D((e) => {
176
- M(e, t);
175
+ H((e) => {
176
+ U(e, t);
177
177
  });
178
178
  const n = e.getNodes();
179
179
  if (n.length > 0) {
@@ -181,11 +181,11 @@ function $(e, t) {
181
181
  for (const o of n) {
182
182
  if (!$isElementNode(o) || !o.canBeEmpty() || 0 !== o.getChildrenSize()) continue;
183
183
  const n = o.getKey();
184
- e.has(n) || (e.add(n), M(o, t));
184
+ e.has(n) || (e.add(n), U(o, t));
185
185
  }
186
186
  }
187
187
  }
188
- function D(e) {
188
+ function H(e) {
189
189
  const n = $getSelection();
190
190
  if (!n) return;
191
191
  const o = /* @__PURE__ */ new Map(), c = (e) => o.get(e.getKey()) || [0, e.getTextContentSize()];
@@ -197,37 +197,41 @@ function D(e) {
197
197
  if (l !== o) if ($isTokenOrSegmented(n) || 0 === o && l === n.getTextContentSize()) e(n);
198
198
  else e(n.splitText(o, l)[0 === o ? 0 : 1]);
199
199
  }
200
- $isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && j(n);
200
+ $isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && V(n);
201
201
  }
202
- function j(e) {
202
+ function V(e) {
203
203
  if (e.isBackward()) {
204
204
  const { anchor: t, focus: n } = e, { key: o, offset: l, type: r } = t;
205
205
  t.set(n.key, n.offset, n.type), n.set(o, l, r);
206
206
  }
207
207
  }
208
- function U(e, t) {
208
+ function W(e, t) {
209
209
  const n = e.getFormatType(), o = e.getIndent();
210
210
  n !== t.getFormatType() && t.setFormat(n), o !== t.getIndent() && t.setIndent(o);
211
211
  }
212
- function H(e, t, n = U) {
212
+ function X(e, t, n) {
213
+ let o = $caretFromPoint(e, n);
214
+ if ($isExtendableTextPointCaret(o)) return !1;
215
+ for (; o; o = o.getParentCaret()) {
216
+ const e = o.getParentAtCaret();
217
+ if (!e || o.getNodeAtCaret()) return !1;
218
+ if (t.is(e)) return !0;
219
+ }
220
+ return !1;
221
+ }
222
+ function q(e, t, n = W) {
213
223
  if (!e) return;
214
224
  const o = e.getStartEndPoints();
215
225
  let l = !1, r = null;
216
226
  const i = /* @__PURE__ */ new Map();
217
227
  if (o) {
218
- const [e, t] = o, n = $findMatchingParent(e.getNode(), INTERNAL_$isBlock);
219
- r = $findMatchingParent(t.getNode(), INTERNAL_$isBlock), l = $isElementNode(r) && !r.is(n) && function(e, t) {
220
- if (0 !== e.offset) return !1;
221
- let n = e.getNode();
222
- if ($isElementNode(n) && n.isEmpty()) return !1;
223
- for (; !n.is(t);) {
224
- if (null !== n.getPreviousSibling()) return !1;
225
- const e = n.getParent();
226
- if (null === e) return !1;
227
- n = e;
228
- }
229
- return !0;
230
- }(t, r), $isElementNode(n) && i.set(n.getKey(), n), $isElementNode(r) && !l && i.set(r.getKey(), r);
228
+ const [t, n] = o, s = $findMatchingParent(t.getNode(), INTERNAL_$isBlock);
229
+ r = $findMatchingParent(n.getNode(), INTERNAL_$isBlock);
230
+ const f = e.isBackward() ? "previous" : "next";
231
+ l = $isElementNode(r) && !r.is(s) && function(e, t, n) {
232
+ const o = e.getNode();
233
+ return (!$isElementNode(o) || !o.isEmpty()) && X(e, t, n);
234
+ }(n, r, flipDirection(f)), $isElementNode(s) && i.set(s.getKey(), s), $isElementNode(r) && !l && i.set(r.getKey(), r);
231
235
  }
232
236
  for (const t of e.getNodes()) if ($isElementNode(t) && INTERNAL_$isBlock(t)) {
233
237
  if (l && t.is(r)) continue;
@@ -241,17 +245,17 @@ function H(e, t, n = U) {
241
245
  n(e, o), e.replace(o, !0);
242
246
  }
243
247
  }
244
- function V(e) {
248
+ function G(e) {
245
249
  return e.getNode().isAttached();
246
250
  }
247
- function W(e) {
251
+ function J(e) {
248
252
  let t = e;
249
253
  for (; null !== t && !$isRootOrShadowRoot(t);) {
250
254
  const e = t.getLatest(), n = t.getParent();
251
255
  0 === e.getChildrenSize() && t.remove(!0), t = n;
252
256
  }
253
257
  }
254
- function X(e, t, n = null) {
258
+ function Q(e, t, n = null) {
255
259
  const o = e.getStartEndPoints(), l = o ? o[0] : null, r = e.getNodes(), i = r.length;
256
260
  if (null !== l && (0 === i || 1 === i && "element" === l.type && 0 === l.getNode().getChildrenSize())) {
257
261
  const e = "text" === l.type ? l.getNode().getParentOrThrow() : l.getNode(), o = e.getChildren();
@@ -262,18 +266,18 @@ function X(e, t, n = null) {
262
266
  let s = null, c = [];
263
267
  for (let o = 0; o < i; o++) {
264
268
  const l = r[o];
265
- $isRootOrShadowRoot(l) ? (q(e, c, c.length, t, n), c = [], s = l) : null === s || null !== s && $hasAncestor(l, s) ? c.push(l) : (q(e, c, c.length, t, n), c = [l]);
269
+ $isRootOrShadowRoot(l) ? (Y(e, c, c.length, t, n), c = [], s = l) : null === s || null !== s && $hasAncestor(l, s) ? c.push(l) : (Y(e, c, c.length, t, n), c = [l]);
266
270
  }
267
- q(e, c, c.length, t, n);
271
+ Y(e, c, c.length, t, n);
268
272
  }
269
- function q(e, t, n, o, l = null) {
273
+ function Y(e, t, n, o, l = null) {
270
274
  if (0 === t.length) return;
271
275
  const i = t[0], s = /* @__PURE__ */ new Map(), f = [], u = $isElementNode(i) ? i : i.getParentOrThrow();
272
- let g = u.isInline() ? u.getParentOrThrow() : u, a = !1;
276
+ let g = u.isInline() ? u.getParentOrThrow() : u, d = !1;
273
277
  for (; null !== g;) {
274
278
  const e = g.getPreviousSibling();
275
279
  if (null !== e) {
276
- g = e, a = !0;
280
+ g = e, d = !0;
277
281
  break;
278
282
  }
279
283
  if (g = g.getParentOrThrow(), $isRootOrShadowRoot(g)) break;
@@ -295,10 +299,10 @@ function q(e, t, n, o, l = null) {
295
299
  const n = l.getChildren();
296
300
  t.splice(t.getChildrenSize(), 0, n);
297
301
  for (const e of n) if (h.add(e.getKey()), $isElementNode(e)) for (const t of e.getChildrenKeys()) h.add(t);
298
- W(l);
302
+ J(l);
299
303
  }
300
304
  } else if (p.has(n.getKey())) {
301
- $isElementNode(n) || K(179);
305
+ $isElementNode(n) || B(179);
302
306
  const e = o();
303
307
  e.setFormat(n.getFormatType()), e.setIndent(n.getIndent()), f.push(e), n.remove(!0);
304
308
  }
@@ -308,7 +312,7 @@ function q(e, t, n, o, l = null) {
308
312
  l.append(t);
309
313
  }
310
314
  let y = null;
311
- if ($isRootOrShadowRoot(g)) if (a) if (null !== l) g.insertAfter(l);
315
+ if ($isRootOrShadowRoot(g)) if (d) if (null !== l) g.insertAfter(l);
312
316
  else for (let e = f.length - 1; e >= 0; e--) {
313
317
  const t = f[e];
314
318
  g.insertAfter(t);
@@ -332,22 +336,26 @@ function q(e, t, n, o, l = null) {
332
336
  g.insertAfter(t), y = t;
333
337
  }
334
338
  const m = $getPreviousSelection();
335
- $isRangeSelection(m) && V(m.anchor) && V(m.focus) ? $setSelection(m.clone()) : null !== y ? y.selectEnd() : e.dirty = !0;
339
+ $isRangeSelection(m) && G(m.anchor) && G(m.focus) ? $setSelection(m.clone()) : null !== y ? y.selectEnd() : e.dirty = !0;
336
340
  }
337
- function G(e) {
338
- const t = J(e);
341
+ function Z(e) {
342
+ const t = ee(e);
339
343
  return null !== t && "vertical-rl" === t.writingMode;
340
344
  }
341
- function J(e) {
345
+ function ee(e) {
342
346
  const t = e.anchor.getNode();
343
- return $isElementNode(t) ? k(t) : z(t);
347
+ return $isElementNode(t) ? R(t) : O(t);
344
348
  }
345
- function Q(e, t) {
346
- let n = G(e) ? !t : t;
347
- Z(e) && (n = !n);
348
- const o = $caretFromPoint(e.focus, n ? "previous" : "next");
349
- if ($isExtendableTextPointCaret(o)) return !1;
350
- for (const e of $extendCaretToRange(o)) {
349
+ function te(e, n) {
350
+ let o = Z(e) ? !n : n;
351
+ oe(e) && (o = !o);
352
+ const l = $caretFromPoint(e.focus, o ? "previous" : "next");
353
+ if ($isExtendableTextPointCaret(l)) return !1;
354
+ if ($isTextPointCaret(l) && !$isTabNode(l.origin) && l.origin.isUnmergeable()) {
355
+ const e = l.getNodeAtCaret();
356
+ if ($isTextNode(e) && !$isTabNode(e)) return !0;
357
+ }
358
+ for (const e of $extendCaretToRange(l)) {
351
359
  if ($isChildCaret(e)) return !e.origin.isInline();
352
360
  if (!$isElementNode(e.origin)) {
353
361
  if ($isDecoratorNode(e.origin)) return !0;
@@ -356,23 +364,23 @@ function Q(e, t) {
356
364
  }
357
365
  return !1;
358
366
  }
359
- function Y(e, t, n, o) {
367
+ function ne(e, t, n, o) {
360
368
  e.modify(t ? "extend" : "move", n, o);
361
369
  }
362
- function Z(e) {
363
- const t = J(e);
370
+ function oe(e) {
371
+ const t = ee(e);
364
372
  return null !== t && "rtl" === t.direction;
365
373
  }
366
- function ee(e, t, n) {
367
- const o = Z(e);
374
+ function le(e, t, n) {
375
+ const o = oe(e);
368
376
  let l;
369
- l = G(e) || o ? !n : n, Y(e, t, l, "character");
377
+ l = Z(e) || o ? !n : n, ne(e, t, l, "character");
370
378
  }
371
- function te(e, t, n) {
379
+ function re(e, t, n) {
372
380
  const l = getStyleObjectFromCSS(e.getStyle());
373
381
  return null !== l && l[t] || n;
374
382
  }
375
- function ne(e, n, o = "") {
383
+ function ie(e, n, o = "") {
376
384
  let l = null;
377
385
  const i = e.getNodes();
378
386
  let s, c;
@@ -387,7 +395,7 @@ function ne(e, n, o = "") {
387
395
  for (let e = 0; e < i.length; e++) {
388
396
  const r = i[e];
389
397
  if ($isTextNode(r) && !r.is(0 === e ? s : c)) {
390
- const e = te(r, n, o);
398
+ const e = re(r, n, o);
391
399
  if (null === l) l = e;
392
400
  else if (l !== e) {
393
401
  l = "";
@@ -397,6 +405,7 @@ function ne(e, n, o = "") {
397
405
  }
398
406
  return null === l ? o : l;
399
407
  }
400
- const oe = getStyleObjectFromCSS, le = _;
408
+ const se = getStyleObjectFromCSS;
409
+ const ce = $;
401
410
  //#endregion
402
- export { L as $addNodeStyle, $cloneWithProperties, U as $copyBlockFormatIndent, j as $ensureForwardRangeSelection, D as $forEachSelectedTextNode, k as $getComputedStyleForElement, z as $getComputedStyleForParent, ne as $getSelectionStyleValueForProperty, A as $isAtNodeEnd, Z as $isParentElementRTL, R as $isParentRTL, Y as $moveCaretSelection, ee as $moveCharacter, $ as $patchStyleText, $selectAll, H as $setBlocksType, Q as $shouldOverrideDefaultCharacterSelection, O as $sliceSelectedTextNodeContent, _ as $trimTextContentFromAnchor, X as $wrapNodes, B as createDOMRange, F as createRectsFromDOMRange, b as getCSSFromStyleObject, oe as getStyleObjectFromCSS, le as trimTextContentFromAnchor };
411
+ export { D as $addNodeStyle, $cloneWithProperties, W as $copyBlockFormatIndent, V as $ensureForwardRangeSelection, H as $forEachSelectedTextNode, R as $getComputedStyleForElement, O as $getComputedStyleForParent, ie as $getSelectionStyleValueForProperty, X as $isAtEdgeOfElement, M as $isAtNodeEnd, oe as $isParentElementRTL, _ as $isParentRTL, ne as $moveCaretSelection, le as $moveCharacter, j as $patchStyleText, $selectAll, q as $setBlocksType, te as $shouldOverrideDefaultCharacterSelection, L as $sliceSelectedTextNodeContent, $ as $trimTextContentFromAnchor, Q as $wrapNodes, b as createDOMRange, z as createRectsFromDOMRange, A as getCSSFromStyleObject, se as getStyleObjectFromCSS, ce as trimTextContentFromAnchor };