@mx-space/cli 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -11
- package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-Cck4n26y.mjs} +998 -584
- package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-D6wf2D5M.mjs} +15 -5
- package/dist/Lexical.prod-DCwS1oTq.mjs +7170 -0
- package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CMkPHV7O.mjs} +6 -6
- package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-m4nZ7IYw.mjs} +2 -2
- package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-B_rN1vE1.mjs} +10 -8
- package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DyJw3i8V.mjs} +62 -72
- package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-DPXLHQLF.mjs} +212 -213
- package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-ZkNfMwrE.mjs} +3 -3
- package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-Ds9oLUFh.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-B58ic2av.mjs} +5 -4
- package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-DvwHs1Xv.mjs} +79 -67
- package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-5OymZQfy.mjs} +4 -2
- package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-Ce0T5smQ.mjs} +372 -358
- package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-DA0WldSR.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-1kQgKB6c.mjs} +2 -2
- package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-BDB7CUrx.mjs} +14 -12
- package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-DpVNt7It.mjs} +4 -4
- package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-HkxM5scw.mjs} +331 -300
- package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-C5zNJlrm.mjs} +65 -59
- package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-Bkt9hQAt.mjs} +196 -201
- package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B7VgME-m.mjs} +55 -82
- package/dist/LexicalList.prod-B8c7TDjH.mjs +951 -0
- package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-B5z9kLbV.mjs} +62 -42
- package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-wKzw7FFH.mjs} +255 -202
- package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-CUd6Li5F.mjs} +399 -120
- package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-BKfaQ-CH.mjs} +12 -8
- package/dist/LexicalRichText.prod-SBewjJHx.mjs +708 -0
- package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-D27JOCqj.mjs} +48 -17
- package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-DBEwPjBu.mjs} +5 -4
- package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-OaYhXHOL.mjs} +101 -92
- package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-6IFFOAE0.mjs} +590 -259
- package/dist/LexicalTable.prod-2CaLZ7fH.mjs +2524 -0
- package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-DJA7J_7v.mjs} +15 -19
- package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-Df9oPTlA.mjs} +6 -6
- package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-Bb7V4Ewg.mjs} +155 -159
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-CDcJmHkG.mjs +2 -0
- package/dist/{esm-BNu4sUWV.mjs → esm-DLzrv7gD.mjs} +1837 -6015
- package/dist/index.d.mts +57 -62
- package/dist/index.mjs +1 -1
- package/dist/{mxs-CMX2yklg.mjs → mxs-BIRW5Axj.mjs} +13579 -8682
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/vendor/litexml/cli.mjs +7043 -6207
- package/dist/vendor/litexml/litexml-html-preview-client.css +80 -47
- package/dist/vendor/litexml/litexml-html-preview-client.js +14422 -10838
- package/dist/vendor/litexml/style.css +6 -2
- package/package.json +23 -23
- package/skills/commands-ai.md +45 -12
- package/skills/overview.md +1 -1
- package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
- package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
- package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
- package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
- package/dist/esm-jbwcVZth.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../../node_modules/.pnpm/@lexical+selection@0.
|
|
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-D6wf2D5M.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@lexical+selection@0.49.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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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) && !
|
|
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 (
|
|
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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@lexical+selection@0.49.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-
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalSelection.dev-D27JOCqj.mjs") : import("./LexicalSelection.prod-OaYhXHOL.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 $
|
|
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, $
|
|
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 {
|
|
2
|
-
//#region ../../node_modules/.pnpm/@lexical+selection@0.
|
|
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-D6wf2D5M.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@lexical+selection@0.49.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
|
|
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
|
|
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
|
|
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
|
|
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),
|
|
32
|
-
if ($isTextNode(o) && (u =
|
|
33
|
-
"BR" === u.nodeName && ([u,
|
|
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 ===
|
|
35
|
+
u === g && null != p && "BR" === p.nodeName && 0 === a && 0 === d && (d = 1);
|
|
36
36
|
try {
|
|
37
|
-
f.setStart(u,
|
|
37
|
+
f.setStart(u, a), f.setEnd(g, d);
|
|
38
38
|
} catch (e) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
return !f.collapsed ||
|
|
41
|
+
return !f.collapsed || a === d && s === c || (f.setStart(g, d), f.setEnd(u, a)), f;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
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
|
|
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
|
|
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
|
|
70
|
-
return
|
|
69
|
+
function O(e) {
|
|
70
|
+
return R($isRootNode(e) ? e : e.getParentOrThrow());
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const t =
|
|
72
|
+
function _(e) {
|
|
73
|
+
const t = O(e);
|
|
74
74
|
return null !== t && "rtl" === t.direction;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
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),
|
|
80
|
-
if (g ||
|
|
81
|
-
const [o, l] = $getCharacterOffsets(e), r = s.is(c), g = t.is(i ? c : s),
|
|
82
|
-
let
|
|
83
|
-
if (r) p = o > l ? l : o,
|
|
84
|
-
else if (g) p = i ? l : o,
|
|
85
|
-
else if (
|
|
86
|
-
const h = t.__text.slice(p,
|
|
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
|
|
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) ||
|
|
95
|
+
return $isElementNode(t) || B(177), e.offset === t.getChildrenSize();
|
|
96
96
|
}
|
|
97
|
-
function
|
|
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
|
|
164
|
-
function
|
|
165
|
-
($isRangeSelection(e) ? e.isCollapsed() : $isTextNode(e) || $isElementNode(e)) ||
|
|
166
|
-
const o = getStyleObjectFromCSS($isRangeSelection(e) ? e.style : $isTextNode(e) ? e.getStyle() : e.getTextStyle()), l =
|
|
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
|
|
169
|
+
function j(e, t) {
|
|
170
170
|
if ($isRangeSelection(e) && e.isCollapsed()) {
|
|
171
|
-
|
|
171
|
+
U(e, t);
|
|
172
172
|
const n = e.anchor.getNode();
|
|
173
|
-
$isElementNode(n) && n.isEmpty() &&
|
|
173
|
+
$isElementNode(n) && n.isEmpty() && U(n, t);
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
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),
|
|
184
|
+
e.has(n) || (e.add(n), U(o, t));
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
function
|
|
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 &&
|
|
200
|
+
$isRangeSelection(n) && "text" === n.anchor.type && "text" === n.focus.type && n.anchor.key === n.focus.key && V(n);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
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
|
|
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
|
|
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 [
|
|
219
|
-
r = $findMatchingParent(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
|
248
|
+
function G(e) {
|
|
245
249
|
return e.getNode().isAttached();
|
|
246
250
|
}
|
|
247
|
-
function
|
|
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
|
|
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) ? (
|
|
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
|
-
|
|
271
|
+
Y(e, c, c.length, t, n);
|
|
268
272
|
}
|
|
269
|
-
function
|
|
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,
|
|
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,
|
|
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
|
-
|
|
302
|
+
J(l);
|
|
299
303
|
}
|
|
300
304
|
} else if (p.has(n.getKey())) {
|
|
301
|
-
$isElementNode(n) ||
|
|
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 (
|
|
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) &&
|
|
339
|
+
$isRangeSelection(m) && G(m.anchor) && G(m.focus) ? $setSelection(m.clone()) : null !== y ? y.selectEnd() : e.dirty = !0;
|
|
336
340
|
}
|
|
337
|
-
function
|
|
338
|
-
const t =
|
|
341
|
+
function Z(e) {
|
|
342
|
+
const t = ee(e);
|
|
339
343
|
return null !== t && "vertical-rl" === t.writingMode;
|
|
340
344
|
}
|
|
341
|
-
function
|
|
345
|
+
function ee(e) {
|
|
342
346
|
const t = e.anchor.getNode();
|
|
343
|
-
return $isElementNode(t) ?
|
|
347
|
+
return $isElementNode(t) ? R(t) : O(t);
|
|
344
348
|
}
|
|
345
|
-
function
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
const
|
|
349
|
-
if ($isExtendableTextPointCaret(
|
|
350
|
-
|
|
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
|
|
367
|
+
function ne(e, t, n, o) {
|
|
360
368
|
e.modify(t ? "extend" : "move", n, o);
|
|
361
369
|
}
|
|
362
|
-
function
|
|
363
|
-
const t =
|
|
370
|
+
function oe(e) {
|
|
371
|
+
const t = ee(e);
|
|
364
372
|
return null !== t && "rtl" === t.direction;
|
|
365
373
|
}
|
|
366
|
-
function
|
|
367
|
-
const o =
|
|
374
|
+
function le(e, t, n) {
|
|
375
|
+
const o = oe(e);
|
|
368
376
|
let l;
|
|
369
|
-
l =
|
|
377
|
+
l = Z(e) || o ? !n : n, ne(e, t, l, "character");
|
|
370
378
|
}
|
|
371
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
408
|
+
const se = getStyleObjectFromCSS;
|
|
409
|
+
const ce = $;
|
|
401
410
|
//#endregion
|
|
402
|
-
export {
|
|
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 };
|