@mx-space/cli 0.13.0 → 0.13.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.
Files changed (55) hide show
  1. package/README.md +23 -1
  2. package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
  3. package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
  4. package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
  5. package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
  6. package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
  7. package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
  8. package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
  9. package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
  10. package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
  11. package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
  12. package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
  13. package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
  14. package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
  15. package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
  16. package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
  17. package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
  18. package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
  19. package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
  20. package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
  21. package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
  22. package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
  23. package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
  24. package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
  25. package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
  26. package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
  27. package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
  28. package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
  29. package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
  30. package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
  31. package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
  32. package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
  33. package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
  34. package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
  35. package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
  36. package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
  37. package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
  38. package/dist/bin/mxs.mjs +1 -1
  39. package/dist/esm-BumPuCXw.mjs +2 -0
  40. package/dist/{esm-lpolVSUJ.mjs → esm-DupC6TTP.mjs} +172 -172
  41. package/dist/index.d.mts +16 -16
  42. package/dist/index.mjs +1 -1
  43. package/dist/{mxs-PFV8OJ-M.mjs → mxs-BgAyMQdq.mjs} +1595 -314
  44. package/package.json +17 -17
  45. package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
  46. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
  47. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
  48. package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
  49. package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
  50. package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
  51. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
  52. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
  53. package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
  54. package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
  55. package/dist/esm-DGvoYR6n.mjs +0 -2
@@ -0,0 +1,186 @@
1
+ import { f as namedSignals, l as effect, m as watchedSignal } from "./LexicalExtension.node-CMsupJZs.mjs";
2
+ import { Ar as getEditorPropertyFromDOMNode, Cr as getActiveElementDeep, W as $getSelection, Zr as isLexicalEditor, ai as safeCast, br as defineExtension, bt as $isTextNode, pt as $isRangeSelection } from "./Lexical.node-DnR_u_Ke.mjs";
3
+ //#region ../../node_modules/.pnpm/@lexical+dragon@0.46.0_typescript@6.0.3/node_modules/@lexical/dragon/dist/LexicalDragon.dev.mjs
4
+ /**
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ *
10
+ */
11
+ /**
12
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ *
17
+ */
18
+ const TEXT_FORMAT_BY_EXEC_COMMAND = {
19
+ bold: "bold",
20
+ italic: "italic",
21
+ strikeThrough: "strikethrough",
22
+ subscript: "subscript",
23
+ superscript: "superscript",
24
+ underline: "underline"
25
+ };
26
+ const WINDOW_STATE_KEY = Symbol.for("@lexical/dragon/WindowState");
27
+ function getOrCreateWindowState(targetWindow) {
28
+ let state = targetWindow[WINDOW_STATE_KEY];
29
+ if (state === void 0) {
30
+ state = {
31
+ dispose: () => {},
32
+ editors: /* @__PURE__ */ new Map(),
33
+ installs: /* @__PURE__ */ new Set()
34
+ };
35
+ targetWindow[WINDOW_STATE_KEY] = state;
36
+ }
37
+ return state;
38
+ }
39
+ function defaultWindow() {
40
+ return typeof window !== "undefined" ? window : void 0;
41
+ }
42
+ /**
43
+ * Install the shared window listener that handles Dragon NaturallySpeaking's
44
+ * web extension messages for every registered editor in the given window.
45
+ *
46
+ * Browsers invoke a window's message listeners in registration order, and
47
+ * the extension's content script registers its own listener at document_end
48
+ * of the initial page load. {@link registerDragonSupport} installs this
49
+ * listener lazily, when an editor's root element is mounted, which loses
50
+ * that race whenever editors mount after the initial load (a navigation in
51
+ * a single page app, a dialog, any lazily rendered field). The extension
52
+ * then edits the DOM directly before Lexical can stopImmediatePropagation,
53
+ * and the edit is applied twice.
54
+ *
55
+ * Call this synchronously from every entrypoint that may render an editor
56
+ * lazily, before document_end, so the listener is ahead of the extension's
57
+ * and editors win the race no matter when they mount.
58
+ *
59
+ * Pass `targetWindow` to install the listener on a window other than the
60
+ * global one (for example, an editor mounted inside an iframe). When
61
+ * omitted, defaults to the current `window` when available. Returns a
62
+ * teardown function; the listener for a window is removed once every
63
+ * teardown for it (including the ones returned by
64
+ * {@link registerDragonSupport}) has been called.
65
+ */
66
+ function installDragonSupport(targetWindow = defaultWindow()) {
67
+ return targetWindow ? addInstall(targetWindow, Symbol("@lexical/dragon/globalInstall"), void 0) : () => {};
68
+ }
69
+ function addInstall(targetWindow, installKey, editor) {
70
+ const state = getOrCreateWindowState(targetWindow);
71
+ if (state.installs.size === 0) {
72
+ const boundHandleMessage = handleMessage.bind(targetWindow);
73
+ targetWindow.addEventListener("message", boundHandleMessage, true);
74
+ state.dispose = () => {
75
+ targetWindow.removeEventListener("message", boundHandleMessage, true);
76
+ };
77
+ }
78
+ state.installs.add(installKey);
79
+ if (editor) {
80
+ const installSet = state.editors.get(editor) || /* @__PURE__ */ new Set();
81
+ installSet.add(installKey);
82
+ state.editors.set(editor, installSet);
83
+ }
84
+ return removeInstall.bind(null, targetWindow, state, installKey, editor);
85
+ }
86
+ function removeInstall(targetWindow, state, installKey, editor) {
87
+ if (editor) {
88
+ const installSet = state.editors.get(editor);
89
+ if (installSet && installSet.delete(installKey) && installSet.size === 0) state.editors.delete(editor);
90
+ }
91
+ if (state.installs.delete(installKey) && state.installs.size === 0) {
92
+ state.dispose();
93
+ delete targetWindow[WINDOW_STATE_KEY];
94
+ }
95
+ }
96
+ function getDefaultView(el) {
97
+ return el && el.ownerDocument.defaultView;
98
+ }
99
+ function registerDragonSupport(editor) {
100
+ const windowSignal = watchedSignal(() => getDefaultView(editor.getRootElement()), (self) => editor.registerRootListener((rootElement) => {
101
+ self.value = getDefaultView(rootElement);
102
+ }));
103
+ return effect(() => {
104
+ const targetWindow = windowSignal.value;
105
+ if (targetWindow) return addInstall(targetWindow, Symbol("@lexical/dragon/editorInstall"), editor);
106
+ });
107
+ }
108
+ function getFocusedEditor(targetWindow) {
109
+ const state = targetWindow[WINDOW_STATE_KEY];
110
+ if (state === void 0) return null;
111
+ const activeEditor = getEditorPropertyFromDOMNode(getActiveElementDeep(targetWindow.document));
112
+ return isLexicalEditor(activeEditor) && state.editors.has(activeEditor) ? activeEditor : null;
113
+ }
114
+ function handleMessage(event) {
115
+ const targetWindow = this;
116
+ if (event.origin !== targetWindow.location.origin) return;
117
+ const editor = getFocusedEditor(targetWindow);
118
+ if (editor === null) return;
119
+ const data = event.data;
120
+ if (typeof data === "string") {
121
+ let parsedData;
122
+ try {
123
+ parsedData = JSON.parse(data);
124
+ } catch (_e) {
125
+ return;
126
+ }
127
+ if (parsedData && parsedData.protocol === "nuanria_messaging" && parsedData.type === "request") {
128
+ const payload = parsedData.payload;
129
+ if (payload && payload.functionId === "makeChanges") {
130
+ const args = payload.args;
131
+ if (Array.isArray(args)) {
132
+ const [elementStart, elementLength, text, selStart, selLength, formatCommand] = args;
133
+ if (![
134
+ elementStart,
135
+ elementLength,
136
+ selStart,
137
+ selLength
138
+ ].every(Number.isFinite) || typeof text !== "string" && text !== -1) return;
139
+ editor.update(() => {
140
+ const selection = $getSelection();
141
+ if ($isRangeSelection(selection)) {
142
+ const anchor = selection.anchor;
143
+ let anchorNode = anchor.getNode();
144
+ let setSelStart = 0;
145
+ let setSelEnd = 0;
146
+ if ($isTextNode(anchorNode)) {
147
+ if (elementStart >= 0 && elementLength >= 0) {
148
+ setSelStart = elementStart;
149
+ setSelEnd = elementStart + elementLength;
150
+ selection.setTextNodeRange(anchorNode, setSelStart, anchorNode, setSelEnd);
151
+ }
152
+ }
153
+ if (typeof text === "string" && (setSelStart !== setSelEnd || text !== "")) {
154
+ selection.insertRawText(text);
155
+ anchorNode = anchor.getNode();
156
+ }
157
+ if ($isTextNode(anchorNode)) {
158
+ const anchorNodeTextLength = anchorNode.getTextContentSize();
159
+ setSelStart = Math.min(Math.max(selStart, 0), anchorNodeTextLength);
160
+ setSelEnd = selStart < 0 || selLength < 0 ? setSelStart : Math.min(selStart + selLength, anchorNodeTextLength);
161
+ selection.setTextNodeRange(anchorNode, setSelStart, anchorNode, setSelEnd);
162
+ }
163
+ if (typeof formatCommand === "string" && selLength > 0 && !selection.isCollapsed()) {
164
+ const format = TEXT_FORMAT_BY_EXEC_COMMAND[formatCommand];
165
+ if (format !== void 0) selection.formatText(format);
166
+ }
167
+ event.stopImmediatePropagation();
168
+ }
169
+ });
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ /**
176
+ * Add Dragon speech to text input support to the editor, via the
177
+ * \@lexical/dragon module.
178
+ */
179
+ const DragonExtension = /* @__PURE__ */ defineExtension({
180
+ build: (editor, config, state) => namedSignals(config),
181
+ config: /* @__PURE__ */ safeCast({ disabled: typeof window === "undefined" }),
182
+ name: "@lexical/dragon",
183
+ register: (editor, config, state) => effect(() => state.getOutput().disabled.value ? void 0 : registerDragonSupport(editor))
184
+ });
185
+ //#endregion
186
+ export { DragonExtension, installDragonSupport, registerDragonSupport };
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@lexical+dragon@0.45.0/node_modules/@lexical/dragon/dist/LexicalDragon.node.mjs
1
+ //#region ../../node_modules/.pnpm/@lexical+dragon@0.46.0_typescript@6.0.3/node_modules/@lexical/dragon/dist/LexicalDragon.node.mjs
2
2
  /**
3
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
4
4
  *
@@ -6,8 +6,9 @@
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("./LexicalDragon.dev-DwprRH0z.mjs") : import("./LexicalDragon.prod-nh4J-8vn.mjs"));
9
+ const mod = await (process.env.NODE_ENV !== "production" ? import("./LexicalDragon.dev-DRm2bGZ1.mjs") : import("./LexicalDragon.prod-ey3uKDJF.mjs"));
10
10
  const DragonExtension = mod.DragonExtension;
11
+ mod.installDragonSupport;
11
12
  mod.registerDragonSupport;
12
13
  //#endregion
13
14
  export { DragonExtension as t };
@@ -0,0 +1,121 @@
1
+ import { f as namedSignals, l as effect, m as watchedSignal } from "./LexicalExtension.node-CMsupJZs.mjs";
2
+ import { Ar as getEditorPropertyFromDOMNode, Cr as getActiveElementDeep, W as $getSelection, Zr as isLexicalEditor, ai as safeCast, br as defineExtension, bt as $isTextNode, pt as $isRangeSelection } from "./Lexical.node-DnR_u_Ke.mjs";
3
+ //#region ../../node_modules/.pnpm/@lexical+dragon@0.46.0_typescript@6.0.3/node_modules/@lexical/dragon/dist/LexicalDragon.prod.mjs
4
+ /**
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ *
10
+ */
11
+ const c = {
12
+ bold: "bold",
13
+ italic: "italic",
14
+ strikeThrough: "strikethrough",
15
+ subscript: "subscript",
16
+ superscript: "superscript",
17
+ underline: "underline"
18
+ }, f = Symbol.for("@lexical/dragon/WindowState");
19
+ function g(e = function() {
20
+ return "undefined" != typeof window ? window : void 0;
21
+ }()) {
22
+ return e ? p(e, Symbol("@lexical/dragon/globalInstall"), void 0) : () => {};
23
+ }
24
+ function p(e, t, n) {
25
+ const i = function(e) {
26
+ let t = e[f];
27
+ return void 0 === t && (t = {
28
+ dispose: () => {},
29
+ editors: /* @__PURE__ */ new Map(),
30
+ installs: /* @__PURE__ */ new Set()
31
+ }, e[f] = t), t;
32
+ }(e);
33
+ if (0 === i.installs.size) {
34
+ const t = x.bind(e);
35
+ e.addEventListener("message", t, !0), i.dispose = () => {
36
+ e.removeEventListener("message", t, !0);
37
+ };
38
+ }
39
+ if (i.installs.add(t), n) {
40
+ const e = i.editors.get(n) || /* @__PURE__ */ new Set();
41
+ e.add(t), i.editors.set(n, e);
42
+ }
43
+ return m.bind(null, e, i, t, n);
44
+ }
45
+ function m(e, t, n, i) {
46
+ if (i) {
47
+ const e = t.editors.get(i);
48
+ e && e.delete(n) && 0 === e.size && t.editors.delete(i);
49
+ }
50
+ t.installs.delete(n) && 0 === t.installs.size && (t.dispose(), delete e[f]);
51
+ }
52
+ function y(e) {
53
+ return e && e.ownerDocument.defaultView;
54
+ }
55
+ function b(n) {
56
+ const i = watchedSignal(() => y(n.getRootElement()), (e) => n.registerRootListener((t) => {
57
+ e.value = y(t);
58
+ }));
59
+ return effect(() => {
60
+ const e = i.value;
61
+ if (e) return p(e, Symbol("@lexical/dragon/editorInstall"), n);
62
+ });
63
+ }
64
+ function x(e) {
65
+ if (e.origin !== this.location.origin) return;
66
+ const t = function(e) {
67
+ const t = e[f];
68
+ if (void 0 === t) return null;
69
+ const n = getEditorPropertyFromDOMNode(getActiveElementDeep(e.document));
70
+ return isLexicalEditor(n) && t.editors.has(n) ? n : null;
71
+ }(this);
72
+ if (null === t) return;
73
+ const n = e.data;
74
+ if ("string" == typeof n) {
75
+ let r;
76
+ try {
77
+ r = JSON.parse(n);
78
+ } catch (e) {
79
+ return;
80
+ }
81
+ if (r && "nuanria_messaging" === r.protocol && "request" === r.type) {
82
+ const n = r.payload;
83
+ if (n && "makeChanges" === n.functionId) {
84
+ const r = n.args;
85
+ if (Array.isArray(r)) {
86
+ const [n, l, a, d, u, f] = r;
87
+ if (![
88
+ n,
89
+ l,
90
+ d,
91
+ u
92
+ ].every(Number.isFinite) || "string" != typeof a && -1 !== a) return;
93
+ t.update(() => {
94
+ const t = $getSelection();
95
+ if ($isRangeSelection(t)) {
96
+ const i = t.anchor;
97
+ let o = i.getNode(), r = 0, g = 0;
98
+ if ($isTextNode(o) && n >= 0 && l >= 0 && (r = n, g = n + l, t.setTextNodeRange(o, r, o, g)), "string" != typeof a || r === g && "" === a || (t.insertRawText(a), o = i.getNode()), $isTextNode(o)) {
99
+ const e = o.getTextContentSize();
100
+ r = Math.min(Math.max(d, 0), e), g = d < 0 || u < 0 ? r : Math.min(d + u, e), t.setTextNodeRange(o, r, o, g);
101
+ }
102
+ if ("string" == typeof f && u > 0 && !t.isCollapsed()) {
103
+ const e = c[f];
104
+ void 0 !== e && t.formatText(e);
105
+ }
106
+ e.stopImmediatePropagation();
107
+ }
108
+ });
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ const h = /* @__PURE__ */ defineExtension({
115
+ build: (e, t, i) => namedSignals(t),
116
+ config: /* @__PURE__ */ safeCast({ disabled: "undefined" == typeof window }),
117
+ name: "@lexical/dragon",
118
+ register: (e, n, i) => effect(() => i.getOutput().disabled.value ? void 0 : b(e))
119
+ });
120
+ //#endregion
121
+ export { h as DragonExtension, g as installDragonSupport, b as registerDragonSupport };