@arcgis/coding-components 4.29.0-beta.47 → 4.29.0-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +13 -13
- package/dist/arcgis-coding-components/index.esm.js +1 -1
- package/dist/arcgis-coding-components/{p-10a322ec.js → p-0d616249.js} +9 -9
- package/dist/arcgis-coding-components/p-2c0d6f15.js +2 -0
- package/dist/arcgis-coding-components/{p-71faf9a4.js → p-5802524a.js} +1 -1
- package/dist/arcgis-coding-components/{p-9eabda86.js → p-5ddccf04.js} +1 -1
- package/dist/arcgis-coding-components/p-7475f3a6.js +1 -0
- package/dist/arcgis-coding-components/{p-e6ede32d.js → p-7d8caba9.js} +1 -1
- package/dist/arcgis-coding-components/{p-f7d7d78d.js → p-9f6db08a.js} +1 -1
- package/dist/arcgis-coding-components/{p-e475e6cd.js → p-aefe77ce.js} +1 -1
- package/dist/arcgis-coding-components/p-ce2be55e.entry.js +1 -0
- package/dist/arcgis-coding-components/{p-ce586a8c.js → p-d425a387.js} +1 -1
- package/dist/arcgis-coding-components/{p-c084ada8.js → p-ff21f230.js} +1 -1
- package/dist/cjs/{arcade-defaults-8445d852.js → arcade-defaults-2d513b59.js} +1534 -1534
- package/dist/cjs/arcade-mode-6219f1b8.js +599 -0
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +1404 -1408
- package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
- package/dist/cjs/{cssMode-e63287bb.js → cssMode-1ec48254.js} +2 -2
- package/dist/cjs/{html-c0d4db3b.js → html-0e1741fe.js} +2 -2
- package/dist/cjs/{htmlMode-fdc44d57.js → htmlMode-279d3c29.js} +2 -2
- package/dist/cjs/{index-6a382a34.js → index-ac186201.js} +67 -24
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{javascript-a419d064.js → javascript-04f1bce0.js} +3 -3
- package/dist/cjs/{jsonMode-73aee5d2.js → jsonMode-59322f7a.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{tsMode-37d1b053.js → tsMode-17561f70.js} +2 -2
- package/dist/cjs/{typescript-53f9f36a.js → typescript-b7da8629.js} +2 -2
- package/dist/components/arcade-api.js +160 -160
- package/dist/components/arcade-contribution.js +60 -60
- package/dist/components/arcade-defaults.js +1240 -1240
- package/dist/components/arcade-mode.js +514 -513
- package/dist/components/arcade-results.js +426 -430
- package/dist/components/arcade-suggestions.js +130 -132
- package/dist/components/arcade-variables.js +157 -155
- package/dist/components/arcgis-arcade-api.d.ts +2 -2
- package/dist/components/arcgis-arcade-editor.d.ts +2 -2
- package/dist/components/arcgis-arcade-editor.js +391 -391
- package/dist/components/arcgis-arcade-results.d.ts +2 -2
- package/dist/components/arcgis-arcade-suggestions.d.ts +2 -2
- package/dist/components/arcgis-arcade-variables.d.ts +2 -2
- package/dist/components/arcgis-code-editor.d.ts +2 -2
- package/dist/components/code-editor.js +251 -251
- package/dist/components/fields.js +69 -69
- package/dist/components/functional-components.js +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/markdown.js +28 -28
- package/dist/components/utilities.js +20 -20
- package/dist/esm/{arcade-defaults-d7893362.js → arcade-defaults-0bafa696.js} +1534 -1534
- package/dist/esm/arcade-mode-c17a1fa1.js +595 -0
- package/dist/esm/arcgis-arcade-api_6.entry.js +1404 -1408
- package/dist/esm/arcgis-coding-components.js +3 -3
- package/dist/esm/{cssMode-b1771f92.js → cssMode-3d18bd2b.js} +2 -2
- package/dist/esm/{html-af635d52.js → html-2bce5d77.js} +2 -2
- package/dist/esm/{htmlMode-3021c301.js → htmlMode-69d56956.js} +2 -2
- package/dist/esm/{index-fd6b2fd8.js → index-022fb97b.js} +67 -24
- package/dist/esm/index.js +2 -2
- package/dist/esm/{javascript-70589186.js → javascript-ded5c9d7.js} +3 -3
- package/dist/esm/{jsonMode-cb509b79.js → jsonMode-0bf84cb2.js} +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{tsMode-ed90c9aa.js → tsMode-15d4e936.js} +2 -2
- package/dist/esm/{typescript-db8a0b18.js → typescript-cc4d00f0.js} +2 -2
- package/dist/types/components/arcade-api/arcade-api.d.ts +40 -40
- package/dist/types/components/arcade-api/t9n-types.d.ts +6 -6
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +127 -127
- package/dist/types/components/arcade-editor/t9n-types.d.ts +6 -6
- package/dist/types/components/arcade-results/arcade-results.d.ts +47 -47
- package/dist/types/components/arcade-results/t9n-types.d.ts +11 -11
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +34 -34
- package/dist/types/components/arcade-suggestions/t9n-types.d.ts +4 -4
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +41 -41
- package/dist/types/components/arcade-variables/t9n-types.d.ts +6 -6
- package/dist/types/components/code-editor/code-editor.d.ts +73 -73
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/dist/types/utils/arcade-executor.d.ts +79 -79
- package/dist/types/utils/arcade-monaco/arcade-defaults.d.ts +66 -66
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +23 -23
- package/dist/types/utils/arcade-monaco/arcade-mode.d.ts +9 -9
- package/dist/types/utils/arcade-monaco/arcade-theme.d.ts +7 -7
- package/dist/types/utils/arcade-monaco/arcade-worker-manager.d.ts +9 -9
- package/dist/types/utils/arcade-monaco/arcade.worker.d.ts +12 -12
- package/dist/types/utils/arcade-monaco/types.d.ts +29 -29
- package/dist/types/utils/editor-suggestions.d.ts +24 -24
- package/dist/types/utils/functional-components.d.ts +1 -1
- package/dist/types/utils/markdown.d.ts +1 -1
- package/dist/types/utils/profile/editor-profile.d.ts +185 -185
- package/dist/types/utils/profile/types.d.ts +101 -101
- package/dist/types/utils/utilities.d.ts +1 -1
- package/package.json +7 -7
- package/dist/arcgis-coding-components/p-5d670bd2.js +0 -2
- package/dist/arcgis-coding-components/p-9e242e76.js +0 -1
- package/dist/arcgis-coding-components/p-ccdf0ac1.entry.js +0 -1
- package/dist/cjs/arcade-mode-b77afcc9.js +0 -598
- package/dist/esm/arcade-mode-70e22d22.js +0 -594
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Fragment, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { editor, KeyCode } from 'monaco-editor';
|
|
3
3
|
import { e as executeScript, D as DevelopersWebSitePath, d as defineCustomElement$5 } from './arcade-results.js';
|
|
4
|
-
import { p,
|
|
4
|
+
import { p, $, P, F, U } from './index2.js';
|
|
5
5
|
import { s as setupMonacoEnvironment, a as getArcadeDiagnosticService } from './arcade-contribution.js';
|
|
6
6
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
7
7
|
import '@esri/calcite-components/dist/components/calcite-action-bar.js';
|
|
@@ -34,425 +34,425 @@ const themeConfig = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
function setupArcadeTheme() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
["light", "dark"].forEach((theme) => {
|
|
38
|
+
const base = theme === "light" ? "vs" : "vs-dark";
|
|
39
|
+
const colors = themeConfig[`arcade-${theme}-theme`];
|
|
40
|
+
// Defines the light and dark theme based on the calcite theme name
|
|
41
|
+
editor.defineTheme(base, {
|
|
42
|
+
base,
|
|
43
|
+
inherit: true,
|
|
44
|
+
rules: [
|
|
45
|
+
{ token: "comment.arc", foreground: colors.comment },
|
|
46
|
+
{ token: "constant.arc", foreground: colors.constant },
|
|
47
|
+
{ token: "keyword.arc", foreground: colors.keyword },
|
|
48
|
+
{ token: "identifier.arc", foreground: colors.identifier },
|
|
49
|
+
{ token: "number.arc", foreground: colors.number },
|
|
50
|
+
{ token: "string.arc", foreground: colors.string }
|
|
51
|
+
],
|
|
52
|
+
colors: {}
|
|
53
|
+
});
|
|
53
54
|
});
|
|
54
|
-
});
|
|
55
55
|
}
|
|
56
56
|
function updateThemeColors(theme, colorRules) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
const base = theme === "light" ? "vs" : "vs-dark";
|
|
62
|
-
const rules = [];
|
|
63
|
-
["comment", "keyword", "identifier", "string", "number", "constant"].forEach((key) => {
|
|
64
|
-
// @ts-expect-error
|
|
65
|
-
const foreground = colorRules[key];
|
|
66
|
-
if (!foreground) {
|
|
67
|
-
return;
|
|
57
|
+
if (colorRules === undefined) {
|
|
58
|
+
setupArcadeTheme();
|
|
59
|
+
return;
|
|
68
60
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
const base = theme === "light" ? "vs" : "vs-dark";
|
|
62
|
+
const rules = [];
|
|
63
|
+
["comment", "keyword", "identifier", "string", "number", "constant"].forEach((key) => {
|
|
64
|
+
// @ts-expect-error
|
|
65
|
+
const foreground = colorRules[key];
|
|
66
|
+
if (!foreground) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
rules.push({ token: `${key}.arc`, foreground });
|
|
70
|
+
});
|
|
71
|
+
editor.defineTheme(base, { base, inherit: true, rules, colors: {} });
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
const arcadeEditorCss = "arcgis-arcade-editor{display:flex;flex-direction:column;height:100%;width:100%;position:relative;overflow:hidden;border:1px solid var(--calcite-ui-border-3);box-sizing:border-box;background-color:var(--calcite-ui-foreground-1)}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-ui-border-3);box-sizing:border-box}arcgis-arcade-editor .border-inline-end{border-inline-end:1px solid var(--calcite-ui-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-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-ui-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-ui-border-3);flex:0 0 auto}arcgis-arcade-editor .main-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-half)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}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-half)}arcgis-arcade-editor arcgis-arcade-results{border-top:1px solid var(--calcite-ui-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-ui-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-1)}";
|
|
75
75
|
|
|
76
76
|
setupArcadeTheme();
|
|
77
77
|
const ArcgisArcadeEditor$1 = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeEditor extends HTMLElement {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
78
|
+
constructor() {
|
|
79
|
+
super();
|
|
80
|
+
this.__registerHost();
|
|
81
|
+
this.scriptChange = createEvent(this, "scriptChange", 3);
|
|
82
|
+
this.diagnosticsChange = createEvent(this, "diagnosticsChange", 3);
|
|
83
|
+
this._componentReadyDefer = new p();
|
|
84
|
+
this._modelId = $();
|
|
85
|
+
this._editorProfilePromise = Promise.resolve(undefined);
|
|
86
|
+
this._disposables = [];
|
|
87
|
+
this._executeScript = async () => {
|
|
88
|
+
const testContext = this.testData;
|
|
89
|
+
if (!this._codeEditorElt || !testContext) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const editorProfile = await this._editorProfilePromise;
|
|
93
|
+
if (!editorProfile) {
|
|
94
|
+
this._executionResult = { type: "error", value: "Missing editor profile", error: null };
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this._showExecutionPanel = true;
|
|
98
|
+
this._executingScript = true;
|
|
99
|
+
this._consoleLogs = [];
|
|
100
|
+
setTimeout(async () => {
|
|
101
|
+
const script = await this._codeEditorElt?.getValue();
|
|
102
|
+
this._executionResult = await executeScript(editorProfile.definition, script, testContext, (log) => setTimeout(() => (this._consoleLogs = [...this._consoleLogs, log]), 0));
|
|
103
|
+
this._executingScript = false;
|
|
104
|
+
}, 0);
|
|
105
|
+
};
|
|
106
|
+
this._toggleShowExecutionPanel = () => (this._showExecutionPanel = !this._showExecutionPanel);
|
|
107
|
+
this._toggleSideActionBarExpanded = () => (this.sideActionBarExpanded = !this.sideActionBarExpanded);
|
|
108
|
+
this._toggleSidePanel = async (e) => {
|
|
109
|
+
if (!e.target) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const panelName = e.target?.dataset.panelName ?? "none";
|
|
113
|
+
// Setup the new panel. Toggle to none if already opened
|
|
114
|
+
this.openedSidePanel = panelName === this.openedSidePanel ? "none" : panelName;
|
|
115
|
+
if (this.openedSidePanel === "none") {
|
|
116
|
+
// Reset focus on the code editor if no panel displayed
|
|
117
|
+
await this._codeEditorElt?.setFocus();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
this._openArcadeHelp = () => window.open(DevelopersWebSitePath, "Arcade Help");
|
|
121
|
+
this._emitScriptChange = (e) => {
|
|
122
|
+
e.stopPropagation();
|
|
123
|
+
this.scriptChange.emit(e.detail);
|
|
124
|
+
};
|
|
125
|
+
this._insertAsSnippet = (e) => this._codeEditorElt?.insertSnippet(e.detail);
|
|
126
|
+
this._insertAsText = (e) => this._codeEditorElt?.insertText(e.detail);
|
|
127
|
+
this._onResultPanelChange = (e) => (this._resultPanel = e.detail);
|
|
128
|
+
this._onExecutionPanelClose = () => (this._showExecutionPanel = false);
|
|
129
|
+
this._lang = "";
|
|
130
|
+
this._t9nLocale = "";
|
|
131
|
+
this._t9nStrings = undefined;
|
|
132
|
+
this._standaloneCodeEditor = undefined;
|
|
133
|
+
this._preparingProfile = false;
|
|
134
|
+
this._editorProfile = undefined;
|
|
135
|
+
this._showExecutionPanel = false;
|
|
136
|
+
this._resultPanel = "output";
|
|
103
137
|
this._executingScript = false;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (this.openedSidePanel === "none") {
|
|
116
|
-
// Reset focus on the code editor if no panel displayed
|
|
117
|
-
await this._codeEditorElt?.setFocus();
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
this._openArcadeHelp = () => window.open(DevelopersWebSitePath, "Arcade Help");
|
|
121
|
-
this._emitScriptChange = (e) => {
|
|
122
|
-
e.stopPropagation();
|
|
123
|
-
this.scriptChange.emit(e.detail);
|
|
124
|
-
};
|
|
125
|
-
this._insertAsSnippet = (e) => this._codeEditorElt?.insertSnippet(e.detail);
|
|
126
|
-
this._insertAsText = (e) => this._codeEditorElt?.insertText(e.detail);
|
|
127
|
-
this._onResultPanelChange = (e) => (this._resultPanel = e.detail);
|
|
128
|
-
this._onExecutionPanelClose = () => (this._showExecutionPanel = false);
|
|
129
|
-
this._lang = "";
|
|
130
|
-
this._t9nLocale = "";
|
|
131
|
-
this._t9nStrings = undefined;
|
|
132
|
-
this._standaloneCodeEditor = undefined;
|
|
133
|
-
this._preparingProfile = false;
|
|
134
|
-
this._editorProfile = undefined;
|
|
135
|
-
this._showExecutionPanel = false;
|
|
136
|
-
this._resultPanel = "output";
|
|
137
|
-
this._executingScript = false;
|
|
138
|
-
this._consoleLogs = [];
|
|
139
|
-
this._executionResult = undefined;
|
|
140
|
-
this.profile = undefined;
|
|
141
|
-
this.script = "";
|
|
142
|
-
this.testData = undefined;
|
|
143
|
-
this.suggestions = undefined;
|
|
144
|
-
this.snippets = undefined;
|
|
145
|
-
this.hideDocumentationActions = false;
|
|
146
|
-
this.hideSideBar = false;
|
|
147
|
-
this.sideActionBarExpanded = false;
|
|
148
|
-
this.openedSidePanel = "none";
|
|
149
|
-
}
|
|
150
|
-
_profileChanged(newValue, oldValue) {
|
|
151
|
-
// Prevent the execution as long as the component has not been fully loaded
|
|
152
|
-
if (newValue === oldValue) {
|
|
153
|
-
return;
|
|
138
|
+
this._consoleLogs = [];
|
|
139
|
+
this._executionResult = undefined;
|
|
140
|
+
this.profile = undefined;
|
|
141
|
+
this.script = "";
|
|
142
|
+
this.testData = undefined;
|
|
143
|
+
this.suggestions = undefined;
|
|
144
|
+
this.snippets = undefined;
|
|
145
|
+
this.hideDocumentationActions = false;
|
|
146
|
+
this.hideSideBar = false;
|
|
147
|
+
this.sideActionBarExpanded = false;
|
|
148
|
+
this.openedSidePanel = "none";
|
|
154
149
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
150
|
+
_profileChanged(newValue, oldValue) {
|
|
151
|
+
// Prevent the execution as long as the component has not been fully loaded
|
|
152
|
+
if (newValue === oldValue) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this._updateEditorProfile();
|
|
160
156
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
157
|
+
_testDataChanged(newValue, oldValue) {
|
|
158
|
+
if (newValue === oldValue || !this._showExecutionPanel) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this._executeScript();
|
|
166
162
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
* Returns the current script.
|
|
175
|
-
* @returns {Promise<string>}
|
|
176
|
-
*/
|
|
177
|
-
async getScript() {
|
|
178
|
-
await this._componentReadyDefer.promise;
|
|
179
|
-
return this._codeEditorElt?.getValue();
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Set the focus on the element.
|
|
183
|
-
*/
|
|
184
|
-
async setFocus() {
|
|
185
|
-
await this._componentReadyDefer.promise;
|
|
186
|
-
await this._codeEditorElt?.setFocus();
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* @internal
|
|
190
|
-
* Returns the editor instance.
|
|
191
|
-
* @returns {Promise<IStandaloneCodeEditor>} - The monaco editor instance
|
|
192
|
-
*/
|
|
193
|
-
async getEditorInstance() {
|
|
194
|
-
await this._componentReadyDefer.promise;
|
|
195
|
-
return this._codeEditorElt?.getEditorInstance();
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Returns the Arcade result for the script for the provided test data.
|
|
199
|
-
*/
|
|
200
|
-
async getTestResult() {
|
|
201
|
-
if (!this.testData) {
|
|
202
|
-
return { type: "error", value: "Missing test data", error: null };
|
|
163
|
+
_snippetChanged(newValue, oldValue) {
|
|
164
|
+
if (newValue === oldValue) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
arcadeDefaults.updateApiContextForModel(this._modelId, {
|
|
168
|
+
snippets: this.snippets
|
|
169
|
+
});
|
|
203
170
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
171
|
+
// #endregion
|
|
172
|
+
// #region Public methods API
|
|
173
|
+
/**
|
|
174
|
+
* Returns the current script.
|
|
175
|
+
* @returns {Promise<string>}
|
|
176
|
+
*/
|
|
177
|
+
async getScript() {
|
|
178
|
+
await this._componentReadyDefer.promise;
|
|
179
|
+
return this._codeEditorElt?.getValue();
|
|
207
180
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* @deprecated Use getTestResult
|
|
215
|
-
* @internal
|
|
216
|
-
*/
|
|
217
|
-
async getOutputType() {
|
|
218
|
-
return (await this.getTestResult()).type;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Allows to change theme colors
|
|
222
|
-
* @internal
|
|
223
|
-
*/
|
|
224
|
-
async updateThemeColors(colorRules) {
|
|
225
|
-
const theme = P(this._hostElement);
|
|
226
|
-
updateThemeColors(theme, colorRules);
|
|
227
|
-
if (colorRules === undefined) {
|
|
228
|
-
["comment", "keyword", "identifier", "string", "number", "constant", "date"].forEach((key) => {
|
|
229
|
-
this._hostElement.style.removeProperty(`--arcgis-arcade-editor-${key}`);
|
|
230
|
-
});
|
|
231
|
-
return;
|
|
181
|
+
/**
|
|
182
|
+
* Set the focus on the element.
|
|
183
|
+
*/
|
|
184
|
+
async setFocus() {
|
|
185
|
+
await this._componentReadyDefer.promise;
|
|
186
|
+
await this._codeEditorElt?.setFocus();
|
|
232
187
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
// However, we need to setup the environment before the code editor is instantiated because
|
|
249
|
-
// we need to access the arcade language service to get the api library.
|
|
250
|
-
setupMonacoEnvironment(assetsPath);
|
|
251
|
-
// Starts a locale observer. It will load the correct t9n strings for the component
|
|
252
|
-
// when the locale changes. We also pass updateEditorProfile. It will be invoked the first
|
|
253
|
-
// and on each locale change. The profile has to be refreshed on locale change as well.
|
|
254
|
-
await F(this, assetsPath, async () => await this._updateEditorProfile());
|
|
255
|
-
}
|
|
256
|
-
async componentDidLoad() {
|
|
257
|
-
// Mark on component as ready.
|
|
258
|
-
// Some methods are waiting for this state to actually continue.
|
|
259
|
-
this._componentReadyDefer.resolve();
|
|
260
|
-
// Start listening to the validation diagnostics.
|
|
261
|
-
// We are doing this as late as possible
|
|
262
|
-
const diagnosticsService = await getArcadeDiagnosticService();
|
|
263
|
-
this._disposables.push(diagnosticsService.onDiagnosticsChange((ev) => !this._preparingProfile && this.diagnosticsChange.emit(ev.diagnostics)));
|
|
264
|
-
// Get editor instance and add action
|
|
265
|
-
this._standaloneCodeEditor = await this.getEditorInstance();
|
|
266
|
-
this._standaloneCodeEditor?.addAction({
|
|
267
|
-
// An unique identifier for the action.
|
|
268
|
-
id: "run-script",
|
|
269
|
-
label: "Run Arcade Expression",
|
|
270
|
-
keybindings: [KeyCode.F5],
|
|
271
|
-
contextMenuGroupId: "code",
|
|
272
|
-
contextMenuOrder: 1,
|
|
273
|
-
run: () => {
|
|
274
|
-
if (this.testData) {
|
|
275
|
-
this._executeScript();
|
|
188
|
+
/**
|
|
189
|
+
* @internal
|
|
190
|
+
* Returns the editor instance.
|
|
191
|
+
* @returns {Promise<IStandaloneCodeEditor>} - The monaco editor instance
|
|
192
|
+
*/
|
|
193
|
+
async getEditorInstance() {
|
|
194
|
+
await this._componentReadyDefer.promise;
|
|
195
|
+
return this._codeEditorElt?.getEditorInstance();
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Returns the Arcade result for the script for the provided test data.
|
|
199
|
+
*/
|
|
200
|
+
async getTestResult() {
|
|
201
|
+
if (!this.testData) {
|
|
202
|
+
return { type: "error", value: "Missing test data", error: null };
|
|
276
203
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
204
|
+
const editorProfile = await this._editorProfilePromise;
|
|
205
|
+
if (!editorProfile) {
|
|
206
|
+
return { type: "error", value: "Missing editor profile", error: null };
|
|
207
|
+
}
|
|
208
|
+
await this._componentReadyDefer.promise;
|
|
209
|
+
const script = await this._codeEditorElt?.getValue();
|
|
210
|
+
return executeScript(editorProfile.definition, script, this.testData);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Returns the Arcade output type for the script.
|
|
214
|
+
* @deprecated Use getTestResult
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
async getOutputType() {
|
|
218
|
+
return (await this.getTestResult()).type;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Allows to change theme colors
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
async updateThemeColors(colorRules) {
|
|
225
|
+
const theme = P(this._hostElement);
|
|
226
|
+
updateThemeColors(theme, colorRules);
|
|
227
|
+
if (colorRules === undefined) {
|
|
228
|
+
["comment", "keyword", "identifier", "string", "number", "constant", "date"].forEach((key) => {
|
|
229
|
+
this._hostElement.style.removeProperty(`--arcgis-arcade-editor-${key}`);
|
|
230
|
+
});
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
["comment", "keyword", "identifier", "string", "number", "constant", "date"].forEach((key) => {
|
|
234
|
+
// @ts-expect-error
|
|
235
|
+
const foreground = colorRules[key];
|
|
236
|
+
if (!foreground) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this._hostElement.style.setProperty(`--arcgis-arcade-editor-${key}`, foreground);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
// #endregion
|
|
243
|
+
// #region Component lifecycle events
|
|
244
|
+
async componentWillLoad() {
|
|
245
|
+
const assetsPath = getAssetPath("./assets");
|
|
246
|
+
// We are a bit in a chicken and egg situation here.
|
|
247
|
+
// Normally, it is the code editor that is responsible for setting up the Monaco environement.
|
|
248
|
+
// However, we need to setup the environment before the code editor is instantiated because
|
|
249
|
+
// we need to access the arcade language service to get the api library.
|
|
250
|
+
setupMonacoEnvironment(assetsPath);
|
|
251
|
+
// Starts a locale observer. It will load the correct t9n strings for the component
|
|
252
|
+
// when the locale changes. We also pass updateEditorProfile. It will be invoked the first
|
|
253
|
+
// and on each locale change. The profile has to be refreshed on locale change as well.
|
|
254
|
+
await F(this, assetsPath, async () => await this._updateEditorProfile());
|
|
287
255
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
256
|
+
async componentDidLoad() {
|
|
257
|
+
// Mark on component as ready.
|
|
258
|
+
// Some methods are waiting for this state to actually continue.
|
|
259
|
+
this._componentReadyDefer.resolve();
|
|
260
|
+
// Start listening to the validation diagnostics.
|
|
261
|
+
// We are doing this as late as possible
|
|
262
|
+
const diagnosticsService = await getArcadeDiagnosticService();
|
|
263
|
+
this._disposables.push(diagnosticsService.onDiagnosticsChange((event) => !this._preparingProfile && this.diagnosticsChange.emit(event.diagnostics)));
|
|
264
|
+
// Get editor instance and add action
|
|
265
|
+
this._standaloneCodeEditor = await this.getEditorInstance();
|
|
266
|
+
this._standaloneCodeEditor?.addAction({
|
|
267
|
+
// An unique identifier for the action.
|
|
268
|
+
id: "run-script",
|
|
269
|
+
label: "Run Arcade Expression",
|
|
270
|
+
keybindings: [KeyCode.F5],
|
|
271
|
+
contextMenuGroupId: "code",
|
|
272
|
+
contextMenuOrder: 1,
|
|
273
|
+
run: () => {
|
|
274
|
+
if (this.testData) {
|
|
275
|
+
this._executeScript();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
await this._codeEditorElt?.setFocus();
|
|
280
|
+
}
|
|
281
|
+
disconnectedCallback() {
|
|
282
|
+
U(this);
|
|
283
|
+
arcadeDefaults.disposeApiContextForModel(this._modelId);
|
|
284
|
+
arcadeDefaults.disposeEditorProfileForModel(this._modelId);
|
|
285
|
+
while (this._disposables.length) {
|
|
286
|
+
this._disposables.pop()?.dispose();
|
|
287
|
+
}
|
|
305
288
|
}
|
|
306
|
-
|
|
307
|
-
|
|
289
|
+
// #endregion
|
|
290
|
+
// #region Private methods API
|
|
291
|
+
async _updateEditorProfile() {
|
|
292
|
+
// The goal is to
|
|
293
|
+
// - convert the runtime profile into a specialized instance that will serve the UI better.
|
|
294
|
+
// - extract the language service profile that is specialized for completion and validation
|
|
295
|
+
this._preparingProfile = true;
|
|
296
|
+
try {
|
|
297
|
+
// Set a new profile for the model using the profile definition and the locale.
|
|
298
|
+
await arcadeDefaults.setProfileForModel(this._modelId, this.profile, {
|
|
299
|
+
locale: this._t9nLocale,
|
|
300
|
+
snippets: this.snippets
|
|
301
|
+
});
|
|
302
|
+
// Get the corresponding editor profile for the model.
|
|
303
|
+
// The editor profile contains the specialized profile for the UI.
|
|
304
|
+
this._editorProfile = arcadeDefaults.getEditorProfileForModel(this._modelId);
|
|
305
|
+
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
this._editorProfile = undefined;
|
|
308
|
+
}
|
|
309
|
+
finally {
|
|
310
|
+
this._editorProfilePromise = Promise.resolve(this._editorProfile);
|
|
311
|
+
this._preparingProfile = false;
|
|
312
|
+
}
|
|
308
313
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
314
|
+
// #endregion
|
|
315
|
+
//#region Render Main Action Bar
|
|
316
|
+
renderMainActionBar() {
|
|
317
|
+
if (!this.testData) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
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._t9nStrings?.run ?? "Run", "text-enabled": true, icon: "play", scale: "s", loading: this._preparingProfile, onClick: this._executeScript }), this._executionResult ? (h("calcite-action", { text: this._t9nStrings?.lastresults ?? "Last results", active: this._showExecutionPanel, "text-enabled": true, icon: "access-string-results", iconFlipRtl: true, scale: "s", onClick: this._toggleShowExecutionPanel })) : null)));
|
|
312
321
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region Render Main Panel
|
|
324
|
+
renderMainPanel() {
|
|
325
|
+
return (
|
|
326
|
+
// <div class="flex-adjustable">
|
|
327
|
+
h("arcgis-code-editor", { class: "flex-adjustable", language: arcadeDefaults.languageId, value: this.script ?? "", modelId: this._modelId, onValueChange: this._emitScriptChange, ref: (e) => (this._codeEditorElt = e) })
|
|
328
|
+
// </div>
|
|
329
|
+
);
|
|
319
330
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
h("arcgis-code-editor", { class: "flex-adjustable", language: arcadeDefaults.languageId, value: this.script ?? "", modelId: this._modelId, onValueChange: this._emitScriptChange, ref: (e) => (this._codeEditorElt = e) })
|
|
328
|
-
// </div>
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
//#endregion
|
|
332
|
-
//#region Rendering the Action Bar
|
|
333
|
-
renderSideActionBar() {
|
|
334
|
-
if (this.hideSideBar) {
|
|
335
|
-
return null;
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region Rendering the Action Bar
|
|
333
|
+
renderSideActionBar() {
|
|
334
|
+
if (this.hideSideBar) {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
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, h("calcite-action", { id: "profile-variables-action", text: this._t9nStrings?.profilevariables ?? "Profile variables", icon: "profile-variables", active: this.openedSidePanel === "variables", onClick: this._toggleSidePanel, "data-panel-name": "variables" }), h("calcite-action", { id: "function-action", text: this._t9nStrings?.constantsandfunctions ?? "Constants and functions", icon: "function", active: this.openedSidePanel === "api", onClick: this._toggleSidePanel, "data-panel-name": "api" }), this.suggestions?.length ? (h(Fragment, null, h("calcite-action", { id: "suggestions-action", text: this._t9nStrings?.suggestions ?? "Suggestions", icon: "lightbulb", active: this.openedSidePanel === "suggestions", onClick: this._toggleSidePanel, "data-panel-name": "suggestions" }))) : null, this.hideDocumentationActions ? null : (h(Fragment, null, h("calcite-action", { id: "developer-website-action", text: this._t9nStrings?.help ?? "Help", icon: "question", iconFlipRtl: this._t9nLocale === "ar", onClick: this._openArcadeHelp }))))));
|
|
336
338
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
339
|
+
// private renderTooltip(id: string, label: string | undefined): VNode | null {
|
|
340
|
+
// if (this.sideActionBarExpanded || !label) {
|
|
341
|
+
// return null;
|
|
342
|
+
// }
|
|
343
|
+
// return (
|
|
344
|
+
// <calcite-tooltip label={label} reference-element={id} placement="leading-start">
|
|
345
|
+
// <span>{label}</span>
|
|
346
|
+
// </calcite-tooltip>
|
|
347
|
+
// );
|
|
348
|
+
// }
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region Render Side Panel
|
|
351
|
+
renderSidePanel() {
|
|
352
|
+
if (this.hideSideBar) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
switch (this.openedSidePanel) {
|
|
356
|
+
case "api":
|
|
357
|
+
return (h("arcgis-arcade-api", { class: "side-panel flex-panel border-inline-start", modelId: this._modelId, hideDocumentationActions: this.hideDocumentationActions, onItemSelected: this._insertAsSnippet, onClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
358
|
+
case "variables":
|
|
359
|
+
return (h("arcgis-arcade-variables", { class: "side-panel flex-panel border-inline-start", loading: this._preparingProfile, modelId: this._modelId, onItemSelected: this._insertAsText, onClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
360
|
+
case "suggestions":
|
|
361
|
+
return (h("arcgis-arcade-suggestions", { class: "side-panel flex-panel border-inline-start", suggestions: this.suggestions, onItemSelected: this._insertAsText, onClose: this._toggleSidePanel, "data-panel-name": "none" }));
|
|
362
|
+
default:
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
354
365
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
return (h("arcgis-arcade-
|
|
362
|
-
default:
|
|
363
|
-
return null;
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region Rendering Results Panel
|
|
368
|
+
renderResultsPanel() {
|
|
369
|
+
if (!this._showExecutionPanel) {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
return (h("arcgis-arcade-results", { class: "flex-adjustable", openedResultPanel: this._resultPanel, loading: this._executingScript, result: this._executionResult, consoleLogs: this._consoleLogs, onOpenedResultPanelChange: this._onResultPanelChange, onClose: this._onExecutionPanelClose }));
|
|
364
373
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
if (!this._showExecutionPanel) {
|
|
370
|
-
return null;
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region Render
|
|
376
|
+
render() {
|
|
377
|
+
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())));
|
|
371
378
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
get _hostElement() { return this; }
|
|
381
|
-
static get watchers() { return {
|
|
382
|
-
"profile": ["_profileChanged"],
|
|
383
|
-
"testData": ["_testDataChanged"],
|
|
384
|
-
"snippets": ["_snippetChanged"]
|
|
385
|
-
}; }
|
|
386
|
-
static get style() { return arcadeEditorCss; }
|
|
379
|
+
static get assetsDirs() { return ["assets"]; }
|
|
380
|
+
get _hostElement() { return this; }
|
|
381
|
+
static get watchers() { return {
|
|
382
|
+
"profile": ["_profileChanged"],
|
|
383
|
+
"testData": ["_testDataChanged"],
|
|
384
|
+
"snippets": ["_snippetChanged"]
|
|
385
|
+
}; }
|
|
386
|
+
static get style() { return arcadeEditorCss; }
|
|
387
387
|
}, [0, "arcgis-arcade-editor", {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
388
|
+
"profile": [16],
|
|
389
|
+
"script": [1],
|
|
390
|
+
"testData": [16],
|
|
391
|
+
"suggestions": [16],
|
|
392
|
+
"snippets": [16],
|
|
393
|
+
"hideDocumentationActions": [4, "hide-documentation-actions"],
|
|
394
|
+
"hideSideBar": [4, "hide-side-bar"],
|
|
395
|
+
"sideActionBarExpanded": [1540, "side-action-bar-expanded"],
|
|
396
|
+
"openedSidePanel": [1537, "opened-side-panel"],
|
|
397
|
+
"_lang": [32],
|
|
398
|
+
"_t9nLocale": [32],
|
|
399
|
+
"_t9nStrings": [32],
|
|
400
|
+
"_standaloneCodeEditor": [32],
|
|
401
|
+
"_preparingProfile": [32],
|
|
402
|
+
"_editorProfile": [32],
|
|
403
|
+
"_showExecutionPanel": [32],
|
|
404
|
+
"_resultPanel": [32],
|
|
405
|
+
"_executingScript": [32],
|
|
406
|
+
"_consoleLogs": [32],
|
|
407
|
+
"_executionResult": [32],
|
|
408
|
+
"getScript": [64],
|
|
409
|
+
"setFocus": [64],
|
|
410
|
+
"getEditorInstance": [64],
|
|
411
|
+
"getTestResult": [64],
|
|
412
|
+
"getOutputType": [64],
|
|
413
|
+
"updateThemeColors": [64]
|
|
414
|
+
}, undefined, {
|
|
415
|
+
"profile": ["_profileChanged"],
|
|
416
|
+
"testData": ["_testDataChanged"],
|
|
417
|
+
"snippets": ["_snippetChanged"]
|
|
418
|
+
}]);
|
|
419
419
|
function defineCustomElement$1() {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
420
|
+
if (typeof customElements === "undefined") {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
const components = ["arcgis-arcade-editor", "arcgis-arcade-api", "arcgis-arcade-results", "arcgis-arcade-suggestions", "arcgis-arcade-variables", "arcgis-code-editor"];
|
|
424
|
+
components.forEach(tagName => { switch (tagName) {
|
|
425
|
+
case "arcgis-arcade-editor":
|
|
426
|
+
if (!customElements.get(tagName)) {
|
|
427
|
+
customElements.define(tagName, ArcgisArcadeEditor$1);
|
|
428
|
+
}
|
|
429
|
+
break;
|
|
430
|
+
case "arcgis-arcade-api":
|
|
431
|
+
if (!customElements.get(tagName)) {
|
|
432
|
+
defineCustomElement$6();
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
435
|
+
case "arcgis-arcade-results":
|
|
436
|
+
if (!customElements.get(tagName)) {
|
|
437
|
+
defineCustomElement$5();
|
|
438
|
+
}
|
|
439
|
+
break;
|
|
440
|
+
case "arcgis-arcade-suggestions":
|
|
441
|
+
if (!customElements.get(tagName)) {
|
|
442
|
+
defineCustomElement$4();
|
|
443
|
+
}
|
|
444
|
+
break;
|
|
445
|
+
case "arcgis-arcade-variables":
|
|
446
|
+
if (!customElements.get(tagName)) {
|
|
447
|
+
defineCustomElement$3();
|
|
448
|
+
}
|
|
449
|
+
break;
|
|
450
|
+
case "arcgis-code-editor":
|
|
451
|
+
if (!customElements.get(tagName)) {
|
|
452
|
+
defineCustomElement$2();
|
|
453
|
+
}
|
|
454
|
+
break;
|
|
455
|
+
} });
|
|
456
456
|
}
|
|
457
457
|
defineCustomElement$1();
|
|
458
458
|
|