@ws-ui/code-editor 0.2.0 → 0.2.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/demo/common.d.ts +5 -0
- package/dist/editor/utils.d.ts +1 -1
- package/dist/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +295 -275
- package/dist/index.es.js.map +1 -1
- package/dist/studio/assets/css.worker.bundle.js +18131 -14357
- package/dist/studio/assets/editor.worker.bundle.js +1948 -924
- package/dist/studio/assets/html.worker.bundle.js +4726 -3749
- package/dist/studio/assets/json.worker.bundle.js +6007 -4623
- package/dist/studio/assets/textmate.worker.bundle.js +2158 -1055
- package/dist/studio/assets/ts.worker.bundle.js +90386 -54619
- package/package.json +23 -22
package/dist/index.es.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsxs as
|
|
5
|
-
import K, { useEffect as
|
|
6
|
-
import { loader as
|
|
7
|
-
import { lspSubject as
|
|
8
|
-
import { MonacoLanguageClient as
|
|
9
|
-
import { mergeServices as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
1
|
+
var ce = Object.defineProperty;
|
|
2
|
+
var Ie = (t, e, n) => e in t ? ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var R = (t, e, n) => (Ie(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { jsxs as O, jsx as S, Fragment as de } from "react/jsx-runtime";
|
|
5
|
+
import K, { useEffect as J, createContext as z, useState as D, useRef as P, useContext as _, memo as ue } from "react";
|
|
6
|
+
import { loader as Ce, useMonaco as me, Editor as fe } from "@monaco-editor/react";
|
|
7
|
+
import { lspSubject as Ae, LspActions as j, hasAttributesString as U, FileFolderType as pe } from "@ws-ui/shared";
|
|
8
|
+
import { MonacoLanguageClient as be } from "monaco-languageclient";
|
|
9
|
+
import { mergeServices as he, initServices as ve } from "monaco-languageclient/vscode/services";
|
|
10
|
+
import Se, { initUserConfiguration as ye } from "@codingame/monaco-vscode-configuration-service-override";
|
|
11
|
+
import Ne from "@codingame/monaco-vscode-theme-service-override";
|
|
12
|
+
import we from "@codingame/monaco-vscode-textmate-service-override";
|
|
13
|
+
import Re from "@codingame/monaco-vscode-languages-service-override";
|
|
14
|
+
import xe from "@codingame/monaco-vscode-editor-service-override";
|
|
14
15
|
import "@codingame/monaco-vscode-theme-defaults-default-extension";
|
|
15
16
|
import * as o from "monaco-editor";
|
|
16
|
-
import { Selection as
|
|
17
|
-
import { Logger as
|
|
18
|
-
import { ErrorAction as
|
|
19
|
-
import { WebSocketMessageReader as
|
|
20
|
-
import { WillSaveTextDocumentNotification as
|
|
21
|
-
import { StandaloneServices as
|
|
17
|
+
import { Selection as We, KeyMod as B, KeyCode as G, editor as q, Uri as Le } from "monaco-editor";
|
|
18
|
+
import { Logger as Fe } from "monaco-languageclient/tools";
|
|
19
|
+
import { ErrorAction as Ze, CloseAction as je } from "vscode-languageclient";
|
|
20
|
+
import { WebSocketMessageReader as Xe, WebSocketMessageWriter as Ee, toSocket as Ke } from "vscode-ws-jsonrpc";
|
|
21
|
+
import { WillSaveTextDocumentNotification as ke, TextDocumentSaveReason as Be, DidSaveTextDocumentNotification as Ge, WillCreateFilesRequest as Oe, WillRenameFilesRequest as Je, WillDeleteFilesRequest as Te, DidCreateFilesNotification as De, DidRenameFilesNotification as Ve, DidDeleteFilesNotification as Ye } from "vscode-languageserver-protocol";
|
|
22
|
+
import { StandaloneServices as Me, ICodeEditorService as Pe } from "vscode/services";
|
|
22
23
|
import "@codingame/monaco-vscode-standalone-languages";
|
|
23
24
|
import "@codingame/monaco-vscode-standalone-html-language-features";
|
|
24
25
|
import "@codingame/monaco-vscode-standalone-css-language-features";
|
|
@@ -28,12 +29,14 @@ import "@codingame/monaco-vscode-css-default-extension";
|
|
|
28
29
|
import "@codingame/monaco-vscode-json-default-extension";
|
|
29
30
|
import "@codingame/monaco-vscode-html-default-extension";
|
|
30
31
|
import "@codingame/monaco-vscode-javascript-default-extension";
|
|
31
|
-
import { registerExtension as
|
|
32
|
-
const
|
|
33
|
-
const t =
|
|
32
|
+
import { registerExtension as He } from "vscode/extensions";
|
|
33
|
+
const $e = () => Se(), ze = () => {
|
|
34
|
+
const t = Ne(), e = t.themeService.ctor.prototype;
|
|
34
35
|
return e.defineTheme = () => {
|
|
35
36
|
}, t;
|
|
36
|
-
},
|
|
37
|
+
}, _e = () => xe(
|
|
38
|
+
() => Promise.resolve(void 0)
|
|
39
|
+
), Ue = `{
|
|
37
40
|
"workbench.colorTheme": "Default Dark+",
|
|
38
41
|
"workbench.iconTheme": "vs-seti",
|
|
39
42
|
"editor.autoClosingBrackets": "languageDefined",
|
|
@@ -118,10 +121,10 @@ const Me = () => he(), Pe = () => {
|
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
|
-
`,
|
|
124
|
+
`, qe = () => ye(Ue), Qe = async (t) => {
|
|
122
125
|
var r;
|
|
123
126
|
const e = t.serviceConfig ?? {};
|
|
124
|
-
e.debugLogging = ((r = t.logger) == null ? void 0 : r.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await
|
|
127
|
+
e.debugLogging = ((r = t.logger) == null ? void 0 : r.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await qe(), e.userServices = e.userServices ?? {};
|
|
125
128
|
const n = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
|
|
126
129
|
if (n === void 0) {
|
|
127
130
|
if (i)
|
|
@@ -130,12 +133,13 @@ const Me = () => he(), Pe = () => {
|
|
|
130
133
|
);
|
|
131
134
|
const a = {
|
|
132
135
|
// @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
|
|
133
|
-
|
|
134
|
-
...
|
|
135
|
-
...
|
|
136
|
-
...
|
|
136
|
+
...$e(),
|
|
137
|
+
...ze(),
|
|
138
|
+
...we(),
|
|
139
|
+
...Re(),
|
|
140
|
+
..._e()
|
|
137
141
|
};
|
|
138
|
-
|
|
142
|
+
he(a, e.userServices);
|
|
139
143
|
}
|
|
140
144
|
return i || (e.workspaceConfig = {
|
|
141
145
|
workspaceProvider: {
|
|
@@ -149,10 +153,10 @@ const Me = () => he(), Pe = () => {
|
|
|
149
153
|
}
|
|
150
154
|
}), e;
|
|
151
155
|
};
|
|
152
|
-
class
|
|
156
|
+
class en extends Xe {
|
|
153
157
|
constructor(n, i) {
|
|
154
158
|
super(n);
|
|
155
|
-
|
|
159
|
+
R(this, "onMessage");
|
|
156
160
|
this.onMessage = i;
|
|
157
161
|
}
|
|
158
162
|
readMessage(n) {
|
|
@@ -168,10 +172,10 @@ class Ue extends Fe {
|
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
|
-
class
|
|
175
|
+
class nn extends Ee {
|
|
172
176
|
constructor(n, i) {
|
|
173
177
|
super(n);
|
|
174
|
-
|
|
178
|
+
R(this, "onSend");
|
|
175
179
|
this.onSend = i;
|
|
176
180
|
}
|
|
177
181
|
async write(n) {
|
|
@@ -183,14 +187,15 @@ class _e extends Ze {
|
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
190
|
+
function F(t, e = !0) {
|
|
191
|
+
const n = `/PACKAGE/Project/Sources/${t}`;
|
|
192
|
+
return e ? `file://${n}` : n;
|
|
188
193
|
}
|
|
189
194
|
function Q(t, e = 0) {
|
|
190
195
|
setTimeout(t, e);
|
|
191
196
|
}
|
|
192
|
-
function
|
|
193
|
-
const n = new
|
|
197
|
+
function tn(t, e) {
|
|
198
|
+
const n = new We(
|
|
194
199
|
e.startLineNumber,
|
|
195
200
|
e.startColumn,
|
|
196
201
|
e.endLineNumber || e.startLineNumber,
|
|
@@ -200,24 +205,24 @@ function qe(t, e) {
|
|
|
200
205
|
t.setSelection(n), t.revealRangeInCenter(n), t.focus();
|
|
201
206
|
});
|
|
202
207
|
}
|
|
203
|
-
function
|
|
208
|
+
function on(t, e, n = 0) {
|
|
204
209
|
n > 0 && (e = n + e), Q(() => {
|
|
205
210
|
t.setPosition({ lineNumber: e, column: 1 }), t.revealLineInCenter(e), t.focus();
|
|
206
211
|
});
|
|
207
212
|
}
|
|
208
|
-
function
|
|
213
|
+
function tt(t, e, n) {
|
|
209
214
|
const r = t.getModel();
|
|
210
215
|
if (r && e) {
|
|
211
216
|
const a = r.getLineCount();
|
|
212
217
|
for (let g = 1; g <= a; g++) {
|
|
213
|
-
const
|
|
214
|
-
if (new RegExp(`(?:Function|function) ${n}`).test(
|
|
218
|
+
const C = r.getLineContent(g);
|
|
219
|
+
if (new RegExp(`(?:Function|function) ${n}`).test(C))
|
|
215
220
|
return g;
|
|
216
221
|
}
|
|
217
222
|
}
|
|
218
223
|
return 0;
|
|
219
224
|
}
|
|
220
|
-
const
|
|
225
|
+
const rn = {
|
|
221
226
|
provideCompletionItems: async (t, e) => {
|
|
222
227
|
const n = t.getWordUntilPosition(e);
|
|
223
228
|
return {
|
|
@@ -334,7 +339,7 @@ const en = {
|
|
|
334
339
|
]
|
|
335
340
|
};
|
|
336
341
|
}
|
|
337
|
-
},
|
|
342
|
+
}, sn = {
|
|
338
343
|
provideCompletionItems: async (t, e) => {
|
|
339
344
|
const n = t.getWordUntilPosition(e);
|
|
340
345
|
return {
|
|
@@ -449,7 +454,7 @@ const en = {
|
|
|
449
454
|
]
|
|
450
455
|
};
|
|
451
456
|
}
|
|
452
|
-
},
|
|
457
|
+
}, ln = [
|
|
453
458
|
// zoom in
|
|
454
459
|
{
|
|
455
460
|
keybinding: B.CtrlCmd | G.NumpadAdd,
|
|
@@ -477,16 +482,16 @@ const en = {
|
|
|
477
482
|
keybinding: B.CtrlCmd | G.Digit0,
|
|
478
483
|
command: "editor.action.fontZoomReset"
|
|
479
484
|
}
|
|
480
|
-
],
|
|
485
|
+
], an = ({ defaultZoom: t }) => (J(() => {
|
|
481
486
|
t !== void 0 && q.EditorZoom.setZoomLevel(t);
|
|
482
487
|
}, []), null);
|
|
483
|
-
({}).VITE_DISABLE_MONACO_LOADER ||
|
|
488
|
+
({}).VITE_DISABLE_MONACO_LOADER || Ce.config({
|
|
484
489
|
monaco: o
|
|
485
490
|
// paths: {
|
|
486
491
|
// vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.41.0/min/vs",
|
|
487
492
|
// },
|
|
488
493
|
});
|
|
489
|
-
const ee = z(void 0),
|
|
494
|
+
const ee = z(void 0), it = ({
|
|
490
495
|
children: t,
|
|
491
496
|
url: e,
|
|
492
497
|
qodly: n,
|
|
@@ -495,204 +500,219 @@ const ee = z(void 0), qn = ({
|
|
|
495
500
|
language: a = "4d",
|
|
496
501
|
defaultInited: g = !1
|
|
497
502
|
}) => {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
e &&
|
|
501
|
-
}, [e,
|
|
503
|
+
const C = me(), [m, h] = D(g), [Z, y] = D(null), f = P(), b = P(0);
|
|
504
|
+
J(() => {
|
|
505
|
+
e && C && v();
|
|
506
|
+
}, [e, C]);
|
|
502
507
|
const v = async () => {
|
|
503
|
-
if (!
|
|
508
|
+
if (!C)
|
|
504
509
|
return;
|
|
505
|
-
const
|
|
510
|
+
const c = new Fe({
|
|
506
511
|
enabled: process.env.NODE_ENV === "development",
|
|
507
512
|
debugEnabled: process.env.NODE_ENV === "development"
|
|
508
|
-
}),
|
|
509
|
-
logger:
|
|
513
|
+
}), I = await Qe({
|
|
514
|
+
logger: c
|
|
510
515
|
});
|
|
511
|
-
await
|
|
516
|
+
await ve({
|
|
512
517
|
caller: "Qodly Code Editor",
|
|
513
|
-
logger:
|
|
514
|
-
serviceConfig:
|
|
515
|
-
}), r &&
|
|
518
|
+
logger: c,
|
|
519
|
+
serviceConfig: I
|
|
520
|
+
}), r && Me.get(Pe).registerCodeEditorOpenHandler(r), C.languages.registerCompletionItemProvider(
|
|
516
521
|
a,
|
|
517
|
-
n ?
|
|
518
|
-
), q.addKeybindingRules(
|
|
522
|
+
n ? sn : rn
|
|
523
|
+
), q.addKeybindingRules(ln), p();
|
|
519
524
|
}, p = () => {
|
|
520
525
|
y(null);
|
|
521
|
-
let
|
|
526
|
+
let c;
|
|
522
527
|
try {
|
|
523
|
-
|
|
528
|
+
c = new WebSocket(localStorage.LSP_SERVER || e);
|
|
524
529
|
} catch {
|
|
525
530
|
y(new Event("INVALID_URL"));
|
|
526
531
|
return;
|
|
527
532
|
}
|
|
528
|
-
|
|
533
|
+
c.onopen = N, c.onclose = A, c.onerror = u, b.current = 0;
|
|
529
534
|
}, N = async function() {
|
|
530
|
-
const
|
|
535
|
+
const c = Ke(this), I = new en(c), d = new nn(c), L = new be({
|
|
531
536
|
name: "4D Language Client",
|
|
532
537
|
clientOptions: {
|
|
533
538
|
workspaceFolder: {
|
|
534
|
-
uri:
|
|
539
|
+
uri: Le.parse("file:///PACKAGE")
|
|
535
540
|
},
|
|
536
541
|
// use a language id as a document selector
|
|
537
542
|
documentSelector: [{ scheme: "file", language: a }],
|
|
538
543
|
// disable the default error handler
|
|
539
544
|
errorHandler: {
|
|
540
|
-
error: () => ({ action:
|
|
541
|
-
closed: () => ({ action:
|
|
545
|
+
error: () => ({ action: Ze.Continue }),
|
|
546
|
+
closed: () => ({ action: je.DoNotRestart })
|
|
542
547
|
}
|
|
543
548
|
},
|
|
544
549
|
// create a language client connection from the JSON RPC connection on demand
|
|
545
550
|
connectionProvider: {
|
|
546
551
|
get: () => Promise.resolve({
|
|
547
|
-
reader:
|
|
548
|
-
writer:
|
|
552
|
+
reader: I,
|
|
553
|
+
writer: d
|
|
549
554
|
})
|
|
550
555
|
}
|
|
551
556
|
});
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
|
|
557
|
+
f.current = L;
|
|
558
|
+
const ae = L.sendRequest.bind(L);
|
|
559
|
+
f.current.sendRequest = function(Y, M, ge) {
|
|
555
560
|
return typeof Y == "object" && Y.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
|
|
556
561
|
M.textDocument.uri
|
|
557
|
-
) ? Promise.resolve() :
|
|
558
|
-
},
|
|
559
|
-
|
|
562
|
+
) ? Promise.resolve() : ae(Y, M, ge);
|
|
563
|
+
}, I.onClose(() => {
|
|
564
|
+
L.stop(), b.current < 3 ? setTimeout(() => {
|
|
560
565
|
b.current++, p();
|
|
561
566
|
}, 1e3) : y(new Event("WEBSOCKET_CLOSED"));
|
|
562
|
-
}),
|
|
563
|
-
},
|
|
564
|
-
},
|
|
565
|
-
y(
|
|
567
|
+
}), L.needsStart() && await L.start(), h(!0);
|
|
568
|
+
}, A = () => {
|
|
569
|
+
}, u = (c) => {
|
|
570
|
+
y(c);
|
|
566
571
|
};
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
switch (
|
|
570
|
-
case
|
|
571
|
-
|
|
572
|
+
J(() => {
|
|
573
|
+
const c = Ae.subscribe(({ action: I, payload: d }) => {
|
|
574
|
+
switch (I) {
|
|
575
|
+
case j.WILL_SAVE:
|
|
576
|
+
l(d.filePath);
|
|
572
577
|
break;
|
|
573
|
-
case
|
|
574
|
-
|
|
578
|
+
case j.DID_SAVE:
|
|
579
|
+
w(d.filePath, d.content);
|
|
575
580
|
break;
|
|
576
|
-
case
|
|
577
|
-
|
|
581
|
+
case j.WILL_CREATE:
|
|
582
|
+
x(d.filePath);
|
|
578
583
|
break;
|
|
579
|
-
case
|
|
580
|
-
|
|
584
|
+
case j.DID_CREATE:
|
|
585
|
+
re(d.filePath);
|
|
581
586
|
break;
|
|
582
|
-
case
|
|
583
|
-
|
|
587
|
+
case j.WILL_RENAME:
|
|
588
|
+
k(d.oldPath, d.newPath);
|
|
584
589
|
break;
|
|
585
|
-
case
|
|
586
|
-
|
|
590
|
+
case j.DID_RENAME:
|
|
591
|
+
se(d.oldPath, d.newPath);
|
|
587
592
|
break;
|
|
588
|
-
case
|
|
589
|
-
|
|
593
|
+
case j.WILL_DELETE:
|
|
594
|
+
W(d.filePath);
|
|
590
595
|
break;
|
|
591
|
-
case
|
|
592
|
-
|
|
596
|
+
case j.DID_DELETE:
|
|
597
|
+
le(d.filePath);
|
|
598
|
+
break;
|
|
599
|
+
case j.DIAGNOSTIC_REFRESH:
|
|
600
|
+
s(d.filePath);
|
|
593
601
|
break;
|
|
594
602
|
}
|
|
595
603
|
});
|
|
596
|
-
return () =>
|
|
604
|
+
return () => c.unsubscribe();
|
|
597
605
|
}, []);
|
|
598
|
-
const
|
|
599
|
-
var
|
|
600
|
-
(
|
|
606
|
+
const E = (c) => {
|
|
607
|
+
var I, d;
|
|
608
|
+
return (d = (I = f.current) == null ? void 0 : I._features) == null ? void 0 : d.find(
|
|
609
|
+
(L) => L.constructor.name === c
|
|
610
|
+
);
|
|
611
|
+
}, s = (c) => {
|
|
612
|
+
if (f.current) {
|
|
613
|
+
const I = E("DiagnosticFeature");
|
|
614
|
+
if (I)
|
|
615
|
+
for (const [d, L] of I._registrations)
|
|
616
|
+
L.provider && L.provider.onDidChangeDiagnosticsEmitter.fire();
|
|
617
|
+
}
|
|
618
|
+
}, l = (c, I = Be.Manual) => {
|
|
619
|
+
var d;
|
|
620
|
+
(d = f.current) == null || d.sendNotification(ke.type, {
|
|
601
621
|
textDocument: {
|
|
602
|
-
uri:
|
|
622
|
+
uri: F(c)
|
|
603
623
|
},
|
|
604
|
-
reason:
|
|
624
|
+
reason: I
|
|
605
625
|
});
|
|
606
|
-
},
|
|
607
|
-
var
|
|
608
|
-
(
|
|
626
|
+
}, w = (c, I) => {
|
|
627
|
+
var d;
|
|
628
|
+
(d = f.current) == null || d.sendNotification(Ge.type, {
|
|
609
629
|
textDocument: {
|
|
610
|
-
uri:
|
|
630
|
+
uri: F(c)
|
|
611
631
|
},
|
|
612
|
-
text:
|
|
632
|
+
text: I
|
|
613
633
|
});
|
|
614
|
-
},
|
|
615
|
-
var
|
|
616
|
-
(
|
|
634
|
+
}, x = (c) => {
|
|
635
|
+
var I;
|
|
636
|
+
(I = f.current) == null || I.sendRequest(Oe.type, {
|
|
617
637
|
files: [
|
|
618
638
|
{
|
|
619
|
-
uri:
|
|
639
|
+
uri: F(c)
|
|
620
640
|
}
|
|
621
641
|
]
|
|
622
642
|
});
|
|
623
|
-
},
|
|
624
|
-
var
|
|
625
|
-
(
|
|
643
|
+
}, k = (c, I) => {
|
|
644
|
+
var d;
|
|
645
|
+
(d = f.current) == null || d.sendRequest(Je.type, {
|
|
626
646
|
files: [
|
|
627
647
|
{
|
|
628
|
-
oldUri:
|
|
629
|
-
newUri:
|
|
648
|
+
oldUri: F(c),
|
|
649
|
+
newUri: F(I)
|
|
630
650
|
}
|
|
631
651
|
]
|
|
632
652
|
});
|
|
633
|
-
},
|
|
634
|
-
var
|
|
635
|
-
(
|
|
653
|
+
}, W = (c) => {
|
|
654
|
+
var I;
|
|
655
|
+
(I = f.current) == null || I.sendRequest(Te.type, {
|
|
636
656
|
files: [
|
|
637
657
|
{
|
|
638
|
-
uri:
|
|
658
|
+
uri: F(c)
|
|
639
659
|
}
|
|
640
660
|
]
|
|
641
661
|
});
|
|
642
|
-
},
|
|
643
|
-
var
|
|
644
|
-
(
|
|
662
|
+
}, re = (c) => {
|
|
663
|
+
var I;
|
|
664
|
+
(I = f.current) == null || I.sendNotification(De.type, {
|
|
645
665
|
files: [
|
|
646
666
|
{
|
|
647
|
-
uri:
|
|
667
|
+
uri: F(c)
|
|
648
668
|
}
|
|
649
669
|
]
|
|
650
670
|
});
|
|
651
|
-
},
|
|
652
|
-
var
|
|
653
|
-
(
|
|
671
|
+
}, se = (c, I) => {
|
|
672
|
+
var d;
|
|
673
|
+
(d = f.current) == null || d.sendNotification(Ve.type, {
|
|
654
674
|
files: [
|
|
655
675
|
{
|
|
656
|
-
oldUri:
|
|
657
|
-
newUri:
|
|
676
|
+
oldUri: F(c),
|
|
677
|
+
newUri: F(I)
|
|
658
678
|
}
|
|
659
679
|
]
|
|
660
680
|
});
|
|
661
|
-
},
|
|
662
|
-
var
|
|
663
|
-
(
|
|
681
|
+
}, le = (c) => {
|
|
682
|
+
var I;
|
|
683
|
+
(I = f.current) == null || I.sendNotification(Ye.type, {
|
|
664
684
|
files: [
|
|
665
685
|
{
|
|
666
|
-
uri:
|
|
686
|
+
uri: F(c)
|
|
667
687
|
}
|
|
668
688
|
]
|
|
669
689
|
});
|
|
670
690
|
};
|
|
671
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ O(
|
|
672
692
|
ee.Provider,
|
|
673
693
|
{
|
|
674
694
|
value: {
|
|
675
|
-
inited: m || !!
|
|
676
|
-
clientRef:
|
|
677
|
-
lastError:
|
|
695
|
+
inited: m || !!Z,
|
|
696
|
+
clientRef: f,
|
|
697
|
+
lastError: Z,
|
|
678
698
|
reload: p
|
|
679
699
|
},
|
|
680
700
|
children: [
|
|
681
701
|
t,
|
|
682
|
-
/* @__PURE__ */ S(
|
|
702
|
+
/* @__PURE__ */ S(an, { defaultZoom: i })
|
|
683
703
|
]
|
|
684
704
|
}
|
|
685
705
|
);
|
|
686
706
|
};
|
|
687
|
-
function
|
|
688
|
-
const t =
|
|
707
|
+
function ot() {
|
|
708
|
+
const t = _(ee);
|
|
689
709
|
if (t === void 0)
|
|
690
710
|
throw new Error("useLSP must be used within an LSPContext");
|
|
691
711
|
return t;
|
|
692
712
|
}
|
|
693
713
|
const ne = z(
|
|
694
714
|
void 0
|
|
695
|
-
),
|
|
715
|
+
), rt = ue(({ children: t }) => {
|
|
696
716
|
const [e, n] = D(null);
|
|
697
717
|
return /* @__PURE__ */ S(
|
|
698
718
|
ne.Provider,
|
|
@@ -705,8 +725,8 @@ const ne = z(
|
|
|
705
725
|
}
|
|
706
726
|
);
|
|
707
727
|
});
|
|
708
|
-
function
|
|
709
|
-
const t =
|
|
728
|
+
function gn() {
|
|
729
|
+
const t = _(ne), e = D(null);
|
|
710
730
|
if (t === void 0) {
|
|
711
731
|
const [n, i] = e;
|
|
712
732
|
return {
|
|
@@ -722,16 +742,16 @@ var te = {
|
|
|
722
742
|
className: void 0,
|
|
723
743
|
style: void 0,
|
|
724
744
|
attr: void 0
|
|
725
|
-
}, H = K.createContext && K.createContext(te),
|
|
726
|
-
return
|
|
745
|
+
}, H = K.createContext && K.createContext(te), X = globalThis && globalThis.__assign || function() {
|
|
746
|
+
return X = Object.assign || function(t) {
|
|
727
747
|
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
728
748
|
e = arguments[n];
|
|
729
749
|
for (var r in e)
|
|
730
750
|
Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
731
751
|
}
|
|
732
752
|
return t;
|
|
733
|
-
},
|
|
734
|
-
},
|
|
753
|
+
}, X.apply(this, arguments);
|
|
754
|
+
}, cn = globalThis && globalThis.__rest || function(t, e) {
|
|
735
755
|
var n = {};
|
|
736
756
|
for (var i in t)
|
|
737
757
|
Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
@@ -742,32 +762,32 @@ var te = {
|
|
|
742
762
|
};
|
|
743
763
|
function ie(t) {
|
|
744
764
|
return t && t.map(function(e, n) {
|
|
745
|
-
return K.createElement(e.tag,
|
|
765
|
+
return K.createElement(e.tag, X({
|
|
746
766
|
key: n
|
|
747
767
|
}, e.attr), ie(e.child));
|
|
748
768
|
});
|
|
749
769
|
}
|
|
750
770
|
function oe(t) {
|
|
751
771
|
return function(e) {
|
|
752
|
-
return K.createElement(
|
|
753
|
-
attr:
|
|
772
|
+
return K.createElement(In, X({
|
|
773
|
+
attr: X({}, t.attr)
|
|
754
774
|
}, e), ie(t.child));
|
|
755
775
|
};
|
|
756
776
|
}
|
|
757
|
-
function
|
|
777
|
+
function In(t) {
|
|
758
778
|
var e = function(n) {
|
|
759
|
-
var i = t.attr, r = t.size, a = t.title, g =
|
|
760
|
-
return n.className && (m = n.className), t.className && (m = (m ? m + " " : "") + t.className), K.createElement("svg",
|
|
779
|
+
var i = t.attr, r = t.size, a = t.title, g = cn(t, ["attr", "size", "title"]), C = r || n.size || "1em", m;
|
|
780
|
+
return n.className && (m = n.className), t.className && (m = (m ? m + " " : "") + t.className), K.createElement("svg", X({
|
|
761
781
|
stroke: "currentColor",
|
|
762
782
|
fill: "currentColor",
|
|
763
783
|
strokeWidth: "0"
|
|
764
784
|
}, n.attr, i, g, {
|
|
765
785
|
className: m,
|
|
766
|
-
style:
|
|
786
|
+
style: X(X({
|
|
767
787
|
color: t.color || n.color
|
|
768
788
|
}, n.style), t.style),
|
|
769
|
-
height:
|
|
770
|
-
width:
|
|
789
|
+
height: C,
|
|
790
|
+
width: C,
|
|
771
791
|
xmlns: "http://www.w3.org/2000/svg"
|
|
772
792
|
}), a && K.createElement("title", null, a), t.children);
|
|
773
793
|
};
|
|
@@ -775,24 +795,24 @@ function ln(t) {
|
|
|
775
795
|
return e(n);
|
|
776
796
|
}) : e(te);
|
|
777
797
|
}
|
|
778
|
-
function
|
|
798
|
+
function dn(t) {
|
|
779
799
|
return oe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z" } }] })(t);
|
|
780
800
|
}
|
|
781
|
-
function
|
|
801
|
+
function un(t) {
|
|
782
802
|
return oe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0080 446.25h340.89a32 32 0 0028.18-47.17zm-198.6-1.83a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.95a21.73 21.73 0 0121.5-22.69h.21a21.74 21.74 0 0121.73 22.7z" } }] })(t);
|
|
783
803
|
}
|
|
784
|
-
const
|
|
804
|
+
const Cn = ({ lspProps: { lastError: t, reload: e } }) => {
|
|
785
805
|
const [n, i] = D(!1), r = () => {
|
|
786
806
|
e();
|
|
787
807
|
}, a = () => {
|
|
788
808
|
i(!1);
|
|
789
809
|
};
|
|
790
|
-
return
|
|
810
|
+
return J(() => {
|
|
791
811
|
i(!!t);
|
|
792
|
-
}, [t]), n ? /* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
-
/* @__PURE__ */ S(
|
|
795
|
-
/* @__PURE__ */
|
|
812
|
+
}, [t]), n ? /* @__PURE__ */ O("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
|
|
813
|
+
/* @__PURE__ */ O("span", { className: "flex flex-1 justify-center gap-1", children: [
|
|
814
|
+
/* @__PURE__ */ S(un, { className: "h-4 w-4 text-yellow-600" }),
|
|
815
|
+
/* @__PURE__ */ O("span", { children: [
|
|
796
816
|
"LSP not loaded.",
|
|
797
817
|
" ",
|
|
798
818
|
/* @__PURE__ */ S(
|
|
@@ -806,14 +826,14 @@ const cn = ({ lspProps: { lastError: t, reload: e } }) => {
|
|
|
806
826
|
] })
|
|
807
827
|
] }),
|
|
808
828
|
/* @__PURE__ */ S("button", { className: "focus:outline-none", children: /* @__PURE__ */ S(
|
|
809
|
-
|
|
829
|
+
dn,
|
|
810
830
|
{
|
|
811
831
|
className: "h-4 w-4 text-white",
|
|
812
832
|
onClick: a
|
|
813
833
|
}
|
|
814
834
|
) })
|
|
815
835
|
] }) : null;
|
|
816
|
-
},
|
|
836
|
+
}, mn = {
|
|
817
837
|
provideCompletionItems: (t, e) => {
|
|
818
838
|
const n = t.getWordUntilPosition(e);
|
|
819
839
|
return {
|
|
@@ -841,7 +861,7 @@ const cn = ({ lspProps: { lastError: t, reload: e } }) => {
|
|
|
841
861
|
]
|
|
842
862
|
};
|
|
843
863
|
}
|
|
844
|
-
},
|
|
864
|
+
}, fn = "#/definitions/Condition", An = {
|
|
845
865
|
Base: {
|
|
846
866
|
type: "object",
|
|
847
867
|
properties: {
|
|
@@ -1109,32 +1129,32 @@ const cn = ({ lspProps: { lastError: t, reload: e } }) => {
|
|
|
1109
1129
|
"ref"
|
|
1110
1130
|
]
|
|
1111
1131
|
}
|
|
1112
|
-
},
|
|
1113
|
-
$ref:
|
|
1114
|
-
definitions:
|
|
1132
|
+
}, pn = {
|
|
1133
|
+
$ref: fn,
|
|
1134
|
+
definitions: An
|
|
1115
1135
|
};
|
|
1116
|
-
function
|
|
1136
|
+
function bn(t, e) {
|
|
1117
1137
|
const n = document.createElement("style");
|
|
1118
1138
|
n.dataset.id = e, n.textContent = t, document.head.append(n);
|
|
1119
1139
|
}
|
|
1120
|
-
function
|
|
1140
|
+
function hn(t) {
|
|
1121
1141
|
return Array.from(document.styleSheets).find(
|
|
1122
1142
|
(e) => e.ownerNode.getAttribute("data-id") === t
|
|
1123
1143
|
);
|
|
1124
1144
|
}
|
|
1125
|
-
function
|
|
1145
|
+
function vn(t, e) {
|
|
1126
1146
|
const n = [];
|
|
1127
1147
|
let i = [];
|
|
1128
|
-
const r = [], a = (s, l, w,
|
|
1148
|
+
const r = [], a = (s, l, w, x) => {
|
|
1129
1149
|
n.push({
|
|
1130
1150
|
startLineNumber: s,
|
|
1131
1151
|
endLineNumber: w,
|
|
1132
1152
|
startColumn: l,
|
|
1133
|
-
endColumn:
|
|
1153
|
+
endColumn: x
|
|
1134
1154
|
}), h(), m();
|
|
1135
1155
|
}, g = (s) => {
|
|
1136
1156
|
r.indexOf(s) < 0 && r.push(s);
|
|
1137
|
-
},
|
|
1157
|
+
}, C = (s) => {
|
|
1138
1158
|
const l = r.indexOf(s);
|
|
1139
1159
|
l < 0 || r.splice(l, 1);
|
|
1140
1160
|
}, m = () => {
|
|
@@ -1146,7 +1166,7 @@ function An(t, e) {
|
|
|
1146
1166
|
}
|
|
1147
1167
|
}, h = () => {
|
|
1148
1168
|
const s = t.getModel();
|
|
1149
|
-
s && (i =
|
|
1169
|
+
s && (i = yn(
|
|
1150
1170
|
n.map((l) => [
|
|
1151
1171
|
s.getOffsetAt({
|
|
1152
1172
|
lineNumber: l.startLineNumber,
|
|
@@ -1160,7 +1180,7 @@ function An(t, e) {
|
|
|
1160
1180
|
/*mergeJoins*/
|
|
1161
1181
|
!0
|
|
1162
1182
|
), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >= s.getValueLength() && (i[i.length - 1][1] = Number.POSITIVE_INFINITY)));
|
|
1163
|
-
},
|
|
1183
|
+
}, Z = (s) => {
|
|
1164
1184
|
const l = {
|
|
1165
1185
|
isDeletion: !1,
|
|
1166
1186
|
isAddition: !1,
|
|
@@ -1168,16 +1188,16 @@ function An(t, e) {
|
|
|
1168
1188
|
};
|
|
1169
1189
|
return s.text === "" ? l.isDeletion = !0 : s.range.startLineNumber === s.range.endLineNumber && s.range.startColumn === s.range.endColumn ? l.isAddition = !0 : l.isReplacement = !0, l;
|
|
1170
1190
|
}, y = t.onDidChangeModel((s) => {
|
|
1171
|
-
h(),
|
|
1172
|
-
}),
|
|
1191
|
+
h(), u();
|
|
1192
|
+
}), f = t.onDidChangeModelContent((s) => {
|
|
1173
1193
|
if (!s.isUndoing)
|
|
1174
1194
|
for (const l of s.changes) {
|
|
1175
|
-
const w =
|
|
1195
|
+
const w = Z(l);
|
|
1176
1196
|
if (w.isReplacement || w.isDeletion || w.isAddition) {
|
|
1177
|
-
const
|
|
1197
|
+
const x = n.some(
|
|
1178
1198
|
(W) => l.range.startLineNumber >= W.startLineNumber && l.range.endLineNumber <= W.endLineNumber && l.range.startColumn >= W.startColumn && l.range.endColumn <= W.endColumn
|
|
1179
|
-
), k = !
|
|
1180
|
-
if (
|
|
1199
|
+
), k = !x && e && l.range.startLineNumber === 1 && l.range.startColumn === 1 && !U(l.text);
|
|
1200
|
+
if (x || k) {
|
|
1181
1201
|
const W = t.getModel();
|
|
1182
1202
|
if (W) {
|
|
1183
1203
|
W.undo();
|
|
@@ -1187,7 +1207,7 @@ function An(t, e) {
|
|
|
1187
1207
|
}
|
|
1188
1208
|
}
|
|
1189
1209
|
}), b = () => {
|
|
1190
|
-
y.dispose(),
|
|
1210
|
+
y.dispose(), f.dispose();
|
|
1191
1211
|
};
|
|
1192
1212
|
let v = [], p = `
|
|
1193
1213
|
.idoc-readonly-mark {
|
|
@@ -1197,26 +1217,26 @@ function An(t, e) {
|
|
|
1197
1217
|
`;
|
|
1198
1218
|
if (p) {
|
|
1199
1219
|
const s = "monaco-read-only";
|
|
1200
|
-
|
|
1220
|
+
hn(s) || bn(p, s), p = null;
|
|
1201
1221
|
}
|
|
1202
1222
|
const N = () => {
|
|
1203
|
-
g(
|
|
1204
|
-
},
|
|
1205
|
-
u
|
|
1206
|
-
},
|
|
1223
|
+
g(u), u();
|
|
1224
|
+
}, A = () => {
|
|
1225
|
+
C(u), v = t.deltaDecorations(v, []);
|
|
1226
|
+
}, u = () => {
|
|
1207
1227
|
const s = t.getModel();
|
|
1208
1228
|
s && (v = t.deltaDecorations(
|
|
1209
1229
|
v,
|
|
1210
|
-
i.map(
|
|
1230
|
+
i.map(E(s))
|
|
1211
1231
|
));
|
|
1212
|
-
},
|
|
1213
|
-
const w = s.getPositionAt(l[0]),
|
|
1232
|
+
}, E = (s) => (l) => {
|
|
1233
|
+
const w = s.getPositionAt(l[0]), x = s.getPositionAt(l[1]);
|
|
1214
1234
|
return {
|
|
1215
1235
|
range: new o.Range(
|
|
1216
1236
|
w.lineNumber,
|
|
1217
1237
|
w.column,
|
|
1218
|
-
|
|
1219
|
-
|
|
1238
|
+
x.lineNumber,
|
|
1239
|
+
x.column
|
|
1220
1240
|
),
|
|
1221
1241
|
options: {
|
|
1222
1242
|
className: "idoc-readonly-mark"
|
|
@@ -1229,47 +1249,47 @@ function An(t, e) {
|
|
|
1229
1249
|
},
|
|
1230
1250
|
exclude: a,
|
|
1231
1251
|
attach: g,
|
|
1232
|
-
detach:
|
|
1252
|
+
detach: C,
|
|
1233
1253
|
dispose: b,
|
|
1234
1254
|
show: N,
|
|
1235
|
-
hide:
|
|
1255
|
+
hide: A
|
|
1236
1256
|
};
|
|
1237
1257
|
}
|
|
1238
|
-
function
|
|
1258
|
+
function Sn(t, e, n) {
|
|
1239
1259
|
let i = !1;
|
|
1240
|
-
const r = (
|
|
1260
|
+
const r = (A) => A[1] < A[0] ? (i = !0, [[A[1], A[0]]]) : [[...A]], a = (A) => i ? A.map((u) => u[1] > u[0] ? C(u) : u).reverse() : A;
|
|
1241
1261
|
let g;
|
|
1242
|
-
const
|
|
1243
|
-
let h,
|
|
1262
|
+
const C = (A) => (g = A[1], A[1] = A[0], A[0] = g, A), m = r(t);
|
|
1263
|
+
let h, Z, y, f, b, v, p, N;
|
|
1244
1264
|
y = m[0];
|
|
1245
|
-
for (
|
|
1246
|
-
for (p =
|
|
1247
|
-
if (y = m[
|
|
1265
|
+
for (Z of e)
|
|
1266
|
+
for (p = Z[0], N = Z[1], f = 0; f < m.length; f++) {
|
|
1267
|
+
if (y = m[f], b = y[0], v = y[1], b < p)
|
|
1248
1268
|
v < p ? h = [y] : v <= N ? h = [[b, p - 1]] : h = [
|
|
1249
1269
|
[b, p - 1],
|
|
1250
1270
|
[N + 1, v]
|
|
1251
1271
|
];
|
|
1252
1272
|
else if (b <= N)
|
|
1253
1273
|
if (p === Number.NEGATIVE_INFINITY) {
|
|
1254
|
-
const
|
|
1255
|
-
h = n === 0 ? [] : [[
|
|
1274
|
+
const A = N + 1;
|
|
1275
|
+
h = n === 0 ? [] : [[A, v > A ? v : A]];
|
|
1256
1276
|
} else
|
|
1257
1277
|
N === Number.POSITIVE_INFINITY ? h = n === 0 ? [] : [[p - 1, p - 1]] : v <= N ? h = n < 0 ? [[p - 1, p - 1]] : n > 0 ? [[N + 1, N + 1]] : [] : h = [[N + 1, v]];
|
|
1258
1278
|
else
|
|
1259
1279
|
h = [y];
|
|
1260
|
-
if (m.splice(
|
|
1280
|
+
if (m.splice(f, 1, ...h), m.length === 1 && m[0][1] < p)
|
|
1261
1281
|
return a(m);
|
|
1262
1282
|
}
|
|
1263
1283
|
return a(m);
|
|
1264
1284
|
}
|
|
1265
|
-
function
|
|
1285
|
+
function yn(t, e) {
|
|
1266
1286
|
if (t.length < 2)
|
|
1267
1287
|
return t;
|
|
1268
1288
|
const n = [];
|
|
1269
1289
|
let i = null, r, a;
|
|
1270
1290
|
t = t.map(
|
|
1271
1291
|
(g) => (g[1] < g[0] && (r = g[1], g[1] = g[0], g[1] = r), g)
|
|
1272
|
-
).sort((g,
|
|
1292
|
+
).sort((g, C) => g[0] - C[0]), n.push(t[0]);
|
|
1273
1293
|
for (let g = 1; g < t.length; g++)
|
|
1274
1294
|
i = n[n.length - 1], a = t[g], i[1] === a[0] && !e ? n.push(a) : i[1] === a[0] - 1 && e ? (i[1] = a[1], n.splice(n.length - 1, 1, i)) : i[1] < a[0] ? n.push(a) : i[1] < a[1] && (i[1] = a[1], n.splice(n.length - 1, 1, i));
|
|
1275
1295
|
return n;
|
|
@@ -1277,20 +1297,20 @@ function bn(t, e) {
|
|
|
1277
1297
|
function T(t, e) {
|
|
1278
1298
|
return e.bind(t);
|
|
1279
1299
|
}
|
|
1280
|
-
class
|
|
1300
|
+
class Nn {
|
|
1281
1301
|
constructor(e, n) {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1302
|
+
R(this, "editor");
|
|
1303
|
+
R(this, "intervals");
|
|
1304
|
+
R(this, "disposables", []);
|
|
1285
1305
|
/**
|
|
1286
1306
|
* Flag for `excludeIntervals`
|
|
1287
1307
|
*/
|
|
1288
|
-
|
|
1289
|
-
|
|
1308
|
+
R(this, "prefer", 1);
|
|
1309
|
+
R(this, "lastPrefer", 1);
|
|
1290
1310
|
/**
|
|
1291
1311
|
* Linked to ICodeEditor.onDidChangeCursorPosition event.
|
|
1292
1312
|
*/
|
|
1293
|
-
|
|
1313
|
+
R(this, "onCursor", T(
|
|
1294
1314
|
this,
|
|
1295
1315
|
function(e) {
|
|
1296
1316
|
if (e.source === "api")
|
|
@@ -1299,16 +1319,16 @@ class hn {
|
|
|
1299
1319
|
n.length !== 0 && this.editor.setSelections(n);
|
|
1300
1320
|
}
|
|
1301
1321
|
));
|
|
1302
|
-
|
|
1322
|
+
R(this, "onRectangleSelectionStart", T(this, function({ event: e }) {
|
|
1303
1323
|
e.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
|
|
1304
1324
|
}));
|
|
1305
|
-
|
|
1325
|
+
R(this, "onRectangleSelectionStop", T(this, function() {
|
|
1306
1326
|
this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
|
|
1307
1327
|
}));
|
|
1308
1328
|
/**
|
|
1309
1329
|
* Linked to ICodeEditor.onKeyDown event.
|
|
1310
1330
|
*/
|
|
1311
|
-
|
|
1331
|
+
R(this, "onKey", T(this, function(e) {
|
|
1312
1332
|
const n = e.keyCode, i = o.KeyCode;
|
|
1313
1333
|
if (e.altKey || i.F1 <= n && n <= i.F19 || e.ctrlKey && n !== i.Backspace)
|
|
1314
1334
|
return;
|
|
@@ -1323,21 +1343,21 @@ class hn {
|
|
|
1323
1343
|
const r = this.getSelections(), a = this.intervals.buffer;
|
|
1324
1344
|
let g;
|
|
1325
1345
|
if (n === i.Delete)
|
|
1326
|
-
g = (
|
|
1346
|
+
g = (C) => C[0] === C[1] && a.find((m) => C[1] + 1 === m[0]) != null;
|
|
1327
1347
|
else if (n === i.Backspace)
|
|
1328
|
-
g = (
|
|
1348
|
+
g = (C) => C[0] === C[1] && a.find((m) => m[1] + 1 === C[0]) != null;
|
|
1329
1349
|
else
|
|
1330
1350
|
return;
|
|
1331
1351
|
r.findIndex(g) !== -1 && (e.stopPropagation(), e.preventDefault());
|
|
1332
1352
|
}));
|
|
1333
|
-
|
|
1353
|
+
R(this, "getOffsetAt", T(this, function(e) {
|
|
1334
1354
|
let n;
|
|
1335
1355
|
for (let i = 0; i < this.intervals.buffer.length; i++)
|
|
1336
1356
|
if (n = this.intervals.buffer[i], e <= n[1])
|
|
1337
1357
|
return n[0] - e < e - n[1] ? n[0] : n[1];
|
|
1338
1358
|
}));
|
|
1339
1359
|
var i;
|
|
1340
|
-
this.editor = e, this.intervals =
|
|
1360
|
+
this.editor = e, this.intervals = vn(e, n), (i = this.editor.getModel()) == null || i.setEOL(o.editor.EndOfLineSequence.LF);
|
|
1341
1361
|
}
|
|
1342
1362
|
enable() {
|
|
1343
1363
|
this.disposables.push(
|
|
@@ -1357,7 +1377,7 @@ class hn {
|
|
|
1357
1377
|
getApprovedSelections() {
|
|
1358
1378
|
const e = this.editor.getModel();
|
|
1359
1379
|
return this.getSelections().map(
|
|
1360
|
-
(i) =>
|
|
1380
|
+
(i) => Sn(
|
|
1361
1381
|
i,
|
|
1362
1382
|
this.intervals.buffer,
|
|
1363
1383
|
this.prefer
|
|
@@ -1386,13 +1406,13 @@ class hn {
|
|
|
1386
1406
|
]);
|
|
1387
1407
|
}
|
|
1388
1408
|
}
|
|
1389
|
-
const
|
|
1409
|
+
const wn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ */ S("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ S("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ O("div", { className: "space-y-2", children: [
|
|
1390
1410
|
/* @__PURE__ */ S("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
|
|
1391
1411
|
/* @__PURE__ */ S("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1392
1412
|
/* @__PURE__ */ S("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
|
|
1393
1413
|
/* @__PURE__ */ S("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1394
1414
|
/* @__PURE__ */ S("div", { className: "h-3 rounded bg-grey-200" })
|
|
1395
|
-
] }) }) }),
|
|
1415
|
+
] }) }) }), st = ({
|
|
1396
1416
|
path: t,
|
|
1397
1417
|
initialValue: e,
|
|
1398
1418
|
theme: n = "fd-dark",
|
|
@@ -1400,66 +1420,66 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
|
|
|
1400
1420
|
language: r,
|
|
1401
1421
|
onChange: a,
|
|
1402
1422
|
options: g = {},
|
|
1403
|
-
extra:
|
|
1423
|
+
extra: C = {},
|
|
1404
1424
|
showAlerts: m = !1,
|
|
1405
1425
|
lspProps: h,
|
|
1406
|
-
...
|
|
1426
|
+
...Z
|
|
1407
1427
|
}) => {
|
|
1408
|
-
const { initialLineInfo: y, initialSelectionInfo:
|
|
1409
|
-
function N(
|
|
1410
|
-
r === "css" &&
|
|
1428
|
+
const { initialLineInfo: y, initialSelectionInfo: f } = C, { editor: b, setEditor: v } = gn(), { inited: p } = h;
|
|
1429
|
+
function N(u) {
|
|
1430
|
+
r === "css" && u.languages.registerCompletionItemProvider("css", mn), r === "json" && u.languages.json && u.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1411
1431
|
validate: !0,
|
|
1412
1432
|
schemas: [
|
|
1413
1433
|
{
|
|
1414
1434
|
uri: "condition-schema.json",
|
|
1415
1435
|
fileMatch: ["*.condition.json"],
|
|
1416
|
-
schema:
|
|
1436
|
+
schema: pn
|
|
1417
1437
|
}
|
|
1418
1438
|
]
|
|
1419
1439
|
});
|
|
1420
1440
|
}
|
|
1421
|
-
function
|
|
1422
|
-
v(
|
|
1423
|
-
const s =
|
|
1424
|
-
if (s && (s.updateOptions({ insertSpaces: !1 }),
|
|
1441
|
+
function A(u, E) {
|
|
1442
|
+
v(u);
|
|
1443
|
+
const s = u.getModel();
|
|
1444
|
+
if (s && (s.updateOptions({ insertSpaces: !1 }), u.onKeyUp(() => {
|
|
1425
1445
|
var w;
|
|
1426
|
-
const l = (w =
|
|
1446
|
+
const l = (w = u.getPosition()) == null ? void 0 : w.lineNumber;
|
|
1427
1447
|
if (l) {
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1448
|
+
const x = s.getLineFirstNonWhitespaceColumn(l), k = s.getLineLength(l), W = s.getLineContent(l);
|
|
1449
|
+
wn.test(W) && u.executeEdits("edit-handler", [
|
|
1430
1450
|
{
|
|
1431
|
-
range: new
|
|
1451
|
+
range: new E.Range(
|
|
1432
1452
|
l,
|
|
1433
1453
|
0,
|
|
1434
1454
|
l,
|
|
1435
1455
|
k
|
|
1436
1456
|
),
|
|
1437
1457
|
text: W.substr(
|
|
1438
|
-
|
|
1439
|
-
k -
|
|
1458
|
+
x - 1,
|
|
1459
|
+
k - x
|
|
1440
1460
|
)
|
|
1441
1461
|
}
|
|
1442
1462
|
]);
|
|
1443
1463
|
}
|
|
1444
|
-
})), i ===
|
|
1445
|
-
const l = new
|
|
1464
|
+
})), i === pe.METHOD && U(e)) {
|
|
1465
|
+
const l = new Nn(u, !0);
|
|
1446
1466
|
l.exclude(1, 1, 1, Number.POSITIVE_INFINITY), l.enable();
|
|
1447
1467
|
}
|
|
1448
1468
|
}
|
|
1449
|
-
return
|
|
1469
|
+
return J(() => {
|
|
1450
1470
|
if (!b)
|
|
1451
1471
|
return;
|
|
1452
|
-
const { line:
|
|
1453
|
-
|
|
1454
|
-
}, [y, b]),
|
|
1472
|
+
const { line: u, offset: E } = y || {};
|
|
1473
|
+
u && on(b, u, E);
|
|
1474
|
+
}, [y, b]), J(() => {
|
|
1455
1475
|
if (!b)
|
|
1456
1476
|
return;
|
|
1457
|
-
const { selection:
|
|
1458
|
-
|
|
1459
|
-
}, [
|
|
1460
|
-
m ? /* @__PURE__ */ S(
|
|
1477
|
+
const { selection: u } = f || {};
|
|
1478
|
+
u && tn(b, u);
|
|
1479
|
+
}, [f, b]), p ? /* @__PURE__ */ O(de, { children: [
|
|
1480
|
+
m ? /* @__PURE__ */ S(Cn, { lspProps: h }) : null,
|
|
1461
1481
|
/* @__PURE__ */ S(
|
|
1462
|
-
|
|
1482
|
+
fe,
|
|
1463
1483
|
{
|
|
1464
1484
|
options: {
|
|
1465
1485
|
readOnly: !0,
|
|
@@ -1468,19 +1488,19 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
|
|
|
1468
1488
|
padding: { top: 10 },
|
|
1469
1489
|
...g
|
|
1470
1490
|
},
|
|
1471
|
-
path:
|
|
1491
|
+
path: F(t),
|
|
1472
1492
|
value: e,
|
|
1473
1493
|
theme: "fd-dark",
|
|
1474
|
-
onChange: (
|
|
1494
|
+
onChange: (u) => a && a(u || ""),
|
|
1475
1495
|
language: r,
|
|
1476
1496
|
beforeMount: N,
|
|
1477
|
-
onMount:
|
|
1497
|
+
onMount: A,
|
|
1478
1498
|
loading: /* @__PURE__ */ S($, {}),
|
|
1479
|
-
...
|
|
1499
|
+
...Z
|
|
1480
1500
|
}
|
|
1481
1501
|
)
|
|
1482
1502
|
] }) : /* @__PURE__ */ S($, {});
|
|
1483
|
-
},
|
|
1503
|
+
}, Rn = {
|
|
1484
1504
|
name: "4d",
|
|
1485
1505
|
displayName: "%displayName%",
|
|
1486
1506
|
description: "%description%",
|
|
@@ -1505,7 +1525,7 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
|
|
|
1505
1525
|
}
|
|
1506
1526
|
]
|
|
1507
1527
|
}
|
|
1508
|
-
}, { registerFileUrl: V, whenReady:
|
|
1528
|
+
}, { registerFileUrl: V, whenReady: lt } = He(Rn, void 0, {
|
|
1509
1529
|
system: !0
|
|
1510
1530
|
});
|
|
1511
1531
|
V(
|
|
@@ -1529,18 +1549,18 @@ V(
|
|
|
1529
1549
|
{ mimeType: "application/json", size: 135 }
|
|
1530
1550
|
);
|
|
1531
1551
|
export {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1552
|
+
Cn as Alerts,
|
|
1553
|
+
st as CodeEditor,
|
|
1554
|
+
rt as CodeEditorProvider,
|
|
1555
|
+
it as LSPProvider,
|
|
1536
1556
|
Q as _await,
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1557
|
+
Qe as configureServices,
|
|
1558
|
+
F as getFileSystemPath,
|
|
1559
|
+
tt as getFunctionOffset,
|
|
1560
|
+
qe as initMonacoUserConfiguration,
|
|
1561
|
+
on as jumpToLine,
|
|
1562
|
+
tn as jumpToSelection,
|
|
1563
|
+
gn as useCodeEditor,
|
|
1564
|
+
ot as useLSP
|
|
1545
1565
|
};
|
|
1546
1566
|
//# sourceMappingURL=index.es.js.map
|