@arcgis/coding-components 4.30.0-next.9 → 4.30.0-next.91
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-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 +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +2 -0
- 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 +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +2 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +2 -0
- 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 +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +2 -0
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +2 -0
- 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-1818f70a.js +7 -0
- package/dist/arcgis-coding-components/{p-5bb0cc6f.js → p-42521253.js} +2 -2
- package/dist/arcgis-coding-components/{p-24963fee.js → p-571527b2.js} +3 -3
- package/dist/arcgis-coding-components/{p-22acdf9e.js → p-7e9bfb5e.js} +1 -1
- package/dist/arcgis-coding-components/{p-f6ac0a47.js → p-ab667b93.js} +3 -3
- package/dist/arcgis-coding-components/p-c959e8ad.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-3861533c.js → p-cb0e91f8.js} +3 -3
- package/dist/arcgis-coding-components/p-d172cb6b.js +68 -0
- package/dist/arcgis-coding-components/{p-ee8182a0.js → p-d6af9a0f.js} +2 -2
- package/dist/arcgis-coding-components/{p-07a4996f.js → p-e2de9631.js} +2 -2
- package/dist/arcgis-coding-components/{p-e8d8cb26.js → p-f4f50674.js} +2 -2
- package/dist/arcgis-coding-components/{p-acf1a47b.js → p-f6af0173.js} +2 -2
- package/dist/cjs/{arcade-defaults-9a205209.js → arcade-defaults-9c519009.js} +625 -248
- package/dist/cjs/{arcade-mode-b45aee7d.js → arcade-mode-2de2a7bf.js} +45 -51
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +1652 -290
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/{css-19232df4.js → css-de32edb5.js} +1 -1
- package/dist/cjs/{cssMode-4f290a37.js → cssMode-576d9424.js} +3 -3
- package/dist/cjs/{html-8e42ebe7.js → html-04970904.js} +3 -3
- package/dist/cjs/{htmlMode-062349b7.js → htmlMode-d2890ac0.js} +3 -3
- package/dist/cjs/{index-f8b11b82.js → index-873901a9.js} +40 -4
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-337ae21a.js → javascript-cbbd5053.js} +4 -4
- package/dist/cjs/{jsonMode-247b2a02.js → jsonMode-dd28f8eb.js} +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{tsMode-a95a4dea.js → tsMode-dac552ef.js} +3 -3
- package/dist/cjs/{typescript-78dffda3.js → typescript-da6b4646.js} +3 -3
- package/dist/components/arcade-api.js +23 -33
- package/dist/components/arcade-contribution.js +72 -13
- package/dist/components/arcade-defaults.js +131 -149
- package/dist/components/arcade-mode.js +44 -50
- package/dist/components/arcade-results.js +47 -60
- package/dist/components/arcade-suggestions.js +23 -33
- package/dist/components/arcade-variables.js +22 -36
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +60 -150
- 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-IHYYRFLQ.js +1363 -0
- package/dist/components/code-editor.js +70 -78
- 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 +9 -11
- package/dist/components/useT9n.js +37 -0
- package/dist/components/utilities.js +3 -3
- package/dist/esm/{arcade-defaults-2280f825.js → arcade-defaults-656c0b09.js} +608 -235
- package/dist/esm/{arcade-mode-85d869d0.js → arcade-mode-777c3a35.js} +45 -51
- package/dist/esm/arcgis-arcade-api_6.entry.js +1652 -290
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/{css-da967c43.js → css-c3db7375.js} +1 -1
- package/dist/esm/{cssMode-b235d424.js → cssMode-f030de75.js} +3 -3
- package/dist/esm/{html-4b5f94a0.js → html-a57519f0.js} +3 -3
- package/dist/esm/{htmlMode-c9b00fcc.js → htmlMode-a292e84b.js} +3 -3
- package/dist/esm/{index-f5eb0427.js → index-21588bc1.js} +40 -4
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-42627a0e.js → javascript-3eda0787.js} +4 -4
- package/dist/esm/{jsonMode-7dce6c2d.js → jsonMode-2c222212.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{tsMode-85663f7f.js → tsMode-40f20114.js} +3 -3
- package/dist/esm/{typescript-911c34c6.js → typescript-e6ad6f59.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/stencil.config.d.ts +3 -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 +27 -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/editorContext.d.ts +11 -0
- package/dist/types/data/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 +6 -0
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +9 -0
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +9 -0
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +19 -0
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +6 -0
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -1
- package/dist/types/utils/profile/types.d.ts +15 -13
- package/dist/types/utils/profile/utils.d.ts +1 -3
- package/package.json +23 -23
- package/dist/arcgis-coding-components/p-8f70519f.js +0 -7
- package/dist/arcgis-coding-components/p-9d23e7cc.entry.js +0 -6
- package/dist/arcgis-coding-components/p-e9157a8c.js +0 -68
|
@@ -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.91
|
|
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"],
|
|
@@ -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,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.91
|
|
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-IHYYRFLQ.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,25 @@ 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)}";
|
|
243
244
|
|
|
244
245
|
//#region Specialized Constants
|
|
245
246
|
const treeProps = {
|
|
246
247
|
lines: true,
|
|
247
248
|
selectionMode: "none",
|
|
248
249
|
scale: "s",
|
|
249
|
-
onCalciteTreeSelect: (e) => e.target.selectedItems.forEach((itemElt) => (itemElt.selected = false))
|
|
250
|
+
onCalciteTreeSelect: (e) => e.target.selectedItems.forEach((itemElt) => (itemElt.selected = false)),
|
|
250
251
|
};
|
|
251
252
|
const expandableTreeItemProps = {
|
|
252
253
|
onClick: (e) => {
|
|
253
254
|
const item = e.currentTarget;
|
|
254
255
|
item.expanded = !item.expanded;
|
|
255
|
-
}
|
|
256
|
+
},
|
|
256
257
|
};
|
|
257
258
|
//#endregion
|
|
258
259
|
//#region Helper Functions
|
|
@@ -271,7 +272,7 @@ function renderSimpleValue(arcadeResult) {
|
|
|
271
272
|
case "null":
|
|
272
273
|
return h("span", { class: "constant-value" }, arcadeResult.type);
|
|
273
274
|
case "text":
|
|
274
|
-
return h("span", { class: "string-value" },
|
|
275
|
+
return h("span", { class: "string-value" }, quoteString(arcadeResult.value));
|
|
275
276
|
case "number":
|
|
276
277
|
return h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
277
278
|
case "boolean":
|
|
@@ -279,9 +280,9 @@ function renderSimpleValue(arcadeResult) {
|
|
|
279
280
|
case "date":
|
|
280
281
|
return h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
281
282
|
case "dateOnly":
|
|
282
|
-
return h("span", { class: "string-value" },
|
|
283
|
+
return h("span", { class: "string-value" }, quoteString(formatArcadeResultDateOnly(arcadeResult)));
|
|
283
284
|
case "time":
|
|
284
|
-
return h("span", { class: "string-value" },
|
|
285
|
+
return h("span", { class: "string-value" }, quoteString(formatArcadeResultTimeOnly(arcadeResult)));
|
|
285
286
|
default:
|
|
286
287
|
return null;
|
|
287
288
|
}
|
|
@@ -298,13 +299,18 @@ function renderFeatureSetTable(arcadeResult) {
|
|
|
298
299
|
}
|
|
299
300
|
})))))));
|
|
300
301
|
}
|
|
302
|
+
const __cmpMeta = [1,"arcgis-arcade-results",{"loading":[1028],"openedResultPanel":[1537,"opened-result-panel"],"result":[1040],"consoleLogs":[1040]}];
|
|
301
303
|
const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeResults extends HTMLElement {
|
|
302
304
|
constructor() {
|
|
303
305
|
super();
|
|
304
306
|
this.__registerHost();
|
|
307
|
+
this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
305
308
|
this.__attachShadow();
|
|
306
|
-
this.
|
|
307
|
-
this.
|
|
309
|
+
this.arcgisOpenedResultPanelChange = createEvent(this, "arcgisOpenedResultPanelChange", 3);
|
|
310
|
+
this.arcgisClose = createEvent(this, "arcgisClose", 3);
|
|
311
|
+
this.manager = useControllerManager(this,forceUpdate);
|
|
312
|
+
//#region Private Properties
|
|
313
|
+
this.messages = useT9n();
|
|
308
314
|
this._switchResultPanel = (e) => {
|
|
309
315
|
if (!e.target) {
|
|
310
316
|
return;
|
|
@@ -315,28 +321,17 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
315
321
|
}
|
|
316
322
|
this.updateResultPanel(panelName);
|
|
317
323
|
};
|
|
318
|
-
this._emitClose = () => this.
|
|
319
|
-
this._lang = "";
|
|
320
|
-
this._t9nLocale = "";
|
|
321
|
-
this._t9nStrings = undefined;
|
|
324
|
+
this._emitClose = () => this.arcgisClose.emit();
|
|
322
325
|
this.loading = true;
|
|
323
326
|
this.openedResultPanel = "output";
|
|
324
327
|
this.result = undefined;
|
|
325
328
|
this.consoleLogs = undefined;
|
|
326
329
|
}
|
|
327
330
|
//#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
331
|
//#region Private Methods
|
|
337
332
|
updateResultPanel(resultPanelType) {
|
|
338
333
|
this.openedResultPanel = resultPanelType;
|
|
339
|
-
this.
|
|
334
|
+
this.arcgisOpenedResultPanelChange.emit(resultPanelType);
|
|
340
335
|
}
|
|
341
336
|
//#endregion
|
|
342
337
|
//#region Rendering
|
|
@@ -347,7 +342,7 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
347
342
|
if (this.loading && !this.consoleLogs?.length) {
|
|
348
343
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
349
344
|
}
|
|
350
|
-
return (h("div", { class: "console-logs-container ltr-container" }, this.consoleLogs?.length ?
|
|
345
|
+
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
346
|
}
|
|
352
347
|
renderLogPanel() {
|
|
353
348
|
if (this.openedResultPanel !== "log") {
|
|
@@ -357,24 +352,24 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
357
352
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
358
353
|
}
|
|
359
354
|
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, {
|
|
355
|
+
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label: setValuesInString(this.messages.lastexecutionformat, {
|
|
356
|
+
timeStamp: new Intl.DateTimeFormat(this.messages._t9nLocale, {
|
|
362
357
|
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, {
|
|
358
|
+
timeStyle: "medium",
|
|
359
|
+
}).format(this.result.timeStamp),
|
|
360
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: setValuesInString(this.messages.compilationtimeformat, {
|
|
361
|
+
time: new Intl.NumberFormat(this.messages._t9nLocale, {
|
|
367
362
|
style: "unit",
|
|
368
363
|
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, {
|
|
364
|
+
maximumFractionDigits: 2,
|
|
365
|
+
}).format(this.result.compilationTime ?? 0),
|
|
366
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: setValuesInString(this.messages.executiontimeformat, {
|
|
367
|
+
time: new Intl.NumberFormat(this.messages._t9nLocale, {
|
|
373
368
|
style: "unit",
|
|
374
369
|
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.
|
|
370
|
+
maximumFractionDigits: 2,
|
|
371
|
+
}).format(this.result.executionTime ?? 0),
|
|
372
|
+
}) }, 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
373
|
}
|
|
379
374
|
renderOutputPanel() {
|
|
380
375
|
if (this.openedResultPanel !== "output") {
|
|
@@ -385,8 +380,8 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
385
380
|
}
|
|
386
381
|
switch (this.result?.type) {
|
|
387
382
|
case "error":
|
|
388
|
-
return (h("div", { class: "result-value-simple flex-adjustable" },
|
|
389
|
-
message: this.result.value
|
|
383
|
+
return (h("div", { class: "result-value-simple flex-adjustable" }, setValuesInString(this.messages.executionerrorformat, {
|
|
384
|
+
message: this.result.value,
|
|
390
385
|
})));
|
|
391
386
|
case "null":
|
|
392
387
|
case "unknown":
|
|
@@ -416,14 +411,14 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
416
411
|
case "knowledgeGraph":
|
|
417
412
|
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
413
|
default:
|
|
419
|
-
return
|
|
414
|
+
return h("div", { class: "result-value-simple flex-adjustable ltr-container" }, this.messages.runscriptmessage);
|
|
420
415
|
}
|
|
421
416
|
}
|
|
422
417
|
renderArrayHeader(arcadeResult) {
|
|
423
418
|
const items = arcadeResult.value ?? [];
|
|
424
419
|
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()
|
|
420
|
+
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0", setValuesInString(this.messages.showingfirstitemsformat, {
|
|
421
|
+
count: MaxArrayItems.toString(),
|
|
427
422
|
}))) : null));
|
|
428
423
|
}
|
|
429
424
|
renderArrayTree(items, subtree = false) {
|
|
@@ -468,25 +463,17 @@ const ArcgisArcadeResults = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeR
|
|
|
468
463
|
}
|
|
469
464
|
}
|
|
470
465
|
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()
|
|
466
|
+
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0", setValuesInString(this.messages.showingfirstitemsformat, {
|
|
467
|
+
count: BatchSize.toString(),
|
|
473
468
|
}))) : null));
|
|
474
469
|
}
|
|
475
470
|
render() {
|
|
476
|
-
return (h(Host, null, h("header", { class: "flex-row" }, h("calcite-action-bar", { class: "flex-adjustable", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { active: this.openedResultPanel === "output", text: this.
|
|
471
|
+
return (h(Host, null, h("header", { class: "flex-row" }, h("calcite-action-bar", { class: "flex-adjustable", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { 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", { 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", { 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", { scale: "s", icon: "x", text: this.messages.close ?? "", onClick: this._emitClose })), h("article", { 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
472
|
}
|
|
478
473
|
static get assetsDirs() { return ["assets"]; }
|
|
479
|
-
get
|
|
474
|
+
get el() { return this; }
|
|
480
475
|
static get style() { return arcadeResultsCss; }
|
|
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
|
-
}]);
|
|
476
|
+
}, __cmpMeta);
|
|
490
477
|
function defineCustomElement() {
|
|
491
478
|
if (typeof customElements === "undefined") {
|
|
492
479
|
return;
|