@ws-ui/code-editor 1.8.0 → 1.8.3
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/index.d.ts +0 -1
- package/dist/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +517 -520
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { loader as
|
|
4
|
-
import { lspSubject as
|
|
5
|
-
import { MonacoLanguageClient as
|
|
6
|
-
import { mergeServices as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { jsxs as z, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import O, { useEffect as M, createContext as le, useState as $, useRef as oe, useContext as ae, memo as Se } from "react";
|
|
3
|
+
import { loader as ye, useMonaco as Ne, Editor as Re } from "@monaco-editor/react";
|
|
4
|
+
import { lspSubject as we, LspActions as E, hasAttributesString as ge, FileFolderType as ie, SourceCodeDescriptor as xe, HTTP_HANDLERS_TAB_PATH as ke } from "@ws-ui/shared";
|
|
5
|
+
import { MonacoLanguageClient as Le } from "monaco-languageclient";
|
|
6
|
+
import { mergeServices as We, initServices as Fe } from "monaco-languageclient/vscode/services";
|
|
7
|
+
import Ze, { initUserConfiguration as je } from "@codingame/monaco-vscode-configuration-service-override";
|
|
8
|
+
import Xe from "@codingame/monaco-vscode-languages-service-override";
|
|
9
|
+
import Ee from "@codingame/monaco-vscode-textmate-service-override";
|
|
10
10
|
import "@codingame/monaco-vscode-theme-defaults-default-extension";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import Ke from "@codingame/monaco-vscode-editor-service-override";
|
|
12
|
+
import Be from "@codingame/monaco-vscode-theme-service-override";
|
|
13
13
|
import * as l from "monaco-editor";
|
|
14
|
-
import { Selection as
|
|
15
|
-
import { Logger as
|
|
16
|
-
import { CloseAction as
|
|
17
|
-
import { WebSocketMessageReader as
|
|
18
|
-
import { TextDocumentSaveReason as
|
|
19
|
-
import { StandaloneServices as
|
|
14
|
+
import { Selection as Te, KeyMod as G, KeyCode as J, editor as ce, Range as Oe, Uri as De, CancellationTokenSource as Ge } from "monaco-editor";
|
|
15
|
+
import { Logger as Je } from "monaco-languageclient/tools";
|
|
16
|
+
import { CloseAction as Me, ErrorAction as Pe } from "vscode-languageclient";
|
|
17
|
+
import { WebSocketMessageReader as Ve, WebSocketMessageWriter as Ye, toSocket as He } from "vscode-ws-jsonrpc";
|
|
18
|
+
import { TextDocumentSaveReason as ze, DocumentDiagnosticRequest as $e, WillSaveTextDocumentNotification as _e, DidSaveTextDocumentNotification as Ue, WillCreateFilesRequest as qe, WillRenameFilesRequest as Qe, WillDeleteFilesRequest as et, DidCreateFilesNotification as tt, DidRenameFilesNotification as nt, DidDeleteFilesNotification as it, SemanticTokensRegistrationType as ot } from "vscode-languageserver-protocol";
|
|
19
|
+
import { StandaloneServices as rt, ICodeEditorService as st } from "vscode/services";
|
|
20
20
|
import { KeybindingsRegistry as te } from "vscode/monaco";
|
|
21
21
|
import "@codingame/monaco-vscode-standalone-languages";
|
|
22
22
|
import "@codingame/monaco-vscode-standalone-html-language-features";
|
|
@@ -27,14 +27,14 @@ import "@codingame/monaco-vscode-css-default-extension";
|
|
|
27
27
|
import "@codingame/monaco-vscode-json-default-extension";
|
|
28
28
|
import "@codingame/monaco-vscode-html-default-extension";
|
|
29
29
|
import "@codingame/monaco-vscode-javascript-default-extension";
|
|
30
|
-
import { registerExtension as
|
|
31
|
-
const
|
|
30
|
+
import { registerExtension as lt } from "vscode/extensions";
|
|
31
|
+
const at = () => Ze(), gt = () => Ke(
|
|
32
32
|
() => Promise.resolve(void 0)
|
|
33
|
-
),
|
|
34
|
-
const t =
|
|
33
|
+
), ct = () => {
|
|
34
|
+
const t = Be(), e = t.themeService.ctor.prototype;
|
|
35
35
|
return e.defineTheme = () => {
|
|
36
36
|
}, t;
|
|
37
|
-
},
|
|
37
|
+
}, ut = `{
|
|
38
38
|
"workbench.colorTheme": "Default Dark+",
|
|
39
39
|
"workbench.iconTheme": "vs-seti",
|
|
40
40
|
"editor.autoClosingBrackets": "languageDefined",
|
|
@@ -119,10 +119,10 @@ const gt = () => je(), ct = () => Be(
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
`,
|
|
122
|
+
`, dt = () => je(ut), It = async (t) => {
|
|
123
123
|
var o;
|
|
124
124
|
const e = t.serviceConfig ?? {};
|
|
125
|
-
e.debugLogging = ((o = t.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await
|
|
125
|
+
e.debugLogging = ((o = t.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await dt(), e.userServices = e.userServices ?? {};
|
|
126
126
|
const n = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
|
|
127
127
|
if (n === void 0) {
|
|
128
128
|
if (i)
|
|
@@ -131,13 +131,13 @@ const gt = () => je(), ct = () => Be(
|
|
|
131
131
|
);
|
|
132
132
|
const r = {
|
|
133
133
|
// @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
|
|
134
|
-
...
|
|
135
|
-
...
|
|
136
|
-
...Ke(),
|
|
134
|
+
...at(),
|
|
135
|
+
...ct(),
|
|
137
136
|
...Ee(),
|
|
138
|
-
...
|
|
137
|
+
...Xe(),
|
|
138
|
+
...gt()
|
|
139
139
|
};
|
|
140
|
-
|
|
140
|
+
We(r, e.userServices);
|
|
141
141
|
}
|
|
142
142
|
return i || (e.workspaceConfig = {
|
|
143
143
|
workspaceProvider: {
|
|
@@ -151,7 +151,7 @@ const gt = () => je(), ct = () => Be(
|
|
|
151
151
|
}
|
|
152
152
|
}), e;
|
|
153
153
|
};
|
|
154
|
-
class
|
|
154
|
+
class Ct extends Ve {
|
|
155
155
|
constructor(e, n) {
|
|
156
156
|
super(e), this.onMessage = n;
|
|
157
157
|
}
|
|
@@ -168,7 +168,7 @@ class mt extends Ye {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
class
|
|
171
|
+
class mt extends Ye {
|
|
172
172
|
constructor(e, n) {
|
|
173
173
|
super(e), this.onSend = n;
|
|
174
174
|
}
|
|
@@ -188,8 +188,8 @@ function j(t, e = !0) {
|
|
|
188
188
|
function ue(t, e = 0) {
|
|
189
189
|
setTimeout(t, e);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
const n = new
|
|
191
|
+
function ft(t, e) {
|
|
192
|
+
const n = new Te(
|
|
193
193
|
e.startLineNumber,
|
|
194
194
|
e.startColumn,
|
|
195
195
|
e.endLineNumber || e.startLineNumber,
|
|
@@ -199,24 +199,24 @@ function pt(t, e) {
|
|
|
199
199
|
t.setSelection(n), t.revealRangeInCenter(n), t.focus();
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function pt(t, e, n = 0) {
|
|
203
203
|
n > 0 && (e = n + e), ue(() => {
|
|
204
204
|
t.setPosition({ lineNumber: e, column: 1 }), t.revealLineInCenter(e), t.focus();
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Nn(t, e, n) {
|
|
208
208
|
const o = t.getModel();
|
|
209
209
|
if (o && e) {
|
|
210
210
|
const r = o.getLineCount();
|
|
211
211
|
for (let s = 1; s <= r; s++) {
|
|
212
|
-
const
|
|
213
|
-
if (new RegExp(`(?:Function|function) ${n}`).test(
|
|
212
|
+
const p = o.getLineContent(s);
|
|
213
|
+
if (new RegExp(`(?:Function|function) ${n}`).test(p))
|
|
214
214
|
return s;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
return 0;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const At = {
|
|
220
220
|
provideCompletionItems: async (t, e) => {
|
|
221
221
|
const n = t.getWordUntilPosition(e);
|
|
222
222
|
return {
|
|
@@ -333,7 +333,7 @@ const bt = {
|
|
|
333
333
|
]
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
|
-
},
|
|
336
|
+
}, bt = {
|
|
337
337
|
provideCompletionItems: async (t, e) => {
|
|
338
338
|
const n = t.getWordUntilPosition(e);
|
|
339
339
|
return {
|
|
@@ -448,45 +448,45 @@ const bt = {
|
|
|
448
448
|
]
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
|
-
},
|
|
451
|
+
}, ht = [
|
|
452
452
|
// zoom in
|
|
453
453
|
{
|
|
454
|
-
keybinding:
|
|
454
|
+
keybinding: G.CtrlCmd | J.NumpadAdd,
|
|
455
455
|
command: "editor.action.fontZoomIn"
|
|
456
456
|
},
|
|
457
457
|
{
|
|
458
|
-
keybinding:
|
|
458
|
+
keybinding: G.CtrlCmd | J.Equal,
|
|
459
459
|
command: "editor.action.fontZoomIn"
|
|
460
460
|
},
|
|
461
461
|
// zoom out
|
|
462
462
|
{
|
|
463
|
-
keybinding:
|
|
463
|
+
keybinding: G.CtrlCmd | J.NumpadSubtract,
|
|
464
464
|
command: "editor.action.fontZoomOut"
|
|
465
465
|
},
|
|
466
466
|
{
|
|
467
|
-
keybinding:
|
|
467
|
+
keybinding: G.CtrlCmd | J.Minus,
|
|
468
468
|
command: "editor.action.fontZoomOut"
|
|
469
469
|
},
|
|
470
470
|
// zoom reset
|
|
471
471
|
{
|
|
472
|
-
keybinding:
|
|
472
|
+
keybinding: G.CtrlCmd | J.Numpad0,
|
|
473
473
|
command: "editor.action.fontZoomReset"
|
|
474
474
|
},
|
|
475
475
|
{
|
|
476
|
-
keybinding:
|
|
476
|
+
keybinding: G.CtrlCmd | J.Digit0,
|
|
477
477
|
command: "editor.action.fontZoomReset"
|
|
478
478
|
}
|
|
479
|
-
],
|
|
479
|
+
], vt = ({ defaultZoom: t }) => (M(() => {
|
|
480
480
|
t !== void 0 && ce.EditorZoom.setZoomLevel(t);
|
|
481
481
|
}, []), null);
|
|
482
|
-
|
|
482
|
+
ye.config({
|
|
483
483
|
monaco: l
|
|
484
484
|
// paths: {
|
|
485
485
|
// vs: import.meta.env.VITE_MONACO_EDITOR_CDN,
|
|
486
486
|
// },
|
|
487
487
|
});
|
|
488
|
-
var
|
|
489
|
-
class
|
|
488
|
+
var H = /* @__PURE__ */ ((t) => (t[t.NotSet = -1] = "NotSet", t[t.None = 0] = "None", t[t.Italic = 1] = "Italic", t[t.Bold = 2] = "Bold", t[t.Underline = 4] = "Underline", t[t.Strikethrough = 8] = "Strikethrough", t))(H || {}), de = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.DefaultForeground = 1] = "DefaultForeground", t[t.DefaultBackground = 2] = "DefaultBackground", t))(de || {}), Ie = /* @__PURE__ */ ((t) => (t[t.Other = 0] = "Other", t[t.Comment = 1] = "Comment", t[t.String = 2] = "String", t[t.RegEx = 3] = "RegEx", t))(Ie || {});
|
|
489
|
+
class V {
|
|
490
490
|
static getLanguageId(e) {
|
|
491
491
|
return (e & 255) >>> 0;
|
|
492
492
|
}
|
|
@@ -528,47 +528,47 @@ class H {
|
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function St(t, e, n, i) {
|
|
532
532
|
const o = n.tokens.data, r = t.getLanguageId();
|
|
533
|
-
let s = 0,
|
|
534
|
-
const
|
|
533
|
+
let s = 0, p = 0;
|
|
534
|
+
const m = i.lineNumber - 1, h = i.column - 1;
|
|
535
535
|
for (let C = 0; C < o.length; C += 5) {
|
|
536
|
-
const
|
|
537
|
-
if (
|
|
538
|
-
const
|
|
536
|
+
const A = o[C], f = o[C + 1], x = o[C + 2], R = o[C + 3], S = o[C + 4], y = s + A, b = A === 0 ? p + f : f;
|
|
537
|
+
if (m === y && b <= h && h < b + x) {
|
|
538
|
+
const d = n.legend.tokenTypes[R] || "not in legend (ignored)", F = [];
|
|
539
539
|
let a = S;
|
|
540
|
-
for (let
|
|
541
|
-
a & 1 &&
|
|
542
|
-
a > 0 &&
|
|
543
|
-
const
|
|
544
|
-
|
|
540
|
+
for (let P = 0; a > 0 && P < n.legend.tokenModifiers.length; P++)
|
|
541
|
+
a & 1 && F.push(n.legend.tokenModifiers[P]), a = a >> 1;
|
|
542
|
+
a > 0 && F.push("not in legend (ignored)");
|
|
543
|
+
const g = new Oe(
|
|
544
|
+
y + 1,
|
|
545
545
|
b + 1,
|
|
546
|
-
|
|
547
|
-
b + 1 +
|
|
548
|
-
),
|
|
549
|
-
|
|
550
|
-
|
|
546
|
+
y + 1,
|
|
547
|
+
b + 1 + x
|
|
548
|
+
), k = {}, L = e.getColorTheme().tokenColorMap, v = e.getColorTheme().getTokenStyleMetadata(
|
|
549
|
+
d,
|
|
550
|
+
F,
|
|
551
551
|
r,
|
|
552
552
|
!0,
|
|
553
|
-
|
|
553
|
+
k
|
|
554
554
|
);
|
|
555
|
-
let
|
|
556
|
-
return v && (
|
|
555
|
+
let _;
|
|
556
|
+
return v && (_ = {
|
|
557
557
|
languageId: void 0,
|
|
558
558
|
tokenType: Ie.Other,
|
|
559
559
|
bold: v == null ? void 0 : v.bold,
|
|
560
560
|
italic: v == null ? void 0 : v.italic,
|
|
561
561
|
underline: v == null ? void 0 : v.underline,
|
|
562
562
|
strikethrough: v == null ? void 0 : v.strikethrough,
|
|
563
|
-
foreground:
|
|
563
|
+
foreground: L[(v == null ? void 0 : v.foreground) || de.None],
|
|
564
564
|
background: void 0
|
|
565
|
-
}), { type:
|
|
565
|
+
}), { type: d, modifiers: F, range: g, metadata: _, definitions: k };
|
|
566
566
|
}
|
|
567
|
-
s =
|
|
567
|
+
s = y, p = b;
|
|
568
568
|
}
|
|
569
569
|
return null;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function yt(t, e, n) {
|
|
572
572
|
let i = null;
|
|
573
573
|
for (let o = 1; o < n; o++)
|
|
574
574
|
i = e.tokenizeLine(
|
|
@@ -577,51 +577,51 @@ function Nt(t, e, n) {
|
|
|
577
577
|
).ruleStack;
|
|
578
578
|
return i;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
581
|
-
const i = t.getColorTheme().tokenColorMap, o =
|
|
580
|
+
function Nt(t, e, n) {
|
|
581
|
+
const i = t.getColorTheme().tokenColorMap, o = V.getLanguageId(n), r = V.getTokenType(n), s = V.getFontStyle(n), p = V.getForeground(n), m = V.getBackground(n);
|
|
582
582
|
return {
|
|
583
583
|
languageId: e.languageIdCodec.decodeLanguageId(o),
|
|
584
584
|
tokenType: r,
|
|
585
|
-
bold: s &
|
|
586
|
-
italic: s &
|
|
587
|
-
underline: s &
|
|
588
|
-
strikethrough: s &
|
|
589
|
-
foreground: i[
|
|
590
|
-
background: i[
|
|
585
|
+
bold: s & H.Bold ? !0 : void 0,
|
|
586
|
+
italic: s & H.Italic ? !0 : void 0,
|
|
587
|
+
underline: s & H.Underline ? !0 : void 0,
|
|
588
|
+
strikethrough: s & H.Strikethrough ? !0 : void 0,
|
|
589
|
+
foreground: i[p],
|
|
590
|
+
background: i[m]
|
|
591
591
|
};
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
const i = n.lineNumber, o = t, r = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, s =
|
|
593
|
+
function Rt(t, e, n) {
|
|
594
|
+
const i = n.lineNumber, o = t, r = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, s = yt(t, r, i), p = r.tokenizeLine(
|
|
595
595
|
t.getLineContent(i),
|
|
596
596
|
s
|
|
597
|
-
),
|
|
597
|
+
), m = r.tokenizeLine2(
|
|
598
598
|
t.getLineContent(i),
|
|
599
599
|
s
|
|
600
600
|
);
|
|
601
601
|
let h = 0;
|
|
602
|
-
for (let
|
|
603
|
-
const
|
|
604
|
-
if (n.column - 1 >=
|
|
605
|
-
h =
|
|
602
|
+
for (let A = p.tokens.length - 1; A >= 0; A--) {
|
|
603
|
+
const f = p.tokens[A];
|
|
604
|
+
if (n.column - 1 >= f.startIndex) {
|
|
605
|
+
h = A;
|
|
606
606
|
break;
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
let C = 0;
|
|
610
|
-
for (let
|
|
611
|
-
if (n.column - 1 >=
|
|
612
|
-
C =
|
|
610
|
+
for (let A = m.tokens.length >>> 1; A >= 0; A--)
|
|
611
|
+
if (n.column - 1 >= m.tokens[A << 1]) {
|
|
612
|
+
C = A;
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
615
|
return {
|
|
616
|
-
token:
|
|
617
|
-
metadata:
|
|
616
|
+
token: p.tokens[h],
|
|
617
|
+
metadata: Nt(
|
|
618
618
|
e,
|
|
619
619
|
o._languageService,
|
|
620
|
-
|
|
620
|
+
m.tokens[(C << 1) + 1]
|
|
621
621
|
)
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
const Ce = le(void 0),
|
|
624
|
+
const Ce = le(void 0), Rn = ({
|
|
625
625
|
children: t,
|
|
626
626
|
url: e,
|
|
627
627
|
qodly: n,
|
|
@@ -630,174 +630,174 @@ const Ce = le(void 0), xn = ({
|
|
|
630
630
|
language: r = "4d",
|
|
631
631
|
defaultInited: s = !1
|
|
632
632
|
}) => {
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
e &&
|
|
636
|
-
}, [e,
|
|
637
|
-
const
|
|
638
|
-
if (!
|
|
639
|
-
const
|
|
633
|
+
const p = Ne(), [m, h] = $(s), [C, A] = $(null), f = oe(), x = oe(0);
|
|
634
|
+
M(() => {
|
|
635
|
+
e && p && R();
|
|
636
|
+
}, [e, p]);
|
|
637
|
+
const R = async () => {
|
|
638
|
+
if (!p) return;
|
|
639
|
+
const I = new Je({
|
|
640
640
|
enabled: process.env.NODE_ENV === "development",
|
|
641
641
|
debugEnabled: process.env.NODE_ENV === "development"
|
|
642
|
-
}),
|
|
643
|
-
logger:
|
|
642
|
+
}), c = await It({
|
|
643
|
+
logger: I
|
|
644
644
|
});
|
|
645
|
-
await
|
|
645
|
+
await Fe({
|
|
646
646
|
caller: "Qodly Code Editor",
|
|
647
|
-
logger:
|
|
648
|
-
serviceConfig:
|
|
649
|
-
}), o &&
|
|
647
|
+
logger: I,
|
|
648
|
+
serviceConfig: c
|
|
649
|
+
}), o && rt.get(st).registerCodeEditorOpenHandler(o), p.languages.registerCompletionItemProvider(
|
|
650
650
|
r,
|
|
651
|
-
n ?
|
|
651
|
+
n ? bt : At
|
|
652
652
|
);
|
|
653
|
-
const
|
|
654
|
-
te.getDefaultKeybindings = () =>
|
|
653
|
+
const u = te.getDefaultKeybindings.bind(te);
|
|
654
|
+
te.getDefaultKeybindings = () => u().filter(
|
|
655
655
|
(Z) => ![
|
|
656
656
|
"workbench.action.files.saveAs",
|
|
657
657
|
"workbench.action.files.save"
|
|
658
658
|
].includes(Z.command)
|
|
659
|
-
), ce.addKeybindingRules(
|
|
660
|
-
provideFoldingRanges: function(
|
|
659
|
+
), ce.addKeybindingRules(ht), p.languages.registerFoldingRangeProvider(r, {
|
|
660
|
+
provideFoldingRanges: function(N) {
|
|
661
661
|
const Z = [], X = /\\\s*$/;
|
|
662
|
-
for (let
|
|
663
|
-
const U =
|
|
662
|
+
for (let W = 1, D = N.getLineCount(); W <= D; W++) {
|
|
663
|
+
const U = N.getLineContent(W);
|
|
664
664
|
if (X.exec(U)) {
|
|
665
|
-
let K =
|
|
666
|
-
for (; K <=
|
|
667
|
-
const ee =
|
|
665
|
+
let K = W + 1;
|
|
666
|
+
for (; K <= D; ) {
|
|
667
|
+
const ee = N.getLineContent(K);
|
|
668
668
|
if (X.exec(ee) == null)
|
|
669
669
|
break;
|
|
670
670
|
K++;
|
|
671
671
|
}
|
|
672
|
-
K >
|
|
673
|
-
start:
|
|
672
|
+
K > W && (Z.push({
|
|
673
|
+
start: W,
|
|
674
674
|
end: K,
|
|
675
|
-
kind:
|
|
676
|
-
}),
|
|
675
|
+
kind: p.languages.FoldingRangeKind.Region
|
|
676
|
+
}), W = K);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
return Z;
|
|
680
680
|
}
|
|
681
681
|
}), S();
|
|
682
682
|
}, S = () => {
|
|
683
|
-
|
|
684
|
-
let
|
|
683
|
+
A(null);
|
|
684
|
+
let I;
|
|
685
685
|
try {
|
|
686
|
-
|
|
686
|
+
I = new WebSocket(localStorage.LSP_SERVER || e);
|
|
687
687
|
} catch {
|
|
688
|
-
|
|
688
|
+
A(new Event("INVALID_URL"));
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
|
-
|
|
692
|
-
},
|
|
693
|
-
const
|
|
691
|
+
I.onopen = y, I.onclose = b, I.onerror = d, x.current = 0;
|
|
692
|
+
}, y = async function() {
|
|
693
|
+
const I = He(this), c = new Ct(I), u = new mt(I), N = new Le({
|
|
694
694
|
name: "4D Language Client",
|
|
695
695
|
clientOptions: {
|
|
696
696
|
workspaceFolder: {
|
|
697
|
-
uri:
|
|
697
|
+
uri: De.parse("file:///PACKAGE")
|
|
698
698
|
},
|
|
699
699
|
// use a language id as a document selector
|
|
700
700
|
documentSelector: [{ scheme: "file", language: r }],
|
|
701
701
|
// disable the default error handler
|
|
702
702
|
errorHandler: {
|
|
703
|
-
error: () => ({ action:
|
|
704
|
-
closed: () => ({ action:
|
|
703
|
+
error: () => ({ action: Pe.Continue }),
|
|
704
|
+
closed: () => ({ action: Me.DoNotRestart })
|
|
705
705
|
}
|
|
706
706
|
},
|
|
707
707
|
// create a language client connection from the JSON RPC connection on demand
|
|
708
708
|
connectionProvider: {
|
|
709
709
|
get: () => Promise.resolve({
|
|
710
|
-
reader:
|
|
711
|
-
writer:
|
|
710
|
+
reader: c,
|
|
711
|
+
writer: u
|
|
712
712
|
})
|
|
713
713
|
}
|
|
714
714
|
});
|
|
715
|
-
|
|
716
|
-
const Z =
|
|
717
|
-
|
|
715
|
+
f.current = N;
|
|
716
|
+
const Z = N.sendRequest.bind(N);
|
|
717
|
+
f.current.sendRequest = function(X, W, D) {
|
|
718
718
|
return typeof X == "object" && X.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
|
|
719
|
-
|
|
720
|
-
) ? Promise.resolve() : Z(X,
|
|
721
|
-
},
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}, 1e3) :
|
|
725
|
-
}),
|
|
719
|
+
W.textDocument.uri
|
|
720
|
+
) ? Promise.resolve() : Z(X, W, D);
|
|
721
|
+
}, c.onClose(() => {
|
|
722
|
+
N.stop(), x.current < 3 ? setTimeout(() => {
|
|
723
|
+
x.current++, S();
|
|
724
|
+
}, 1e3) : A(new Event("WEBSOCKET_CLOSED"));
|
|
725
|
+
}), N.needsStart() && await N.start(), h(!0);
|
|
726
726
|
}, b = () => {
|
|
727
|
-
},
|
|
728
|
-
|
|
727
|
+
}, d = (I) => {
|
|
728
|
+
A(I);
|
|
729
729
|
};
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
switch (
|
|
730
|
+
M(() => {
|
|
731
|
+
const I = we.subscribe(({ action: c, payload: u }) => {
|
|
732
|
+
switch (c) {
|
|
733
733
|
case E.WILL_SAVE:
|
|
734
|
-
|
|
734
|
+
L(u.filePath);
|
|
735
735
|
break;
|
|
736
736
|
case E.DID_SAVE:
|
|
737
|
-
T(
|
|
737
|
+
T(u.filePath, u.content);
|
|
738
738
|
break;
|
|
739
739
|
case E.WILL_CREATE:
|
|
740
|
-
v(
|
|
740
|
+
v(u.filePath);
|
|
741
741
|
break;
|
|
742
742
|
case E.DID_CREATE:
|
|
743
|
-
be(
|
|
743
|
+
be(u.filePath);
|
|
744
744
|
break;
|
|
745
745
|
case E.WILL_RENAME:
|
|
746
|
-
|
|
746
|
+
_(u.oldPath, u.newPath);
|
|
747
747
|
break;
|
|
748
748
|
case E.DID_RENAME:
|
|
749
|
-
he(
|
|
749
|
+
he(u.oldPath, u.newPath);
|
|
750
750
|
break;
|
|
751
751
|
case E.WILL_DELETE:
|
|
752
|
-
|
|
752
|
+
P(u.filePath);
|
|
753
753
|
break;
|
|
754
754
|
case E.DID_DELETE:
|
|
755
|
-
ve(
|
|
755
|
+
ve(u.filePath);
|
|
756
756
|
break;
|
|
757
757
|
case E.DIAGNOSTIC_REFRESH:
|
|
758
|
-
|
|
758
|
+
k(u.filePath);
|
|
759
759
|
break;
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
|
-
return () =>
|
|
762
|
+
return () => I.unsubscribe();
|
|
763
763
|
}, []);
|
|
764
|
-
const
|
|
765
|
-
var
|
|
766
|
-
return (
|
|
767
|
-
(
|
|
764
|
+
const F = (I) => {
|
|
765
|
+
var c, u;
|
|
766
|
+
return (u = (c = f.current) == null ? void 0 : c._features) == null ? void 0 : u.find(
|
|
767
|
+
(N) => {
|
|
768
768
|
var Z;
|
|
769
|
-
return ((Z =
|
|
769
|
+
return ((Z = N._registrationType) == null ? void 0 : Z.method) === I;
|
|
770
770
|
}
|
|
771
771
|
);
|
|
772
|
-
}, a = (
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
775
|
-
for (const [,
|
|
776
|
-
|
|
777
|
-
return
|
|
778
|
-
},
|
|
779
|
-
var Z, X,
|
|
780
|
-
const
|
|
781
|
-
|
|
772
|
+
}, a = (I) => {
|
|
773
|
+
const c = [], u = F(I);
|
|
774
|
+
if (u)
|
|
775
|
+
for (const [, N] of u._registrations)
|
|
776
|
+
N.provider && c.push(N.provider);
|
|
777
|
+
return c;
|
|
778
|
+
}, g = async (I, c, u) => {
|
|
779
|
+
var Z, X, W;
|
|
780
|
+
const N = a(
|
|
781
|
+
ot.method
|
|
782
782
|
);
|
|
783
|
-
if (
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
783
|
+
if (N[0]) {
|
|
784
|
+
const D = new Ge(), U = await Promise.resolve(
|
|
785
|
+
N[0].full.provideDocumentSemanticTokens(
|
|
786
|
+
c,
|
|
787
|
+
D.token
|
|
788
788
|
)
|
|
789
|
-
), Q =
|
|
790
|
-
|
|
789
|
+
), Q = I, K = U ? St(
|
|
790
|
+
c,
|
|
791
791
|
Q._themeService,
|
|
792
792
|
{
|
|
793
793
|
tokens: U,
|
|
794
|
-
legend: (
|
|
794
|
+
legend: (W = (X = (Z = f.current) == null ? void 0 : Z._capabilities) == null ? void 0 : X.semanticTokensProvider) == null ? void 0 : W.legend
|
|
795
795
|
},
|
|
796
|
-
|
|
797
|
-
) : null, ee =
|
|
798
|
-
|
|
796
|
+
u
|
|
797
|
+
) : null, ee = Rt(
|
|
798
|
+
c,
|
|
799
799
|
Q._themeService,
|
|
800
|
-
|
|
800
|
+
u
|
|
801
801
|
);
|
|
802
802
|
return {
|
|
803
803
|
semanticTokenInfo: K,
|
|
@@ -805,105 +805,105 @@ const Ce = le(void 0), xn = ({
|
|
|
805
805
|
};
|
|
806
806
|
}
|
|
807
807
|
return null;
|
|
808
|
-
},
|
|
809
|
-
if (
|
|
810
|
-
const
|
|
811
|
-
|
|
808
|
+
}, k = (I) => {
|
|
809
|
+
if (f.current) {
|
|
810
|
+
const c = a(
|
|
811
|
+
$e.method
|
|
812
812
|
);
|
|
813
|
-
for (const
|
|
814
|
-
|
|
813
|
+
for (const u of c)
|
|
814
|
+
u.onDidChangeDiagnosticsEmitter.fire();
|
|
815
815
|
}
|
|
816
|
-
},
|
|
817
|
-
var
|
|
818
|
-
(
|
|
816
|
+
}, L = (I, c = ze.Manual) => {
|
|
817
|
+
var u;
|
|
818
|
+
(u = f.current) == null || u.sendNotification(_e.type, {
|
|
819
819
|
textDocument: {
|
|
820
|
-
uri: j(
|
|
820
|
+
uri: j(I)
|
|
821
821
|
},
|
|
822
|
-
reason:
|
|
822
|
+
reason: c
|
|
823
823
|
});
|
|
824
|
-
}, T = (
|
|
825
|
-
var
|
|
826
|
-
(
|
|
824
|
+
}, T = (I, c) => {
|
|
825
|
+
var u;
|
|
826
|
+
(u = f.current) == null || u.sendNotification(Ue.type, {
|
|
827
827
|
textDocument: {
|
|
828
|
-
uri: j(
|
|
828
|
+
uri: j(I)
|
|
829
829
|
},
|
|
830
|
-
text:
|
|
830
|
+
text: c
|
|
831
831
|
});
|
|
832
|
-
}, v = (
|
|
833
|
-
var
|
|
834
|
-
(
|
|
832
|
+
}, v = (I) => {
|
|
833
|
+
var c;
|
|
834
|
+
(c = f.current) == null || c.sendRequest(qe.type, {
|
|
835
835
|
files: [
|
|
836
836
|
{
|
|
837
|
-
uri: j(
|
|
837
|
+
uri: j(I)
|
|
838
838
|
}
|
|
839
839
|
]
|
|
840
840
|
});
|
|
841
|
-
},
|
|
842
|
-
var
|
|
843
|
-
(
|
|
841
|
+
}, _ = (I, c) => {
|
|
842
|
+
var u;
|
|
843
|
+
(u = f.current) == null || u.sendRequest(Qe.type, {
|
|
844
844
|
files: [
|
|
845
845
|
{
|
|
846
|
-
oldUri: j(
|
|
847
|
-
newUri: j(
|
|
846
|
+
oldUri: j(I),
|
|
847
|
+
newUri: j(c)
|
|
848
848
|
}
|
|
849
849
|
]
|
|
850
850
|
});
|
|
851
|
-
},
|
|
852
|
-
var
|
|
853
|
-
(
|
|
851
|
+
}, P = (I) => {
|
|
852
|
+
var c;
|
|
853
|
+
(c = f.current) == null || c.sendRequest(et.type, {
|
|
854
854
|
files: [
|
|
855
855
|
{
|
|
856
|
-
uri: j(
|
|
856
|
+
uri: j(I)
|
|
857
857
|
}
|
|
858
858
|
]
|
|
859
859
|
});
|
|
860
|
-
}, be = (
|
|
861
|
-
var
|
|
862
|
-
(
|
|
860
|
+
}, be = (I) => {
|
|
861
|
+
var c;
|
|
862
|
+
(c = f.current) == null || c.sendNotification(tt.type, {
|
|
863
863
|
files: [
|
|
864
864
|
{
|
|
865
|
-
uri: j(
|
|
865
|
+
uri: j(I)
|
|
866
866
|
}
|
|
867
867
|
]
|
|
868
868
|
});
|
|
869
|
-
}, he = (
|
|
870
|
-
var
|
|
871
|
-
(
|
|
869
|
+
}, he = (I, c) => {
|
|
870
|
+
var u;
|
|
871
|
+
(u = f.current) == null || u.sendNotification(nt.type, {
|
|
872
872
|
files: [
|
|
873
873
|
{
|
|
874
|
-
oldUri: j(
|
|
875
|
-
newUri: j(
|
|
874
|
+
oldUri: j(I),
|
|
875
|
+
newUri: j(c)
|
|
876
876
|
}
|
|
877
877
|
]
|
|
878
878
|
});
|
|
879
|
-
}, ve = (
|
|
880
|
-
var
|
|
881
|
-
(
|
|
879
|
+
}, ve = (I) => {
|
|
880
|
+
var c;
|
|
881
|
+
(c = f.current) == null || c.sendNotification(it.type, {
|
|
882
882
|
files: [
|
|
883
883
|
{
|
|
884
|
-
uri: j(
|
|
884
|
+
uri: j(I)
|
|
885
885
|
}
|
|
886
886
|
]
|
|
887
887
|
});
|
|
888
888
|
};
|
|
889
|
-
return /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ z(
|
|
890
890
|
Ce.Provider,
|
|
891
891
|
{
|
|
892
892
|
value: {
|
|
893
|
-
inited:
|
|
894
|
-
clientRef:
|
|
893
|
+
inited: m || !!C,
|
|
894
|
+
clientRef: f,
|
|
895
895
|
lastError: C,
|
|
896
896
|
reload: S,
|
|
897
|
-
getTokenAtPosition:
|
|
897
|
+
getTokenAtPosition: g
|
|
898
898
|
},
|
|
899
899
|
children: [
|
|
900
900
|
t,
|
|
901
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ w(vt, { defaultZoom: i })
|
|
902
902
|
]
|
|
903
903
|
}
|
|
904
904
|
);
|
|
905
905
|
};
|
|
906
|
-
function
|
|
906
|
+
function wn() {
|
|
907
907
|
const t = ae(Ce);
|
|
908
908
|
if (t === void 0)
|
|
909
909
|
throw new Error("useLSP must be used within an LSPContext");
|
|
@@ -911,9 +911,9 @@ function kn() {
|
|
|
911
911
|
}
|
|
912
912
|
const me = le(
|
|
913
913
|
void 0
|
|
914
|
-
),
|
|
915
|
-
const [e, n] =
|
|
916
|
-
return /* @__PURE__ */
|
|
914
|
+
), xn = Se(({ children: t }) => {
|
|
915
|
+
const [e, n] = $(null);
|
|
916
|
+
return /* @__PURE__ */ w(
|
|
917
917
|
me.Provider,
|
|
918
918
|
{
|
|
919
919
|
value: {
|
|
@@ -924,8 +924,8 @@ const me = le(
|
|
|
924
924
|
}
|
|
925
925
|
);
|
|
926
926
|
});
|
|
927
|
-
function
|
|
928
|
-
const t = ae(me), e =
|
|
927
|
+
function wt() {
|
|
928
|
+
const t = ae(me), e = $(null);
|
|
929
929
|
if (t === void 0) {
|
|
930
930
|
const [n, i] = e;
|
|
931
931
|
return {
|
|
@@ -935,103 +935,7 @@ function xt() {
|
|
|
935
935
|
}
|
|
936
936
|
return t;
|
|
937
937
|
}
|
|
938
|
-
|
|
939
|
-
color: void 0,
|
|
940
|
-
size: void 0,
|
|
941
|
-
className: void 0,
|
|
942
|
-
style: void 0,
|
|
943
|
-
attr: void 0
|
|
944
|
-
}, re = D.createContext && D.createContext(fe), B = function() {
|
|
945
|
-
return B = Object.assign || function(t) {
|
|
946
|
-
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
947
|
-
e = arguments[n];
|
|
948
|
-
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
949
|
-
}
|
|
950
|
-
return t;
|
|
951
|
-
}, B.apply(this, arguments);
|
|
952
|
-
}, kt = function(t, e) {
|
|
953
|
-
var n = {};
|
|
954
|
-
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
955
|
-
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
|
|
956
|
-
e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
|
|
957
|
-
return n;
|
|
958
|
-
};
|
|
959
|
-
function pe(t) {
|
|
960
|
-
return t && t.map(function(e, n) {
|
|
961
|
-
return D.createElement(e.tag, B({
|
|
962
|
-
key: n
|
|
963
|
-
}, e.attr), pe(e.child));
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
function Ae(t) {
|
|
967
|
-
return function(e) {
|
|
968
|
-
return D.createElement(Lt, B({
|
|
969
|
-
attr: B({}, t.attr)
|
|
970
|
-
}, e), pe(t.child));
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
function Lt(t) {
|
|
974
|
-
var e = function(n) {
|
|
975
|
-
var i = t.attr, o = t.size, r = t.title, s = kt(t, ["attr", "size", "title"]), m = o || n.size || "1em", I;
|
|
976
|
-
return n.className && (I = n.className), t.className && (I = (I ? I + " " : "") + t.className), D.createElement("svg", B({
|
|
977
|
-
stroke: "currentColor",
|
|
978
|
-
fill: "currentColor",
|
|
979
|
-
strokeWidth: "0"
|
|
980
|
-
}, n.attr, i, s, {
|
|
981
|
-
className: I,
|
|
982
|
-
style: B(B({
|
|
983
|
-
color: t.color || n.color
|
|
984
|
-
}, n.style), t.style),
|
|
985
|
-
height: m,
|
|
986
|
-
width: m,
|
|
987
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
988
|
-
}), r && D.createElement("title", null, r), t.children);
|
|
989
|
-
};
|
|
990
|
-
return re !== void 0 ? D.createElement(re.Consumer, null, function(n) {
|
|
991
|
-
return e(n);
|
|
992
|
-
}) : e(fe);
|
|
993
|
-
}
|
|
994
|
-
function Wt(t) {
|
|
995
|
-
return Ae({ 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);
|
|
996
|
-
}
|
|
997
|
-
function Ft(t) {
|
|
998
|
-
return Ae({ 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);
|
|
999
|
-
}
|
|
1000
|
-
const Zt = ({
|
|
1001
|
-
lspProps: { lastError: t, reload: e }
|
|
1002
|
-
}) => {
|
|
1003
|
-
const [n, i] = _(!1), o = () => {
|
|
1004
|
-
e();
|
|
1005
|
-
}, r = () => {
|
|
1006
|
-
i(!1);
|
|
1007
|
-
};
|
|
1008
|
-
return V(() => {
|
|
1009
|
-
i(!!t);
|
|
1010
|
-
}, [t]), n ? /* @__PURE__ */ P("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: [
|
|
1011
|
-
/* @__PURE__ */ P("span", { className: "flex flex-1 justify-center gap-1", children: [
|
|
1012
|
-
/* @__PURE__ */ k(Ft, { className: "h-4 w-4 text-yellow-600" }),
|
|
1013
|
-
/* @__PURE__ */ P("span", { children: [
|
|
1014
|
-
"LSP not loaded.",
|
|
1015
|
-
" ",
|
|
1016
|
-
/* @__PURE__ */ k(
|
|
1017
|
-
"button",
|
|
1018
|
-
{
|
|
1019
|
-
className: "text-primary-dark underline",
|
|
1020
|
-
onClick: o,
|
|
1021
|
-
children: "Reload?"
|
|
1022
|
-
}
|
|
1023
|
-
)
|
|
1024
|
-
] })
|
|
1025
|
-
] }),
|
|
1026
|
-
/* @__PURE__ */ k("button", { className: "focus:outline-none", children: /* @__PURE__ */ k(
|
|
1027
|
-
Wt,
|
|
1028
|
-
{
|
|
1029
|
-
className: "h-4 w-4 text-white",
|
|
1030
|
-
onClick: r
|
|
1031
|
-
}
|
|
1032
|
-
) })
|
|
1033
|
-
] }) : null;
|
|
1034
|
-
}, jt = {
|
|
938
|
+
const xt = {
|
|
1035
939
|
provideCompletionItems: (t, e) => {
|
|
1036
940
|
const n = t.getWordUntilPosition(e);
|
|
1037
941
|
return {
|
|
@@ -1059,78 +963,78 @@ const Zt = ({
|
|
|
1059
963
|
]
|
|
1060
964
|
};
|
|
1061
965
|
}
|
|
1062
|
-
},
|
|
1063
|
-
$ref:
|
|
1064
|
-
definitions:
|
|
1065
|
-
},
|
|
1066
|
-
type:
|
|
1067
|
-
items:
|
|
966
|
+
}, kt = "#/definitions/Condition", Lt = { Base: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } }, required: ["id"] }, Condition: { oneOf: [{ $ref: "#/definitions/Datasource" }, { $ref: "#/definitions/Privilege" }, { $ref: "#/definitions/Combination" }, { $ref: "#/definitions/CurrentState" }, { $ref: "#/definitions/ParentState" }, { $ref: "#/definitions/Reference" }] }, Datasource: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "datasource" }, path: { type: "string" }, value: { type: ["number", "string", "boolean", "object", "array", "null"] }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex", "in", "nin", "gt", "gte", "lt", "lte"] } }, required: ["name", "type", "path", "value", "op"] }, Privilege: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "privilege" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Combination: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "combination" }, op: { enum: ["and", "or"] }, conditions: { type: "array", items: { $ref: "#/definitions/Condition" } } }, required: ["type", "conditions", "op"] }, CurrentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "currentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, ParentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "parentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Reference: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "reference" }, ref: { type: "string" } }, required: ["type", "ref"] } }, Wt = {
|
|
967
|
+
$ref: kt,
|
|
968
|
+
definitions: Lt
|
|
969
|
+
}, Ft = "array", Zt = { type: "object", properties: { class: { type: "string" }, method: { type: "string" }, regexPattern: { type: "string" }, verbs: { type: "string" } } }, jt = {
|
|
970
|
+
type: Ft,
|
|
971
|
+
items: Zt
|
|
1068
972
|
};
|
|
1069
|
-
function
|
|
973
|
+
function Xt(t, e) {
|
|
1070
974
|
const n = document.createElement("style");
|
|
1071
975
|
n.dataset.id = e, n.textContent = t, document.head.append(n);
|
|
1072
976
|
}
|
|
1073
|
-
function
|
|
977
|
+
function Et(t) {
|
|
1074
978
|
return Array.from(document.styleSheets).find(
|
|
1075
979
|
(e) => e.ownerNode.getAttribute("data-id") === t
|
|
1076
980
|
);
|
|
1077
981
|
}
|
|
1078
|
-
function
|
|
982
|
+
function Kt(t, e) {
|
|
1079
983
|
const n = [];
|
|
1080
984
|
let i = [];
|
|
1081
|
-
const o = [], r = (a,
|
|
985
|
+
const o = [], r = (a, g, k, L) => {
|
|
1082
986
|
n.push({
|
|
1083
987
|
startLineNumber: a,
|
|
1084
|
-
endLineNumber:
|
|
1085
|
-
startColumn:
|
|
1086
|
-
endColumn:
|
|
1087
|
-
}), h(),
|
|
988
|
+
endLineNumber: k,
|
|
989
|
+
startColumn: g,
|
|
990
|
+
endColumn: L
|
|
991
|
+
}), h(), m();
|
|
1088
992
|
}, s = (a) => {
|
|
1089
993
|
o.indexOf(a) < 0 && o.push(a);
|
|
1090
|
-
},
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
},
|
|
994
|
+
}, p = (a) => {
|
|
995
|
+
const g = o.indexOf(a);
|
|
996
|
+
g < 0 || o.splice(g, 1);
|
|
997
|
+
}, m = () => {
|
|
1094
998
|
for (const a of o)
|
|
1095
999
|
try {
|
|
1096
1000
|
a(i);
|
|
1097
|
-
} catch (
|
|
1098
|
-
console.error(
|
|
1001
|
+
} catch (g) {
|
|
1002
|
+
console.error(g);
|
|
1099
1003
|
}
|
|
1100
1004
|
}, h = () => {
|
|
1101
1005
|
const a = t.getModel();
|
|
1102
|
-
a && (i =
|
|
1103
|
-
n.map((
|
|
1006
|
+
a && (i = Tt(
|
|
1007
|
+
n.map((g) => [
|
|
1104
1008
|
a.getOffsetAt({
|
|
1105
|
-
lineNumber:
|
|
1106
|
-
column:
|
|
1009
|
+
lineNumber: g.startLineNumber,
|
|
1010
|
+
column: g.startColumn
|
|
1107
1011
|
}),
|
|
1108
1012
|
a.getOffsetAt({
|
|
1109
|
-
lineNumber:
|
|
1110
|
-
column:
|
|
1013
|
+
lineNumber: g.endLineNumber,
|
|
1014
|
+
column: g.endColumn
|
|
1111
1015
|
})
|
|
1112
1016
|
]),
|
|
1113
1017
|
/*mergeJoins*/
|
|
1114
1018
|
!0
|
|
1115
1019
|
), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >= a.getValueLength() && (i[i.length - 1][1] = Number.POSITIVE_INFINITY)));
|
|
1116
1020
|
}, C = (a) => {
|
|
1117
|
-
const
|
|
1021
|
+
const g = {
|
|
1118
1022
|
isDeletion: !1,
|
|
1119
1023
|
isAddition: !1,
|
|
1120
1024
|
isReplacement: !1
|
|
1121
1025
|
};
|
|
1122
|
-
return a.text === "" ?
|
|
1123
|
-
},
|
|
1124
|
-
h(),
|
|
1125
|
-
}),
|
|
1026
|
+
return a.text === "" ? g.isDeletion = !0 : a.range.startLineNumber === a.range.endLineNumber && a.range.startColumn === a.range.endColumn ? g.isAddition = !0 : g.isReplacement = !0, g;
|
|
1027
|
+
}, A = t.onDidChangeModel((a) => {
|
|
1028
|
+
h(), d();
|
|
1029
|
+
}), f = t.onDidChangeModelContent((a) => {
|
|
1126
1030
|
if (!a.isUndoing)
|
|
1127
|
-
for (const
|
|
1128
|
-
const
|
|
1129
|
-
if (
|
|
1130
|
-
const
|
|
1131
|
-
(v) =>
|
|
1132
|
-
), T = !
|
|
1133
|
-
if (
|
|
1031
|
+
for (const g of a.changes) {
|
|
1032
|
+
const k = C(g);
|
|
1033
|
+
if (k.isReplacement || k.isDeletion || k.isAddition) {
|
|
1034
|
+
const L = n.some(
|
|
1035
|
+
(v) => g.range.startLineNumber >= v.startLineNumber && g.range.endLineNumber <= v.endLineNumber && g.range.startColumn >= v.startColumn && g.range.endColumn <= v.endColumn
|
|
1036
|
+
), T = !L && e && g.range.startLineNumber === 1 && g.range.startColumn === 1 && !ge(g.text);
|
|
1037
|
+
if (L || T) {
|
|
1134
1038
|
const v = t.getModel();
|
|
1135
1039
|
if (v) {
|
|
1136
1040
|
v.undo();
|
|
@@ -1139,10 +1043,10 @@ function Jt(t, e) {
|
|
|
1139
1043
|
}
|
|
1140
1044
|
}
|
|
1141
1045
|
}
|
|
1142
|
-
}),
|
|
1143
|
-
|
|
1046
|
+
}), x = () => {
|
|
1047
|
+
A.dispose(), f.dispose();
|
|
1144
1048
|
};
|
|
1145
|
-
let
|
|
1049
|
+
let R = [], S = `
|
|
1146
1050
|
.idoc-readonly-mark {
|
|
1147
1051
|
cursor: not-allowed;
|
|
1148
1052
|
z-index: 1;
|
|
@@ -1150,26 +1054,26 @@ function Jt(t, e) {
|
|
|
1150
1054
|
`;
|
|
1151
1055
|
if (S) {
|
|
1152
1056
|
const a = "monaco-read-only";
|
|
1153
|
-
|
|
1057
|
+
Et(a) || Xt(S, a), S = null;
|
|
1154
1058
|
}
|
|
1155
|
-
const
|
|
1156
|
-
s(
|
|
1059
|
+
const y = () => {
|
|
1060
|
+
s(d), d();
|
|
1157
1061
|
}, b = () => {
|
|
1158
|
-
|
|
1159
|
-
},
|
|
1062
|
+
p(d), R = t.deltaDecorations(R, []);
|
|
1063
|
+
}, d = () => {
|
|
1160
1064
|
const a = t.getModel();
|
|
1161
|
-
a && (
|
|
1162
|
-
|
|
1163
|
-
i.map(
|
|
1065
|
+
a && (R = t.deltaDecorations(
|
|
1066
|
+
R,
|
|
1067
|
+
i.map(F(a))
|
|
1164
1068
|
));
|
|
1165
|
-
},
|
|
1166
|
-
const
|
|
1069
|
+
}, F = (a) => (g) => {
|
|
1070
|
+
const k = a.getPositionAt(g[0]), L = a.getPositionAt(g[1]);
|
|
1167
1071
|
return {
|
|
1168
1072
|
range: new l.Range(
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1073
|
+
k.lineNumber,
|
|
1074
|
+
k.column,
|
|
1075
|
+
L.lineNumber,
|
|
1076
|
+
L.column
|
|
1173
1077
|
),
|
|
1174
1078
|
options: {
|
|
1175
1079
|
className: "idoc-readonly-mark"
|
|
@@ -1182,66 +1086,66 @@ function Jt(t, e) {
|
|
|
1182
1086
|
},
|
|
1183
1087
|
exclude: r,
|
|
1184
1088
|
attach: s,
|
|
1185
|
-
detach:
|
|
1186
|
-
dispose:
|
|
1187
|
-
show:
|
|
1089
|
+
detach: p,
|
|
1090
|
+
dispose: x,
|
|
1091
|
+
show: y,
|
|
1188
1092
|
hide: b
|
|
1189
1093
|
};
|
|
1190
1094
|
}
|
|
1191
|
-
function
|
|
1095
|
+
function Bt(t, e, n) {
|
|
1192
1096
|
let i = !1;
|
|
1193
|
-
const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((
|
|
1097
|
+
const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((d) => d[1] > d[0] ? p(d) : d).reverse() : b;
|
|
1194
1098
|
let s;
|
|
1195
|
-
const
|
|
1196
|
-
let h, C,
|
|
1197
|
-
|
|
1099
|
+
const p = (b) => (s = b[1], b[1] = b[0], b[0] = s, b), m = o(t);
|
|
1100
|
+
let h, C, A, f, x, R, S, y;
|
|
1101
|
+
A = m[0];
|
|
1198
1102
|
for (C of e)
|
|
1199
|
-
for (S = C[0],
|
|
1200
|
-
if (
|
|
1201
|
-
|
|
1202
|
-
[
|
|
1203
|
-
[
|
|
1103
|
+
for (S = C[0], y = C[1], f = 0; f < m.length; f++) {
|
|
1104
|
+
if (A = m[f], x = A[0], R = A[1], x < S)
|
|
1105
|
+
R < S ? h = [A] : R <= y ? h = [[x, S - 1]] : h = [
|
|
1106
|
+
[x, S - 1],
|
|
1107
|
+
[y + 1, R]
|
|
1204
1108
|
];
|
|
1205
|
-
else if (
|
|
1109
|
+
else if (x <= y)
|
|
1206
1110
|
if (S === Number.NEGATIVE_INFINITY) {
|
|
1207
|
-
const b =
|
|
1208
|
-
h = n === 0 ? [] : [[b,
|
|
1209
|
-
} else
|
|
1111
|
+
const b = y + 1;
|
|
1112
|
+
h = n === 0 ? [] : [[b, R > b ? R : b]];
|
|
1113
|
+
} else y === Number.POSITIVE_INFINITY ? h = n === 0 ? [] : [[S - 1, S - 1]] : R <= y ? h = n < 0 ? [[S - 1, S - 1]] : n > 0 ? [[y + 1, y + 1]] : [] : h = [[y + 1, R]];
|
|
1210
1114
|
else
|
|
1211
|
-
h = [
|
|
1212
|
-
if (
|
|
1115
|
+
h = [A];
|
|
1116
|
+
if (m.splice(f, 1, ...h), m.length === 1 && m[0][1] < S) return r(m);
|
|
1213
1117
|
}
|
|
1214
|
-
return r(
|
|
1118
|
+
return r(m);
|
|
1215
1119
|
}
|
|
1216
|
-
function
|
|
1120
|
+
function Tt(t, e) {
|
|
1217
1121
|
if (t.length < 2) return t;
|
|
1218
1122
|
const n = [];
|
|
1219
1123
|
let i = null, o, r;
|
|
1220
1124
|
t = t.map(
|
|
1221
1125
|
(s) => (s[1] < s[0] && (o = s[1], s[1] = s[0], s[1] = o), s)
|
|
1222
|
-
).sort((s,
|
|
1126
|
+
).sort((s, p) => s[0] - p[0]), n.push(t[0]);
|
|
1223
1127
|
for (let s = 1; s < t.length; s++)
|
|
1224
1128
|
i = n[n.length - 1], r = t[s], i[1] === r[0] && !e || (i[1] === r[0] - 1 && e ? (i[1] = r[1], n.splice(n.length - 1, 1, i)) : i[1] < r[0] ? n.push(r) : i[1] < r[1] && (i[1] = r[1], n.splice(n.length - 1, 1, i)));
|
|
1225
1129
|
return n;
|
|
1226
1130
|
}
|
|
1227
|
-
function
|
|
1131
|
+
function Y(t, e) {
|
|
1228
1132
|
return e.bind(t);
|
|
1229
1133
|
}
|
|
1230
|
-
class
|
|
1134
|
+
class Ot {
|
|
1231
1135
|
constructor(e, n) {
|
|
1232
1136
|
var i;
|
|
1233
|
-
this.disposables = [], this.prefer = 1, this.lastPrefer = 1, this.onCursor =
|
|
1137
|
+
this.disposables = [], this.prefer = 1, this.lastPrefer = 1, this.onCursor = Y(
|
|
1234
1138
|
this,
|
|
1235
1139
|
function(o) {
|
|
1236
1140
|
if (o.source === "api") return;
|
|
1237
1141
|
const r = this.getApprovedSelections();
|
|
1238
1142
|
r.length !== 0 && this.editor.setSelections(r);
|
|
1239
1143
|
}
|
|
1240
|
-
), this.onRectangleSelectionStart =
|
|
1144
|
+
), this.onRectangleSelectionStart = Y(this, function({ event: o }) {
|
|
1241
1145
|
o.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
|
|
1242
|
-
}), this.onRectangleSelectionStop =
|
|
1146
|
+
}), this.onRectangleSelectionStop = Y(this, function() {
|
|
1243
1147
|
this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
|
|
1244
|
-
}), this.onKey =
|
|
1148
|
+
}), this.onKey = Y(this, function(o) {
|
|
1245
1149
|
const r = o.keyCode, s = l.KeyCode;
|
|
1246
1150
|
if (o.altKey || s.F1 <= r && r <= s.F19 || o.ctrlKey && r !== s.Backspace) return;
|
|
1247
1151
|
if (r === s.UpArrow || r === s.LeftArrow || r === s.Home || r === s.PageUp) {
|
|
@@ -1252,21 +1156,21 @@ class Vt {
|
|
|
1252
1156
|
this.prefer = 1;
|
|
1253
1157
|
return;
|
|
1254
1158
|
}
|
|
1255
|
-
const
|
|
1159
|
+
const p = this.getSelections(), m = this.intervals.buffer;
|
|
1256
1160
|
let h;
|
|
1257
1161
|
if (r === s.Delete)
|
|
1258
|
-
h = (C) => C[0] === C[1] &&
|
|
1162
|
+
h = (C) => C[0] === C[1] && m.find((A) => C[1] + 1 === A[0]) != null;
|
|
1259
1163
|
else if (r === s.Backspace)
|
|
1260
|
-
h = (C) => C[0] === C[1] &&
|
|
1164
|
+
h = (C) => C[0] === C[1] && m.find((A) => A[1] + 1 === C[0]) != null;
|
|
1261
1165
|
else
|
|
1262
1166
|
return;
|
|
1263
|
-
|
|
1264
|
-
}), this.getOffsetAt =
|
|
1167
|
+
p.findIndex(h) !== -1 && (o.stopPropagation(), o.preventDefault());
|
|
1168
|
+
}), this.getOffsetAt = Y(this, function(o) {
|
|
1265
1169
|
let r;
|
|
1266
1170
|
for (let s = 0; s < this.intervals.buffer.length; s++)
|
|
1267
1171
|
if (r = this.intervals.buffer[s], o <= r[1])
|
|
1268
1172
|
return r[0] - o < o - r[1] ? r[0] : r[1];
|
|
1269
|
-
}), this.editor = e, this.intervals =
|
|
1173
|
+
}), this.editor = e, this.intervals = Kt(e, n), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
|
|
1270
1174
|
}
|
|
1271
1175
|
enable() {
|
|
1272
1176
|
this.disposables.push(
|
|
@@ -1285,7 +1189,7 @@ class Vt {
|
|
|
1285
1189
|
getApprovedSelections() {
|
|
1286
1190
|
const e = this.editor.getModel();
|
|
1287
1191
|
return this.getSelections().map(
|
|
1288
|
-
(i) =>
|
|
1192
|
+
(i) => Bt(
|
|
1289
1193
|
i,
|
|
1290
1194
|
this.intervals.buffer,
|
|
1291
1195
|
this.prefer
|
|
@@ -1314,28 +1218,28 @@ class Vt {
|
|
|
1314
1218
|
]);
|
|
1315
1219
|
}
|
|
1316
1220
|
}
|
|
1317
|
-
const
|
|
1221
|
+
const Dt = new RegExp("^[ s]+(exposed|Function)", "i"), Gt = ({
|
|
1318
1222
|
lineNumber: t,
|
|
1319
1223
|
editor: e,
|
|
1320
1224
|
type: n,
|
|
1321
1225
|
source: i
|
|
1322
1226
|
}) => {
|
|
1323
1227
|
var h;
|
|
1324
|
-
const o = n === ie.METHOD || n === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) ===
|
|
1228
|
+
const o = n === ie.METHOD || n === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) === xe.METHOD;
|
|
1325
1229
|
if (t === 1)
|
|
1326
1230
|
return o ? "" : "1";
|
|
1327
|
-
const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [],
|
|
1328
|
-
let
|
|
1231
|
+
const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [], p = Array(s.length).fill("-");
|
|
1232
|
+
let m = o ? 0 : 1;
|
|
1329
1233
|
for (let C = 1; C < s.length; C++)
|
|
1330
|
-
(C === 1 ? "" : s[C - 1]).endsWith("\\") || (
|
|
1331
|
-
return
|
|
1332
|
-
},
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
] }) }) }), ne = ["fd-dark"],
|
|
1234
|
+
(C === 1 ? "" : s[C - 1]).endsWith("\\") || (m += 1, p[C] = m.toString());
|
|
1235
|
+
return p[t - 1];
|
|
1236
|
+
}, re = () => /* @__PURE__ */ w("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ w("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ z("div", { className: "space-y-2", children: [
|
|
1237
|
+
/* @__PURE__ */ w("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
|
|
1238
|
+
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1239
|
+
/* @__PURE__ */ w("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
|
|
1240
|
+
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1241
|
+
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" })
|
|
1242
|
+
] }) }) }), ne = ["fd-dark"], kn = ({
|
|
1339
1243
|
path: t,
|
|
1340
1244
|
initialValue: e,
|
|
1341
1245
|
type: n,
|
|
@@ -1343,99 +1247,192 @@ const Yt = new RegExp("^[ s]+(exposed|Function)", "i"), Ht = ({
|
|
|
1343
1247
|
onChange: o,
|
|
1344
1248
|
options: r = {},
|
|
1345
1249
|
extra: s = {},
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
...C
|
|
1250
|
+
lspProps: p,
|
|
1251
|
+
theme: m = ne[0],
|
|
1252
|
+
...h
|
|
1350
1253
|
}) => {
|
|
1351
|
-
const { initialLineInfo:
|
|
1352
|
-
function
|
|
1353
|
-
i === "css" &&
|
|
1254
|
+
const { initialLineInfo: C, initialSelectionInfo: A } = s, { editor: f, setEditor: x } = wt(), { inited: R } = p;
|
|
1255
|
+
function S(d) {
|
|
1256
|
+
i === "css" && d.languages.registerCompletionItemProvider("css", xt), i === "json" && d.languages.json && d.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1354
1257
|
validate: !0,
|
|
1355
1258
|
schemas: [
|
|
1356
1259
|
{
|
|
1357
1260
|
uri: "condition-schema.json",
|
|
1358
1261
|
fileMatch: ["*.condition.json"],
|
|
1359
|
-
schema:
|
|
1262
|
+
schema: Wt
|
|
1360
1263
|
},
|
|
1361
1264
|
{
|
|
1362
1265
|
uri: "handlers-schema.json",
|
|
1363
|
-
fileMatch: [
|
|
1364
|
-
schema:
|
|
1266
|
+
fileMatch: [ke],
|
|
1267
|
+
schema: jt
|
|
1365
1268
|
}
|
|
1366
1269
|
]
|
|
1367
1270
|
});
|
|
1368
1271
|
}
|
|
1369
|
-
function
|
|
1370
|
-
x(
|
|
1371
|
-
const
|
|
1372
|
-
if (
|
|
1373
|
-
var
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1272
|
+
function y(d, F) {
|
|
1273
|
+
x(d);
|
|
1274
|
+
const a = d.getModel();
|
|
1275
|
+
if (a && (a.updateOptions({ insertSpaces: !1 }), d.onKeyUp(() => {
|
|
1276
|
+
var k;
|
|
1277
|
+
const g = (k = d.getPosition()) == null ? void 0 : k.lineNumber;
|
|
1278
|
+
if (g) {
|
|
1279
|
+
const L = a.getLineFirstNonWhitespaceColumn(g), T = a.getLineLength(g), v = a.getLineContent(g);
|
|
1280
|
+
Dt.test(v) && d.executeEdits("edit-handler", [
|
|
1378
1281
|
{
|
|
1379
|
-
range: new
|
|
1380
|
-
|
|
1282
|
+
range: new F.Range(
|
|
1283
|
+
g,
|
|
1381
1284
|
0,
|
|
1382
|
-
|
|
1383
|
-
|
|
1285
|
+
g,
|
|
1286
|
+
T
|
|
1384
1287
|
),
|
|
1385
|
-
text:
|
|
1386
|
-
|
|
1387
|
-
|
|
1288
|
+
text: v.substr(
|
|
1289
|
+
L - 1,
|
|
1290
|
+
T - L
|
|
1388
1291
|
)
|
|
1389
1292
|
}
|
|
1390
1293
|
]);
|
|
1391
1294
|
}
|
|
1392
1295
|
})), n === ie.METHOD && ge(e)) {
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1296
|
+
const g = new Ot(d, !0);
|
|
1297
|
+
g.exclude(1, 1, 1, Number.POSITIVE_INFINITY), g.enable();
|
|
1395
1298
|
}
|
|
1396
1299
|
}
|
|
1397
|
-
|
|
1398
|
-
if (!
|
|
1399
|
-
const { line:
|
|
1400
|
-
|
|
1401
|
-
}, [
|
|
1402
|
-
if (!
|
|
1403
|
-
const { selection:
|
|
1404
|
-
|
|
1405
|
-
}, [A,
|
|
1406
|
-
const
|
|
1407
|
-
return
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1300
|
+
M(() => {
|
|
1301
|
+
if (!f) return;
|
|
1302
|
+
const { line: d, offset: F } = C || {};
|
|
1303
|
+
d && pt(f, d, F);
|
|
1304
|
+
}, [C, f]), M(() => {
|
|
1305
|
+
if (!f) return;
|
|
1306
|
+
const { selection: d } = A || {};
|
|
1307
|
+
d && ft(f, d);
|
|
1308
|
+
}, [A, f]);
|
|
1309
|
+
const b = (d) => ne.includes(d) ? d : ne[0];
|
|
1310
|
+
return R ? /* @__PURE__ */ w(
|
|
1311
|
+
Re,
|
|
1312
|
+
{
|
|
1313
|
+
options: {
|
|
1314
|
+
readOnly: !0,
|
|
1315
|
+
fontSize: 12,
|
|
1316
|
+
"semanticHighlighting.enabled": !0,
|
|
1317
|
+
padding: { top: 10 },
|
|
1318
|
+
lineNumbers: i === "4d" ? (d) => Gt({
|
|
1319
|
+
lineNumber: d,
|
|
1320
|
+
editor: f,
|
|
1321
|
+
type: n,
|
|
1322
|
+
source: s == null ? void 0 : s.source
|
|
1323
|
+
}) : void 0,
|
|
1324
|
+
scrollBeyondLastLine: !1,
|
|
1325
|
+
...r
|
|
1326
|
+
},
|
|
1327
|
+
path: j(t),
|
|
1328
|
+
value: e,
|
|
1329
|
+
theme: b(m),
|
|
1330
|
+
onChange: (d) => o && o(d || ""),
|
|
1331
|
+
language: i,
|
|
1332
|
+
beforeMount: S,
|
|
1333
|
+
onMount: y,
|
|
1334
|
+
loading: /* @__PURE__ */ w(re, {}),
|
|
1335
|
+
...h
|
|
1336
|
+
}
|
|
1337
|
+
) : /* @__PURE__ */ w("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ w(re, {}) });
|
|
1338
|
+
};
|
|
1339
|
+
var fe = {
|
|
1340
|
+
color: void 0,
|
|
1341
|
+
size: void 0,
|
|
1342
|
+
className: void 0,
|
|
1343
|
+
style: void 0,
|
|
1344
|
+
attr: void 0
|
|
1345
|
+
}, se = O.createContext && O.createContext(fe), B = function() {
|
|
1346
|
+
return B = Object.assign || function(t) {
|
|
1347
|
+
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
1348
|
+
e = arguments[n];
|
|
1349
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
|
|
1350
|
+
}
|
|
1351
|
+
return t;
|
|
1352
|
+
}, B.apply(this, arguments);
|
|
1353
|
+
}, Jt = function(t, e) {
|
|
1354
|
+
var n = {};
|
|
1355
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
1356
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(t); o < i.length; o++)
|
|
1357
|
+
e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[o]) && (n[i[o]] = t[i[o]]);
|
|
1358
|
+
return n;
|
|
1359
|
+
};
|
|
1360
|
+
function pe(t) {
|
|
1361
|
+
return t && t.map(function(e, n) {
|
|
1362
|
+
return O.createElement(e.tag, B({
|
|
1363
|
+
key: n
|
|
1364
|
+
}, e.attr), pe(e.child));
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
function Ae(t) {
|
|
1368
|
+
return function(e) {
|
|
1369
|
+
return O.createElement(Mt, B({
|
|
1370
|
+
attr: B({}, t.attr)
|
|
1371
|
+
}, e), pe(t.child));
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function Mt(t) {
|
|
1375
|
+
var e = function(n) {
|
|
1376
|
+
var i = t.attr, o = t.size, r = t.title, s = Jt(t, ["attr", "size", "title"]), p = o || n.size || "1em", m;
|
|
1377
|
+
return n.className && (m = n.className), t.className && (m = (m ? m + " " : "") + t.className), O.createElement("svg", B({
|
|
1378
|
+
stroke: "currentColor",
|
|
1379
|
+
fill: "currentColor",
|
|
1380
|
+
strokeWidth: "0"
|
|
1381
|
+
}, n.attr, i, s, {
|
|
1382
|
+
className: m,
|
|
1383
|
+
style: B(B({
|
|
1384
|
+
color: t.color || n.color
|
|
1385
|
+
}, n.style), t.style),
|
|
1386
|
+
height: p,
|
|
1387
|
+
width: p,
|
|
1388
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1389
|
+
}), r && O.createElement("title", null, r), t.children);
|
|
1390
|
+
};
|
|
1391
|
+
return se !== void 0 ? O.createElement(se.Consumer, null, function(n) {
|
|
1392
|
+
return e(n);
|
|
1393
|
+
}) : e(fe);
|
|
1394
|
+
}
|
|
1395
|
+
function Pt(t) {
|
|
1396
|
+
return Ae({ 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);
|
|
1397
|
+
}
|
|
1398
|
+
function Vt(t) {
|
|
1399
|
+
return Ae({ 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);
|
|
1400
|
+
}
|
|
1401
|
+
const Ln = ({
|
|
1402
|
+
lspProps: { lastError: t, reload: e }
|
|
1403
|
+
}) => {
|
|
1404
|
+
const [n, i] = $(!1), o = () => {
|
|
1405
|
+
e();
|
|
1406
|
+
}, r = () => {
|
|
1407
|
+
i(!1);
|
|
1408
|
+
};
|
|
1409
|
+
return M(() => {
|
|
1410
|
+
i(!!t);
|
|
1411
|
+
}, [t]), n ? /* @__PURE__ */ z("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: [
|
|
1412
|
+
/* @__PURE__ */ z("span", { className: "flex flex-1 justify-center gap-1", children: [
|
|
1413
|
+
/* @__PURE__ */ w(Vt, { className: "h-4 w-4 text-yellow-600" }),
|
|
1414
|
+
/* @__PURE__ */ z("span", { children: [
|
|
1415
|
+
"LSP not loaded.",
|
|
1416
|
+
" ",
|
|
1417
|
+
/* @__PURE__ */ w(
|
|
1418
|
+
"button",
|
|
1419
|
+
{
|
|
1420
|
+
className: "text-primary-dark underline",
|
|
1421
|
+
onClick: o,
|
|
1422
|
+
children: "Reload?"
|
|
1423
|
+
}
|
|
1424
|
+
)
|
|
1425
|
+
] })
|
|
1426
|
+
] }),
|
|
1427
|
+
/* @__PURE__ */ w("button", { className: "focus:outline-none", children: /* @__PURE__ */ w(
|
|
1428
|
+
Pt,
|
|
1411
1429
|
{
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
fontSize: 12,
|
|
1415
|
-
"semanticHighlighting.enabled": !0,
|
|
1416
|
-
padding: { top: 10 },
|
|
1417
|
-
lineNumbers: i === "4d" ? (p) => Ht({
|
|
1418
|
-
lineNumber: p,
|
|
1419
|
-
editor: N,
|
|
1420
|
-
type: n,
|
|
1421
|
-
source: s == null ? void 0 : s.source
|
|
1422
|
-
}) : void 0,
|
|
1423
|
-
scrollBeyondLastLine: !1,
|
|
1424
|
-
...r
|
|
1425
|
-
},
|
|
1426
|
-
path: j(t),
|
|
1427
|
-
value: e,
|
|
1428
|
-
theme: L(h),
|
|
1429
|
-
onChange: (p) => o && o(p || ""),
|
|
1430
|
-
language: i,
|
|
1431
|
-
beforeMount: R,
|
|
1432
|
-
onMount: b,
|
|
1433
|
-
loading: /* @__PURE__ */ k(se, {}),
|
|
1434
|
-
...C
|
|
1430
|
+
className: "h-4 w-4 text-white",
|
|
1431
|
+
onClick: r
|
|
1435
1432
|
}
|
|
1436
|
-
)
|
|
1437
|
-
] }) :
|
|
1438
|
-
},
|
|
1433
|
+
) })
|
|
1434
|
+
] }) : null;
|
|
1435
|
+
}, Yt = {
|
|
1439
1436
|
name: "4d",
|
|
1440
1437
|
displayName: "%displayName%",
|
|
1441
1438
|
description: "%description%",
|
|
@@ -1460,7 +1457,7 @@ const Yt = new RegExp("^[ s]+(exposed|Function)", "i"), Ht = ({
|
|
|
1460
1457
|
}
|
|
1461
1458
|
]
|
|
1462
1459
|
}
|
|
1463
|
-
}, { registerFileUrl: q, whenReady:
|
|
1460
|
+
}, { registerFileUrl: q, whenReady: Wn } = lt(Yt, void 0, {
|
|
1464
1461
|
system: !0
|
|
1465
1462
|
});
|
|
1466
1463
|
q(
|
|
@@ -1484,20 +1481,20 @@ q(
|
|
|
1484
1481
|
{ mimeType: "application/json", size: 135 }
|
|
1485
1482
|
);
|
|
1486
1483
|
export {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1484
|
+
Ln as Alerts,
|
|
1485
|
+
kn as CodeEditor,
|
|
1486
|
+
xn as CodeEditorProvider,
|
|
1487
|
+
Gt as FdLineNumbers,
|
|
1488
|
+
Rn as LSPProvider,
|
|
1492
1489
|
ne as SUPPORTED_THEMES,
|
|
1493
1490
|
ue as _await,
|
|
1494
|
-
|
|
1491
|
+
It as configureServices,
|
|
1495
1492
|
j as getFileSystemPath,
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1493
|
+
Nn as getFunctionOffset,
|
|
1494
|
+
dt as initMonacoUserConfiguration,
|
|
1495
|
+
pt as jumpToLine,
|
|
1496
|
+
ft as jumpToSelection,
|
|
1497
|
+
wt as useCodeEditor,
|
|
1498
|
+
wn as useLSP
|
|
1502
1499
|
};
|
|
1503
1500
|
//# sourceMappingURL=index.es.js.map
|