@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.
- package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-CtGmYDoh.mjs} +770 -271
- package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-8sRFmq2X.mjs} +15 -5
- package/dist/Lexical.prod-D-VfeKDz.mjs +7200 -0
- package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CzQ15z6E.mjs} +6 -6
- package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-D4gMGws6.mjs} +2 -2
- package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-CltkQpzS.mjs} +10 -8
- package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DkYBZRGB.mjs} +11 -9
- package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-COc3_QL8.mjs} +178 -167
- package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-Dv5_WUae.mjs} +3 -3
- package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-DgjrmWkd.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-DnpbDe-_.mjs} +5 -4
- package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-JMH_6-OZ.mjs} +73 -52
- package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-BUozzx4t.mjs} +4 -2
- package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-UiyDgmou.mjs} +370 -347
- package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-BfLGciiX.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-CWF7edmQ.mjs} +2 -2
- package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-D5EF5PGW.mjs} +13 -11
- package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-BYbzHNVe.mjs} +4 -4
- package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-D_FfkvVD.mjs} +330 -299
- package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-D3Pgh6ik.mjs} +53 -23
- package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-XZoAYVYD.mjs} +217 -198
- package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B5d3ObhB.mjs} +49 -44
- package/dist/LexicalList.prod-OQDpVAEb.mjs +967 -0
- package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-BkM8G3DG.mjs} +61 -42
- package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-DcVXCex6.mjs} +254 -202
- package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-DppD7IrA.mjs} +337 -52
- package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-CPSn7dkg.mjs} +12 -8
- package/dist/LexicalRichText.prod-h7JPxFNp.mjs +718 -0
- package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-CD0SLbxP.mjs} +48 -17
- package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-CGlJgUlZ.mjs} +5 -4
- package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-DbVZN5AV.mjs} +101 -92
- package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-D0HU14UV.mjs} +340 -138
- package/dist/LexicalTable.prod-BcPNSrxP.mjs +2468 -0
- package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-iKy_TrRT.mjs} +15 -19
- package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-CIgMS8cG.mjs} +6 -6
- package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-DIAsKJzu.mjs} +155 -159
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-CH7CrOvh.mjs +2 -0
- package/dist/{esm-BNu4sUWV.mjs → esm-CwXl1N0a.mjs} +1801 -6013
- package/dist/index.d.mts +57 -62
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BUqt-N3N.mjs → mxs-iW9DgqSZ.mjs} +14960 -9235
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/vendor/litexml/cli.mjs +6693 -5762
- package/dist/vendor/litexml/litexml-html-preview-client.js +11912 -8698
- package/package.json +31 -30
- package/LICENSE +0 -33
- 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-CPSn7dkg.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-8sRFmq2X.mjs";
|
|
3
|
+
import { a as $sliceSelectedTextNodeContent } from "./LexicalSelection.node-CGlJgUlZ.mjs";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@lexical+markdown@0.48.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
|
*
|
|
@@ -492,7 +492,7 @@ const TRANSFORMERS = [
|
|
|
492
492
|
];
|
|
493
493
|
function normalizeMarkdown(input, shouldMergeAdjacentLines = false) {
|
|
494
494
|
const lines = input.split("\n");
|
|
495
|
-
let
|
|
495
|
+
let codeBlockFenceLength = 0;
|
|
496
496
|
const sanitizedLines = [];
|
|
497
497
|
for (let i = 0; i < lines.length; i++) {
|
|
498
498
|
const rawLine = lines[i];
|
|
@@ -504,12 +504,19 @@ function normalizeMarkdown(input, shouldMergeAdjacentLines = false) {
|
|
|
504
504
|
sanitizedLines.push(line);
|
|
505
505
|
continue;
|
|
506
506
|
}
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
507
|
+
if (codeBlockFenceLength === 0) {
|
|
508
|
+
const openMatch = line.match(CODE_START_REGEX);
|
|
509
|
+
if (openMatch) {
|
|
510
|
+
codeBlockFenceLength = openMatch[1].trim().length;
|
|
511
|
+
sanitizedLines.push(line);
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
} else {
|
|
515
|
+
if (CODE_END_REGEX.test(line) && line.trim().length >= codeBlockFenceLength) {
|
|
516
|
+
codeBlockFenceLength = 0;
|
|
517
|
+
sanitizedLines.push(line);
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
513
520
|
sanitizedLines.push(rawLine);
|
|
514
521
|
continue;
|
|
515
522
|
}
|
|
@@ -903,8 +910,7 @@ function scanDelimiters(text, transformersIndex, excludeRanges = []) {
|
|
|
903
910
|
canOpen,
|
|
904
911
|
char,
|
|
905
912
|
index: i,
|
|
906
|
-
length: len
|
|
907
|
-
originalLength: len
|
|
913
|
+
length: len
|
|
908
914
|
});
|
|
909
915
|
i += len;
|
|
910
916
|
}
|
|
@@ -920,14 +926,14 @@ function processEmphasis(text, delimiters, transformersIndex) {
|
|
|
920
926
|
currentPos++;
|
|
921
927
|
continue;
|
|
922
928
|
}
|
|
923
|
-
const bottomKey = `${closer.char}${closer.canOpen}`;
|
|
929
|
+
const bottomKey = `${closer.char}${closer.canOpen}${closer.length % 3}`;
|
|
924
930
|
const bottom = openersBottom[bottomKey] ?? -1;
|
|
925
931
|
let foundOpener = false;
|
|
926
932
|
for (let openIdx = currentPos - 1; openIdx > bottom; openIdx--) {
|
|
927
933
|
const opener = delimiters[openIdx];
|
|
928
934
|
if (!opener.active || !opener.canOpen || opener.length === 0 || opener.char !== closer.char) continue;
|
|
929
935
|
if (opener.canClose || closer.canOpen) {
|
|
930
|
-
if ((opener.
|
|
936
|
+
if ((opener.length + closer.length) % 3 === 0 && opener.length % 3 !== 0 && closer.length % 3 !== 0) continue;
|
|
931
937
|
}
|
|
932
938
|
const maxLen = Math.min(opener.length, closer.length);
|
|
933
939
|
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 +1099,31 @@ function importTextTransformers(textNode, textFormatTransformersIndex, textMatch
|
|
|
1093
1099
|
*
|
|
1094
1100
|
*/
|
|
1095
1101
|
/**
|
|
1096
|
-
*
|
|
1102
|
+
* Parses a markdown string and appends the resulting nodes to `container`.
|
|
1103
|
+
* Does not clear the container or touch the selection — callers handle that.
|
|
1097
1104
|
*/
|
|
1098
|
-
function
|
|
1105
|
+
function $importMarkdownNodes(markdownString, container, transformers, shouldPreserveNewLines = false) {
|
|
1099
1106
|
const byType = transformersByType(transformers);
|
|
1100
1107
|
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);
|
|
1108
|
+
const lines = markdownString.split("\n");
|
|
1109
|
+
const linesLength = lines.length;
|
|
1110
|
+
for (let i = 0; i < linesLength; i++) {
|
|
1111
|
+
const lineText = lines[i];
|
|
1112
|
+
const [imported, shiftedIndex] = $importMultiline(lines, i, byType.multilineElement, container);
|
|
1113
|
+
if (imported) {
|
|
1114
|
+
i = shiftedIndex;
|
|
1115
|
+
continue;
|
|
1114
1116
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1117
|
+
$importBlocks(lineText, container, byType.element, textFormatTransformersIndex, byType.textMatch, shouldPreserveNewLines);
|
|
1118
|
+
}
|
|
1119
|
+
const children = container.getChildren();
|
|
1120
|
+
for (const child of children) {
|
|
1121
|
+
if (!shouldPreserveNewLines && isEmptyParagraph(child) && container.getChildrenSize() > 1) {
|
|
1122
|
+
child.remove();
|
|
1123
|
+
continue;
|
|
1122
1124
|
}
|
|
1123
|
-
if ($
|
|
1124
|
-
}
|
|
1125
|
+
if ($isElementNode(child)) for (const textNode of child.getAllTextNodes()) $normalizeMarkdownTextNode(textNode);
|
|
1126
|
+
}
|
|
1125
1127
|
}
|
|
1126
1128
|
/**
|
|
1127
1129
|
*
|
|
@@ -1187,7 +1189,7 @@ function $importBlocks(lineText, rootNode, elementTransformers, textFormatTransf
|
|
|
1187
1189
|
}
|
|
1188
1190
|
}
|
|
1189
1191
|
importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers);
|
|
1190
|
-
if (elementNode.
|
|
1192
|
+
if (elementNode.getParent() !== null && lineText.length > 0) {
|
|
1191
1193
|
const previousNode = elementNode.getPreviousSibling();
|
|
1192
1194
|
if (!shouldPreserveNewLines && ($isParagraphNode(previousNode) || $isQuoteNode(previousNode) || $isListNode(previousNode))) {
|
|
1193
1195
|
let targetNode = previousNode;
|
|
@@ -1455,7 +1457,24 @@ function registerMarkdownShortcuts(editor, transformers = TRANSFORMERS) {
|
|
|
1455
1457
|
*/
|
|
1456
1458
|
function $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {
|
|
1457
1459
|
const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);
|
|
1458
|
-
|
|
1460
|
+
const root = node || $getRoot();
|
|
1461
|
+
root.clear();
|
|
1462
|
+
$importMarkdownNodes(sanitizedMarkdown, root, transformers, shouldPreserveNewLines);
|
|
1463
|
+
if ($getSelection() !== null) root.selectStart();
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Parses a markdown string and returns the resulting nodes as an array,
|
|
1467
|
+
* without modifying the document tree or selection. The returned nodes can be
|
|
1468
|
+
* inserted at an arbitrary position via `selection.insertNodes()`.
|
|
1469
|
+
*
|
|
1470
|
+
* @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions
|
|
1471
|
+
* @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.
|
|
1472
|
+
*/
|
|
1473
|
+
function $generateNodesFromMarkdownString(markdown, transformers = TRANSFORMERS, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {
|
|
1474
|
+
const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);
|
|
1475
|
+
const container = new ArtificialNode__DO_NOT_USE();
|
|
1476
|
+
$importMarkdownNodes(sanitizedMarkdown, container, transformers, shouldPreserveNewLines);
|
|
1477
|
+
return container.getChildren();
|
|
1459
1478
|
}
|
|
1460
1479
|
/**
|
|
1461
1480
|
* Renders string from markdown. The selection is moved to the start after the operation.
|
|
@@ -1471,4 +1490,4 @@ function $convertSelectionToMarkdownString(transformers = TRANSFORMERS, selectio
|
|
|
1471
1490
|
return createSelectionMarkdownExport(transformers, shouldPreserveNewLines)(selection);
|
|
1472
1491
|
}
|
|
1473
1492
|
//#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 };
|
|
1493
|
+
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 };
|