@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,7 +1,7 @@
|
|
|
1
|
-
import { _ as LinkNode, a as HeadingNode, c as $createListNode, d as ListItemNode, f as ListNode, h as $isLinkNode, i as $isQuoteNode, l as $isListItemNode, m as $isAutoLinkNode, n as $createQuoteNode, o as QuoteNode, p as $createLinkNode, r as $isHeadingNode, s as $createListItemNode, t as $createHeadingNode, u as $isListNode, v as $createCodeNode, x as CodeNode, y as $isCodeNode } from "./LexicalRichText.node-
|
|
2
|
-
import {
|
|
3
|
-
import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@lexical+markdown@0.
|
|
1
|
+
import { _ as LinkNode, a as HeadingNode, c as $createListNode, d as ListItemNode, f as ListNode, h as $isLinkNode, i as $isQuoteNode, l as $isListItemNode, m as $isAutoLinkNode, n as $createQuoteNode, o as QuoteNode, p as $createLinkNode, r as $isHeadingNode, s as $createListItemNode, t as $createHeadingNode, u as $isListNode, v as $createCodeNode, x as CodeNode, y as $isCodeNode } from "./LexicalRichText.node-BKfaQ-CH.mjs";
|
|
2
|
+
import { $t as COMMAND_PRIORITY_LOW, Cr as createState, Ft as $setSelection, G as $getSelection, Ht as ArtificialNode__DO_NOT_USE, Lt as $setState, St as $isTextNode, W as $getRoot, Yn as KEY_ENTER_COMMAND, Z as $getState, _ as $createTabNode, b as $findMatchingParent, ci as mergeRegister, d as $createLineBreakNode, dt as $isLineBreakNode, en as COMPOSITION_END_TAG, gt as $isRootOrShadowRoot, h as $createRangeSelection, hr as TEXT_TYPE_TO_FORMAT, it as $isDecoratorNode, mt as $isRangeSelection, ot as $isElementNode, p as $createParagraphNode, pt as $isParagraphNode, qt as COLLABORATION_TAG, t as $addUpdateTag, v as $createTextNode, xn as HISTORY_PUSH_TAG, yn as HISTORIC_TAG } from "./Lexical.node-D6wf2D5M.mjs";
|
|
3
|
+
import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-DBEwPjBu.mjs";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@lexical+markdown@0.49.0_typescript@6.0.3/node_modules/@lexical/markdown/dist/LexicalMarkdown.dev.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
7
|
*
|
|
@@ -165,6 +165,7 @@ function getIndent(whitespaces) {
|
|
|
165
165
|
}
|
|
166
166
|
const listReplace = (listType) => {
|
|
167
167
|
return (parentNode, children, match, isImport) => {
|
|
168
|
+
if ($isHeadingNode(parentNode)) return false;
|
|
168
169
|
const previousNode = parentNode.getPreviousSibling();
|
|
169
170
|
const nextNode = parentNode.getNextSibling();
|
|
170
171
|
const listItem = $createListItemNode(listType === "check" ? match[3] === "x" : void 0);
|
|
@@ -492,7 +493,7 @@ const TRANSFORMERS = [
|
|
|
492
493
|
];
|
|
493
494
|
function normalizeMarkdown(input, shouldMergeAdjacentLines = false) {
|
|
494
495
|
const lines = input.split("\n");
|
|
495
|
-
let
|
|
496
|
+
let codeBlockFenceLength = 0;
|
|
496
497
|
const sanitizedLines = [];
|
|
497
498
|
for (let i = 0; i < lines.length; i++) {
|
|
498
499
|
const rawLine = lines[i];
|
|
@@ -504,12 +505,19 @@ function normalizeMarkdown(input, shouldMergeAdjacentLines = false) {
|
|
|
504
505
|
sanitizedLines.push(line);
|
|
505
506
|
continue;
|
|
506
507
|
}
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
508
|
+
if (codeBlockFenceLength === 0) {
|
|
509
|
+
const openMatch = line.match(CODE_START_REGEX);
|
|
510
|
+
if (openMatch) {
|
|
511
|
+
codeBlockFenceLength = openMatch[1].trim().length;
|
|
512
|
+
sanitizedLines.push(line);
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
} else {
|
|
516
|
+
if (CODE_END_REGEX.test(line) && line.trim().length >= codeBlockFenceLength) {
|
|
517
|
+
codeBlockFenceLength = 0;
|
|
518
|
+
sanitizedLines.push(line);
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
513
521
|
sanitizedLines.push(rawLine);
|
|
514
522
|
continue;
|
|
515
523
|
}
|
|
@@ -903,8 +911,7 @@ function scanDelimiters(text, transformersIndex, excludeRanges = []) {
|
|
|
903
911
|
canOpen,
|
|
904
912
|
char,
|
|
905
913
|
index: i,
|
|
906
|
-
length: len
|
|
907
|
-
originalLength: len
|
|
914
|
+
length: len
|
|
908
915
|
});
|
|
909
916
|
i += len;
|
|
910
917
|
}
|
|
@@ -920,14 +927,14 @@ function processEmphasis(text, delimiters, transformersIndex) {
|
|
|
920
927
|
currentPos++;
|
|
921
928
|
continue;
|
|
922
929
|
}
|
|
923
|
-
const bottomKey = `${closer.char}${closer.canOpen}`;
|
|
930
|
+
const bottomKey = `${closer.char}${closer.canOpen}${closer.length % 3}`;
|
|
924
931
|
const bottom = openersBottom[bottomKey] ?? -1;
|
|
925
932
|
let foundOpener = false;
|
|
926
933
|
for (let openIdx = currentPos - 1; openIdx > bottom; openIdx--) {
|
|
927
934
|
const opener = delimiters[openIdx];
|
|
928
935
|
if (!opener.active || !opener.canOpen || opener.length === 0 || opener.char !== closer.char) continue;
|
|
929
936
|
if (opener.canClose || closer.canOpen) {
|
|
930
|
-
if ((opener.
|
|
937
|
+
if ((opener.length + closer.length) % 3 === 0 && opener.length % 3 !== 0 && closer.length % 3 !== 0) continue;
|
|
931
938
|
}
|
|
932
939
|
const maxLen = Math.min(opener.length, closer.length);
|
|
933
940
|
const matchedTag = Object.keys(transformersIndex.transformersByTag).filter((t) => t[0] === opener.char && t.length <= maxLen).sort((a, b) => b.length - a.length)[0];
|
|
@@ -1093,35 +1100,31 @@ function importTextTransformers(textNode, textFormatTransformersIndex, textMatch
|
|
|
1093
1100
|
*
|
|
1094
1101
|
*/
|
|
1095
1102
|
/**
|
|
1096
|
-
*
|
|
1103
|
+
* Parses a markdown string and appends the resulting nodes to `container`.
|
|
1104
|
+
* Does not clear the container or touch the selection — callers handle that.
|
|
1097
1105
|
*/
|
|
1098
|
-
function
|
|
1106
|
+
function $importMarkdownNodes(markdownString, container, transformers, shouldPreserveNewLines = false) {
|
|
1099
1107
|
const byType = transformersByType(transformers);
|
|
1100
1108
|
const textFormatTransformersIndex = createTextFormatTransformersIndex(byType.textFormat);
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
if (imported) {
|
|
1110
|
-
i = shiftedIndex;
|
|
1111
|
-
continue;
|
|
1112
|
-
}
|
|
1113
|
-
$importBlocks(lineText, root, byType.element, textFormatTransformersIndex, byType.textMatch, shouldPreserveNewLines);
|
|
1109
|
+
const lines = markdownString.split("\n");
|
|
1110
|
+
const linesLength = lines.length;
|
|
1111
|
+
for (let i = 0; i < linesLength; i++) {
|
|
1112
|
+
const lineText = lines[i];
|
|
1113
|
+
const [imported, shiftedIndex] = $importMultiline(lines, i, byType.multilineElement, container);
|
|
1114
|
+
if (imported) {
|
|
1115
|
+
i = shiftedIndex;
|
|
1116
|
+
continue;
|
|
1114
1117
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1118
|
+
$importBlocks(lineText, container, byType.element, textFormatTransformersIndex, byType.textMatch, shouldPreserveNewLines);
|
|
1119
|
+
}
|
|
1120
|
+
const children = container.getChildren();
|
|
1121
|
+
for (const child of children) {
|
|
1122
|
+
if (!shouldPreserveNewLines && isEmptyParagraph(child) && container.getChildrenSize() > 1) {
|
|
1123
|
+
child.remove();
|
|
1124
|
+
continue;
|
|
1122
1125
|
}
|
|
1123
|
-
if ($
|
|
1124
|
-
}
|
|
1126
|
+
if ($isElementNode(child)) for (const textNode of child.getAllTextNodes()) $normalizeMarkdownTextNode(textNode);
|
|
1127
|
+
}
|
|
1125
1128
|
}
|
|
1126
1129
|
/**
|
|
1127
1130
|
*
|
|
@@ -1187,7 +1190,7 @@ function $importBlocks(lineText, rootNode, elementTransformers, textFormatTransf
|
|
|
1187
1190
|
}
|
|
1188
1191
|
}
|
|
1189
1192
|
importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers);
|
|
1190
|
-
if (elementNode.
|
|
1193
|
+
if (elementNode.getParent() !== null && lineText.length > 0) {
|
|
1191
1194
|
const previousNode = elementNode.getPreviousSibling();
|
|
1192
1195
|
if (!shouldPreserveNewLines && ($isParagraphNode(previousNode) || $isQuoteNode(previousNode) || $isListNode(previousNode))) {
|
|
1193
1196
|
let targetNode = previousNode;
|
|
@@ -1455,7 +1458,24 @@ function registerMarkdownShortcuts(editor, transformers = TRANSFORMERS) {
|
|
|
1455
1458
|
*/
|
|
1456
1459
|
function $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {
|
|
1457
1460
|
const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);
|
|
1458
|
-
|
|
1461
|
+
const root = node || $getRoot();
|
|
1462
|
+
root.clear();
|
|
1463
|
+
$importMarkdownNodes(sanitizedMarkdown, root, transformers, shouldPreserveNewLines);
|
|
1464
|
+
if ($getSelection() !== null) root.selectStart();
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Parses a markdown string and returns the resulting nodes as an array,
|
|
1468
|
+
* without modifying the document tree or selection. The returned nodes can be
|
|
1469
|
+
* inserted at an arbitrary position via `selection.insertNodes()`.
|
|
1470
|
+
*
|
|
1471
|
+
* @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions
|
|
1472
|
+
* @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.
|
|
1473
|
+
*/
|
|
1474
|
+
function $generateNodesFromMarkdownString(markdown, transformers = TRANSFORMERS, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {
|
|
1475
|
+
const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);
|
|
1476
|
+
const container = new ArtificialNode__DO_NOT_USE();
|
|
1477
|
+
$importMarkdownNodes(sanitizedMarkdown, container, transformers, shouldPreserveNewLines);
|
|
1478
|
+
return container.getChildren();
|
|
1459
1479
|
}
|
|
1460
1480
|
/**
|
|
1461
1481
|
* Renders string from markdown. The selection is moved to the start after the operation.
|
|
@@ -1471,4 +1491,4 @@ function $convertSelectionToMarkdownString(transformers = TRANSFORMERS, selectio
|
|
|
1471
1491
|
return createSelectionMarkdownExport(transformers, shouldPreserveNewLines)(selection);
|
|
1472
1492
|
}
|
|
1473
1493
|
//#endregion
|
|
1474
|
-
export { $convertFromMarkdownString, $convertSelectionToMarkdownString, $convertToMarkdownString, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, CODE, ELEMENT_TRANSFORMERS, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, LINK, MULTILINE_ELEMENT_TRANSFORMERS, ORDERED_LIST, QUOTE, STRIKETHROUGH, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS, UNORDERED_LIST, isTableRowDivider, registerMarkdownShortcuts };
|
|
1494
|
+
export { $convertFromMarkdownString, $convertSelectionToMarkdownString, $convertToMarkdownString, $generateNodesFromMarkdownString, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, CODE, ELEMENT_TRANSFORMERS, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, LINK, MULTILINE_ELEMENT_TRANSFORMERS, ORDERED_LIST, QUOTE, STRIKETHROUGH, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS, UNORDERED_LIST, isTableRowDivider, registerMarkdownShortcuts };
|