@arcgis/coding-components 4.31.0-next.33 → 4.31.0-next.35
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/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +38 -39
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-41da41b7.js → p-226a2b0d.js} +2 -2
- package/dist/arcgis-coding-components/{p-b320932c.js → p-2c21d9c3.js} +2 -2
- package/dist/arcgis-coding-components/{p-1e8ecfad.js → p-3a3209fb.js} +3 -3
- package/dist/arcgis-coding-components/{p-0f7c3b46.entry.js → p-3d962835.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-5712f14a.js → p-3e0d0235.js} +2 -2
- package/dist/arcgis-coding-components/{p-08b429c3.js → p-4d7e3292.js} +2 -2
- package/dist/arcgis-coding-components/p-50f928fb.js +6 -0
- package/dist/arcgis-coding-components/{p-993bc0d7.js → p-5dfe3e0f.js} +1 -1
- package/dist/arcgis-coding-components/{p-355201f9.js → p-76898840.js} +1 -1
- package/dist/arcgis-coding-components/{p-ffffcb8d.entry.js → p-782d55b4.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-8a69d580.js → p-8d192963.js} +2 -2
- package/dist/arcgis-coding-components/{p-75433d50.js → p-b02795ae.js} +2 -2
- package/dist/arcgis-coding-components/{p-9f2c7bf5.js → p-ee17b2c9.js} +1 -1
- package/dist/arcgis-coding-components/{p-e9a06305.js → p-f0b2d3ba.js} +2 -2
- package/dist/arcgis-coding-components/{p-81abf375.js → p-f76884e9.js} +9 -9
- package/dist/arcgis-coding-components/p-fbb03659.js +6 -0
- package/dist/arcgis-coding-components/{p-31373916.js → p-ff690f99.js} +2 -2
- package/dist/arcgis-coding-components/{p-26bd361b.entry.js → p-ff6b4231.entry.js} +2 -2
- package/dist/cjs/{app-globals-4fe8cc70.js → app-globals-3c13b438.js} +1 -1
- package/dist/cjs/{arcade-defaults-a591369b.js → arcade-defaults-22f46fbd.js} +4 -4
- package/dist/cjs/{arcade-mode-8e6464d3.js → arcade-mode-6491dead.js} +266 -6
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +5 -5
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
- package/dist/cjs/{css-67e59b62.js → css-a029310b.js} +1 -1
- package/dist/cjs/{cssMode-ac51091d.js → cssMode-107c5417.js} +2 -2
- package/dist/cjs/{html-3127941b.js → html-b3440c82.js} +2 -2
- package/dist/cjs/{htmlMode-c686ddee.js → htmlMode-51a1d953.js} +2 -2
- package/dist/cjs/{index-8e823a40.js → index-dafd3e7e.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-37aa76f5.js → javascript-8a365175.js} +3 -3
- package/dist/cjs/{jsonMode-9d875fc8.js → jsonMode-61d601d6.js} +2 -2
- package/dist/cjs/{language-defaults-base-82944173.js → language-defaults-base-6f2dd8d3.js} +9 -29
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{sql-expr-defaults-d74ef4f2.js → sql-expr-defaults-b523ed8e.js} +4 -17
- package/dist/cjs/sql-expr-mode-ccdbce5c.js +467 -0
- package/dist/cjs/{tsMode-916f8dc0.js → tsMode-f146dd8f.js} +2 -2
- package/dist/cjs/{typescript-05142a58.js → typescript-64b9a919.js} +2 -2
- package/dist/components/arcade-defaults.js +1 -1
- package/dist/components/arcade-mode.js +265 -4
- package/dist/components/arcade-results.js +1 -1
- package/dist/components/arcade-suggestions.js +1 -1
- package/dist/components/arcade-variables.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +1 -1
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-assets.d.ts +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.js +1 -1
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/chunk-EOMOY2EF.js +1 -1
- package/dist/components/code-editor.js +1 -1
- package/dist/components/fields.js +2 -20
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/language-api-panel.js +1 -1
- package/dist/components/language-defaults-base.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +2 -14
- package/dist/components/sql-expr-mode.js +161 -868
- package/dist/components/sql-expression-fields.js +1 -1
- package/dist/components/useT9n.js +1 -1
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-5a151155.js → app-globals-04c8b633.js} +1 -1
- package/dist/esm/{arcade-defaults-5c8f894d.js → arcade-defaults-7eee0783.js} +4 -4
- package/dist/esm/{arcade-mode-c4a6c6e6.js → arcade-mode-a0bff327.js} +263 -3
- package/dist/esm/arcgis-arcade-editor_6.entry.js +5 -5
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
- package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
- package/dist/esm/{css-6709b3e0.js → css-7ca8de5b.js} +1 -1
- package/dist/esm/{cssMode-76e8796d.js → cssMode-c19a78c2.js} +2 -2
- package/dist/esm/{html-53d10c85.js → html-d4ccf94c.js} +2 -2
- package/dist/esm/{htmlMode-e9f070f1.js → htmlMode-d8759393.js} +2 -2
- package/dist/esm/{index-b16f119e.js → index-5cfecead.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-785bbfd8.js → javascript-1f5d1700.js} +3 -3
- package/dist/esm/{jsonMode-cd6fe200.js → jsonMode-051ff879.js} +2 -2
- package/dist/esm/{language-defaults-base-e68e4d35.js → language-defaults-base-592412b1.js} +10 -28
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{sql-expr-defaults-bdfdf7b4.js → sql-expr-defaults-acdf8eda.js} +5 -17
- package/dist/esm/sql-expr-mode-f47663a4.js +463 -0
- package/dist/esm/{tsMode-31b5e806.js → tsMode-e4212407.js} +2 -2
- package/dist/esm/{typescript-b2aa1d45.js → typescript-4f3f0f4d.js} +2 -2
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +56 -6
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +22 -6
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +3 -18
- package/dist/types/utils/sql-expr-monaco/sql-expr-parser-utils.d.ts +30 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +0 -2
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +4 -4
- package/dist/types/utils/sql-expr-monaco/types.d.ts +25 -17
- package/package.json +11 -11
- package/dist/arcgis-coding-components/p-11d77b20.js +0 -6
- package/dist/arcgis-coding-components/p-86eb1d4c.js +0 -6
- package/dist/arcgis-coding-components/p-f544962a.js +0 -6
- package/dist/cjs/arcade-language-features-58ffb6a0.js +0 -274
- package/dist/cjs/sql-expr-mode-98437b6d.js +0 -1171
- package/dist/components/arcade-language-features.js +0 -271
- package/dist/esm/arcade-language-features-664e727d.js +0 -269
- package/dist/esm/sql-expr-mode-e58e1f11.js +0 -1167
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
|
-
import { editor, languages, Emitter } from 'monaco-editor';
|
|
7
|
-
import { CompletionItemKind } from 'vscode-languageserver-types';
|
|
8
|
-
import {
|
|
6
|
+
import { editor, MarkerSeverity, Range, languages, Emitter } from 'monaco-editor';
|
|
7
|
+
import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat } from 'vscode-languageserver-types';
|
|
8
|
+
import { t as debounce } from './index2.js';
|
|
9
9
|
|
|
10
10
|
var V={False:"false",Null:"null",True:"true"},f={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},Ee=["++","--"],Je=["-","+","!","~"],Qe=["=","/=","*=","%=","+=","-="],Ze=["||","&&"],Lt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var U=[[],[],[]];Ee.forEach(t=>U[t.length-1]?.push(t));Je.forEach(t=>U[t.length-1]?.push(t));Ze.forEach(t=>U[t.length-1]?.push(t));Qe.forEach(t=>U[t.length-1]?.push(t));Lt.forEach(t=>U[t.length-1]?.push(t));var ft=Object.values(f),gt=Object.values(V);gt.map(t=>({label:t,kind:CompletionItemKind.Constant}));ft.map(t=>({label:t,kind:CompletionItemKind.Keyword}));
|
|
11
11
|
|
|
@@ -217,6 +217,267 @@ const arcadeMonarchLanguage = {
|
|
|
217
217
|
},
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
+
//#region Diagnostic
|
|
221
|
+
class DiagnosticsAdapter {
|
|
222
|
+
constructor(_languageId, _worker, { defaults, diagnosticsService, }) {
|
|
223
|
+
this._languageId = _languageId;
|
|
224
|
+
this._worker = _worker;
|
|
225
|
+
this._disposables = [];
|
|
226
|
+
this._listener = new Map();
|
|
227
|
+
this._diagnosticsService = diagnosticsService;
|
|
228
|
+
this._defaults = defaults;
|
|
229
|
+
const onModelAdd = (model) => {
|
|
230
|
+
const languageId = model.getLanguageId();
|
|
231
|
+
if (languageId !== this._languageId) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const debouncedValidate = debounce(() => {
|
|
235
|
+
this._doValidate(model, languageId).catch((err) => {
|
|
236
|
+
throw err;
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
this._listener.set(model.uri.toString(), model.onDidChangeContent(debouncedValidate));
|
|
240
|
+
this._doValidate(model, languageId).catch(console.error);
|
|
241
|
+
};
|
|
242
|
+
const onModelRemoved = (model) => {
|
|
243
|
+
const uriStr = model.uri.toString();
|
|
244
|
+
editor.setModelMarkers(model, this._languageId, []);
|
|
245
|
+
const listener = this._listener.get(uriStr);
|
|
246
|
+
if (listener) {
|
|
247
|
+
listener.dispose();
|
|
248
|
+
this._listener.delete(uriStr);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
this._disposables.push(editor.onDidCreateModel(onModelAdd));
|
|
252
|
+
this._disposables.push(editor.onWillDisposeModel((model) => {
|
|
253
|
+
onModelRemoved(model);
|
|
254
|
+
}));
|
|
255
|
+
this._disposables.push(editor.onDidChangeModelLanguage((event) => {
|
|
256
|
+
onModelRemoved(event.model);
|
|
257
|
+
onModelAdd(event.model);
|
|
258
|
+
}));
|
|
259
|
+
this._disposables.push(defaults.onDidChange(() => {
|
|
260
|
+
editor.getModels().forEach((model) => {
|
|
261
|
+
if (model.getLanguageId() === this._languageId) {
|
|
262
|
+
onModelRemoved(model);
|
|
263
|
+
onModelAdd(model);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}));
|
|
267
|
+
this._disposables.push(defaults.onModelContextDidChange((key) => {
|
|
268
|
+
editor.getModels().forEach((model) => {
|
|
269
|
+
if (model.getLanguageId() === this._languageId && model.uri.toString() === key) {
|
|
270
|
+
this._doValidate(model, this._languageId).catch(console.error);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}));
|
|
274
|
+
this._disposables.push({
|
|
275
|
+
dispose: () => {
|
|
276
|
+
this._listener.forEach((value) => value.dispose());
|
|
277
|
+
this._listener.clear();
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
editor.getModels().forEach(onModelAdd);
|
|
281
|
+
}
|
|
282
|
+
dispose() {
|
|
283
|
+
this._disposables.forEach((d) => d.dispose());
|
|
284
|
+
this._disposables = [];
|
|
285
|
+
}
|
|
286
|
+
async _doValidate(model, languageId) {
|
|
287
|
+
if (!model.isAttachedToEditor()) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
try {
|
|
291
|
+
const workerProxy = await this._worker(model.uri);
|
|
292
|
+
const context = this._defaults.getApiContextForModel(model.uri);
|
|
293
|
+
const diagnostics = await workerProxy.doValidation(model.uri.toString(), context);
|
|
294
|
+
const markers = diagnostics.map((d) => toMarker(model.uri, d));
|
|
295
|
+
this._diagnosticsService.fireDiagnosticsChange(model.uri, diagnostics);
|
|
296
|
+
editor.setModelMarkers(model, languageId, markers);
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
console.error(err);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function toSeverity(languageServiceSeverity) {
|
|
304
|
+
switch (languageServiceSeverity) {
|
|
305
|
+
case DiagnosticSeverity.Error:
|
|
306
|
+
return MarkerSeverity.Error;
|
|
307
|
+
case DiagnosticSeverity.Warning:
|
|
308
|
+
return MarkerSeverity.Warning;
|
|
309
|
+
case DiagnosticSeverity.Information:
|
|
310
|
+
return MarkerSeverity.Info;
|
|
311
|
+
case DiagnosticSeverity.Hint:
|
|
312
|
+
return MarkerSeverity.Hint;
|
|
313
|
+
default:
|
|
314
|
+
return MarkerSeverity.Info;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function toMarker(_resource, diag) {
|
|
318
|
+
// Diagnostics positions are zero-based, MarkerData are 1-based
|
|
319
|
+
return {
|
|
320
|
+
severity: toSeverity(diag.severity),
|
|
321
|
+
startLineNumber: diag.range.start.line + 1,
|
|
322
|
+
startColumn: diag.range.start.character + 1,
|
|
323
|
+
endLineNumber: diag.range.end.line + 1,
|
|
324
|
+
endColumn: diag.range.end.character + 1,
|
|
325
|
+
message: diag.message,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region Completion
|
|
330
|
+
function fromPosition(position) {
|
|
331
|
+
// Language service is zero based
|
|
332
|
+
return { character: position.column - 1, line: position.lineNumber - 1 };
|
|
333
|
+
}
|
|
334
|
+
function toRange(range) {
|
|
335
|
+
return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
|
|
336
|
+
}
|
|
337
|
+
function toTextEdit(textEdit) {
|
|
338
|
+
return {
|
|
339
|
+
range: toRange(textEdit.range),
|
|
340
|
+
text: textEdit.newText,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function isInsertReplaceEdit(edit) {
|
|
344
|
+
return (typeof edit.insert !== "undefined" &&
|
|
345
|
+
typeof edit.replace !== "undefined");
|
|
346
|
+
}
|
|
347
|
+
// TODO: extract this function to common util
|
|
348
|
+
function toCompletionItemKind(kind) {
|
|
349
|
+
const mItemKind = languages.CompletionItemKind;
|
|
350
|
+
switch (kind) {
|
|
351
|
+
case CompletionItemKind.Text:
|
|
352
|
+
return mItemKind.Text;
|
|
353
|
+
case CompletionItemKind.Method:
|
|
354
|
+
return mItemKind.Method;
|
|
355
|
+
case CompletionItemKind.Function:
|
|
356
|
+
return mItemKind.Function;
|
|
357
|
+
case CompletionItemKind.Constructor:
|
|
358
|
+
return mItemKind.Constructor;
|
|
359
|
+
case CompletionItemKind.Field:
|
|
360
|
+
return mItemKind.Field;
|
|
361
|
+
case CompletionItemKind.Variable:
|
|
362
|
+
return mItemKind.Variable;
|
|
363
|
+
case CompletionItemKind.Class:
|
|
364
|
+
return mItemKind.Class;
|
|
365
|
+
case CompletionItemKind.Interface:
|
|
366
|
+
return mItemKind.Interface;
|
|
367
|
+
case CompletionItemKind.Module:
|
|
368
|
+
return mItemKind.Module;
|
|
369
|
+
case CompletionItemKind.Property:
|
|
370
|
+
return mItemKind.Property;
|
|
371
|
+
case CompletionItemKind.Unit:
|
|
372
|
+
return mItemKind.Unit;
|
|
373
|
+
case CompletionItemKind.Value:
|
|
374
|
+
return mItemKind.Value;
|
|
375
|
+
case CompletionItemKind.Enum:
|
|
376
|
+
return mItemKind.Enum;
|
|
377
|
+
case CompletionItemKind.Keyword:
|
|
378
|
+
return mItemKind.Keyword;
|
|
379
|
+
case CompletionItemKind.Snippet:
|
|
380
|
+
return mItemKind.Snippet;
|
|
381
|
+
case CompletionItemKind.Color:
|
|
382
|
+
return mItemKind.Color;
|
|
383
|
+
case CompletionItemKind.File:
|
|
384
|
+
return mItemKind.File;
|
|
385
|
+
case CompletionItemKind.Reference:
|
|
386
|
+
return mItemKind.Reference;
|
|
387
|
+
case CompletionItemKind.Folder:
|
|
388
|
+
return mItemKind.Folder;
|
|
389
|
+
case CompletionItemKind.EnumMember:
|
|
390
|
+
return mItemKind.EnumMember;
|
|
391
|
+
case CompletionItemKind.Constant:
|
|
392
|
+
return mItemKind.Constant;
|
|
393
|
+
case CompletionItemKind.Struct:
|
|
394
|
+
return mItemKind.Struct;
|
|
395
|
+
case CompletionItemKind.Event:
|
|
396
|
+
return mItemKind.Event;
|
|
397
|
+
case CompletionItemKind.Operator:
|
|
398
|
+
return mItemKind.Operator;
|
|
399
|
+
case CompletionItemKind.TypeParameter:
|
|
400
|
+
return mItemKind.TypeParameter;
|
|
401
|
+
default:
|
|
402
|
+
return mItemKind.Property;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
class CompletionProvider {
|
|
406
|
+
constructor(_worker, _defaults) {
|
|
407
|
+
this._worker = _worker;
|
|
408
|
+
this._defaults = _defaults;
|
|
409
|
+
this.triggerCharacters = [".", "("];
|
|
410
|
+
}
|
|
411
|
+
async provideCompletionItems(model, position) {
|
|
412
|
+
const worker = await this._worker(model.uri);
|
|
413
|
+
const context = this._defaults.getApiContextForModel(model.uri);
|
|
414
|
+
const completionList = await worker.doComplete(model.uri.toString(), fromPosition(position), context);
|
|
415
|
+
const wordInfo = model.getWordUntilPosition(position);
|
|
416
|
+
const wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
417
|
+
const items = completionList.items.map((entry) => {
|
|
418
|
+
const item = {
|
|
419
|
+
label: entry.label,
|
|
420
|
+
insertText: entry.insertText || entry.label,
|
|
421
|
+
sortText: entry.sortText,
|
|
422
|
+
filterText: entry.filterText,
|
|
423
|
+
detail: entry.detail,
|
|
424
|
+
range: wordRange,
|
|
425
|
+
kind: toCompletionItemKind(entry.kind),
|
|
426
|
+
};
|
|
427
|
+
if (entry.textEdit) {
|
|
428
|
+
if (isInsertReplaceEdit(entry.textEdit)) {
|
|
429
|
+
item.range = {
|
|
430
|
+
insert: toRange(entry.textEdit.insert),
|
|
431
|
+
replace: toRange(entry.textEdit.replace),
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
item.range = toRange(entry.textEdit.range);
|
|
436
|
+
}
|
|
437
|
+
item.insertText = entry.textEdit.newText;
|
|
438
|
+
}
|
|
439
|
+
if (entry.additionalTextEdits) {
|
|
440
|
+
item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
|
|
441
|
+
}
|
|
442
|
+
if (entry.insertTextFormat === InsertTextFormat.Snippet) {
|
|
443
|
+
item.insertTextRules = languages.CompletionItemInsertTextRule.InsertAsSnippet;
|
|
444
|
+
}
|
|
445
|
+
if (entry.documentation) {
|
|
446
|
+
if (typeof entry.documentation === "string") {
|
|
447
|
+
item.documentation = entry.documentation;
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
item.documentation = {
|
|
451
|
+
supportThemeIcons: false,
|
|
452
|
+
value: entry.documentation.value,
|
|
453
|
+
supportHtml: true,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return item;
|
|
458
|
+
});
|
|
459
|
+
return {
|
|
460
|
+
incomplete: completionList.isIncomplete,
|
|
461
|
+
suggestions: items,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region Formatter
|
|
467
|
+
class FormattingProvider {
|
|
468
|
+
constructor(_worker, _defaults) {
|
|
469
|
+
this._worker = _worker;
|
|
470
|
+
this._defaults = _defaults;
|
|
471
|
+
}
|
|
472
|
+
async provideDocumentFormattingEdits(model) {
|
|
473
|
+
const worker = await this._worker(model.uri);
|
|
474
|
+
const context = this._defaults.getApiContextForModel(model.uri.toString());
|
|
475
|
+
const edits = await worker.doFormat(model.uri.toString(), context);
|
|
476
|
+
return edits.map((e) => ({ range: toRange(e.range), text: e.newText }));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
//#endregion
|
|
480
|
+
|
|
220
481
|
/**
|
|
221
482
|
* Manager to create our arcade worker and client proxy
|
|
222
483
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host, forceUpdate } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as importArcade, s as supportedFields } from './fields.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, a as colorizeCodeElement } from './markdown.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h } from '@stencil/core/internal/client';
|
|
7
7
|
import { u as useControllerManager } from './chunk-EOMOY2EF.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { KeyCode } from 'monaco-editor';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeResults$1, d as defineCustomElement$1 } from './arcade-results.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeSuggestions$1, d as defineCustomElement$1 } from './arcade-suggestions.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeVariables$1, d as defineCustomElement$1 } from './arcade-variables.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
let resourceUrl = "https://js.arcgis.com/coding-components/next/";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisCodeEditor$1, d as defineCustomElement$1 } from './code-editor.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisLanguageApiPanel$1, d as defineCustomElement$1 } from './language-api-panel.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { u as useControllerManager } from './chunk-EOMOY2EF.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { S as SqlExpressionFields, d as defineCustomElement$1 } from './sql-expression-fields.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { a as isNotUndefined, D as Deferred, k as safeAsyncCall, l as devToolsAwareTimeout, m as safeCall } from './index2.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { editor, languages, Range, Uri, KeyMod, KeyCode } from 'monaco-editor';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
// src/index.ts
|
|
7
7
|
var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
|
|
@@ -19,17 +19,6 @@ async function newLayersFeatureLayer(properties) {
|
|
|
19
19
|
const ModConstructor = await importLayersFeatureLayer();
|
|
20
20
|
return new ModConstructor(properties);
|
|
21
21
|
}
|
|
22
|
-
async function importLayersSupportFieldsIndex() {
|
|
23
|
-
if (isAMD) {
|
|
24
|
-
return await window.$arcgis.import("esri/layers/support/FieldsIndex");
|
|
25
|
-
}
|
|
26
|
-
const module = await import('@arcgis/core/layers/support/FieldsIndex.js');
|
|
27
|
-
return isDefaultModule(module) ? module.default : module;
|
|
28
|
-
}
|
|
29
|
-
async function newLayersSupportFieldsIndex(properties) {
|
|
30
|
-
const ModConstructor = await importLayersSupportFieldsIndex();
|
|
31
|
-
return new ModConstructor(properties);
|
|
32
|
-
}
|
|
33
22
|
async function importPortalPortalItem() {
|
|
34
23
|
if (isAMD) {
|
|
35
24
|
return await window.$arcgis.import("esri/portal/PortalItem");
|
|
@@ -70,13 +59,6 @@ async function importArcade() {
|
|
|
70
59
|
const module = await import('@arcgis/core/arcade.js');
|
|
71
60
|
return isDefaultModule(module) ? module.default : module;
|
|
72
61
|
}
|
|
73
|
-
async function importCoreSql() {
|
|
74
|
-
if (isAMD) {
|
|
75
|
-
return await window.$arcgis.import("esri/core/sql");
|
|
76
|
-
}
|
|
77
|
-
const module = await import('@arcgis/core/core/sql.js');
|
|
78
|
-
return isDefaultModule(module) ? module.default : module;
|
|
79
|
-
}
|
|
80
62
|
async function importRequest() {
|
|
81
63
|
if (isAMD) {
|
|
82
64
|
return await window.$arcgis.import("esri/request");
|
|
@@ -170,4 +152,4 @@ function fieldAlias(field) {
|
|
|
170
152
|
return field.alias || field.name;
|
|
171
153
|
}
|
|
172
154
|
|
|
173
|
-
export { newPortalPortalItem as a, newWebScene as b, newWebMap as c, fieldTypeToIconName as d, fieldTypeToApiValueVarType as e, fieldAlias as f, importArcade as g,
|
|
155
|
+
export { newPortalPortalItem as a, newWebScene as b, newWebMap as c, fieldTypeToIconName as d, fieldTypeToApiValueVarType as e, fieldAlias as f, importArcade as g, importRequest as i, newLayersFeatureLayer as n, supportedFields as s };
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
export { setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
7
7
|
export { a as arcade } from './arcade-defaults.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, b as colorizedAllCodeElements } from './markdown.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { n as newLayersFeatureLayer, i as importRequest, s as supportedFields, a as newPortalPortalItem, b as newWebScene, c as newWebMap, f as fieldAlias, d as fieldTypeToIconName, e as fieldTypeToApiValueVarType } from './fields.js';
|
|
7
7
|
import { p as portalItemPageUrl } from './utilities.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { editor } from 'monaco-editor';
|
|
7
7
|
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.35
|
|
5
5
|
*/
|
|
6
6
|
import { f as fieldsToProfileValues, i as isPredefinedProfile, b as isFeatureSetDefinition, L as LanguageDefaultsBase, E as EditorProfile } from './language-defaults-base.js';
|
|
7
7
|
import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
|
|
@@ -108,18 +108,6 @@ async function convertToEditorProfileDefinition(predefinedProfile, locale = "en"
|
|
|
108
108
|
return editorProfile;
|
|
109
109
|
}
|
|
110
110
|
// #endregion
|
|
111
|
-
// #region profile utils
|
|
112
|
-
/**
|
|
113
|
-
* util to retrieve fields from the $layer variable in the api context.
|
|
114
|
-
*/
|
|
115
|
-
const getFieldsFromLayerVariable = (profile) => {
|
|
116
|
-
if (profile.variables) {
|
|
117
|
-
const layerVar = profile.variables.find((variable) => variable.name === "$layer" && variable.type === "dictionary");
|
|
118
|
-
return layerVar.properties ?? [];
|
|
119
|
-
}
|
|
120
|
-
return [];
|
|
121
|
-
};
|
|
122
|
-
// #endregion
|
|
123
111
|
|
|
124
112
|
/**
|
|
125
113
|
* Returns the sql-expression worker for the model.
|
|
@@ -193,4 +181,4 @@ class SqlExprDefaults extends LanguageDefaultsBase {
|
|
|
193
181
|
}
|
|
194
182
|
const sqlExprDefaults = new SqlExprDefaults();
|
|
195
183
|
|
|
196
|
-
export {
|
|
184
|
+
export { getMode as g, sqlExprDefaults as s };
|