@arcgis/coding-components 4.30.0-next.11 → 4.30.0-next.111
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/LICENSE.md +1 -1
- package/README.md +2 -4
- package/dist/arcgis-coding-components/arcgis-coding-components.css +1 -1
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-api/t9n/arcade-api.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ar.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bg.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bs.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ca.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.cs.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.da.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.de.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.el.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.en.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.es.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.et.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fi.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fr.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.he.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hr.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hu.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.id.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.it.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ja.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ko.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lt.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lv.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nb.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nl.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pl.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-BR.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-PT.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ro.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ru.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sk.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sl.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sr.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sv.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.th.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.tr.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.uk.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.vi.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-CN.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-HK.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-TW.json +25 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +8 -6
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hu.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ja.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.lt.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.lv.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ro.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +7 -5
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +3 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +2 -2
- package/dist/arcgis-coding-components/assets/code-editor/css.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/editor.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/html.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/json.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/ts.worker.js +1 -1
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/p-25549f14.entry.js +6 -0
- package/dist/arcgis-coding-components/p-4998461e.js +6 -0
- package/dist/arcgis-coding-components/p-4d731512.js +6 -0
- package/dist/arcgis-coding-components/{p-2dc8c1c3.js → p-7d1a3e00.js} +1 -1
- package/dist/arcgis-coding-components/p-7f7b18b5.js +7 -0
- package/dist/arcgis-coding-components/{p-67e523f9.js → p-81b4a62f.js} +2 -2
- package/dist/arcgis-coding-components/p-82cacda2.js +68 -0
- package/dist/arcgis-coding-components/{p-fe7352bb.js → p-8e74e852.js} +3 -3
- package/dist/arcgis-coding-components/{p-b2a8cb09.js → p-91470a4a.js} +2 -2
- package/dist/arcgis-coding-components/{p-b8161e05.js → p-bc983f83.js} +2 -2
- package/dist/arcgis-coding-components/{p-ef12f153.js → p-c9ac7a16.js} +3 -3
- package/dist/arcgis-coding-components/{p-acb10a82.js → p-e1b11b78.js} +2 -2
- package/dist/arcgis-coding-components/{p-f74fe922.js → p-f5841047.js} +2 -2
- package/dist/cjs/app-globals-41c1f370.js +10 -0
- package/dist/cjs/{arcade-defaults-576ac87c.js → arcade-defaults-d6466b5a.js} +729 -289
- package/dist/cjs/{arcade-mode-255ab73e.js → arcade-mode-b9b8cb02.js} +78 -84
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +1613 -240
- package/dist/cjs/arcgis-coding-components.cjs.js +14 -12
- package/dist/cjs/{css-ed54e7c5.js → css-445635ef.js} +1 -1
- package/dist/cjs/{cssMode-953d135f.js → cssMode-afed37ca.js} +3 -3
- package/dist/cjs/{html-6885989e.js → html-04f96ede.js} +3 -3
- package/dist/cjs/{htmlMode-036d018f.js → htmlMode-30d3358f.js} +3 -3
- package/dist/cjs/index-202533e4.js +1303 -0
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-8937794f.js → javascript-0f0f9b7b.js} +4 -4
- package/dist/cjs/{jsonMode-679c7610.js → jsonMode-7ffc2346.js} +3 -3
- package/dist/cjs/loader.cjs.js +6 -4
- package/dist/cjs/{tsMode-ab115860.js → tsMode-885b55a1.js} +3 -3
- package/dist/cjs/{typescript-38fcedb8.js → typescript-c042efee.js} +3 -3
- package/dist/components/arcade-api.js +27 -34
- package/dist/components/arcade-contribution.js +10 -10
- package/dist/components/arcade-defaults.js +143 -161
- package/dist/components/arcade-mode.js +46 -52
- package/dist/components/arcade-results.js +51 -61
- package/dist/components/arcade-suggestions.js +27 -34
- package/dist/components/arcade-variables.js +26 -37
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +63 -89
- 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-2CDDVOQU.js +1364 -0
- package/dist/components/code-editor.js +75 -80
- package/dist/components/fields.js +45 -45
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +394 -3
- package/dist/components/markdown.js +13 -27
- package/dist/components/useT9n.js +37 -0
- package/dist/components/utilities.js +3 -3
- package/dist/esm/app-globals-73ff8787.js +8 -0
- package/dist/esm/{arcade-defaults-75889e75.js → arcade-defaults-c6c41c52.js} +712 -275
- package/dist/esm/{arcade-mode-5b34a4b8.js → arcade-mode-3b59a8a3.js} +78 -84
- package/dist/esm/arcgis-arcade-api_6.entry.js +1613 -240
- package/dist/esm/arcgis-coding-components.js +15 -13
- package/dist/esm/{css-97016367.js → css-19fe388b.js} +1 -1
- package/dist/esm/{cssMode-9629ae8c.js → cssMode-18face1c.js} +3 -3
- package/dist/esm/{html-8663047e.js → html-f3314d3b.js} +3 -3
- package/dist/esm/{htmlMode-bebf5737.js → htmlMode-2796244f.js} +3 -3
- package/dist/esm/index-9e18ee96.js +1272 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-b4989490.js → javascript-10ca6f91.js} +4 -4
- package/dist/esm/{jsonMode-b32620ba.js → jsonMode-9f05b287.js} +3 -3
- package/dist/esm/loader.js +7 -5
- package/dist/esm/{tsMode-a6cd5561.js → tsMode-17e9cd75.js} +3 -3
- package/dist/esm/{typescript-4fbf00a5.js → typescript-1416b690.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/components/arcade-api/arcade-api.d.ts +6 -7
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +18 -12
- package/dist/types/components/arcade-results/arcade-results.d.ts +6 -9
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +7 -8
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +6 -8
- package/dist/types/components/code-editor/code-editor.d.ts +23 -13
- package/dist/types/components.d.ts +57 -35
- package/dist/types/controllers/useT9n.d.ts +1 -0
- package/dist/types/data/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 +10 -13
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +15 -0
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -1
- package/dist/types/utils/profile/types.d.ts +40 -13
- package/dist/types/utils/profile/utils.d.ts +2 -4
- package/package.json +24 -24
- package/dist/arcgis-coding-components/p-2ccd9fd8.entry.js +0 -6
- package/dist/arcgis-coding-components/p-2d2b5e39.js +0 -7
- package/dist/arcgis-coding-components/p-7e1cb194.js +0 -68
- package/dist/arcgis-coding-components/p-9829e511.js +0 -6
- package/dist/cjs/index-2c5ded93.js +0 -1958
- package/dist/esm/index-b24a41ab.js +0 -1927
|
@@ -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.111
|
|
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 { u 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"],
|
|
@@ -140,11 +140,11 @@ const arcadeMonarchLanguage = {
|
|
|
140
140
|
// delimiter: after number because of .\d floats
|
|
141
141
|
[/[;,.]/u, "delimiter"],
|
|
142
142
|
// strings
|
|
143
|
-
[/"([^"\\]|\\.)*$/u, "string.invalid"],
|
|
144
|
-
[/'([^'\\]|\\.)*$/u, "string.invalid"],
|
|
143
|
+
[/"([^"\\]|\\.)*$/u, "string.invalid"], // non-teminated string
|
|
144
|
+
[/'([^'\\]|\\.)*$/u, "string.invalid"], // non-teminated string
|
|
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,11 +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.111
|
|
5
5
|
*/
|
|
6
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as importArcade, s as supportedFields } from './fields.js';
|
|
8
|
-
import {
|
|
8
|
+
import { u as useControllerManager } from './chunk-2CDDVOQU.js';
|
|
9
|
+
import { s as setValuesInString, r as quoteString } from './index2.js';
|
|
10
|
+
import { u as useT9n } from './useT9n.js';
|
|
9
11
|
import "@esri/calcite-components/dist/components/calcite-tree.js";
|
|
10
12
|
import "@esri/calcite-components/dist/components/calcite-tree-item.js";
|
|
11
13
|
import "@esri/calcite-components/dist/components/calcite-loader.js";
|
|
@@ -15,7 +17,6 @@ import "@esri/calcite-components/dist/components/calcite-icon.js";
|
|
|
15
17
|
import "@esri/calcite-components/dist/components/calcite-action-bar.js";
|
|
16
18
|
import "@esri/calcite-components/dist/components/calcite-action-group.js";
|
|
17
19
|
import "@esri/calcite-components/dist/components/calcite-action.js";
|
|
18
|
-
import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
|
|
19
20
|
|
|
20
21
|
const DevelopersWebSitePath = "https://developers.arcgis.com/arcade/";
|
|
21
22
|
const MaxArrayItems = 100;
|
|
@@ -200,7 +201,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
200
201
|
// Setup an executor with the script
|
|
201
202
|
const arcade = await importArcade();
|
|
202
203
|
const executor = await arcade.createArcadeExecutor(script ?? "", {
|
|
203
|
-
variables: editorProfile?.variables ?? []
|
|
204
|
+
variables: editorProfile?.variables ?? [],
|
|
204
205
|
});
|
|
205
206
|
// We want to measure the execution time
|
|
206
207
|
const t1 = performance.now();
|
|
@@ -210,7 +211,7 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
210
211
|
spatialReference,
|
|
211
212
|
timeZone,
|
|
212
213
|
rawOutput: true,
|
|
213
|
-
console
|
|
214
|
+
console,
|
|
214
215
|
};
|
|
215
216
|
// Execute the script
|
|
216
217
|
const scriptOutput = await executor.executeAsync(profileVariableInstances, executeContext);
|
|
@@ -234,25 +235,26 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
234
235
|
error,
|
|
235
236
|
timeStamp,
|
|
236
237
|
compilationTime: 0,
|
|
237
|
-
executionTime: 0
|
|
238
|
+
executionTime: 0,
|
|
238
239
|
};
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
242
|
|
|
242
|
-
const arcadeResultsCss = ":host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2)}:host .flex-adjustable{flex:1 1 auto;overflow:hidden}:host .flex-row{display:flex;flex-direction:row;overflow:hidden}:host .flex-column{display:flex;flex-direction:column;overflow:hidden}:host .y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}:host header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}:host .ltr-container{direction:ltr}:host calcite-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-
|
|
243
|
+
const arcadeResultsCss = ":host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2)}:host .flex-adjustable{flex:1 1 auto;overflow:hidden}:host .flex-row{display:flex;flex-direction:row;overflow:hidden}:host .flex-column{display:flex;flex-direction:column;overflow:hidden}:host .y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}:host header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}:host .ltr-container{direction:ltr}:host calcite-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}:host calcite-action-bar calcite-action-group:last-child{border-inline-end-width:0px}:host calcite-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}:host .notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}:host .color-info{color:var(--calcite-color-status-info)}:host .color-error{color:var(--calcite-color-status-danger)}:host .color-success{color:var(--calcite-color-status-success)}:host [class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}:host .console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}:host .result-value-table table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap}:host .result-value-table table thead{background-color:var(--calcite-color-foreground-2)}:host .result-value-table table tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}:host .result-value-table table th,:host .result-value-table table td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs)}:host .result-value-table table th .string-value,:host .result-value-table table td .string-value{white-space:pre}:host .result-value-table table th{font-weight:var(--calcite-font-weight-medium)}:host .tree-item-label,:host .number-value,:host .string-value,:host .boolean-value{font-family:var(--calcite-code-family)}:host .tree-item-label,:host .value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}:host .dictionary-property{color:var(--arcgis-arcade-editor-identifier)}:host .number-value{color:var(--arcgis-arcade-editor-number)}:host .string-value{color:var(--arcgis-arcade-editor-string);white-space:pre-wrap}:host .constant-value{color:var(--arcgis-arcade-editor-constant)}:host .date-value{color:var(--arcgis-arcade-editor-date)}";
|
|
244
|
+
const ArcgisArcadeResultsStyle0 = arcadeResultsCss;
|
|
243
245
|
|
|
244
246
|
//#region Specialized Constants
|
|
245
247
|
const treeProps = {
|
|
246
248
|
lines: true,
|
|
247
249
|
selectionMode: "none",
|
|
248
250
|
scale: "s",
|
|
249
|
-
onCalciteTreeSelect: (e) => e.target.selectedItems.forEach((itemElt) => (itemElt.selected = false))
|
|
251
|
+
onCalciteTreeSelect: (e) => e.target.selectedItems.forEach((itemElt) => (itemElt.selected = false)),
|
|
250
252
|
};
|
|
251
253
|
const expandableTreeItemProps = {
|
|
252
254
|
onClick: (e) => {
|
|
253
255
|
const item = e.currentTarget;
|
|
254
256
|
item.expanded = !item.expanded;
|
|
255
|
-
}
|
|
257
|
+
},
|
|
256
258
|
};
|
|
257
259
|
//#endregion
|
|
258
260
|
//#region Helper Functions
|
|
@@ -271,7 +273,7 @@ function renderSimpleValue(arcadeResult) {
|
|
|
271
273
|
case "null":
|
|
272
274
|
return h("span", { class: "constant-value" }, arcadeResult.type);
|
|
273
275
|
case "text":
|
|
274
|
-
return h("span", { class: "string-value" },
|
|
276
|
+
return h("span", { class: "string-value" }, quoteString(arcadeResult.value));
|
|
275
277
|
case "number":
|
|
276
278
|
return h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
277
279
|
case "boolean":
|
|
@@ -279,9 +281,9 @@ function renderSimpleValue(arcadeResult) {
|
|
|
279
281
|
case "date":
|
|
280
282
|
return h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
281
283
|
case "dateOnly":
|
|
282
|
-
return h("span", { class: "string-value" },
|
|
284
|
+
return h("span", { class: "string-value" }, quoteString(formatArcadeResultDateOnly(arcadeResult)));
|
|
283
285
|
case "time":
|
|
284
|
-
return h("span", { class: "string-value" },
|
|
286
|
+
return h("span", { class: "string-value" }, quoteString(formatArcadeResultTimeOnly(arcadeResult)));
|
|
285
287
|
default:
|
|
286
288
|
return null;
|
|
287
289
|
}
|
|
@@ -298,13 +300,20 @@ function renderFeatureSetTable(arcadeResult) {
|
|
|
298
300
|
}
|
|
299
301
|
})))))));
|
|
300
302
|
}
|
|
303
|
+
const __cmpMeta = [1,"arcgis-arcade-results",{"loading":[1028],"openedResultPanel":[1537,"opened-result-panel"],"result":[1040],"consoleLogs":[1040]}];
|
|
301
304
|
const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeResults extends HTMLElement {
|
|
305
|
+
connectedCallback() { this.manager._connectedCallback(); }
|
|
306
|
+
disconnectedCallback() { this.manager._disconnectedCallback(); }
|
|
302
307
|
constructor() {
|
|
303
308
|
super();
|
|
304
309
|
this.__registerHost();
|
|
310
|
+
this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
305
311
|
this.__attachShadow();
|
|
306
|
-
this.
|
|
307
|
-
this.
|
|
312
|
+
this.arcgisOpenedResultPanelChange = createEvent(this, "arcgisOpenedResultPanelChange", 3);
|
|
313
|
+
this.arcgisClose = createEvent(this, "arcgisClose", 3);
|
|
314
|
+
this.manager = useControllerManager(this,forceUpdate);
|
|
315
|
+
//#region Private Properties
|
|
316
|
+
this.messages = useT9n();
|
|
308
317
|
this._switchResultPanel = (e) => {
|
|
309
318
|
if (!e.target) {
|
|
310
319
|
return;
|
|
@@ -315,28 +324,17 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
315
324
|
}
|
|
316
325
|
this.updateResultPanel(panelName);
|
|
317
326
|
};
|
|
318
|
-
this._emitClose = () => this.
|
|
319
|
-
this._lang = "";
|
|
320
|
-
this._t9nLocale = "";
|
|
321
|
-
this._t9nStrings = undefined;
|
|
327
|
+
this._emitClose = () => this.arcgisClose.emit();
|
|
322
328
|
this.loading = true;
|
|
323
329
|
this.openedResultPanel = "output";
|
|
324
330
|
this.result = undefined;
|
|
325
331
|
this.consoleLogs = undefined;
|
|
326
332
|
}
|
|
327
333
|
//#endregion
|
|
328
|
-
// #region Component lifecycle events
|
|
329
|
-
async componentWillLoad() {
|
|
330
|
-
await B(this, getAssetPath("./assets"));
|
|
331
|
-
}
|
|
332
|
-
disconnectedCallback() {
|
|
333
|
-
q(this);
|
|
334
|
-
}
|
|
335
|
-
// #endregion
|
|
336
334
|
//#region Private Methods
|
|
337
335
|
updateResultPanel(resultPanelType) {
|
|
338
336
|
this.openedResultPanel = resultPanelType;
|
|
339
|
-
this.
|
|
337
|
+
this.arcgisOpenedResultPanelChange.emit(resultPanelType);
|
|
340
338
|
}
|
|
341
339
|
//#endregion
|
|
342
340
|
//#region Rendering
|
|
@@ -347,7 +345,7 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
347
345
|
if (this.loading && !this.consoleLogs?.length) {
|
|
348
346
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
349
347
|
}
|
|
350
|
-
return (h("div", { class: "console-logs-container ltr-container" }, this.consoleLogs?.length ?
|
|
348
|
+
return (h("div", { class: "console-logs-container ltr-container" }, this.consoleLogs?.length ? this.consoleLogs.map((log) => h("p", null, log)) : h("p", null, this.messages.consolemessage)));
|
|
351
349
|
}
|
|
352
350
|
renderLogPanel() {
|
|
353
351
|
if (this.openedResultPanel !== "log") {
|
|
@@ -357,24 +355,24 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
357
355
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
358
356
|
}
|
|
359
357
|
const iconClass = this.result?.type === "error" ? "color-error" : "color-success";
|
|
360
|
-
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label:
|
|
361
|
-
timeStamp: new Intl.DateTimeFormat(this._t9nLocale, {
|
|
358
|
+
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label: setValuesInString(this.messages.lastexecutionformat, {
|
|
359
|
+
timeStamp: new Intl.DateTimeFormat(this.messages._t9nLocale, {
|
|
362
360
|
dateStyle: "medium",
|
|
363
|
-
timeStyle: "medium"
|
|
364
|
-
}).format(this.result.timeStamp)
|
|
365
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
366
|
-
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
361
|
+
timeStyle: "medium",
|
|
362
|
+
}).format(this.result.timeStamp),
|
|
363
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: setValuesInString(this.messages.compilationtimeformat, {
|
|
364
|
+
time: new Intl.NumberFormat(this.messages._t9nLocale, {
|
|
367
365
|
style: "unit",
|
|
368
366
|
unit: "millisecond",
|
|
369
|
-
maximumFractionDigits: 2
|
|
370
|
-
}).format(this.result.compilationTime ?? 0)
|
|
371
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
372
|
-
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
367
|
+
maximumFractionDigits: 2,
|
|
368
|
+
}).format(this.result.compilationTime ?? 0),
|
|
369
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: setValuesInString(this.messages.executiontimeformat, {
|
|
370
|
+
time: new Intl.NumberFormat(this.messages._t9nLocale, {
|
|
373
371
|
style: "unit",
|
|
374
372
|
unit: "millisecond",
|
|
375
|
-
maximumFractionDigits: 2
|
|
376
|
-
}).format(this.result.executionTime ?? 0)
|
|
377
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })))) : (h("calcite-list-item", { label: this.
|
|
373
|
+
maximumFractionDigits: 2,
|
|
374
|
+
}).format(this.result.executionTime ?? 0),
|
|
375
|
+
}) }, 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" })))));
|
|
378
376
|
}
|
|
379
377
|
renderOutputPanel() {
|
|
380
378
|
if (this.openedResultPanel !== "output") {
|
|
@@ -385,8 +383,8 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
385
383
|
}
|
|
386
384
|
switch (this.result?.type) {
|
|
387
385
|
case "error":
|
|
388
|
-
return (h("div", { class: "result-value-simple flex-adjustable" },
|
|
389
|
-
message: this.result.value
|
|
386
|
+
return (h("div", { class: "result-value-simple flex-adjustable" }, setValuesInString(this.messages.executionerrorformat, {
|
|
387
|
+
message: this.result.value,
|
|
390
388
|
})));
|
|
391
389
|
case "null":
|
|
392
390
|
case "unknown":
|
|
@@ -416,14 +414,14 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
416
414
|
case "knowledgeGraph":
|
|
417
415
|
return (h("div", { class: "result-value-simple ltr-container" }, h("span", { class: "value-type" }, this.result.type, ":\u00A0"), h("span", { class: "string-value" }, this.result.value.url)));
|
|
418
416
|
default:
|
|
419
|
-
return
|
|
417
|
+
return h("div", { class: "result-value-simple flex-adjustable ltr-container" }, this.messages.runscriptmessage);
|
|
420
418
|
}
|
|
421
419
|
}
|
|
422
420
|
renderArrayHeader(arcadeResult) {
|
|
423
421
|
const items = arcadeResult.value ?? [];
|
|
424
422
|
const leftoverCount = Math.max(items.length - MaxArrayItems, 0);
|
|
425
|
-
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0",
|
|
426
|
-
count: MaxArrayItems.toString()
|
|
423
|
+
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0", setValuesInString(this.messages.showingfirstitemsformat, {
|
|
424
|
+
count: MaxArrayItems.toString(),
|
|
427
425
|
}))) : null));
|
|
428
426
|
}
|
|
429
427
|
renderArrayTree(items, subtree = false) {
|
|
@@ -468,25 +466,17 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
468
466
|
}
|
|
469
467
|
}
|
|
470
468
|
renderFeatureSetLabel(arcadeResult) {
|
|
471
|
-
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0",
|
|
472
|
-
count: BatchSize.toString()
|
|
469
|
+
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0", setValuesInString(this.messages.showingfirstitemsformat, {
|
|
470
|
+
count: BatchSize.toString(),
|
|
473
471
|
}))) : null));
|
|
474
472
|
}
|
|
475
473
|
render() {
|
|
476
|
-
return (h(Host,
|
|
474
|
+
return (h(Host, { key: 'a614339d095dcaa6ba426f3fc104f3628979a019' }, h("header", { key: 'cafdb89380b6a1db8fb478ef61d8dc328907977d', class: "flex-row" }, h("calcite-action-bar", { key: '542065aba5cc9e26ee9259c47e8c067d39aee748', class: "flex-adjustable", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { key: 'ca20537be7a679c37ae72ba6556a2448c3ff3a3b', scale: "s" }, h("calcite-action", { key: 'e7cf514c820e23d77663b48190be003b679dd865', active: this.openedResultPanel === "output", text: this.messages.output ?? "Output", "text-enabled": true, scale: "s", icon: "list-show-all", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "output" }), h("calcite-action", { key: '086b8bb306556ce5bbe8153a5ebfa42430eef01e', active: this.openedResultPanel === "console", text: this.messages.console ?? "Console", "text-enabled": true, scale: "s", icon: "console", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "console" }), h("calcite-action", { key: 'fde3d723183ea294706adf0bb5041bd10234a222', active: this.openedResultPanel === "log", text: this.messages.log ?? "Log", "text-enabled": true, scale: "s", icon: "list", iconFlipRtl: true, onClick: this._switchResultPanel, "data-panel-name": "log" }))), h("calcite-action", { key: '51cc05e32acc8dc0eee956af96fe8541abf613e8', scale: "s", icon: "x", text: this.messages.close ?? "", onClick: this._emitClose })), h("article", { key: 'ce84fa0ec6376e764c3479a9c891dfa02dd7cb10', class: "flex-adjustable" }, this.loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: "" })) : (h("div", { class: "flex-column y-scrollable-container" }, this.renderOutputPanel(), this.renderConsolePanel(), this.renderLogPanel())))));
|
|
477
475
|
}
|
|
478
476
|
static get assetsDirs() { return ["assets"]; }
|
|
479
|
-
get
|
|
480
|
-
static get style() { return
|
|
481
|
-
},
|
|
482
|
-
"loading": [4],
|
|
483
|
-
"openedResultPanel": [1537, "opened-result-panel"],
|
|
484
|
-
"result": [16],
|
|
485
|
-
"consoleLogs": [16],
|
|
486
|
-
"_lang": [32],
|
|
487
|
-
"_t9nLocale": [32],
|
|
488
|
-
"_t9nStrings": [32]
|
|
489
|
-
}]);
|
|
477
|
+
get el() { return this; }
|
|
478
|
+
static get style() { return ArcgisArcadeResultsStyle0; }
|
|
479
|
+
}, __cmpMeta);
|
|
490
480
|
function defineCustomElement() {
|
|
491
481
|
if (typeof customElements === "undefined") {
|
|
492
482
|
return;
|