@ws-ui/code-editor 0.1.19 → 0.1.20
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/schemas/condition.schema.json.d.ts +21 -6
- package/dist/index.cjs.js +9 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +207 -146
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -4,8 +4,8 @@ var Y = (r, n, t) => (jt(r, typeof n != "symbol" ? n + "" : n, t), t);
|
|
|
4
4
|
import z, { useEffect as J, createContext as Qe, useState as oe, useRef as Ue, useContext as et, memo as kt } from "react";
|
|
5
5
|
import { loader as At, useMonaco as Dt, Editor as Lt } from "@monaco-editor/react";
|
|
6
6
|
import { getMonacoTheme as $t, lspSubject as Ft, LspActions as G, hasAttributesString as tt, FileFolderType as Mt } from "@ws-ui/shared";
|
|
7
|
-
import { initServices as Wt, MonacoLanguageClient as
|
|
8
|
-
import { ErrorAction as
|
|
7
|
+
import { initServices as Wt, MonacoLanguageClient as qt } from "monaco-languageclient";
|
|
8
|
+
import { ErrorAction as Kt, CloseAction as Yt } from "vscode-languageclient";
|
|
9
9
|
import * as c from "monaco-editor";
|
|
10
10
|
import { Selection as Ut, KeyMod as Q, KeyCode as ee, editor as nt, Uri as Vt } from "monaco-editor";
|
|
11
11
|
import { WebSocketMessageReader as Bt, WebSocketMessageWriter as zt, toSocket as Gt } from "vscode-ws-jsonrpc";
|
|
@@ -35,12 +35,12 @@ function rt() {
|
|
|
35
35
|
var u = new String("abc");
|
|
36
36
|
if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5")
|
|
37
37
|
return !1;
|
|
38
|
-
for (var
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
return
|
|
38
|
+
for (var d = {}, l = 0; l < 10; l++)
|
|
39
|
+
d["_" + String.fromCharCode(l)] = l;
|
|
40
|
+
var f = Object.getOwnPropertyNames(d).map(function(b) {
|
|
41
|
+
return d[b];
|
|
42
42
|
});
|
|
43
|
-
if (
|
|
43
|
+
if (f.join("") !== "0123456789")
|
|
44
44
|
return !1;
|
|
45
45
|
var h = {};
|
|
46
46
|
return "abcdefghijklmnopqrst".split("").forEach(function(b) {
|
|
@@ -50,18 +50,18 @@ function rt() {
|
|
|
50
50
|
return !1;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return Ce = s() ? Object.assign : function(u,
|
|
54
|
-
for (var l,
|
|
53
|
+
return Ce = s() ? Object.assign : function(u, d) {
|
|
54
|
+
for (var l, f = i(u), h, b = 1; b < arguments.length; b++) {
|
|
55
55
|
l = Object(arguments[b]);
|
|
56
|
-
for (var
|
|
57
|
-
n.call(l,
|
|
56
|
+
for (var y in l)
|
|
57
|
+
n.call(l, y) && (f[y] = l[y]);
|
|
58
58
|
if (r) {
|
|
59
59
|
h = r(l);
|
|
60
60
|
for (var v = 0; v < h.length; v++)
|
|
61
|
-
t.call(l, h[v]) && (
|
|
61
|
+
t.call(l, h[v]) && (f[h[v]] = l[h[v]]);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return
|
|
64
|
+
return f;
|
|
65
65
|
}, Ce;
|
|
66
66
|
}
|
|
67
67
|
/** @license React v17.0.2
|
|
@@ -83,17 +83,17 @@ function on() {
|
|
|
83
83
|
n = t("react.element"), te.Fragment = t("react.fragment");
|
|
84
84
|
}
|
|
85
85
|
var i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = Object.prototype.hasOwnProperty, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
86
|
-
function
|
|
87
|
-
var b,
|
|
88
|
-
h !== void 0 && (v = "" + h),
|
|
89
|
-
for (b in
|
|
90
|
-
s.call(
|
|
86
|
+
function d(l, f, h) {
|
|
87
|
+
var b, y = {}, v = null, N = null;
|
|
88
|
+
h !== void 0 && (v = "" + h), f.key !== void 0 && (v = "" + f.key), f.ref !== void 0 && (N = f.ref);
|
|
89
|
+
for (b in f)
|
|
90
|
+
s.call(f, b) && !u.hasOwnProperty(b) && (y[b] = f[b]);
|
|
91
91
|
if (l && l.defaultProps)
|
|
92
|
-
for (b in
|
|
93
|
-
|
|
94
|
-
return { $$typeof: n, type: l, key: v, ref: N, props:
|
|
92
|
+
for (b in f = l.defaultProps, f)
|
|
93
|
+
y[b] === void 0 && (y[b] = f[b]);
|
|
94
|
+
return { $$typeof: n, type: l, key: v, ref: N, props: y, _owner: i.current };
|
|
95
95
|
}
|
|
96
|
-
return te.jsx =
|
|
96
|
+
return te.jsx = d, te.jsxs = d, te;
|
|
97
97
|
}
|
|
98
98
|
var Ee = {};
|
|
99
99
|
/** @license React v17.0.2
|
|
@@ -110,10 +110,10 @@ function an() {
|
|
|
110
110
|
process.env.NODE_ENV !== "production" && function() {
|
|
111
111
|
var n = z, t = rt(), i = 60103, s = 60106;
|
|
112
112
|
r.Fragment = 60107;
|
|
113
|
-
var u = 60108,
|
|
113
|
+
var u = 60108, d = 60114, l = 60109, f = 60110, h = 60112, b = 60113, y = 60120, v = 60115, N = 60116, k = 60121, P = 60122, $ = 60117, _ = 60129, E = 60131;
|
|
114
114
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
115
|
-
var
|
|
116
|
-
i =
|
|
115
|
+
var S = Symbol.for;
|
|
116
|
+
i = S("react.element"), s = S("react.portal"), r.Fragment = S("react.fragment"), u = S("react.strict_mode"), d = S("react.profiler"), l = S("react.provider"), f = S("react.context"), h = S("react.forward_ref"), b = S("react.suspense"), y = S("react.suspense_list"), v = S("react.memo"), N = S("react.lazy"), k = S("react.block"), P = S("react.server.block"), $ = S("react.fundamental"), S("react.scope"), S("react.opaque.id"), _ = S("react.debug_trace_mode"), S("react.offscreen"), E = S("react.legacy_hidden");
|
|
117
117
|
}
|
|
118
118
|
var g = typeof Symbol == "function" && Symbol.iterator, p = "@@iterator";
|
|
119
119
|
function M(e) {
|
|
@@ -127,10 +127,10 @@ function an() {
|
|
|
127
127
|
{
|
|
128
128
|
for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), m = 1; m < o; m++)
|
|
129
129
|
a[m - 1] = arguments[m];
|
|
130
|
-
|
|
130
|
+
K("error", e, a);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function K(e, o, a) {
|
|
134
134
|
{
|
|
135
135
|
var m = F.ReactDebugCurrentFrame, T = m.getStackAddendum();
|
|
136
136
|
T !== "" && (o += "%s", a = a.concat([T]));
|
|
@@ -142,7 +142,7 @@ function an() {
|
|
|
142
142
|
}
|
|
143
143
|
var ce = !1;
|
|
144
144
|
function x(e) {
|
|
145
|
-
return !!(typeof e == "string" || typeof e == "function" || e === r.Fragment || e ===
|
|
145
|
+
return !!(typeof e == "string" || typeof e == "function" || e === r.Fragment || e === d || e === _ || e === u || e === b || e === y || e === E || ce || typeof e == "object" && e !== null && (e.$$typeof === N || e.$$typeof === v || e.$$typeof === l || e.$$typeof === f || e.$$typeof === h || e.$$typeof === $ || e.$$typeof === k || e[0] === P));
|
|
146
146
|
}
|
|
147
147
|
function I(e, o, a) {
|
|
148
148
|
var m = o.displayName || o.name || "";
|
|
@@ -163,18 +163,18 @@ function an() {
|
|
|
163
163
|
return "Fragment";
|
|
164
164
|
case s:
|
|
165
165
|
return "Portal";
|
|
166
|
-
case
|
|
166
|
+
case d:
|
|
167
167
|
return "Profiler";
|
|
168
168
|
case u:
|
|
169
169
|
return "StrictMode";
|
|
170
170
|
case b:
|
|
171
171
|
return "Suspense";
|
|
172
|
-
case
|
|
172
|
+
case y:
|
|
173
173
|
return "SuspenseList";
|
|
174
174
|
}
|
|
175
175
|
if (typeof e == "object")
|
|
176
176
|
switch (e.$$typeof) {
|
|
177
|
-
case
|
|
177
|
+
case f:
|
|
178
178
|
var o = e;
|
|
179
179
|
return w(o) + ".Consumer";
|
|
180
180
|
case l:
|
|
@@ -197,14 +197,14 @@ function an() {
|
|
|
197
197
|
}
|
|
198
198
|
return null;
|
|
199
199
|
}
|
|
200
|
-
var ne = 0,
|
|
200
|
+
var ne = 0, ye, Se, we, _e, Ie, Te, Oe;
|
|
201
201
|
function Ne() {
|
|
202
202
|
}
|
|
203
203
|
Ne.__reactDisabledLog = !0;
|
|
204
204
|
function ct() {
|
|
205
205
|
{
|
|
206
206
|
if (ne === 0) {
|
|
207
|
-
|
|
207
|
+
ye = console.log, Se = console.info, we = console.warn, _e = console.error, Ie = console.group, Te = console.groupCollapsed, Oe = console.groupEnd;
|
|
208
208
|
var e = {
|
|
209
209
|
configurable: !0,
|
|
210
210
|
enumerable: !0,
|
|
@@ -224,7 +224,7 @@ function an() {
|
|
|
224
224
|
ne++;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function dt() {
|
|
228
228
|
{
|
|
229
229
|
if (ne--, ne === 0) {
|
|
230
230
|
var e = {
|
|
@@ -234,10 +234,10 @@ function an() {
|
|
|
234
234
|
};
|
|
235
235
|
Object.defineProperties(console, {
|
|
236
236
|
log: t({}, e, {
|
|
237
|
-
value:
|
|
237
|
+
value: ye
|
|
238
238
|
}),
|
|
239
239
|
info: t({}, e, {
|
|
240
|
-
value:
|
|
240
|
+
value: Se
|
|
241
241
|
}),
|
|
242
242
|
warn: t({}, e, {
|
|
243
243
|
value: we
|
|
@@ -259,24 +259,24 @@ function an() {
|
|
|
259
259
|
ne < 0 && A("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
var
|
|
262
|
+
var de = F.ReactCurrentDispatcher, fe;
|
|
263
263
|
function ae(e, o, a) {
|
|
264
264
|
{
|
|
265
|
-
if (
|
|
265
|
+
if (fe === void 0)
|
|
266
266
|
try {
|
|
267
267
|
throw Error();
|
|
268
268
|
} catch (T) {
|
|
269
269
|
var m = T.stack.trim().match(/\n( *(at )?)/);
|
|
270
|
-
|
|
270
|
+
fe = m && m[1] || "";
|
|
271
271
|
}
|
|
272
272
|
return `
|
|
273
|
-
` +
|
|
273
|
+
` + fe + e;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
var me = !1, se;
|
|
277
277
|
{
|
|
278
|
-
var
|
|
279
|
-
se = new
|
|
278
|
+
var ft = typeof WeakMap == "function" ? WeakMap : Map;
|
|
279
|
+
se = new ft();
|
|
280
280
|
}
|
|
281
281
|
function Pe(e, o) {
|
|
282
282
|
if (!e || me)
|
|
@@ -291,7 +291,7 @@ function an() {
|
|
|
291
291
|
var T = Error.prepareStackTrace;
|
|
292
292
|
Error.prepareStackTrace = void 0;
|
|
293
293
|
var O;
|
|
294
|
-
O =
|
|
294
|
+
O = de.current, de.current = null, ct();
|
|
295
295
|
try {
|
|
296
296
|
if (o) {
|
|
297
297
|
var R = function() {
|
|
@@ -327,14 +327,14 @@ function an() {
|
|
|
327
327
|
} catch (B) {
|
|
328
328
|
if (B && m && typeof B.stack == "string") {
|
|
329
329
|
for (var C = B.stack.split(`
|
|
330
|
-
`),
|
|
331
|
-
`), D = C.length - 1, L =
|
|
330
|
+
`), q = m.stack.split(`
|
|
331
|
+
`), D = C.length - 1, L = q.length - 1; D >= 1 && L >= 0 && C[D] !== q[L]; )
|
|
332
332
|
L--;
|
|
333
333
|
for (; D >= 1 && L >= 0; D--, L--)
|
|
334
|
-
if (C[D] !==
|
|
334
|
+
if (C[D] !== q[L]) {
|
|
335
335
|
if (D !== 1 || L !== 1)
|
|
336
336
|
do
|
|
337
|
-
if (D--, L--, L < 0 || C[D] !==
|
|
337
|
+
if (D--, L--, L < 0 || C[D] !== q[L]) {
|
|
338
338
|
var V = `
|
|
339
339
|
` + C[D].replace(" at new ", " at ");
|
|
340
340
|
return typeof e == "function" && se.set(e, V), V;
|
|
@@ -344,7 +344,7 @@ function an() {
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
} finally {
|
|
347
|
-
me = !1,
|
|
347
|
+
me = !1, de.current = O, dt(), Error.prepareStackTrace = T;
|
|
348
348
|
}
|
|
349
349
|
var X = e ? e.displayName || e.name : "", Ye = X ? ae(X) : "";
|
|
350
350
|
return typeof e == "function" && se.set(e, Ye), Ye;
|
|
@@ -366,7 +366,7 @@ function an() {
|
|
|
366
366
|
switch (e) {
|
|
367
367
|
case b:
|
|
368
368
|
return ae("Suspense");
|
|
369
|
-
case
|
|
369
|
+
case y:
|
|
370
370
|
return ae("SuspenseList");
|
|
371
371
|
}
|
|
372
372
|
if (typeof e == "object")
|
|
@@ -403,8 +403,8 @@ function an() {
|
|
|
403
403
|
var C = void 0;
|
|
404
404
|
try {
|
|
405
405
|
if (typeof e[R] != "function") {
|
|
406
|
-
var
|
|
407
|
-
throw
|
|
406
|
+
var q = Error((m || "React class") + ": " + a + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
407
|
+
throw q.name = "Invariant Violation", q;
|
|
408
408
|
}
|
|
409
409
|
C = e[R](o, R, m, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
410
410
|
} catch (D) {
|
|
@@ -496,8 +496,8 @@ function an() {
|
|
|
496
496
|
};
|
|
497
497
|
function xt(e, o, a, m, T) {
|
|
498
498
|
{
|
|
499
|
-
var O, R = {}, C = null,
|
|
500
|
-
a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (
|
|
499
|
+
var O, R = {}, C = null, q = null;
|
|
500
|
+
a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (q = o.ref, bt(o, T));
|
|
501
501
|
for (O in o)
|
|
502
502
|
ge.call(o, O) && !pt.hasOwnProperty(O) && (R[O] = o[O]);
|
|
503
503
|
if (e && e.defaultProps) {
|
|
@@ -505,11 +505,11 @@ function an() {
|
|
|
505
505
|
for (O in D)
|
|
506
506
|
R[O] === void 0 && (R[O] = D[O]);
|
|
507
507
|
}
|
|
508
|
-
if (C ||
|
|
508
|
+
if (C || q) {
|
|
509
509
|
var L = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
510
|
-
C && Ct(R, L),
|
|
510
|
+
C && Ct(R, L), q && Et(R, L);
|
|
511
511
|
}
|
|
512
|
-
return Rt(e, C,
|
|
512
|
+
return Rt(e, C, q, T, m, re.current, R);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
var ve = F.ReactCurrentOwner, $e = F.ReactDebugCurrentFrame;
|
|
@@ -537,7 +537,7 @@ Check the render method of \`` + e + "`.";
|
|
|
537
537
|
return "";
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function yt(e) {
|
|
541
541
|
{
|
|
542
542
|
if (e !== void 0) {
|
|
543
543
|
var o = e.fileName.replace(/^.*[\\\/]/, ""), a = e.lineNumber;
|
|
@@ -549,7 +549,7 @@ Check your code at ` + o + ":" + a + ".";
|
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
var Me = {};
|
|
552
|
-
function
|
|
552
|
+
function St(e) {
|
|
553
553
|
{
|
|
554
554
|
var o = Fe();
|
|
555
555
|
if (!o) {
|
|
@@ -566,7 +566,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
566
566
|
if (!e._store || e._store.validated || e.key != null)
|
|
567
567
|
return;
|
|
568
568
|
e._store.validated = !0;
|
|
569
|
-
var a =
|
|
569
|
+
var a = St(o);
|
|
570
570
|
if (Me[a])
|
|
571
571
|
return;
|
|
572
572
|
Me[a] = !0;
|
|
@@ -574,7 +574,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
574
574
|
e && e._owner && e._owner !== ve.current && (m = " It was passed a child from " + W(e._owner.type) + "."), H(e), A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, m), H(null);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function qe(e, o) {
|
|
578
578
|
{
|
|
579
579
|
if (typeof e != "object")
|
|
580
580
|
return;
|
|
@@ -630,14 +630,14 @@ Check the top-level render call using <` + a + ">.");
|
|
|
630
630
|
e.ref !== null && (H(e), A("Invalid attribute `ref` supplied to `React.Fragment`."), H(null));
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Ke(e, o, a, m, T, O) {
|
|
634
634
|
{
|
|
635
635
|
var R = x(e);
|
|
636
636
|
if (!R) {
|
|
637
637
|
var C = "";
|
|
638
638
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
639
|
-
var
|
|
640
|
-
|
|
639
|
+
var q = yt(T);
|
|
640
|
+
q ? C += q : C += Fe();
|
|
641
641
|
var D;
|
|
642
642
|
e === null ? D = "null" : Array.isArray(e) ? D = "array" : e !== void 0 && e.$$typeof === i ? (D = "<" + (W(e.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, C);
|
|
643
643
|
}
|
|
@@ -650,21 +650,21 @@ Check the top-level render call using <` + a + ">.");
|
|
|
650
650
|
if (m)
|
|
651
651
|
if (Array.isArray(V)) {
|
|
652
652
|
for (var X = 0; X < V.length; X++)
|
|
653
|
-
|
|
653
|
+
qe(V[X], e);
|
|
654
654
|
Object.freeze && Object.freeze(V);
|
|
655
655
|
} else
|
|
656
656
|
A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
657
657
|
else
|
|
658
|
-
|
|
658
|
+
qe(V, e);
|
|
659
659
|
}
|
|
660
660
|
return e === r.Fragment ? _t(L) : wt(L), L;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
function It(e, o, a) {
|
|
664
|
-
return
|
|
664
|
+
return Ke(e, o, a, !0);
|
|
665
665
|
}
|
|
666
666
|
function Tt(e, o, a) {
|
|
667
|
-
return
|
|
667
|
+
return Ke(e, o, a, !1);
|
|
668
668
|
}
|
|
669
669
|
var Ot = Tt, Nt = It;
|
|
670
670
|
r.jsx = Ot, r.jsxs = Nt;
|
|
@@ -737,7 +737,7 @@ function cn(r, n) {
|
|
|
737
737
|
r.setSelection(t), r.revealRangeInCenter(t), r.focus();
|
|
738
738
|
});
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function dn(r, n, t = 0) {
|
|
741
741
|
t > 0 && (n = t + n), it(() => {
|
|
742
742
|
r.setPosition({ lineNumber: n, column: 1 }), r.revealLineInCenter(n), r.focus();
|
|
743
743
|
});
|
|
@@ -746,15 +746,15 @@ function zn(r, n, t) {
|
|
|
746
746
|
const s = r.getModel();
|
|
747
747
|
if (s && n) {
|
|
748
748
|
const u = s.getLineCount();
|
|
749
|
-
for (let
|
|
750
|
-
const l = s.getLineContent(
|
|
749
|
+
for (let d = 1; d <= u; d++) {
|
|
750
|
+
const l = s.getLineContent(d);
|
|
751
751
|
if (new RegExp(`(?:Function|function) ${t}`).test(l))
|
|
752
|
-
return
|
|
752
|
+
return d;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
return 0;
|
|
756
756
|
}
|
|
757
|
-
const
|
|
757
|
+
const fn = {
|
|
758
758
|
getServiceOverride: ({ openHandler: r }) => ({
|
|
759
759
|
get [Ve.toString()]() {
|
|
760
760
|
const n = xe.get(Ve);
|
|
@@ -1092,8 +1092,8 @@ const dn = {
|
|
|
1092
1092
|
// vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.41.0/min/vs",
|
|
1093
1093
|
// },
|
|
1094
1094
|
});
|
|
1095
|
-
const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, openHandler: s, language: u = "4d", defaultInited:
|
|
1096
|
-
const l = Dt(), [
|
|
1095
|
+
const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, openHandler: s, language: u = "4d", defaultInited: d = !1 }) => {
|
|
1096
|
+
const l = Dt(), [f, h] = oe(d), [b, y] = oe(null), v = Ue(), N = Ue(0);
|
|
1097
1097
|
J(() => {
|
|
1098
1098
|
Wt({
|
|
1099
1099
|
configureEditorOrViewsService: {
|
|
@@ -1102,7 +1102,7 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1102
1102
|
debugLogging: !1,
|
|
1103
1103
|
userServices: {
|
|
1104
1104
|
// @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
|
|
1105
|
-
...
|
|
1105
|
+
...fn.getServiceOverride({ openHandler: s }),
|
|
1106
1106
|
...mn.getServiceOverride(),
|
|
1107
1107
|
...gn.getServiceOverride()
|
|
1108
1108
|
}
|
|
@@ -1123,17 +1123,17 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1123
1123
|
t ? hn : vn
|
|
1124
1124
|
), nt.addKeybindingRules(bn), P();
|
|
1125
1125
|
}, P = () => {
|
|
1126
|
-
|
|
1126
|
+
y(null);
|
|
1127
1127
|
let x;
|
|
1128
1128
|
try {
|
|
1129
1129
|
x = new WebSocket(localStorage.LSP_SERVER || n);
|
|
1130
1130
|
} catch {
|
|
1131
|
-
|
|
1131
|
+
y(new Event("INVALID_URL"));
|
|
1132
1132
|
return;
|
|
1133
1133
|
}
|
|
1134
1134
|
x.onopen = $, x.onclose = _, x.onerror = E, N.current = 0;
|
|
1135
1135
|
}, $ = async function() {
|
|
1136
|
-
const x = Gt(this), I = new sn(x), w = new ln(x), W = new
|
|
1136
|
+
const x = Gt(this), I = new sn(x), w = new ln(x), W = new qt({
|
|
1137
1137
|
name: "4D Language Client",
|
|
1138
1138
|
clientOptions: {
|
|
1139
1139
|
workspaceFolder: {
|
|
@@ -1143,7 +1143,7 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1143
1143
|
documentSelector: [{ scheme: "file", language: u }],
|
|
1144
1144
|
// disable the default error handler
|
|
1145
1145
|
errorHandler: {
|
|
1146
|
-
error: () => ({ action:
|
|
1146
|
+
error: () => ({ action: Kt.Continue }),
|
|
1147
1147
|
closed: () => ({ action: Yt.DoNotRestart })
|
|
1148
1148
|
}
|
|
1149
1149
|
},
|
|
@@ -1158,17 +1158,17 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1158
1158
|
v.current = W, I.onClose(() => {
|
|
1159
1159
|
W.stop(), N.current < 3 ? setTimeout(() => {
|
|
1160
1160
|
N.current++, P();
|
|
1161
|
-
}, 1e3) :
|
|
1161
|
+
}, 1e3) : y(new Event("WEBSOCKET_CLOSED"));
|
|
1162
1162
|
}), W.needsStart() && await W.start(), h(!0);
|
|
1163
1163
|
}, _ = () => {
|
|
1164
1164
|
}, E = (x) => {
|
|
1165
|
-
|
|
1165
|
+
y(x);
|
|
1166
1166
|
};
|
|
1167
1167
|
J(() => {
|
|
1168
1168
|
const x = Ft.subscribe(({ action: I, payload: w }) => {
|
|
1169
1169
|
switch (I) {
|
|
1170
1170
|
case G.WILL_SAVE:
|
|
1171
|
-
|
|
1171
|
+
S(w.filePath);
|
|
1172
1172
|
break;
|
|
1173
1173
|
case G.DID_SAVE:
|
|
1174
1174
|
g(w.filePath, w.content);
|
|
@@ -1183,7 +1183,7 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1183
1183
|
M(w.oldPath, w.newPath);
|
|
1184
1184
|
break;
|
|
1185
1185
|
case G.DID_RENAME:
|
|
1186
|
-
|
|
1186
|
+
K(w.oldPath, w.newPath);
|
|
1187
1187
|
break;
|
|
1188
1188
|
case G.WILL_DELETE:
|
|
1189
1189
|
F(w.filePath);
|
|
@@ -1195,7 +1195,7 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1195
1195
|
});
|
|
1196
1196
|
return () => x.unsubscribe();
|
|
1197
1197
|
}, []);
|
|
1198
|
-
const
|
|
1198
|
+
const S = (x, I = Jt.Manual) => {
|
|
1199
1199
|
var w;
|
|
1200
1200
|
(w = v.current) == null || w.sendNotification(Zt.type, {
|
|
1201
1201
|
textDocument: {
|
|
@@ -1248,7 +1248,7 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1248
1248
|
}
|
|
1249
1249
|
]
|
|
1250
1250
|
});
|
|
1251
|
-
},
|
|
1251
|
+
}, K = (x, I) => {
|
|
1252
1252
|
var w;
|
|
1253
1253
|
(w = v.current) == null || w.sendNotification(nn.type, {
|
|
1254
1254
|
files: [
|
|
@@ -1272,7 +1272,7 @@ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1272
1272
|
ot.Provider,
|
|
1273
1273
|
{
|
|
1274
1274
|
value: {
|
|
1275
|
-
inited:
|
|
1275
|
+
inited: f || !!b,
|
|
1276
1276
|
clientRef: v,
|
|
1277
1277
|
lastError: b,
|
|
1278
1278
|
reload: P
|
|
@@ -1356,13 +1356,13 @@ function ut(r) {
|
|
|
1356
1356
|
}
|
|
1357
1357
|
function xn(r) {
|
|
1358
1358
|
var n = function(t) {
|
|
1359
|
-
var i = r.attr, s = r.size, u = r.title,
|
|
1360
|
-
return t.className && (
|
|
1359
|
+
var i = r.attr, s = r.size, u = r.title, d = Rn(r, ["attr", "size", "title"]), l = s || t.size || "1em", f;
|
|
1360
|
+
return t.className && (f = t.className), r.className && (f = (f ? f + " " : "") + r.className), z.createElement("svg", Z({
|
|
1361
1361
|
stroke: "currentColor",
|
|
1362
1362
|
fill: "currentColor",
|
|
1363
1363
|
strokeWidth: "0"
|
|
1364
|
-
}, t.attr, i,
|
|
1365
|
-
className:
|
|
1364
|
+
}, t.attr, i, d, {
|
|
1365
|
+
className: f,
|
|
1366
1366
|
style: Z(Z({
|
|
1367
1367
|
color: r.color || t.color
|
|
1368
1368
|
}, t.style), r.style),
|
|
@@ -1375,10 +1375,10 @@ function xn(r) {
|
|
|
1375
1375
|
return n(t);
|
|
1376
1376
|
}) : n(st);
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function yn(r) {
|
|
1379
1379
|
return ut({ 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" } }] })(r);
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function Sn(r) {
|
|
1382
1382
|
return ut({ 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" } }] })(r);
|
|
1383
1383
|
}
|
|
1384
1384
|
const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
@@ -1391,7 +1391,7 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1391
1391
|
i(!!r);
|
|
1392
1392
|
}, [r]), t ? /* @__PURE__ */ j.jsxs("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: [
|
|
1393
1393
|
/* @__PURE__ */ j.jsxs("span", { className: "flex flex-1 justify-center gap-1", children: [
|
|
1394
|
-
/* @__PURE__ */ j.jsx(
|
|
1394
|
+
/* @__PURE__ */ j.jsx(Sn, { className: "h-4 w-4 text-yellow-600" }),
|
|
1395
1395
|
/* @__PURE__ */ j.jsxs("span", { children: [
|
|
1396
1396
|
"LSP not loaded.",
|
|
1397
1397
|
" ",
|
|
@@ -1406,7 +1406,7 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1406
1406
|
] })
|
|
1407
1407
|
] }),
|
|
1408
1408
|
/* @__PURE__ */ j.jsx("button", { className: "focus:outline-none", children: /* @__PURE__ */ j.jsx(
|
|
1409
|
-
|
|
1409
|
+
yn,
|
|
1410
1410
|
{
|
|
1411
1411
|
className: "h-4 w-4 text-white",
|
|
1412
1412
|
onClick: u
|
|
@@ -1451,7 +1451,10 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1451
1451
|
name: {
|
|
1452
1452
|
type: "string"
|
|
1453
1453
|
}
|
|
1454
|
-
}
|
|
1454
|
+
},
|
|
1455
|
+
required: [
|
|
1456
|
+
"id"
|
|
1457
|
+
]
|
|
1455
1458
|
},
|
|
1456
1459
|
Condition: {
|
|
1457
1460
|
oneOf: [
|
|
@@ -1501,6 +1504,16 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1501
1504
|
"hardCoded"
|
|
1502
1505
|
]
|
|
1503
1506
|
},
|
|
1507
|
+
dataType: {
|
|
1508
|
+
enum: [
|
|
1509
|
+
"string",
|
|
1510
|
+
"number",
|
|
1511
|
+
"date",
|
|
1512
|
+
"boolean",
|
|
1513
|
+
"array",
|
|
1514
|
+
"object"
|
|
1515
|
+
]
|
|
1516
|
+
},
|
|
1504
1517
|
op: {
|
|
1505
1518
|
enum: [
|
|
1506
1519
|
"eq",
|
|
@@ -1514,7 +1527,14 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1514
1527
|
"lte"
|
|
1515
1528
|
]
|
|
1516
1529
|
}
|
|
1517
|
-
}
|
|
1530
|
+
},
|
|
1531
|
+
required: [
|
|
1532
|
+
"name",
|
|
1533
|
+
"type",
|
|
1534
|
+
"path",
|
|
1535
|
+
"value",
|
|
1536
|
+
"op"
|
|
1537
|
+
]
|
|
1518
1538
|
},
|
|
1519
1539
|
Privilege: {
|
|
1520
1540
|
allOf: [
|
|
@@ -1535,6 +1555,16 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1535
1555
|
"hardCoded"
|
|
1536
1556
|
]
|
|
1537
1557
|
},
|
|
1558
|
+
dataType: {
|
|
1559
|
+
enum: [
|
|
1560
|
+
"string",
|
|
1561
|
+
"number",
|
|
1562
|
+
"date",
|
|
1563
|
+
"boolean",
|
|
1564
|
+
"array",
|
|
1565
|
+
"object"
|
|
1566
|
+
]
|
|
1567
|
+
},
|
|
1538
1568
|
op: {
|
|
1539
1569
|
enum: [
|
|
1540
1570
|
"eq",
|
|
@@ -1542,7 +1572,13 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1542
1572
|
"regex"
|
|
1543
1573
|
]
|
|
1544
1574
|
}
|
|
1545
|
-
}
|
|
1575
|
+
},
|
|
1576
|
+
required: [
|
|
1577
|
+
"name",
|
|
1578
|
+
"type",
|
|
1579
|
+
"value",
|
|
1580
|
+
"op"
|
|
1581
|
+
]
|
|
1546
1582
|
},
|
|
1547
1583
|
Combination: {
|
|
1548
1584
|
allOf: [
|
|
@@ -1566,7 +1602,12 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1566
1602
|
$ref: "#/definitions/Condition"
|
|
1567
1603
|
}
|
|
1568
1604
|
}
|
|
1569
|
-
}
|
|
1605
|
+
},
|
|
1606
|
+
required: [
|
|
1607
|
+
"type",
|
|
1608
|
+
"conditions",
|
|
1609
|
+
"op"
|
|
1610
|
+
]
|
|
1570
1611
|
},
|
|
1571
1612
|
ParentState: {
|
|
1572
1613
|
allOf: [
|
|
@@ -1587,6 +1628,16 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1587
1628
|
"hardCoded"
|
|
1588
1629
|
]
|
|
1589
1630
|
},
|
|
1631
|
+
dataType: {
|
|
1632
|
+
enum: [
|
|
1633
|
+
"string",
|
|
1634
|
+
"number",
|
|
1635
|
+
"date",
|
|
1636
|
+
"boolean",
|
|
1637
|
+
"array",
|
|
1638
|
+
"object"
|
|
1639
|
+
]
|
|
1640
|
+
},
|
|
1590
1641
|
op: {
|
|
1591
1642
|
enum: [
|
|
1592
1643
|
"eq",
|
|
@@ -1594,7 +1645,13 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1594
1645
|
"regex"
|
|
1595
1646
|
]
|
|
1596
1647
|
}
|
|
1597
|
-
}
|
|
1648
|
+
},
|
|
1649
|
+
required: [
|
|
1650
|
+
"name",
|
|
1651
|
+
"type",
|
|
1652
|
+
"value",
|
|
1653
|
+
"op"
|
|
1654
|
+
]
|
|
1598
1655
|
},
|
|
1599
1656
|
Reference: {
|
|
1600
1657
|
allOf: [
|
|
@@ -1609,7 +1666,11 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1609
1666
|
ref: {
|
|
1610
1667
|
type: "string"
|
|
1611
1668
|
}
|
|
1612
|
-
}
|
|
1669
|
+
},
|
|
1670
|
+
required: [
|
|
1671
|
+
"type",
|
|
1672
|
+
"ref"
|
|
1673
|
+
]
|
|
1613
1674
|
}
|
|
1614
1675
|
}, On = {
|
|
1615
1676
|
$ref: In,
|
|
@@ -1633,13 +1694,13 @@ function jn(r, n) {
|
|
|
1633
1694
|
endLineNumber: M,
|
|
1634
1695
|
startColumn: p,
|
|
1635
1696
|
endColumn: F
|
|
1636
|
-
}), h(),
|
|
1637
|
-
},
|
|
1697
|
+
}), h(), f();
|
|
1698
|
+
}, d = (g) => {
|
|
1638
1699
|
s.indexOf(g) < 0 && s.push(g);
|
|
1639
1700
|
}, l = (g) => {
|
|
1640
1701
|
const p = s.indexOf(g);
|
|
1641
1702
|
p < 0 || s.splice(p, 1);
|
|
1642
|
-
},
|
|
1703
|
+
}, f = () => {
|
|
1643
1704
|
for (const g of s)
|
|
1644
1705
|
try {
|
|
1645
1706
|
g(i);
|
|
@@ -1669,7 +1730,7 @@ function jn(r, n) {
|
|
|
1669
1730
|
isReplacement: !1
|
|
1670
1731
|
};
|
|
1671
1732
|
return g.text === "" ? p.isDeletion = !0 : g.range.startLineNumber === g.range.endLineNumber && g.range.startColumn === g.range.endColumn ? p.isAddition = !0 : p.isReplacement = !0, p;
|
|
1672
|
-
},
|
|
1733
|
+
}, y = r.onDidChangeModel((g) => {
|
|
1673
1734
|
h(), E();
|
|
1674
1735
|
}), v = r.onDidChangeModelContent((g) => {
|
|
1675
1736
|
if (!g.isUndoing)
|
|
@@ -1677,19 +1738,19 @@ function jn(r, n) {
|
|
|
1677
1738
|
const M = b(p);
|
|
1678
1739
|
if (M.isReplacement || M.isDeletion || M.isAddition) {
|
|
1679
1740
|
const F = t.some(
|
|
1680
|
-
(
|
|
1741
|
+
(K) => p.range.startLineNumber >= K.startLineNumber && p.range.endLineNumber <= K.endLineNumber && p.range.startColumn >= K.startColumn && p.range.endColumn <= K.endColumn
|
|
1681
1742
|
), A = !F && n && p.range.startLineNumber === 1 && p.range.startColumn === 1 && !tt(p.text);
|
|
1682
1743
|
if (F || A) {
|
|
1683
|
-
const
|
|
1684
|
-
if (
|
|
1685
|
-
|
|
1744
|
+
const K = r.getModel();
|
|
1745
|
+
if (K) {
|
|
1746
|
+
K.undo();
|
|
1686
1747
|
return;
|
|
1687
1748
|
}
|
|
1688
1749
|
}
|
|
1689
1750
|
}
|
|
1690
1751
|
}
|
|
1691
1752
|
}), N = () => {
|
|
1692
|
-
|
|
1753
|
+
y.dispose(), v.dispose();
|
|
1693
1754
|
};
|
|
1694
1755
|
let k = [], P = `
|
|
1695
1756
|
.idoc-readonly-mark {
|
|
@@ -1702,16 +1763,16 @@ function jn(r, n) {
|
|
|
1702
1763
|
Pn(g) || Nn(P, g), P = null;
|
|
1703
1764
|
}
|
|
1704
1765
|
const $ = () => {
|
|
1705
|
-
|
|
1766
|
+
d(E), E();
|
|
1706
1767
|
}, _ = () => {
|
|
1707
1768
|
l(E), k = r.deltaDecorations(k, []);
|
|
1708
1769
|
}, E = () => {
|
|
1709
1770
|
const g = r.getModel();
|
|
1710
1771
|
g && (k = r.deltaDecorations(
|
|
1711
1772
|
k,
|
|
1712
|
-
i.map(
|
|
1773
|
+
i.map(S(g))
|
|
1713
1774
|
));
|
|
1714
|
-
},
|
|
1775
|
+
}, S = (g) => (p) => {
|
|
1715
1776
|
const M = g.getPositionAt(p[0]), F = g.getPositionAt(p[1]);
|
|
1716
1777
|
return {
|
|
1717
1778
|
range: new c.Range(
|
|
@@ -1730,7 +1791,7 @@ function jn(r, n) {
|
|
|
1730
1791
|
return i;
|
|
1731
1792
|
},
|
|
1732
1793
|
exclude: u,
|
|
1733
|
-
attach:
|
|
1794
|
+
attach: d,
|
|
1734
1795
|
detach: l,
|
|
1735
1796
|
dispose: N,
|
|
1736
1797
|
show: $,
|
|
@@ -1740,14 +1801,14 @@ function jn(r, n) {
|
|
|
1740
1801
|
function kn(r, n, t) {
|
|
1741
1802
|
let i = !1;
|
|
1742
1803
|
const s = (_) => _[1] < _[0] ? (i = !0, [[_[1], _[0]]]) : [[..._]], u = (_) => i ? _.map((E) => E[1] > E[0] ? l(E) : E).reverse() : _;
|
|
1743
|
-
let
|
|
1744
|
-
const l = (_) => (
|
|
1745
|
-
let h, b,
|
|
1746
|
-
|
|
1804
|
+
let d;
|
|
1805
|
+
const l = (_) => (d = _[1], _[1] = _[0], _[0] = d, _), f = s(r);
|
|
1806
|
+
let h, b, y, v, N, k, P, $;
|
|
1807
|
+
y = f[0];
|
|
1747
1808
|
for (b of n)
|
|
1748
|
-
for (P = b[0], $ = b[1], v = 0; v <
|
|
1749
|
-
if (
|
|
1750
|
-
k < P ? h = [
|
|
1809
|
+
for (P = b[0], $ = b[1], v = 0; v < f.length; v++) {
|
|
1810
|
+
if (y = f[v], N = y[0], k = y[1], N < P)
|
|
1811
|
+
k < P ? h = [y] : k <= $ ? h = [[N, P - 1]] : h = [
|
|
1751
1812
|
[N, P - 1],
|
|
1752
1813
|
[$ + 1, k]
|
|
1753
1814
|
];
|
|
@@ -1758,11 +1819,11 @@ function kn(r, n, t) {
|
|
|
1758
1819
|
} else
|
|
1759
1820
|
$ === Number.POSITIVE_INFINITY ? h = t === 0 ? [] : [[P - 1, P - 1]] : k <= $ ? h = t < 0 ? [[P - 1, P - 1]] : t > 0 ? [[$ + 1, $ + 1]] : [] : h = [[$ + 1, k]];
|
|
1760
1821
|
else
|
|
1761
|
-
h = [
|
|
1762
|
-
if (
|
|
1763
|
-
return u(
|
|
1822
|
+
h = [y];
|
|
1823
|
+
if (f.splice(v, 1, ...h), f.length === 1 && f[0][1] < P)
|
|
1824
|
+
return u(f);
|
|
1764
1825
|
}
|
|
1765
|
-
return u(
|
|
1826
|
+
return u(f);
|
|
1766
1827
|
}
|
|
1767
1828
|
function An(r, n) {
|
|
1768
1829
|
if (r.length < 2)
|
|
@@ -1770,10 +1831,10 @@ function An(r, n) {
|
|
|
1770
1831
|
const t = [];
|
|
1771
1832
|
let i = null, s, u;
|
|
1772
1833
|
r = r.map(
|
|
1773
|
-
(
|
|
1774
|
-
).sort((
|
|
1775
|
-
for (let
|
|
1776
|
-
i = t[t.length - 1], u = r[
|
|
1834
|
+
(d) => (d[1] < d[0] && (s = d[1], d[1] = d[0], d[1] = s), d)
|
|
1835
|
+
).sort((d, l) => d[0] - l[0]), t.push(r[0]);
|
|
1836
|
+
for (let d = 1; d < r.length; d++)
|
|
1837
|
+
i = t[t.length - 1], u = r[d], i[1] === u[0] && !n ? t.push(u) : i[1] === u[0] - 1 && n ? (i[1] = u[1], t.splice(t.length - 1, 1, i)) : i[1] < u[0] ? t.push(u) : i[1] < u[1] && (i[1] = u[1], t.splice(t.length - 1, 1, i));
|
|
1777
1838
|
return t;
|
|
1778
1839
|
}
|
|
1779
1840
|
function ie(r, n) {
|
|
@@ -1823,14 +1884,14 @@ class Dn {
|
|
|
1823
1884
|
return;
|
|
1824
1885
|
}
|
|
1825
1886
|
const s = this.getSelections(), u = this.intervals.buffer;
|
|
1826
|
-
let
|
|
1887
|
+
let d;
|
|
1827
1888
|
if (t === i.Delete)
|
|
1828
|
-
|
|
1889
|
+
d = (l) => l[0] === l[1] && u.find((f) => l[1] + 1 === f[0]) != null;
|
|
1829
1890
|
else if (t === i.Backspace)
|
|
1830
|
-
|
|
1891
|
+
d = (l) => l[0] === l[1] && u.find((f) => f[1] + 1 === l[0]) != null;
|
|
1831
1892
|
else
|
|
1832
1893
|
return;
|
|
1833
|
-
s.findIndex(
|
|
1894
|
+
s.findIndex(d) !== -1 && (n.stopPropagation(), n.preventDefault());
|
|
1834
1895
|
}));
|
|
1835
1896
|
Y(this, "getOffsetAt", ie(this, function(n) {
|
|
1836
1897
|
let t;
|
|
@@ -1901,13 +1962,13 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1901
1962
|
type: i,
|
|
1902
1963
|
language: s,
|
|
1903
1964
|
onChange: u,
|
|
1904
|
-
options:
|
|
1965
|
+
options: d = {},
|
|
1905
1966
|
extra: l = {},
|
|
1906
|
-
showAlerts:
|
|
1967
|
+
showAlerts: f = !1,
|
|
1907
1968
|
lspProps: h,
|
|
1908
1969
|
...b
|
|
1909
1970
|
}) => {
|
|
1910
|
-
const { initialLineInfo:
|
|
1971
|
+
const { initialLineInfo: y, initialSelectionInfo: v } = l, { editor: N, setEditor: k } = En(), { inited: P } = h;
|
|
1911
1972
|
function $(E) {
|
|
1912
1973
|
s === "css" && E.languages.registerCompletionItemProvider("css", _n), s === "json" && E.languages.json && E.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1913
1974
|
validate: !0,
|
|
@@ -1920,23 +1981,23 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1920
1981
|
]
|
|
1921
1982
|
});
|
|
1922
1983
|
}
|
|
1923
|
-
function _(E,
|
|
1984
|
+
function _(E, S) {
|
|
1924
1985
|
k(E);
|
|
1925
1986
|
const g = E.getModel();
|
|
1926
1987
|
if (g && (g.updateOptions({ insertSpaces: !1 }), E.onKeyUp(() => {
|
|
1927
1988
|
var M;
|
|
1928
1989
|
const p = (M = E.getPosition()) == null ? void 0 : M.lineNumber;
|
|
1929
1990
|
if (p) {
|
|
1930
|
-
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p),
|
|
1931
|
-
Ln.test(
|
|
1991
|
+
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), K = g.getLineContent(p);
|
|
1992
|
+
Ln.test(K) && E.executeEdits("edit-handler", [
|
|
1932
1993
|
{
|
|
1933
|
-
range: new
|
|
1994
|
+
range: new S.Range(
|
|
1934
1995
|
p,
|
|
1935
1996
|
0,
|
|
1936
1997
|
p,
|
|
1937
1998
|
A
|
|
1938
1999
|
),
|
|
1939
|
-
text:
|
|
2000
|
+
text: K.substr(
|
|
1940
2001
|
F - 1,
|
|
1941
2002
|
A - F
|
|
1942
2003
|
)
|
|
@@ -1951,15 +2012,15 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1951
2012
|
return J(() => {
|
|
1952
2013
|
if (!N)
|
|
1953
2014
|
return;
|
|
1954
|
-
const { line: E, offset:
|
|
1955
|
-
E &&
|
|
1956
|
-
}, [
|
|
2015
|
+
const { line: E, offset: S } = y || {};
|
|
2016
|
+
E && dn(N, E, S);
|
|
2017
|
+
}, [y, N]), J(() => {
|
|
1957
2018
|
if (!N)
|
|
1958
2019
|
return;
|
|
1959
2020
|
const { selection: E } = v || {};
|
|
1960
2021
|
E && cn(N, E);
|
|
1961
2022
|
}, [v, N]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
|
|
1962
|
-
|
|
2023
|
+
f ? /* @__PURE__ */ j.jsx(wn, { lspProps: h }) : null,
|
|
1963
2024
|
/* @__PURE__ */ j.jsx(
|
|
1964
2025
|
Lt,
|
|
1965
2026
|
{
|
|
@@ -1967,7 +2028,7 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1967
2028
|
readOnly: !0,
|
|
1968
2029
|
fontSize: 12,
|
|
1969
2030
|
"semanticHighlighting.enabled": !0,
|
|
1970
|
-
...
|
|
2031
|
+
...d
|
|
1971
2032
|
},
|
|
1972
2033
|
path: U(r),
|
|
1973
2034
|
value: n,
|
|
@@ -1990,7 +2051,7 @@ export {
|
|
|
1990
2051
|
it as _await,
|
|
1991
2052
|
U as getFileSystemPath,
|
|
1992
2053
|
zn as getFunctionOffset,
|
|
1993
|
-
|
|
2054
|
+
dn as jumpToLine,
|
|
1994
2055
|
cn as jumpToSelection,
|
|
1995
2056
|
En as useCodeEditor,
|
|
1996
2057
|
Zn as useLSP
|