@ws-ui/code-editor 0.1.18 → 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/demo/common.d.ts +10 -0
- package/dist/editor/schemas/condition.schema.json.d.ts +155 -0
- package/dist/index.cjs.js +13 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +575 -332
- package/dist/index.es.js.map +1 -1
- package/package.json +8 -4
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var Pt = Object.defineProperty;
|
|
2
2
|
var jt = (r, n, t) => n in r ? Pt(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
-
var
|
|
4
|
-
import z, { useEffect as J, createContext as Qe, useState as oe, useRef as
|
|
5
|
-
import { loader as At, useMonaco as
|
|
3
|
+
var Y = (r, n, t) => (jt(r, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
|
+
import z, { useEffect as J, createContext as Qe, useState as oe, useRef as Ue, useContext as et, memo as kt } from "react";
|
|
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
|
-
import { Selection as
|
|
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";
|
|
12
12
|
import { WillSaveTextDocumentNotification as Zt, TextDocumentSaveReason as Jt, DidSaveTextDocumentNotification as Ht, WillCreateFilesRequest as Xt, WillRenameFilesRequest as Qt, WillDeleteFilesRequest as en, DidCreateFilesNotification as tn, DidRenameFilesNotification as nn, DidDeleteFilesNotification as rn } from "vscode-languageserver-protocol";
|
|
13
|
-
import { ICodeEditorService as
|
|
13
|
+
import { ICodeEditorService as Ve, StandaloneServices as xe, ILanguageFeaturesService as Be, ITextModelService as ze } from "vscode/services";
|
|
14
14
|
var Re = { exports: {} }, te = {};
|
|
15
15
|
/*
|
|
16
16
|
object-assign
|
|
@@ -28,19 +28,19 @@ function rt() {
|
|
|
28
28
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
29
29
|
return Object(u);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function s() {
|
|
32
32
|
try {
|
|
33
33
|
if (!Object.assign)
|
|
34
34
|
return !1;
|
|
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 =
|
|
54
|
-
for (var
|
|
55
|
-
|
|
56
|
-
for (var
|
|
57
|
-
n.call(
|
|
53
|
+
return Ce = s() ? Object.assign : function(u, d) {
|
|
54
|
+
for (var l, f = i(u), h, b = 1; b < arguments.length; b++) {
|
|
55
|
+
l = Object(arguments[b]);
|
|
56
|
+
for (var y in l)
|
|
57
|
+
n.call(l, y) && (f[y] = l[y]);
|
|
58
58
|
if (r) {
|
|
59
|
-
h = r(
|
|
59
|
+
h = r(l);
|
|
60
60
|
for (var v = 0; v < h.length; v++)
|
|
61
|
-
t.call(
|
|
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
|
|
@@ -82,18 +82,18 @@ function on() {
|
|
|
82
82
|
var t = Symbol.for;
|
|
83
83
|
n = t("react.element"), te.Fragment = t("react.fragment");
|
|
84
84
|
}
|
|
85
|
-
var i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
86
|
-
function
|
|
87
|
-
var b,
|
|
88
|
-
h !== void 0 && (v = "" + h),
|
|
89
|
-
for (b in
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
for (b in
|
|
93
|
-
|
|
94
|
-
return { $$typeof: n, type:
|
|
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 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
|
+
if (l && l.defaultProps)
|
|
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
|
|
@@ -108,12 +108,12 @@ var Je;
|
|
|
108
108
|
function an() {
|
|
109
109
|
return Je || (Je = 1, function(r) {
|
|
110
110
|
process.env.NODE_ENV !== "production" && function() {
|
|
111
|
-
var n = z, t = rt(), i = 60103,
|
|
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,22 +127,22 @@ 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]));
|
|
137
|
-
var
|
|
138
|
-
return "" +
|
|
137
|
+
var O = a.map(function(R) {
|
|
138
|
+
return "" + R;
|
|
139
139
|
});
|
|
140
|
-
|
|
140
|
+
O.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, O);
|
|
141
141
|
}
|
|
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 || "";
|
|
@@ -161,23 +161,23 @@ function an() {
|
|
|
161
161
|
switch (e) {
|
|
162
162
|
case r.Fragment:
|
|
163
163
|
return "Fragment";
|
|
164
|
-
case
|
|
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
|
-
case
|
|
180
|
+
case l:
|
|
181
181
|
var a = e;
|
|
182
182
|
return w(a._context) + ".Provider";
|
|
183
183
|
case h:
|
|
@@ -186,10 +186,10 @@ function an() {
|
|
|
186
186
|
return W(e.type);
|
|
187
187
|
case k:
|
|
188
188
|
return W(e._render);
|
|
189
|
-
case
|
|
190
|
-
var m = e, T = m._payload,
|
|
189
|
+
case N: {
|
|
190
|
+
var m = e, T = m._payload, O = m._init;
|
|
191
191
|
try {
|
|
192
|
-
return W(
|
|
192
|
+
return W(O(T));
|
|
193
193
|
} catch {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
@@ -197,18 +197,18 @@ function an() {
|
|
|
197
197
|
}
|
|
198
198
|
return null;
|
|
199
199
|
}
|
|
200
|
-
var ne = 0,
|
|
201
|
-
function
|
|
200
|
+
var ne = 0, ye, Se, we, _e, Ie, Te, Oe;
|
|
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,
|
|
211
|
-
value:
|
|
211
|
+
value: Ne,
|
|
212
212
|
writable: !0
|
|
213
213
|
};
|
|
214
214
|
Object.defineProperties(console, {
|
|
@@ -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
|
|
@@ -252,31 +252,31 @@ function an() {
|
|
|
252
252
|
value: Te
|
|
253
253
|
}),
|
|
254
254
|
groupEnd: t({}, e, {
|
|
255
|
-
value:
|
|
255
|
+
value: Oe
|
|
256
256
|
})
|
|
257
257
|
});
|
|
258
258
|
}
|
|
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)
|
|
@@ -290,31 +290,31 @@ function an() {
|
|
|
290
290
|
me = !0;
|
|
291
291
|
var T = Error.prepareStackTrace;
|
|
292
292
|
Error.prepareStackTrace = void 0;
|
|
293
|
-
var
|
|
294
|
-
|
|
293
|
+
var O;
|
|
294
|
+
O = de.current, de.current = null, ct();
|
|
295
295
|
try {
|
|
296
296
|
if (o) {
|
|
297
|
-
var
|
|
297
|
+
var R = function() {
|
|
298
298
|
throw Error();
|
|
299
299
|
};
|
|
300
|
-
if (Object.defineProperty(
|
|
300
|
+
if (Object.defineProperty(R.prototype, "props", {
|
|
301
301
|
set: function() {
|
|
302
302
|
throw Error();
|
|
303
303
|
}
|
|
304
304
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
305
305
|
try {
|
|
306
|
-
Reflect.construct(
|
|
306
|
+
Reflect.construct(R, []);
|
|
307
307
|
} catch (B) {
|
|
308
308
|
m = B;
|
|
309
309
|
}
|
|
310
|
-
Reflect.construct(e, [],
|
|
310
|
+
Reflect.construct(e, [], R);
|
|
311
311
|
} else {
|
|
312
312
|
try {
|
|
313
|
-
|
|
313
|
+
R.call();
|
|
314
314
|
} catch (B) {
|
|
315
315
|
m = B;
|
|
316
316
|
}
|
|
317
|
-
e.call(
|
|
317
|
+
e.call(R.prototype);
|
|
318
318
|
}
|
|
319
319
|
} else {
|
|
320
320
|
try {
|
|
@@ -327,27 +327,27 @@ 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
|
-
`),
|
|
332
|
-
|
|
333
|
-
for (;
|
|
334
|
-
if (C[
|
|
335
|
-
if (
|
|
330
|
+
`), q = m.stack.split(`
|
|
331
|
+
`), D = C.length - 1, L = q.length - 1; D >= 1 && L >= 0 && C[D] !== q[L]; )
|
|
332
|
+
L--;
|
|
333
|
+
for (; D >= 1 && L >= 0; D--, L--)
|
|
334
|
+
if (C[D] !== q[L]) {
|
|
335
|
+
if (D !== 1 || L !== 1)
|
|
336
336
|
do
|
|
337
|
-
if (
|
|
338
|
-
var
|
|
339
|
-
` + C[
|
|
340
|
-
return typeof e == "function" && se.set(e,
|
|
337
|
+
if (D--, L--, L < 0 || C[D] !== q[L]) {
|
|
338
|
+
var V = `
|
|
339
|
+
` + C[D].replace(" at new ", " at ");
|
|
340
|
+
return typeof e == "function" && se.set(e, V), V;
|
|
341
341
|
}
|
|
342
|
-
while (
|
|
342
|
+
while (D >= 1 && L >= 0);
|
|
343
343
|
break;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
} finally {
|
|
347
|
-
me = !1,
|
|
347
|
+
me = !1, de.current = O, dt(), Error.prepareStackTrace = T;
|
|
348
348
|
}
|
|
349
|
-
var X = e ? e.displayName || e.name : "",
|
|
350
|
-
return typeof e == "function" && se.set(e,
|
|
349
|
+
var X = e ? e.displayName || e.name : "", Ye = X ? ae(X) : "";
|
|
350
|
+
return typeof e == "function" && se.set(e, Ye), Ye;
|
|
351
351
|
}
|
|
352
352
|
function je(e, o, a) {
|
|
353
353
|
return Pe(e, !1);
|
|
@@ -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")
|
|
@@ -377,10 +377,10 @@ function an() {
|
|
|
377
377
|
return le(e.type, o, a);
|
|
378
378
|
case k:
|
|
379
379
|
return je(e._render);
|
|
380
|
-
case
|
|
381
|
-
var m = e, T = m._payload,
|
|
380
|
+
case N: {
|
|
381
|
+
var m = e, T = m._payload, O = m._init;
|
|
382
382
|
try {
|
|
383
|
-
return le(
|
|
383
|
+
return le(O(T), o, a);
|
|
384
384
|
} catch {
|
|
385
385
|
}
|
|
386
386
|
}
|
|
@@ -397,20 +397,20 @@ function an() {
|
|
|
397
397
|
}
|
|
398
398
|
function gt(e, o, a, m, T) {
|
|
399
399
|
{
|
|
400
|
-
var
|
|
401
|
-
for (var
|
|
402
|
-
if (
|
|
400
|
+
var O = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
401
|
+
for (var R in e)
|
|
402
|
+
if (O(e, R)) {
|
|
403
403
|
var C = void 0;
|
|
404
404
|
try {
|
|
405
|
-
if (typeof e[
|
|
406
|
-
var
|
|
407
|
-
throw
|
|
405
|
+
if (typeof e[R] != "function") {
|
|
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
|
-
C = e[
|
|
410
|
-
} catch (
|
|
411
|
-
C =
|
|
409
|
+
C = e[R](o, R, m, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
410
|
+
} catch (D) {
|
|
411
|
+
C = D;
|
|
412
412
|
}
|
|
413
|
-
C && !(C instanceof Error) && (ue(T), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", a,
|
|
413
|
+
C && !(C instanceof Error) && (ue(T), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", a, R, typeof C), ue(null)), C instanceof Error && !(C.message in ke) && (ke[C.message] = !0, ue(T), A("Failed %s type: %s", a, C.message), ue(null));
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
}
|
|
@@ -419,7 +419,7 @@ function an() {
|
|
|
419
419
|
ref: !0,
|
|
420
420
|
__self: !0,
|
|
421
421
|
__source: !0
|
|
422
|
-
},
|
|
422
|
+
}, De, Le, pe;
|
|
423
423
|
pe = {};
|
|
424
424
|
function vt(e) {
|
|
425
425
|
if (ge.call(e, "ref")) {
|
|
@@ -446,7 +446,7 @@ function an() {
|
|
|
446
446
|
function Ct(e, o) {
|
|
447
447
|
{
|
|
448
448
|
var a = function() {
|
|
449
|
-
|
|
449
|
+
De || (De = !0, A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
450
450
|
};
|
|
451
451
|
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
452
452
|
get: a,
|
|
@@ -457,7 +457,7 @@ function an() {
|
|
|
457
457
|
function Et(e, o) {
|
|
458
458
|
{
|
|
459
459
|
var a = function() {
|
|
460
|
-
|
|
460
|
+
Le || (Le = !0, A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
461
461
|
};
|
|
462
462
|
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
463
463
|
get: a,
|
|
@@ -465,7 +465,7 @@ function an() {
|
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
var Rt = function(e, o, a, m, T,
|
|
468
|
+
var Rt = function(e, o, a, m, T, O, R) {
|
|
469
469
|
var C = {
|
|
470
470
|
// This tag allows us to uniquely identify this as a React Element
|
|
471
471
|
$$typeof: i,
|
|
@@ -473,9 +473,9 @@ function an() {
|
|
|
473
473
|
type: e,
|
|
474
474
|
key: o,
|
|
475
475
|
ref: a,
|
|
476
|
-
props:
|
|
476
|
+
props: R,
|
|
477
477
|
// Record the component responsible for creating this element.
|
|
478
|
-
_owner:
|
|
478
|
+
_owner: O
|
|
479
479
|
};
|
|
480
480
|
return C._store = {}, Object.defineProperty(C._store, "validated", {
|
|
481
481
|
configurable: !1,
|
|
@@ -496,20 +496,20 @@ function an() {
|
|
|
496
496
|
};
|
|
497
497
|
function xt(e, o, a, m, T) {
|
|
498
498
|
{
|
|
499
|
-
var
|
|
500
|
-
a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (
|
|
501
|
-
for (
|
|
502
|
-
ge.call(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
|
+
for (O in o)
|
|
502
|
+
ge.call(o, O) && !pt.hasOwnProperty(O) && (R[O] = o[O]);
|
|
503
503
|
if (e && e.defaultProps) {
|
|
504
|
-
var
|
|
505
|
-
for (
|
|
506
|
-
|
|
504
|
+
var D = e.defaultProps;
|
|
505
|
+
for (O in D)
|
|
506
|
+
R[O] === void 0 && (R[O] = D[O]);
|
|
507
507
|
}
|
|
508
|
-
if (C ||
|
|
509
|
-
var
|
|
510
|
-
C && Ct(
|
|
508
|
+
if (C || q) {
|
|
509
|
+
var L = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
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;
|
|
@@ -588,8 +588,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
588
588
|
else if (e) {
|
|
589
589
|
var T = M(e);
|
|
590
590
|
if (typeof T == "function" && T !== e.entries)
|
|
591
|
-
for (var
|
|
592
|
-
be(
|
|
591
|
+
for (var O = T.call(e), R; !(R = O.next()).done; )
|
|
592
|
+
be(R.value) && We(R.value, o);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
}
|
|
@@ -630,44 +630,44 @@ 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
|
-
var
|
|
636
|
-
if (!
|
|
635
|
+
var R = x(e);
|
|
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
|
-
|
|
641
|
-
var
|
|
642
|
-
e === null ?
|
|
639
|
+
var q = yt(T);
|
|
640
|
+
q ? C += q : C += Fe();
|
|
641
|
+
var D;
|
|
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
|
}
|
|
644
|
-
var
|
|
645
|
-
if (
|
|
646
|
-
return
|
|
647
|
-
if (
|
|
648
|
-
var
|
|
649
|
-
if (
|
|
644
|
+
var L = xt(e, o, a, T, O);
|
|
645
|
+
if (L == null)
|
|
646
|
+
return L;
|
|
647
|
+
if (R) {
|
|
648
|
+
var V = o.children;
|
|
649
|
+
if (V !== void 0)
|
|
650
650
|
if (m)
|
|
651
|
-
if (Array.isArray(
|
|
652
|
-
for (var X = 0; X <
|
|
653
|
-
|
|
654
|
-
Object.freeze && Object.freeze(
|
|
651
|
+
if (Array.isArray(V)) {
|
|
652
|
+
for (var X = 0; X < V.length; X++)
|
|
653
|
+
qe(V[X], e);
|
|
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
|
-
return e === r.Fragment ? _t(
|
|
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
|
-
var
|
|
670
|
-
r.jsx =
|
|
669
|
+
var Ot = Tt, Nt = It;
|
|
670
|
+
r.jsx = Ot, r.jsxs = Nt;
|
|
671
671
|
}();
|
|
672
672
|
}(Ee)), Ee;
|
|
673
673
|
}
|
|
@@ -676,7 +676,7 @@ var j = Re.exports;
|
|
|
676
676
|
class sn extends Bt {
|
|
677
677
|
constructor(t, i) {
|
|
678
678
|
super(t);
|
|
679
|
-
|
|
679
|
+
Y(this, "onMessage");
|
|
680
680
|
this.onMessage = i;
|
|
681
681
|
}
|
|
682
682
|
readMessage(t) {
|
|
@@ -687,15 +687,15 @@ class sn extends Bt {
|
|
|
687
687
|
if (this.state === "initial")
|
|
688
688
|
this.events.splice(0, 0, { message: i });
|
|
689
689
|
else if (this.state === "listening") {
|
|
690
|
-
const
|
|
691
|
-
this.callback(
|
|
690
|
+
const s = JSON.parse(i);
|
|
691
|
+
this.callback(s);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
class ln extends zt {
|
|
696
696
|
constructor(t, i) {
|
|
697
697
|
super(t);
|
|
698
|
-
|
|
698
|
+
Y(this, "onSend");
|
|
699
699
|
this.onSend = i;
|
|
700
700
|
}
|
|
701
701
|
async write(t) {
|
|
@@ -720,14 +720,14 @@ const un = {
|
|
|
720
720
|
}
|
|
721
721
|
]
|
|
722
722
|
};
|
|
723
|
-
function
|
|
723
|
+
function U(r) {
|
|
724
724
|
return `file:///PACKAGE/Project/Sources/${r}`;
|
|
725
725
|
}
|
|
726
726
|
function it(r, n = 0) {
|
|
727
727
|
setTimeout(r, n);
|
|
728
728
|
}
|
|
729
729
|
function cn(r, n) {
|
|
730
|
-
const t = new
|
|
730
|
+
const t = new Ut(
|
|
731
731
|
n.startLineNumber,
|
|
732
732
|
n.startColumn,
|
|
733
733
|
n.endLineNumber || n.startLineNumber,
|
|
@@ -737,27 +737,27 @@ 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
|
});
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
const u =
|
|
749
|
-
for (let
|
|
750
|
-
const
|
|
751
|
-
if (new RegExp(`(?:Function|function) ${t}`).test(
|
|
752
|
-
return
|
|
745
|
+
function zn(r, n, t) {
|
|
746
|
+
const s = r.getModel();
|
|
747
|
+
if (s && n) {
|
|
748
|
+
const u = s.getLineCount();
|
|
749
|
+
for (let d = 1; d <= u; d++) {
|
|
750
|
+
const l = s.getLineContent(d);
|
|
751
|
+
if (new RegExp(`(?:Function|function) ${t}`).test(l))
|
|
752
|
+
return d;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
return 0;
|
|
756
756
|
}
|
|
757
|
-
const
|
|
757
|
+
const fn = {
|
|
758
758
|
getServiceOverride: ({ openHandler: r }) => ({
|
|
759
|
-
get [
|
|
760
|
-
const n = xe.get(
|
|
759
|
+
get [Ve.toString()]() {
|
|
760
|
+
const n = xe.get(Ve);
|
|
761
761
|
return r && n.registerCodeEditorOpenHandler(r), n;
|
|
762
762
|
}
|
|
763
763
|
})
|
|
@@ -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),
|
|
1096
|
-
const
|
|
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,49 +1102,49 @@ const ot = Qe(void 0), qn = ({ 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
|
}
|
|
1109
1109
|
});
|
|
1110
1110
|
}, []), J(() => {
|
|
1111
|
-
n &&
|
|
1112
|
-
}, [n,
|
|
1111
|
+
n && l && k();
|
|
1112
|
+
}, [n, l]);
|
|
1113
1113
|
const k = async () => {
|
|
1114
|
-
if (!
|
|
1114
|
+
if (!l)
|
|
1115
1115
|
return;
|
|
1116
1116
|
const x = await $t();
|
|
1117
|
-
|
|
1117
|
+
l.editor.defineTheme("fd-dark", x || un), l.languages.register({
|
|
1118
1118
|
id: u,
|
|
1119
1119
|
extensions: [".4dm", ".4qm", ".4qs"],
|
|
1120
1120
|
aliases: ["4d", "4D"]
|
|
1121
|
-
}),
|
|
1121
|
+
}), l.languages.setLanguageConfiguration(u, pn), l.languages.registerCompletionItemProvider(
|
|
1122
1122
|
u,
|
|
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
|
-
x.onopen = $, x.onclose = _, x.onerror =
|
|
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: {
|
|
1140
|
-
uri:
|
|
1140
|
+
uri: Vt.parse("file:///PACKAGE")
|
|
1141
1141
|
},
|
|
1142
1142
|
// use a language id as a document selector
|
|
1143
1143
|
documentSelector: [{ scheme: "file", language: u }],
|
|
1144
1144
|
// disable the default error handler
|
|
1145
1145
|
errorHandler: {
|
|
1146
|
-
error: () => ({ action:
|
|
1147
|
-
closed: () => ({ action:
|
|
1146
|
+
error: () => ({ action: Kt.Continue }),
|
|
1147
|
+
closed: () => ({ action: Yt.DoNotRestart })
|
|
1148
1148
|
}
|
|
1149
1149
|
},
|
|
1150
1150
|
// create a language client connection from the JSON RPC connection on demand
|
|
@@ -1156,19 +1156,19 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1156
1156
|
}
|
|
1157
1157
|
});
|
|
1158
1158
|
v.current = W, I.onClose(() => {
|
|
1159
|
-
W.stop(),
|
|
1160
|
-
|
|
1161
|
-
}, 1e3) :
|
|
1159
|
+
W.stop(), N.current < 3 ? setTimeout(() => {
|
|
1160
|
+
N.current++, P();
|
|
1161
|
+
}, 1e3) : y(new Event("WEBSOCKET_CLOSED"));
|
|
1162
1162
|
}), W.needsStart() && await W.start(), h(!0);
|
|
1163
1163
|
}, _ = () => {
|
|
1164
|
-
},
|
|
1165
|
-
|
|
1164
|
+
}, E = (x) => {
|
|
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), qn = ({ 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,11 +1195,11 @@ const ot = Qe(void 0), qn = ({ 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: {
|
|
1202
|
-
uri:
|
|
1202
|
+
uri: U(x)
|
|
1203
1203
|
},
|
|
1204
1204
|
reason: I
|
|
1205
1205
|
});
|
|
@@ -1207,7 +1207,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1207
1207
|
var w;
|
|
1208
1208
|
(w = v.current) == null || w.sendNotification(Ht.type, {
|
|
1209
1209
|
textDocument: {
|
|
1210
|
-
uri:
|
|
1210
|
+
uri: U(x)
|
|
1211
1211
|
},
|
|
1212
1212
|
text: I
|
|
1213
1213
|
});
|
|
@@ -1216,7 +1216,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1216
1216
|
(I = v.current) == null || I.sendRequest(Xt.type, {
|
|
1217
1217
|
files: [
|
|
1218
1218
|
{
|
|
1219
|
-
uri:
|
|
1219
|
+
uri: U(x)
|
|
1220
1220
|
}
|
|
1221
1221
|
]
|
|
1222
1222
|
});
|
|
@@ -1225,8 +1225,8 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1225
1225
|
(w = v.current) == null || w.sendRequest(Qt.type, {
|
|
1226
1226
|
files: [
|
|
1227
1227
|
{
|
|
1228
|
-
oldUri:
|
|
1229
|
-
newUri:
|
|
1228
|
+
oldUri: U(x),
|
|
1229
|
+
newUri: U(I)
|
|
1230
1230
|
}
|
|
1231
1231
|
]
|
|
1232
1232
|
});
|
|
@@ -1235,7 +1235,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1235
1235
|
(I = v.current) == null || I.sendRequest(en.type, {
|
|
1236
1236
|
files: [
|
|
1237
1237
|
{
|
|
1238
|
-
uri:
|
|
1238
|
+
uri: U(x)
|
|
1239
1239
|
}
|
|
1240
1240
|
]
|
|
1241
1241
|
});
|
|
@@ -1244,17 +1244,17 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1244
1244
|
(I = v.current) == null || I.sendNotification(tn.type, {
|
|
1245
1245
|
files: [
|
|
1246
1246
|
{
|
|
1247
|
-
uri:
|
|
1247
|
+
uri: U(x)
|
|
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: [
|
|
1255
1255
|
{
|
|
1256
|
-
oldUri:
|
|
1257
|
-
newUri:
|
|
1256
|
+
oldUri: U(x),
|
|
1257
|
+
newUri: U(I)
|
|
1258
1258
|
}
|
|
1259
1259
|
]
|
|
1260
1260
|
});
|
|
@@ -1263,7 +1263,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1263
1263
|
(I = v.current) == null || I.sendNotification(rn.type, {
|
|
1264
1264
|
files: [
|
|
1265
1265
|
{
|
|
1266
|
-
uri:
|
|
1266
|
+
uri: U(x)
|
|
1267
1267
|
}
|
|
1268
1268
|
]
|
|
1269
1269
|
});
|
|
@@ -1272,7 +1272,7 @@ const ot = Qe(void 0), qn = ({ 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
|
|
@@ -1284,7 +1284,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1284
1284
|
}
|
|
1285
1285
|
);
|
|
1286
1286
|
};
|
|
1287
|
-
function
|
|
1287
|
+
function Zn() {
|
|
1288
1288
|
const r = et(ot);
|
|
1289
1289
|
if (r === void 0)
|
|
1290
1290
|
throw new Error("useLSP must be used within an LSPContext");
|
|
@@ -1292,7 +1292,7 @@ function Bn() {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
const at = Qe(
|
|
1294
1294
|
void 0
|
|
1295
|
-
),
|
|
1295
|
+
), Jn = kt(({ children: r }) => {
|
|
1296
1296
|
const [n, t] = oe(null);
|
|
1297
1297
|
return /* @__PURE__ */ j.jsx(
|
|
1298
1298
|
at.Provider,
|
|
@@ -1326,8 +1326,8 @@ var st = {
|
|
|
1326
1326
|
return Z = Object.assign || function(r) {
|
|
1327
1327
|
for (var n, t = 1, i = arguments.length; t < i; t++) {
|
|
1328
1328
|
n = arguments[t];
|
|
1329
|
-
for (var
|
|
1330
|
-
Object.prototype.hasOwnProperty.call(n,
|
|
1329
|
+
for (var s in n)
|
|
1330
|
+
Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
|
|
1331
1331
|
}
|
|
1332
1332
|
return r;
|
|
1333
1333
|
}, Z.apply(this, arguments);
|
|
@@ -1336,8 +1336,8 @@ var st = {
|
|
|
1336
1336
|
for (var i in r)
|
|
1337
1337
|
Object.prototype.hasOwnProperty.call(r, i) && n.indexOf(i) < 0 && (t[i] = r[i]);
|
|
1338
1338
|
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1339
|
-
for (var
|
|
1340
|
-
n.indexOf(i[
|
|
1339
|
+
for (var s = 0, i = Object.getOwnPropertySymbols(r); s < i.length; s++)
|
|
1340
|
+
n.indexOf(i[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, i[s]) && (t[i[s]] = r[i[s]]);
|
|
1341
1341
|
return t;
|
|
1342
1342
|
};
|
|
1343
1343
|
function lt(r) {
|
|
@@ -1356,18 +1356,18 @@ function ut(r) {
|
|
|
1356
1356
|
}
|
|
1357
1357
|
function xn(r) {
|
|
1358
1358
|
var n = function(t) {
|
|
1359
|
-
var i = r.attr,
|
|
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),
|
|
1369
|
-
height:
|
|
1370
|
-
width:
|
|
1369
|
+
height: l,
|
|
1370
|
+
width: l,
|
|
1371
1371
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1372
1372
|
}), u && z.createElement("title", null, u), r.children);
|
|
1373
1373
|
};
|
|
@@ -1375,14 +1375,14 @@ 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 } }) => {
|
|
1385
|
-
const [t, i] = oe(!1),
|
|
1385
|
+
const [t, i] = oe(!1), s = () => {
|
|
1386
1386
|
n();
|
|
1387
1387
|
}, u = () => {
|
|
1388
1388
|
i(!1);
|
|
@@ -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
|
" ",
|
|
@@ -1399,14 +1399,14 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1399
1399
|
"button",
|
|
1400
1400
|
{
|
|
1401
1401
|
className: "text-primary-dark underline",
|
|
1402
|
-
onClick:
|
|
1402
|
+
onClick: s,
|
|
1403
1403
|
children: "Reload?"
|
|
1404
1404
|
}
|
|
1405
1405
|
)
|
|
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
|
|
@@ -1441,33 +1441,267 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
|
|
|
1441
1441
|
]
|
|
1442
1442
|
};
|
|
1443
1443
|
}
|
|
1444
|
+
}, In = "#/definitions/Condition", Tn = {
|
|
1445
|
+
Base: {
|
|
1446
|
+
type: "object",
|
|
1447
|
+
properties: {
|
|
1448
|
+
id: {
|
|
1449
|
+
type: "string"
|
|
1450
|
+
},
|
|
1451
|
+
name: {
|
|
1452
|
+
type: "string"
|
|
1453
|
+
}
|
|
1454
|
+
},
|
|
1455
|
+
required: [
|
|
1456
|
+
"id"
|
|
1457
|
+
]
|
|
1458
|
+
},
|
|
1459
|
+
Condition: {
|
|
1460
|
+
oneOf: [
|
|
1461
|
+
{
|
|
1462
|
+
$ref: "#/definitions/Datasource"
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
$ref: "#/definitions/Privilege"
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
$ref: "#/definitions/Combination"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
$ref: "#/definitions/ParentState"
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
$ref: "#/definitions/Reference"
|
|
1475
|
+
}
|
|
1476
|
+
]
|
|
1477
|
+
},
|
|
1478
|
+
Datasource: {
|
|
1479
|
+
allOf: [
|
|
1480
|
+
{
|
|
1481
|
+
$ref: "#/definitions/Base"
|
|
1482
|
+
}
|
|
1483
|
+
],
|
|
1484
|
+
properties: {
|
|
1485
|
+
type: {
|
|
1486
|
+
const: "datasource"
|
|
1487
|
+
},
|
|
1488
|
+
path: {
|
|
1489
|
+
type: "string"
|
|
1490
|
+
},
|
|
1491
|
+
value: {
|
|
1492
|
+
type: [
|
|
1493
|
+
"number",
|
|
1494
|
+
"string",
|
|
1495
|
+
"boolean",
|
|
1496
|
+
"object",
|
|
1497
|
+
"array",
|
|
1498
|
+
"null"
|
|
1499
|
+
]
|
|
1500
|
+
},
|
|
1501
|
+
valueType: {
|
|
1502
|
+
enum: [
|
|
1503
|
+
"datasource",
|
|
1504
|
+
"hardCoded"
|
|
1505
|
+
]
|
|
1506
|
+
},
|
|
1507
|
+
dataType: {
|
|
1508
|
+
enum: [
|
|
1509
|
+
"string",
|
|
1510
|
+
"number",
|
|
1511
|
+
"date",
|
|
1512
|
+
"boolean",
|
|
1513
|
+
"array",
|
|
1514
|
+
"object"
|
|
1515
|
+
]
|
|
1516
|
+
},
|
|
1517
|
+
op: {
|
|
1518
|
+
enum: [
|
|
1519
|
+
"eq",
|
|
1520
|
+
"neq",
|
|
1521
|
+
"regex",
|
|
1522
|
+
"in",
|
|
1523
|
+
"nin",
|
|
1524
|
+
"gt",
|
|
1525
|
+
"gte",
|
|
1526
|
+
"lt",
|
|
1527
|
+
"lte"
|
|
1528
|
+
]
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
required: [
|
|
1532
|
+
"name",
|
|
1533
|
+
"type",
|
|
1534
|
+
"path",
|
|
1535
|
+
"value",
|
|
1536
|
+
"op"
|
|
1537
|
+
]
|
|
1538
|
+
},
|
|
1539
|
+
Privilege: {
|
|
1540
|
+
allOf: [
|
|
1541
|
+
{
|
|
1542
|
+
$ref: "#/definitions/Base"
|
|
1543
|
+
}
|
|
1544
|
+
],
|
|
1545
|
+
properties: {
|
|
1546
|
+
type: {
|
|
1547
|
+
const: "privilege"
|
|
1548
|
+
},
|
|
1549
|
+
value: {
|
|
1550
|
+
type: "string"
|
|
1551
|
+
},
|
|
1552
|
+
valueType: {
|
|
1553
|
+
enum: [
|
|
1554
|
+
"datasource",
|
|
1555
|
+
"hardCoded"
|
|
1556
|
+
]
|
|
1557
|
+
},
|
|
1558
|
+
dataType: {
|
|
1559
|
+
enum: [
|
|
1560
|
+
"string",
|
|
1561
|
+
"number",
|
|
1562
|
+
"date",
|
|
1563
|
+
"boolean",
|
|
1564
|
+
"array",
|
|
1565
|
+
"object"
|
|
1566
|
+
]
|
|
1567
|
+
},
|
|
1568
|
+
op: {
|
|
1569
|
+
enum: [
|
|
1570
|
+
"eq",
|
|
1571
|
+
"neq",
|
|
1572
|
+
"regex"
|
|
1573
|
+
]
|
|
1574
|
+
}
|
|
1575
|
+
},
|
|
1576
|
+
required: [
|
|
1577
|
+
"name",
|
|
1578
|
+
"type",
|
|
1579
|
+
"value",
|
|
1580
|
+
"op"
|
|
1581
|
+
]
|
|
1582
|
+
},
|
|
1583
|
+
Combination: {
|
|
1584
|
+
allOf: [
|
|
1585
|
+
{
|
|
1586
|
+
$ref: "#/definitions/Base"
|
|
1587
|
+
}
|
|
1588
|
+
],
|
|
1589
|
+
properties: {
|
|
1590
|
+
type: {
|
|
1591
|
+
const: "combination"
|
|
1592
|
+
},
|
|
1593
|
+
op: {
|
|
1594
|
+
enum: [
|
|
1595
|
+
"and",
|
|
1596
|
+
"or"
|
|
1597
|
+
]
|
|
1598
|
+
},
|
|
1599
|
+
conditions: {
|
|
1600
|
+
type: "array",
|
|
1601
|
+
items: {
|
|
1602
|
+
$ref: "#/definitions/Condition"
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
},
|
|
1606
|
+
required: [
|
|
1607
|
+
"type",
|
|
1608
|
+
"conditions",
|
|
1609
|
+
"op"
|
|
1610
|
+
]
|
|
1611
|
+
},
|
|
1612
|
+
ParentState: {
|
|
1613
|
+
allOf: [
|
|
1614
|
+
{
|
|
1615
|
+
$ref: "#/definitions/Base"
|
|
1616
|
+
}
|
|
1617
|
+
],
|
|
1618
|
+
properties: {
|
|
1619
|
+
type: {
|
|
1620
|
+
const: "parentState"
|
|
1621
|
+
},
|
|
1622
|
+
value: {
|
|
1623
|
+
type: "string"
|
|
1624
|
+
},
|
|
1625
|
+
valueType: {
|
|
1626
|
+
enum: [
|
|
1627
|
+
"datasource",
|
|
1628
|
+
"hardCoded"
|
|
1629
|
+
]
|
|
1630
|
+
},
|
|
1631
|
+
dataType: {
|
|
1632
|
+
enum: [
|
|
1633
|
+
"string",
|
|
1634
|
+
"number",
|
|
1635
|
+
"date",
|
|
1636
|
+
"boolean",
|
|
1637
|
+
"array",
|
|
1638
|
+
"object"
|
|
1639
|
+
]
|
|
1640
|
+
},
|
|
1641
|
+
op: {
|
|
1642
|
+
enum: [
|
|
1643
|
+
"eq",
|
|
1644
|
+
"neq",
|
|
1645
|
+
"regex"
|
|
1646
|
+
]
|
|
1647
|
+
}
|
|
1648
|
+
},
|
|
1649
|
+
required: [
|
|
1650
|
+
"name",
|
|
1651
|
+
"type",
|
|
1652
|
+
"value",
|
|
1653
|
+
"op"
|
|
1654
|
+
]
|
|
1655
|
+
},
|
|
1656
|
+
Reference: {
|
|
1657
|
+
allOf: [
|
|
1658
|
+
{
|
|
1659
|
+
$ref: "#/definitions/Base"
|
|
1660
|
+
}
|
|
1661
|
+
],
|
|
1662
|
+
properties: {
|
|
1663
|
+
type: {
|
|
1664
|
+
const: "reference"
|
|
1665
|
+
},
|
|
1666
|
+
ref: {
|
|
1667
|
+
type: "string"
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
required: [
|
|
1671
|
+
"type",
|
|
1672
|
+
"ref"
|
|
1673
|
+
]
|
|
1674
|
+
}
|
|
1675
|
+
}, On = {
|
|
1676
|
+
$ref: In,
|
|
1677
|
+
definitions: Tn
|
|
1444
1678
|
};
|
|
1445
|
-
function
|
|
1679
|
+
function Nn(r, n) {
|
|
1446
1680
|
const t = document.createElement("style");
|
|
1447
1681
|
t.dataset.id = n, t.textContent = r, document.head.append(t);
|
|
1448
1682
|
}
|
|
1449
|
-
function
|
|
1683
|
+
function Pn(r) {
|
|
1450
1684
|
return Array.from(document.styleSheets).find(
|
|
1451
1685
|
(n) => n.ownerNode.getAttribute("data-id") === r
|
|
1452
1686
|
);
|
|
1453
1687
|
}
|
|
1454
|
-
function
|
|
1688
|
+
function jn(r, n) {
|
|
1455
1689
|
const t = [];
|
|
1456
1690
|
let i = [];
|
|
1457
|
-
const
|
|
1691
|
+
const s = [], u = (g, p, M, F) => {
|
|
1458
1692
|
t.push({
|
|
1459
1693
|
startLineNumber: g,
|
|
1460
1694
|
endLineNumber: M,
|
|
1461
1695
|
startColumn: p,
|
|
1462
1696
|
endColumn: F
|
|
1463
|
-
}), h(),
|
|
1464
|
-
},
|
|
1465
|
-
|
|
1466
|
-
},
|
|
1467
|
-
const p =
|
|
1468
|
-
p < 0 ||
|
|
1469
|
-
},
|
|
1470
|
-
for (const g of
|
|
1697
|
+
}), h(), f();
|
|
1698
|
+
}, d = (g) => {
|
|
1699
|
+
s.indexOf(g) < 0 && s.push(g);
|
|
1700
|
+
}, l = (g) => {
|
|
1701
|
+
const p = s.indexOf(g);
|
|
1702
|
+
p < 0 || s.splice(p, 1);
|
|
1703
|
+
}, f = () => {
|
|
1704
|
+
for (const g of s)
|
|
1471
1705
|
try {
|
|
1472
1706
|
g(i);
|
|
1473
1707
|
} catch (p) {
|
|
@@ -1475,7 +1709,7 @@ function Nn(r, n) {
|
|
|
1475
1709
|
}
|
|
1476
1710
|
}, h = () => {
|
|
1477
1711
|
const g = r.getModel();
|
|
1478
|
-
g && (i =
|
|
1712
|
+
g && (i = An(
|
|
1479
1713
|
t.map((p) => [
|
|
1480
1714
|
g.getOffsetAt({
|
|
1481
1715
|
lineNumber: p.startLineNumber,
|
|
@@ -1496,27 +1730,27 @@ function Nn(r, n) {
|
|
|
1496
1730
|
isReplacement: !1
|
|
1497
1731
|
};
|
|
1498
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;
|
|
1499
|
-
},
|
|
1500
|
-
h(),
|
|
1733
|
+
}, y = r.onDidChangeModel((g) => {
|
|
1734
|
+
h(), E();
|
|
1501
1735
|
}), v = r.onDidChangeModelContent((g) => {
|
|
1502
1736
|
if (!g.isUndoing)
|
|
1503
1737
|
for (const p of g.changes) {
|
|
1504
1738
|
const M = b(p);
|
|
1505
1739
|
if (M.isReplacement || M.isDeletion || M.isAddition) {
|
|
1506
1740
|
const F = t.some(
|
|
1507
|
-
(
|
|
1741
|
+
(K) => p.range.startLineNumber >= K.startLineNumber && p.range.endLineNumber <= K.endLineNumber && p.range.startColumn >= K.startColumn && p.range.endColumn <= K.endColumn
|
|
1508
1742
|
), A = !F && n && p.range.startLineNumber === 1 && p.range.startColumn === 1 && !tt(p.text);
|
|
1509
1743
|
if (F || A) {
|
|
1510
|
-
const
|
|
1511
|
-
if (
|
|
1512
|
-
|
|
1744
|
+
const K = r.getModel();
|
|
1745
|
+
if (K) {
|
|
1746
|
+
K.undo();
|
|
1513
1747
|
return;
|
|
1514
1748
|
}
|
|
1515
1749
|
}
|
|
1516
1750
|
}
|
|
1517
1751
|
}
|
|
1518
|
-
}),
|
|
1519
|
-
|
|
1752
|
+
}), N = () => {
|
|
1753
|
+
y.dispose(), v.dispose();
|
|
1520
1754
|
};
|
|
1521
1755
|
let k = [], P = `
|
|
1522
1756
|
.idoc-readonly-mark {
|
|
@@ -1526,19 +1760,19 @@ function Nn(r, n) {
|
|
|
1526
1760
|
`;
|
|
1527
1761
|
if (P) {
|
|
1528
1762
|
const g = "monaco-read-only";
|
|
1529
|
-
|
|
1763
|
+
Pn(g) || Nn(P, g), P = null;
|
|
1530
1764
|
}
|
|
1531
1765
|
const $ = () => {
|
|
1532
|
-
|
|
1766
|
+
d(E), E();
|
|
1533
1767
|
}, _ = () => {
|
|
1534
|
-
|
|
1535
|
-
},
|
|
1768
|
+
l(E), k = r.deltaDecorations(k, []);
|
|
1769
|
+
}, E = () => {
|
|
1536
1770
|
const g = r.getModel();
|
|
1537
1771
|
g && (k = r.deltaDecorations(
|
|
1538
1772
|
k,
|
|
1539
|
-
i.map(
|
|
1773
|
+
i.map(S(g))
|
|
1540
1774
|
));
|
|
1541
|
-
},
|
|
1775
|
+
}, S = (g) => (p) => {
|
|
1542
1776
|
const M = g.getPositionAt(p[0]), F = g.getPositionAt(p[1]);
|
|
1543
1777
|
return {
|
|
1544
1778
|
range: new c.Range(
|
|
@@ -1557,69 +1791,69 @@ function Nn(r, n) {
|
|
|
1557
1791
|
return i;
|
|
1558
1792
|
},
|
|
1559
1793
|
exclude: u,
|
|
1560
|
-
attach:
|
|
1561
|
-
detach:
|
|
1562
|
-
dispose:
|
|
1794
|
+
attach: d,
|
|
1795
|
+
detach: l,
|
|
1796
|
+
dispose: N,
|
|
1563
1797
|
show: $,
|
|
1564
1798
|
hide: _
|
|
1565
1799
|
};
|
|
1566
1800
|
}
|
|
1567
|
-
function
|
|
1801
|
+
function kn(r, n, t) {
|
|
1568
1802
|
let i = !1;
|
|
1569
|
-
const
|
|
1570
|
-
let
|
|
1571
|
-
const
|
|
1572
|
-
let h, b,
|
|
1573
|
-
|
|
1803
|
+
const s = (_) => _[1] < _[0] ? (i = !0, [[_[1], _[0]]]) : [[..._]], u = (_) => i ? _.map((E) => E[1] > E[0] ? l(E) : E).reverse() : _;
|
|
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];
|
|
1574
1808
|
for (b of n)
|
|
1575
|
-
for (P = b[0], $ = b[1], v = 0; v <
|
|
1576
|
-
if (
|
|
1577
|
-
k < P ? h = [
|
|
1578
|
-
[
|
|
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 = [
|
|
1812
|
+
[N, P - 1],
|
|
1579
1813
|
[$ + 1, k]
|
|
1580
1814
|
];
|
|
1581
|
-
else if (
|
|
1815
|
+
else if (N <= $)
|
|
1582
1816
|
if (P === Number.NEGATIVE_INFINITY) {
|
|
1583
1817
|
const _ = $ + 1;
|
|
1584
1818
|
h = t === 0 ? [] : [[_, k > _ ? k : _]];
|
|
1585
1819
|
} else
|
|
1586
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]];
|
|
1587
1821
|
else
|
|
1588
|
-
h = [
|
|
1589
|
-
if (
|
|
1590
|
-
return u(
|
|
1822
|
+
h = [y];
|
|
1823
|
+
if (f.splice(v, 1, ...h), f.length === 1 && f[0][1] < P)
|
|
1824
|
+
return u(f);
|
|
1591
1825
|
}
|
|
1592
|
-
return u(
|
|
1826
|
+
return u(f);
|
|
1593
1827
|
}
|
|
1594
|
-
function
|
|
1828
|
+
function An(r, n) {
|
|
1595
1829
|
if (r.length < 2)
|
|
1596
1830
|
return r;
|
|
1597
1831
|
const t = [];
|
|
1598
|
-
let i = null,
|
|
1832
|
+
let i = null, s, u;
|
|
1599
1833
|
r = r.map(
|
|
1600
|
-
(
|
|
1601
|
-
).sort((
|
|
1602
|
-
for (let
|
|
1603
|
-
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));
|
|
1604
1838
|
return t;
|
|
1605
1839
|
}
|
|
1606
1840
|
function ie(r, n) {
|
|
1607
1841
|
return n.bind(r);
|
|
1608
1842
|
}
|
|
1609
|
-
class
|
|
1843
|
+
class Dn {
|
|
1610
1844
|
constructor(n, t) {
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1845
|
+
Y(this, "editor");
|
|
1846
|
+
Y(this, "intervals");
|
|
1847
|
+
Y(this, "disposables", []);
|
|
1614
1848
|
/**
|
|
1615
1849
|
* Flag for `excludeIntervals`
|
|
1616
1850
|
*/
|
|
1617
|
-
|
|
1618
|
-
|
|
1851
|
+
Y(this, "prefer", 1);
|
|
1852
|
+
Y(this, "lastPrefer", 1);
|
|
1619
1853
|
/**
|
|
1620
1854
|
* Linked to ICodeEditor.onDidChangeCursorPosition event.
|
|
1621
1855
|
*/
|
|
1622
|
-
|
|
1856
|
+
Y(this, "onCursor", ie(
|
|
1623
1857
|
this,
|
|
1624
1858
|
function(n) {
|
|
1625
1859
|
if (n.source === "api")
|
|
@@ -1628,16 +1862,16 @@ class jn {
|
|
|
1628
1862
|
t.length !== 0 && this.editor.setSelections(t);
|
|
1629
1863
|
}
|
|
1630
1864
|
));
|
|
1631
|
-
|
|
1865
|
+
Y(this, "onRectangleSelectionStart", ie(this, function({ event: n }) {
|
|
1632
1866
|
n.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
|
|
1633
1867
|
}));
|
|
1634
|
-
|
|
1868
|
+
Y(this, "onRectangleSelectionStop", ie(this, function() {
|
|
1635
1869
|
this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
|
|
1636
1870
|
}));
|
|
1637
1871
|
/**
|
|
1638
1872
|
* Linked to ICodeEditor.onKeyDown event.
|
|
1639
1873
|
*/
|
|
1640
|
-
|
|
1874
|
+
Y(this, "onKey", ie(this, function(n) {
|
|
1641
1875
|
const t = n.keyCode, i = c.KeyCode;
|
|
1642
1876
|
if (n.altKey || i.F1 <= t && t <= i.F19 || n.ctrlKey && t !== i.Backspace)
|
|
1643
1877
|
return;
|
|
@@ -1649,24 +1883,24 @@ class jn {
|
|
|
1649
1883
|
this.prefer = 1;
|
|
1650
1884
|
return;
|
|
1651
1885
|
}
|
|
1652
|
-
const
|
|
1653
|
-
let
|
|
1886
|
+
const s = this.getSelections(), u = this.intervals.buffer;
|
|
1887
|
+
let d;
|
|
1654
1888
|
if (t === i.Delete)
|
|
1655
|
-
|
|
1889
|
+
d = (l) => l[0] === l[1] && u.find((f) => l[1] + 1 === f[0]) != null;
|
|
1656
1890
|
else if (t === i.Backspace)
|
|
1657
|
-
|
|
1891
|
+
d = (l) => l[0] === l[1] && u.find((f) => f[1] + 1 === l[0]) != null;
|
|
1658
1892
|
else
|
|
1659
1893
|
return;
|
|
1660
|
-
|
|
1894
|
+
s.findIndex(d) !== -1 && (n.stopPropagation(), n.preventDefault());
|
|
1661
1895
|
}));
|
|
1662
|
-
|
|
1896
|
+
Y(this, "getOffsetAt", ie(this, function(n) {
|
|
1663
1897
|
let t;
|
|
1664
1898
|
for (let i = 0; i < this.intervals.buffer.length; i++)
|
|
1665
1899
|
if (t = this.intervals.buffer[i], n <= t[1])
|
|
1666
1900
|
return t[0] - n < n - t[1] ? t[0] : t[1];
|
|
1667
1901
|
}));
|
|
1668
1902
|
var i;
|
|
1669
|
-
this.editor = n, this.intervals =
|
|
1903
|
+
this.editor = n, this.intervals = jn(n, t), (i = this.editor.getModel()) == null || i.setEOL(c.editor.EndOfLineSequence.LF);
|
|
1670
1904
|
}
|
|
1671
1905
|
enable() {
|
|
1672
1906
|
this.disposables.push(
|
|
@@ -1680,22 +1914,22 @@ class jn {
|
|
|
1680
1914
|
n.dispose();
|
|
1681
1915
|
this.disposables.splice(0);
|
|
1682
1916
|
}
|
|
1683
|
-
exclude(n, t, i,
|
|
1684
|
-
arguments.length === 1 ? this.intervals.exclude(n, 0, n, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(n, t, i,
|
|
1917
|
+
exclude(n, t, i, s) {
|
|
1918
|
+
arguments.length === 1 ? this.intervals.exclude(n, 0, n, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(n, t, i, s);
|
|
1685
1919
|
}
|
|
1686
1920
|
getApprovedSelections() {
|
|
1687
1921
|
const n = this.editor.getModel();
|
|
1688
1922
|
return this.getSelections().map(
|
|
1689
|
-
(i) =>
|
|
1923
|
+
(i) => kn(
|
|
1690
1924
|
i,
|
|
1691
1925
|
this.intervals.buffer,
|
|
1692
1926
|
this.prefer
|
|
1693
1927
|
)
|
|
1694
1928
|
).flat().map((i) => {
|
|
1695
|
-
const
|
|
1929
|
+
const s = n.getPositionAt(i[0]), u = n.getPositionAt(i[1]);
|
|
1696
1930
|
return new c.Selection(
|
|
1697
|
-
|
|
1698
|
-
|
|
1931
|
+
s.lineNumber,
|
|
1932
|
+
s.column,
|
|
1699
1933
|
u.lineNumber,
|
|
1700
1934
|
u.column
|
|
1701
1935
|
);
|
|
@@ -1715,46 +1949,55 @@ class jn {
|
|
|
1715
1949
|
]);
|
|
1716
1950
|
}
|
|
1717
1951
|
}
|
|
1718
|
-
const
|
|
1952
|
+
const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__ */ j.jsx("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ j.jsx("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ j.jsxs("div", { className: "space-y-2", children: [
|
|
1719
1953
|
/* @__PURE__ */ j.jsx("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
|
|
1720
1954
|
/* @__PURE__ */ j.jsx("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1721
1955
|
/* @__PURE__ */ j.jsx("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
|
|
1722
1956
|
/* @__PURE__ */ j.jsx("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1723
1957
|
/* @__PURE__ */ j.jsx("div", { className: "h-3 rounded bg-grey-200" })
|
|
1724
|
-
] }) }) }),
|
|
1958
|
+
] }) }) }), Hn = ({
|
|
1725
1959
|
path: r,
|
|
1726
1960
|
initialValue: n,
|
|
1727
1961
|
theme: t = "fd-dark",
|
|
1728
1962
|
type: i,
|
|
1729
|
-
language:
|
|
1963
|
+
language: s,
|
|
1730
1964
|
onChange: u,
|
|
1731
|
-
options:
|
|
1732
|
-
extra:
|
|
1733
|
-
showAlerts:
|
|
1965
|
+
options: d = {},
|
|
1966
|
+
extra: l = {},
|
|
1967
|
+
showAlerts: f = !1,
|
|
1734
1968
|
lspProps: h,
|
|
1735
1969
|
...b
|
|
1736
1970
|
}) => {
|
|
1737
|
-
const { initialLineInfo:
|
|
1738
|
-
function $(
|
|
1739
|
-
|
|
1971
|
+
const { initialLineInfo: y, initialSelectionInfo: v } = l, { editor: N, setEditor: k } = En(), { inited: P } = h;
|
|
1972
|
+
function $(E) {
|
|
1973
|
+
s === "css" && E.languages.registerCompletionItemProvider("css", _n), s === "json" && E.languages.json && E.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1974
|
+
validate: !0,
|
|
1975
|
+
schemas: [
|
|
1976
|
+
{
|
|
1977
|
+
uri: "condition-schema.json",
|
|
1978
|
+
fileMatch: ["*.condition.json"],
|
|
1979
|
+
schema: On
|
|
1980
|
+
}
|
|
1981
|
+
]
|
|
1982
|
+
});
|
|
1740
1983
|
}
|
|
1741
|
-
function _(
|
|
1742
|
-
k(
|
|
1743
|
-
const g =
|
|
1744
|
-
if (g && (g.updateOptions({ insertSpaces: !1 }),
|
|
1984
|
+
function _(E, S) {
|
|
1985
|
+
k(E);
|
|
1986
|
+
const g = E.getModel();
|
|
1987
|
+
if (g && (g.updateOptions({ insertSpaces: !1 }), E.onKeyUp(() => {
|
|
1745
1988
|
var M;
|
|
1746
|
-
const p = (M =
|
|
1989
|
+
const p = (M = E.getPosition()) == null ? void 0 : M.lineNumber;
|
|
1747
1990
|
if (p) {
|
|
1748
|
-
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p),
|
|
1749
|
-
|
|
1991
|
+
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), K = g.getLineContent(p);
|
|
1992
|
+
Ln.test(K) && E.executeEdits("edit-handler", [
|
|
1750
1993
|
{
|
|
1751
|
-
range: new
|
|
1994
|
+
range: new S.Range(
|
|
1752
1995
|
p,
|
|
1753
1996
|
0,
|
|
1754
1997
|
p,
|
|
1755
1998
|
A
|
|
1756
1999
|
),
|
|
1757
|
-
text:
|
|
2000
|
+
text: K.substr(
|
|
1758
2001
|
F - 1,
|
|
1759
2002
|
A - F
|
|
1760
2003
|
)
|
|
@@ -1762,36 +2005,36 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1762
2005
|
]);
|
|
1763
2006
|
}
|
|
1764
2007
|
})), i === Mt.METHOD && tt(n)) {
|
|
1765
|
-
const p = new
|
|
2008
|
+
const p = new Dn(E, !0);
|
|
1766
2009
|
p.exclude(1, 1, 1, Number.POSITIVE_INFINITY), p.enable();
|
|
1767
2010
|
}
|
|
1768
2011
|
}
|
|
1769
2012
|
return J(() => {
|
|
1770
|
-
if (!
|
|
2013
|
+
if (!N)
|
|
1771
2014
|
return;
|
|
1772
|
-
const { line:
|
|
1773
|
-
|
|
1774
|
-
}, [
|
|
1775
|
-
if (!
|
|
2015
|
+
const { line: E, offset: S } = y || {};
|
|
2016
|
+
E && dn(N, E, S);
|
|
2017
|
+
}, [y, N]), J(() => {
|
|
2018
|
+
if (!N)
|
|
1776
2019
|
return;
|
|
1777
|
-
const { selection:
|
|
1778
|
-
|
|
1779
|
-
}, [v,
|
|
1780
|
-
|
|
2020
|
+
const { selection: E } = v || {};
|
|
2021
|
+
E && cn(N, E);
|
|
2022
|
+
}, [v, N]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
|
|
2023
|
+
f ? /* @__PURE__ */ j.jsx(wn, { lspProps: h }) : null,
|
|
1781
2024
|
/* @__PURE__ */ j.jsx(
|
|
1782
|
-
|
|
2025
|
+
Lt,
|
|
1783
2026
|
{
|
|
1784
2027
|
options: {
|
|
1785
2028
|
readOnly: !0,
|
|
1786
2029
|
fontSize: 12,
|
|
1787
2030
|
"semanticHighlighting.enabled": !0,
|
|
1788
|
-
...
|
|
2031
|
+
...d
|
|
1789
2032
|
},
|
|
1790
|
-
path:
|
|
2033
|
+
path: U(r),
|
|
1791
2034
|
value: n,
|
|
1792
2035
|
theme: "fd-dark",
|
|
1793
|
-
onChange: (
|
|
1794
|
-
language:
|
|
2036
|
+
onChange: (E) => u && u(E || ""),
|
|
2037
|
+
language: s,
|
|
1795
2038
|
beforeMount: $,
|
|
1796
2039
|
onMount: _,
|
|
1797
2040
|
loading: /* @__PURE__ */ j.jsx(Xe, {}),
|
|
@@ -1802,15 +2045,15 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1802
2045
|
};
|
|
1803
2046
|
export {
|
|
1804
2047
|
wn as Alerts,
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
2048
|
+
Hn as CodeEditor,
|
|
2049
|
+
Jn as CodeEditorProvider,
|
|
2050
|
+
Gn as LSPProvider,
|
|
1808
2051
|
it as _await,
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
2052
|
+
U as getFileSystemPath,
|
|
2053
|
+
zn as getFunctionOffset,
|
|
2054
|
+
dn as jumpToLine,
|
|
1812
2055
|
cn as jumpToSelection,
|
|
1813
2056
|
En as useCodeEditor,
|
|
1814
|
-
|
|
2057
|
+
Zn as useLSP
|
|
1815
2058
|
};
|
|
1816
2059
|
//# sourceMappingURL=index.es.js.map
|