@arcgis/coding-components 4.30.0-next.29 → 4.30.0-next.30
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/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-2262edb5.js → p-05407167.js} +2 -2
- package/dist/arcgis-coding-components/p-0e4fd488.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-eff2d3a4.js → p-1b04872b.js} +3 -3
- package/dist/arcgis-coding-components/{p-77ed71a8.js → p-305e6a27.js} +3 -3
- package/dist/arcgis-coding-components/{p-24adbb7c.js → p-38778060.js} +3 -3
- package/dist/arcgis-coding-components/{p-9a00ddea.js → p-3e84bed2.js} +2 -2
- package/dist/arcgis-coding-components/{p-23baf361.js → p-50cbdef2.js} +2 -2
- package/dist/arcgis-coding-components/p-51032f3c.js +68 -0
- package/dist/arcgis-coding-components/{p-9f9cd0b9.js → p-61a3a32b.js} +2 -2
- package/dist/arcgis-coding-components/{p-6df29b26.js → p-7f41598e.js} +2 -2
- package/dist/arcgis-coding-components/{p-9a6e0c8c.js → p-a09a2021.js} +1 -1
- package/dist/arcgis-coding-components/{p-622b32b2.js → p-f2b266c1.js} +1 -1
- package/dist/cjs/{arcade-defaults-5269f6ab.js → arcade-defaults-18a60f03.js} +663 -337
- package/dist/cjs/{arcade-mode-85df9043.js → arcade-mode-c53bfc0e.js} +45 -51
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +366 -261
- package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
- package/dist/cjs/{css-894bed01.js → css-56924b29.js} +1 -1
- package/dist/cjs/{cssMode-0fd626db.js → cssMode-ea630257.js} +3 -3
- package/dist/cjs/{html-64719fae.js → html-3d953aa2.js} +3 -3
- package/dist/cjs/{htmlMode-ad637d19.js → htmlMode-f3da6666.js} +3 -3
- package/dist/cjs/{index-994ea295.js → index-084a0845.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-72aed55a.js → javascript-470dd761.js} +4 -4
- package/dist/cjs/{jsonMode-b98b4ca9.js → jsonMode-f2bad76f.js} +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{tsMode-7b613436.js → tsMode-4dbfa911.js} +3 -3
- package/dist/cjs/{typescript-585a7543.js → typescript-8fb2fceb.js} +3 -3
- package/dist/components/arcade-api.js +6 -6
- package/dist/components/arcade-contribution.js +9 -10
- package/dist/components/arcade-defaults.js +58 -58
- package/dist/components/arcade-mode.js +44 -50
- package/dist/components/arcade-results.js +27 -27
- package/dist/components/arcade-suggestions.js +4 -4
- package/dist/components/arcade-variables.js +5 -5
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +24 -24
- 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/{chunk-MRROWYKQ.js → chunk-FQ4KFKVY.js} +305 -199
- package/dist/components/code-editor.js +13 -13
- package/dist/components/fields.js +2 -62
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +387 -3
- package/dist/components/markdown.js +3 -3
- package/dist/components/utilities.js +3 -3
- package/dist/esm/{arcade-defaults-87a86d11.js → arcade-defaults-3f0e1c43.js} +650 -326
- package/dist/esm/{arcade-mode-45fc67da.js → arcade-mode-5aef1763.js} +45 -51
- package/dist/esm/arcgis-arcade-api_6.entry.js +419 -314
- package/dist/esm/arcgis-coding-components.js +3 -3
- package/dist/esm/{css-08f38d73.js → css-4c710cf8.js} +1 -1
- package/dist/esm/{cssMode-ab8f5063.js → cssMode-54cea919.js} +3 -3
- package/dist/esm/{html-af497230.js → html-3908d2da.js} +3 -3
- package/dist/esm/{htmlMode-da083262.js → htmlMode-2fa6e6a4.js} +3 -3
- package/dist/esm/{index-18371544.js → index-06d390be.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-5e6afc56.js → javascript-1d86322d.js} +4 -4
- package/dist/esm/{jsonMode-71281d55.js → jsonMode-27eb619c.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{tsMode-98a33527.js → tsMode-9a8f9af2.js} +3 -3
- package/dist/esm/{typescript-1dcc1a21.js → typescript-7a26367c.js} +3 -3
- 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/arcade-monaco/arcade-language-features.d.ts +1 -1
- package/package.json +9 -9
- package/dist/arcgis-coding-components/p-0dc0bb8a.js +0 -6
- package/dist/arcgis-coding-components/p-1cdc731d.js +0 -6
- package/dist/arcgis-coding-components/p-62e5bb1a.js +0 -6
- package/dist/arcgis-coding-components/p-9dc57c40.entry.js +0 -6
- package/dist/arcgis-coding-components/p-e2200653.js +0 -68
- package/dist/cjs/Accessor-U5QUEX2T-e8f5e012.js +0 -1249
- package/dist/cjs/chunk-CQC6TXVI-eb50b11c.js +0 -1286
- package/dist/cjs/decorators-5KFQ5FDO-45eeb3a7.js +0 -120
- package/dist/components/Accessor-U5QUEX2T.js +0 -1247
- package/dist/components/chunk-CQC6TXVI.js +0 -1257
- package/dist/components/decorators-5KFQ5FDO.js +0 -109
- package/dist/esm/Accessor-U5QUEX2T-0dfda39e.js +0 -1247
- package/dist/esm/chunk-CQC6TXVI-f8d27710.js +0 -1257
- package/dist/esm/decorators-5KFQ5FDO-7ae08fab.js +0 -109
- /package/dist/types/data/{actions-runner-2 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-2 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/code-editor/code-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-2 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +0 -0
|
@@ -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.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.30
|
|
5
5
|
*/
|
|
6
6
|
import { editor, MarkerSeverity, Range, languages, Emitter } from 'monaco-editor';
|
|
7
7
|
import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat } from 'vscode-languageserver-types';
|
|
8
|
-
import {
|
|
8
|
+
import { w as debounce } from './index2.js';
|
|
9
9
|
|
|
10
10
|
var j={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"},Fe=["++","--"],Qe=["-","+","!","~"],Ze=["=","/=","*=","%=","+=","-="],Xe=["||","&&"],Lt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var U=[[],[],[]];Fe.forEach(t=>U[t.length-1]?.push(t));Qe.forEach(t=>U[t.length-1]?.push(t));Xe.forEach(t=>U[t.length-1]?.push(t));Ze.forEach(t=>U[t.length-1]?.push(t));Lt.forEach(t=>U[t.length-1]?.push(t));var ht=Object.values(f),dt=Object.values(j);dt.map(t=>({label:t,kind:CompletionItemKind.Constant}));ht.map(t=>({label:t,kind:CompletionItemKind.Keyword}));
|
|
11
11
|
|
|
@@ -37,19 +37,19 @@ const operators = [
|
|
|
37
37
|
"*=",
|
|
38
38
|
"**=",
|
|
39
39
|
"/=",
|
|
40
|
-
"%="
|
|
40
|
+
"%=",
|
|
41
41
|
];
|
|
42
42
|
const arcadeLanguageConfiguration = {
|
|
43
43
|
// the default separators except `@$`
|
|
44
44
|
wordPattern: /(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,
|
|
45
45
|
comments: {
|
|
46
46
|
lineComment: "//",
|
|
47
|
-
blockComment: ["/*", "*/"]
|
|
47
|
+
blockComment: ["/*", "*/"],
|
|
48
48
|
},
|
|
49
49
|
brackets: [
|
|
50
50
|
["{", "}"],
|
|
51
51
|
["[", "]"],
|
|
52
|
-
["(", ")"]
|
|
52
|
+
["(", ")"],
|
|
53
53
|
],
|
|
54
54
|
autoClosingPairs: [
|
|
55
55
|
{ open: "{", close: "}" },
|
|
@@ -57,21 +57,21 @@ const arcadeLanguageConfiguration = {
|
|
|
57
57
|
{ open: "(", close: ")" },
|
|
58
58
|
{ open: '"', close: '"', notIn: ["string"] },
|
|
59
59
|
{ open: "'", close: "'", notIn: ["string", "comment"] },
|
|
60
|
-
{ open: "`", close: "`", notIn: ["string", "comment"] }
|
|
60
|
+
{ open: "`", close: "`", notIn: ["string", "comment"] },
|
|
61
61
|
],
|
|
62
62
|
autoCloseBefore: ";:.,=}])` \n\t",
|
|
63
63
|
folding: {
|
|
64
64
|
markers: {
|
|
65
65
|
start: /^\s*\/\/\s*#?region\b/u,
|
|
66
|
-
end: /^\s*\/\/\s*#?endregion\b/u
|
|
67
|
-
}
|
|
66
|
+
end: /^\s*\/\/\s*#?endregion\b/u,
|
|
67
|
+
},
|
|
68
68
|
},
|
|
69
69
|
indentationRules: {
|
|
70
70
|
// ^(.*\*/)?\s*\}.*$
|
|
71
71
|
decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,
|
|
72
72
|
// ^.*\{[^}"']*$
|
|
73
|
-
increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u
|
|
74
|
-
}
|
|
73
|
+
increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u,
|
|
74
|
+
},
|
|
75
75
|
};
|
|
76
76
|
const arcadeMonarchLanguage = {
|
|
77
77
|
// Set defaultToken to invalid to see what you do not tokenize yet
|
|
@@ -107,16 +107,16 @@ const arcadeMonarchLanguage = {
|
|
|
107
107
|
cases: {
|
|
108
108
|
"@constants": "constant",
|
|
109
109
|
"@keywords": "keyword",
|
|
110
|
-
"@default": "identifier"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
110
|
+
"@default": "identifier",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
113
|
],
|
|
114
114
|
// whitespace
|
|
115
115
|
{ include: "@whitespace" },
|
|
116
116
|
// regular expression: ensure it is terminated before beginning (otherwise it is an opeator)
|
|
117
117
|
[
|
|
118
118
|
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,
|
|
119
|
-
{ token: "regexp", bracket: "@open", next: "@regexp" }
|
|
119
|
+
{ token: "regexp", bracket: "@open", next: "@regexp" },
|
|
120
120
|
],
|
|
121
121
|
// delimiters and operators
|
|
122
122
|
[/[()\[\]]/u, "@brackets"],
|
|
@@ -126,9 +126,9 @@ const arcadeMonarchLanguage = {
|
|
|
126
126
|
{
|
|
127
127
|
cases: {
|
|
128
128
|
"@operators": "delimiter",
|
|
129
|
-
"@default": ""
|
|
130
|
-
}
|
|
131
|
-
}
|
|
129
|
+
"@default": "",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
132
|
],
|
|
133
133
|
// numbers
|
|
134
134
|
[/(@digits)[eE]([\-+]?(@digits))?/u, "number"],
|
|
@@ -144,7 +144,7 @@ const arcadeMonarchLanguage = {
|
|
|
144
144
|
[/'([^'\\]|\\.)*$/u, "string.invalid"],
|
|
145
145
|
[/"/u, "string", "@string_double"],
|
|
146
146
|
[/'/u, "string", "@string_single"],
|
|
147
|
-
[/`/u, "string", "@string_backtick"]
|
|
147
|
+
[/`/u, "string", "@string_backtick"],
|
|
148
148
|
],
|
|
149
149
|
import: [
|
|
150
150
|
// import keyword
|
|
@@ -156,24 +156,24 @@ const arcadeMonarchLanguage = {
|
|
|
156
156
|
// whitespace
|
|
157
157
|
{ include: "@whitespace" },
|
|
158
158
|
// from keyword
|
|
159
|
-
[/from/u, { token: "keyword", next: "@popall" }]
|
|
159
|
+
[/from/u, { token: "keyword", next: "@popall" }],
|
|
160
160
|
],
|
|
161
161
|
whitespace: [
|
|
162
162
|
[/[ \t\r\n]+/u, ""],
|
|
163
163
|
[/\/\*/u, "comment", "@comment"],
|
|
164
|
-
[/\/\/.*$/u, "comment"]
|
|
164
|
+
[/\/\/.*$/u, "comment"],
|
|
165
165
|
],
|
|
166
166
|
comment: [
|
|
167
167
|
[/[^\/*]+/u, "comment"],
|
|
168
168
|
[/\*\//u, "comment", "@pop"],
|
|
169
|
-
[/[\/*]/u, "comment"]
|
|
169
|
+
[/[\/*]/u, "comment"],
|
|
170
170
|
],
|
|
171
171
|
// We match regular expression quite precisely
|
|
172
172
|
regexp: [
|
|
173
173
|
[/(\{)(\d+(?:,\d*)?)(\})/u, ["regexp.escape.control", "regexp.escape.control", "regexp.escape.control"]],
|
|
174
174
|
[
|
|
175
175
|
/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,
|
|
176
|
-
["regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }]
|
|
176
|
+
["regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }],
|
|
177
177
|
],
|
|
178
178
|
[/(\()(\?:|\?=|\?!)/u, ["regexp.escape.control", "regexp.escape.control"]],
|
|
179
179
|
[/[()]/u, "regexp.escape.control"],
|
|
@@ -181,45 +181,45 @@ const arcadeMonarchLanguage = {
|
|
|
181
181
|
[/[^\\\/]/u, "regexp"],
|
|
182
182
|
[/@regexpesc/u, "regexp.escape"],
|
|
183
183
|
[/\\\./u, "regexp.invalid"],
|
|
184
|
-
[/(\/)([gimsuy]*)/u, [{ token: "regexp", bracket: "@close", next: "@pop" }, "keyword.other"]]
|
|
184
|
+
[/(\/)([gimsuy]*)/u, [{ token: "regexp", bracket: "@close", next: "@pop" }, "keyword.other"]],
|
|
185
185
|
],
|
|
186
186
|
regexrange: [
|
|
187
187
|
[/-/u, "regexp.escape.control"],
|
|
188
188
|
[/\^/u, "regexp.invalid"],
|
|
189
189
|
[/@regexpesc/u, "regexp.escape"],
|
|
190
190
|
[/[^\]]/u, "regexp"],
|
|
191
|
-
[/\]/u, { token: "regexp.escape.control", next: "@pop", bracket: "@close" }]
|
|
191
|
+
[/\]/u, { token: "regexp.escape.control", next: "@pop", bracket: "@close" }],
|
|
192
192
|
],
|
|
193
193
|
string_double: [
|
|
194
194
|
[/[^\\"]+/u, "string"],
|
|
195
195
|
[/@escapes/u, "string.escape"],
|
|
196
196
|
[/\\./u, "string.escape.invalid"],
|
|
197
|
-
[/"/u, "string", "@pop"]
|
|
197
|
+
[/"/u, "string", "@pop"],
|
|
198
198
|
],
|
|
199
199
|
string_single: [
|
|
200
200
|
[/[^\\']+/u, "string"],
|
|
201
201
|
[/@escapes/u, "string.escape"],
|
|
202
202
|
[/\\./u, "string.escape.invalid"],
|
|
203
|
-
[/'/u, "string", "@pop"]
|
|
203
|
+
[/'/u, "string", "@pop"],
|
|
204
204
|
],
|
|
205
205
|
string_backtick: [
|
|
206
206
|
[/\$\{/u, { token: "delimiter.bracket", next: "@bracketCounting" }],
|
|
207
207
|
[/[^\\`$]+/u, "string"],
|
|
208
208
|
[/@escapes/u, "string.escape"],
|
|
209
209
|
[/\\./u, "string.escape.invalid"],
|
|
210
|
-
[/`/u, "string", "@pop"]
|
|
210
|
+
[/`/u, "string", "@pop"],
|
|
211
211
|
],
|
|
212
212
|
bracketCounting: [
|
|
213
213
|
[/\{/u, "delimiter.bracket", "@bracketCounting"],
|
|
214
214
|
[/\}/u, "delimiter.bracket", "@pop"],
|
|
215
|
-
{ include: "common" }
|
|
216
|
-
]
|
|
217
|
-
}
|
|
215
|
+
{ include: "common" },
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
//#region Diagnostic
|
|
221
221
|
class DiagnosticsAdapter {
|
|
222
|
-
constructor(_languageId, _worker, { defaults, diagnosticsService }) {
|
|
222
|
+
constructor(_languageId, _worker, { defaults, diagnosticsService, }) {
|
|
223
223
|
this._languageId = _languageId;
|
|
224
224
|
this._worker = _worker;
|
|
225
225
|
this._disposables = [];
|
|
@@ -231,7 +231,7 @@ class DiagnosticsAdapter {
|
|
|
231
231
|
if (languageId !== this._languageId) {
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
const debouncedValidate =
|
|
234
|
+
const debouncedValidate = debounce(() => {
|
|
235
235
|
this._doValidate(model, languageId).catch((err) => {
|
|
236
236
|
throw err;
|
|
237
237
|
});
|
|
@@ -275,7 +275,7 @@ class DiagnosticsAdapter {
|
|
|
275
275
|
dispose: () => {
|
|
276
276
|
this._listener.forEach((value) => value.dispose());
|
|
277
277
|
this._listener.clear();
|
|
278
|
-
}
|
|
278
|
+
},
|
|
279
279
|
});
|
|
280
280
|
editor.getModels().forEach(onModelAdd);
|
|
281
281
|
}
|
|
@@ -322,7 +322,7 @@ function toMarker(_resource, diag) {
|
|
|
322
322
|
startColumn: diag.range.start.character + 1,
|
|
323
323
|
endLineNumber: diag.range.end.line + 1,
|
|
324
324
|
endColumn: diag.range.end.character + 1,
|
|
325
|
-
message: diag.message
|
|
325
|
+
message: diag.message,
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
//#endregion
|
|
@@ -337,7 +337,7 @@ function toRange(range) {
|
|
|
337
337
|
function toTextEdit(textEdit) {
|
|
338
338
|
return {
|
|
339
339
|
range: toRange(textEdit.range),
|
|
340
|
-
text: textEdit.newText
|
|
340
|
+
text: textEdit.newText,
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
function isInsertReplaceEdit(edit) {
|
|
@@ -407,10 +407,7 @@ class CompletionProvider {
|
|
|
407
407
|
this._defaults = _defaults;
|
|
408
408
|
this.triggerCharacters = [".", "("];
|
|
409
409
|
}
|
|
410
|
-
async provideCompletionItems(model, position
|
|
411
|
-
// _context: languages.CompletionContext,
|
|
412
|
-
// _token: CancellationToken,
|
|
413
|
-
) {
|
|
410
|
+
async provideCompletionItems(model, position) {
|
|
414
411
|
const worker = await this._worker(model.uri);
|
|
415
412
|
const context = this._defaults.getApiContextForModel(model.uri);
|
|
416
413
|
const completionList = await worker.doComplete(model.uri.toString(), fromPosition(position), context);
|
|
@@ -424,13 +421,13 @@ class CompletionProvider {
|
|
|
424
421
|
filterText: entry.filterText,
|
|
425
422
|
detail: entry.detail,
|
|
426
423
|
range: wordRange,
|
|
427
|
-
kind: toCompletionItemKind(entry.kind)
|
|
424
|
+
kind: toCompletionItemKind(entry.kind),
|
|
428
425
|
};
|
|
429
426
|
if (entry.textEdit) {
|
|
430
427
|
if (isInsertReplaceEdit(entry.textEdit)) {
|
|
431
428
|
item.range = {
|
|
432
429
|
insert: toRange(entry.textEdit.insert),
|
|
433
|
-
replace: toRange(entry.textEdit.replace)
|
|
430
|
+
replace: toRange(entry.textEdit.replace),
|
|
434
431
|
};
|
|
435
432
|
}
|
|
436
433
|
else {
|
|
@@ -452,7 +449,7 @@ class CompletionProvider {
|
|
|
452
449
|
item.documentation = {
|
|
453
450
|
supportThemeIcons: false,
|
|
454
451
|
value: entry.documentation.value,
|
|
455
|
-
supportHtml: true
|
|
452
|
+
supportHtml: true,
|
|
456
453
|
};
|
|
457
454
|
}
|
|
458
455
|
}
|
|
@@ -460,7 +457,7 @@ class CompletionProvider {
|
|
|
460
457
|
});
|
|
461
458
|
return {
|
|
462
459
|
incomplete: completionList.isIncomplete,
|
|
463
|
-
suggestions: items
|
|
460
|
+
suggestions: items,
|
|
464
461
|
};
|
|
465
462
|
}
|
|
466
463
|
}
|
|
@@ -471,10 +468,7 @@ class FormattingProvider {
|
|
|
471
468
|
this._worker = _worker;
|
|
472
469
|
this._defaults = _defaults;
|
|
473
470
|
}
|
|
474
|
-
async provideDocumentFormattingEdits(model
|
|
475
|
-
// _options: languages.FormattingOptions,
|
|
476
|
-
// _token: CancellationToken,
|
|
477
|
-
) {
|
|
471
|
+
async provideDocumentFormattingEdits(model) {
|
|
478
472
|
const worker = await this._worker(model.uri);
|
|
479
473
|
const context = this._defaults.getApiContextForModel(model.uri.toString());
|
|
480
474
|
const edits = await worker.doFormat(model.uri.toString(), context);
|
|
@@ -515,8 +509,8 @@ class WorkerManager {
|
|
|
515
509
|
label: languageId,
|
|
516
510
|
createData: {
|
|
517
511
|
languageId,
|
|
518
|
-
languageOptions
|
|
519
|
-
}
|
|
512
|
+
languageOptions,
|
|
513
|
+
},
|
|
520
514
|
});
|
|
521
515
|
this._client = this._worker.getProxy();
|
|
522
516
|
}
|
|
@@ -591,7 +585,7 @@ function setupMode(arcadeDefaults) {
|
|
|
591
585
|
// eslint-disable-next-line no-new
|
|
592
586
|
new DiagnosticsAdapter(arcadeDefaults.languageId, workerAccessor, {
|
|
593
587
|
defaults: arcadeDefaults,
|
|
594
|
-
diagnosticsService: arcadeDiagnosticService
|
|
588
|
+
diagnosticsService: arcadeDiagnosticService,
|
|
595
589
|
});
|
|
596
590
|
}
|
|
597
591
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.30
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
7
|
-
import {
|
|
8
|
-
import { u as useControllerManager, a as useT9n } from './chunk-
|
|
9
|
-
import {
|
|
7
|
+
import { t as importArcade, s as setValuesInString, u as quoteString } from './index2.js';
|
|
8
|
+
import { u as useControllerManager, a as useT9n } from './chunk-FQ4KFKVY.js';
|
|
9
|
+
import { s as supportedFields } from './fields.js';
|
|
10
10
|
import "@esri/calcite-components/dist/components/calcite-tree.js";
|
|
11
11
|
import "@esri/calcite-components/dist/components/calcite-tree-item.js";
|
|
12
12
|
import "@esri/calcite-components/dist/components/calcite-loader.js";
|
|
@@ -200,7 +200,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
200
200
|
// Setup an executor with the script
|
|
201
201
|
const arcade = await importArcade();
|
|
202
202
|
const executor = await arcade.createArcadeExecutor(script ?? "", {
|
|
203
|
-
variables: editorProfile?.variables ?? []
|
|
203
|
+
variables: editorProfile?.variables ?? [],
|
|
204
204
|
});
|
|
205
205
|
// We want to measure the execution time
|
|
206
206
|
const t1 = performance.now();
|
|
@@ -210,7 +210,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
210
210
|
spatialReference,
|
|
211
211
|
timeZone,
|
|
212
212
|
rawOutput: true,
|
|
213
|
-
console
|
|
213
|
+
console,
|
|
214
214
|
};
|
|
215
215
|
// Execute the script
|
|
216
216
|
const scriptOutput = await executor.executeAsync(profileVariableInstances, executeContext);
|
|
@@ -234,7 +234,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
234
234
|
error,
|
|
235
235
|
timeStamp,
|
|
236
236
|
compilationTime: 0,
|
|
237
|
-
executionTime: 0
|
|
237
|
+
executionTime: 0,
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
240
|
}
|
|
@@ -246,13 +246,13 @@ const treeProps = {
|
|
|
246
246
|
lines: true,
|
|
247
247
|
selectionMode: "none",
|
|
248
248
|
scale: "s",
|
|
249
|
-
onCalciteTreeSelect: (e) => e.target.selectedItems.forEach((itemElt) => (itemElt.selected = false))
|
|
249
|
+
onCalciteTreeSelect: (e) => e.target.selectedItems.forEach((itemElt) => (itemElt.selected = false)),
|
|
250
250
|
};
|
|
251
251
|
const expandableTreeItemProps = {
|
|
252
252
|
onClick: (e) => {
|
|
253
253
|
const item = e.currentTarget;
|
|
254
254
|
item.expanded = !item.expanded;
|
|
255
|
-
}
|
|
255
|
+
},
|
|
256
256
|
};
|
|
257
257
|
//#endregion
|
|
258
258
|
//#region Helper Functions
|
|
@@ -271,7 +271,7 @@ function renderSimpleValue(arcadeResult) {
|
|
|
271
271
|
case "null":
|
|
272
272
|
return h("span", { class: "constant-value" }, arcadeResult.type);
|
|
273
273
|
case "text":
|
|
274
|
-
return h("span", { class: "string-value" },
|
|
274
|
+
return h("span", { class: "string-value" }, quoteString(arcadeResult.value));
|
|
275
275
|
case "number":
|
|
276
276
|
return h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
277
277
|
case "boolean":
|
|
@@ -279,9 +279,9 @@ function renderSimpleValue(arcadeResult) {
|
|
|
279
279
|
case "date":
|
|
280
280
|
return h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
281
281
|
case "dateOnly":
|
|
282
|
-
return h("span", { class: "string-value" },
|
|
282
|
+
return h("span", { class: "string-value" }, quoteString(formatArcadeResultDateOnly(arcadeResult)));
|
|
283
283
|
case "time":
|
|
284
|
-
return h("span", { class: "string-value" },
|
|
284
|
+
return h("span", { class: "string-value" }, quoteString(formatArcadeResultTimeOnly(arcadeResult)));
|
|
285
285
|
default:
|
|
286
286
|
return null;
|
|
287
287
|
}
|
|
@@ -349,23 +349,23 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
349
349
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
350
350
|
}
|
|
351
351
|
const iconClass = this.result?.type === "error" ? "color-error" : "color-success";
|
|
352
|
-
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label:
|
|
352
|
+
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label: setValuesInString(this.messages.lastexecutionformat, {
|
|
353
353
|
timeStamp: new Intl.DateTimeFormat(this.messages._t9nLocale, {
|
|
354
354
|
dateStyle: "medium",
|
|
355
|
-
timeStyle: "medium"
|
|
356
|
-
}).format(this.result.timeStamp)
|
|
357
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
355
|
+
timeStyle: "medium",
|
|
356
|
+
}).format(this.result.timeStamp),
|
|
357
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: setValuesInString(this.messages.compilationtimeformat, {
|
|
358
358
|
time: new Intl.NumberFormat(this.messages._t9nLocale, {
|
|
359
359
|
style: "unit",
|
|
360
360
|
unit: "millisecond",
|
|
361
|
-
maximumFractionDigits: 2
|
|
362
|
-
}).format(this.result.compilationTime ?? 0)
|
|
363
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
361
|
+
maximumFractionDigits: 2,
|
|
362
|
+
}).format(this.result.compilationTime ?? 0),
|
|
363
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: setValuesInString(this.messages.executiontimeformat, {
|
|
364
364
|
time: new Intl.NumberFormat(this.messages._t9nLocale, {
|
|
365
365
|
style: "unit",
|
|
366
366
|
unit: "millisecond",
|
|
367
|
-
maximumFractionDigits: 2
|
|
368
|
-
}).format(this.result.executionTime ?? 0)
|
|
367
|
+
maximumFractionDigits: 2,
|
|
368
|
+
}).format(this.result.executionTime ?? 0),
|
|
369
369
|
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })))) : (h("calcite-list-item", { label: this.messages.runscriptmessage ?? "No output, run the script once." }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: "color-info" })))));
|
|
370
370
|
}
|
|
371
371
|
renderOutputPanel() {
|
|
@@ -377,8 +377,8 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
377
377
|
}
|
|
378
378
|
switch (this.result?.type) {
|
|
379
379
|
case "error":
|
|
380
|
-
return (h("div", { class: "result-value-simple flex-adjustable" },
|
|
381
|
-
message: this.result.value
|
|
380
|
+
return (h("div", { class: "result-value-simple flex-adjustable" }, setValuesInString(this.messages.executionerrorformat, {
|
|
381
|
+
message: this.result.value,
|
|
382
382
|
})));
|
|
383
383
|
case "null":
|
|
384
384
|
case "unknown":
|
|
@@ -414,8 +414,8 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
414
414
|
renderArrayHeader(arcadeResult) {
|
|
415
415
|
const items = arcadeResult.value ?? [];
|
|
416
416
|
const leftoverCount = Math.max(items.length - MaxArrayItems, 0);
|
|
417
|
-
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0",
|
|
418
|
-
count: MaxArrayItems.toString()
|
|
417
|
+
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0", setValuesInString(this.messages.showingfirstitemsformat, {
|
|
418
|
+
count: MaxArrayItems.toString(),
|
|
419
419
|
}))) : null));
|
|
420
420
|
}
|
|
421
421
|
renderArrayTree(items, subtree = false) {
|
|
@@ -460,8 +460,8 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
renderFeatureSetLabel(arcadeResult) {
|
|
463
|
-
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0",
|
|
464
|
-
count: BatchSize.toString()
|
|
463
|
+
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0", setValuesInString(this.messages.showingfirstitemsformat, {
|
|
464
|
+
count: BatchSize.toString(),
|
|
465
465
|
}))) : null));
|
|
466
466
|
}
|
|
467
467
|
render() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.30
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, b as colorizeCodeElement } from './markdown.js';
|
|
8
8
|
import { f as filterCollection } from './utilities.js';
|
|
9
|
-
import { u as useControllerManager, a as useT9n } from './chunk-
|
|
10
|
-
import {
|
|
9
|
+
import { u as useControllerManager, a as useT9n } from './chunk-FQ4KFKVY.js';
|
|
10
|
+
import { k as setFocusOnElement } from './index2.js';
|
|
11
11
|
import "@esri/calcite-components/dist/components/calcite-list-item-group.js";
|
|
12
12
|
import "@esri/calcite-components/dist/components/calcite-list-item.js";
|
|
13
13
|
import "@esri/calcite-components/dist/components/calcite-action.js";
|
|
@@ -101,7 +101,7 @@ const ArcgisArcadeSuggestions = /*@__PURE__*/ proxyCustomElement(class ArcgisArc
|
|
|
101
101
|
// When switching between flow the same reference is reused
|
|
102
102
|
this._flowObserver = new MutationObserver(() => {
|
|
103
103
|
// Get the last panel and try to set focus on the input element
|
|
104
|
-
|
|
104
|
+
setFocusOnElement(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
105
105
|
});
|
|
106
106
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
107
107
|
}
|
|
@@ -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.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.30
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
7
|
-
import { u as useControllerManager, a as useT9n } from './chunk-
|
|
8
|
-
import {
|
|
7
|
+
import { u as useControllerManager, a as useT9n } from './chunk-FQ4KFKVY.js';
|
|
8
|
+
import { k as setFocusOnElement, j as createFilterExpression } from './index2.js';
|
|
9
9
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
10
10
|
import "@esri/calcite-components/dist/components/calcite-flow-item.js";
|
|
11
11
|
import "@esri/calcite-components/dist/components/calcite-action.js";
|
|
@@ -100,7 +100,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
100
100
|
// When switching between flow the same reference is reused
|
|
101
101
|
this._flowObserver = new MutationObserver(() => {
|
|
102
102
|
// Get the last panel and try to set focus on the input element
|
|
103
|
-
|
|
103
|
+
setFocusOnElement(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
104
104
|
});
|
|
105
105
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
106
106
|
}
|
|
@@ -134,7 +134,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
|
|
|
134
134
|
}
|
|
135
135
|
renderEditorVariables(collection) {
|
|
136
136
|
// Filter the variables. Skip group, we will filter the children later on.
|
|
137
|
-
const filterExpression =
|
|
137
|
+
const filterExpression = createFilterExpression(this._filterValue);
|
|
138
138
|
const filteredVariables = collection.variables.filter((variable) => variable.passFilter(filterExpression));
|
|
139
139
|
if (!filteredVariables.length) {
|
|
140
140
|
return h("div", { class: "notice-container" }, this.messages.noitems ?? "No item");
|
|
@@ -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.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.30
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeApi$1, d as defineCustomElement$1 } from './arcade-api.js';
|
|
7
7
|
|