@mx-space/cli 0.7.8 → 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.
Files changed (55) hide show
  1. package/dist/{Lexical.dev-rcxzwpir.mjs → Lexical.dev-By5dOKBN.mjs} +1486 -356
  2. package/dist/{Lexical.node-BUsI9gWr.mjs → Lexical.node-fXM8Jp7p.mjs} +39 -17
  3. package/dist/{Lexical.prod-C8HtkSD6.mjs → Lexical.prod-BlCvXPGa.mjs} +2279 -1768
  4. package/dist/LexicalClipboard.dev--HxGoSkO.mjs +915 -0
  5. package/dist/{LexicalClipboard.node-CO-MCKx5.mjs → LexicalClipboard.node-C3mRbrmW.mjs} +10 -3
  6. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +371 -0
  7. package/dist/LexicalCodeCore.dev-DjSrd4A4.mjs +1109 -0
  8. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +642 -0
  9. package/dist/{LexicalDragon.dev-gBP8WSRS.mjs → LexicalDragon.dev-DwprRH0z.mjs} +3 -3
  10. package/dist/{LexicalDragon.node-OG6G55nl.mjs → LexicalDragon.node-BVhw4C7s.mjs} +2 -2
  11. package/dist/{LexicalDragon.prod-DP-_Q8cv.mjs → LexicalDragon.prod-nh4J-8vn.mjs} +3 -3
  12. package/dist/{LexicalExtension.dev-DVbjljrm.mjs → LexicalExtension.dev-BPNyvGqe.mjs} +335 -6
  13. package/dist/{LexicalExtension.node-CF3EAPN7.mjs → LexicalExtension.node-BVlcrgOx.mjs} +15 -8
  14. package/dist/{LexicalExtension.prod-DklHHErZ.mjs → LexicalExtension.prod-DFKbiNt-.mjs} +375 -265
  15. package/dist/{LexicalHeadless.dev-DdWLM7Nl.mjs → LexicalHeadless.dev-B-cj7Pr5.mjs} +2 -2
  16. package/dist/{LexicalHeadless.prod-CoiiTDzR.mjs → LexicalHeadless.prod-Byp1vNzT.mjs} +2 -2
  17. package/dist/LexicalHtml.dev-prBAwszN.mjs +2424 -0
  18. package/dist/LexicalHtml.node-BvNF96jZ.mjs +56 -0
  19. package/dist/LexicalHtml.prod-Sz3CW1ht.mjs +1207 -0
  20. package/dist/{LexicalLink.dev-BS1Bf-yD.mjs → LexicalLink.dev-NySTYhVR.mjs} +42 -8
  21. package/dist/{LexicalLink.prod-B_crkoHP.mjs → LexicalLink.prod-BuCM8gts.mjs} +209 -191
  22. package/dist/{LexicalList.dev-OMqmcnQ-.mjs → LexicalList.dev-DIMOvSFD.mjs} +252 -80
  23. package/dist/{LexicalList.prod-CpL1s8vS.mjs → LexicalList.prod-MVqfA6Vo.mjs} +364 -278
  24. package/dist/{LexicalMarkdown.dev-BHSdx_Gr.mjs → LexicalMarkdown.dev-C7aylvCG.mjs} +729 -552
  25. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +868 -0
  26. package/dist/{LexicalRichText.dev-Bz9A_WbM.mjs → LexicalRichText.dev-DfICq6lU.mjs} +272 -77
  27. package/dist/{LexicalRichText.node-DDpwfE-P.mjs → LexicalRichText.node-Bg9jND3Q.mjs} +21 -8
  28. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +550 -0
  29. package/dist/{LexicalSelection.dev-CQ380fnD.mjs → LexicalSelection.dev-DGjj12wW.mjs} +50 -38
  30. package/dist/{LexicalSelection.node-DesBMjIE.mjs → LexicalSelection.node-BU5L4193.mjs} +4 -4
  31. package/dist/{LexicalSelection.prod-D2jivCDB.mjs → LexicalSelection.prod-D-PwRbyK.mjs} +158 -140
  32. package/dist/{LexicalTable.dev-Ca7mQ7Jk.mjs → LexicalTable.dev-ChP7cugd.mjs} +215 -53
  33. package/dist/{LexicalTable.prod-DyPAcC7y.mjs → LexicalTable.prod-Bpr9YRXp.mjs} +668 -573
  34. package/dist/{LexicalUtils.dev-HxM8F0g6.mjs → LexicalUtils.dev-BiFU3789.mjs} +10 -47
  35. package/dist/{LexicalUtils.node-lCWjRjoG.mjs → LexicalUtils.node-j3Llm7Y3.mjs} +2 -2
  36. package/dist/{LexicalUtils.prod-Bti5w4ki.mjs → LexicalUtils.prod-DCvrA78p.mjs} +103 -105
  37. package/dist/bin/mxs.d.mts +1 -1
  38. package/dist/bin/mxs.mjs +1 -1
  39. package/dist/esm-By7trG9K.mjs +2 -0
  40. package/dist/{esm-CK9m5JKX.mjs → esm-Dg-WhPCe.mjs} +989 -989
  41. package/dist/index.d.mts +1 -1
  42. package/dist/index.mjs +1 -1
  43. package/dist/{mxs-BZt1cLW9.mjs → mxs-DT0oYk6U.mjs} +11935 -11866
  44. package/package.json +15 -14
  45. package/dist/LexicalClipboard.dev-BpqRwTLP.mjs +0 -494
  46. package/dist/LexicalClipboard.prod-B_xdeiAC.mjs +0 -291
  47. package/dist/LexicalCodeCore.dev-7_cexm39.mjs +0 -537
  48. package/dist/LexicalCodeCore.prod-Bd6WFHcO.mjs +0 -381
  49. package/dist/LexicalHtml.dev-C3ZSWBFZ.mjs +0 -684
  50. package/dist/LexicalHtml.node-D0TD152E.mjs +0 -24
  51. package/dist/LexicalHtml.prod-CX47X0zl.mjs +0 -430
  52. package/dist/LexicalMarkdown.prod-C-S7Ii6-.mjs +0 -754
  53. package/dist/LexicalRichText.prod-C8qXACDL.mjs +0 -427
  54. package/dist/esm-DRbkkY3r.mjs +0 -2
  55. /package/dist/{mxs-CM8-6uAr.d.mts → mxs-iqJBopvE.d.mts} +0 -0
@@ -1,5 +1,5 @@
1
- import { $t as INTERNAL_$isBlock, E as $getCharacterOffsets, K as $isChildCaret, L as $getPreviousSelection, Ln as getStyleObjectFromCSS$1, P as $getNodeByKey, Q as $isLeafNode, U as $hasAncestor, X as $isExtendableTextPointCaret, Y as $isElementNode, _ as $createTextNode, a as $cloneWithProperties, at as $isRootOrShadowRoot, ct as $isTextNode, gt as $selectAll, i as $caretRangeFromSelection, it as $isRootNode, j as $getEditor, m as $createRangeSelection, o as $cloneWithPropertiesEphemeral, q as $isDecoratorNode, r as $caretFromPoint, rt as $isRangeSelection, ut as $isTokenOrSegmented, v as $extendCaretToRange, vt as $setSelection, y as $findMatchingParent, z as $getSelection } from "./Lexical.node-BUsI9gWr.mjs";
2
- //#region ../../node_modules/.pnpm/@lexical+selection@0.44.0/node_modules/@lexical/selection/LexicalSelection.dev.mjs
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
- * Given a CSS string, returns the parsed style object.
127
- * @param css - The CSS property as a string.
128
- * @returns The value of the given CSS property.
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 === null) return;
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
- const focusBlock = $findMatchingParent(focus.getNode(), INTERNAL_$isBlock);
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)) blockMap.set(node.getKey(), node);
425
- else if (anchorAndFocus === null) {
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 [key, prevNode] of blockMap) {
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().forEach((child) => {
537
- targetElement.append(child);
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().forEach((key) => movedNodes.add(key));
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
- const anchor = selection.anchor;
685
- const focus = selection.focus;
686
- const isBackward = selection.isBackward();
687
- const startNode = isBackward ? focus.getNode() : anchor.getNode();
688
- const endNode = isBackward ? anchor.getNode() : focus.getNode();
689
- const startOffset = isBackward ? focus.offset : anchor.offset;
690
- const endOffset = isBackward ? anchor.offset : focus.offset;
691
- if ($isRangeSelection(selection) && selection.isCollapsed() && selection.style !== "") {
692
- const css = selection.style;
693
- const styleObject = getStyleObjectFromCSS$1(css);
694
- if (styleObject !== null && styleProperty in styleObject) return styleObject[styleProperty];
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 (i === 0 && node.is(startNode) && $isTextNode(node) && startOffset === node.getTextContentSize()) continue;
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.44.0/node_modules/@lexical/selection/LexicalSelection.node.mjs
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-CQ380fnD.mjs") : import("./LexicalSelection.prod-D2jivCDB.mjs"));
10
- const $addNodeStyle = mod.$addNodeStyle;
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 { $sliceSelectedTextNodeContent as a, $shouldOverrideDefaultCharacterSelection as i, $isParentRTL as n, createRectsFromDOMRange as o, $moveCharacter as r, $addNodeStyle as t };
36
+ export { createRectsFromDOMRange as a, $sliceSelectedTextNodeContent as i, $moveCharacter as n, $shouldOverrideDefaultCharacterSelection as r, $isParentRTL as t };