@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.
- 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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BZt1cLW9.mjs → mxs-DT0oYk6U.mjs} +11935 -11866
- package/package.json +15 -14
- 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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region ../../node_modules/.pnpm/@lexical+utils@0.
|
|
1
|
+
import { $ as $isElementNode, Ar as removeClassNamesFromElement, D as $getCaretRangeInDirection, Dr as makeStepwiseIterator, Dt as $splitAtPointCaretNext, E as $getCaretRange, Et as $setState, G as $getState, H as $getRoot, M as $getCollapsedCaretRange, Mt as CAN_USE_DOM, N as $getDOMSlot, Or as mergeRegister, Ot as $splitNode, P as $getDOMTextNode, S as $getAdjacentChildCaret, Sn as IS_SAFARI, Sr as isHTMLElement, T as $getCaretInDirection, Tt as $setSelectionFromCaretRange, U as $getSelection, V as $getPreviousSelection, W as $getSiblingCaret, X as $isChildCaret, a as $cloneWithProperties, b as $fullReconcile, bn as IS_IOS, dn as IS_ANDROID, f as $createParagraphNode, fn as IS_ANDROID_CHROME, ft as $isTextNode, gn as IS_CHROME, hr as isBlockDomNode, ht as $normalizeCaret, i as $caretRangeFromSelection, j as $getChildCaretOrSelf, jt as CAN_USE_BEFORE_INPUT, k as $getChildCaret, mn as IS_APPLE_WEBKIT, pn as IS_APPLE, pt as $isTextPointCaret, r as $caretFromPoint, st as $isRangeSelection, tr as addClassNamesToElement, ur as getDOMTextNode, ut as $isSiblingCaret, vn as IS_FIREFOX, vt as $removeTextFromCaretRange, w as $getAdjacentSiblingOrParentSiblingCaret, wr as isInlineDomNode, wt as $setSelection, xr as isHTMLAnchorElement, y as $findMatchingParent, yt as $rewindSiblingCaret } from "./Lexical.node-fXM8Jp7p.mjs";
|
|
2
|
+
import { a as createRectsFromDOMRange } from "./LexicalSelection.node-BU5L4193.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@lexical+utils@0.45.0/node_modules/@lexical/utils/dist/LexicalUtils.dev.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
@@ -25,31 +25,6 @@ function formatDevErrorMessage(message) {
|
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
|
-
const CAN_USE_DOM$1 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
29
|
-
/**
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
const documentMode = CAN_USE_DOM$1 && "documentMode" in document ? document.documentMode : null;
|
|
37
|
-
const IS_APPLE$1 = CAN_USE_DOM$1 && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
38
|
-
const IS_FIREFOX$1 = CAN_USE_DOM$1 && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
39
|
-
const CAN_USE_BEFORE_INPUT$1 = CAN_USE_DOM$1 && "InputEvent" in window && !documentMode ? "getTargetRanges" in new window.InputEvent("input") : false;
|
|
40
|
-
const IS_IOS$1 = CAN_USE_DOM$1 && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
41
|
-
const IS_ANDROID$1 = CAN_USE_DOM$1 && /Android/.test(navigator.userAgent);
|
|
42
|
-
const IS_SAFARI$1 = CAN_USE_DOM$1 && /Version\/[\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID$1;
|
|
43
|
-
const IS_CHROME$1 = CAN_USE_DOM$1 && /^(?=.*Chrome).*/i.test(navigator.userAgent);
|
|
44
|
-
const IS_ANDROID_CHROME$1 = CAN_USE_DOM$1 && IS_ANDROID$1 && IS_CHROME$1;
|
|
45
|
-
const IS_APPLE_WEBKIT$1 = CAN_USE_DOM$1 && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && IS_APPLE$1 && !IS_CHROME$1;
|
|
46
|
-
/**
|
|
47
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the MIT license found in the
|
|
50
|
-
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
28
|
function px(value) {
|
|
54
29
|
return `${value}px`;
|
|
55
30
|
}
|
|
@@ -168,18 +143,17 @@ function $getOrderedSelectionPoints(selection) {
|
|
|
168
143
|
const points = selection.getStartEndPoints();
|
|
169
144
|
return selection.isBackward() ? [points[1], points[0]] : points;
|
|
170
145
|
}
|
|
171
|
-
function $rangeTargetFromPoint(point, node, dom) {
|
|
172
|
-
if (point.type === "text" || !$isElementNode(node)) return [getDOMTextNode(dom) || dom, point.offset];
|
|
146
|
+
function $rangeTargetFromPoint(editor, point, node, dom) {
|
|
147
|
+
if (point.type === "text" || !$isElementNode(node)) return [($isTextNode(node) ? $getDOMTextNode(node, dom, editor) : getDOMTextNode(dom)) || dom, point.offset];
|
|
173
148
|
else {
|
|
174
|
-
const
|
|
175
|
-
const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(node, dom, editor);
|
|
149
|
+
const slot = $getDOMSlot(node, dom, editor);
|
|
176
150
|
return [slot.element, slot.getFirstChildOffset() + point.offset];
|
|
177
151
|
}
|
|
178
152
|
}
|
|
179
153
|
function $rangeFromPoints(editor, start, startNode, startDOM, end, endNode, endDOM) {
|
|
180
154
|
const range = (editor._window ? editor._window.document : document).createRange();
|
|
181
|
-
range.setStart(...$rangeTargetFromPoint(start, startNode, startDOM));
|
|
182
|
-
range.setEnd(...$rangeTargetFromPoint(end, endNode, endDOM));
|
|
155
|
+
range.setStart(...$rangeTargetFromPoint(editor, start, startNode, startDOM));
|
|
156
|
+
range.setEnd(...$rangeTargetFromPoint(editor, end, endNode, endDOM));
|
|
183
157
|
return range;
|
|
184
158
|
}
|
|
185
159
|
function defaultOnReposition(domNodes) {
|
|
@@ -242,7 +216,7 @@ function markSelection(editor, onReposition = defaultOnReposition) {
|
|
|
242
216
|
previousFocusNode = currentEndNode;
|
|
243
217
|
previousFocusNodeDOM = currentEndNodeDOM;
|
|
244
218
|
previousFocusOffset = currentEndOffset;
|
|
245
|
-
});
|
|
219
|
+
}, { editor });
|
|
246
220
|
}
|
|
247
221
|
compute(editor.getEditorState());
|
|
248
222
|
return mergeRegister(editor.registerUpdateListener(({ editorState }) => compute(editorState)), () => {
|
|
@@ -281,16 +255,6 @@ function selectionAlwaysOnDisplay(editor, onReposition) {
|
|
|
281
255
|
}
|
|
282
256
|
});
|
|
283
257
|
}
|
|
284
|
-
const CAN_USE_BEFORE_INPUT = CAN_USE_BEFORE_INPUT$1;
|
|
285
|
-
const CAN_USE_DOM = CAN_USE_DOM$1;
|
|
286
|
-
const IS_ANDROID = IS_ANDROID$1;
|
|
287
|
-
const IS_ANDROID_CHROME = IS_ANDROID_CHROME$1;
|
|
288
|
-
const IS_APPLE = IS_APPLE$1;
|
|
289
|
-
const IS_APPLE_WEBKIT = IS_APPLE_WEBKIT$1;
|
|
290
|
-
const IS_CHROME = IS_CHROME$1;
|
|
291
|
-
const IS_FIREFOX = IS_FIREFOX$1;
|
|
292
|
-
const IS_IOS = IS_IOS$1;
|
|
293
|
-
const IS_SAFARI = IS_SAFARI$1;
|
|
294
258
|
/**
|
|
295
259
|
* Returns true if the file type matches the types passed within the acceptableMimeTypes array, false otherwise.
|
|
296
260
|
* The types passed must be strings and are CASE-SENSITIVE.
|
|
@@ -530,12 +494,11 @@ function registerNestedElementResolver(editor, targetNode, cloneNode, handleOver
|
|
|
530
494
|
* @param editorState - The editor's state
|
|
531
495
|
*/
|
|
532
496
|
function $restoreEditorState(editor, editorState) {
|
|
533
|
-
const FULL_RECONCILE = 2;
|
|
534
497
|
const nodeMap = /* @__PURE__ */ new Map();
|
|
535
498
|
const activeEditorState = editor._pendingEditorState;
|
|
536
499
|
for (const [key, node] of editorState._nodeMap) nodeMap.set(key, $cloneWithProperties(node));
|
|
537
500
|
if (activeEditorState) activeEditorState._nodeMap = nodeMap;
|
|
538
|
-
|
|
501
|
+
$fullReconcile();
|
|
539
502
|
const selection = editorState._selection;
|
|
540
503
|
$setSelection(selection === null ? null : selection.clone());
|
|
541
504
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@lexical+utils@0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@lexical+utils@0.45.0/node_modules/@lexical/utils/dist/LexicalUtils.node.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
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("./LexicalUtils.dev-
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalUtils.dev-BiFU3789.mjs") : import("./LexicalUtils.prod-DCvrA78p.mjs"));
|
|
10
10
|
const $descendantsMatching = mod.$descendantsMatching;
|
|
11
11
|
const $dfs = mod.$dfs;
|
|
12
12
|
mod.$dfsIterator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region ../../node_modules/.pnpm/@lexical+utils@0.
|
|
1
|
+
import { $ as $isElementNode, Ar as removeClassNamesFromElement, D as $getCaretRangeInDirection, Dr as makeStepwiseIterator, Dt as $splitAtPointCaretNext, E as $getCaretRange, Et as $setState, G as $getState, H as $getRoot, M as $getCollapsedCaretRange, Mt as CAN_USE_DOM, N as $getDOMSlot, Or as mergeRegister, Ot as $splitNode, P as $getDOMTextNode, S as $getAdjacentChildCaret, Sn as IS_SAFARI, Sr as isHTMLElement, T as $getCaretInDirection, Tt as $setSelectionFromCaretRange, U as $getSelection, V as $getPreviousSelection, W as $getSiblingCaret, X as $isChildCaret, a as $cloneWithProperties, b as $fullReconcile, bn as IS_IOS, dn as IS_ANDROID, f as $createParagraphNode, fn as IS_ANDROID_CHROME, ft as $isTextNode, gn as IS_CHROME, hr as isBlockDomNode, ht as $normalizeCaret, i as $caretRangeFromSelection, j as $getChildCaretOrSelf, jt as CAN_USE_BEFORE_INPUT, k as $getChildCaret, mn as IS_APPLE_WEBKIT, pn as IS_APPLE, pt as $isTextPointCaret, r as $caretFromPoint, st as $isRangeSelection, tr as addClassNamesToElement, ur as getDOMTextNode, ut as $isSiblingCaret, vn as IS_FIREFOX, vt as $removeTextFromCaretRange, w as $getAdjacentSiblingOrParentSiblingCaret, wr as isInlineDomNode, wt as $setSelection, xr as isHTMLAnchorElement, y as $findMatchingParent, yt as $rewindSiblingCaret } from "./Lexical.node-fXM8Jp7p.mjs";
|
|
2
|
+
import { a as createRectsFromDOMRange } from "./LexicalSelection.node-BU5L4193.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@lexical+utils@0.45.0/node_modules/@lexical/utils/dist/LexicalUtils.prod.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
@@ -8,109 +8,108 @@ import { o as createRectsFromDOMRange } from "./LexicalSelection.node-DesBMjIE.m
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
function
|
|
11
|
+
function k(t, ...e) {
|
|
12
12
|
const n = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
13
13
|
o.append("code", t);
|
|
14
14
|
for (const t of e) o.append("v", t);
|
|
15
15
|
throw n.search = o.toString(), Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
function J(t) {
|
|
17
|
+
function U(t) {
|
|
19
18
|
return `${t}px`;
|
|
20
19
|
}
|
|
21
|
-
const
|
|
20
|
+
const j = {
|
|
22
21
|
attributes: !0,
|
|
23
22
|
characterData: !0,
|
|
24
23
|
childList: !0,
|
|
25
24
|
subtree: !0
|
|
26
25
|
};
|
|
27
|
-
function
|
|
26
|
+
function z(e, n, o) {
|
|
28
27
|
let r = null, i = null, l = null, s = [];
|
|
29
28
|
const u = document.createElement("div");
|
|
30
29
|
function c() {
|
|
31
|
-
null === r &&
|
|
30
|
+
null === r && k(182), null === i && k(183);
|
|
32
31
|
const { left: t, top: l } = i.getBoundingClientRect(), c = createRectsFromDOMRange(e, n);
|
|
33
|
-
var
|
|
34
|
-
u.isConnected || (
|
|
32
|
+
var f, a;
|
|
33
|
+
u.isConnected || (a = u, (f = i).insertBefore(a, f.firstChild));
|
|
35
34
|
let d = !1;
|
|
36
35
|
for (let e = 0; e < c.length; e++) {
|
|
37
36
|
const n = c[e], o = s[e] || document.createElement("div"), r = o.style;
|
|
38
37
|
"absolute" !== r.position && (r.position = "absolute", d = !0);
|
|
39
|
-
const i =
|
|
38
|
+
const i = U(n.left - t);
|
|
40
39
|
r.left !== i && (r.left = i, d = !0);
|
|
41
|
-
const
|
|
42
|
-
r.top !==
|
|
43
|
-
const
|
|
44
|
-
r.width !==
|
|
45
|
-
const g =
|
|
40
|
+
const f = U(n.top - l);
|
|
41
|
+
r.top !== f && (o.style.top = f, d = !0);
|
|
42
|
+
const a = U(n.width);
|
|
43
|
+
r.width !== a && (o.style.width = a, d = !0);
|
|
44
|
+
const g = U(n.height);
|
|
46
45
|
r.height !== g && (o.style.height = g, d = !0), o.parentNode !== u && (u.append(o), d = !0), s[e] = o;
|
|
47
46
|
}
|
|
48
47
|
for (; s.length > c.length;) s.pop();
|
|
49
48
|
d && o(s);
|
|
50
49
|
}
|
|
51
|
-
function
|
|
50
|
+
function f() {
|
|
52
51
|
i = null, r = null, null !== l && l.disconnect(), l = null, u.remove();
|
|
53
52
|
for (const t of s) t.remove();
|
|
54
53
|
s = [];
|
|
55
54
|
}
|
|
56
55
|
u.style.position = "relative";
|
|
57
|
-
const
|
|
56
|
+
const a = e.registerRootListener(function n() {
|
|
58
57
|
const o = e.getRootElement();
|
|
59
|
-
if (null === o) return
|
|
58
|
+
if (null === o) return f();
|
|
60
59
|
const s = o.parentElement;
|
|
61
|
-
if (!isHTMLElement(s)) return
|
|
62
|
-
|
|
60
|
+
if (!isHTMLElement(s)) return f();
|
|
61
|
+
f(), r = o, i = s, l = new MutationObserver((t) => {
|
|
63
62
|
const o = e.getRootElement(), l = o && o.parentElement;
|
|
64
63
|
if (o !== r || l !== i) return n();
|
|
65
64
|
for (const e of t) if (!u.contains(e.target)) return c();
|
|
66
|
-
}), l.observe(s,
|
|
65
|
+
}), l.observe(s, j), c();
|
|
67
66
|
});
|
|
68
67
|
return () => {
|
|
69
|
-
|
|
68
|
+
a(), f();
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
|
-
function
|
|
73
|
-
if ("text" !==
|
|
74
|
-
const
|
|
75
|
-
return [r.element, r.getFirstChildOffset() +
|
|
71
|
+
function W(t, e, n, o) {
|
|
72
|
+
if ("text" !== e.type && $isElementNode(n)) {
|
|
73
|
+
const r = $getDOMSlot(n, o, t);
|
|
74
|
+
return [r.element, r.getFirstChildOffset() + e.offset];
|
|
76
75
|
}
|
|
77
|
-
return [getDOMTextNode(n) ||
|
|
76
|
+
return [($isTextNode(n) ? $getDOMTextNode(n, o, t) : getDOMTextNode(o)) || o, e.offset];
|
|
78
77
|
}
|
|
79
|
-
function
|
|
78
|
+
function G(t) {
|
|
80
79
|
for (const e of t) {
|
|
81
80
|
const t = e.style;
|
|
82
|
-
"Highlight" !== t.background && (t.background = "Highlight"), "HighlightText" !== t.color && (t.color = "HighlightText"), t.marginTop !==
|
|
81
|
+
"Highlight" !== t.background && (t.background = "Highlight"), "HighlightText" !== t.color && (t.color = "HighlightText"), t.marginTop !== U(-1.5) && (t.marginTop = U(-1.5)), t.paddingTop !== U(4) && (t.paddingTop = U(4)), t.paddingBottom !== U(0) && (t.paddingBottom = U(0));
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
|
-
function
|
|
86
|
-
let i = null, l = null, s = null, u = null, c = null,
|
|
84
|
+
function V(t, r = G) {
|
|
85
|
+
let i = null, l = null, s = null, u = null, c = null, f = null, a = () => {};
|
|
87
86
|
function d(e) {
|
|
88
87
|
e.read(() => {
|
|
89
88
|
const e = $getSelection();
|
|
90
|
-
if (!$isRangeSelection(e)) return i = null, s = null, u = null,
|
|
89
|
+
if (!$isRangeSelection(e)) return i = null, s = null, u = null, f = null, a(), void (a = () => {});
|
|
91
90
|
const [d, g] = function(t) {
|
|
92
91
|
const e = t.getStartEndPoints();
|
|
93
92
|
return t.isBackward() ? [e[1], e[0]] : e;
|
|
94
|
-
}(e), p = d.getNode(), m = p.getKey(), h = d.offset,
|
|
95
|
-
if ((C ||
|
|
93
|
+
}(e), p = d.getNode(), m = p.getKey(), h = d.offset, y = g.getNode(), v = y.getKey(), E = g.offset, S = t.getElementByKey(m), x = t.getElementByKey(v), C = null === i || S !== l || h !== s || m !== i.getKey(), N = null === u || x !== c || E !== f || v !== u.getKey();
|
|
94
|
+
if ((C || N) && null !== S && null !== x) {
|
|
96
95
|
const e = function(t, e, n, o, r, i, l) {
|
|
97
96
|
const s = (t._window ? t._window.document : document).createRange();
|
|
98
|
-
return s.setStart(...
|
|
99
|
-
}(t, d, p,
|
|
100
|
-
|
|
97
|
+
return s.setStart(...W(t, e, n, o)), s.setEnd(...W(t, r, i, l)), s;
|
|
98
|
+
}(t, d, p, S, g, y, x);
|
|
99
|
+
a(), a = z(t, e, r);
|
|
101
100
|
}
|
|
102
|
-
i = p, l =
|
|
103
|
-
});
|
|
101
|
+
i = p, l = S, s = h, u = y, c = x, f = E;
|
|
102
|
+
}, { editor: t });
|
|
104
103
|
}
|
|
105
104
|
return d(t.getEditorState()), mergeRegister(t.registerUpdateListener(({ editorState: t }) => d(t)), () => {
|
|
106
|
-
|
|
105
|
+
a();
|
|
107
106
|
});
|
|
108
107
|
}
|
|
109
|
-
function
|
|
108
|
+
function X(t, e) {
|
|
110
109
|
let n = null;
|
|
111
110
|
const o = () => {
|
|
112
111
|
const o = getSelection(), r = o && o.anchorNode, i = t.getRootElement();
|
|
113
|
-
null !== r && null !== i && i.contains(r) ? null !== n && (n(), n = null) : null === n && (n =
|
|
112
|
+
null !== r && null !== i && i.contains(r) ? null !== n && (n(), n = null) : null === n && (n = V(t, e));
|
|
114
113
|
};
|
|
115
114
|
return t.registerRootListener((t) => {
|
|
116
115
|
if (t) {
|
|
@@ -121,12 +120,11 @@ function et(t, e) {
|
|
|
121
120
|
}
|
|
122
121
|
});
|
|
123
122
|
}
|
|
124
|
-
|
|
125
|
-
function dt(t, e) {
|
|
123
|
+
function q(t, e) {
|
|
126
124
|
for (const n of e) if (t.type.startsWith(n)) return !0;
|
|
127
125
|
return !1;
|
|
128
126
|
}
|
|
129
|
-
function
|
|
127
|
+
function J(t, e) {
|
|
130
128
|
const n = t[Symbol.iterator]();
|
|
131
129
|
return new Promise((t, o) => {
|
|
132
130
|
const r = [], i = () => {
|
|
@@ -139,62 +137,62 @@ function gt(t, e) {
|
|
|
139
137
|
file: s,
|
|
140
138
|
result: t
|
|
141
139
|
}), i();
|
|
142
|
-
}),
|
|
140
|
+
}), q(s, e) ? u.readAsDataURL(s) : i();
|
|
143
141
|
};
|
|
144
142
|
i();
|
|
145
143
|
});
|
|
146
144
|
}
|
|
147
|
-
function
|
|
148
|
-
return Array.from(
|
|
145
|
+
function Q(t, e) {
|
|
146
|
+
return Array.from(tt(t, e));
|
|
149
147
|
}
|
|
150
|
-
function
|
|
148
|
+
function Y(t) {
|
|
151
149
|
return t ? t.getAdjacentCaret() : null;
|
|
152
150
|
}
|
|
153
|
-
function
|
|
154
|
-
return Array.from(
|
|
151
|
+
function Z(t, e) {
|
|
152
|
+
return Array.from(lt(t, e));
|
|
155
153
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
154
|
+
function tt(t, e) {
|
|
155
|
+
return nt("next", t, e);
|
|
158
156
|
}
|
|
159
|
-
function
|
|
157
|
+
function et(t, e) {
|
|
160
158
|
const n = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(t, e));
|
|
161
159
|
return n && n[0];
|
|
162
160
|
}
|
|
163
|
-
function
|
|
164
|
-
const o = $getRoot(), i = e || o, l = $isElementNode(i) ? $getChildCaret(i, t) : $getSiblingCaret(i, t), s =
|
|
165
|
-
let
|
|
161
|
+
function nt(t, e, n) {
|
|
162
|
+
const o = $getRoot(), i = e || o, l = $isElementNode(i) ? $getChildCaret(i, t) : $getSiblingCaret(i, t), s = rt(i), u = n ? $getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(n, t))) || et(n, t) : et(i, t);
|
|
163
|
+
let f = s;
|
|
166
164
|
return makeStepwiseIterator({
|
|
167
165
|
hasNext: (t) => null !== t,
|
|
168
166
|
initial: l,
|
|
169
167
|
map: (t) => ({
|
|
170
|
-
depth:
|
|
168
|
+
depth: f,
|
|
171
169
|
node: t.origin
|
|
172
170
|
}),
|
|
173
171
|
step: (t) => {
|
|
174
|
-
if (t.isSameNodeCaret(
|
|
175
|
-
$isChildCaret(t) &&
|
|
172
|
+
if (t.isSameNodeCaret(u)) return null;
|
|
173
|
+
$isChildCaret(t) && f++;
|
|
176
174
|
const e = $getAdjacentSiblingOrParentSiblingCaret(t);
|
|
177
|
-
return !e || e[0].isSameNodeCaret(
|
|
175
|
+
return !e || e[0].isSameNodeCaret(u) ? null : (f += e[1], e[0]);
|
|
178
176
|
}
|
|
179
177
|
});
|
|
180
178
|
}
|
|
181
|
-
function
|
|
179
|
+
function ot(t) {
|
|
182
180
|
const e = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(t, "next"));
|
|
183
181
|
return e && [e[0].origin, e[1]];
|
|
184
182
|
}
|
|
185
|
-
function
|
|
183
|
+
function rt(t) {
|
|
186
184
|
let e = -1;
|
|
187
185
|
for (let n = t; null !== n; n = n.getParent()) e++;
|
|
188
186
|
return e;
|
|
189
187
|
}
|
|
190
|
-
function
|
|
188
|
+
function it(t) {
|
|
191
189
|
const n = $getAdjacentSiblingOrParentSiblingCaret($getChildCaretOrSelf($getSiblingCaret(t, "previous")), "root");
|
|
192
190
|
return n && n[0].origin;
|
|
193
191
|
}
|
|
194
|
-
function
|
|
195
|
-
return
|
|
192
|
+
function lt(t, e) {
|
|
193
|
+
return nt("previous", t, e);
|
|
196
194
|
}
|
|
197
|
-
function
|
|
195
|
+
function st(t, e) {
|
|
198
196
|
let n = t;
|
|
199
197
|
for (; null != n;) {
|
|
200
198
|
if (n instanceof e) return n;
|
|
@@ -202,11 +200,11 @@ function At(t, e) {
|
|
|
202
200
|
}
|
|
203
201
|
return null;
|
|
204
202
|
}
|
|
205
|
-
function
|
|
203
|
+
function ut(t) {
|
|
206
204
|
const e = $findMatchingParent(t, (t) => $isElementNode(t) && !t.isInline());
|
|
207
|
-
return $isElementNode(e) ||
|
|
205
|
+
return $isElementNode(e) || k(4, t.__key), e;
|
|
208
206
|
}
|
|
209
|
-
function
|
|
207
|
+
function ct(t, e, n, o) {
|
|
210
208
|
const r = (t) => t instanceof e;
|
|
211
209
|
return t.registerNodeTransform(e, (t) => {
|
|
212
210
|
const e = ((t) => {
|
|
@@ -237,14 +235,14 @@ function bt(t, e, n, o) {
|
|
|
237
235
|
}
|
|
238
236
|
});
|
|
239
237
|
}
|
|
240
|
-
function
|
|
238
|
+
function ft(t, e) {
|
|
241
239
|
const n = /* @__PURE__ */ new Map(), o = t._pendingEditorState;
|
|
242
240
|
for (const [t, o] of e._nodeMap) n.set(t, $cloneWithProperties(o));
|
|
243
|
-
o && (o._nodeMap = n),
|
|
241
|
+
o && (o._nodeMap = n), $fullReconcile();
|
|
244
242
|
const r = e._selection;
|
|
245
243
|
$setSelection(null === r ? null : r.clone());
|
|
246
244
|
}
|
|
247
|
-
function
|
|
245
|
+
function at(t) {
|
|
248
246
|
const e = $getSelection() || $getPreviousSelection();
|
|
249
247
|
let r;
|
|
250
248
|
if ($isRangeSelection(e)) r = $caretFromPoint(e.focus, "next");
|
|
@@ -255,16 +253,16 @@ function Pt(t) {
|
|
|
255
253
|
}
|
|
256
254
|
r = r || $getChildCaret($getRoot(), "previous").getFlipped().insert($createParagraphNode());
|
|
257
255
|
}
|
|
258
|
-
const i =
|
|
256
|
+
const i = dt(t, r), l = $getAdjacentChildCaret(i);
|
|
259
257
|
return $setSelectionFromCaretRange($getCollapsedCaretRange($isChildCaret(l) ? $normalizeCaret(l) : i)), t.getLatest();
|
|
260
258
|
}
|
|
261
|
-
function
|
|
259
|
+
function dt(t, e, n) {
|
|
262
260
|
let o = $getCaretInDirection(e, "next");
|
|
263
|
-
$isTextPointCaret(o) && (0 === o.offset ? o = $getSiblingCaret(o.origin, "previous").getFlipped() : o.offset === o.origin.getTextContentSize() && (o = $getSiblingCaret(o.origin, "next"))), o.origin.is(t) && ($isSiblingCaret(o) ||
|
|
261
|
+
$isTextPointCaret(o) && (0 === o.offset ? o = $getSiblingCaret(o.origin, "previous").getFlipped() : o.offset === o.origin.getTextContentSize() && (o = $getSiblingCaret(o.origin, "next"))), o.origin.is(t) && ($isSiblingCaret(o) || k(342, t.getKey(), t.getType()), o = $rewindSiblingCaret(o)), (t.is(o.getNodeAtCaret()) || t.is(o.getFlipped().getNodeAtCaret())) && t.remove(!0);
|
|
264
262
|
for (let t = o; t; t = $splitAtPointCaretNext(t, n)) o = t;
|
|
265
|
-
return $isTextPointCaret(o) &&
|
|
263
|
+
return $isTextPointCaret(o) && k(283), o.insert(t.isInline() ? $createParagraphNode().append(t) : t), $getCaretInDirection($getSiblingCaret(t.getLatest(), "next"), e.direction);
|
|
266
264
|
}
|
|
267
|
-
function
|
|
265
|
+
function gt(t) {
|
|
268
266
|
const e = $getSelection();
|
|
269
267
|
if (!$isRangeSelection(e)) return void (e && e.insertNodes([t]));
|
|
270
268
|
let i = $getCaretRangeInDirection($removeTextFromCaretRange($caretRangeFromSelection(e)), "next").anchor;
|
|
@@ -276,14 +274,14 @@ function Mt(t) {
|
|
|
276
274
|
const l = i.getFlipped();
|
|
277
275
|
l.insert(t), $setSelectionFromCaretRange($getCaretRange(l, l));
|
|
278
276
|
}
|
|
279
|
-
function
|
|
277
|
+
function pt(t, e) {
|
|
280
278
|
const n = e();
|
|
281
279
|
return t.replace(n), n.append(t), n;
|
|
282
280
|
}
|
|
283
|
-
function
|
|
281
|
+
function mt(t, e) {
|
|
284
282
|
return null !== t && Object.getPrototypeOf(t).constructor.name === e.name;
|
|
285
283
|
}
|
|
286
|
-
function
|
|
284
|
+
function ht(t, e) {
|
|
287
285
|
const n = [];
|
|
288
286
|
for (let o = 0; o < t.length; o++) {
|
|
289
287
|
const r = e(t[o]);
|
|
@@ -291,7 +289,7 @@ function Kt(t, e) {
|
|
|
291
289
|
}
|
|
292
290
|
return n;
|
|
293
291
|
}
|
|
294
|
-
function
|
|
292
|
+
function yt(t) {
|
|
295
293
|
const e = $getSelection();
|
|
296
294
|
if (!$isRangeSelection(e)) return !1;
|
|
297
295
|
const i = /* @__PURE__ */ new Set(), l = e.getNodes();
|
|
@@ -305,47 +303,47 @@ function _t(t) {
|
|
|
305
303
|
}
|
|
306
304
|
return i.size > 0;
|
|
307
305
|
}
|
|
308
|
-
function
|
|
306
|
+
function vt(t, e) {
|
|
309
307
|
$getChildCaret(t, "next").insert(e);
|
|
310
308
|
}
|
|
311
|
-
let
|
|
312
|
-
function
|
|
309
|
+
let Et = !(IS_FIREFOX || !CAN_USE_DOM) && void 0;
|
|
310
|
+
function St(t, e = !1) {
|
|
313
311
|
let n = 1;
|
|
314
312
|
if (function() {
|
|
315
|
-
if (void 0 ===
|
|
313
|
+
if (void 0 === Et) {
|
|
316
314
|
const t = document.createElement("div");
|
|
317
315
|
t.style.position = "absolute", t.style.opacity = "0", t.style.width = "100px", t.style.left = "-1000px", document.body.appendChild(t);
|
|
318
316
|
const e = t.getBoundingClientRect();
|
|
319
|
-
t.style.setProperty("zoom", "2"),
|
|
317
|
+
t.style.setProperty("zoom", "2"), Et = t.getBoundingClientRect().width === e.width, document.body.removeChild(t);
|
|
320
318
|
}
|
|
321
|
-
return
|
|
319
|
+
return Et;
|
|
322
320
|
}() || e) for (; t;) n *= Number(window.getComputedStyle(t).getPropertyValue("zoom")), t = t.parentElement;
|
|
323
321
|
return n;
|
|
324
322
|
}
|
|
325
|
-
function
|
|
323
|
+
function xt(t) {
|
|
326
324
|
return null !== t._parentEditor;
|
|
327
325
|
}
|
|
328
|
-
function
|
|
329
|
-
return
|
|
326
|
+
function Ct(t, e) {
|
|
327
|
+
return Nt(t, e, null);
|
|
330
328
|
}
|
|
331
|
-
function
|
|
329
|
+
function Nt(t, e, n) {
|
|
332
330
|
let o = !1;
|
|
333
|
-
for (const i of
|
|
331
|
+
for (const i of At(t)) e(i) ? null !== n && n(i) : (o = !0, $isElementNode(i) && Nt(i, e, n || ((t) => i.insertAfter(t))), i.remove());
|
|
334
332
|
return o;
|
|
335
333
|
}
|
|
336
|
-
function
|
|
334
|
+
function _t(t, e) {
|
|
337
335
|
const n = [], o = Array.from(t).reverse();
|
|
338
336
|
for (let t = o.pop(); void 0 !== t; t = o.pop()) if (e(t)) n.push(t);
|
|
339
|
-
else if ($isElementNode(t)) for (const e of
|
|
337
|
+
else if ($isElementNode(t)) for (const e of At(t)) o.push(e);
|
|
340
338
|
return n;
|
|
341
339
|
}
|
|
342
|
-
function
|
|
343
|
-
return
|
|
340
|
+
function wt(t) {
|
|
341
|
+
return Rt($getChildCaret(t, "next"));
|
|
344
342
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
343
|
+
function At(t) {
|
|
344
|
+
return Rt($getChildCaret(t, "previous"));
|
|
347
345
|
}
|
|
348
|
-
function
|
|
346
|
+
function Rt(t) {
|
|
349
347
|
return makeStepwiseIterator({
|
|
350
348
|
hasNext: $isSiblingCaret,
|
|
351
349
|
initial: t.getAdjacentCaret(),
|
|
@@ -353,10 +351,10 @@ function Ut(t) {
|
|
|
353
351
|
step: (t) => t.getAdjacentCaret()
|
|
354
352
|
});
|
|
355
353
|
}
|
|
356
|
-
function
|
|
354
|
+
function It(t) {
|
|
357
355
|
$rewindSiblingCaret($getSiblingCaret(t, "next")).splice(1, t.getChildren());
|
|
358
356
|
}
|
|
359
|
-
function
|
|
357
|
+
function Lt(t) {
|
|
360
358
|
const e = (e) => $getState(e, t), n = (e, n) => $setState(e, t, n);
|
|
361
359
|
return {
|
|
362
360
|
$get: e,
|
|
@@ -372,4 +370,4 @@ function Wt(t) {
|
|
|
372
370
|
};
|
|
373
371
|
}
|
|
374
372
|
//#endregion
|
|
375
|
-
export {
|
|
373
|
+
export { _t as $descendantsMatching, Q as $dfs, tt as $dfsIterator, ht as $filter, $findMatchingParent, wt as $firstToLastIterator, Y as $getAdjacentCaret, $getAdjacentSiblingOrParentSiblingCaret, rt as $getDepth, ut as $getNearestBlockElementAncestorOrThrow, st as $getNearestNodeOfType, it as $getNextRightPreorderNode, ot as $getNextSiblingOrParentSibling, yt as $handleIndentAndOutdent, vt as $insertFirst, gt as $insertNodeIntoLeaf, at as $insertNodeToNearestRoot, dt as $insertNodeToNearestRootAtCaret, xt as $isEditorIsNestedEditor, At as $lastToFirstIterator, ft as $restoreEditorState, Z as $reverseDfs, lt as $reverseDfsIterator, $splitNode, Ct as $unwrapAndFilterDescendants, It as $unwrapNode, pt as $wrapNodeInElement, CAN_USE_BEFORE_INPUT, CAN_USE_DOM, IS_ANDROID, IS_ANDROID_CHROME, IS_APPLE, IS_APPLE_WEBKIT, IS_CHROME, IS_FIREFOX, IS_IOS, IS_SAFARI, addClassNamesToElement, St as calculateZoomLevel, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, q as isMimeType, Lt as makeStateWrapper, V as markSelection, J as mediaFileReader, mergeRegister, mt as objectKlassEquals, z as positionNodeOnRange, ct as registerNestedElementResolver, removeClassNamesFromElement, X as selectionAlwaysOnDisplay };
|
package/dist/bin/mxs.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as run } from "../mxs-
|
|
1
|
+
import { t as run } from "../mxs-iqJBopvE.mjs";
|
|
2
2
|
export { run };
|
package/dist/bin/mxs.mjs
CHANGED