@mx-space/cli 0.7.7 → 0.8.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/dist/{Lexical.dev-rcxzwpir.mjs → Lexical.dev-By5dOKBN.mjs} +1486 -356
- package/dist/{Lexical.node-BUsI9gWr.mjs → Lexical.node-fXM8Jp7p.mjs} +39 -17
- package/dist/{Lexical.prod-C8HtkSD6.mjs → Lexical.prod-BlCvXPGa.mjs} +2279 -1768
- package/dist/LexicalClipboard.dev--HxGoSkO.mjs +915 -0
- package/dist/{LexicalClipboard.node-CO-MCKx5.mjs → LexicalClipboard.node-C3mRbrmW.mjs} +10 -3
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +371 -0
- package/dist/LexicalCodeCore.dev-DjSrd4A4.mjs +1109 -0
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +642 -0
- package/dist/{LexicalDragon.dev-gBP8WSRS.mjs → LexicalDragon.dev-DwprRH0z.mjs} +3 -3
- package/dist/{LexicalDragon.node-OG6G55nl.mjs → LexicalDragon.node-BVhw4C7s.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DP-_Q8cv.mjs → LexicalDragon.prod-nh4J-8vn.mjs} +3 -3
- package/dist/{LexicalExtension.dev-DVbjljrm.mjs → LexicalExtension.dev-BPNyvGqe.mjs} +335 -6
- package/dist/{LexicalExtension.node-CF3EAPN7.mjs → LexicalExtension.node-BVlcrgOx.mjs} +15 -8
- package/dist/{LexicalExtension.prod-DklHHErZ.mjs → LexicalExtension.prod-DFKbiNt-.mjs} +375 -265
- package/dist/{LexicalHeadless.dev-DdWLM7Nl.mjs → LexicalHeadless.dev-B-cj7Pr5.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-CoiiTDzR.mjs → LexicalHeadless.prod-Byp1vNzT.mjs} +2 -2
- package/dist/LexicalHtml.dev-prBAwszN.mjs +2424 -0
- package/dist/LexicalHtml.node-BvNF96jZ.mjs +56 -0
- package/dist/LexicalHtml.prod-Sz3CW1ht.mjs +1207 -0
- package/dist/{LexicalLink.dev-BS1Bf-yD.mjs → LexicalLink.dev-NySTYhVR.mjs} +42 -8
- package/dist/{LexicalLink.prod-B_crkoHP.mjs → LexicalLink.prod-BuCM8gts.mjs} +209 -191
- package/dist/{LexicalList.dev-OMqmcnQ-.mjs → LexicalList.dev-DIMOvSFD.mjs} +252 -80
- package/dist/{LexicalList.prod-CpL1s8vS.mjs → LexicalList.prod-MVqfA6Vo.mjs} +364 -278
- package/dist/{LexicalMarkdown.dev-BHSdx_Gr.mjs → LexicalMarkdown.dev-C7aylvCG.mjs} +729 -552
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +868 -0
- package/dist/{LexicalRichText.dev-Bz9A_WbM.mjs → LexicalRichText.dev-DfICq6lU.mjs} +272 -77
- package/dist/{LexicalRichText.node-DDpwfE-P.mjs → LexicalRichText.node-Bg9jND3Q.mjs} +21 -8
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +550 -0
- package/dist/{LexicalSelection.dev-CQ380fnD.mjs → LexicalSelection.dev-DGjj12wW.mjs} +50 -38
- package/dist/{LexicalSelection.node-DesBMjIE.mjs → LexicalSelection.node-BU5L4193.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D2jivCDB.mjs → LexicalSelection.prod-D-PwRbyK.mjs} +158 -140
- package/dist/{LexicalTable.dev-Ca7mQ7Jk.mjs → LexicalTable.dev-ChP7cugd.mjs} +215 -53
- package/dist/{LexicalTable.prod-DyPAcC7y.mjs → LexicalTable.prod-Bpr9YRXp.mjs} +668 -573
- package/dist/{LexicalUtils.dev-HxM8F0g6.mjs → LexicalUtils.dev-BiFU3789.mjs} +10 -47
- package/dist/{LexicalUtils.node-lCWjRjoG.mjs → LexicalUtils.node-j3Llm7Y3.mjs} +2 -2
- package/dist/{LexicalUtils.prod-Bti5w4ki.mjs → LexicalUtils.prod-DCvrA78p.mjs} +103 -105
- package/dist/bin/mxs.d.mts +1 -1
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-By7trG9K.mjs +2 -0
- package/dist/{esm-CK9m5JKX.mjs → esm-Dg-WhPCe.mjs} +989 -989
- package/dist/index.d.mts +22 -2
- package/dist/index.mjs +1 -1
- package/dist/{mxs-vbxEu09D.mjs → mxs-DT0oYk6U.mjs} +10387 -8278
- package/package.json +18 -17
- package/dist/LexicalClipboard.dev-BpqRwTLP.mjs +0 -494
- package/dist/LexicalClipboard.prod-B_xdeiAC.mjs +0 -291
- package/dist/LexicalCodeCore.dev-7_cexm39.mjs +0 -537
- package/dist/LexicalCodeCore.prod-Bd6WFHcO.mjs +0 -381
- package/dist/LexicalHtml.dev-C3ZSWBFZ.mjs +0 -684
- package/dist/LexicalHtml.node-D0TD152E.mjs +0 -24
- package/dist/LexicalHtml.prod-CX47X0zl.mjs +0 -430
- package/dist/LexicalMarkdown.prod-C-S7Ii6-.mjs +0 -754
- package/dist/LexicalRichText.prod-C8qXACDL.mjs +0 -427
- package/dist/esm-DRbkkY3r.mjs +0 -2
- /package/dist/{mxs-CM8-6uAr.d.mts → mxs-iqJBopvE.d.mts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
//#region ../../node_modules/.pnpm/@lexical+selection@0.
|
|
1
|
+
import { $ as $isElementNode, F as $getEditor, O as $getCharacterOffsets, R as $getNodeByKey, U as $getSelection, V as $getPreviousSelection, X as $isChildCaret, Z as $isDecoratorNode, _ as $createTextNode, a as $cloneWithProperties, bt as $selectAll, ct as $isRootNode, et as $isExtendableTextPointCaret, ft as $isTextNode, i as $caretRangeFromSelection, lt as $isRootOrShadowRoot, mt as $isTokenOrSegmented, nt as $isLeafNode, o as $cloneWithPropertiesEphemeral, pr as getStyleObjectFromCSS$1, q as $hasAncestor, r as $caretFromPoint, st as $isRangeSelection, un as INTERNAL_$isBlock, v as $extendCaretToRange, wt as $setSelection, y as $findMatchingParent } from "./Lexical.node-fXM8Jp7p.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@lexical+selection@0.45.0/node_modules/@lexical/selection/dist/LexicalSelection.dev.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
5
|
*
|
|
@@ -123,9 +123,10 @@ function createRectsFromDOMRange(editor, range) {
|
|
|
123
123
|
return selectionRects;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @
|
|
128
|
-
* @
|
|
126
|
+
* Serializes a style object into a CSS declaration string, the inverse of
|
|
127
|
+
* {@link getStyleObjectFromCSS}.
|
|
128
|
+
* @param styles - An object mapping CSS property names to their values.
|
|
129
|
+
* @returns A CSS string of the form `prop: value;` for each entry, concatenated together.
|
|
129
130
|
*/
|
|
130
131
|
function getCSSFromStyleObject(styles) {
|
|
131
132
|
let css = "";
|
|
@@ -400,6 +401,18 @@ function $copyBlockFormatIndent(srcNode, destNode) {
|
|
|
400
401
|
if (format !== destNode.getFormatType()) destNode.setFormat(format);
|
|
401
402
|
if (indent !== destNode.getIndent()) destNode.setIndent(indent);
|
|
402
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;
|
|
413
|
+
}
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
403
416
|
/**
|
|
404
417
|
* Converts all nodes in the selection that are of one block type to another.
|
|
405
418
|
* @param selection - The selected blocks to be converted.
|
|
@@ -407,35 +420,31 @@ function $copyBlockFormatIndent(srcNode, destNode) {
|
|
|
407
420
|
* @param $afterCreateElement - The function that updates the new node based on the previous one ($copyBlockFormatIndent by default)
|
|
408
421
|
*/
|
|
409
422
|
function $setBlocksType(selection, $createElement, $afterCreateElement = $copyBlockFormatIndent) {
|
|
410
|
-
if (selection
|
|
423
|
+
if (!selection) return;
|
|
411
424
|
const anchorAndFocus = selection.getStartEndPoints();
|
|
425
|
+
let skipFocusAtBlockStart = false;
|
|
426
|
+
let focusBlock = null;
|
|
412
427
|
const blockMap = /* @__PURE__ */ new Map();
|
|
413
|
-
let newSelection = null;
|
|
414
428
|
if (anchorAndFocus) {
|
|
415
429
|
const [anchor, focus] = anchorAndFocus;
|
|
416
|
-
newSelection = $createRangeSelection();
|
|
417
|
-
newSelection.anchor.set(anchor.key, anchor.offset, anchor.type);
|
|
418
|
-
newSelection.focus.set(focus.key, focus.offset, focus.type);
|
|
419
430
|
const anchorBlock = $findMatchingParent(anchor.getNode(), INTERNAL_$isBlock);
|
|
420
|
-
|
|
431
|
+
focusBlock = $findMatchingParent(focus.getNode(), INTERNAL_$isBlock);
|
|
432
|
+
skipFocusAtBlockStart = $isElementNode(focusBlock) && !focusBlock.is(anchorBlock) && $isPointAtBlockStart(focus, focusBlock);
|
|
421
433
|
if ($isElementNode(anchorBlock)) blockMap.set(anchorBlock.getKey(), anchorBlock);
|
|
422
|
-
if ($isElementNode(focusBlock)) blockMap.set(focusBlock.getKey(), focusBlock);
|
|
434
|
+
if ($isElementNode(focusBlock) && !skipFocusAtBlockStart) blockMap.set(focusBlock.getKey(), focusBlock);
|
|
423
435
|
}
|
|
424
|
-
for (const node of selection.getNodes()) if ($isElementNode(node) && INTERNAL_$isBlock(node))
|
|
425
|
-
|
|
436
|
+
for (const node of selection.getNodes()) if ($isElementNode(node) && INTERNAL_$isBlock(node)) {
|
|
437
|
+
if (skipFocusAtBlockStart && node.is(focusBlock)) continue;
|
|
438
|
+
blockMap.set(node.getKey(), node);
|
|
439
|
+
} else if (!anchorAndFocus) {
|
|
426
440
|
const ancestorBlock = $findMatchingParent(node, INTERNAL_$isBlock);
|
|
427
441
|
if ($isElementNode(ancestorBlock)) blockMap.set(ancestorBlock.getKey(), ancestorBlock);
|
|
428
442
|
}
|
|
429
|
-
for (const
|
|
443
|
+
for (const prevNode of blockMap.values()) {
|
|
430
444
|
const element = $createElement();
|
|
431
445
|
$afterCreateElement(prevNode, element);
|
|
432
446
|
prevNode.replace(element, true);
|
|
433
|
-
if (newSelection) {
|
|
434
|
-
if (key === newSelection.anchor.key) newSelection.anchor.set(element.getKey(), newSelection.anchor.offset, newSelection.anchor.type);
|
|
435
|
-
if (key === newSelection.focus.key) newSelection.focus.set(element.getKey(), newSelection.focus.offset, newSelection.focus.type);
|
|
436
|
-
}
|
|
437
447
|
}
|
|
438
|
-
if (newSelection && selection.is($getSelection())) $setSelection(newSelection);
|
|
439
448
|
}
|
|
440
449
|
function isPointAttached(point) {
|
|
441
450
|
return point.getNode().isAttached();
|
|
@@ -533,11 +542,12 @@ function $wrapNodesImpl(selection, nodes, nodesLength, createElement, wrappingEl
|
|
|
533
542
|
targetElement.setIndent(parent.getIndent());
|
|
534
543
|
elements.push(targetElement);
|
|
535
544
|
elementMapping.set(parentKey, targetElement);
|
|
536
|
-
parent.getChildren()
|
|
537
|
-
|
|
545
|
+
const children = parent.getChildren();
|
|
546
|
+
targetElement.splice(targetElement.getChildrenSize(), 0, children);
|
|
547
|
+
for (const child of children) {
|
|
538
548
|
movedNodes.add(child.getKey());
|
|
539
|
-
if ($isElementNode(child)) child.getChildrenKeys()
|
|
540
|
-
}
|
|
549
|
+
if ($isElementNode(child)) for (const key of child.getChildrenKeys()) movedNodes.add(key);
|
|
550
|
+
}
|
|
541
551
|
$removeParentEmptyElements(parent);
|
|
542
552
|
}
|
|
543
553
|
} else if (emptyElements.has(node.getKey())) {
|
|
@@ -681,23 +691,25 @@ function $getNodeStyleValueForProperty(node, styleProperty, defaultValue) {
|
|
|
681
691
|
function $getSelectionStyleValueForProperty(selection, styleProperty, defaultValue = "") {
|
|
682
692
|
let styleValue = null;
|
|
683
693
|
const nodes = selection.getNodes();
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
const
|
|
693
|
-
const
|
|
694
|
-
|
|
694
|
+
let startNode;
|
|
695
|
+
let endNode;
|
|
696
|
+
if ($isRangeSelection(selection)) {
|
|
697
|
+
if (selection.isCollapsed() && selection.style !== "") {
|
|
698
|
+
const styleObject = getStyleObjectFromCSS$1(selection.style);
|
|
699
|
+
if (styleObject !== null && styleProperty in styleObject) return styleObject[styleProperty];
|
|
700
|
+
}
|
|
701
|
+
const { anchor, focus } = selection;
|
|
702
|
+
const isBackward = selection.isBackward();
|
|
703
|
+
const firstNode = isBackward ? focus.getNode() : anchor.getNode();
|
|
704
|
+
const lastNode = isBackward ? anchor.getNode() : focus.getNode();
|
|
705
|
+
const startOffset = isBackward ? focus.offset : anchor.offset;
|
|
706
|
+
const endOffset = isBackward ? anchor.offset : focus.offset;
|
|
707
|
+
if ($isTextNode(firstNode) && startOffset === firstNode.getTextContentSize()) startNode = firstNode;
|
|
708
|
+
if (endOffset === 0) endNode = lastNode;
|
|
695
709
|
}
|
|
696
710
|
for (let i = 0; i < nodes.length; i++) {
|
|
697
711
|
const node = nodes[i];
|
|
698
|
-
if (
|
|
699
|
-
if (i !== 0 && node.is(endNode) && endOffset === 0) continue;
|
|
700
|
-
if ($isTextNode(node)) {
|
|
712
|
+
if ($isTextNode(node) && !node.is(i === 0 ? startNode : endNode)) {
|
|
701
713
|
const nodeStyleValue = $getNodeStyleValueForProperty(node, styleProperty, defaultValue);
|
|
702
714
|
if (styleValue === null) styleValue = nodeStyleValue;
|
|
703
715
|
else if (styleValue !== nodeStyleValue) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@lexical+selection@0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@lexical+selection@0.45.0/node_modules/@lexical/selection/dist/LexicalSelection.node.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
4
|
*
|
|
@@ -6,8 +6,8 @@
|
|
|
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-
|
|
10
|
-
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalSelection.dev-DGjj12wW.mjs") : import("./LexicalSelection.prod-D-PwRbyK.mjs"));
|
|
10
|
+
mod.$addNodeStyle;
|
|
11
11
|
mod.$cloneWithProperties;
|
|
12
12
|
mod.$copyBlockFormatIndent;
|
|
13
13
|
mod.$ensureForwardRangeSelection;
|
|
@@ -33,4 +33,4 @@ mod.getCSSFromStyleObject;
|
|
|
33
33
|
mod.getStyleObjectFromCSS;
|
|
34
34
|
mod.trimTextContentFromAnchor;
|
|
35
35
|
//#endregion
|
|
36
|
-
export {
|
|
36
|
+
export { createRectsFromDOMRange as a, $sliceSelectedTextNodeContent as i, $moveCharacter as n, $shouldOverrideDefaultCharacterSelection as r, $isParentRTL as t };
|