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