@ws-ui/code-editor 0.2.24 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor/index.d.ts +1 -0
- package/dist/index.cjs.js +19 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +506 -502
- package/dist/index.es.js.map +1 -1
- package/dist/studio/assets/css.worker.bundle.js +337 -206
- package/dist/studio/assets/editor.worker.bundle.js +331 -200
- package/dist/studio/assets/html.worker.bundle.js +334 -203
- package/dist/studio/assets/json.worker.bundle.js +334 -203
- package/dist/studio/assets/textmate.worker.bundle.js +367 -209
- package/dist/studio/assets/ts.worker.bundle.js +1282 -1151
- package/package.json +22 -22
package/dist/index.es.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var F = (n, e, t) => (
|
|
4
|
-
import { jsxs as
|
|
5
|
-
import
|
|
6
|
-
import { loader as xe, useMonaco as
|
|
7
|
-
import { lspSubject as
|
|
8
|
-
import { MonacoLanguageClient as
|
|
9
|
-
import { mergeServices as
|
|
10
|
-
import
|
|
1
|
+
var Se = Object.defineProperty;
|
|
2
|
+
var ye = (n, e, t) => e in n ? Se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var F = (n, e, t) => (ye(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { jsxs as J, jsx as w, Fragment as Ne } from "react/jsx-runtime";
|
|
5
|
+
import T, { useEffect as M, createContext as re, useState as _, useRef as ne, useContext as se, memo as Re } from "react";
|
|
6
|
+
import { loader as xe, useMonaco as we, Editor as ke } from "@monaco-editor/react";
|
|
7
|
+
import { lspSubject as Le, LspActions as X, hasAttributesString as le, HTTP_HANDLERS_PATH as We, FileFolderType as Fe } from "@ws-ui/shared";
|
|
8
|
+
import { MonacoLanguageClient as Ze } from "monaco-languageclient";
|
|
9
|
+
import { mergeServices as je, initServices as Xe } from "monaco-languageclient/vscode/services";
|
|
10
|
+
import Ee, { initUserConfiguration as Ke } from "@codingame/monaco-vscode-configuration-service-override";
|
|
11
11
|
import Be from "@codingame/monaco-vscode-languages-service-override";
|
|
12
|
-
import
|
|
12
|
+
import Te from "@codingame/monaco-vscode-textmate-service-override";
|
|
13
13
|
import "@codingame/monaco-vscode-theme-defaults-default-extension";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import * as
|
|
17
|
-
import { Selection as Ge, KeyMod as
|
|
14
|
+
import Oe from "@codingame/monaco-vscode-editor-service-override";
|
|
15
|
+
import De from "@codingame/monaco-vscode-theme-service-override";
|
|
16
|
+
import * as s from "monaco-editor";
|
|
17
|
+
import { Selection as Ge, KeyMod as D, KeyCode as G, editor as ae, Range as Je, Uri as Me, CancellationTokenSource as Pe } from "monaco-editor";
|
|
18
18
|
import { Logger as Ve } from "monaco-languageclient/tools";
|
|
19
|
-
import { ErrorAction as
|
|
20
|
-
import { WebSocketMessageReader as
|
|
21
|
-
import { DocumentDiagnosticRequest as
|
|
22
|
-
import { StandaloneServices as
|
|
19
|
+
import { ErrorAction as Ye, CloseAction as He } from "vscode-languageclient";
|
|
20
|
+
import { WebSocketMessageReader as ze, WebSocketMessageWriter as _e, toSocket as $e } from "vscode-ws-jsonrpc";
|
|
21
|
+
import { DocumentDiagnosticRequest as Ue, WillSaveTextDocumentNotification as qe, TextDocumentSaveReason as Qe, DidSaveTextDocumentNotification as et, WillCreateFilesRequest as tt, WillRenameFilesRequest as nt, WillDeleteFilesRequest as it, DidCreateFilesNotification as ot, DidRenameFilesNotification as rt, DidDeleteFilesNotification as st, SemanticTokensRegistrationType as lt } from "vscode-languageserver-protocol";
|
|
22
|
+
import { StandaloneServices as at, ICodeEditorService as gt } from "vscode/services";
|
|
23
23
|
import { KeybindingsRegistry as q } from "vscode/monaco";
|
|
24
24
|
import "@codingame/monaco-vscode-standalone-languages";
|
|
25
25
|
import "@codingame/monaco-vscode-standalone-html-language-features";
|
|
@@ -30,14 +30,14 @@ import "@codingame/monaco-vscode-css-default-extension";
|
|
|
30
30
|
import "@codingame/monaco-vscode-json-default-extension";
|
|
31
31
|
import "@codingame/monaco-vscode-html-default-extension";
|
|
32
32
|
import "@codingame/monaco-vscode-javascript-default-extension";
|
|
33
|
-
import { registerExtension as
|
|
34
|
-
const
|
|
33
|
+
import { registerExtension as ct } from "vscode/extensions";
|
|
34
|
+
const ut = () => Ee(), dt = () => Oe(
|
|
35
35
|
() => Promise.resolve(void 0)
|
|
36
|
-
),
|
|
37
|
-
const n =
|
|
36
|
+
), It = () => {
|
|
37
|
+
const n = De(), e = n.themeService.ctor.prototype;
|
|
38
38
|
return e.defineTheme = () => {
|
|
39
39
|
}, n;
|
|
40
|
-
},
|
|
40
|
+
}, Ct = `{
|
|
41
41
|
"workbench.colorTheme": "Default Dark+",
|
|
42
42
|
"workbench.iconTheme": "vs-seti",
|
|
43
43
|
"editor.autoClosingBrackets": "languageDefined",
|
|
@@ -122,31 +122,31 @@ const ct = () => Xe(), ut = () => Te(
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
`,
|
|
125
|
+
`, mt = () => Ke(Ct), ft = async (n) => {
|
|
126
126
|
var o;
|
|
127
127
|
const e = n.serviceConfig ?? {};
|
|
128
|
-
e.debugLogging = ((o = n.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || n.logger.isDebugEnabled() === !0), await
|
|
128
|
+
e.debugLogging = ((o = n.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || n.logger.isDebugEnabled() === !0), await mt(), e.userServices = e.userServices ?? {};
|
|
129
129
|
const t = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
|
|
130
130
|
if (t === void 0) {
|
|
131
131
|
if (i)
|
|
132
132
|
throw new Error(
|
|
133
133
|
"You provided a workspaceConfig without using the configurationServiceOverride"
|
|
134
134
|
);
|
|
135
|
-
const
|
|
135
|
+
const l = {
|
|
136
136
|
// @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
|
|
137
|
-
...
|
|
138
|
-
...
|
|
139
|
-
...
|
|
137
|
+
...ut(),
|
|
138
|
+
...It(),
|
|
139
|
+
...Te(),
|
|
140
140
|
...Be(),
|
|
141
|
-
...
|
|
141
|
+
...dt()
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
je(l, e.userServices);
|
|
144
144
|
}
|
|
145
145
|
return i || (e.workspaceConfig = {
|
|
146
146
|
workspaceProvider: {
|
|
147
147
|
trusted: !0,
|
|
148
148
|
workspace: {
|
|
149
|
-
workspaceUri:
|
|
149
|
+
workspaceUri: s.Uri.file("/workspace")
|
|
150
150
|
},
|
|
151
151
|
async open() {
|
|
152
152
|
return !1;
|
|
@@ -154,7 +154,7 @@ const ct = () => Xe(), ut = () => Te(
|
|
|
154
154
|
}
|
|
155
155
|
}), e;
|
|
156
156
|
};
|
|
157
|
-
class
|
|
157
|
+
class At extends ze {
|
|
158
158
|
constructor(t, i) {
|
|
159
159
|
super(t);
|
|
160
160
|
F(this, "onMessage");
|
|
@@ -173,7 +173,7 @@ class ft extends He {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
class
|
|
176
|
+
class pt extends _e {
|
|
177
177
|
constructor(t, i) {
|
|
178
178
|
super(t);
|
|
179
179
|
F(this, "onSend");
|
|
@@ -192,30 +192,30 @@ function j(n, e = !0) {
|
|
|
192
192
|
const t = `/PACKAGE/Project/Sources/${n}`;
|
|
193
193
|
return e ? `file://${t}` : t;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function ge(n, e = 0) {
|
|
196
196
|
setTimeout(n, e);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function bt(n, e) {
|
|
199
199
|
const t = new Ge(
|
|
200
200
|
e.startLineNumber,
|
|
201
201
|
e.startColumn,
|
|
202
202
|
e.endLineNumber || e.startLineNumber,
|
|
203
203
|
e.endColumn || e.startColumn
|
|
204
204
|
);
|
|
205
|
-
|
|
205
|
+
ge(() => {
|
|
206
206
|
n.setSelection(t), n.revealRangeInCenter(t), n.focus();
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
t > 0 && (e = t + e),
|
|
209
|
+
function ht(n, e, t = 0) {
|
|
210
|
+
t > 0 && (e = t + e), ge(() => {
|
|
211
211
|
n.setPosition({ lineNumber: e, column: 1 }), n.revealLineInCenter(e), n.focus();
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function wn(n, e, t) {
|
|
215
215
|
const o = n.getModel();
|
|
216
216
|
if (o && e) {
|
|
217
|
-
const
|
|
218
|
-
for (let r = 1; r <=
|
|
217
|
+
const l = o.getLineCount();
|
|
218
|
+
for (let r = 1; r <= l; r++) {
|
|
219
219
|
const I = o.getLineContent(r);
|
|
220
220
|
if (new RegExp(`(?:Function|function) ${t}`).test(I))
|
|
221
221
|
return r;
|
|
@@ -223,15 +223,15 @@ function Rn(n, e, t) {
|
|
|
223
223
|
}
|
|
224
224
|
return 0;
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const vt = {
|
|
227
227
|
provideCompletionItems: async (n, e) => {
|
|
228
228
|
const t = n.getWordUntilPosition(e);
|
|
229
229
|
return {
|
|
230
230
|
suggestions: [
|
|
231
231
|
{
|
|
232
232
|
label: "var",
|
|
233
|
-
kind:
|
|
234
|
-
range: new
|
|
233
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
234
|
+
range: new s.Range(
|
|
235
235
|
e.lineNumber,
|
|
236
236
|
t.startColumn,
|
|
237
237
|
e.lineNumber,
|
|
@@ -239,12 +239,12 @@ const ht = {
|
|
|
239
239
|
),
|
|
240
240
|
insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
|
|
241
241
|
`),
|
|
242
|
-
insertTextRules:
|
|
242
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
label: "While",
|
|
246
|
-
kind:
|
|
247
|
-
range: new
|
|
246
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
247
|
+
range: new s.Range(
|
|
248
248
|
e.lineNumber,
|
|
249
249
|
t.startColumn,
|
|
250
250
|
e.lineNumber,
|
|
@@ -256,12 +256,12 @@ const ht = {
|
|
|
256
256
|
"End while"
|
|
257
257
|
].join(`
|
|
258
258
|
`),
|
|
259
|
-
insertTextRules:
|
|
259
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
label: "Case of",
|
|
263
|
-
kind:
|
|
264
|
-
range: new
|
|
263
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
264
|
+
range: new s.Range(
|
|
265
265
|
e.lineNumber,
|
|
266
266
|
t.startColumn,
|
|
267
267
|
e.lineNumber,
|
|
@@ -274,12 +274,12 @@ const ht = {
|
|
|
274
274
|
"End case"
|
|
275
275
|
].join(`
|
|
276
276
|
`),
|
|
277
|
-
insertTextRules:
|
|
277
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
280
|
label: "Else",
|
|
281
|
-
kind:
|
|
282
|
-
range: new
|
|
281
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
282
|
+
range: new s.Range(
|
|
283
283
|
e.lineNumber,
|
|
284
284
|
t.startColumn,
|
|
285
285
|
e.lineNumber,
|
|
@@ -287,12 +287,12 @@ const ht = {
|
|
|
287
287
|
),
|
|
288
288
|
insertText: ["Else", " "].join(`
|
|
289
289
|
`),
|
|
290
|
-
insertTextRules:
|
|
290
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
293
|
label: "If",
|
|
294
|
-
kind:
|
|
295
|
-
range: new
|
|
294
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
295
|
+
range: new s.Range(
|
|
296
296
|
e.lineNumber,
|
|
297
297
|
t.startColumn,
|
|
298
298
|
e.lineNumber,
|
|
@@ -302,12 +302,12 @@ const ht = {
|
|
|
302
302
|
`
|
|
303
303
|
`
|
|
304
304
|
),
|
|
305
|
-
insertTextRules:
|
|
305
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
label: "For",
|
|
309
|
-
kind:
|
|
310
|
-
range: new
|
|
309
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
310
|
+
range: new s.Range(
|
|
311
311
|
e.lineNumber,
|
|
312
312
|
t.startColumn,
|
|
313
313
|
e.lineNumber,
|
|
@@ -319,12 +319,12 @@ const ht = {
|
|
|
319
319
|
"End for"
|
|
320
320
|
].join(`
|
|
321
321
|
`),
|
|
322
|
-
insertTextRules:
|
|
322
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
325
|
label: "Function",
|
|
326
|
-
kind:
|
|
327
|
-
range: new
|
|
326
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
327
|
+
range: new s.Range(
|
|
328
328
|
e.lineNumber,
|
|
329
329
|
t.startColumn,
|
|
330
330
|
e.lineNumber,
|
|
@@ -335,20 +335,20 @@ const ht = {
|
|
|
335
335
|
" ${5:body}"
|
|
336
336
|
].join(`
|
|
337
337
|
`),
|
|
338
|
-
insertTextRules:
|
|
338
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
339
339
|
}
|
|
340
340
|
]
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
},
|
|
343
|
+
}, St = {
|
|
344
344
|
provideCompletionItems: async (n, e) => {
|
|
345
345
|
const t = n.getWordUntilPosition(e);
|
|
346
346
|
return {
|
|
347
347
|
suggestions: [
|
|
348
348
|
{
|
|
349
349
|
label: "var",
|
|
350
|
-
kind:
|
|
351
|
-
range: new
|
|
350
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
351
|
+
range: new s.Range(
|
|
352
352
|
e.lineNumber,
|
|
353
353
|
t.startColumn,
|
|
354
354
|
e.lineNumber,
|
|
@@ -356,12 +356,12 @@ const ht = {
|
|
|
356
356
|
),
|
|
357
357
|
insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
|
|
358
358
|
`),
|
|
359
|
-
insertTextRules:
|
|
359
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
360
360
|
},
|
|
361
361
|
{
|
|
362
362
|
label: "while",
|
|
363
|
-
kind:
|
|
364
|
-
range: new
|
|
363
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
364
|
+
range: new s.Range(
|
|
365
365
|
e.lineNumber,
|
|
366
366
|
t.startColumn,
|
|
367
367
|
e.lineNumber,
|
|
@@ -371,12 +371,12 @@ const ht = {
|
|
|
371
371
|
`
|
|
372
372
|
`
|
|
373
373
|
),
|
|
374
|
-
insertTextRules:
|
|
374
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
375
375
|
},
|
|
376
376
|
{
|
|
377
377
|
label: "switch",
|
|
378
|
-
kind:
|
|
379
|
-
range: new
|
|
378
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
379
|
+
range: new s.Range(
|
|
380
380
|
e.lineNumber,
|
|
381
381
|
t.startColumn,
|
|
382
382
|
e.lineNumber,
|
|
@@ -389,12 +389,12 @@ const ht = {
|
|
|
389
389
|
"end"
|
|
390
390
|
].join(`
|
|
391
391
|
`),
|
|
392
|
-
insertTextRules:
|
|
392
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
393
393
|
},
|
|
394
394
|
{
|
|
395
395
|
label: "else",
|
|
396
|
-
kind:
|
|
397
|
-
range: new
|
|
396
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
397
|
+
range: new s.Range(
|
|
398
398
|
e.lineNumber,
|
|
399
399
|
t.startColumn,
|
|
400
400
|
e.lineNumber,
|
|
@@ -402,12 +402,12 @@ const ht = {
|
|
|
402
402
|
),
|
|
403
403
|
insertText: ["else", " "].join(`
|
|
404
404
|
`),
|
|
405
|
-
insertTextRules:
|
|
405
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
406
406
|
},
|
|
407
407
|
{
|
|
408
408
|
label: "if",
|
|
409
|
-
kind:
|
|
410
|
-
range: new
|
|
409
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
410
|
+
range: new s.Range(
|
|
411
411
|
e.lineNumber,
|
|
412
412
|
t.startColumn,
|
|
413
413
|
e.lineNumber,
|
|
@@ -417,12 +417,12 @@ const ht = {
|
|
|
417
417
|
`
|
|
418
418
|
`
|
|
419
419
|
),
|
|
420
|
-
insertTextRules:
|
|
420
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
421
421
|
},
|
|
422
422
|
{
|
|
423
423
|
label: "for",
|
|
424
|
-
kind:
|
|
425
|
-
range: new
|
|
424
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
425
|
+
range: new s.Range(
|
|
426
426
|
e.lineNumber,
|
|
427
427
|
t.startColumn,
|
|
428
428
|
e.lineNumber,
|
|
@@ -434,12 +434,12 @@ const ht = {
|
|
|
434
434
|
"end"
|
|
435
435
|
].join(`
|
|
436
436
|
`),
|
|
437
|
-
insertTextRules:
|
|
437
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
438
438
|
},
|
|
439
439
|
{
|
|
440
440
|
label: "function",
|
|
441
|
-
kind:
|
|
442
|
-
range: new
|
|
441
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
442
|
+
range: new s.Range(
|
|
443
443
|
e.lineNumber,
|
|
444
444
|
t.startColumn,
|
|
445
445
|
e.lineNumber,
|
|
@@ -450,50 +450,50 @@ const ht = {
|
|
|
450
450
|
" ${5:body}"
|
|
451
451
|
].join(`
|
|
452
452
|
`),
|
|
453
|
-
insertTextRules:
|
|
453
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
454
454
|
}
|
|
455
455
|
]
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
-
},
|
|
458
|
+
}, yt = [
|
|
459
459
|
// zoom in
|
|
460
460
|
{
|
|
461
|
-
keybinding:
|
|
461
|
+
keybinding: D.CtrlCmd | G.NumpadAdd,
|
|
462
462
|
command: "editor.action.fontZoomIn"
|
|
463
463
|
},
|
|
464
464
|
{
|
|
465
|
-
keybinding:
|
|
465
|
+
keybinding: D.CtrlCmd | G.Equal,
|
|
466
466
|
command: "editor.action.fontZoomIn"
|
|
467
467
|
},
|
|
468
468
|
// zoom out
|
|
469
469
|
{
|
|
470
|
-
keybinding:
|
|
470
|
+
keybinding: D.CtrlCmd | G.NumpadSubtract,
|
|
471
471
|
command: "editor.action.fontZoomOut"
|
|
472
472
|
},
|
|
473
473
|
{
|
|
474
|
-
keybinding:
|
|
474
|
+
keybinding: D.CtrlCmd | G.Minus,
|
|
475
475
|
command: "editor.action.fontZoomOut"
|
|
476
476
|
},
|
|
477
477
|
// zoom reset
|
|
478
478
|
{
|
|
479
|
-
keybinding:
|
|
479
|
+
keybinding: D.CtrlCmd | G.Numpad0,
|
|
480
480
|
command: "editor.action.fontZoomReset"
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
|
-
keybinding:
|
|
483
|
+
keybinding: D.CtrlCmd | G.Digit0,
|
|
484
484
|
command: "editor.action.fontZoomReset"
|
|
485
485
|
}
|
|
486
|
-
],
|
|
487
|
-
n !== void 0 &&
|
|
486
|
+
], Nt = ({ defaultZoom: n }) => (M(() => {
|
|
487
|
+
n !== void 0 && ae.EditorZoom.setZoomLevel(n);
|
|
488
488
|
}, []), null);
|
|
489
489
|
({}).VITE_DISABLE_MONACO_LOADER || xe.config({
|
|
490
|
-
monaco:
|
|
490
|
+
monaco: s
|
|
491
491
|
// paths: {
|
|
492
492
|
// vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.41.0/min/vs",
|
|
493
493
|
// },
|
|
494
494
|
});
|
|
495
|
-
var
|
|
496
|
-
class
|
|
495
|
+
var z = /* @__PURE__ */ ((n) => (n[n.NotSet = -1] = "NotSet", n[n.None = 0] = "None", n[n.Italic = 1] = "Italic", n[n.Bold = 2] = "Bold", n[n.Underline = 4] = "Underline", n[n.Strikethrough = 8] = "Strikethrough", n))(z || {}), ce = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.DefaultForeground = 1] = "DefaultForeground", n[n.DefaultBackground = 2] = "DefaultBackground", n))(ce || {}), ue = /* @__PURE__ */ ((n) => (n[n.Other = 0] = "Other", n[n.Comment = 1] = "Comment", n[n.String = 2] = "String", n[n.RegEx = 3] = "RegEx", n))(ue || {});
|
|
496
|
+
class Y {
|
|
497
497
|
static getLanguageId(e) {
|
|
498
498
|
return (e & 255) >>> 0;
|
|
499
499
|
}
|
|
@@ -519,10 +519,10 @@ class P {
|
|
|
519
519
|
}
|
|
520
520
|
static getInlineStyleFromMetadata(e, t) {
|
|
521
521
|
const i = this.getForeground(e), o = this.getFontStyle(e);
|
|
522
|
-
let
|
|
523
|
-
o & 1 && (
|
|
522
|
+
let l = `color: ${t[i]};`;
|
|
523
|
+
o & 1 && (l += "font-style: italic;"), o & 2 && (l += "font-weight: bold;");
|
|
524
524
|
let r = "";
|
|
525
|
-
return o & 4 && (r += " underline"), o & 8 && (r += " line-through"), r && (
|
|
525
|
+
return o & 4 && (r += " underline"), o & 8 && (r += " line-through"), r && (l += `text-decoration:${r};`), l;
|
|
526
526
|
}
|
|
527
527
|
static getPresentationFromMetadata(e) {
|
|
528
528
|
const t = this.getForeground(e), i = this.getFontStyle(e);
|
|
@@ -535,43 +535,43 @@ class P {
|
|
|
535
535
|
};
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
const o = t.tokens.data,
|
|
538
|
+
function Rt(n, e, t, i) {
|
|
539
|
+
const o = t.tokens.data, l = n.getLanguageId();
|
|
540
540
|
let r = 0, I = 0;
|
|
541
|
-
const
|
|
542
|
-
for (let
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
let
|
|
547
|
-
for (let
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
),
|
|
556
|
-
N,
|
|
541
|
+
const C = i.lineNumber - 1, S = i.column - 1;
|
|
542
|
+
for (let y = 0; y < o.length; y += 5) {
|
|
543
|
+
const p = o[y], m = o[y + 1], N = o[y + 2], x = o[y + 3], h = o[y + 4], R = r + p, f = p === 0 ? I + m : m;
|
|
544
|
+
if (C === R && f <= S && S < f + N) {
|
|
545
|
+
const k = t.legend.tokenTypes[x] || "not in legend (ignored)", A = [];
|
|
546
|
+
let a = h;
|
|
547
|
+
for (let P = 0; a > 0 && P < t.legend.tokenModifiers.length; P++)
|
|
548
|
+
a & 1 && A.push(t.legend.tokenModifiers[P]), a = a >> 1;
|
|
549
|
+
a > 0 && A.push("not in legend (ignored)");
|
|
550
|
+
const u = new Je(
|
|
551
|
+
R + 1,
|
|
552
|
+
f + 1,
|
|
553
|
+
R + 1,
|
|
554
|
+
f + 1 + N
|
|
555
|
+
), v = {}, L = e.getColorTheme().tokenColorMap, b = e.getColorTheme().getTokenStyleMetadata(
|
|
557
556
|
k,
|
|
558
|
-
|
|
557
|
+
A,
|
|
558
|
+
l,
|
|
559
559
|
!0,
|
|
560
|
-
|
|
560
|
+
v
|
|
561
561
|
);
|
|
562
|
-
let
|
|
563
|
-
return
|
|
562
|
+
let B;
|
|
563
|
+
return b && (B = {
|
|
564
564
|
languageId: void 0,
|
|
565
|
-
tokenType:
|
|
566
|
-
bold:
|
|
567
|
-
italic:
|
|
568
|
-
underline:
|
|
569
|
-
strikethrough:
|
|
570
|
-
foreground: L[(
|
|
565
|
+
tokenType: ue.Other,
|
|
566
|
+
bold: b == null ? void 0 : b.bold,
|
|
567
|
+
italic: b == null ? void 0 : b.italic,
|
|
568
|
+
underline: b == null ? void 0 : b.underline,
|
|
569
|
+
strikethrough: b == null ? void 0 : b.strikethrough,
|
|
570
|
+
foreground: L[(b == null ? void 0 : b.foreground) || ce.None],
|
|
571
571
|
background: void 0
|
|
572
|
-
}), { type:
|
|
572
|
+
}), { type: k, modifiers: A, range: u, metadata: B, definitions: v };
|
|
573
573
|
}
|
|
574
|
-
r =
|
|
574
|
+
r = R, I = f;
|
|
575
575
|
}
|
|
576
576
|
return null;
|
|
577
577
|
}
|
|
@@ -584,287 +584,287 @@ function xt(n, e, t) {
|
|
|
584
584
|
).ruleStack;
|
|
585
585
|
return i;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
const i = n.getColorTheme().tokenColorMap, o =
|
|
587
|
+
function wt(n, e, t) {
|
|
588
|
+
const i = n.getColorTheme().tokenColorMap, o = Y.getLanguageId(t), l = Y.getTokenType(t), r = Y.getFontStyle(t), I = Y.getForeground(t), C = Y.getBackground(t);
|
|
589
589
|
return {
|
|
590
590
|
languageId: e.languageIdCodec.decodeLanguageId(o),
|
|
591
|
-
tokenType:
|
|
592
|
-
bold: r &
|
|
593
|
-
italic: r &
|
|
594
|
-
underline: r &
|
|
595
|
-
strikethrough: r &
|
|
591
|
+
tokenType: l,
|
|
592
|
+
bold: r & z.Bold ? !0 : void 0,
|
|
593
|
+
italic: r & z.Italic ? !0 : void 0,
|
|
594
|
+
underline: r & z.Underline ? !0 : void 0,
|
|
595
|
+
strikethrough: r & z.Strikethrough ? !0 : void 0,
|
|
596
596
|
foreground: i[I],
|
|
597
|
-
background: i[
|
|
597
|
+
background: i[C]
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
const i = t.lineNumber, o = n,
|
|
600
|
+
function kt(n, e, t) {
|
|
601
|
+
const i = t.lineNumber, o = n, l = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, r = xt(n, l, i), I = l.tokenizeLine(
|
|
602
602
|
n.getLineContent(i),
|
|
603
603
|
r
|
|
604
|
-
),
|
|
604
|
+
), C = l.tokenizeLine2(
|
|
605
605
|
n.getLineContent(i),
|
|
606
606
|
r
|
|
607
607
|
);
|
|
608
|
-
let
|
|
609
|
-
for (let
|
|
610
|
-
const
|
|
611
|
-
if (t.column - 1 >=
|
|
612
|
-
|
|
608
|
+
let S = 0;
|
|
609
|
+
for (let p = I.tokens.length - 1; p >= 0; p--) {
|
|
610
|
+
const m = I.tokens[p];
|
|
611
|
+
if (t.column - 1 >= m.startIndex) {
|
|
612
|
+
S = p;
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
let
|
|
617
|
-
for (let
|
|
618
|
-
if (t.column - 1 >=
|
|
619
|
-
|
|
616
|
+
let y = 0;
|
|
617
|
+
for (let p = C.tokens.length >>> 1; p >= 0; p--)
|
|
618
|
+
if (t.column - 1 >= C.tokens[p << 1]) {
|
|
619
|
+
y = p;
|
|
620
620
|
break;
|
|
621
621
|
}
|
|
622
622
|
return {
|
|
623
|
-
token: I.tokens[
|
|
624
|
-
metadata:
|
|
623
|
+
token: I.tokens[S],
|
|
624
|
+
metadata: wt(
|
|
625
625
|
e,
|
|
626
626
|
o._languageService,
|
|
627
|
-
|
|
627
|
+
C.tokens[(y << 1) + 1]
|
|
628
628
|
)
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
const
|
|
631
|
+
const de = re(void 0), kn = ({
|
|
632
632
|
children: n,
|
|
633
633
|
url: e,
|
|
634
634
|
qodly: t,
|
|
635
635
|
defaultZoom: i,
|
|
636
636
|
openHandler: o,
|
|
637
|
-
language:
|
|
637
|
+
language: l = "4d",
|
|
638
638
|
defaultInited: r = !1
|
|
639
639
|
}) => {
|
|
640
|
-
const I =
|
|
641
|
-
|
|
642
|
-
e && I &&
|
|
640
|
+
const I = we(), [C, S] = _(r), [y, p] = _(null), m = ne(), N = ne(0);
|
|
641
|
+
M(() => {
|
|
642
|
+
e && I && x();
|
|
643
643
|
}, [e, I]);
|
|
644
|
-
const
|
|
644
|
+
const x = async () => {
|
|
645
645
|
if (!I)
|
|
646
646
|
return;
|
|
647
647
|
const d = new Ve({
|
|
648
648
|
enabled: process.env.NODE_ENV === "development",
|
|
649
649
|
debugEnabled: process.env.NODE_ENV === "development"
|
|
650
|
-
}),
|
|
650
|
+
}), g = await ft({
|
|
651
651
|
logger: d
|
|
652
652
|
});
|
|
653
|
-
await
|
|
653
|
+
await Xe({
|
|
654
654
|
caller: "Qodly Code Editor",
|
|
655
655
|
logger: d,
|
|
656
|
-
serviceConfig:
|
|
657
|
-
}), o &&
|
|
658
|
-
|
|
659
|
-
t ?
|
|
656
|
+
serviceConfig: g
|
|
657
|
+
}), o && at.get(gt).registerCodeEditorOpenHandler(o), I.languages.registerCompletionItemProvider(
|
|
658
|
+
l,
|
|
659
|
+
t ? St : vt
|
|
660
660
|
);
|
|
661
|
-
const
|
|
662
|
-
q.getDefaultKeybindings = () =>
|
|
661
|
+
const c = q.getDefaultKeybindings.bind(q);
|
|
662
|
+
q.getDefaultKeybindings = () => c().filter(
|
|
663
663
|
(Z) => ![
|
|
664
664
|
"workbench.action.files.saveAs",
|
|
665
665
|
"workbench.action.files.save"
|
|
666
666
|
].includes(Z.command)
|
|
667
|
-
),
|
|
668
|
-
},
|
|
669
|
-
|
|
667
|
+
), ae.addKeybindingRules(yt), h();
|
|
668
|
+
}, h = () => {
|
|
669
|
+
p(null);
|
|
670
670
|
let d;
|
|
671
671
|
try {
|
|
672
672
|
d = new WebSocket(localStorage.LSP_SERVER || e);
|
|
673
673
|
} catch {
|
|
674
|
-
|
|
674
|
+
p(new Event("INVALID_URL"));
|
|
675
675
|
return;
|
|
676
676
|
}
|
|
677
|
-
d.onopen =
|
|
678
|
-
},
|
|
679
|
-
const d =
|
|
677
|
+
d.onopen = R, d.onclose = f, d.onerror = k, N.current = 0;
|
|
678
|
+
}, R = async function() {
|
|
679
|
+
const d = $e(this), g = new At(d), c = new pt(d), W = new Ze({
|
|
680
680
|
name: "4D Language Client",
|
|
681
681
|
clientOptions: {
|
|
682
682
|
workspaceFolder: {
|
|
683
|
-
uri:
|
|
683
|
+
uri: Me.parse("file:///PACKAGE")
|
|
684
684
|
},
|
|
685
685
|
// use a language id as a document selector
|
|
686
|
-
documentSelector: [{ scheme: "file", language:
|
|
686
|
+
documentSelector: [{ scheme: "file", language: l }],
|
|
687
687
|
// disable the default error handler
|
|
688
688
|
errorHandler: {
|
|
689
|
-
error: () => ({ action:
|
|
690
|
-
closed: () => ({ action:
|
|
689
|
+
error: () => ({ action: Ye.Continue }),
|
|
690
|
+
closed: () => ({ action: He.DoNotRestart })
|
|
691
691
|
}
|
|
692
692
|
},
|
|
693
693
|
// create a language client connection from the JSON RPC connection on demand
|
|
694
694
|
connectionProvider: {
|
|
695
695
|
get: () => Promise.resolve({
|
|
696
|
-
reader:
|
|
697
|
-
writer:
|
|
696
|
+
reader: g,
|
|
697
|
+
writer: c
|
|
698
698
|
})
|
|
699
699
|
}
|
|
700
700
|
});
|
|
701
|
-
|
|
701
|
+
m.current = W;
|
|
702
702
|
const Z = W.sendRequest.bind(W);
|
|
703
|
-
|
|
704
|
-
return typeof
|
|
703
|
+
m.current.sendRequest = function(O, V, U) {
|
|
704
|
+
return typeof O == "object" && O.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
|
|
705
705
|
V.textDocument.uri
|
|
706
|
-
) ? Promise.resolve() : Z(
|
|
707
|
-
},
|
|
708
|
-
W.stop(),
|
|
709
|
-
|
|
710
|
-
}, 1e3) :
|
|
711
|
-
}), W.needsStart() && await W.start(),
|
|
712
|
-
},
|
|
713
|
-
},
|
|
714
|
-
|
|
706
|
+
) ? Promise.resolve() : Z(O, V, U);
|
|
707
|
+
}, g.onClose(() => {
|
|
708
|
+
W.stop(), N.current < 3 ? setTimeout(() => {
|
|
709
|
+
N.current++, h();
|
|
710
|
+
}, 1e3) : p(new Event("WEBSOCKET_CLOSED"));
|
|
711
|
+
}), W.needsStart() && await W.start(), S(!0);
|
|
712
|
+
}, f = () => {
|
|
713
|
+
}, k = (d) => {
|
|
714
|
+
p(d);
|
|
715
715
|
};
|
|
716
|
-
|
|
717
|
-
const d =
|
|
718
|
-
switch (
|
|
716
|
+
M(() => {
|
|
717
|
+
const d = Le.subscribe(({ action: g, payload: c }) => {
|
|
718
|
+
switch (g) {
|
|
719
719
|
case X.WILL_SAVE:
|
|
720
|
-
L(
|
|
720
|
+
L(c.filePath);
|
|
721
721
|
break;
|
|
722
722
|
case X.DID_SAVE:
|
|
723
|
-
|
|
723
|
+
K(c.filePath, c.content);
|
|
724
724
|
break;
|
|
725
725
|
case X.WILL_CREATE:
|
|
726
|
-
|
|
726
|
+
b(c.filePath);
|
|
727
727
|
break;
|
|
728
728
|
case X.DID_CREATE:
|
|
729
|
-
|
|
729
|
+
Ae(c.filePath);
|
|
730
730
|
break;
|
|
731
731
|
case X.WILL_RENAME:
|
|
732
|
-
|
|
732
|
+
B(c.oldPath, c.newPath);
|
|
733
733
|
break;
|
|
734
734
|
case X.DID_RENAME:
|
|
735
|
-
|
|
735
|
+
pe(c.oldPath, c.newPath);
|
|
736
736
|
break;
|
|
737
737
|
case X.WILL_DELETE:
|
|
738
|
-
|
|
738
|
+
P(c.filePath);
|
|
739
739
|
break;
|
|
740
740
|
case X.DID_DELETE:
|
|
741
|
-
|
|
741
|
+
be(c.filePath);
|
|
742
742
|
break;
|
|
743
743
|
case X.DIAGNOSTIC_REFRESH:
|
|
744
|
-
|
|
744
|
+
v(c.filePath);
|
|
745
745
|
break;
|
|
746
746
|
}
|
|
747
747
|
});
|
|
748
748
|
return () => d.unsubscribe();
|
|
749
749
|
}, []);
|
|
750
|
-
const
|
|
751
|
-
var
|
|
752
|
-
return (
|
|
750
|
+
const A = (d) => {
|
|
751
|
+
var g, c;
|
|
752
|
+
return (c = (g = m.current) == null ? void 0 : g._features) == null ? void 0 : c.find(
|
|
753
753
|
(W) => {
|
|
754
754
|
var Z;
|
|
755
755
|
return ((Z = W._registrationType) == null ? void 0 : Z.method) === d;
|
|
756
756
|
}
|
|
757
757
|
);
|
|
758
|
-
},
|
|
759
|
-
const
|
|
760
|
-
if (
|
|
761
|
-
for (const [W, Z] of
|
|
762
|
-
Z.provider &&
|
|
763
|
-
return
|
|
764
|
-
},
|
|
765
|
-
var Z,
|
|
766
|
-
const W =
|
|
767
|
-
|
|
758
|
+
}, a = (d) => {
|
|
759
|
+
const g = [], c = A(d);
|
|
760
|
+
if (c)
|
|
761
|
+
for (const [W, Z] of c._registrations)
|
|
762
|
+
Z.provider && g.push(Z.provider);
|
|
763
|
+
return g;
|
|
764
|
+
}, u = async (d, g, c) => {
|
|
765
|
+
var Z, O, V;
|
|
766
|
+
const W = a(
|
|
767
|
+
lt.method
|
|
768
768
|
);
|
|
769
769
|
if (W[0]) {
|
|
770
|
-
const U = new
|
|
770
|
+
const U = new Pe(), ee = await Promise.resolve(
|
|
771
771
|
W[0].full.provideDocumentSemanticTokens(
|
|
772
|
-
|
|
772
|
+
g,
|
|
773
773
|
U.token
|
|
774
774
|
)
|
|
775
|
-
),
|
|
776
|
-
|
|
777
|
-
|
|
775
|
+
), te = d, he = ee ? Rt(
|
|
776
|
+
g,
|
|
777
|
+
te._themeService,
|
|
778
778
|
{
|
|
779
|
-
tokens:
|
|
780
|
-
legend: (V = (
|
|
779
|
+
tokens: ee,
|
|
780
|
+
legend: (V = (O = (Z = m.current) == null ? void 0 : Z._capabilities) == null ? void 0 : O.semanticTokensProvider) == null ? void 0 : V.legend
|
|
781
781
|
},
|
|
782
|
-
|
|
783
|
-
) : null,
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
782
|
+
c
|
|
783
|
+
) : null, ve = kt(
|
|
784
|
+
g,
|
|
785
|
+
te._themeService,
|
|
786
|
+
c
|
|
787
787
|
);
|
|
788
788
|
return {
|
|
789
|
-
semanticTokenInfo:
|
|
790
|
-
textmateTokenInfo:
|
|
789
|
+
semanticTokenInfo: he,
|
|
790
|
+
textmateTokenInfo: ve
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
793
|
return null;
|
|
794
|
-
},
|
|
795
|
-
if (
|
|
796
|
-
const
|
|
797
|
-
|
|
794
|
+
}, v = (d) => {
|
|
795
|
+
if (m.current) {
|
|
796
|
+
const g = a(
|
|
797
|
+
Ue.method
|
|
798
798
|
);
|
|
799
|
-
for (const
|
|
800
|
-
|
|
799
|
+
for (const c of g)
|
|
800
|
+
c.onDidChangeDiagnosticsEmitter.fire();
|
|
801
801
|
}
|
|
802
|
-
}, L = (d,
|
|
803
|
-
var
|
|
804
|
-
(
|
|
802
|
+
}, L = (d, g = Qe.Manual) => {
|
|
803
|
+
var c;
|
|
804
|
+
(c = m.current) == null || c.sendNotification(qe.type, {
|
|
805
805
|
textDocument: {
|
|
806
806
|
uri: j(d)
|
|
807
807
|
},
|
|
808
|
-
reason:
|
|
808
|
+
reason: g
|
|
809
809
|
});
|
|
810
|
-
},
|
|
811
|
-
var
|
|
812
|
-
(
|
|
810
|
+
}, K = (d, g) => {
|
|
811
|
+
var c;
|
|
812
|
+
(c = m.current) == null || c.sendNotification(et.type, {
|
|
813
813
|
textDocument: {
|
|
814
814
|
uri: j(d)
|
|
815
815
|
},
|
|
816
|
-
text:
|
|
816
|
+
text: g
|
|
817
817
|
});
|
|
818
|
-
},
|
|
819
|
-
var
|
|
820
|
-
(
|
|
818
|
+
}, b = (d) => {
|
|
819
|
+
var g;
|
|
820
|
+
(g = m.current) == null || g.sendRequest(tt.type, {
|
|
821
821
|
files: [
|
|
822
822
|
{
|
|
823
823
|
uri: j(d)
|
|
824
824
|
}
|
|
825
825
|
]
|
|
826
826
|
});
|
|
827
|
-
},
|
|
828
|
-
var
|
|
829
|
-
(
|
|
827
|
+
}, B = (d, g) => {
|
|
828
|
+
var c;
|
|
829
|
+
(c = m.current) == null || c.sendRequest(nt.type, {
|
|
830
830
|
files: [
|
|
831
831
|
{
|
|
832
832
|
oldUri: j(d),
|
|
833
|
-
newUri: j(
|
|
833
|
+
newUri: j(g)
|
|
834
834
|
}
|
|
835
835
|
]
|
|
836
836
|
});
|
|
837
|
-
},
|
|
838
|
-
var
|
|
839
|
-
(
|
|
837
|
+
}, P = (d) => {
|
|
838
|
+
var g;
|
|
839
|
+
(g = m.current) == null || g.sendRequest(it.type, {
|
|
840
840
|
files: [
|
|
841
841
|
{
|
|
842
842
|
uri: j(d)
|
|
843
843
|
}
|
|
844
844
|
]
|
|
845
845
|
});
|
|
846
|
-
},
|
|
847
|
-
var
|
|
848
|
-
(
|
|
846
|
+
}, Ae = (d) => {
|
|
847
|
+
var g;
|
|
848
|
+
(g = m.current) == null || g.sendNotification(ot.type, {
|
|
849
849
|
files: [
|
|
850
850
|
{
|
|
851
851
|
uri: j(d)
|
|
852
852
|
}
|
|
853
853
|
]
|
|
854
854
|
});
|
|
855
|
-
},
|
|
856
|
-
var
|
|
857
|
-
(
|
|
855
|
+
}, pe = (d, g) => {
|
|
856
|
+
var c;
|
|
857
|
+
(c = m.current) == null || c.sendNotification(rt.type, {
|
|
858
858
|
files: [
|
|
859
859
|
{
|
|
860
860
|
oldUri: j(d),
|
|
861
|
-
newUri: j(
|
|
861
|
+
newUri: j(g)
|
|
862
862
|
}
|
|
863
863
|
]
|
|
864
864
|
});
|
|
865
|
-
},
|
|
866
|
-
var
|
|
867
|
-
(
|
|
865
|
+
}, be = (d) => {
|
|
866
|
+
var g;
|
|
867
|
+
(g = m.current) == null || g.sendNotification(st.type, {
|
|
868
868
|
files: [
|
|
869
869
|
{
|
|
870
870
|
uri: j(d)
|
|
@@ -872,35 +872,35 @@ const ue = oe(void 0), wn = ({
|
|
|
872
872
|
]
|
|
873
873
|
});
|
|
874
874
|
};
|
|
875
|
-
return /* @__PURE__ */
|
|
876
|
-
|
|
875
|
+
return /* @__PURE__ */ J(
|
|
876
|
+
de.Provider,
|
|
877
877
|
{
|
|
878
878
|
value: {
|
|
879
|
-
inited:
|
|
880
|
-
clientRef:
|
|
881
|
-
lastError:
|
|
882
|
-
reload:
|
|
883
|
-
getTokenAtPosition:
|
|
879
|
+
inited: C || !!y,
|
|
880
|
+
clientRef: m,
|
|
881
|
+
lastError: y,
|
|
882
|
+
reload: h,
|
|
883
|
+
getTokenAtPosition: u
|
|
884
884
|
},
|
|
885
885
|
children: [
|
|
886
886
|
n,
|
|
887
|
-
/* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ w(Nt, { defaultZoom: i })
|
|
888
888
|
]
|
|
889
889
|
}
|
|
890
890
|
);
|
|
891
891
|
};
|
|
892
|
-
function
|
|
893
|
-
const n =
|
|
892
|
+
function Ln() {
|
|
893
|
+
const n = se(de);
|
|
894
894
|
if (n === void 0)
|
|
895
895
|
throw new Error("useLSP must be used within an LSPContext");
|
|
896
896
|
return n;
|
|
897
897
|
}
|
|
898
|
-
const
|
|
898
|
+
const Ie = re(
|
|
899
899
|
void 0
|
|
900
|
-
),
|
|
901
|
-
const [e, t] =
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
|
|
900
|
+
), Wn = Re(({ children: n }) => {
|
|
901
|
+
const [e, t] = _(null);
|
|
902
|
+
return /* @__PURE__ */ w(
|
|
903
|
+
Ie.Provider,
|
|
904
904
|
{
|
|
905
905
|
value: {
|
|
906
906
|
editor: e,
|
|
@@ -910,8 +910,8 @@ const de = oe(
|
|
|
910
910
|
}
|
|
911
911
|
);
|
|
912
912
|
});
|
|
913
|
-
function
|
|
914
|
-
const n =
|
|
913
|
+
function Lt() {
|
|
914
|
+
const n = se(Ie), e = _(null);
|
|
915
915
|
if (n === void 0) {
|
|
916
916
|
const [t, i] = e;
|
|
917
917
|
return {
|
|
@@ -921,22 +921,22 @@ function kt() {
|
|
|
921
921
|
}
|
|
922
922
|
return n;
|
|
923
923
|
}
|
|
924
|
-
var
|
|
924
|
+
var Ce = {
|
|
925
925
|
color: void 0,
|
|
926
926
|
size: void 0,
|
|
927
927
|
className: void 0,
|
|
928
928
|
style: void 0,
|
|
929
929
|
attr: void 0
|
|
930
|
-
},
|
|
931
|
-
return
|
|
930
|
+
}, ie = T.createContext && T.createContext(Ce), E = globalThis && globalThis.__assign || function() {
|
|
931
|
+
return E = Object.assign || function(n) {
|
|
932
932
|
for (var e, t = 1, i = arguments.length; t < i; t++) {
|
|
933
933
|
e = arguments[t];
|
|
934
934
|
for (var o in e)
|
|
935
935
|
Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
|
|
936
936
|
}
|
|
937
937
|
return n;
|
|
938
|
-
},
|
|
939
|
-
},
|
|
938
|
+
}, E.apply(this, arguments);
|
|
939
|
+
}, Wt = globalThis && globalThis.__rest || function(n, e) {
|
|
940
940
|
var t = {};
|
|
941
941
|
for (var i in n)
|
|
942
942
|
Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
@@ -945,64 +945,64 @@ var Ie = {
|
|
|
945
945
|
e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[o]) && (t[i[o]] = n[i[o]]);
|
|
946
946
|
return t;
|
|
947
947
|
};
|
|
948
|
-
function
|
|
948
|
+
function me(n) {
|
|
949
949
|
return n && n.map(function(e, t) {
|
|
950
|
-
return
|
|
950
|
+
return T.createElement(e.tag, E({
|
|
951
951
|
key: t
|
|
952
|
-
}, e.attr),
|
|
952
|
+
}, e.attr), me(e.child));
|
|
953
953
|
});
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function fe(n) {
|
|
956
956
|
return function(e) {
|
|
957
|
-
return
|
|
958
|
-
attr:
|
|
959
|
-
}, e),
|
|
957
|
+
return T.createElement(Ft, E({
|
|
958
|
+
attr: E({}, n.attr)
|
|
959
|
+
}, e), me(n.child));
|
|
960
960
|
};
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function Ft(n) {
|
|
963
963
|
var e = function(t) {
|
|
964
|
-
var i = n.attr, o = n.size,
|
|
965
|
-
return t.className && (
|
|
964
|
+
var i = n.attr, o = n.size, l = n.title, r = Wt(n, ["attr", "size", "title"]), I = o || t.size || "1em", C;
|
|
965
|
+
return t.className && (C = t.className), n.className && (C = (C ? C + " " : "") + n.className), T.createElement("svg", E({
|
|
966
966
|
stroke: "currentColor",
|
|
967
967
|
fill: "currentColor",
|
|
968
968
|
strokeWidth: "0"
|
|
969
969
|
}, t.attr, i, r, {
|
|
970
|
-
className:
|
|
971
|
-
style:
|
|
970
|
+
className: C,
|
|
971
|
+
style: E(E({
|
|
972
972
|
color: n.color || t.color
|
|
973
973
|
}, t.style), n.style),
|
|
974
974
|
height: I,
|
|
975
975
|
width: I,
|
|
976
976
|
xmlns: "http://www.w3.org/2000/svg"
|
|
977
|
-
}),
|
|
977
|
+
}), l && T.createElement("title", null, l), n.children);
|
|
978
978
|
};
|
|
979
|
-
return
|
|
979
|
+
return ie !== void 0 ? T.createElement(ie.Consumer, null, function(t) {
|
|
980
980
|
return e(t);
|
|
981
|
-
}) : e(
|
|
982
|
-
}
|
|
983
|
-
function Ft(n) {
|
|
984
|
-
return me({ 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" } }] })(n);
|
|
981
|
+
}) : e(Ce);
|
|
985
982
|
}
|
|
986
983
|
function Zt(n) {
|
|
987
|
-
return
|
|
984
|
+
return fe({ 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" } }] })(n);
|
|
988
985
|
}
|
|
989
|
-
|
|
986
|
+
function jt(n) {
|
|
987
|
+
return fe({ 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" } }] })(n);
|
|
988
|
+
}
|
|
989
|
+
const Xt = ({
|
|
990
990
|
lspProps: { lastError: n, reload: e }
|
|
991
991
|
}) => {
|
|
992
|
-
const [t, i] =
|
|
992
|
+
const [t, i] = _(!1), o = () => {
|
|
993
993
|
e();
|
|
994
|
-
},
|
|
994
|
+
}, l = () => {
|
|
995
995
|
i(!1);
|
|
996
996
|
};
|
|
997
|
-
return
|
|
997
|
+
return M(() => {
|
|
998
998
|
i(!!n);
|
|
999
|
-
}, [n]), t ? /* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */
|
|
999
|
+
}, [n]), t ? /* @__PURE__ */ J("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: [
|
|
1000
|
+
/* @__PURE__ */ J("span", { className: "flex flex-1 justify-center gap-1", children: [
|
|
1001
|
+
/* @__PURE__ */ w(jt, { className: "h-4 w-4 text-yellow-600" }),
|
|
1002
|
+
/* @__PURE__ */ J("span", { children: [
|
|
1003
1003
|
"LSP not loaded.",
|
|
1004
1004
|
" ",
|
|
1005
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ w(
|
|
1006
1006
|
"button",
|
|
1007
1007
|
{
|
|
1008
1008
|
className: "text-primary-dark underline",
|
|
@@ -1012,24 +1012,24 @@ const jt = ({
|
|
|
1012
1012
|
)
|
|
1013
1013
|
] })
|
|
1014
1014
|
] }),
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
|
|
1015
|
+
/* @__PURE__ */ w("button", { className: "focus:outline-none", children: /* @__PURE__ */ w(
|
|
1016
|
+
Zt,
|
|
1017
1017
|
{
|
|
1018
1018
|
className: "h-4 w-4 text-white",
|
|
1019
|
-
onClick:
|
|
1019
|
+
onClick: l
|
|
1020
1020
|
}
|
|
1021
1021
|
) })
|
|
1022
1022
|
] }) : null;
|
|
1023
|
-
},
|
|
1023
|
+
}, Et = {
|
|
1024
1024
|
provideCompletionItems: (n, e) => {
|
|
1025
1025
|
const t = n.getWordUntilPosition(e);
|
|
1026
1026
|
return {
|
|
1027
1027
|
suggestions: [
|
|
1028
1028
|
{
|
|
1029
1029
|
label: "device:xs",
|
|
1030
|
-
kind:
|
|
1030
|
+
kind: s.languages.CompletionItemKind.Snippet,
|
|
1031
1031
|
documentation: "Media query for phone device",
|
|
1032
|
-
range: new
|
|
1032
|
+
range: new s.Range(
|
|
1033
1033
|
e.lineNumber,
|
|
1034
1034
|
t.startColumn,
|
|
1035
1035
|
e.lineNumber,
|
|
@@ -1043,7 +1043,7 @@ const jt = ({
|
|
|
1043
1043
|
"}"
|
|
1044
1044
|
].join(`
|
|
1045
1045
|
`),
|
|
1046
|
-
insertTextRules:
|
|
1046
|
+
insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
|
1047
1047
|
}
|
|
1048
1048
|
]
|
|
1049
1049
|
};
|
|
@@ -1316,10 +1316,10 @@ const jt = ({
|
|
|
1316
1316
|
"ref"
|
|
1317
1317
|
]
|
|
1318
1318
|
}
|
|
1319
|
-
},
|
|
1319
|
+
}, Tt = {
|
|
1320
1320
|
$ref: Kt,
|
|
1321
1321
|
definitions: Bt
|
|
1322
|
-
},
|
|
1322
|
+
}, Ot = "array", Dt = {
|
|
1323
1323
|
type: "object",
|
|
1324
1324
|
properties: {
|
|
1325
1325
|
class: {
|
|
@@ -1336,111 +1336,111 @@ const jt = ({
|
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
1338
|
}, Gt = {
|
|
1339
|
-
type:
|
|
1340
|
-
items:
|
|
1339
|
+
type: Ot,
|
|
1340
|
+
items: Dt
|
|
1341
1341
|
};
|
|
1342
|
-
function
|
|
1342
|
+
function Jt(n, e) {
|
|
1343
1343
|
const t = document.createElement("style");
|
|
1344
1344
|
t.dataset.id = e, t.textContent = n, document.head.append(t);
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function Mt(n) {
|
|
1347
1347
|
return Array.from(document.styleSheets).find(
|
|
1348
1348
|
(e) => e.ownerNode.getAttribute("data-id") === n
|
|
1349
1349
|
);
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function Pt(n, e) {
|
|
1352
1352
|
const t = [];
|
|
1353
1353
|
let i = [];
|
|
1354
|
-
const o = [],
|
|
1354
|
+
const o = [], l = (a, u, v, L) => {
|
|
1355
1355
|
t.push({
|
|
1356
|
-
startLineNumber:
|
|
1357
|
-
endLineNumber:
|
|
1358
|
-
startColumn:
|
|
1356
|
+
startLineNumber: a,
|
|
1357
|
+
endLineNumber: v,
|
|
1358
|
+
startColumn: u,
|
|
1359
1359
|
endColumn: L
|
|
1360
|
-
}),
|
|
1361
|
-
}, r = (
|
|
1362
|
-
o.indexOf(
|
|
1363
|
-
}, I = (
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
},
|
|
1367
|
-
for (const
|
|
1360
|
+
}), S(), C();
|
|
1361
|
+
}, r = (a) => {
|
|
1362
|
+
o.indexOf(a) < 0 && o.push(a);
|
|
1363
|
+
}, I = (a) => {
|
|
1364
|
+
const u = o.indexOf(a);
|
|
1365
|
+
u < 0 || o.splice(u, 1);
|
|
1366
|
+
}, C = () => {
|
|
1367
|
+
for (const a of o)
|
|
1368
1368
|
try {
|
|
1369
|
-
|
|
1370
|
-
} catch (
|
|
1371
|
-
console.error(
|
|
1369
|
+
a(i);
|
|
1370
|
+
} catch (u) {
|
|
1371
|
+
console.error(u);
|
|
1372
1372
|
}
|
|
1373
|
-
},
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1376
|
-
t.map((
|
|
1377
|
-
|
|
1378
|
-
lineNumber:
|
|
1379
|
-
column:
|
|
1373
|
+
}, S = () => {
|
|
1374
|
+
const a = n.getModel();
|
|
1375
|
+
a && (i = Yt(
|
|
1376
|
+
t.map((u) => [
|
|
1377
|
+
a.getOffsetAt({
|
|
1378
|
+
lineNumber: u.startLineNumber,
|
|
1379
|
+
column: u.startColumn
|
|
1380
1380
|
}),
|
|
1381
|
-
|
|
1382
|
-
lineNumber:
|
|
1383
|
-
column:
|
|
1381
|
+
a.getOffsetAt({
|
|
1382
|
+
lineNumber: u.endLineNumber,
|
|
1383
|
+
column: u.endColumn
|
|
1384
1384
|
})
|
|
1385
1385
|
]),
|
|
1386
1386
|
/*mergeJoins*/
|
|
1387
1387
|
!0
|
|
1388
|
-
), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >=
|
|
1389
|
-
},
|
|
1390
|
-
const
|
|
1388
|
+
), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >= a.getValueLength() && (i[i.length - 1][1] = Number.POSITIVE_INFINITY)));
|
|
1389
|
+
}, y = (a) => {
|
|
1390
|
+
const u = {
|
|
1391
1391
|
isDeletion: !1,
|
|
1392
1392
|
isAddition: !1,
|
|
1393
1393
|
isReplacement: !1
|
|
1394
1394
|
};
|
|
1395
|
-
return
|
|
1396
|
-
},
|
|
1397
|
-
|
|
1398
|
-
}),
|
|
1399
|
-
if (!
|
|
1400
|
-
for (const
|
|
1401
|
-
const
|
|
1402
|
-
if (
|
|
1395
|
+
return a.text === "" ? u.isDeletion = !0 : a.range.startLineNumber === a.range.endLineNumber && a.range.startColumn === a.range.endColumn ? u.isAddition = !0 : u.isReplacement = !0, u;
|
|
1396
|
+
}, p = n.onDidChangeModel((a) => {
|
|
1397
|
+
S(), k();
|
|
1398
|
+
}), m = n.onDidChangeModelContent((a) => {
|
|
1399
|
+
if (!a.isUndoing)
|
|
1400
|
+
for (const u of a.changes) {
|
|
1401
|
+
const v = y(u);
|
|
1402
|
+
if (v.isReplacement || v.isDeletion || v.isAddition) {
|
|
1403
1403
|
const L = t.some(
|
|
1404
|
-
(
|
|
1405
|
-
),
|
|
1406
|
-
if (L ||
|
|
1407
|
-
const
|
|
1408
|
-
if (
|
|
1409
|
-
|
|
1404
|
+
(b) => u.range.startLineNumber >= b.startLineNumber && u.range.endLineNumber <= b.endLineNumber && u.range.startColumn >= b.startColumn && u.range.endColumn <= b.endColumn
|
|
1405
|
+
), K = !L && e && u.range.startLineNumber === 1 && u.range.startColumn === 1 && !le(u.text);
|
|
1406
|
+
if (L || K) {
|
|
1407
|
+
const b = n.getModel();
|
|
1408
|
+
if (b) {
|
|
1409
|
+
b.undo();
|
|
1410
1410
|
return;
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
|
-
}),
|
|
1416
|
-
|
|
1415
|
+
}), N = () => {
|
|
1416
|
+
p.dispose(), m.dispose();
|
|
1417
1417
|
};
|
|
1418
|
-
let
|
|
1418
|
+
let x = [], h = `
|
|
1419
1419
|
.idoc-readonly-mark {
|
|
1420
1420
|
cursor: not-allowed;
|
|
1421
1421
|
z-index: 1;
|
|
1422
1422
|
}
|
|
1423
1423
|
`;
|
|
1424
|
-
if (
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1424
|
+
if (h) {
|
|
1425
|
+
const a = "monaco-read-only";
|
|
1426
|
+
Mt(a) || Jt(h, a), h = null;
|
|
1427
1427
|
}
|
|
1428
|
-
const
|
|
1429
|
-
r(
|
|
1430
|
-
},
|
|
1431
|
-
I(
|
|
1432
|
-
},
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
i.map(
|
|
1428
|
+
const R = () => {
|
|
1429
|
+
r(k), k();
|
|
1430
|
+
}, f = () => {
|
|
1431
|
+
I(k), x = n.deltaDecorations(x, []);
|
|
1432
|
+
}, k = () => {
|
|
1433
|
+
const a = n.getModel();
|
|
1434
|
+
a && (x = n.deltaDecorations(
|
|
1435
|
+
x,
|
|
1436
|
+
i.map(A(a))
|
|
1437
1437
|
));
|
|
1438
|
-
},
|
|
1439
|
-
const
|
|
1438
|
+
}, A = (a) => (u) => {
|
|
1439
|
+
const v = a.getPositionAt(u[0]), L = a.getPositionAt(u[1]);
|
|
1440
1440
|
return {
|
|
1441
|
-
range: new
|
|
1442
|
-
|
|
1443
|
-
|
|
1441
|
+
range: new s.Range(
|
|
1442
|
+
v.lineNumber,
|
|
1443
|
+
v.column,
|
|
1444
1444
|
L.lineNumber,
|
|
1445
1445
|
L.column
|
|
1446
1446
|
),
|
|
@@ -1453,57 +1453,57 @@ function Mt(n, e) {
|
|
|
1453
1453
|
get buffer() {
|
|
1454
1454
|
return i;
|
|
1455
1455
|
},
|
|
1456
|
-
exclude:
|
|
1456
|
+
exclude: l,
|
|
1457
1457
|
attach: r,
|
|
1458
1458
|
detach: I,
|
|
1459
|
-
dispose:
|
|
1460
|
-
show:
|
|
1461
|
-
hide:
|
|
1459
|
+
dispose: N,
|
|
1460
|
+
show: R,
|
|
1461
|
+
hide: f
|
|
1462
1462
|
};
|
|
1463
1463
|
}
|
|
1464
1464
|
function Vt(n, e, t) {
|
|
1465
1465
|
let i = !1;
|
|
1466
|
-
const o = (
|
|
1466
|
+
const o = (f) => f[1] < f[0] ? (i = !0, [[f[1], f[0]]]) : [[...f]], l = (f) => i ? f.map((k) => k[1] > k[0] ? I(k) : k).reverse() : f;
|
|
1467
1467
|
let r;
|
|
1468
|
-
const I = (
|
|
1469
|
-
let
|
|
1470
|
-
|
|
1471
|
-
for (
|
|
1472
|
-
for (
|
|
1473
|
-
if (
|
|
1474
|
-
|
|
1475
|
-
[
|
|
1476
|
-
[
|
|
1468
|
+
const I = (f) => (r = f[1], f[1] = f[0], f[0] = r, f), C = o(n);
|
|
1469
|
+
let S, y, p, m, N, x, h, R;
|
|
1470
|
+
p = C[0];
|
|
1471
|
+
for (y of e)
|
|
1472
|
+
for (h = y[0], R = y[1], m = 0; m < C.length; m++) {
|
|
1473
|
+
if (p = C[m], N = p[0], x = p[1], N < h)
|
|
1474
|
+
x < h ? S = [p] : x <= R ? S = [[N, h - 1]] : S = [
|
|
1475
|
+
[N, h - 1],
|
|
1476
|
+
[R + 1, x]
|
|
1477
1477
|
];
|
|
1478
|
-
else if (
|
|
1479
|
-
if (
|
|
1480
|
-
const
|
|
1481
|
-
|
|
1478
|
+
else if (N <= R)
|
|
1479
|
+
if (h === Number.NEGATIVE_INFINITY) {
|
|
1480
|
+
const f = R + 1;
|
|
1481
|
+
S = t === 0 ? [] : [[f, x > f ? x : f]];
|
|
1482
1482
|
} else
|
|
1483
|
-
|
|
1483
|
+
R === Number.POSITIVE_INFINITY ? S = t === 0 ? [] : [[h - 1, h - 1]] : x <= R ? S = t < 0 ? [[h - 1, h - 1]] : t > 0 ? [[R + 1, R + 1]] : [] : S = [[R + 1, x]];
|
|
1484
1484
|
else
|
|
1485
|
-
|
|
1486
|
-
if (
|
|
1487
|
-
return
|
|
1485
|
+
S = [p];
|
|
1486
|
+
if (C.splice(m, 1, ...S), C.length === 1 && C[0][1] < h)
|
|
1487
|
+
return l(C);
|
|
1488
1488
|
}
|
|
1489
|
-
return
|
|
1489
|
+
return l(C);
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function Yt(n, e) {
|
|
1492
1492
|
if (n.length < 2)
|
|
1493
1493
|
return n;
|
|
1494
1494
|
const t = [];
|
|
1495
|
-
let i = null, o,
|
|
1495
|
+
let i = null, o, l;
|
|
1496
1496
|
n = n.map(
|
|
1497
1497
|
(r) => (r[1] < r[0] && (o = r[1], r[1] = r[0], r[1] = o), r)
|
|
1498
1498
|
).sort((r, I) => r[0] - I[0]), t.push(n[0]);
|
|
1499
1499
|
for (let r = 1; r < n.length; r++)
|
|
1500
|
-
i = t[t.length - 1],
|
|
1500
|
+
i = t[t.length - 1], l = n[r], i[1] === l[0] && !e ? t.push(l) : i[1] === l[0] - 1 && e ? (i[1] = l[1], t.splice(t.length - 1, 1, i)) : i[1] < l[0] ? t.push(l) : i[1] < l[1] && (i[1] = l[1], t.splice(t.length - 1, 1, i));
|
|
1501
1501
|
return t;
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1503
|
+
function H(n, e) {
|
|
1504
1504
|
return e.bind(n);
|
|
1505
1505
|
}
|
|
1506
|
-
class
|
|
1506
|
+
class Ht {
|
|
1507
1507
|
constructor(e, t) {
|
|
1508
1508
|
F(this, "editor");
|
|
1509
1509
|
F(this, "intervals");
|
|
@@ -1516,7 +1516,7 @@ class Yt {
|
|
|
1516
1516
|
/**
|
|
1517
1517
|
* Linked to ICodeEditor.onDidChangeCursorPosition event.
|
|
1518
1518
|
*/
|
|
1519
|
-
F(this, "onCursor",
|
|
1519
|
+
F(this, "onCursor", H(
|
|
1520
1520
|
this,
|
|
1521
1521
|
function(e) {
|
|
1522
1522
|
if (e.source === "api")
|
|
@@ -1525,17 +1525,17 @@ class Yt {
|
|
|
1525
1525
|
t.length !== 0 && this.editor.setSelections(t);
|
|
1526
1526
|
}
|
|
1527
1527
|
));
|
|
1528
|
-
F(this, "onRectangleSelectionStart",
|
|
1528
|
+
F(this, "onRectangleSelectionStart", H(this, function({ event: e }) {
|
|
1529
1529
|
e.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
|
|
1530
1530
|
}));
|
|
1531
|
-
F(this, "onRectangleSelectionStop",
|
|
1531
|
+
F(this, "onRectangleSelectionStop", H(this, function() {
|
|
1532
1532
|
this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
|
|
1533
1533
|
}));
|
|
1534
1534
|
/**
|
|
1535
1535
|
* Linked to ICodeEditor.onKeyDown event.
|
|
1536
1536
|
*/
|
|
1537
|
-
F(this, "onKey",
|
|
1538
|
-
const t = e.keyCode, i =
|
|
1537
|
+
F(this, "onKey", H(this, function(e) {
|
|
1538
|
+
const t = e.keyCode, i = s.KeyCode;
|
|
1539
1539
|
if (e.altKey || i.F1 <= t && t <= i.F19 || e.ctrlKey && t !== i.Backspace)
|
|
1540
1540
|
return;
|
|
1541
1541
|
if (t === i.UpArrow || t === i.LeftArrow || t === i.Home || t === i.PageUp) {
|
|
@@ -1546,24 +1546,24 @@ class Yt {
|
|
|
1546
1546
|
this.prefer = 1;
|
|
1547
1547
|
return;
|
|
1548
1548
|
}
|
|
1549
|
-
const o = this.getSelections(),
|
|
1549
|
+
const o = this.getSelections(), l = this.intervals.buffer;
|
|
1550
1550
|
let r;
|
|
1551
1551
|
if (t === i.Delete)
|
|
1552
|
-
r = (I) => I[0] === I[1] &&
|
|
1552
|
+
r = (I) => I[0] === I[1] && l.find((C) => I[1] + 1 === C[0]) != null;
|
|
1553
1553
|
else if (t === i.Backspace)
|
|
1554
|
-
r = (I) => I[0] === I[1] &&
|
|
1554
|
+
r = (I) => I[0] === I[1] && l.find((C) => C[1] + 1 === I[0]) != null;
|
|
1555
1555
|
else
|
|
1556
1556
|
return;
|
|
1557
1557
|
o.findIndex(r) !== -1 && (e.stopPropagation(), e.preventDefault());
|
|
1558
1558
|
}));
|
|
1559
|
-
F(this, "getOffsetAt",
|
|
1559
|
+
F(this, "getOffsetAt", H(this, function(e) {
|
|
1560
1560
|
let t;
|
|
1561
1561
|
for (let i = 0; i < this.intervals.buffer.length; i++)
|
|
1562
1562
|
if (t = this.intervals.buffer[i], e <= t[1])
|
|
1563
1563
|
return t[0] - e < e - t[1] ? t[0] : t[1];
|
|
1564
1564
|
}));
|
|
1565
1565
|
var i;
|
|
1566
|
-
this.editor = e, this.intervals =
|
|
1566
|
+
this.editor = e, this.intervals = Pt(e, t), (i = this.editor.getModel()) == null || i.setEOL(s.editor.EndOfLineSequence.LF);
|
|
1567
1567
|
}
|
|
1568
1568
|
enable() {
|
|
1569
1569
|
this.disposables.push(
|
|
@@ -1589,12 +1589,12 @@ class Yt {
|
|
|
1589
1589
|
this.prefer
|
|
1590
1590
|
)
|
|
1591
1591
|
).flat().map((i) => {
|
|
1592
|
-
const o = e.getPositionAt(i[0]),
|
|
1593
|
-
return new
|
|
1592
|
+
const o = e.getPositionAt(i[0]), l = e.getPositionAt(i[1]);
|
|
1593
|
+
return new s.Selection(
|
|
1594
1594
|
o.lineNumber,
|
|
1595
1595
|
o.column,
|
|
1596
|
-
|
|
1597
|
-
|
|
1596
|
+
l.lineNumber,
|
|
1597
|
+
l.column
|
|
1598
1598
|
);
|
|
1599
1599
|
});
|
|
1600
1600
|
}
|
|
@@ -1612,105 +1612,108 @@ class Yt {
|
|
|
1612
1612
|
]);
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
|
-
const
|
|
1616
|
-
/* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
/* @__PURE__ */
|
|
1620
|
-
/* @__PURE__ */
|
|
1621
|
-
] }) }) }),
|
|
1615
|
+
const zt = new RegExp("^[ s]+(exposed|Function)", "i"), oe = () => /* @__PURE__ */ w("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ w("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ J("div", { className: "space-y-2", children: [
|
|
1616
|
+
/* @__PURE__ */ w("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
|
|
1617
|
+
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1618
|
+
/* @__PURE__ */ w("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
|
|
1619
|
+
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1620
|
+
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" })
|
|
1621
|
+
] }) }) }), Q = ["fd-dark"], Fn = ({
|
|
1622
1622
|
path: n,
|
|
1623
1623
|
initialValue: e,
|
|
1624
1624
|
type: t,
|
|
1625
1625
|
language: i,
|
|
1626
1626
|
onChange: o,
|
|
1627
|
-
options:
|
|
1627
|
+
options: l = {},
|
|
1628
1628
|
extra: r = {},
|
|
1629
1629
|
showAlerts: I = !1,
|
|
1630
|
-
lspProps:
|
|
1631
|
-
|
|
1630
|
+
lspProps: C,
|
|
1631
|
+
theme: S = Q[0],
|
|
1632
|
+
...y
|
|
1632
1633
|
}) => {
|
|
1633
|
-
const { initialLineInfo:
|
|
1634
|
-
function
|
|
1635
|
-
i === "css" &&
|
|
1634
|
+
const { initialLineInfo: p, initialSelectionInfo: m } = r, { editor: N, setEditor: x } = Lt(), { inited: h } = C;
|
|
1635
|
+
function R(A) {
|
|
1636
|
+
i === "css" && A.languages.registerCompletionItemProvider("css", Et), i === "json" && A.languages.json && A.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1636
1637
|
validate: !0,
|
|
1637
1638
|
schemas: [
|
|
1638
1639
|
{
|
|
1639
1640
|
uri: "condition-schema.json",
|
|
1640
1641
|
fileMatch: ["*.condition.json"],
|
|
1641
|
-
schema:
|
|
1642
|
+
schema: Tt
|
|
1642
1643
|
},
|
|
1643
1644
|
{
|
|
1644
1645
|
uri: "handlers-schema.json",
|
|
1645
|
-
fileMatch: [
|
|
1646
|
+
fileMatch: [We],
|
|
1646
1647
|
schema: Gt
|
|
1647
1648
|
}
|
|
1648
1649
|
]
|
|
1649
1650
|
});
|
|
1650
1651
|
}
|
|
1651
|
-
function
|
|
1652
|
-
|
|
1653
|
-
const
|
|
1654
|
-
if (
|
|
1655
|
-
var
|
|
1656
|
-
const
|
|
1657
|
-
if (
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1652
|
+
function f(A, a) {
|
|
1653
|
+
x(A);
|
|
1654
|
+
const u = A.getModel();
|
|
1655
|
+
if (u && (u.updateOptions({ insertSpaces: !1 }), A.onKeyUp(() => {
|
|
1656
|
+
var L;
|
|
1657
|
+
const v = (L = A.getPosition()) == null ? void 0 : L.lineNumber;
|
|
1658
|
+
if (v) {
|
|
1659
|
+
const K = u.getLineFirstNonWhitespaceColumn(v), b = u.getLineLength(v), B = u.getLineContent(v);
|
|
1660
|
+
zt.test(B) && A.executeEdits("edit-handler", [
|
|
1660
1661
|
{
|
|
1661
|
-
range: new
|
|
1662
|
-
|
|
1662
|
+
range: new a.Range(
|
|
1663
|
+
v,
|
|
1663
1664
|
0,
|
|
1664
|
-
|
|
1665
|
-
|
|
1665
|
+
v,
|
|
1666
|
+
b
|
|
1666
1667
|
),
|
|
1667
1668
|
text: B.substr(
|
|
1668
|
-
|
|
1669
|
-
|
|
1669
|
+
K - 1,
|
|
1670
|
+
b - K
|
|
1670
1671
|
)
|
|
1671
1672
|
}
|
|
1672
1673
|
]);
|
|
1673
1674
|
}
|
|
1674
|
-
})), t ===
|
|
1675
|
-
const
|
|
1676
|
-
|
|
1675
|
+
})), t === Fe.METHOD && le(e)) {
|
|
1676
|
+
const v = new Ht(A, !0);
|
|
1677
|
+
v.exclude(1, 1, 1, Number.POSITIVE_INFINITY), v.enable();
|
|
1677
1678
|
}
|
|
1678
1679
|
}
|
|
1679
|
-
|
|
1680
|
-
if (!
|
|
1680
|
+
M(() => {
|
|
1681
|
+
if (!N)
|
|
1681
1682
|
return;
|
|
1682
|
-
const { line:
|
|
1683
|
-
|
|
1684
|
-
}, [
|
|
1685
|
-
if (!
|
|
1683
|
+
const { line: A, offset: a } = p || {};
|
|
1684
|
+
A && ht(N, A, a);
|
|
1685
|
+
}, [p, N]), M(() => {
|
|
1686
|
+
if (!N)
|
|
1686
1687
|
return;
|
|
1687
|
-
const { selection:
|
|
1688
|
-
|
|
1689
|
-
}, [
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1688
|
+
const { selection: A } = m || {};
|
|
1689
|
+
A && bt(N, A);
|
|
1690
|
+
}, [m, N]);
|
|
1691
|
+
const k = (A) => Q.includes(A) ? A : Q[0];
|
|
1692
|
+
return h ? /* @__PURE__ */ J(Ne, { children: [
|
|
1693
|
+
I ? /* @__PURE__ */ w(Xt, { lspProps: C }) : null,
|
|
1694
|
+
/* @__PURE__ */ w(
|
|
1695
|
+
ke,
|
|
1693
1696
|
{
|
|
1694
1697
|
options: {
|
|
1695
1698
|
readOnly: !0,
|
|
1696
1699
|
fontSize: 12,
|
|
1697
1700
|
"semanticHighlighting.enabled": !0,
|
|
1698
1701
|
padding: { top: 10 },
|
|
1699
|
-
...
|
|
1702
|
+
...l
|
|
1700
1703
|
},
|
|
1701
1704
|
path: j(n),
|
|
1702
1705
|
value: e,
|
|
1703
|
-
theme:
|
|
1704
|
-
onChange: (
|
|
1706
|
+
theme: k(S),
|
|
1707
|
+
onChange: (A) => o && o(A || ""),
|
|
1705
1708
|
language: i,
|
|
1706
|
-
beforeMount:
|
|
1707
|
-
onMount:
|
|
1708
|
-
loading: /* @__PURE__ */
|
|
1709
|
-
...
|
|
1709
|
+
beforeMount: R,
|
|
1710
|
+
onMount: f,
|
|
1711
|
+
loading: /* @__PURE__ */ w(oe, {}),
|
|
1712
|
+
...y
|
|
1710
1713
|
}
|
|
1711
1714
|
)
|
|
1712
|
-
] }) : /* @__PURE__ */
|
|
1713
|
-
},
|
|
1715
|
+
] }) : /* @__PURE__ */ w(oe, {});
|
|
1716
|
+
}, _t = {
|
|
1714
1717
|
name: "4d",
|
|
1715
1718
|
displayName: "%displayName%",
|
|
1716
1719
|
description: "%description%",
|
|
@@ -1735,7 +1738,7 @@ const Ht = new RegExp("^[ s]+(exposed|Function)", "i"), ie = () => /* @__PURE__
|
|
|
1735
1738
|
}
|
|
1736
1739
|
]
|
|
1737
1740
|
}
|
|
1738
|
-
}, { registerFileUrl: $, whenReady:
|
|
1741
|
+
}, { registerFileUrl: $, whenReady: Zn } = ct(_t, void 0, {
|
|
1739
1742
|
system: !0
|
|
1740
1743
|
});
|
|
1741
1744
|
$(
|
|
@@ -1759,18 +1762,19 @@ $(
|
|
|
1759
1762
|
{ mimeType: "application/json", size: 135 }
|
|
1760
1763
|
);
|
|
1761
1764
|
export {
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1765
|
+
Xt as Alerts,
|
|
1766
|
+
Fn as CodeEditor,
|
|
1767
|
+
Wn as CodeEditorProvider,
|
|
1768
|
+
kn as LSPProvider,
|
|
1769
|
+
Q as SUPPORTED_THEMES,
|
|
1770
|
+
ge as _await,
|
|
1771
|
+
ft as configureServices,
|
|
1768
1772
|
j as getFileSystemPath,
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1773
|
+
wn as getFunctionOffset,
|
|
1774
|
+
mt as initMonacoUserConfiguration,
|
|
1775
|
+
ht as jumpToLine,
|
|
1776
|
+
bt as jumpToSelection,
|
|
1777
|
+
Lt as useCodeEditor,
|
|
1778
|
+
Ln as useLSP
|
|
1775
1779
|
};
|
|
1776
1780
|
//# sourceMappingURL=index.es.js.map
|