@mx-space/cli 0.13.0 → 0.13.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.
- package/README.md +23 -1
- package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
- package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
- package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
- package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
- package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
- package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
- package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
- package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
- package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
- package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
- package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
- package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
- package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
- package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
- package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
- package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
- package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
- package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
- package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
- package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
- package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
- package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
- package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
- package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
- package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
- package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
- package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
- package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
- package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
- package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
- package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
- package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
- package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
- package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-BumPuCXw.mjs +2 -0
- package/dist/{esm-lpolVSUJ.mjs → esm-DupC6TTP.mjs} +172 -172
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +1 -1
- package/dist/{mxs-PFV8OJ-M.mjs → mxs-BgAyMQdq.mjs} +1595 -314
- package/package.json +17 -17
- package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
- package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
- package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
- package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
- package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
- package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
- package/dist/esm-DGvoYR6n.mjs +0 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { d as getPeerDependencyFromEditor, f as namedSignals, l as effect } from "./LexicalExtension.node-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { d as getPeerDependencyFromEditor, f as namedSignals, l as effect } from "./LexicalExtension.node-CMsupJZs.mjs";
|
|
2
|
+
import { Bn as KEY_ARROW_LEFT_COMMAND, Br as isDOMDocumentNode, Ct as $normalizeCaret, D as $getCaretRange, G as $getSiblingCaret, Gn as KEY_ENTER_COMMAND, Hn as KEY_ARROW_UP_COMMAND, I as $getEditor, Jn as KEY_TAB_COMMAND, Lr as getTextDirection, Nt as $setSelectionFromCaretRange, O as $getCaretRangeInDirection, Qn as OUTDENT_CONTENT_COMMAND, S as $generateNodesFromRawText, Ur as isDOMTextNode, Vn as KEY_ARROW_RIGHT_COMMAND, W as $getSelection, Xn as MOVE_TO_END, Yt as COMMAND_PRIORITY_LOW, Z as $getTextPointCaret, Zn as MOVE_TO_START, _ as $createTabNode, ai as safeCast, at as $isElementNode, br as defineExtension, bt as $isTextNode, d as $createLineBreakNode, dn as ElementNode, et as $insertNodes, fi as tokenizeRawText, fr as TextNode, hr as configExtension, ii as removeClassNamesFromElement, m as $createPoint, n as $applyNodeReplacement, ni as mergeRegister, oi as setDOMStyleFromCSS, p as $createParagraphNode, pr as addClassNamesToElement, pt as $isRangeSelection, qr as isHTMLElement, u as $create, ut as $isLineBreakNode, vn as INDENT_CONTENT_COMMAND, xn as INSERT_TAB_COMMAND, yt as $isTabNode, zn as KEY_ARROW_DOWN_COMMAND } from "./Lexical.node-DnR_u_Ke.mjs";
|
|
3
|
+
import { c as DOMImportExtension, g as defineOverlayRules, h as defineImportRule, l as ImportOverlays, s as CoreImportExtension, v as sel } from "./LexicalHtml.node-DagZUjQ_.mjs";
|
|
4
|
+
import { l as $onEscapeDown, u as $onEscapeUp } from "./LexicalUtils.node-Ck74ludK.mjs";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@lexical+code-core@0.46.0_typescript@6.0.3/node_modules/@lexical/code-core/dist/LexicalCodeCore.dev.mjs
|
|
5
6
|
/**
|
|
6
7
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
8
|
*
|
|
@@ -81,9 +82,13 @@ function $getStartOfCodeInLine(anchor, offset) {
|
|
|
81
82
|
let nodeTextContent = anchor.getTextContent();
|
|
82
83
|
while (true) {
|
|
83
84
|
if (nodeOffset === 0) {
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
|
|
85
|
+
const prevSibling = node.getPreviousSibling();
|
|
86
|
+
if (prevSibling === null) {
|
|
87
|
+
node = null;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (!($isCodeHighlightNode(prevSibling) || $isTabNode(prevSibling) || $isLineBreakNode(prevSibling))) formatDevErrorMessage(`Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode`);
|
|
91
|
+
node = prevSibling;
|
|
87
92
|
if ($isLineBreakNode(node)) {
|
|
88
93
|
last = {
|
|
89
94
|
node,
|
|
@@ -154,12 +159,10 @@ function $getEndOfCodeInLine(anchor) {
|
|
|
154
159
|
*/
|
|
155
160
|
function $plainifyCodeContent(text) {
|
|
156
161
|
const out = [];
|
|
157
|
-
text
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (part.length > 0) out.push($createCodeHighlightNode(part));
|
|
162
|
-
});
|
|
162
|
+
tokenizeRawText(text, {
|
|
163
|
+
linebreak: () => out.push($createLineBreakNode()),
|
|
164
|
+
tab: () => out.push($createTabNode()),
|
|
165
|
+
text: (part) => out.push($createCodeHighlightNode(part))
|
|
163
166
|
});
|
|
164
167
|
return out;
|
|
165
168
|
}
|
|
@@ -565,30 +568,6 @@ function $isCodeHighlightNode(node) {
|
|
|
565
568
|
* LICENSE file in the root directory of this source tree.
|
|
566
569
|
*
|
|
567
570
|
*/
|
|
568
|
-
/**
|
|
569
|
-
* Add code blocks to the editor (syntax highlighting provided separately)
|
|
570
|
-
*/
|
|
571
|
-
const CodeExtension = defineExtension({
|
|
572
|
-
name: "@lexical/code",
|
|
573
|
-
nodes: () => [CodeNode, CodeHighlightNode],
|
|
574
|
-
register(editor) {
|
|
575
|
-
return editor.registerCommand(KEY_ENTER_COMMAND, (event) => {
|
|
576
|
-
const selection = $getSelection();
|
|
577
|
-
if ($isRangeSelection(selection) && $exitCodeNodeOnEnter(selection)) {
|
|
578
|
-
event.preventDefault();
|
|
579
|
-
return true;
|
|
580
|
-
}
|
|
581
|
-
return false;
|
|
582
|
-
}, COMMAND_PRIORITY_LOW);
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
/**
|
|
586
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
587
|
-
*
|
|
588
|
-
* This source code is licensed under the MIT license found in the
|
|
589
|
-
* LICENSE file in the root directory of this source tree.
|
|
590
|
-
*
|
|
591
|
-
*/
|
|
592
571
|
const LANGUAGE_DATA_ATTRIBUTE = "data-language";
|
|
593
572
|
/**
|
|
594
573
|
* True for elements whose `font-family` mentions `monospace` — the
|
|
@@ -615,12 +594,12 @@ function isMonospaceDescendant(node) {
|
|
|
615
594
|
* the cost of these rules is never paid against unrelated `<tr>` /
|
|
616
595
|
* `<td>` pastes.
|
|
617
596
|
*/
|
|
618
|
-
const GitHubCodeTableOverlayRules = defineOverlayRules([defineImportRule({
|
|
597
|
+
const GitHubCodeTableOverlayRules = /* @__PURE__ */ defineOverlayRules([/* @__PURE__ */ defineImportRule({
|
|
619
598
|
$import: (ctx, el) => ctx.$importChildren(el),
|
|
620
599
|
match: sel.tag("tr", "td"),
|
|
621
600
|
name: "@lexical/code/github-code-table/unwrap"
|
|
622
601
|
})]);
|
|
623
|
-
const PreRule = defineImportRule({
|
|
602
|
+
const PreRule = /* @__PURE__ */ defineImportRule({
|
|
624
603
|
$import: (ctx, el) => [$createCodeNode(el.getAttribute(LANGUAGE_DATA_ATTRIBUTE)).splice(0, 0, ctx.$importChildren(el))],
|
|
625
604
|
match: sel.tag("pre"),
|
|
626
605
|
name: "@lexical/code/pre"
|
|
@@ -631,7 +610,7 @@ const PreRule = defineImportRule({
|
|
|
631
610
|
* defers to the inline-format rule from `CoreImportExtension` so it
|
|
632
611
|
* becomes a TextNode with IS_CODE.
|
|
633
612
|
*/
|
|
634
|
-
const MultilineCodeRule = defineImportRule({
|
|
613
|
+
const MultilineCodeRule = /* @__PURE__ */ defineImportRule({
|
|
635
614
|
$import: (ctx, el, $next) => {
|
|
636
615
|
const text = el.textContent || "";
|
|
637
616
|
if (!(/\r?\n/.test(text) || el.querySelector("br") !== null)) return $next();
|
|
@@ -721,7 +700,7 @@ function looksLikeVscodePaste(root) {
|
|
|
721
700
|
}
|
|
722
701
|
return false;
|
|
723
702
|
}
|
|
724
|
-
const VscodeCodePasteOverlay = defineOverlayRules([defineImportRule({
|
|
703
|
+
const VscodeCodePasteOverlay = /* @__PURE__ */ defineOverlayRules([/* @__PURE__ */ defineImportRule({
|
|
725
704
|
$import: (_ctx, el, $next) => {
|
|
726
705
|
if (!isMonospacePreElement(el) || isMonospaceDescendant(el)) return $next();
|
|
727
706
|
const lines = splitMonospaceWrapperLines(el);
|
|
@@ -730,7 +709,7 @@ const VscodeCodePasteOverlay = defineOverlayRules([defineImportRule({
|
|
|
730
709
|
},
|
|
731
710
|
match: sel.tag("div"),
|
|
732
711
|
name: "@lexical/code/vscode-wrapper"
|
|
733
|
-
}), defineImportRule({
|
|
712
|
+
}), /* @__PURE__ */ defineImportRule({
|
|
734
713
|
$import: (_ctx, el, $next) => {
|
|
735
714
|
if (!isMonospacePreElement(el) || isMonospaceDescendant(el)) return $next();
|
|
736
715
|
const prev = el.previousElementSibling;
|
|
@@ -779,7 +758,7 @@ const $installVscodeCodePasteOverlay = (dom, ctx, $next) => {
|
|
|
779
758
|
* wrapper just unwrap so their text content flows into the surrounding
|
|
780
759
|
* CodeNode.
|
|
781
760
|
*/
|
|
782
|
-
const DivRule = defineImportRule({
|
|
761
|
+
const DivRule = /* @__PURE__ */ defineImportRule({
|
|
783
762
|
$import: (ctx, el, $next) => {
|
|
784
763
|
if (isMonospaceElement(el)) return [$createCodeNode().splice(0, 0, ctx.$importChildren(el))];
|
|
785
764
|
if (isMonospaceDescendant(el)) return ctx.$importChildren(el);
|
|
@@ -795,15 +774,21 @@ const DivRule = defineImportRule({
|
|
|
795
774
|
* registered before the generic `<table>` / `<tr>` / `<td>` rules so
|
|
796
775
|
* they win dispatch.
|
|
797
776
|
*
|
|
777
|
+
* Registered by {@link CodeExtension} itself (together with
|
|
778
|
+
* `CoreImportExtension` and the {@link $installVscodeCodePasteOverlay}
|
|
779
|
+
* preprocess), so any editor that uses the code extension can import
|
|
780
|
+
* these shapes through the `DOMImportExtension` pipeline without further
|
|
781
|
+
* configuration.
|
|
782
|
+
*
|
|
798
783
|
* @experimental
|
|
799
784
|
*/
|
|
800
785
|
const CodeImportRules = [
|
|
801
|
-
defineImportRule({
|
|
786
|
+
/* @__PURE__ */ defineImportRule({
|
|
802
787
|
$import: (ctx, el) => [$createCodeNode().splice(0, 0, ctx.$importChildren(el, { rules: GitHubCodeTableOverlayRules }))],
|
|
803
788
|
match: sel.tag("table").classAll("js-file-line-container"),
|
|
804
789
|
name: "@lexical/code/github-code-table"
|
|
805
790
|
}),
|
|
806
|
-
defineImportRule({
|
|
791
|
+
/* @__PURE__ */ defineImportRule({
|
|
807
792
|
$import: (ctx, el) => ctx.$importChildren(el),
|
|
808
793
|
match: sel.tag("td").classAll("js-file-line"),
|
|
809
794
|
name: "@lexical/code/github-code-cell-by-class"
|
|
@@ -813,22 +798,44 @@ const CodeImportRules = [
|
|
|
813
798
|
DivRule
|
|
814
799
|
];
|
|
815
800
|
/**
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
*
|
|
801
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
802
|
+
*
|
|
803
|
+
* This source code is licensed under the MIT license found in the
|
|
804
|
+
* LICENSE file in the root directory of this source tree.
|
|
805
|
+
*
|
|
806
|
+
*/
|
|
807
|
+
/**
|
|
808
|
+
* Add code blocks to the editor (syntax highlighting provided separately)
|
|
809
|
+
*/
|
|
810
|
+
const CodeExtension = /* @__PURE__ */ defineExtension({
|
|
811
|
+
dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(DOMImportExtension, {
|
|
812
|
+
preprocess: [$installVscodeCodePasteOverlay],
|
|
813
|
+
rules: CodeImportRules
|
|
814
|
+
})],
|
|
815
|
+
name: "@lexical/code",
|
|
816
|
+
nodes: () => [CodeNode, CodeHighlightNode],
|
|
817
|
+
register(editor) {
|
|
818
|
+
return editor.registerCommand(KEY_ENTER_COMMAND, (event) => {
|
|
819
|
+
const selection = $getSelection();
|
|
820
|
+
if ($isRangeSelection(selection) && $exitCodeNodeOnEnter(selection)) {
|
|
821
|
+
event.preventDefault();
|
|
822
|
+
return true;
|
|
823
|
+
}
|
|
824
|
+
return false;
|
|
825
|
+
}, COMMAND_PRIORITY_LOW);
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
/**
|
|
829
|
+
* Bundles {@link CodeImportRules} together with the runtime
|
|
830
|
+
* {@link CodeExtension}.
|
|
820
831
|
*
|
|
821
832
|
* @experimental
|
|
833
|
+
* @deprecated {@link CodeExtension} now registers
|
|
834
|
+
* {@link CodeImportRules} (and `CoreImportExtension`) itself — depend on
|
|
835
|
+
* it directly instead.
|
|
822
836
|
*/
|
|
823
|
-
const CodeImportExtension = defineExtension({
|
|
824
|
-
dependencies: [
|
|
825
|
-
CoreImportExtension,
|
|
826
|
-
CodeExtension,
|
|
827
|
-
configExtension(DOMImportExtension, {
|
|
828
|
-
preprocess: [$installVscodeCodePasteOverlay],
|
|
829
|
-
rules: CodeImportRules
|
|
830
|
-
})
|
|
831
|
-
],
|
|
837
|
+
const CodeImportExtension = /* @__PURE__ */ defineExtension({
|
|
838
|
+
dependencies: [CodeExtension],
|
|
832
839
|
name: "@lexical/code/Import"
|
|
833
840
|
});
|
|
834
841
|
function $isSelectionInCode(selection) {
|
|
@@ -951,13 +958,13 @@ function $handleShiftLines(type, event) {
|
|
|
951
958
|
if (codeNode.getPreviousSibling() === null) {
|
|
952
959
|
codeNode.selectPrevious();
|
|
953
960
|
event.preventDefault();
|
|
954
|
-
return
|
|
961
|
+
return false;
|
|
955
962
|
}
|
|
956
963
|
} else if (!arrowIsUp && anchorOffset === anchorNode.getTextContentSize() && anchorNode.getNextSibling() === null) {
|
|
957
964
|
if (codeNode.getNextSibling() === null) {
|
|
958
965
|
codeNode.selectNext();
|
|
959
966
|
event.preventDefault();
|
|
960
|
-
return
|
|
967
|
+
return false;
|
|
961
968
|
}
|
|
962
969
|
}
|
|
963
970
|
}
|
|
@@ -1043,8 +1050,13 @@ function $handleMoveTo(type, event) {
|
|
|
1043
1050
|
* up to that many leading spaces from a code line. See
|
|
1044
1051
|
* {@link $outdentLeadingSpaces}.
|
|
1045
1052
|
*/
|
|
1046
|
-
function registerCodeIndentation(editor, tabSize) {
|
|
1047
|
-
return mergeRegister(
|
|
1053
|
+
function registerCodeIndentation(editor, tabSize, escapeWithArrows) {
|
|
1054
|
+
return mergeRegister(...escapeWithArrows ? [
|
|
1055
|
+
editor.registerCommand(KEY_ARROW_DOWN_COMMAND, (event) => event.altKey ? false : $onEscapeDown($isCodeNode, event), COMMAND_PRIORITY_LOW),
|
|
1056
|
+
editor.registerCommand(KEY_ARROW_RIGHT_COMMAND, (event) => $onEscapeDown($isCodeNode, event), COMMAND_PRIORITY_LOW),
|
|
1057
|
+
editor.registerCommand(KEY_ARROW_UP_COMMAND, (event) => event.altKey ? false : $onEscapeUp($isCodeNode, event), COMMAND_PRIORITY_LOW),
|
|
1058
|
+
editor.registerCommand(KEY_ARROW_LEFT_COMMAND, (event) => $onEscapeUp($isCodeNode, event), COMMAND_PRIORITY_LOW)
|
|
1059
|
+
] : [], editor.registerCommand(KEY_TAB_COMMAND, (event) => {
|
|
1048
1060
|
const command = $handleTab(event.shiftKey);
|
|
1049
1061
|
if (command === null) return false;
|
|
1050
1062
|
event.preventDefault();
|
|
@@ -1060,7 +1072,8 @@ function registerCodeIndentation(editor, tabSize) {
|
|
|
1060
1072
|
const { anchor } = selection;
|
|
1061
1073
|
const anchorNode = anchor.getNode();
|
|
1062
1074
|
if (!$isSelectionInCode(selection)) return false;
|
|
1063
|
-
|
|
1075
|
+
const parent = anchorNode.getParent();
|
|
1076
|
+
if (selection.isCollapsed() && anchor.offset === 0 && anchorNode.getPreviousSibling() === null && $isCodeNode(parent) && parent.getPreviousSibling() === null) {
|
|
1064
1077
|
event.preventDefault();
|
|
1065
1078
|
return true;
|
|
1066
1079
|
}
|
|
@@ -1071,7 +1084,7 @@ function registerCodeIndentation(editor, tabSize) {
|
|
|
1071
1084
|
const { anchor } = selection;
|
|
1072
1085
|
const anchorNode = anchor.getNode();
|
|
1073
1086
|
if (!$isSelectionInCode(selection)) return false;
|
|
1074
|
-
if (selection.isCollapsed() && anchor.offset === anchorNode.getTextContentSize() && anchorNode.getNextSibling() === null && $isCodeNode(anchorNode.getParentOrThrow())) {
|
|
1087
|
+
if (selection.isCollapsed() && anchor.offset === anchorNode.getTextContentSize() && anchorNode.getNextSibling() === null && $isCodeNode(anchorNode.getParentOrThrow()) && anchorNode.getParentOrThrow().getNextSibling() === null) {
|
|
1075
1088
|
event.preventDefault();
|
|
1076
1089
|
return true;
|
|
1077
1090
|
}
|
|
@@ -1089,10 +1102,11 @@ function registerCodeIndentation(editor, tabSize) {
|
|
|
1089
1102
|
* Code blocks without syntax highlighting can use this extension on its
|
|
1090
1103
|
* own.
|
|
1091
1104
|
*/
|
|
1092
|
-
const CodeIndentExtension = defineExtension({
|
|
1105
|
+
const CodeIndentExtension = /* @__PURE__ */ defineExtension({
|
|
1093
1106
|
build: (editor, config) => namedSignals(config),
|
|
1094
|
-
config: safeCast({
|
|
1107
|
+
config: /* @__PURE__ */ safeCast({
|
|
1095
1108
|
disabled: false,
|
|
1109
|
+
escapeWithArrows: false,
|
|
1096
1110
|
tabSize: void 0
|
|
1097
1111
|
}),
|
|
1098
1112
|
dependencies: [CodeExtension],
|
|
@@ -1101,7 +1115,7 @@ const CodeIndentExtension = defineExtension({
|
|
|
1101
1115
|
const stores = state.getOutput();
|
|
1102
1116
|
return effect(() => {
|
|
1103
1117
|
if (stores.disabled.value) return;
|
|
1104
|
-
return registerCodeIndentation(editor, stores.tabSize.value);
|
|
1118
|
+
return registerCodeIndentation(editor, stores.tabSize.value, stores.escapeWithArrows.value);
|
|
1105
1119
|
});
|
|
1106
1120
|
}
|
|
1107
1121
|
});
|