@arcgis/coding-components 4.30.0-next.4 → 4.30.0-next.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arcgis-coding-components/arcgis-coding-components.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/code-editor/arcade.worker.js +1 -1
- 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-25023832.js → p-1f57b2c8.js} +3 -3
- package/dist/arcgis-coding-components/{p-e88c0d1d.js → p-2656babc.js} +1 -1
- package/dist/arcgis-coding-components/p-41c0f095.js +7 -0
- package/dist/arcgis-coding-components/{p-08f272e7.js → p-4e83c7d9.js} +3 -3
- package/dist/arcgis-coding-components/p-55dffc4c.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-78220a75.js → p-68167d79.js} +3 -3
- package/dist/arcgis-coding-components/{p-4d158786.js → p-6e9ee8e1.js} +2 -2
- package/dist/arcgis-coding-components/{p-b63557ba.js → p-7600673f.js} +2 -2
- package/dist/arcgis-coding-components/{p-73e2476b.js → p-8741dfa4.js} +2 -2
- package/dist/arcgis-coding-components/{p-cd9e95f9.js → p-9acb23cc.js} +2 -2
- package/dist/arcgis-coding-components/p-b3a3ab63.js +68 -0
- package/dist/arcgis-coding-components/{p-c7bb7c6a.js → p-ea30709a.js} +2 -2
- package/dist/cjs/{arcade-defaults-d41420df.js → arcade-defaults-acc3b5ac.js} +498 -172
- package/dist/cjs/{arcade-mode-55360f90.js → arcade-mode-af4f0fdf.js} +45 -51
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +1660 -234
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/{css-9a006c1a.js → css-c1dec897.js} +1 -1
- package/dist/cjs/{cssMode-c9458ea4.js → cssMode-8a51d0ec.js} +3 -3
- package/dist/cjs/{html-45d9defe.js → html-a26829c5.js} +3 -3
- package/dist/cjs/{htmlMode-1716753f.js → htmlMode-d59290f4.js} +3 -3
- package/dist/cjs/{index-25b044b5.js → index-f070b08e.js} +42 -4
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-9ce57501.js → javascript-836a3c78.js} +4 -4
- package/dist/cjs/{jsonMode-3945e8f7.js → jsonMode-2600ca0a.js} +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{tsMode-7eaeb36b.js → tsMode-b10eb9a7.js} +3 -3
- package/dist/cjs/{typescript-ec5da0c4.js → typescript-07dfd341.js} +3 -3
- package/dist/components/arcade-api.js +19 -31
- package/dist/components/arcade-contribution.js +71 -13
- package/dist/components/arcade-defaults.js +79 -74
- package/dist/components/arcade-mode.js +44 -50
- package/dist/components/arcade-results.js +46 -60
- package/dist/components/arcade-suggestions.js +19 -30
- package/dist/components/arcade-variables.js +20 -35
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +48 -140
- 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-HXHHCYA6.js +1460 -0
- package/dist/components/code-editor.js +21 -18
- package/dist/components/fields.js +2 -66
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +388 -3
- package/dist/components/markdown.js +9 -11
- package/dist/components/utilities.js +3 -3
- package/dist/esm/{arcade-defaults-0bce2095.js → arcade-defaults-1f9c1af0.js} +485 -159
- package/dist/esm/{arcade-mode-57782d19.js → arcade-mode-c0bd49f2.js} +45 -51
- package/dist/esm/arcgis-arcade-api_6.entry.js +1660 -234
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/{css-70f18054.js → css-1e20a73b.js} +1 -1
- package/dist/esm/{cssMode-488c3e86.js → cssMode-31dc7377.js} +3 -3
- package/dist/esm/{html-59102be0.js → html-f8a0ecfe.js} +3 -3
- package/dist/esm/{htmlMode-cfdd852e.js → htmlMode-71570d38.js} +3 -3
- package/dist/esm/{index-78a96626.js → index-0030b0f4.js} +42 -5
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-8ee5b791.js → javascript-bd547f0f.js} +4 -4
- package/dist/esm/{jsonMode-771e71b0.js → jsonMode-fc11c3fd.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{tsMode-f95b693f.js → tsMode-201c99e8.js} +3 -3
- package/dist/esm/{typescript-055e39ac.js → typescript-51b03c89.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 +9 -6
- package/dist/types/components/arcade-results/arcade-results.d.ts +6 -9
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +6 -7
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +6 -8
- package/dist/types/components/code-editor/code-editor.d.ts +9 -1
- package/dist/types/components.d.ts +35 -24
- 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 +37 -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/utils/arcade-monaco/arcade-language-features.d.ts +1 -1
- package/dist/types/utils/profile/types.d.ts +1 -1
- package/package.json +20 -19
- package/dist/arcgis-coding-components/p-04561935.entry.js +0 -6
- package/dist/arcgis-coding-components/p-871217d9.js +0 -68
- package/dist/arcgis-coding-components/p-c23d1605.js +0 -7
|
@@ -1,13 +1,14 @@
|
|
|
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.41
|
|
5
5
|
*/
|
|
6
|
-
import { proxyCustomElement, HTMLElement, createEvent, h
|
|
7
|
-
import {
|
|
6
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
7
|
+
import { KeyCode } from 'monaco-editor';
|
|
8
8
|
import { e as executeScript, D as DevelopersWebSitePath, d as defineCustomElement$5 } from './arcade-results.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { u as updateThemeColors, c as colorRulesKeys, s as setupMonacoEnvironment, a as getArcadeDiagnosticService } from './arcade-contribution.js';
|
|
10
|
+
import { u as useControllerManager, a as useT9n } from './chunk-HXHHCYA6.js';
|
|
11
|
+
import { D as Deferred, q as generateGuid, r as getElementTheme } from './index2.js';
|
|
11
12
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
12
13
|
import { d as defineCustomElement$6 } from './arcade-api.js';
|
|
13
14
|
import { d as defineCustomElement$4 } from './arcade-suggestions.js';
|
|
@@ -19,77 +20,19 @@ import "@esri/calcite-components/dist/components/calcite-action.js";
|
|
|
19
20
|
import "@esri/calcite-components/dist/components/calcite-tooltip.js";
|
|
20
21
|
import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
-
"arcade-light-theme": {
|
|
24
|
-
comment: "#606060",
|
|
25
|
-
constant: "#9809C8",
|
|
26
|
-
date: "#296389",
|
|
27
|
-
identifier: "#0000B3",
|
|
28
|
-
keyword: "#BF4900",
|
|
29
|
-
number: "#136D3D",
|
|
30
|
-
string: "#A31515"
|
|
31
|
-
},
|
|
32
|
-
"arcade-dark-theme": {
|
|
33
|
-
comment: "#BFBFBF",
|
|
34
|
-
constant: "#CDBAEA",
|
|
35
|
-
date: "#97A6CE",
|
|
36
|
-
identifier: "#9FD4F3",
|
|
37
|
-
keyword: "#EEAA5A",
|
|
38
|
-
number: "#AAD04B",
|
|
39
|
-
string: "#F2877B"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
function setupArcadeTheme() {
|
|
44
|
-
["light", "dark"].forEach((theme) => {
|
|
45
|
-
const base = theme === "light" ? "vs" : "vs-dark";
|
|
46
|
-
const colors = themeConfig[`arcade-${theme}-theme`];
|
|
47
|
-
// Defines the light and dark theme based on the calcite theme name
|
|
48
|
-
editor.defineTheme(base, {
|
|
49
|
-
base,
|
|
50
|
-
inherit: true,
|
|
51
|
-
rules: [
|
|
52
|
-
{ token: "comment.arc", foreground: colors.comment },
|
|
53
|
-
{ token: "constant.arc", foreground: colors.constant },
|
|
54
|
-
{ token: "keyword.arc", foreground: colors.keyword },
|
|
55
|
-
{ token: "identifier.arc", foreground: colors.identifier },
|
|
56
|
-
{ token: "number.arc", foreground: colors.number },
|
|
57
|
-
{ token: "string.arc", foreground: colors.string }
|
|
58
|
-
],
|
|
59
|
-
colors: {}
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
const monacoThemeKeys = ["comment", "keyword", "identifier", "string", "number", "constant"];
|
|
64
|
-
const colorRulesKeys = [...monacoThemeKeys, "date"];
|
|
65
|
-
function updateThemeColors(theme, colorRules) {
|
|
66
|
-
if (colorRules === undefined) {
|
|
67
|
-
setupArcadeTheme();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const base = theme === "light" ? "vs" : "vs-dark";
|
|
71
|
-
const rules = [];
|
|
72
|
-
monacoThemeKeys.forEach((key) => {
|
|
73
|
-
const foreground = colorRules[key];
|
|
74
|
-
if (!foreground) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
rules.push({ token: `${key}.arc`, foreground });
|
|
78
|
-
});
|
|
79
|
-
editor.defineTheme(base, { base, inherit: true, rules, colors: {} });
|
|
80
|
-
}
|
|
23
|
+
const arcadeEditorCss = "arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid var(--calcite-color-border-3);box-sizing:border-box;background-color:var(--calcite-color-foreground-1);height:100%}arcgis-arcade-editor .flex-adjustable{flex:1 1 auto;overflow:hidden}arcgis-arcade-editor .flex-panel{flex:1 0 auto}arcgis-arcade-editor .position-relative{position:relative}arcgis-arcade-editor .flex-row{display:flex;flex-direction:row;overflow:hidden}arcgis-arcade-editor .flex-column{display:flex;flex-direction:column;overflow:hidden}arcgis-arcade-editor .border-inline-start{border-inline-start:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-arcade-editor .border-inline-end{border-inline-end:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-arcade-editor .sticky{position:sticky;top:0px;z-index:10}arcgis-arcade-editor .notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}arcgis-arcade-editor .side-action-bar{max-width:25%}arcgis-arcade-editor .side-panel{max-width:45%;width:600px}arcgis-arcade-editor .side-panel calcite-flow{height:100%}arcgis-arcade-editor .main-action-bar{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}arcgis-arcade-editor .main-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group:last-child{border-inline-end-width:0px}arcgis-arcade-editor .main-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}arcgis-arcade-editor arcgis-arcade-results{border-top:1px solid var(--calcite-color-border-3);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}arcgis-arcade-editor calcite-flow [slot=footer]{word-break:break-word}arcgis-arcade-editor calcite-list-item-group calcite-list-item{margin-bottom:1px;box-shadow:0 1px 0 var(--calcite-color-border-3)}arcgis-arcade-editor calcite-list-item-group calcite-list-item:last-child{box-shadow:none}arcgis-arcade-editor calcite-list-item-group:last-child{margin-bottom:var(--calcite-spacing-xl)}";
|
|
81
24
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
setupArcadeTheme();
|
|
25
|
+
const __cmpMeta = [0,"arcgis-arcade-editor",{"profile":[1040],"script":[1025],"testData":[1040],"suggestions":[1040],"snippets":[1040],"hideDocumentationActions":[1028,"hide-documentation-actions"],"hideSideBar":[1028,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[1040],"messages":[32],"_standaloneCodeEditor":[32],"_preparingProfile":[32],"_editorProfile":[32],"_showExecutionPanel":[32],"_resultPanel":[32],"_executingScript":[32],"_consoleLogs":[32],"_executionResult":[32],"getScript":[64],"setFocus":[64],"getEditorInstance":[64],"getTestResult":[64],"updateThemeColors":[64]},undefined,{"profile":["_profileChanged"],"testData":["_testDataChanged"],"snippets":["_snippetChanged"]}];
|
|
85
26
|
const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeEditor extends HTMLElement {
|
|
86
27
|
constructor() {
|
|
87
28
|
super();
|
|
88
29
|
this.__registerHost();
|
|
89
|
-
|
|
90
|
-
this.
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
30
|
+
this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
31
|
+
this.arcgisScriptChange = createEvent(this, "arcgisScriptChange", 3);
|
|
32
|
+
this.arcgisDiagnosticsChange = createEvent(this, "arcgisDiagnosticsChange", 3);
|
|
33
|
+
this.manager = useControllerManager(this);
|
|
34
|
+
this._componentReadyDefer = new Deferred();
|
|
35
|
+
this._modelId = generateGuid();
|
|
93
36
|
this._editorProfilePromise = Promise.resolve(undefined);
|
|
94
37
|
this._disposables = [];
|
|
95
38
|
this._executeScript = async () => {
|
|
@@ -132,15 +75,13 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
132
75
|
this._openArcadeHelp = () => void window.open(DevelopersWebSitePath, "Arcade Help");
|
|
133
76
|
this._emitScriptChange = (e) => {
|
|
134
77
|
e.stopPropagation();
|
|
135
|
-
this.
|
|
78
|
+
this.arcgisScriptChange.emit(e.detail);
|
|
136
79
|
};
|
|
137
80
|
this._insertAsSnippet = (e) => void this._codeEditorElt?.insertSnippet(e.detail).catch(console.error);
|
|
138
81
|
this._insertAsText = (e) => void this._codeEditorElt?.insertText(e.detail).catch(console.error);
|
|
139
82
|
this._onResultPanelChange = (e) => void (this._resultPanel = e.detail);
|
|
140
83
|
this._onExecutionPanelClose = () => void (this._showExecutionPanel = false);
|
|
141
|
-
this.
|
|
142
|
-
this._t9nLocale = "";
|
|
143
|
-
this._t9nStrings = undefined;
|
|
84
|
+
this.messages = useT9n();
|
|
144
85
|
this._standaloneCodeEditor = undefined;
|
|
145
86
|
this._preparingProfile = false;
|
|
146
87
|
this._editorProfile = undefined;
|
|
@@ -171,7 +112,7 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
171
112
|
}
|
|
172
113
|
_snippetChanged() {
|
|
173
114
|
arcadeDefaults.updateApiContextForModel(this._modelId, {
|
|
174
|
-
snippets: this.snippets
|
|
115
|
+
snippets: this.snippets,
|
|
175
116
|
});
|
|
176
117
|
}
|
|
177
118
|
// #endregion
|
|
@@ -220,11 +161,11 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
220
161
|
* @internal
|
|
221
162
|
*/
|
|
222
163
|
async updateThemeColors(colorRules) {
|
|
223
|
-
const theme =
|
|
164
|
+
const theme = getElementTheme(this.el);
|
|
224
165
|
updateThemeColors(theme, colorRules);
|
|
225
166
|
if (colorRules === undefined) {
|
|
226
167
|
colorRulesKeys.forEach((key) => {
|
|
227
|
-
this.
|
|
168
|
+
this.el.style.removeProperty(`--arcgis-arcade-editor-${key}`);
|
|
228
169
|
});
|
|
229
170
|
return;
|
|
230
171
|
}
|
|
@@ -233,7 +174,7 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
233
174
|
if (!foreground) {
|
|
234
175
|
return;
|
|
235
176
|
}
|
|
236
|
-
this.
|
|
177
|
+
this.el.style.setProperty(`--arcgis-arcade-editor-${key}`, foreground);
|
|
237
178
|
});
|
|
238
179
|
}
|
|
239
180
|
// #endregion
|
|
@@ -241,14 +182,13 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
241
182
|
async componentWillLoad() {
|
|
242
183
|
const assetsPath = getAssetPath("./assets");
|
|
243
184
|
// We are a bit in a chicken and egg situation here.
|
|
244
|
-
// Normally, it is the code editor that is responsible for setting up the Monaco
|
|
185
|
+
// Normally, it is the code editor that is responsible for setting up the Monaco environment.
|
|
245
186
|
// However, we need to setup the environment before the code editor is instantiated because
|
|
246
187
|
// we need to access the arcade language service to get the api library.
|
|
247
188
|
setupMonacoEnvironment(assetsPath);
|
|
248
|
-
|
|
249
|
-
//
|
|
250
|
-
|
|
251
|
-
await B(this, assetsPath, async () => await this._updateEditorProfile());
|
|
189
|
+
await this._updateEditorProfile();
|
|
190
|
+
// The profile has to be refreshed on locale change
|
|
191
|
+
this.manager.watch("messages", () => void this._updateEditorProfile().catch(console.error));
|
|
252
192
|
}
|
|
253
193
|
async componentDidLoad() {
|
|
254
194
|
// Mark on component as ready.
|
|
@@ -257,7 +197,7 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
257
197
|
// Start listening to the validation diagnostics.
|
|
258
198
|
// We are doing this as late as possible
|
|
259
199
|
const diagnosticsService = await getArcadeDiagnosticService();
|
|
260
|
-
this._disposables.push(diagnosticsService.onDiagnosticsChange((event) => !this._preparingProfile && this.
|
|
200
|
+
this._disposables.push(diagnosticsService.onDiagnosticsChange((event) => !this._preparingProfile && this.arcgisDiagnosticsChange.emit(event.diagnostics)));
|
|
261
201
|
// Get editor instance and add action
|
|
262
202
|
this._standaloneCodeEditor = await this.getEditorInstance();
|
|
263
203
|
this._standaloneCodeEditor?.addAction({
|
|
@@ -271,12 +211,11 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
271
211
|
if (this.testData) {
|
|
272
212
|
this._executeScript().catch(console.error);
|
|
273
213
|
}
|
|
274
|
-
}
|
|
214
|
+
},
|
|
275
215
|
});
|
|
276
216
|
await this._codeEditorElt?.setFocus();
|
|
277
217
|
}
|
|
278
218
|
disconnectedCallback() {
|
|
279
|
-
q(this);
|
|
280
219
|
arcadeDefaults.disposeApiContextForModel(this._modelId);
|
|
281
220
|
arcadeDefaults.disposeEditorProfileForModel(this._modelId);
|
|
282
221
|
while (this._disposables.length) {
|
|
@@ -293,8 +232,8 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
293
232
|
try {
|
|
294
233
|
// Set a new profile for the model using the profile definition and the locale.
|
|
295
234
|
await arcadeDefaults.setProfileForModel(this._modelId, this.profile, {
|
|
296
|
-
locale: this._t9nLocale,
|
|
297
|
-
snippets: this.snippets
|
|
235
|
+
locale: this.messages._t9nLocale,
|
|
236
|
+
snippets: this.snippets,
|
|
298
237
|
});
|
|
299
238
|
// Get the corresponding editor profile for the model.
|
|
300
239
|
// The editor profile contains the specialized profile for the UI.
|
|
@@ -314,51 +253,51 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
314
253
|
if (!this.testData) {
|
|
315
254
|
return null;
|
|
316
255
|
}
|
|
317
|
-
return (h
|
|
256
|
+
return (h("calcite-action-bar", { class: "main-action-bar", layout: "horizontal", scale: "s", expanded: true, "expand-disabled": true }, h("calcite-action-group", { scale: "s" }, h("calcite-action", { text: this.messages.run ?? "Run", "text-enabled": true, icon: "play", scale: "s", loading: this._preparingProfile, onClick: this._executeScript }), this._executionResult ? (h("calcite-action", { text: this.messages.lastresults ?? "Last results", active: this._showExecutionPanel, "text-enabled": true, icon: "access-string-results", iconFlipRtl: true, scale: "s", onClick: this._toggleShowExecutionPanel })) : null)));
|
|
318
257
|
}
|
|
319
258
|
//#endregion
|
|
320
259
|
//#region Render Main Panel
|
|
321
260
|
renderMainPanel() {
|
|
322
|
-
return (h
|
|
261
|
+
return (h("arcgis-code-editor", { class: "flex-adjustable", language: arcadeDefaults.languageId, value: this.script ?? "", modelId: this._modelId, options: this.editorOptions, onArcgisValueChange: this._emitScriptChange, ref: (e) => (this._codeEditorElt = e) }));
|
|
323
262
|
}
|
|
324
263
|
//#endregion
|
|
325
264
|
//#region Rendering the Action Bar
|
|
326
|
-
renderAction({ id, label, icon, active, panelName, onClick = this._toggleSidePanel }) {
|
|
327
|
-
return (h
|
|
265
|
+
renderAction({ id, label, icon, active, panelName, onClick = this._toggleSidePanel, }) {
|
|
266
|
+
return (h(Fragment, null, h("calcite-action", { id: id, text: label, icon: icon, active: active, onClick: onClick, "data-panel-name": panelName }), !this.sideActionBarExpanded && (h("calcite-tooltip", { label: label, "reference-element": id }, h("span", null, label)))));
|
|
328
267
|
}
|
|
329
268
|
renderSideActionBar() {
|
|
330
269
|
if (this.hideSideBar) {
|
|
331
270
|
return null;
|
|
332
271
|
}
|
|
333
|
-
return (h
|
|
272
|
+
return (h("calcite-action-bar", { class: "side-action-bar border-inline-start", expanded: !!this.sideActionBarExpanded, position: "end", onCalciteActionBarToggle: this._toggleSideActionBarExpanded }, h("calcite-action-group", null, this.renderAction({
|
|
334
273
|
id: "profile-variables-action",
|
|
335
|
-
label: this.
|
|
274
|
+
label: this.messages.profilevariables ?? "Profile variables",
|
|
336
275
|
icon: "profile-variables",
|
|
337
276
|
active: this.openedSidePanel === "variables",
|
|
338
|
-
panelName: "variables"
|
|
277
|
+
panelName: "variables",
|
|
339
278
|
}), this.renderAction({
|
|
340
279
|
id: "function-action",
|
|
341
|
-
label: this.
|
|
280
|
+
label: this.messages.constantsandfunctions ?? "Constants and functions",
|
|
342
281
|
icon: "function",
|
|
343
282
|
active: this.openedSidePanel === "api",
|
|
344
|
-
panelName: "api"
|
|
283
|
+
panelName: "api",
|
|
345
284
|
}), this.suggestions?.length
|
|
346
285
|
? this.renderAction({
|
|
347
286
|
id: "suggestions-action",
|
|
348
|
-
label: this.
|
|
287
|
+
label: this.messages.suggestions ?? "Suggestions",
|
|
349
288
|
icon: "lightbulb",
|
|
350
289
|
active: this.openedSidePanel === "suggestions",
|
|
351
|
-
panelName: "suggestions"
|
|
290
|
+
panelName: "suggestions",
|
|
352
291
|
})
|
|
353
292
|
: null, this.hideDocumentationActions
|
|
354
293
|
? null
|
|
355
294
|
: this.renderAction({
|
|
356
295
|
id: "developer-website-action",
|
|
357
|
-
label: this.
|
|
296
|
+
label: this.messages.help ?? "Help",
|
|
358
297
|
icon: "question",
|
|
359
298
|
active: false,
|
|
360
299
|
panelName: "none",
|
|
361
|
-
onClick: this._openArcadeHelp
|
|
300
|
+
onClick: this._openArcadeHelp,
|
|
362
301
|
}))));
|
|
363
302
|
}
|
|
364
303
|
//#endregion
|
|
@@ -369,11 +308,11 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
369
308
|
}
|
|
370
309
|
switch (this.openedSidePanel) {
|
|
371
310
|
case "api":
|
|
372
|
-
return (h
|
|
311
|
+
return (h("arcgis-arcade-api", { class: "side-panel flex-panel border-inline-start", modelId: this._modelId, hideDocumentationActions: this.hideDocumentationActions, onArcgisItemSelected: this._insertAsSnippet, onArcgisClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
373
312
|
case "variables":
|
|
374
|
-
return (h
|
|
313
|
+
return (h("arcgis-arcade-variables", { class: "side-panel flex-panel border-inline-start", loading: this._preparingProfile, modelId: this._modelId, onArcgisItemSelected: this._insertAsText, onArcgisClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
375
314
|
case "suggestions":
|
|
376
|
-
return (h
|
|
315
|
+
return (h("arcgis-arcade-suggestions", { class: "side-panel flex-panel border-inline-start", suggestions: this.suggestions, onArcgisItemSelected: this._insertAsText, onArcgisClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
377
316
|
default:
|
|
378
317
|
return null;
|
|
379
318
|
}
|
|
@@ -384,53 +323,22 @@ const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcade
|
|
|
384
323
|
if (!this._showExecutionPanel) {
|
|
385
324
|
return null;
|
|
386
325
|
}
|
|
387
|
-
return (h
|
|
326
|
+
return (h("arcgis-arcade-results", { class: "flex-adjustable", openedResultPanel: this._resultPanel, loading: this._executingScript, result: this._executionResult, consoleLogs: this._consoleLogs, onArcgisOpenedResultPanelChange: this._onResultPanelChange, onArcgisClose: this._onExecutionPanelClose }));
|
|
388
327
|
}
|
|
389
328
|
//#endregion
|
|
390
329
|
//#region Render
|
|
391
330
|
render() {
|
|
392
|
-
return (h
|
|
331
|
+
return (h(Host, null, this.renderMainActionBar(), h("div", { class: "flex-row flex-adjustable" }, h("div", { class: "flex-column flex-adjustable" }, this.renderMainPanel(), this.renderResultsPanel()), this.renderSidePanel(), this.renderSideActionBar())));
|
|
393
332
|
}
|
|
394
333
|
static get assetsDirs() { return ["assets"]; }
|
|
395
|
-
get
|
|
334
|
+
get el() { return this; }
|
|
396
335
|
static get watchers() { return {
|
|
397
336
|
"profile": ["_profileChanged"],
|
|
398
337
|
"testData": ["_testDataChanged"],
|
|
399
338
|
"snippets": ["_snippetChanged"]
|
|
400
339
|
}; }
|
|
401
340
|
static get style() { return arcadeEditorCss; }
|
|
402
|
-
},
|
|
403
|
-
"profile": [16],
|
|
404
|
-
"script": [1],
|
|
405
|
-
"testData": [16],
|
|
406
|
-
"suggestions": [16],
|
|
407
|
-
"snippets": [16],
|
|
408
|
-
"hideDocumentationActions": [4, "hide-documentation-actions"],
|
|
409
|
-
"hideSideBar": [4, "hide-side-bar"],
|
|
410
|
-
"sideActionBarExpanded": [1540, "side-action-bar-expanded"],
|
|
411
|
-
"openedSidePanel": [1537, "opened-side-panel"],
|
|
412
|
-
"editorOptions": [16],
|
|
413
|
-
"_lang": [32],
|
|
414
|
-
"_t9nLocale": [32],
|
|
415
|
-
"_t9nStrings": [32],
|
|
416
|
-
"_standaloneCodeEditor": [32],
|
|
417
|
-
"_preparingProfile": [32],
|
|
418
|
-
"_editorProfile": [32],
|
|
419
|
-
"_showExecutionPanel": [32],
|
|
420
|
-
"_resultPanel": [32],
|
|
421
|
-
"_executingScript": [32],
|
|
422
|
-
"_consoleLogs": [32],
|
|
423
|
-
"_executionResult": [32],
|
|
424
|
-
"getScript": [64],
|
|
425
|
-
"setFocus": [64],
|
|
426
|
-
"getEditorInstance": [64],
|
|
427
|
-
"getTestResult": [64],
|
|
428
|
-
"updateThemeColors": [64]
|
|
429
|
-
}, undefined, {
|
|
430
|
-
"profile": ["_profileChanged"],
|
|
431
|
-
"testData": ["_testDataChanged"],
|
|
432
|
-
"snippets": ["_snippetChanged"]
|
|
433
|
-
}]);
|
|
341
|
+
}, __cmpMeta);
|
|
434
342
|
function defineCustomElement$1() {
|
|
435
343
|
if (typeof customElements === "undefined") {
|
|
436
344
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.41
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeResults$1, d as defineCustomElement$1 } from './arcade-results.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.41
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeSuggestions$1, d as defineCustomElement$1 } from './arcade-suggestions.js';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.41
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisArcadeVariables$1, d as defineCustomElement$1 } from './arcade-variables.js';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
5
|
-
* v4.30.0-next.
|
|
5
|
+
* v4.30.0-next.41
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Get the base path to where the package assets can be found.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
5
|
-
* v4.30.0-next.
|
|
5
|
+
* v4.30.0-next.41
|
|
6
6
|
*/
|
|
7
7
|
let resourceUrl = "https://js.arcgis.com/coding-components/next/";
|
|
8
8
|
export const getArcgisAssetPath = (path) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.41
|
|
5
5
|
*/
|
|
6
6
|
import { A as ArcgisCodeEditor$1, d as defineCustomElement$1 } from './code-editor.js';
|
|
7
7
|
|