@ws-ui/code-editor 0.1.19 → 0.1.21
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 +47 -7
- package/dist/index.cjs.js +13 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +249 -147
- 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: [
|
|
@@ -1464,6 +1467,9 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1464
1467
|
{
|
|
1465
1468
|
$ref: "#/definitions/Combination"
|
|
1466
1469
|
},
|
|
1470
|
+
{
|
|
1471
|
+
$ref: "#/definitions/CurrentState"
|
|
1472
|
+
},
|
|
1467
1473
|
{
|
|
1468
1474
|
$ref: "#/definitions/ParentState"
|
|
1469
1475
|
},
|
|
@@ -1501,6 +1507,16 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1501
1507
|
"hardCoded"
|
|
1502
1508
|
]
|
|
1503
1509
|
},
|
|
1510
|
+
dataType: {
|
|
1511
|
+
enum: [
|
|
1512
|
+
"string",
|
|
1513
|
+
"number",
|
|
1514
|
+
"date",
|
|
1515
|
+
"boolean",
|
|
1516
|
+
"array",
|
|
1517
|
+
"object"
|
|
1518
|
+
]
|
|
1519
|
+
},
|
|
1504
1520
|
op: {
|
|
1505
1521
|
enum: [
|
|
1506
1522
|
"eq",
|
|
@@ -1514,7 +1530,14 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1514
1530
|
"lte"
|
|
1515
1531
|
]
|
|
1516
1532
|
}
|
|
1517
|
-
}
|
|
1533
|
+
},
|
|
1534
|
+
required: [
|
|
1535
|
+
"name",
|
|
1536
|
+
"type",
|
|
1537
|
+
"path",
|
|
1538
|
+
"value",
|
|
1539
|
+
"op"
|
|
1540
|
+
]
|
|
1518
1541
|
},
|
|
1519
1542
|
Privilege: {
|
|
1520
1543
|
allOf: [
|
|
@@ -1542,7 +1565,13 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1542
1565
|
"regex"
|
|
1543
1566
|
]
|
|
1544
1567
|
}
|
|
1545
|
-
}
|
|
1568
|
+
},
|
|
1569
|
+
required: [
|
|
1570
|
+
"name",
|
|
1571
|
+
"type",
|
|
1572
|
+
"value",
|
|
1573
|
+
"op"
|
|
1574
|
+
]
|
|
1546
1575
|
},
|
|
1547
1576
|
Combination: {
|
|
1548
1577
|
allOf: [
|
|
@@ -1566,7 +1595,58 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1566
1595
|
$ref: "#/definitions/Condition"
|
|
1567
1596
|
}
|
|
1568
1597
|
}
|
|
1569
|
-
}
|
|
1598
|
+
},
|
|
1599
|
+
required: [
|
|
1600
|
+
"type",
|
|
1601
|
+
"conditions",
|
|
1602
|
+
"op"
|
|
1603
|
+
]
|
|
1604
|
+
},
|
|
1605
|
+
CurrentState: {
|
|
1606
|
+
allOf: [
|
|
1607
|
+
{
|
|
1608
|
+
$ref: "#/definitions/Base"
|
|
1609
|
+
}
|
|
1610
|
+
],
|
|
1611
|
+
properties: {
|
|
1612
|
+
type: {
|
|
1613
|
+
const: "currentState"
|
|
1614
|
+
},
|
|
1615
|
+
value: {
|
|
1616
|
+
type: "string"
|
|
1617
|
+
},
|
|
1618
|
+
valueType: {
|
|
1619
|
+
enum: [
|
|
1620
|
+
"datasource",
|
|
1621
|
+
"hardCoded"
|
|
1622
|
+
]
|
|
1623
|
+
},
|
|
1624
|
+
dataType: {
|
|
1625
|
+
enum: [
|
|
1626
|
+
"string",
|
|
1627
|
+
"number",
|
|
1628
|
+
"date",
|
|
1629
|
+
"boolean",
|
|
1630
|
+
"array",
|
|
1631
|
+
"object"
|
|
1632
|
+
]
|
|
1633
|
+
},
|
|
1634
|
+
op: {
|
|
1635
|
+
enum: [
|
|
1636
|
+
"eq",
|
|
1637
|
+
"neq",
|
|
1638
|
+
"regex",
|
|
1639
|
+
"in",
|
|
1640
|
+
"nin"
|
|
1641
|
+
]
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
required: [
|
|
1645
|
+
"name",
|
|
1646
|
+
"type",
|
|
1647
|
+
"value",
|
|
1648
|
+
"op"
|
|
1649
|
+
]
|
|
1570
1650
|
},
|
|
1571
1651
|
ParentState: {
|
|
1572
1652
|
allOf: [
|
|
@@ -1587,14 +1667,32 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1587
1667
|
"hardCoded"
|
|
1588
1668
|
]
|
|
1589
1669
|
},
|
|
1670
|
+
dataType: {
|
|
1671
|
+
enum: [
|
|
1672
|
+
"string",
|
|
1673
|
+
"number",
|
|
1674
|
+
"date",
|
|
1675
|
+
"boolean",
|
|
1676
|
+
"array",
|
|
1677
|
+
"object"
|
|
1678
|
+
]
|
|
1679
|
+
},
|
|
1590
1680
|
op: {
|
|
1591
1681
|
enum: [
|
|
1592
1682
|
"eq",
|
|
1593
1683
|
"neq",
|
|
1594
|
-
"regex"
|
|
1684
|
+
"regex",
|
|
1685
|
+
"in",
|
|
1686
|
+
"nin"
|
|
1595
1687
|
]
|
|
1596
1688
|
}
|
|
1597
|
-
}
|
|
1689
|
+
},
|
|
1690
|
+
required: [
|
|
1691
|
+
"name",
|
|
1692
|
+
"type",
|
|
1693
|
+
"value",
|
|
1694
|
+
"op"
|
|
1695
|
+
]
|
|
1598
1696
|
},
|
|
1599
1697
|
Reference: {
|
|
1600
1698
|
allOf: [
|
|
@@ -1609,7 +1707,11 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1609
1707
|
ref: {
|
|
1610
1708
|
type: "string"
|
|
1611
1709
|
}
|
|
1612
|
-
}
|
|
1710
|
+
},
|
|
1711
|
+
required: [
|
|
1712
|
+
"type",
|
|
1713
|
+
"ref"
|
|
1714
|
+
]
|
|
1613
1715
|
}
|
|
1614
1716
|
}, On = {
|
|
1615
1717
|
$ref: In,
|
|
@@ -1633,13 +1735,13 @@ function jn(r, n) {
|
|
|
1633
1735
|
endLineNumber: M,
|
|
1634
1736
|
startColumn: p,
|
|
1635
1737
|
endColumn: F
|
|
1636
|
-
}), h(),
|
|
1637
|
-
},
|
|
1738
|
+
}), h(), f();
|
|
1739
|
+
}, d = (g) => {
|
|
1638
1740
|
s.indexOf(g) < 0 && s.push(g);
|
|
1639
1741
|
}, l = (g) => {
|
|
1640
1742
|
const p = s.indexOf(g);
|
|
1641
1743
|
p < 0 || s.splice(p, 1);
|
|
1642
|
-
},
|
|
1744
|
+
}, f = () => {
|
|
1643
1745
|
for (const g of s)
|
|
1644
1746
|
try {
|
|
1645
1747
|
g(i);
|
|
@@ -1669,7 +1771,7 @@ function jn(r, n) {
|
|
|
1669
1771
|
isReplacement: !1
|
|
1670
1772
|
};
|
|
1671
1773
|
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
|
-
},
|
|
1774
|
+
}, y = r.onDidChangeModel((g) => {
|
|
1673
1775
|
h(), E();
|
|
1674
1776
|
}), v = r.onDidChangeModelContent((g) => {
|
|
1675
1777
|
if (!g.isUndoing)
|
|
@@ -1677,19 +1779,19 @@ function jn(r, n) {
|
|
|
1677
1779
|
const M = b(p);
|
|
1678
1780
|
if (M.isReplacement || M.isDeletion || M.isAddition) {
|
|
1679
1781
|
const F = t.some(
|
|
1680
|
-
(
|
|
1782
|
+
(K) => p.range.startLineNumber >= K.startLineNumber && p.range.endLineNumber <= K.endLineNumber && p.range.startColumn >= K.startColumn && p.range.endColumn <= K.endColumn
|
|
1681
1783
|
), A = !F && n && p.range.startLineNumber === 1 && p.range.startColumn === 1 && !tt(p.text);
|
|
1682
1784
|
if (F || A) {
|
|
1683
|
-
const
|
|
1684
|
-
if (
|
|
1685
|
-
|
|
1785
|
+
const K = r.getModel();
|
|
1786
|
+
if (K) {
|
|
1787
|
+
K.undo();
|
|
1686
1788
|
return;
|
|
1687
1789
|
}
|
|
1688
1790
|
}
|
|
1689
1791
|
}
|
|
1690
1792
|
}
|
|
1691
1793
|
}), N = () => {
|
|
1692
|
-
|
|
1794
|
+
y.dispose(), v.dispose();
|
|
1693
1795
|
};
|
|
1694
1796
|
let k = [], P = `
|
|
1695
1797
|
.idoc-readonly-mark {
|
|
@@ -1702,16 +1804,16 @@ function jn(r, n) {
|
|
|
1702
1804
|
Pn(g) || Nn(P, g), P = null;
|
|
1703
1805
|
}
|
|
1704
1806
|
const $ = () => {
|
|
1705
|
-
|
|
1807
|
+
d(E), E();
|
|
1706
1808
|
}, _ = () => {
|
|
1707
1809
|
l(E), k = r.deltaDecorations(k, []);
|
|
1708
1810
|
}, E = () => {
|
|
1709
1811
|
const g = r.getModel();
|
|
1710
1812
|
g && (k = r.deltaDecorations(
|
|
1711
1813
|
k,
|
|
1712
|
-
i.map(
|
|
1814
|
+
i.map(S(g))
|
|
1713
1815
|
));
|
|
1714
|
-
},
|
|
1816
|
+
}, S = (g) => (p) => {
|
|
1715
1817
|
const M = g.getPositionAt(p[0]), F = g.getPositionAt(p[1]);
|
|
1716
1818
|
return {
|
|
1717
1819
|
range: new c.Range(
|
|
@@ -1730,7 +1832,7 @@ function jn(r, n) {
|
|
|
1730
1832
|
return i;
|
|
1731
1833
|
},
|
|
1732
1834
|
exclude: u,
|
|
1733
|
-
attach:
|
|
1835
|
+
attach: d,
|
|
1734
1836
|
detach: l,
|
|
1735
1837
|
dispose: N,
|
|
1736
1838
|
show: $,
|
|
@@ -1740,14 +1842,14 @@ function jn(r, n) {
|
|
|
1740
1842
|
function kn(r, n, t) {
|
|
1741
1843
|
let i = !1;
|
|
1742
1844
|
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
|
-
|
|
1845
|
+
let d;
|
|
1846
|
+
const l = (_) => (d = _[1], _[1] = _[0], _[0] = d, _), f = s(r);
|
|
1847
|
+
let h, b, y, v, N, k, P, $;
|
|
1848
|
+
y = f[0];
|
|
1747
1849
|
for (b of n)
|
|
1748
|
-
for (P = b[0], $ = b[1], v = 0; v <
|
|
1749
|
-
if (
|
|
1750
|
-
k < P ? h = [
|
|
1850
|
+
for (P = b[0], $ = b[1], v = 0; v < f.length; v++) {
|
|
1851
|
+
if (y = f[v], N = y[0], k = y[1], N < P)
|
|
1852
|
+
k < P ? h = [y] : k <= $ ? h = [[N, P - 1]] : h = [
|
|
1751
1853
|
[N, P - 1],
|
|
1752
1854
|
[$ + 1, k]
|
|
1753
1855
|
];
|
|
@@ -1758,11 +1860,11 @@ function kn(r, n, t) {
|
|
|
1758
1860
|
} else
|
|
1759
1861
|
$ === 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
1862
|
else
|
|
1761
|
-
h = [
|
|
1762
|
-
if (
|
|
1763
|
-
return u(
|
|
1863
|
+
h = [y];
|
|
1864
|
+
if (f.splice(v, 1, ...h), f.length === 1 && f[0][1] < P)
|
|
1865
|
+
return u(f);
|
|
1764
1866
|
}
|
|
1765
|
-
return u(
|
|
1867
|
+
return u(f);
|
|
1766
1868
|
}
|
|
1767
1869
|
function An(r, n) {
|
|
1768
1870
|
if (r.length < 2)
|
|
@@ -1770,10 +1872,10 @@ function An(r, n) {
|
|
|
1770
1872
|
const t = [];
|
|
1771
1873
|
let i = null, s, u;
|
|
1772
1874
|
r = r.map(
|
|
1773
|
-
(
|
|
1774
|
-
).sort((
|
|
1775
|
-
for (let
|
|
1776
|
-
i = t[t.length - 1], u = r[
|
|
1875
|
+
(d) => (d[1] < d[0] && (s = d[1], d[1] = d[0], d[1] = s), d)
|
|
1876
|
+
).sort((d, l) => d[0] - l[0]), t.push(r[0]);
|
|
1877
|
+
for (let d = 1; d < r.length; d++)
|
|
1878
|
+
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
1879
|
return t;
|
|
1778
1880
|
}
|
|
1779
1881
|
function ie(r, n) {
|
|
@@ -1823,14 +1925,14 @@ class Dn {
|
|
|
1823
1925
|
return;
|
|
1824
1926
|
}
|
|
1825
1927
|
const s = this.getSelections(), u = this.intervals.buffer;
|
|
1826
|
-
let
|
|
1928
|
+
let d;
|
|
1827
1929
|
if (t === i.Delete)
|
|
1828
|
-
|
|
1930
|
+
d = (l) => l[0] === l[1] && u.find((f) => l[1] + 1 === f[0]) != null;
|
|
1829
1931
|
else if (t === i.Backspace)
|
|
1830
|
-
|
|
1932
|
+
d = (l) => l[0] === l[1] && u.find((f) => f[1] + 1 === l[0]) != null;
|
|
1831
1933
|
else
|
|
1832
1934
|
return;
|
|
1833
|
-
s.findIndex(
|
|
1935
|
+
s.findIndex(d) !== -1 && (n.stopPropagation(), n.preventDefault());
|
|
1834
1936
|
}));
|
|
1835
1937
|
Y(this, "getOffsetAt", ie(this, function(n) {
|
|
1836
1938
|
let t;
|
|
@@ -1901,13 +2003,13 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1901
2003
|
type: i,
|
|
1902
2004
|
language: s,
|
|
1903
2005
|
onChange: u,
|
|
1904
|
-
options:
|
|
2006
|
+
options: d = {},
|
|
1905
2007
|
extra: l = {},
|
|
1906
|
-
showAlerts:
|
|
2008
|
+
showAlerts: f = !1,
|
|
1907
2009
|
lspProps: h,
|
|
1908
2010
|
...b
|
|
1909
2011
|
}) => {
|
|
1910
|
-
const { initialLineInfo:
|
|
2012
|
+
const { initialLineInfo: y, initialSelectionInfo: v } = l, { editor: N, setEditor: k } = En(), { inited: P } = h;
|
|
1911
2013
|
function $(E) {
|
|
1912
2014
|
s === "css" && E.languages.registerCompletionItemProvider("css", _n), s === "json" && E.languages.json && E.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1913
2015
|
validate: !0,
|
|
@@ -1920,23 +2022,23 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1920
2022
|
]
|
|
1921
2023
|
});
|
|
1922
2024
|
}
|
|
1923
|
-
function _(E,
|
|
2025
|
+
function _(E, S) {
|
|
1924
2026
|
k(E);
|
|
1925
2027
|
const g = E.getModel();
|
|
1926
2028
|
if (g && (g.updateOptions({ insertSpaces: !1 }), E.onKeyUp(() => {
|
|
1927
2029
|
var M;
|
|
1928
2030
|
const p = (M = E.getPosition()) == null ? void 0 : M.lineNumber;
|
|
1929
2031
|
if (p) {
|
|
1930
|
-
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p),
|
|
1931
|
-
Ln.test(
|
|
2032
|
+
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), K = g.getLineContent(p);
|
|
2033
|
+
Ln.test(K) && E.executeEdits("edit-handler", [
|
|
1932
2034
|
{
|
|
1933
|
-
range: new
|
|
2035
|
+
range: new S.Range(
|
|
1934
2036
|
p,
|
|
1935
2037
|
0,
|
|
1936
2038
|
p,
|
|
1937
2039
|
A
|
|
1938
2040
|
),
|
|
1939
|
-
text:
|
|
2041
|
+
text: K.substr(
|
|
1940
2042
|
F - 1,
|
|
1941
2043
|
A - F
|
|
1942
2044
|
)
|
|
@@ -1951,15 +2053,15 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1951
2053
|
return J(() => {
|
|
1952
2054
|
if (!N)
|
|
1953
2055
|
return;
|
|
1954
|
-
const { line: E, offset:
|
|
1955
|
-
E &&
|
|
1956
|
-
}, [
|
|
2056
|
+
const { line: E, offset: S } = y || {};
|
|
2057
|
+
E && dn(N, E, S);
|
|
2058
|
+
}, [y, N]), J(() => {
|
|
1957
2059
|
if (!N)
|
|
1958
2060
|
return;
|
|
1959
2061
|
const { selection: E } = v || {};
|
|
1960
2062
|
E && cn(N, E);
|
|
1961
2063
|
}, [v, N]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
|
|
1962
|
-
|
|
2064
|
+
f ? /* @__PURE__ */ j.jsx(wn, { lspProps: h }) : null,
|
|
1963
2065
|
/* @__PURE__ */ j.jsx(
|
|
1964
2066
|
Lt,
|
|
1965
2067
|
{
|
|
@@ -1967,7 +2069,7 @@ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1967
2069
|
readOnly: !0,
|
|
1968
2070
|
fontSize: 12,
|
|
1969
2071
|
"semanticHighlighting.enabled": !0,
|
|
1970
|
-
...
|
|
2072
|
+
...d
|
|
1971
2073
|
},
|
|
1972
2074
|
path: U(r),
|
|
1973
2075
|
value: n,
|
|
@@ -1990,7 +2092,7 @@ export {
|
|
|
1990
2092
|
it as _await,
|
|
1991
2093
|
U as getFileSystemPath,
|
|
1992
2094
|
zn as getFunctionOffset,
|
|
1993
|
-
|
|
2095
|
+
dn as jumpToLine,
|
|
1994
2096
|
cn as jumpToSelection,
|
|
1995
2097
|
En as useCodeEditor,
|
|
1996
2098
|
Zn as useLSP
|