@ws-ui/code-editor 1.9.2 → 1.10.0
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/index.es.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { loader as
|
|
4
|
-
import { lspSubject as
|
|
5
|
-
import { MonacoLanguageClient as
|
|
6
|
-
import { mergeServices as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { jsxs as _, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import D, { useEffect as M, createContext as ge, useState as z, useRef as oe, useContext as ce, memo as Ne } from "react";
|
|
3
|
+
import { loader as Re, useMonaco as we, Editor as xe } from "@monaco-editor/react";
|
|
4
|
+
import { getNodeInfo as Fe, DesignerRequestVerb as Le, lspSubject as ke, LspActions as E, hasAttributesString as ue, FileFolderType as ie, SourceCodeDescriptor as We, HTTP_HANDLERS_TAB_PATH as Ze } from "@ws-ui/shared";
|
|
5
|
+
import { MonacoLanguageClient as je } from "monaco-languageclient";
|
|
6
|
+
import { mergeServices as Xe, initServices as Ee } from "monaco-languageclient/vscode/services";
|
|
7
|
+
import Ke, { initUserConfiguration as Be } from "@codingame/monaco-vscode-configuration-service-override";
|
|
8
|
+
import Te from "@codingame/monaco-vscode-languages-service-override";
|
|
9
|
+
import De from "@codingame/monaco-vscode-textmate-service-override";
|
|
10
10
|
import "@codingame/monaco-vscode-theme-defaults-default-extension";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import Oe from "@codingame/monaco-vscode-editor-service-override";
|
|
12
|
+
import Ge from "@codingame/monaco-vscode-theme-service-override";
|
|
13
|
+
import { registerFileSystemOverlay as Je } from "@codingame/monaco-vscode-files-service-override";
|
|
14
|
+
import { FileSystemProviderCapabilities as re, FileType as Me } from "vscode/vscode/vs/platform/files/common/files";
|
|
15
|
+
import { Emitter as se } from "vscode/vscode/vs/base/common/event";
|
|
16
|
+
import { Logger as Pe } from "monaco-languageclient/tools";
|
|
17
|
+
import { CloseAction as Ve, ErrorAction as Ye } from "vscode-languageclient";
|
|
13
18
|
import * as l from "monaco-editor";
|
|
14
|
-
import { Selection as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { TextDocumentSaveReason as ze, DocumentDiagnosticRequest as $e, WillSaveTextDocumentNotification as _e, DidSaveTextDocumentNotification as Ue, WillCreateFilesRequest as qe, WillRenameFilesRequest as Qe, WillDeleteFilesRequest as et, DidCreateFilesNotification as tt, DidRenameFilesNotification as nt, DidDeleteFilesNotification as it, SemanticTokensRegistrationType as ot } from "vscode-languageserver-protocol";
|
|
19
|
-
import { StandaloneServices as rt, ICodeEditorService as st } from "vscode/services";
|
|
19
|
+
import { Selection as He, KeyMod as G, KeyCode as J, editor as de, Range as _e, Uri as ze, CancellationTokenSource as $e } from "monaco-editor";
|
|
20
|
+
import { WebSocketMessageReader as Ue, WebSocketMessageWriter as qe, toSocket as Qe } from "vscode-ws-jsonrpc";
|
|
21
|
+
import { TextDocumentSaveReason as et, DocumentDiagnosticRequest as tt, WillSaveTextDocumentNotification as nt, DidSaveTextDocumentNotification as it, WillCreateFilesRequest as ot, WillRenameFilesRequest as rt, WillDeleteFilesRequest as st, DidCreateFilesNotification as lt, DidRenameFilesNotification as at, DidDeleteFilesNotification as gt, SemanticTokensRegistrationType as ct } from "vscode-languageserver-protocol";
|
|
22
|
+
import { StandaloneServices as ut, ICodeEditorService as dt } from "vscode/services";
|
|
20
23
|
import { KeybindingsRegistry as te } from "vscode/monaco";
|
|
21
24
|
import "@codingame/monaco-vscode-standalone-languages";
|
|
22
25
|
import "@codingame/monaco-vscode-standalone-html-language-features";
|
|
@@ -27,14 +30,14 @@ import "@codingame/monaco-vscode-css-default-extension";
|
|
|
27
30
|
import "@codingame/monaco-vscode-json-default-extension";
|
|
28
31
|
import "@codingame/monaco-vscode-html-default-extension";
|
|
29
32
|
import "@codingame/monaco-vscode-javascript-default-extension";
|
|
30
|
-
import { registerExtension as
|
|
31
|
-
const
|
|
33
|
+
import { registerExtension as It } from "vscode/extensions";
|
|
34
|
+
const Ct = () => Ke(), mt = () => Oe(
|
|
32
35
|
() => Promise.resolve(void 0)
|
|
33
|
-
),
|
|
34
|
-
const
|
|
36
|
+
), ft = () => {
|
|
37
|
+
const n = Ge(), e = n.themeService.ctor.prototype;
|
|
35
38
|
return e.defineTheme = () => {
|
|
36
|
-
},
|
|
37
|
-
},
|
|
39
|
+
}, n;
|
|
40
|
+
}, pt = `{
|
|
38
41
|
"workbench.colorTheme": "Default Dark+",
|
|
39
42
|
"workbench.iconTheme": "vs-seti",
|
|
40
43
|
"editor.autoClosingBrackets": "languageDefined",
|
|
@@ -119,106 +122,152 @@ const at = () => Ze(), gt = () => Ke(
|
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
|
|
125
|
+
`;
|
|
126
|
+
class At {
|
|
127
|
+
constructor() {
|
|
128
|
+
this._onDidChangeCapabilities = new se(), this.onDidChangeCapabilities = this._onDidChangeCapabilities.event, this._onDidChangeFile = new se(), this.onDidChangeFile = this._onDidChangeFile.event, this.capabilities = re.FileReadWrite | re.FileOpenReadWriteClose, this.files = /* @__PURE__ */ new Map();
|
|
129
|
+
}
|
|
130
|
+
// --- stat()
|
|
131
|
+
async stat(e) {
|
|
132
|
+
const t = this.files.get(e.fsPath), i = Date.now();
|
|
133
|
+
return {
|
|
134
|
+
type: Me.File,
|
|
135
|
+
ctime: 0,
|
|
136
|
+
mtime: i,
|
|
137
|
+
size: t ? t.byteLength : 0
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// --- mkdir()
|
|
141
|
+
async mkdir(e) {
|
|
142
|
+
}
|
|
143
|
+
// --- readdir()
|
|
144
|
+
async readdir(e) {
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
// --- readFile()
|
|
148
|
+
async readFile(e) {
|
|
149
|
+
const i = e.toString().split("/"), o = i.length, [r, s] = i.slice(o - 2), m = await Fe({
|
|
150
|
+
verb: Le.GET_INFO,
|
|
151
|
+
path: `${r}/${s}`,
|
|
152
|
+
content: !0,
|
|
153
|
+
as: "text"
|
|
154
|
+
}), d = new TextEncoder().encode(m.content);
|
|
155
|
+
return this.files.set(e.fsPath, d), d;
|
|
156
|
+
}
|
|
157
|
+
// --- writeFile()
|
|
158
|
+
async writeFile(e, t) {
|
|
159
|
+
const i = e.toString();
|
|
160
|
+
this.files.set(i, t), this._onDidChangeFile.fire([
|
|
161
|
+
{ type: 1, resource: e }
|
|
162
|
+
// FileChangeType.Updated
|
|
163
|
+
]);
|
|
164
|
+
}
|
|
165
|
+
// --- delete()
|
|
166
|
+
async delete(e) {
|
|
167
|
+
const t = e.toString();
|
|
168
|
+
this.files.delete(t);
|
|
169
|
+
}
|
|
170
|
+
// --- rename()
|
|
171
|
+
async rename(e, t) {
|
|
172
|
+
const i = e.toString(), o = t.toString(), r = this.files.get(i);
|
|
173
|
+
r && (this.files.set(o, r), this.files.delete(i));
|
|
174
|
+
}
|
|
175
|
+
// --- watch()
|
|
176
|
+
watch(e, t) {
|
|
177
|
+
return { dispose() {
|
|
178
|
+
} };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const bt = () => Be(pt), ht = async (n) => {
|
|
123
182
|
var o;
|
|
124
|
-
const e =
|
|
125
|
-
e.debugLogging = ((o =
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
183
|
+
const e = n.serviceConfig ?? {};
|
|
184
|
+
e.debugLogging = ((o = n.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || n.logger.isDebugEnabled() === !0), await bt(), e.userServices = e.userServices ?? {};
|
|
185
|
+
const t = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
|
|
186
|
+
if (t === void 0) {
|
|
128
187
|
if (i)
|
|
129
188
|
throw new Error(
|
|
130
189
|
"You provided a workspaceConfig without using the configurationServiceOverride"
|
|
131
190
|
);
|
|
132
191
|
const r = {
|
|
133
192
|
// @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
|
|
134
|
-
...
|
|
135
|
-
...
|
|
136
|
-
...
|
|
137
|
-
...
|
|
138
|
-
...
|
|
193
|
+
...Ct(),
|
|
194
|
+
...ft(),
|
|
195
|
+
...De(),
|
|
196
|
+
...Te(),
|
|
197
|
+
...mt()
|
|
139
198
|
};
|
|
140
|
-
|
|
199
|
+
Xe(r, e.userServices);
|
|
141
200
|
}
|
|
142
|
-
return
|
|
143
|
-
workspaceProvider: {
|
|
144
|
-
trusted: !0,
|
|
145
|
-
workspace: {
|
|
146
|
-
workspaceUri: l.Uri.file("/workspace")
|
|
147
|
-
},
|
|
148
|
-
async open() {
|
|
149
|
-
return !1;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}), e;
|
|
201
|
+
return Je(1, new At()), e;
|
|
153
202
|
};
|
|
154
|
-
class
|
|
155
|
-
constructor(e,
|
|
156
|
-
super(e), this.onMessage =
|
|
203
|
+
class vt extends Ue {
|
|
204
|
+
constructor(e, t) {
|
|
205
|
+
super(e), this.onMessage = t;
|
|
157
206
|
}
|
|
158
207
|
readMessage(e) {
|
|
159
208
|
this.onMessage && this.onMessage();
|
|
160
|
-
const [,
|
|
209
|
+
const [, t] = e.split(`\r
|
|
161
210
|
\r
|
|
162
211
|
`);
|
|
163
212
|
if (this.state === "initial")
|
|
164
|
-
this.events.splice(0, 0, { message:
|
|
213
|
+
this.events.splice(0, 0, { message: t });
|
|
165
214
|
else if (this.state === "listening") {
|
|
166
|
-
const i = JSON.parse(
|
|
215
|
+
const i = JSON.parse(t);
|
|
167
216
|
this.callback(i);
|
|
168
217
|
}
|
|
169
218
|
}
|
|
170
219
|
}
|
|
171
|
-
class
|
|
172
|
-
constructor(e,
|
|
173
|
-
super(e), this.onSend =
|
|
220
|
+
class St extends qe {
|
|
221
|
+
constructor(e, t) {
|
|
222
|
+
super(e), this.onSend = t;
|
|
174
223
|
}
|
|
175
224
|
async write(e) {
|
|
176
225
|
try {
|
|
177
|
-
const
|
|
178
|
-
this.socket.send(
|
|
179
|
-
} catch (
|
|
180
|
-
this.errorCount++, this.fireError(
|
|
226
|
+
const t = JSON.stringify(e);
|
|
227
|
+
this.socket.send(t), this.onSend && this.onSend();
|
|
228
|
+
} catch (t) {
|
|
229
|
+
this.errorCount++, this.fireError(t, e, this.errorCount);
|
|
181
230
|
}
|
|
182
231
|
}
|
|
183
232
|
}
|
|
184
|
-
function j(
|
|
185
|
-
const
|
|
186
|
-
return e ? `file://${
|
|
233
|
+
function j(n, e = !0) {
|
|
234
|
+
const t = `/PACKAGE/Project/Sources/${n}`;
|
|
235
|
+
return e ? `file://${t}` : t;
|
|
187
236
|
}
|
|
188
|
-
function
|
|
189
|
-
setTimeout(
|
|
237
|
+
function Ie(n, e = 0) {
|
|
238
|
+
setTimeout(n, e);
|
|
190
239
|
}
|
|
191
|
-
function
|
|
192
|
-
const
|
|
240
|
+
function yt(n, e) {
|
|
241
|
+
const t = new He(
|
|
193
242
|
e.startLineNumber,
|
|
194
243
|
e.startColumn,
|
|
195
244
|
e.endLineNumber || e.startLineNumber,
|
|
196
245
|
e.endColumn || e.startColumn
|
|
197
246
|
);
|
|
198
|
-
|
|
199
|
-
|
|
247
|
+
Ie(() => {
|
|
248
|
+
n.setSelection(t), n.revealRangeInCenter(t), n.focus();
|
|
200
249
|
});
|
|
201
250
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
204
|
-
|
|
251
|
+
function Nt(n, e, t = 0) {
|
|
252
|
+
t > 0 && (e = t + e), Ie(() => {
|
|
253
|
+
n.setPosition({ lineNumber: e, column: 1 }), n.revealLineInCenter(e), n.focus();
|
|
205
254
|
});
|
|
206
255
|
}
|
|
207
|
-
function
|
|
208
|
-
const o =
|
|
256
|
+
function Xn(n, e, t) {
|
|
257
|
+
const o = n.getModel();
|
|
209
258
|
if (o && e) {
|
|
210
259
|
const r = o.getLineCount();
|
|
211
260
|
for (let s = 1; s <= r; s++) {
|
|
212
|
-
const
|
|
213
|
-
if (new RegExp(`(?:Function|function) ${
|
|
261
|
+
const m = o.getLineContent(s);
|
|
262
|
+
if (new RegExp(`(?:Function|function) ${t}`).test(m))
|
|
214
263
|
return s;
|
|
215
264
|
}
|
|
216
265
|
}
|
|
217
266
|
return 0;
|
|
218
267
|
}
|
|
219
|
-
const
|
|
220
|
-
provideCompletionItems: async (
|
|
221
|
-
const
|
|
268
|
+
const Rt = {
|
|
269
|
+
provideCompletionItems: async (n, e) => {
|
|
270
|
+
const t = n.getWordUntilPosition(e);
|
|
222
271
|
return {
|
|
223
272
|
suggestions: [
|
|
224
273
|
{
|
|
@@ -226,9 +275,9 @@ const At = {
|
|
|
226
275
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
227
276
|
range: new l.Range(
|
|
228
277
|
e.lineNumber,
|
|
229
|
-
|
|
278
|
+
t.startColumn,
|
|
230
279
|
e.lineNumber,
|
|
231
|
-
|
|
280
|
+
t.endColumn
|
|
232
281
|
),
|
|
233
282
|
insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
|
|
234
283
|
`),
|
|
@@ -239,9 +288,9 @@ const At = {
|
|
|
239
288
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
240
289
|
range: new l.Range(
|
|
241
290
|
e.lineNumber,
|
|
242
|
-
|
|
291
|
+
t.startColumn,
|
|
243
292
|
e.lineNumber,
|
|
244
|
-
|
|
293
|
+
t.endColumn
|
|
245
294
|
),
|
|
246
295
|
insertText: [
|
|
247
296
|
"While(${1:expression})",
|
|
@@ -256,9 +305,9 @@ const At = {
|
|
|
256
305
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
257
306
|
range: new l.Range(
|
|
258
307
|
e.lineNumber,
|
|
259
|
-
|
|
308
|
+
t.startColumn,
|
|
260
309
|
e.lineNumber,
|
|
261
|
-
|
|
310
|
+
t.endColumn
|
|
262
311
|
),
|
|
263
312
|
insertText: [
|
|
264
313
|
"Case of",
|
|
@@ -274,9 +323,9 @@ const At = {
|
|
|
274
323
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
275
324
|
range: new l.Range(
|
|
276
325
|
e.lineNumber,
|
|
277
|
-
|
|
326
|
+
t.startColumn,
|
|
278
327
|
e.lineNumber,
|
|
279
|
-
|
|
328
|
+
t.endColumn
|
|
280
329
|
),
|
|
281
330
|
insertText: ["Else", " "].join(`
|
|
282
331
|
`),
|
|
@@ -287,9 +336,9 @@ const At = {
|
|
|
287
336
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
288
337
|
range: new l.Range(
|
|
289
338
|
e.lineNumber,
|
|
290
|
-
|
|
339
|
+
t.startColumn,
|
|
291
340
|
e.lineNumber,
|
|
292
|
-
|
|
341
|
+
t.endColumn
|
|
293
342
|
),
|
|
294
343
|
insertText: ["If (${1:expression})", " ${5:body}", "End if"].join(
|
|
295
344
|
`
|
|
@@ -302,9 +351,9 @@ const At = {
|
|
|
302
351
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
303
352
|
range: new l.Range(
|
|
304
353
|
e.lineNumber,
|
|
305
|
-
|
|
354
|
+
t.startColumn,
|
|
306
355
|
e.lineNumber,
|
|
307
|
-
|
|
356
|
+
t.endColumn
|
|
308
357
|
),
|
|
309
358
|
insertText: [
|
|
310
359
|
"For(${1:counter};${2:start};${3:end}${4:;increment})",
|
|
@@ -319,9 +368,9 @@ const At = {
|
|
|
319
368
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
320
369
|
range: new l.Range(
|
|
321
370
|
e.lineNumber,
|
|
322
|
-
|
|
371
|
+
t.startColumn,
|
|
323
372
|
e.lineNumber,
|
|
324
|
-
|
|
373
|
+
t.endColumn
|
|
325
374
|
),
|
|
326
375
|
insertText: [
|
|
327
376
|
"Function ${1:function_name}(${2:params}) -> ${3:var_name} : ${4:var_type}",
|
|
@@ -333,9 +382,9 @@ const At = {
|
|
|
333
382
|
]
|
|
334
383
|
};
|
|
335
384
|
}
|
|
336
|
-
},
|
|
337
|
-
provideCompletionItems: async (
|
|
338
|
-
const
|
|
385
|
+
}, wt = {
|
|
386
|
+
provideCompletionItems: async (n, e) => {
|
|
387
|
+
const t = n.getWordUntilPosition(e);
|
|
339
388
|
return {
|
|
340
389
|
suggestions: [
|
|
341
390
|
{
|
|
@@ -343,9 +392,9 @@ const At = {
|
|
|
343
392
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
344
393
|
range: new l.Range(
|
|
345
394
|
e.lineNumber,
|
|
346
|
-
|
|
395
|
+
t.startColumn,
|
|
347
396
|
e.lineNumber,
|
|
348
|
-
|
|
397
|
+
t.endColumn
|
|
349
398
|
),
|
|
350
399
|
insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
|
|
351
400
|
`),
|
|
@@ -356,9 +405,9 @@ const At = {
|
|
|
356
405
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
357
406
|
range: new l.Range(
|
|
358
407
|
e.lineNumber,
|
|
359
|
-
|
|
408
|
+
t.startColumn,
|
|
360
409
|
e.lineNumber,
|
|
361
|
-
|
|
410
|
+
t.endColumn
|
|
362
411
|
),
|
|
363
412
|
insertText: ["while(${1:expression})", " ${2:body}", "end"].join(
|
|
364
413
|
`
|
|
@@ -371,9 +420,9 @@ const At = {
|
|
|
371
420
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
372
421
|
range: new l.Range(
|
|
373
422
|
e.lineNumber,
|
|
374
|
-
|
|
423
|
+
t.startColumn,
|
|
375
424
|
e.lineNumber,
|
|
376
|
-
|
|
425
|
+
t.endColumn
|
|
377
426
|
),
|
|
378
427
|
insertText: [
|
|
379
428
|
"switch",
|
|
@@ -389,9 +438,9 @@ const At = {
|
|
|
389
438
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
390
439
|
range: new l.Range(
|
|
391
440
|
e.lineNumber,
|
|
392
|
-
|
|
441
|
+
t.startColumn,
|
|
393
442
|
e.lineNumber,
|
|
394
|
-
|
|
443
|
+
t.endColumn
|
|
395
444
|
),
|
|
396
445
|
insertText: ["else", " "].join(`
|
|
397
446
|
`),
|
|
@@ -402,9 +451,9 @@ const At = {
|
|
|
402
451
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
403
452
|
range: new l.Range(
|
|
404
453
|
e.lineNumber,
|
|
405
|
-
|
|
454
|
+
t.startColumn,
|
|
406
455
|
e.lineNumber,
|
|
407
|
-
|
|
456
|
+
t.endColumn
|
|
408
457
|
),
|
|
409
458
|
insertText: ["if (${1:expression})", " ${5:body}", "end"].join(
|
|
410
459
|
`
|
|
@@ -417,9 +466,9 @@ const At = {
|
|
|
417
466
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
418
467
|
range: new l.Range(
|
|
419
468
|
e.lineNumber,
|
|
420
|
-
|
|
469
|
+
t.startColumn,
|
|
421
470
|
e.lineNumber,
|
|
422
|
-
|
|
471
|
+
t.endColumn
|
|
423
472
|
),
|
|
424
473
|
insertText: [
|
|
425
474
|
"for(${1:counter},${2:start},${3:end}${4:,increment})",
|
|
@@ -434,9 +483,9 @@ const At = {
|
|
|
434
483
|
kind: l.languages.CompletionItemKind.Snippet,
|
|
435
484
|
range: new l.Range(
|
|
436
485
|
e.lineNumber,
|
|
437
|
-
|
|
486
|
+
t.startColumn,
|
|
438
487
|
e.lineNumber,
|
|
439
|
-
|
|
488
|
+
t.endColumn
|
|
440
489
|
),
|
|
441
490
|
insertText: [
|
|
442
491
|
"function ${1:function_name}(${2:params}) -> ${3:var_name} : ${4:var_type}",
|
|
@@ -448,7 +497,7 @@ const At = {
|
|
|
448
497
|
]
|
|
449
498
|
};
|
|
450
499
|
}
|
|
451
|
-
},
|
|
500
|
+
}, xt = [
|
|
452
501
|
// zoom in
|
|
453
502
|
{
|
|
454
503
|
keybinding: G.CtrlCmd | J.NumpadAdd,
|
|
@@ -476,16 +525,16 @@ const At = {
|
|
|
476
525
|
keybinding: G.CtrlCmd | J.Digit0,
|
|
477
526
|
command: "editor.action.fontZoomReset"
|
|
478
527
|
}
|
|
479
|
-
],
|
|
480
|
-
|
|
528
|
+
], Ft = ({ defaultZoom: n }) => (M(() => {
|
|
529
|
+
n !== void 0 && de.EditorZoom.setZoomLevel(n);
|
|
481
530
|
}, []), null);
|
|
482
|
-
|
|
531
|
+
Re.config({
|
|
483
532
|
monaco: l
|
|
484
533
|
// paths: {
|
|
485
534
|
// vs: import.meta.env.VITE_MONACO_EDITOR_CDN,
|
|
486
535
|
// },
|
|
487
536
|
});
|
|
488
|
-
var H = /* @__PURE__ */ ((
|
|
537
|
+
var H = /* @__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))(H || {}), Ce = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.DefaultForeground = 1] = "DefaultForeground", n[n.DefaultBackground = 2] = "DefaultBackground", n))(Ce || {}), me = /* @__PURE__ */ ((n) => (n[n.Other = 0] = "Other", n[n.Comment = 1] = "Comment", n[n.String = 2] = "String", n[n.RegEx = 3] = "RegEx", n))(me || {});
|
|
489
538
|
class V {
|
|
490
539
|
static getLanguageId(e) {
|
|
491
540
|
return (e & 255) >>> 0;
|
|
@@ -510,17 +559,17 @@ class V {
|
|
|
510
559
|
const o = this.getFontStyle(e);
|
|
511
560
|
return o & 1 && (i += " mtki"), o & 2 && (i += " mtkb"), o & 4 && (i += " mtku"), o & 8 && (i += " mtks"), i;
|
|
512
561
|
}
|
|
513
|
-
static getInlineStyleFromMetadata(e,
|
|
562
|
+
static getInlineStyleFromMetadata(e, t) {
|
|
514
563
|
const i = this.getForeground(e), o = this.getFontStyle(e);
|
|
515
|
-
let r = `color: ${
|
|
564
|
+
let r = `color: ${t[i]};`;
|
|
516
565
|
o & 1 && (r += "font-style: italic;"), o & 2 && (r += "font-weight: bold;");
|
|
517
566
|
let s = "";
|
|
518
567
|
return o & 4 && (s += " underline"), o & 8 && (s += " line-through"), s && (r += `text-decoration:${s};`), r;
|
|
519
568
|
}
|
|
520
569
|
static getPresentationFromMetadata(e) {
|
|
521
|
-
const
|
|
570
|
+
const t = this.getForeground(e), i = this.getFontStyle(e);
|
|
522
571
|
return {
|
|
523
|
-
foreground:
|
|
572
|
+
foreground: t,
|
|
524
573
|
italic: !!(i & 1),
|
|
525
574
|
bold: !!(i & 2),
|
|
526
575
|
underline: !!(i & 4),
|
|
@@ -528,57 +577,57 @@ class V {
|
|
|
528
577
|
};
|
|
529
578
|
}
|
|
530
579
|
}
|
|
531
|
-
function
|
|
532
|
-
const o =
|
|
533
|
-
let s = 0,
|
|
534
|
-
const
|
|
535
|
-
for (let
|
|
536
|
-
const A = o[
|
|
537
|
-
if (
|
|
538
|
-
const
|
|
580
|
+
function Lt(n, e, t, i) {
|
|
581
|
+
const o = t.tokens.data, r = n.getLanguageId();
|
|
582
|
+
let s = 0, m = 0;
|
|
583
|
+
const d = i.lineNumber - 1, h = i.column - 1;
|
|
584
|
+
for (let f = 0; f < o.length; f += 5) {
|
|
585
|
+
const A = o[f], p = o[f + 1], x = o[f + 2], R = o[f + 3], S = o[f + 4], y = s + A, b = A === 0 ? m + p : p;
|
|
586
|
+
if (d === y && b <= h && h < b + x) {
|
|
587
|
+
const I = t.legend.tokenTypes[R] || "not in legend (ignored)", W = [];
|
|
539
588
|
let a = S;
|
|
540
|
-
for (let P = 0; a > 0 && P <
|
|
541
|
-
a & 1 &&
|
|
542
|
-
a > 0 &&
|
|
543
|
-
const g = new
|
|
589
|
+
for (let P = 0; a > 0 && P < t.legend.tokenModifiers.length; P++)
|
|
590
|
+
a & 1 && W.push(t.legend.tokenModifiers[P]), a = a >> 1;
|
|
591
|
+
a > 0 && W.push("not in legend (ignored)");
|
|
592
|
+
const g = new _e(
|
|
544
593
|
y + 1,
|
|
545
594
|
b + 1,
|
|
546
595
|
y + 1,
|
|
547
596
|
b + 1 + x
|
|
548
|
-
),
|
|
549
|
-
|
|
550
|
-
|
|
597
|
+
), F = {}, L = e.getColorTheme().tokenColorMap, v = e.getColorTheme().getTokenStyleMetadata(
|
|
598
|
+
I,
|
|
599
|
+
W,
|
|
551
600
|
r,
|
|
552
601
|
!0,
|
|
553
|
-
|
|
602
|
+
F
|
|
554
603
|
);
|
|
555
|
-
let
|
|
556
|
-
return v && (
|
|
604
|
+
let $;
|
|
605
|
+
return v && ($ = {
|
|
557
606
|
languageId: void 0,
|
|
558
|
-
tokenType:
|
|
607
|
+
tokenType: me.Other,
|
|
559
608
|
bold: v == null ? void 0 : v.bold,
|
|
560
609
|
italic: v == null ? void 0 : v.italic,
|
|
561
610
|
underline: v == null ? void 0 : v.underline,
|
|
562
611
|
strikethrough: v == null ? void 0 : v.strikethrough,
|
|
563
|
-
foreground: L[(v == null ? void 0 : v.foreground) ||
|
|
612
|
+
foreground: L[(v == null ? void 0 : v.foreground) || Ce.None],
|
|
564
613
|
background: void 0
|
|
565
|
-
}), { type:
|
|
614
|
+
}), { type: I, modifiers: W, range: g, metadata: $, definitions: F };
|
|
566
615
|
}
|
|
567
|
-
s = y,
|
|
616
|
+
s = y, m = b;
|
|
568
617
|
}
|
|
569
618
|
return null;
|
|
570
619
|
}
|
|
571
|
-
function
|
|
620
|
+
function kt(n, e, t) {
|
|
572
621
|
let i = null;
|
|
573
|
-
for (let o = 1; o <
|
|
622
|
+
for (let o = 1; o < t; o++)
|
|
574
623
|
i = e.tokenizeLine(
|
|
575
|
-
|
|
624
|
+
n.getLineContent(o),
|
|
576
625
|
i
|
|
577
626
|
).ruleStack;
|
|
578
627
|
return i;
|
|
579
628
|
}
|
|
580
|
-
function
|
|
581
|
-
const i =
|
|
629
|
+
function Wt(n, e, t) {
|
|
630
|
+
const i = n.getColorTheme().tokenColorMap, o = V.getLanguageId(t), r = V.getTokenType(t), s = V.getFontStyle(t), m = V.getForeground(t), d = V.getBackground(t);
|
|
582
631
|
return {
|
|
583
632
|
languageId: e.languageIdCodec.decodeLanguageId(o),
|
|
584
633
|
tokenType: r,
|
|
@@ -586,69 +635,69 @@ function Nt(t, e, n) {
|
|
|
586
635
|
italic: s & H.Italic ? !0 : void 0,
|
|
587
636
|
underline: s & H.Underline ? !0 : void 0,
|
|
588
637
|
strikethrough: s & H.Strikethrough ? !0 : void 0,
|
|
589
|
-
foreground: i[
|
|
590
|
-
background: i[
|
|
638
|
+
foreground: i[m],
|
|
639
|
+
background: i[d]
|
|
591
640
|
};
|
|
592
641
|
}
|
|
593
|
-
function
|
|
594
|
-
const i =
|
|
595
|
-
|
|
642
|
+
function Zt(n, e, t) {
|
|
643
|
+
const i = t.lineNumber, o = n, r = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, s = kt(n, r, i), m = r.tokenizeLine(
|
|
644
|
+
n.getLineContent(i),
|
|
596
645
|
s
|
|
597
|
-
),
|
|
598
|
-
|
|
646
|
+
), d = r.tokenizeLine2(
|
|
647
|
+
n.getLineContent(i),
|
|
599
648
|
s
|
|
600
649
|
);
|
|
601
650
|
let h = 0;
|
|
602
|
-
for (let A =
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
651
|
+
for (let A = m.tokens.length - 1; A >= 0; A--) {
|
|
652
|
+
const p = m.tokens[A];
|
|
653
|
+
if (t.column - 1 >= p.startIndex) {
|
|
605
654
|
h = A;
|
|
606
655
|
break;
|
|
607
656
|
}
|
|
608
657
|
}
|
|
609
|
-
let
|
|
610
|
-
for (let A =
|
|
611
|
-
if (
|
|
612
|
-
|
|
658
|
+
let f = 0;
|
|
659
|
+
for (let A = d.tokens.length >>> 1; A >= 0; A--)
|
|
660
|
+
if (t.column - 1 >= d.tokens[A << 1]) {
|
|
661
|
+
f = A;
|
|
613
662
|
break;
|
|
614
663
|
}
|
|
615
664
|
return {
|
|
616
|
-
token:
|
|
617
|
-
metadata:
|
|
665
|
+
token: m.tokens[h],
|
|
666
|
+
metadata: Wt(
|
|
618
667
|
e,
|
|
619
668
|
o._languageService,
|
|
620
|
-
|
|
669
|
+
d.tokens[(f << 1) + 1]
|
|
621
670
|
)
|
|
622
671
|
};
|
|
623
672
|
}
|
|
624
|
-
const
|
|
625
|
-
children:
|
|
673
|
+
const fe = ge(void 0), En = ({
|
|
674
|
+
children: n,
|
|
626
675
|
url: e,
|
|
627
|
-
qodly:
|
|
676
|
+
qodly: t,
|
|
628
677
|
defaultZoom: i,
|
|
629
678
|
openHandler: o,
|
|
630
679
|
language: r = "4d",
|
|
631
680
|
defaultInited: s = !1
|
|
632
681
|
}) => {
|
|
633
|
-
const
|
|
682
|
+
const m = we(), [d, h] = z(s), [f, A] = z(null), p = oe(), x = oe(0);
|
|
634
683
|
M(() => {
|
|
635
|
-
e &&
|
|
636
|
-
}, [e,
|
|
684
|
+
e && m && R();
|
|
685
|
+
}, [e, m]);
|
|
637
686
|
const R = async () => {
|
|
638
|
-
if (!
|
|
639
|
-
const
|
|
687
|
+
if (!m) return;
|
|
688
|
+
const C = new Pe({
|
|
640
689
|
enabled: process.env.NODE_ENV === "development",
|
|
641
690
|
debugEnabled: process.env.NODE_ENV === "development"
|
|
642
|
-
}), c = await
|
|
643
|
-
logger:
|
|
691
|
+
}), c = await ht({
|
|
692
|
+
logger: C
|
|
644
693
|
});
|
|
645
|
-
await
|
|
694
|
+
await Ee({
|
|
646
695
|
caller: "Qodly Code Editor",
|
|
647
|
-
logger:
|
|
696
|
+
logger: C,
|
|
648
697
|
serviceConfig: c
|
|
649
|
-
}), o &&
|
|
698
|
+
}), o && ut.get(dt).registerCodeEditorOpenHandler(o), m.languages.registerCompletionItemProvider(
|
|
650
699
|
r,
|
|
651
|
-
|
|
700
|
+
t ? wt : Rt
|
|
652
701
|
);
|
|
653
702
|
const u = te.getDefaultKeybindings.bind(te);
|
|
654
703
|
te.getDefaultKeybindings = () => u().filter(
|
|
@@ -656,24 +705,24 @@ const Ce = le(void 0), Rn = ({
|
|
|
656
705
|
"workbench.action.files.saveAs",
|
|
657
706
|
"workbench.action.files.save"
|
|
658
707
|
].includes(Z.command)
|
|
659
|
-
),
|
|
708
|
+
), de.addKeybindingRules(xt), m.languages.registerFoldingRangeProvider(r, {
|
|
660
709
|
provideFoldingRanges: function(N) {
|
|
661
710
|
const Z = [], X = /\\\s*$/;
|
|
662
|
-
for (let
|
|
663
|
-
const U = N.getLineContent(
|
|
711
|
+
for (let k = 1, O = N.getLineCount(); k <= O; k++) {
|
|
712
|
+
const U = N.getLineContent(k);
|
|
664
713
|
if (X.exec(U)) {
|
|
665
|
-
let K =
|
|
666
|
-
for (; K <=
|
|
714
|
+
let K = k + 1;
|
|
715
|
+
for (; K <= O; ) {
|
|
667
716
|
const ee = N.getLineContent(K);
|
|
668
717
|
if (X.exec(ee) == null)
|
|
669
718
|
break;
|
|
670
719
|
K++;
|
|
671
720
|
}
|
|
672
|
-
K >
|
|
673
|
-
start:
|
|
721
|
+
K > k && (Z.push({
|
|
722
|
+
start: k,
|
|
674
723
|
end: K,
|
|
675
|
-
kind:
|
|
676
|
-
}),
|
|
724
|
+
kind: m.languages.FoldingRangeKind.Region
|
|
725
|
+
}), k = K);
|
|
677
726
|
}
|
|
678
727
|
}
|
|
679
728
|
return Z;
|
|
@@ -681,27 +730,27 @@ const Ce = le(void 0), Rn = ({
|
|
|
681
730
|
}), S();
|
|
682
731
|
}, S = () => {
|
|
683
732
|
A(null);
|
|
684
|
-
let
|
|
733
|
+
let C;
|
|
685
734
|
try {
|
|
686
|
-
|
|
735
|
+
C = new WebSocket(localStorage.LSP_SERVER || e);
|
|
687
736
|
} catch {
|
|
688
737
|
A(new Event("INVALID_URL"));
|
|
689
738
|
return;
|
|
690
739
|
}
|
|
691
|
-
|
|
740
|
+
C.onopen = y, C.onclose = b, C.onerror = I, x.current = 0;
|
|
692
741
|
}, y = async function() {
|
|
693
|
-
const
|
|
742
|
+
const C = Qe(this), c = new vt(C), u = new St(C), N = new je({
|
|
694
743
|
name: "4D Language Client",
|
|
695
744
|
clientOptions: {
|
|
696
745
|
workspaceFolder: {
|
|
697
|
-
uri:
|
|
746
|
+
uri: ze.parse("file:///PACKAGE")
|
|
698
747
|
},
|
|
699
748
|
// use a language id as a document selector
|
|
700
749
|
documentSelector: [{ scheme: "file", language: r }],
|
|
701
750
|
// disable the default error handler
|
|
702
751
|
errorHandler: {
|
|
703
|
-
error: () => ({ action:
|
|
704
|
-
closed: () => ({ action:
|
|
752
|
+
error: () => ({ action: Ye.Continue }),
|
|
753
|
+
closed: () => ({ action: Ve.DoNotRestart })
|
|
705
754
|
}
|
|
706
755
|
},
|
|
707
756
|
// create a language client connection from the JSON RPC connection on demand
|
|
@@ -712,23 +761,23 @@ const Ce = le(void 0), Rn = ({
|
|
|
712
761
|
})
|
|
713
762
|
}
|
|
714
763
|
});
|
|
715
|
-
|
|
764
|
+
p.current = N;
|
|
716
765
|
const Z = N.sendRequest.bind(N);
|
|
717
|
-
|
|
766
|
+
p.current.sendRequest = function(X, k, O) {
|
|
718
767
|
return typeof X == "object" && X.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
|
|
719
|
-
|
|
720
|
-
) ? Promise.resolve() : Z(X,
|
|
768
|
+
k.textDocument.uri
|
|
769
|
+
) ? Promise.resolve() : Z(X, k, O);
|
|
721
770
|
}, c.onClose(() => {
|
|
722
771
|
N.stop(), x.current < 3 ? setTimeout(() => {
|
|
723
772
|
x.current++, S();
|
|
724
773
|
}, 1e3) : A(new Event("WEBSOCKET_CLOSED"));
|
|
725
774
|
}), N.needsStart() && await N.start(), h(!0);
|
|
726
775
|
}, b = () => {
|
|
727
|
-
},
|
|
728
|
-
A(
|
|
776
|
+
}, I = (C) => {
|
|
777
|
+
A(C);
|
|
729
778
|
};
|
|
730
779
|
M(() => {
|
|
731
|
-
const
|
|
780
|
+
const C = ke.subscribe(({ action: c, payload: u }) => {
|
|
732
781
|
switch (c) {
|
|
733
782
|
case E.WILL_SAVE:
|
|
734
783
|
L(u.filePath);
|
|
@@ -740,61 +789,61 @@ const Ce = le(void 0), Rn = ({
|
|
|
740
789
|
v(u.filePath);
|
|
741
790
|
break;
|
|
742
791
|
case E.DID_CREATE:
|
|
743
|
-
|
|
792
|
+
ve(u.filePath);
|
|
744
793
|
break;
|
|
745
794
|
case E.WILL_RENAME:
|
|
746
|
-
|
|
795
|
+
$(u.oldPath, u.newPath);
|
|
747
796
|
break;
|
|
748
797
|
case E.DID_RENAME:
|
|
749
|
-
|
|
798
|
+
Se(u.oldPath, u.newPath);
|
|
750
799
|
break;
|
|
751
800
|
case E.WILL_DELETE:
|
|
752
801
|
P(u.filePath);
|
|
753
802
|
break;
|
|
754
803
|
case E.DID_DELETE:
|
|
755
|
-
|
|
804
|
+
ye(u.filePath);
|
|
756
805
|
break;
|
|
757
806
|
case E.DIAGNOSTIC_REFRESH:
|
|
758
|
-
|
|
807
|
+
F(u.filePath);
|
|
759
808
|
break;
|
|
760
809
|
}
|
|
761
810
|
});
|
|
762
|
-
return () =>
|
|
811
|
+
return () => C.unsubscribe();
|
|
763
812
|
}, []);
|
|
764
|
-
const
|
|
813
|
+
const W = (C) => {
|
|
765
814
|
var c, u;
|
|
766
|
-
return (u = (c =
|
|
815
|
+
return (u = (c = p.current) == null ? void 0 : c._features) == null ? void 0 : u.find(
|
|
767
816
|
(N) => {
|
|
768
817
|
var Z;
|
|
769
|
-
return ((Z = N._registrationType) == null ? void 0 : Z.method) ===
|
|
818
|
+
return ((Z = N._registrationType) == null ? void 0 : Z.method) === C;
|
|
770
819
|
}
|
|
771
820
|
);
|
|
772
|
-
}, a = (
|
|
773
|
-
const c = [], u =
|
|
821
|
+
}, a = (C) => {
|
|
822
|
+
const c = [], u = W(C);
|
|
774
823
|
if (u)
|
|
775
824
|
for (const [, N] of u._registrations)
|
|
776
825
|
N.provider && c.push(N.provider);
|
|
777
826
|
return c;
|
|
778
|
-
}, g = async (
|
|
779
|
-
var Z, X,
|
|
827
|
+
}, g = async (C, c, u) => {
|
|
828
|
+
var Z, X, k;
|
|
780
829
|
const N = a(
|
|
781
|
-
|
|
830
|
+
ct.method
|
|
782
831
|
);
|
|
783
832
|
if (N[0]) {
|
|
784
|
-
const
|
|
833
|
+
const O = new $e(), U = await Promise.resolve(
|
|
785
834
|
N[0].full.provideDocumentSemanticTokens(
|
|
786
835
|
c,
|
|
787
|
-
|
|
836
|
+
O.token
|
|
788
837
|
)
|
|
789
|
-
), Q =
|
|
838
|
+
), Q = C, K = U ? Lt(
|
|
790
839
|
c,
|
|
791
840
|
Q._themeService,
|
|
792
841
|
{
|
|
793
842
|
tokens: U,
|
|
794
|
-
legend: (
|
|
843
|
+
legend: (k = (X = (Z = p.current) == null ? void 0 : Z._capabilities) == null ? void 0 : X.semanticTokensProvider) == null ? void 0 : k.legend
|
|
795
844
|
},
|
|
796
845
|
u
|
|
797
|
-
) : null, ee =
|
|
846
|
+
) : null, ee = Zt(
|
|
798
847
|
c,
|
|
799
848
|
Q._themeService,
|
|
800
849
|
u
|
|
@@ -805,139 +854,139 @@ const Ce = le(void 0), Rn = ({
|
|
|
805
854
|
};
|
|
806
855
|
}
|
|
807
856
|
return null;
|
|
808
|
-
},
|
|
809
|
-
if (
|
|
857
|
+
}, F = (C) => {
|
|
858
|
+
if (p.current) {
|
|
810
859
|
const c = a(
|
|
811
|
-
|
|
860
|
+
tt.method
|
|
812
861
|
);
|
|
813
862
|
for (const u of c)
|
|
814
863
|
u.onDidChangeDiagnosticsEmitter.fire();
|
|
815
864
|
}
|
|
816
|
-
}, L = (
|
|
865
|
+
}, L = (C, c = et.Manual) => {
|
|
817
866
|
var u;
|
|
818
|
-
(u =
|
|
867
|
+
(u = p.current) == null || u.sendNotification(nt.type, {
|
|
819
868
|
textDocument: {
|
|
820
|
-
uri: j(
|
|
869
|
+
uri: j(C)
|
|
821
870
|
},
|
|
822
871
|
reason: c
|
|
823
872
|
});
|
|
824
|
-
}, T = (
|
|
873
|
+
}, T = (C, c) => {
|
|
825
874
|
var u;
|
|
826
|
-
(u =
|
|
875
|
+
(u = p.current) == null || u.sendNotification(it.type, {
|
|
827
876
|
textDocument: {
|
|
828
|
-
uri: j(
|
|
877
|
+
uri: j(C)
|
|
829
878
|
},
|
|
830
879
|
text: c
|
|
831
880
|
});
|
|
832
|
-
}, v = (
|
|
881
|
+
}, v = (C) => {
|
|
833
882
|
var c;
|
|
834
|
-
(c =
|
|
883
|
+
(c = p.current) == null || c.sendRequest(ot.type, {
|
|
835
884
|
files: [
|
|
836
885
|
{
|
|
837
|
-
uri: j(
|
|
886
|
+
uri: j(C)
|
|
838
887
|
}
|
|
839
888
|
]
|
|
840
889
|
});
|
|
841
|
-
},
|
|
890
|
+
}, $ = (C, c) => {
|
|
842
891
|
var u;
|
|
843
|
-
(u =
|
|
892
|
+
(u = p.current) == null || u.sendRequest(rt.type, {
|
|
844
893
|
files: [
|
|
845
894
|
{
|
|
846
|
-
oldUri: j(
|
|
895
|
+
oldUri: j(C),
|
|
847
896
|
newUri: j(c)
|
|
848
897
|
}
|
|
849
898
|
]
|
|
850
899
|
});
|
|
851
|
-
}, P = (
|
|
900
|
+
}, P = (C) => {
|
|
852
901
|
var c;
|
|
853
|
-
(c =
|
|
902
|
+
(c = p.current) == null || c.sendRequest(st.type, {
|
|
854
903
|
files: [
|
|
855
904
|
{
|
|
856
|
-
uri: j(
|
|
905
|
+
uri: j(C)
|
|
857
906
|
}
|
|
858
907
|
]
|
|
859
908
|
});
|
|
860
|
-
},
|
|
909
|
+
}, ve = (C) => {
|
|
861
910
|
var c;
|
|
862
|
-
(c =
|
|
911
|
+
(c = p.current) == null || c.sendNotification(lt.type, {
|
|
863
912
|
files: [
|
|
864
913
|
{
|
|
865
|
-
uri: j(
|
|
914
|
+
uri: j(C)
|
|
866
915
|
}
|
|
867
916
|
]
|
|
868
917
|
});
|
|
869
|
-
},
|
|
918
|
+
}, Se = (C, c) => {
|
|
870
919
|
var u;
|
|
871
|
-
(u =
|
|
920
|
+
(u = p.current) == null || u.sendNotification(at.type, {
|
|
872
921
|
files: [
|
|
873
922
|
{
|
|
874
|
-
oldUri: j(
|
|
923
|
+
oldUri: j(C),
|
|
875
924
|
newUri: j(c)
|
|
876
925
|
}
|
|
877
926
|
]
|
|
878
927
|
});
|
|
879
|
-
},
|
|
928
|
+
}, ye = (C) => {
|
|
880
929
|
var c;
|
|
881
|
-
(c =
|
|
930
|
+
(c = p.current) == null || c.sendNotification(gt.type, {
|
|
882
931
|
files: [
|
|
883
932
|
{
|
|
884
|
-
uri: j(
|
|
933
|
+
uri: j(C)
|
|
885
934
|
}
|
|
886
935
|
]
|
|
887
936
|
});
|
|
888
937
|
};
|
|
889
|
-
return /* @__PURE__ */
|
|
890
|
-
|
|
938
|
+
return /* @__PURE__ */ _(
|
|
939
|
+
fe.Provider,
|
|
891
940
|
{
|
|
892
941
|
value: {
|
|
893
|
-
inited:
|
|
894
|
-
clientRef:
|
|
895
|
-
lastError:
|
|
942
|
+
inited: d || !!f,
|
|
943
|
+
clientRef: p,
|
|
944
|
+
lastError: f,
|
|
896
945
|
reload: S,
|
|
897
946
|
getTokenAtPosition: g
|
|
898
947
|
},
|
|
899
948
|
children: [
|
|
900
|
-
|
|
901
|
-
/* @__PURE__ */ w(
|
|
949
|
+
n,
|
|
950
|
+
/* @__PURE__ */ w(Ft, { defaultZoom: i })
|
|
902
951
|
]
|
|
903
952
|
}
|
|
904
953
|
);
|
|
905
954
|
};
|
|
906
|
-
function
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
955
|
+
function Kn() {
|
|
956
|
+
const n = ce(fe);
|
|
957
|
+
if (n === void 0)
|
|
909
958
|
throw new Error("useLSP must be used within an LSPContext");
|
|
910
|
-
return
|
|
959
|
+
return n;
|
|
911
960
|
}
|
|
912
|
-
const
|
|
961
|
+
const pe = ge(
|
|
913
962
|
void 0
|
|
914
|
-
),
|
|
915
|
-
const [e,
|
|
963
|
+
), Bn = Ne(({ children: n }) => {
|
|
964
|
+
const [e, t] = z(null);
|
|
916
965
|
return /* @__PURE__ */ w(
|
|
917
|
-
|
|
966
|
+
pe.Provider,
|
|
918
967
|
{
|
|
919
968
|
value: {
|
|
920
969
|
editor: e,
|
|
921
|
-
setEditor:
|
|
970
|
+
setEditor: t
|
|
922
971
|
},
|
|
923
|
-
children:
|
|
972
|
+
children: n
|
|
924
973
|
}
|
|
925
974
|
);
|
|
926
975
|
});
|
|
927
|
-
function
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
const [
|
|
976
|
+
function jt() {
|
|
977
|
+
const n = ce(pe), e = z(null);
|
|
978
|
+
if (n === void 0) {
|
|
979
|
+
const [t, i] = e;
|
|
931
980
|
return {
|
|
932
|
-
editor:
|
|
981
|
+
editor: t,
|
|
933
982
|
setEditor: i
|
|
934
983
|
};
|
|
935
984
|
}
|
|
936
|
-
return
|
|
985
|
+
return n;
|
|
937
986
|
}
|
|
938
|
-
const
|
|
939
|
-
provideCompletionItems: (
|
|
940
|
-
const
|
|
987
|
+
const Xt = {
|
|
988
|
+
provideCompletionItems: (n, e) => {
|
|
989
|
+
const t = n.getWordUntilPosition(e);
|
|
941
990
|
return {
|
|
942
991
|
suggestions: [
|
|
943
992
|
{
|
|
@@ -946,9 +995,9 @@ const xt = {
|
|
|
946
995
|
documentation: "Media query for phone device",
|
|
947
996
|
range: new l.Range(
|
|
948
997
|
e.lineNumber,
|
|
949
|
-
|
|
998
|
+
t.startColumn,
|
|
950
999
|
e.lineNumber,
|
|
951
|
-
|
|
1000
|
+
t.endColumn
|
|
952
1001
|
),
|
|
953
1002
|
insertText: [
|
|
954
1003
|
"@media screen and (max-width: ${1:365px}) {",
|
|
@@ -963,38 +1012,38 @@ const xt = {
|
|
|
963
1012
|
]
|
|
964
1013
|
};
|
|
965
1014
|
}
|
|
966
|
-
},
|
|
967
|
-
$ref:
|
|
968
|
-
definitions:
|
|
969
|
-
},
|
|
970
|
-
type:
|
|
971
|
-
items:
|
|
1015
|
+
}, Et = "#/definitions/Condition", Kt = { Base: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } }, required: ["id"] }, Condition: { oneOf: [{ $ref: "#/definitions/Datasource" }, { $ref: "#/definitions/Privilege" }, { $ref: "#/definitions/Combination" }, { $ref: "#/definitions/CurrentState" }, { $ref: "#/definitions/ParentState" }, { $ref: "#/definitions/Reference" }] }, Datasource: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "datasource" }, path: { type: "string" }, value: { type: ["number", "string", "boolean", "object", "array", "null"] }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex", "in", "nin", "gt", "gte", "lt", "lte"] } }, required: ["name", "type", "path", "value", "op"] }, Privilege: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "privilege" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Combination: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "combination" }, op: { enum: ["and", "or"] }, conditions: { type: "array", items: { $ref: "#/definitions/Condition" } } }, required: ["type", "conditions", "op"] }, CurrentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "currentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, ParentState: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "parentState" }, value: { type: "string" }, valueType: { enum: ["datasource", "hardCoded"] }, dataType: { enum: ["string", "number", "date", "boolean", "array", "object"] }, op: { enum: ["eq", "neq", "regex"] } }, required: ["name", "type", "value", "op"] }, Reference: { allOf: [{ $ref: "#/definitions/Base" }], properties: { type: { const: "reference" }, ref: { type: "string" } }, required: ["type", "ref"] } }, Bt = {
|
|
1016
|
+
$ref: Et,
|
|
1017
|
+
definitions: Kt
|
|
1018
|
+
}, Tt = "array", Dt = { type: "object", properties: { class: { type: "string" }, method: { type: "string" }, regexPattern: { type: "string" }, verbs: { type: "string" } } }, Ot = {
|
|
1019
|
+
type: Tt,
|
|
1020
|
+
items: Dt
|
|
972
1021
|
};
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
-
|
|
1022
|
+
function Gt(n, e) {
|
|
1023
|
+
const t = document.createElement("style");
|
|
1024
|
+
t.dataset.id = e, t.textContent = n, document.head.append(t);
|
|
976
1025
|
}
|
|
977
|
-
function
|
|
1026
|
+
function Jt(n) {
|
|
978
1027
|
return Array.from(document.styleSheets).find(
|
|
979
|
-
(e) => e.ownerNode.getAttribute("data-id") ===
|
|
1028
|
+
(e) => e.ownerNode.getAttribute("data-id") === n
|
|
980
1029
|
);
|
|
981
1030
|
}
|
|
982
|
-
function
|
|
983
|
-
const
|
|
1031
|
+
function Mt(n, e) {
|
|
1032
|
+
const t = [];
|
|
984
1033
|
let i = [];
|
|
985
|
-
const o = [], r = (a, g,
|
|
986
|
-
|
|
1034
|
+
const o = [], r = (a, g, F, L) => {
|
|
1035
|
+
t.push({
|
|
987
1036
|
startLineNumber: a,
|
|
988
|
-
endLineNumber:
|
|
1037
|
+
endLineNumber: F,
|
|
989
1038
|
startColumn: g,
|
|
990
1039
|
endColumn: L
|
|
991
|
-
}), h(),
|
|
1040
|
+
}), h(), d();
|
|
992
1041
|
}, s = (a) => {
|
|
993
1042
|
o.indexOf(a) < 0 && o.push(a);
|
|
994
|
-
},
|
|
1043
|
+
}, m = (a) => {
|
|
995
1044
|
const g = o.indexOf(a);
|
|
996
1045
|
g < 0 || o.splice(g, 1);
|
|
997
|
-
},
|
|
1046
|
+
}, d = () => {
|
|
998
1047
|
for (const a of o)
|
|
999
1048
|
try {
|
|
1000
1049
|
a(i);
|
|
@@ -1002,9 +1051,9 @@ function Kt(t, e) {
|
|
|
1002
1051
|
console.error(g);
|
|
1003
1052
|
}
|
|
1004
1053
|
}, h = () => {
|
|
1005
|
-
const a =
|
|
1006
|
-
a && (i =
|
|
1007
|
-
|
|
1054
|
+
const a = n.getModel();
|
|
1055
|
+
a && (i = Vt(
|
|
1056
|
+
t.map((g) => [
|
|
1008
1057
|
a.getOffsetAt({
|
|
1009
1058
|
lineNumber: g.startLineNumber,
|
|
1010
1059
|
column: g.startColumn
|
|
@@ -1017,25 +1066,25 @@ function Kt(t, e) {
|
|
|
1017
1066
|
/*mergeJoins*/
|
|
1018
1067
|
!0
|
|
1019
1068
|
), 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)));
|
|
1020
|
-
},
|
|
1069
|
+
}, f = (a) => {
|
|
1021
1070
|
const g = {
|
|
1022
1071
|
isDeletion: !1,
|
|
1023
1072
|
isAddition: !1,
|
|
1024
1073
|
isReplacement: !1
|
|
1025
1074
|
};
|
|
1026
1075
|
return a.text === "" ? g.isDeletion = !0 : a.range.startLineNumber === a.range.endLineNumber && a.range.startColumn === a.range.endColumn ? g.isAddition = !0 : g.isReplacement = !0, g;
|
|
1027
|
-
}, A =
|
|
1028
|
-
h(),
|
|
1029
|
-
}),
|
|
1076
|
+
}, A = n.onDidChangeModel((a) => {
|
|
1077
|
+
h(), I();
|
|
1078
|
+
}), p = n.onDidChangeModelContent((a) => {
|
|
1030
1079
|
if (!a.isUndoing)
|
|
1031
1080
|
for (const g of a.changes) {
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
const L =
|
|
1081
|
+
const F = f(g);
|
|
1082
|
+
if (F.isReplacement || F.isDeletion || F.isAddition) {
|
|
1083
|
+
const L = t.some(
|
|
1035
1084
|
(v) => g.range.startLineNumber >= v.startLineNumber && g.range.endLineNumber <= v.endLineNumber && g.range.startColumn >= v.startColumn && g.range.endColumn <= v.endColumn
|
|
1036
|
-
), T = !L && e && g.range.startLineNumber === 1 && g.range.startColumn === 1 && !
|
|
1085
|
+
), T = !L && e && g.range.startLineNumber === 1 && g.range.startColumn === 1 && !ue(g.text);
|
|
1037
1086
|
if (L || T) {
|
|
1038
|
-
const v =
|
|
1087
|
+
const v = n.getModel();
|
|
1039
1088
|
if (v) {
|
|
1040
1089
|
v.undo();
|
|
1041
1090
|
return;
|
|
@@ -1044,7 +1093,7 @@ function Kt(t, e) {
|
|
|
1044
1093
|
}
|
|
1045
1094
|
}
|
|
1046
1095
|
}), x = () => {
|
|
1047
|
-
A.dispose(),
|
|
1096
|
+
A.dispose(), p.dispose();
|
|
1048
1097
|
};
|
|
1049
1098
|
let R = [], S = `
|
|
1050
1099
|
.idoc-readonly-mark {
|
|
@@ -1054,24 +1103,24 @@ function Kt(t, e) {
|
|
|
1054
1103
|
`;
|
|
1055
1104
|
if (S) {
|
|
1056
1105
|
const a = "monaco-read-only";
|
|
1057
|
-
|
|
1106
|
+
Jt(a) || Gt(S, a), S = null;
|
|
1058
1107
|
}
|
|
1059
1108
|
const y = () => {
|
|
1060
|
-
s(
|
|
1109
|
+
s(I), I();
|
|
1061
1110
|
}, b = () => {
|
|
1062
|
-
|
|
1063
|
-
},
|
|
1064
|
-
const a =
|
|
1065
|
-
a && (R =
|
|
1111
|
+
m(I), R = n.deltaDecorations(R, []);
|
|
1112
|
+
}, I = () => {
|
|
1113
|
+
const a = n.getModel();
|
|
1114
|
+
a && (R = n.deltaDecorations(
|
|
1066
1115
|
R,
|
|
1067
|
-
i.map(
|
|
1116
|
+
i.map(W(a))
|
|
1068
1117
|
));
|
|
1069
|
-
},
|
|
1070
|
-
const
|
|
1118
|
+
}, W = (a) => (g) => {
|
|
1119
|
+
const F = a.getPositionAt(g[0]), L = a.getPositionAt(g[1]);
|
|
1071
1120
|
return {
|
|
1072
1121
|
range: new l.Range(
|
|
1073
|
-
|
|
1074
|
-
|
|
1122
|
+
F.lineNumber,
|
|
1123
|
+
F.column,
|
|
1075
1124
|
L.lineNumber,
|
|
1076
1125
|
L.column
|
|
1077
1126
|
),
|
|
@@ -1086,22 +1135,22 @@ function Kt(t, e) {
|
|
|
1086
1135
|
},
|
|
1087
1136
|
exclude: r,
|
|
1088
1137
|
attach: s,
|
|
1089
|
-
detach:
|
|
1138
|
+
detach: m,
|
|
1090
1139
|
dispose: x,
|
|
1091
1140
|
show: y,
|
|
1092
1141
|
hide: b
|
|
1093
1142
|
};
|
|
1094
1143
|
}
|
|
1095
|
-
function
|
|
1144
|
+
function Pt(n, e, t) {
|
|
1096
1145
|
let i = !1;
|
|
1097
|
-
const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((
|
|
1146
|
+
const o = (b) => b[1] < b[0] ? (i = !0, [[b[1], b[0]]]) : [[...b]], r = (b) => i ? b.map((I) => I[1] > I[0] ? m(I) : I).reverse() : b;
|
|
1098
1147
|
let s;
|
|
1099
|
-
const
|
|
1100
|
-
let h,
|
|
1101
|
-
A =
|
|
1102
|
-
for (
|
|
1103
|
-
for (S =
|
|
1104
|
-
if (A =
|
|
1148
|
+
const m = (b) => (s = b[1], b[1] = b[0], b[0] = s, b), d = o(n);
|
|
1149
|
+
let h, f, A, p, x, R, S, y;
|
|
1150
|
+
A = d[0];
|
|
1151
|
+
for (f of e)
|
|
1152
|
+
for (S = f[0], y = f[1], p = 0; p < d.length; p++) {
|
|
1153
|
+
if (A = d[p], x = A[0], R = A[1], x < S)
|
|
1105
1154
|
R < S ? h = [A] : R <= y ? h = [[x, S - 1]] : h = [
|
|
1106
1155
|
[x, S - 1],
|
|
1107
1156
|
[y + 1, R]
|
|
@@ -1109,30 +1158,30 @@ function Bt(t, e, n) {
|
|
|
1109
1158
|
else if (x <= y)
|
|
1110
1159
|
if (S === Number.NEGATIVE_INFINITY) {
|
|
1111
1160
|
const b = y + 1;
|
|
1112
|
-
h =
|
|
1113
|
-
} else y === Number.POSITIVE_INFINITY ? h =
|
|
1161
|
+
h = t === 0 ? [] : [[b, R > b ? R : b]];
|
|
1162
|
+
} else y === Number.POSITIVE_INFINITY ? h = t === 0 ? [] : [[S - 1, S - 1]] : R <= y ? h = t < 0 ? [[S - 1, S - 1]] : t > 0 ? [[y + 1, y + 1]] : [] : h = [[y + 1, R]];
|
|
1114
1163
|
else
|
|
1115
1164
|
h = [A];
|
|
1116
|
-
if (
|
|
1165
|
+
if (d.splice(p, 1, ...h), d.length === 1 && d[0][1] < S) return r(d);
|
|
1117
1166
|
}
|
|
1118
|
-
return r(
|
|
1167
|
+
return r(d);
|
|
1119
1168
|
}
|
|
1120
|
-
function
|
|
1121
|
-
if (
|
|
1122
|
-
const
|
|
1169
|
+
function Vt(n, e) {
|
|
1170
|
+
if (n.length < 2) return n;
|
|
1171
|
+
const t = [];
|
|
1123
1172
|
let i = null, o, r;
|
|
1124
|
-
|
|
1173
|
+
n = n.map(
|
|
1125
1174
|
(s) => (s[1] < s[0] && (o = s[1], s[1] = s[0], s[1] = o), s)
|
|
1126
|
-
).sort((s,
|
|
1127
|
-
for (let s = 1; s <
|
|
1128
|
-
i =
|
|
1129
|
-
return
|
|
1175
|
+
).sort((s, m) => s[0] - m[0]), t.push(n[0]);
|
|
1176
|
+
for (let s = 1; s < n.length; s++)
|
|
1177
|
+
i = t[t.length - 1], r = n[s], i[1] === r[0] && !e || (i[1] === r[0] - 1 && e ? (i[1] = r[1], t.splice(t.length - 1, 1, i)) : i[1] < r[0] ? t.push(r) : i[1] < r[1] && (i[1] = r[1], t.splice(t.length - 1, 1, i)));
|
|
1178
|
+
return t;
|
|
1130
1179
|
}
|
|
1131
|
-
function Y(
|
|
1132
|
-
return e.bind(
|
|
1180
|
+
function Y(n, e) {
|
|
1181
|
+
return e.bind(n);
|
|
1133
1182
|
}
|
|
1134
|
-
class
|
|
1135
|
-
constructor(e,
|
|
1183
|
+
class Yt {
|
|
1184
|
+
constructor(e, t) {
|
|
1136
1185
|
var i;
|
|
1137
1186
|
this.disposables = [], this.prefer = 1, this.lastPrefer = 1, this.onCursor = Y(
|
|
1138
1187
|
this,
|
|
@@ -1156,21 +1205,21 @@ class Ot {
|
|
|
1156
1205
|
this.prefer = 1;
|
|
1157
1206
|
return;
|
|
1158
1207
|
}
|
|
1159
|
-
const
|
|
1208
|
+
const m = this.getSelections(), d = this.intervals.buffer;
|
|
1160
1209
|
let h;
|
|
1161
1210
|
if (r === s.Delete)
|
|
1162
|
-
h = (
|
|
1211
|
+
h = (f) => f[0] === f[1] && d.find((A) => f[1] + 1 === A[0]) != null;
|
|
1163
1212
|
else if (r === s.Backspace)
|
|
1164
|
-
h = (
|
|
1213
|
+
h = (f) => f[0] === f[1] && d.find((A) => A[1] + 1 === f[0]) != null;
|
|
1165
1214
|
else
|
|
1166
1215
|
return;
|
|
1167
|
-
|
|
1216
|
+
m.findIndex(h) !== -1 && (o.stopPropagation(), o.preventDefault());
|
|
1168
1217
|
}), this.getOffsetAt = Y(this, function(o) {
|
|
1169
1218
|
let r;
|
|
1170
1219
|
for (let s = 0; s < this.intervals.buffer.length; s++)
|
|
1171
1220
|
if (r = this.intervals.buffer[s], o <= r[1])
|
|
1172
1221
|
return r[0] - o < o - r[1] ? r[0] : r[1];
|
|
1173
|
-
}), this.editor = e, this.intervals =
|
|
1222
|
+
}), this.editor = e, this.intervals = Mt(e, t), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
|
|
1174
1223
|
}
|
|
1175
1224
|
enable() {
|
|
1176
1225
|
this.disposables.push(
|
|
@@ -1183,13 +1232,13 @@ class Ot {
|
|
|
1183
1232
|
for (const e of this.disposables) e.dispose();
|
|
1184
1233
|
this.disposables.splice(0);
|
|
1185
1234
|
}
|
|
1186
|
-
exclude(e,
|
|
1187
|
-
arguments.length === 1 ? this.intervals.exclude(e, 0, e, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(e,
|
|
1235
|
+
exclude(e, t, i, o) {
|
|
1236
|
+
arguments.length === 1 ? this.intervals.exclude(e, 0, e, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(e, t, i, o);
|
|
1188
1237
|
}
|
|
1189
1238
|
getApprovedSelections() {
|
|
1190
1239
|
const e = this.editor.getModel();
|
|
1191
1240
|
return this.getSelections().map(
|
|
1192
|
-
(i) =>
|
|
1241
|
+
(i) => Pt(
|
|
1193
1242
|
i,
|
|
1194
1243
|
this.intervals.buffer,
|
|
1195
1244
|
this.prefer
|
|
@@ -1206,80 +1255,80 @@ class Ot {
|
|
|
1206
1255
|
}
|
|
1207
1256
|
getSelections() {
|
|
1208
1257
|
const e = this.editor.getModel();
|
|
1209
|
-
return (this.editor.getSelections() || []).map((
|
|
1258
|
+
return (this.editor.getSelections() || []).map((t) => [
|
|
1210
1259
|
e.getOffsetAt({
|
|
1211
|
-
lineNumber:
|
|
1212
|
-
column:
|
|
1260
|
+
lineNumber: t.selectionStartLineNumber,
|
|
1261
|
+
column: t.selectionStartColumn
|
|
1213
1262
|
}),
|
|
1214
1263
|
e.getOffsetAt({
|
|
1215
|
-
lineNumber:
|
|
1216
|
-
column:
|
|
1264
|
+
lineNumber: t.positionLineNumber,
|
|
1265
|
+
column: t.positionColumn
|
|
1217
1266
|
})
|
|
1218
1267
|
]);
|
|
1219
1268
|
}
|
|
1220
1269
|
}
|
|
1221
|
-
const
|
|
1222
|
-
lineNumber:
|
|
1270
|
+
const Ht = new RegExp("^[ s]+(exposed|Function)", "i"), _t = ({
|
|
1271
|
+
lineNumber: n,
|
|
1223
1272
|
editor: e,
|
|
1224
|
-
type:
|
|
1273
|
+
type: t,
|
|
1225
1274
|
source: i
|
|
1226
1275
|
}) => {
|
|
1227
1276
|
var h;
|
|
1228
|
-
const o =
|
|
1229
|
-
if (
|
|
1277
|
+
const o = t === ie.METHOD || t === ie.DEBUGGER && ((h = i == null ? void 0 : i.codeDescriptorInfo) == null ? void 0 : h.type) === We.METHOD;
|
|
1278
|
+
if (n === 1)
|
|
1230
1279
|
return o ? "" : "1";
|
|
1231
|
-
const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [],
|
|
1232
|
-
let
|
|
1233
|
-
for (let
|
|
1234
|
-
(
|
|
1235
|
-
return
|
|
1236
|
-
},
|
|
1280
|
+
const r = e == null ? void 0 : e.getModel(), s = (r == null ? void 0 : r.getLinesContent()) || [], m = Array(s.length).fill("-");
|
|
1281
|
+
let d = o ? 0 : 1;
|
|
1282
|
+
for (let f = 1; f < s.length; f++)
|
|
1283
|
+
(f === 1 ? "" : s[f - 1]).endsWith("\\") || (d += 1, m[f] = d.toString());
|
|
1284
|
+
return m[n - 1];
|
|
1285
|
+
}, le = () => /* @__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__ */ _("div", { className: "space-y-2", children: [
|
|
1237
1286
|
/* @__PURE__ */ w("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
|
|
1238
1287
|
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1239
1288
|
/* @__PURE__ */ w("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
|
|
1240
1289
|
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
|
|
1241
1290
|
/* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" })
|
|
1242
|
-
] }) }) }), ne = ["fd-dark"],
|
|
1243
|
-
path:
|
|
1291
|
+
] }) }) }), ne = ["fd-dark"], Tn = ({
|
|
1292
|
+
path: n,
|
|
1244
1293
|
initialValue: e,
|
|
1245
|
-
type:
|
|
1294
|
+
type: t,
|
|
1246
1295
|
language: i,
|
|
1247
1296
|
onChange: o,
|
|
1248
1297
|
options: r = {},
|
|
1249
1298
|
extra: s = {},
|
|
1250
|
-
lspProps:
|
|
1251
|
-
theme:
|
|
1299
|
+
lspProps: m,
|
|
1300
|
+
theme: d = ne[0],
|
|
1252
1301
|
...h
|
|
1253
1302
|
}) => {
|
|
1254
|
-
const { initialLineInfo:
|
|
1255
|
-
function S(
|
|
1256
|
-
i === "css" &&
|
|
1303
|
+
const { initialLineInfo: f, initialSelectionInfo: A } = s, { editor: p, setEditor: x } = jt(), { inited: R } = m;
|
|
1304
|
+
function S(I) {
|
|
1305
|
+
i === "css" && I.languages.registerCompletionItemProvider("css", Xt), i === "json" && I.languages.json && I.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
1257
1306
|
validate: !0,
|
|
1258
1307
|
schemas: [
|
|
1259
1308
|
{
|
|
1260
1309
|
uri: "condition-schema.json",
|
|
1261
1310
|
fileMatch: ["*.condition.json"],
|
|
1262
|
-
schema:
|
|
1311
|
+
schema: Bt
|
|
1263
1312
|
},
|
|
1264
1313
|
{
|
|
1265
1314
|
uri: "handlers-schema.json",
|
|
1266
|
-
fileMatch: [
|
|
1267
|
-
schema:
|
|
1315
|
+
fileMatch: [Ze],
|
|
1316
|
+
schema: Ot
|
|
1268
1317
|
}
|
|
1269
1318
|
]
|
|
1270
1319
|
});
|
|
1271
1320
|
}
|
|
1272
|
-
function y(
|
|
1273
|
-
x(
|
|
1274
|
-
const a =
|
|
1275
|
-
if (a && (a.updateOptions({ insertSpaces: !1 }),
|
|
1276
|
-
var
|
|
1277
|
-
const g = (
|
|
1321
|
+
function y(I, W) {
|
|
1322
|
+
x(I);
|
|
1323
|
+
const a = I.getModel();
|
|
1324
|
+
if (a && (a.updateOptions({ insertSpaces: !1 }), I.onKeyUp(() => {
|
|
1325
|
+
var F;
|
|
1326
|
+
const g = (F = I.getPosition()) == null ? void 0 : F.lineNumber;
|
|
1278
1327
|
if (g) {
|
|
1279
1328
|
const L = a.getLineFirstNonWhitespaceColumn(g), T = a.getLineLength(g), v = a.getLineContent(g);
|
|
1280
|
-
|
|
1329
|
+
Ht.test(v) && I.executeEdits("edit-handler", [
|
|
1281
1330
|
{
|
|
1282
|
-
range: new
|
|
1331
|
+
range: new W.Range(
|
|
1283
1332
|
g,
|
|
1284
1333
|
0,
|
|
1285
1334
|
g,
|
|
@@ -1292,126 +1341,126 @@ const Dt = new RegExp("^[ s]+(exposed|Function)", "i"), Gt = ({
|
|
|
1292
1341
|
}
|
|
1293
1342
|
]);
|
|
1294
1343
|
}
|
|
1295
|
-
})),
|
|
1296
|
-
const g = new
|
|
1344
|
+
})), t === ie.METHOD && ue(e)) {
|
|
1345
|
+
const g = new Yt(I, !0);
|
|
1297
1346
|
g.exclude(1, 1, 1, Number.POSITIVE_INFINITY), g.enable();
|
|
1298
1347
|
}
|
|
1299
1348
|
}
|
|
1300
1349
|
M(() => {
|
|
1301
|
-
if (!
|
|
1302
|
-
const { line:
|
|
1303
|
-
|
|
1304
|
-
}, [
|
|
1305
|
-
if (!
|
|
1306
|
-
const { selection:
|
|
1307
|
-
|
|
1308
|
-
}, [A,
|
|
1309
|
-
const b = (
|
|
1350
|
+
if (!p) return;
|
|
1351
|
+
const { line: I, offset: W } = f || {};
|
|
1352
|
+
I && Nt(p, I, W);
|
|
1353
|
+
}, [f, p]), M(() => {
|
|
1354
|
+
if (!p) return;
|
|
1355
|
+
const { selection: I } = A || {};
|
|
1356
|
+
I && yt(p, I);
|
|
1357
|
+
}, [A, p]);
|
|
1358
|
+
const b = (I) => ne.includes(I) ? I : ne[0];
|
|
1310
1359
|
return R ? /* @__PURE__ */ w(
|
|
1311
|
-
|
|
1360
|
+
xe,
|
|
1312
1361
|
{
|
|
1313
1362
|
options: {
|
|
1314
1363
|
readOnly: !0,
|
|
1315
1364
|
fontSize: 12,
|
|
1316
1365
|
"semanticHighlighting.enabled": !0,
|
|
1317
1366
|
padding: { top: 10 },
|
|
1318
|
-
lineNumbers: i === "4d" ? (
|
|
1319
|
-
lineNumber:
|
|
1320
|
-
editor:
|
|
1321
|
-
type:
|
|
1367
|
+
lineNumbers: i === "4d" ? (I) => _t({
|
|
1368
|
+
lineNumber: I,
|
|
1369
|
+
editor: p,
|
|
1370
|
+
type: t,
|
|
1322
1371
|
source: s == null ? void 0 : s.source
|
|
1323
1372
|
}) : void 0,
|
|
1324
1373
|
scrollBeyondLastLine: !1,
|
|
1325
1374
|
...r
|
|
1326
1375
|
},
|
|
1327
|
-
path: j(
|
|
1376
|
+
path: j(n),
|
|
1328
1377
|
value: e,
|
|
1329
|
-
theme: b(
|
|
1330
|
-
onChange: (
|
|
1378
|
+
theme: b(d),
|
|
1379
|
+
onChange: (I) => o && o(I || ""),
|
|
1331
1380
|
language: i,
|
|
1332
1381
|
beforeMount: S,
|
|
1333
1382
|
onMount: y,
|
|
1334
|
-
loading: /* @__PURE__ */ w(
|
|
1383
|
+
loading: /* @__PURE__ */ w(le, {}),
|
|
1335
1384
|
...h
|
|
1336
1385
|
}
|
|
1337
|
-
) : /* @__PURE__ */ w("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ w(
|
|
1386
|
+
) : /* @__PURE__ */ w("div", { className: "relative flex-1 w-full", children: /* @__PURE__ */ w(le, {}) });
|
|
1338
1387
|
};
|
|
1339
|
-
var
|
|
1388
|
+
var Ae = {
|
|
1340
1389
|
color: void 0,
|
|
1341
1390
|
size: void 0,
|
|
1342
1391
|
className: void 0,
|
|
1343
1392
|
style: void 0,
|
|
1344
1393
|
attr: void 0
|
|
1345
|
-
},
|
|
1346
|
-
return B = Object.assign || function(
|
|
1347
|
-
for (var e,
|
|
1348
|
-
e = arguments[
|
|
1349
|
-
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (
|
|
1394
|
+
}, ae = D.createContext && D.createContext(Ae), B = function() {
|
|
1395
|
+
return B = Object.assign || function(n) {
|
|
1396
|
+
for (var e, t = 1, i = arguments.length; t < i; t++) {
|
|
1397
|
+
e = arguments[t];
|
|
1398
|
+
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
|
|
1350
1399
|
}
|
|
1351
|
-
return
|
|
1400
|
+
return n;
|
|
1352
1401
|
}, B.apply(this, arguments);
|
|
1353
|
-
},
|
|
1354
|
-
var
|
|
1355
|
-
for (var i in
|
|
1356
|
-
if (
|
|
1357
|
-
e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(
|
|
1358
|
-
return
|
|
1402
|
+
}, zt = function(n, e) {
|
|
1403
|
+
var t = {};
|
|
1404
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
1405
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, i = Object.getOwnPropertySymbols(n); o < i.length; o++)
|
|
1406
|
+
e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[o]) && (t[i[o]] = n[i[o]]);
|
|
1407
|
+
return t;
|
|
1359
1408
|
};
|
|
1360
|
-
function
|
|
1361
|
-
return
|
|
1362
|
-
return
|
|
1363
|
-
key:
|
|
1364
|
-
}, e.attr),
|
|
1409
|
+
function be(n) {
|
|
1410
|
+
return n && n.map(function(e, t) {
|
|
1411
|
+
return D.createElement(e.tag, B({
|
|
1412
|
+
key: t
|
|
1413
|
+
}, e.attr), be(e.child));
|
|
1365
1414
|
});
|
|
1366
1415
|
}
|
|
1367
|
-
function
|
|
1416
|
+
function he(n) {
|
|
1368
1417
|
return function(e) {
|
|
1369
|
-
return
|
|
1370
|
-
attr: B({},
|
|
1371
|
-
}, e),
|
|
1418
|
+
return D.createElement($t, B({
|
|
1419
|
+
attr: B({}, n.attr)
|
|
1420
|
+
}, e), be(n.child));
|
|
1372
1421
|
};
|
|
1373
1422
|
}
|
|
1374
|
-
function
|
|
1375
|
-
var e = function(
|
|
1376
|
-
var i =
|
|
1377
|
-
return
|
|
1423
|
+
function $t(n) {
|
|
1424
|
+
var e = function(t) {
|
|
1425
|
+
var i = n.attr, o = n.size, r = n.title, s = zt(n, ["attr", "size", "title"]), m = o || t.size || "1em", d;
|
|
1426
|
+
return t.className && (d = t.className), n.className && (d = (d ? d + " " : "") + n.className), D.createElement("svg", B({
|
|
1378
1427
|
stroke: "currentColor",
|
|
1379
1428
|
fill: "currentColor",
|
|
1380
1429
|
strokeWidth: "0"
|
|
1381
|
-
},
|
|
1382
|
-
className:
|
|
1430
|
+
}, t.attr, i, s, {
|
|
1431
|
+
className: d,
|
|
1383
1432
|
style: B(B({
|
|
1384
|
-
color:
|
|
1385
|
-
},
|
|
1386
|
-
height:
|
|
1387
|
-
width:
|
|
1433
|
+
color: n.color || t.color
|
|
1434
|
+
}, t.style), n.style),
|
|
1435
|
+
height: m,
|
|
1436
|
+
width: m,
|
|
1388
1437
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1389
|
-
}), r &&
|
|
1438
|
+
}), r && D.createElement("title", null, r), n.children);
|
|
1390
1439
|
};
|
|
1391
|
-
return
|
|
1392
|
-
return e(
|
|
1393
|
-
}) : e(
|
|
1440
|
+
return ae !== void 0 ? D.createElement(ae.Consumer, null, function(t) {
|
|
1441
|
+
return e(t);
|
|
1442
|
+
}) : e(Ae);
|
|
1394
1443
|
}
|
|
1395
|
-
function
|
|
1396
|
-
return
|
|
1444
|
+
function Ut(n) {
|
|
1445
|
+
return he({ 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);
|
|
1397
1446
|
}
|
|
1398
|
-
function
|
|
1399
|
-
return
|
|
1447
|
+
function qt(n) {
|
|
1448
|
+
return he({ 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);
|
|
1400
1449
|
}
|
|
1401
|
-
const
|
|
1402
|
-
lspProps: { lastError:
|
|
1450
|
+
const Dn = ({
|
|
1451
|
+
lspProps: { lastError: n, reload: e }
|
|
1403
1452
|
}) => {
|
|
1404
|
-
const [
|
|
1453
|
+
const [t, i] = z(!1), o = () => {
|
|
1405
1454
|
e();
|
|
1406
1455
|
}, r = () => {
|
|
1407
1456
|
i(!1);
|
|
1408
1457
|
};
|
|
1409
1458
|
return M(() => {
|
|
1410
|
-
i(!!
|
|
1411
|
-
}, [
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */ w(
|
|
1414
|
-
/* @__PURE__ */
|
|
1459
|
+
i(!!n);
|
|
1460
|
+
}, [n]), t ? /* @__PURE__ */ _("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: [
|
|
1461
|
+
/* @__PURE__ */ _("span", { className: "flex flex-1 justify-center gap-1", children: [
|
|
1462
|
+
/* @__PURE__ */ w(qt, { className: "h-4 w-4 text-yellow-600" }),
|
|
1463
|
+
/* @__PURE__ */ _("span", { children: [
|
|
1415
1464
|
"LSP not loaded.",
|
|
1416
1465
|
" ",
|
|
1417
1466
|
/* @__PURE__ */ w(
|
|
@@ -1425,14 +1474,14 @@ const Ln = ({
|
|
|
1425
1474
|
] })
|
|
1426
1475
|
] }),
|
|
1427
1476
|
/* @__PURE__ */ w("button", { className: "focus:outline-none", children: /* @__PURE__ */ w(
|
|
1428
|
-
|
|
1477
|
+
Ut,
|
|
1429
1478
|
{
|
|
1430
1479
|
className: "h-4 w-4 text-white",
|
|
1431
1480
|
onClick: r
|
|
1432
1481
|
}
|
|
1433
1482
|
) })
|
|
1434
1483
|
] }) : null;
|
|
1435
|
-
},
|
|
1484
|
+
}, Qt = {
|
|
1436
1485
|
name: "4d",
|
|
1437
1486
|
displayName: "%displayName%",
|
|
1438
1487
|
description: "%description%",
|
|
@@ -1457,7 +1506,7 @@ const Ln = ({
|
|
|
1457
1506
|
}
|
|
1458
1507
|
]
|
|
1459
1508
|
}
|
|
1460
|
-
}, { registerFileUrl: q, whenReady:
|
|
1509
|
+
}, { registerFileUrl: q, whenReady: On } = It(Qt, void 0, {
|
|
1461
1510
|
system: !0
|
|
1462
1511
|
});
|
|
1463
1512
|
q(
|
|
@@ -1481,20 +1530,20 @@ q(
|
|
|
1481
1530
|
{ mimeType: "application/json", size: 135 }
|
|
1482
1531
|
);
|
|
1483
1532
|
export {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1533
|
+
Dn as Alerts,
|
|
1534
|
+
Tn as CodeEditor,
|
|
1535
|
+
Bn as CodeEditorProvider,
|
|
1536
|
+
_t as FdLineNumbers,
|
|
1537
|
+
En as LSPProvider,
|
|
1489
1538
|
ne as SUPPORTED_THEMES,
|
|
1490
|
-
|
|
1491
|
-
|
|
1539
|
+
Ie as _await,
|
|
1540
|
+
ht as configureServices,
|
|
1492
1541
|
j as getFileSystemPath,
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1542
|
+
Xn as getFunctionOffset,
|
|
1543
|
+
bt as initMonacoUserConfiguration,
|
|
1544
|
+
Nt as jumpToLine,
|
|
1545
|
+
yt as jumpToSelection,
|
|
1546
|
+
jt as useCodeEditor,
|
|
1547
|
+
Kn as useLSP
|
|
1499
1548
|
};
|
|
1500
1549
|
//# sourceMappingURL=index.es.js.map
|