@arcgis/coding-components 4.29.0-beta.99 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ar.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bg.json +113 -113
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bs.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ca.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.cs.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.da.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.de.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.el.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.en.json +19 -19
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.es.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.et.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fi.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fr.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.he.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hr.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hu.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.id.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.it.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ja.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ko.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lt.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lv.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nb.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nl.json +66 -66
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pl.json +66 -66
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-BR.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-PT.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ro.json +66 -66
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ru.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sk.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sl.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sr.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sv.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.th.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.tr.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.uk.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.vi.json +111 -111
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-CN.json +66 -66
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-HK.json +66 -66
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-TW.json +66 -66
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ar.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.bg.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.bs.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ca.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.cs.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.da.json +3 -3
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.de.json +3 -3
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.el.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.en.json +3 -3
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.es.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.et.json +3 -3
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.fi.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.fr.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.he.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.hr.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.hu.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.id.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.it.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ja.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ko.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.lt.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.lv.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.nb.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.nl.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pl.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pt-BR.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pt-PT.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ro.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ru.json +3 -3
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sk.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sl.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sr.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sv.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.th.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.tr.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.uk.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.vi.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-CN.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-HK.json +4 -4
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-TW.json +4 -4
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-e1cb02b3.js → p-0a2edf01.js} +2 -2
- package/dist/arcgis-coding-components/p-11e79992.js +6 -0
- package/dist/arcgis-coding-components/{p-f75beb80.js → p-36e2cbc2.js} +3 -3
- package/dist/arcgis-coding-components/{p-457e3916.js → p-4406b5a8.js} +2 -2
- package/dist/arcgis-coding-components/{p-87d7ad9e.js → p-4eb30e60.js} +1 -1
- package/dist/arcgis-coding-components/{p-7f9d3fdc.js → p-619ca372.js} +1 -1
- package/dist/arcgis-coding-components/{p-7e0e8ecc.js → p-71125c69.js} +2 -2
- package/dist/arcgis-coding-components/{p-0bab0228.js → p-8d7f0979.js} +2 -2
- package/dist/arcgis-coding-components/p-9b8091c1.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-ad86a5f5.js → p-bd81fdff.js} +11 -11
- package/dist/arcgis-coding-components/{p-f23f7fee.js → p-ecc8dd8a.js} +2 -2
- package/dist/arcgis-coding-components/{p-4648782b.js → p-f9016c56.js} +2 -2
- package/dist/cjs/{arcade-defaults-5dd9ebb7.js → arcade-defaults-b30ccec8.js} +271 -236
- package/dist/cjs/{arcade-mode-0b4c53a1.js → arcade-mode-eb755260.js} +11 -14
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +160 -184
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/{css-fe7f8980.js → css-9e907aa0.js} +1 -1
- package/dist/cjs/{cssMode-4c9b3a32.js → cssMode-e4189b13.js} +3 -3
- package/dist/cjs/{html-b044fbba.js → html-2582ae43.js} +3 -3
- package/dist/cjs/{htmlMode-956a6ffa.js → htmlMode-0edcf1ee.js} +3 -3
- package/dist/cjs/{index-aaceaf1f.js → index-54d6f9be.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-6c55ac8b.js → javascript-425c653a.js} +4 -4
- package/dist/cjs/{jsonMode-d83e322c.js → jsonMode-eea03515.js} +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{tsMode-5c5ffa3e.js → tsMode-b92c9221.js} +3 -3
- package/dist/cjs/{typescript-6143656a.js → typescript-cfc1221c.js} +3 -3
- package/dist/components/arcade-api.js +20 -18
- package/dist/components/arcade-contribution.js +9 -8
- package/dist/components/arcade-defaults.js +188 -168
- package/dist/components/arcade-mode.js +10 -12
- package/dist/components/arcade-results.js +29 -83
- package/dist/components/arcade-suggestions.js +15 -12
- package/dist/components/arcade-variables.js +30 -21
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +61 -49
- 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-code-editor.js +1 -1
- package/dist/components/code-editor.js +1 -1
- package/dist/components/fields.js +37 -23
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +3 -3
- package/dist/components/markdown.js +10 -1
- package/dist/components/utilities.js +4 -4
- package/dist/esm/{arcade-defaults-2d7283d4.js → arcade-defaults-a5dc6132.js} +267 -233
- package/dist/esm/{arcade-mode-a8abe5af.js → arcade-mode-d06b6e4f.js} +11 -14
- package/dist/esm/arcgis-arcade-api_6.entry.js +160 -184
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/{css-d31a02ca.js → css-59b4804d.js} +1 -1
- package/dist/esm/{cssMode-5ee45e91.js → cssMode-2bce7da7.js} +3 -3
- package/dist/esm/{html-5c2e488c.js → html-3ad47fc0.js} +3 -3
- package/dist/esm/{htmlMode-376cd5e8.js → htmlMode-6cb73c91.js} +3 -3
- package/dist/esm/{index-1b265749.js → index-ee54d182.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-13ddec2b.js → javascript-8917f926.js} +4 -4
- package/dist/esm/{jsonMode-674e89d6.js → jsonMode-9a1dbf00.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{tsMode-4c4398d7.js → tsMode-2caf1509.js} +3 -3
- package/dist/esm/{typescript-b328b622.js → typescript-a3abccc0.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-editor/arcade-editor.d.ts +2 -7
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +0 -1
- package/dist/types/components.d.ts +2 -7
- package/dist/types/utils/arcade-monaco/arcade-contribution.d.ts +2 -2
- package/dist/types/utils/arcade-monaco/arcade-theme.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +2 -2
- package/dist/types/utils/fields.d.ts +1 -0
- package/dist/types/utils/markdown.d.ts +3 -0
- package/dist/types/utils/profile/editor-profile.d.ts +49 -63
- package/dist/types/utils/profile/types.d.ts +122 -1
- package/dist/types/utils/profile/utils.d.ts +22 -9
- package/package.json +8 -8
- package/dist/arcgis-coding-components/p-6d56a4b8.entry.js +0 -6
- package/dist/arcgis-coding-components/p-a75f5087.js +0 -6
- package/dist/components/functional-components.js +0 -15
- package/dist/types/utils/functional-components.d.ts +0 -7
- package/dist/types/utils/json-format.d.ts +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
-
* v4.29.0
|
|
4
|
+
* v4.29.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal,
|
|
6
|
+
import { r as registerInstance, c as createEvent, g as getAssetPath, h, H as Host, a as getElement, F as Fragment } from './index-ee54d182.js';
|
|
7
|
+
import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, i as ie, s as se, d as importRequest, l as languages, f as arcadeDefaults, B, U as Uri, q, W, h as filterCollection, G, j as importArcade, k as h$1, m as U, n as k, K as KeyCode, Z, D, o as supportedFields, p as K, R as Range, x, r as KeyMod } from './arcade-defaults-a5dc6132.js';
|
|
8
8
|
|
|
9
9
|
async function colorizeCode(code) {
|
|
10
10
|
return await editor.colorize(code, "arcade", { tabSize: 2 });
|
|
@@ -20,24 +20,23 @@ async function colorizeCodeElement(e, text) {
|
|
|
20
20
|
if (!e || e.tagName !== "CODE") {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
+
// eslint-disable-next-line require-atomic-updates
|
|
23
24
|
e.innerHTML = await colorizeCode(text ?? "");
|
|
24
25
|
}
|
|
25
26
|
function generateColorizeStyles() {
|
|
27
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
26
28
|
const themeService = StandaloneServices.get(IStandaloneThemeService);
|
|
27
29
|
const theme = themeService.getColorTheme();
|
|
28
30
|
return generateTokensCSSForColorMap(theme.tokenTheme.getColorMap());
|
|
31
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
29
32
|
}
|
|
30
33
|
function onColorizeThemeChanged(func) {
|
|
34
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
31
35
|
const themeService = StandaloneServices.get(IStandaloneThemeService);
|
|
32
36
|
return themeService.onDidColorThemeChange(() => func());
|
|
37
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
const StickyFilterInput = ({ filterValue, ...rest }) => (
|
|
36
|
-
// TODO: Remove when calcite-input bug with scale is fixed
|
|
37
|
-
// @ts-expect-error
|
|
38
|
-
h("div", { class: "sticky", scale: "m" },
|
|
39
|
-
h("calcite-input", { value: filterValue, icon: "magnifying-glass", clearable: true, ...rest })));
|
|
40
|
-
|
|
41
40
|
var marked_umd = createCommonjsModule(function (module, exports) {
|
|
42
41
|
/**
|
|
43
42
|
* marked v5.1.2 - a markdown parser
|
|
@@ -2915,6 +2914,7 @@ var marked_umd = createCommonjsModule(function (module, exports) {
|
|
|
2915
2914
|
}));
|
|
2916
2915
|
});
|
|
2917
2916
|
|
|
2917
|
+
// Set up the marked library to use GitHub Flavored Markdown and to use the custom renderer for links.
|
|
2918
2918
|
marked_umd.marked.use({
|
|
2919
2919
|
gfm: true,
|
|
2920
2920
|
renderer: {
|
|
@@ -2923,6 +2923,9 @@ marked_umd.marked.use({
|
|
|
2923
2923
|
}
|
|
2924
2924
|
}
|
|
2925
2925
|
});
|
|
2926
|
+
/**
|
|
2927
|
+
* Converts a markdown string to HTML using the marked library.
|
|
2928
|
+
*/
|
|
2926
2929
|
function convertMarkdownString(value) {
|
|
2927
2930
|
value ?? (value = "");
|
|
2928
2931
|
const result = marked_umd.marked(typeof value === "string" ? value : value.value, {
|
|
@@ -2935,11 +2938,12 @@ function convertMarkdownString(value) {
|
|
|
2935
2938
|
}
|
|
2936
2939
|
|
|
2937
2940
|
function isMonacoEnvironmentSetup() {
|
|
2938
|
-
return !!
|
|
2941
|
+
return !!window.MonacoEnvironment?.getWorkerUrl;
|
|
2939
2942
|
}
|
|
2940
2943
|
const additionalLanguageWorkersMap = new Map();
|
|
2944
|
+
let _assetsPath = "";
|
|
2941
2945
|
function getAssetsPath() {
|
|
2942
|
-
return
|
|
2946
|
+
return _assetsPath;
|
|
2943
2947
|
}
|
|
2944
2948
|
function setupMonacoEnvironment(assetsPath) {
|
|
2945
2949
|
//
|
|
@@ -2947,10 +2951,10 @@ function setupMonacoEnvironment(assetsPath) {
|
|
|
2947
2951
|
if (isMonacoEnvironmentSetup()) {
|
|
2948
2952
|
return;
|
|
2949
2953
|
}
|
|
2954
|
+
_assetsPath = assetsPath;
|
|
2950
2955
|
// Since we are using workers, monaco needs to find them.
|
|
2951
2956
|
// Using the global MonacoEnvironment.
|
|
2952
|
-
|
|
2953
|
-
assetsPath,
|
|
2957
|
+
window.MonacoEnvironment = {
|
|
2954
2958
|
getWorker: async (_, languageId) => {
|
|
2955
2959
|
// Manufacture the url for the web worker
|
|
2956
2960
|
let url = additionalLanguageWorkersMap.get(languageId) ?? `${assetsPath}/code-editor/editor.worker.js`;
|
|
@@ -2973,7 +2977,7 @@ function setupMonacoEnvironment(assetsPath) {
|
|
|
2973
2977
|
break;
|
|
2974
2978
|
}
|
|
2975
2979
|
// If we have a relative path or we are on same orgin, we can use the default js implementation
|
|
2976
|
-
if (!
|
|
2980
|
+
if (!ie(url) || se(url, globalThis.location.href, true)) {
|
|
2977
2981
|
return new Worker(url, { name: languageId });
|
|
2978
2982
|
}
|
|
2979
2983
|
// For cross orgin, we will load the worker code as a string and manufacture a blob
|
|
@@ -3020,7 +3024,7 @@ async function getArcadeWorker(uri) {
|
|
|
3020
3024
|
* @returns mode for arcade
|
|
3021
3025
|
*/
|
|
3022
3026
|
async function getMode() {
|
|
3023
|
-
return await import('./arcade-mode-
|
|
3027
|
+
return await import('./arcade-mode-d06b6e4f.js');
|
|
3024
3028
|
}
|
|
3025
3029
|
// Register the language in Monaco
|
|
3026
3030
|
languages.register({
|
|
@@ -3052,7 +3056,6 @@ const ArcgisArcadeApi = class {
|
|
|
3052
3056
|
this.close = createEvent(this, "close", 3);
|
|
3053
3057
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
3054
3058
|
this._emitItemSelected = (e) => {
|
|
3055
|
-
// @ts-expect-error
|
|
3056
3059
|
const item = e.target?.["data-item"];
|
|
3057
3060
|
if (!item) {
|
|
3058
3061
|
return;
|
|
@@ -3071,8 +3074,11 @@ const ArcgisArcadeApi = class {
|
|
|
3071
3074
|
const keyEvent = e;
|
|
3072
3075
|
if (!keyEvent.key || keyEvent.key === "Enter") {
|
|
3073
3076
|
e.preventDefault();
|
|
3074
|
-
|
|
3075
|
-
|
|
3077
|
+
const item = e.target?.["data-item"];
|
|
3078
|
+
if (!item) {
|
|
3079
|
+
return;
|
|
3080
|
+
}
|
|
3081
|
+
this.itemSelected.emit(item.completion.insertText);
|
|
3076
3082
|
}
|
|
3077
3083
|
};
|
|
3078
3084
|
this._selectItem = (e) => {
|
|
@@ -3080,14 +3086,14 @@ const ArcgisArcadeApi = class {
|
|
|
3080
3086
|
return;
|
|
3081
3087
|
}
|
|
3082
3088
|
e.stopPropagation();
|
|
3083
|
-
|
|
3084
|
-
this._selectedApiItem = e.target["data-item"];
|
|
3089
|
+
this._selectedApiItem = e.target?.["data-item"];
|
|
3085
3090
|
};
|
|
3086
3091
|
this._unselectItem = async () => {
|
|
3087
3092
|
this._selectedApiItem = undefined;
|
|
3088
3093
|
};
|
|
3089
|
-
|
|
3090
|
-
|
|
3094
|
+
this._updateFilterValue = (e) => {
|
|
3095
|
+
this._filterValue = e.target?.value ?? "";
|
|
3096
|
+
};
|
|
3091
3097
|
this._lang = "";
|
|
3092
3098
|
this._t9nLocale = "";
|
|
3093
3099
|
this._t9nStrings = undefined;
|
|
@@ -3109,12 +3115,12 @@ const ArcgisArcadeApi = class {
|
|
|
3109
3115
|
if (!this.modelId || key !== Uri.parse(this.modelId).toString()) {
|
|
3110
3116
|
return;
|
|
3111
3117
|
}
|
|
3112
|
-
this._updateApiLibrary();
|
|
3118
|
+
this._updateApiLibrary().catch(console.error);
|
|
3113
3119
|
});
|
|
3114
|
-
this._updateApiLibrary();
|
|
3120
|
+
await this._updateApiLibrary();
|
|
3115
3121
|
}
|
|
3116
3122
|
disconnectedCallback() {
|
|
3117
|
-
|
|
3123
|
+
q(this);
|
|
3118
3124
|
this._flowObserver?.disconnect();
|
|
3119
3125
|
this._themeChangedListner?.dispose();
|
|
3120
3126
|
}
|
|
@@ -3159,7 +3165,7 @@ const ArcgisArcadeApi = class {
|
|
|
3159
3165
|
// When switching between flow the same reference is reused
|
|
3160
3166
|
this._flowObserver = new MutationObserver(() => {
|
|
3161
3167
|
// Get the last panel and try to set focus on the input element
|
|
3162
|
-
|
|
3168
|
+
W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
3163
3169
|
});
|
|
3164
3170
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
3165
3171
|
}
|
|
@@ -3170,25 +3176,25 @@ const ArcgisArcadeApi = class {
|
|
|
3170
3176
|
if (!filteredApiItems.length) {
|
|
3171
3177
|
return null;
|
|
3172
3178
|
}
|
|
3173
|
-
return (h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (h("calcite-list-item", { label:
|
|
3179
|
+
return (h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (h("calcite-list-item", { label: G(apiItem.completion.detail), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": apiItem }, h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "Expand", icon: "chevron-right", iconFlipRtl: true, scale: "s", onClick: this._selectItem, "data-item": apiItem }))))));
|
|
3174
3180
|
}
|
|
3175
3181
|
renderApiItemFlowItem() {
|
|
3176
3182
|
const apiItem = this._selectedApiItem;
|
|
3177
3183
|
if (!apiItem) {
|
|
3178
3184
|
return null;
|
|
3179
3185
|
}
|
|
3180
|
-
return (h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, beforeBack: this._unselectItem, closable: true, onCalciteFlowItemClose: this._emitClose }, this.hideDocumentationActions ? null : (h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", scale: "s", href: apiItem.link, target: "Arcade Help", "icon-start": "information" }, this._t9nStrings?.moreinformation)), h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", "icon-start": "code", scale: "s", onClick: this._emitItemSelectedAndClose, "data-item": apiItem, ref: (e) => void e?.setFocus() }, this._t9nStrings?.insert ?? "Insert"), h("calcite-block", { open: true, heading:
|
|
3186
|
+
return (h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, beforeBack: this._unselectItem, closable: true, onCalciteFlowItemClose: this._emitClose }, this.hideDocumentationActions ? null : (h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", scale: "s", href: apiItem.link, target: "Arcade Help", "icon-start": "information" }, this._t9nStrings?.moreinformation)), h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", "icon-start": "code", scale: "s", onClick: this._emitItemSelectedAndClose, "data-item": apiItem, ref: (e) => void e?.setFocus() }, this._t9nStrings?.insert ?? "Insert"), h("calcite-block", { open: true, heading: G(apiItem.completion.detail) }, h("div", { innerHTML: convertMarkdownString(apiItem.completion.documentation) }), apiItem.examples ? (h("div", { ref: (e) => {
|
|
3181
3187
|
if (!e) {
|
|
3182
3188
|
return;
|
|
3183
3189
|
}
|
|
3184
3190
|
e.innerHTML = convertMarkdownString(apiItem.examples);
|
|
3185
|
-
colorizedAllCodeElements(e);
|
|
3191
|
+
colorizedAllCodeElements(e).catch(console.error);
|
|
3186
3192
|
} })) : null)));
|
|
3187
3193
|
}
|
|
3188
3194
|
render() {
|
|
3189
3195
|
const categories = (this._apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
|
|
3190
3196
|
const empty = categories.every((g) => !g);
|
|
3191
|
-
return (h(Host, null, h("style", null, this._colorizeStyle), h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, h(
|
|
3197
|
+
return (h(Host, null, h("style", null, this._colorizeStyle), h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this._preparingApi ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, empty ? h("div", { class: "notice-container" }, this._t9nStrings?.noitems ?? "No items") : categories))), this.renderApiItemFlowItem())));
|
|
3192
3198
|
}
|
|
3193
3199
|
static get assetsDirs() { return ["assets"]; }
|
|
3194
3200
|
get _hostElement() { return getElement(this); }
|
|
@@ -3354,17 +3360,18 @@ function formatArcadeResultDateOnly(dateObject) {
|
|
|
3354
3360
|
function formatArcadeResultTimeOnly(dateObject) {
|
|
3355
3361
|
return dateObject.value.toString();
|
|
3356
3362
|
}
|
|
3357
|
-
async function
|
|
3358
|
-
|
|
3359
|
-
|
|
3363
|
+
async function convertScriptOutputToArcadeResult(scriptOutput, timeZone = "system") {
|
|
3364
|
+
const arcadeResult = valueToArcadeResult(scriptOutput);
|
|
3365
|
+
if (arcadeResult.type !== "featureSet") {
|
|
3366
|
+
return arcadeResult;
|
|
3360
3367
|
}
|
|
3361
3368
|
// Feature Set needs to be loaded
|
|
3362
|
-
await
|
|
3369
|
+
await arcadeResult.value.load();
|
|
3363
3370
|
// Create the first iterator
|
|
3364
|
-
|
|
3371
|
+
arcadeResult.iterator = arcadeResult.value.iterator({ aborted: false });
|
|
3365
3372
|
// Load the first batch of items
|
|
3366
|
-
|
|
3367
|
-
return
|
|
3373
|
+
arcadeResult.features = (await arcadeResult.iterator.nextBatchAsArcadeFeatures(BatchSize, timeZone)) ?? [];
|
|
3374
|
+
return arcadeResult;
|
|
3368
3375
|
}
|
|
3369
3376
|
async function executeScript(editorProfile, script, testContext, console) {
|
|
3370
3377
|
//
|
|
@@ -3392,12 +3399,12 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
3392
3399
|
// Execute the script
|
|
3393
3400
|
const scriptOutput = await executor.executeAsync(profileVariableInstances, executeContext);
|
|
3394
3401
|
// Convert script output to arcade result object and load data if necessary
|
|
3395
|
-
const
|
|
3402
|
+
const arcadeResult = await convertScriptOutputToArcadeResult(scriptOutput, timeZone);
|
|
3396
3403
|
// Timestamp and measure cost
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
return
|
|
3404
|
+
arcadeResult.timeStamp = timeStamp;
|
|
3405
|
+
arcadeResult.compilationTime = t1 - t0;
|
|
3406
|
+
arcadeResult.executionTime = performance.now() - t1;
|
|
3407
|
+
return arcadeResult;
|
|
3401
3408
|
//
|
|
3402
3409
|
}
|
|
3403
3410
|
catch (error) {
|
|
@@ -3457,7 +3464,8 @@ function setupArcadeTheme() {
|
|
|
3457
3464
|
});
|
|
3458
3465
|
});
|
|
3459
3466
|
}
|
|
3460
|
-
const
|
|
3467
|
+
const monacoThemeKeys = ["comment", "keyword", "identifier", "string", "number", "constant"];
|
|
3468
|
+
const colorRulesKeys = [...monacoThemeKeys, "date"];
|
|
3461
3469
|
function updateThemeColors(theme, colorRules) {
|
|
3462
3470
|
if (colorRules === undefined) {
|
|
3463
3471
|
setupArcadeTheme();
|
|
@@ -3465,14 +3473,7 @@ function updateThemeColors(theme, colorRules) {
|
|
|
3465
3473
|
}
|
|
3466
3474
|
const base = theme === "light" ? "vs" : "vs-dark";
|
|
3467
3475
|
const rules = [];
|
|
3468
|
-
|
|
3469
|
-
const foreground = colorRules[key];
|
|
3470
|
-
if (!foreground) {
|
|
3471
|
-
return;
|
|
3472
|
-
}
|
|
3473
|
-
rules.push({ token: `${key}.arc`, foreground });
|
|
3474
|
-
});
|
|
3475
|
-
validKeys.forEach((key) => {
|
|
3476
|
+
monacoThemeKeys.forEach((key) => {
|
|
3476
3477
|
const foreground = colorRules[key];
|
|
3477
3478
|
if (!foreground) {
|
|
3478
3479
|
return;
|
|
@@ -3507,15 +3508,19 @@ const ArcgisArcadeEditor = class {
|
|
|
3507
3508
|
this._showExecutionPanel = true;
|
|
3508
3509
|
this._executingScript = true;
|
|
3509
3510
|
this._consoleLogs = [];
|
|
3510
|
-
setTimeout(async () => {
|
|
3511
|
+
setTimeout(() => void (async () => {
|
|
3511
3512
|
const script = await this._codeEditorElt?.getValue();
|
|
3512
3513
|
this._executionResult = await executeScript(editorProfile.definition, script, testContext, (log) => setTimeout(() => (this._consoleLogs = [...this._consoleLogs, log]), 0));
|
|
3513
3514
|
this._executingScript = false;
|
|
3514
|
-
}, 0);
|
|
3515
|
+
})(), 0);
|
|
3516
|
+
};
|
|
3517
|
+
this._toggleShowExecutionPanel = () => {
|
|
3518
|
+
this._showExecutionPanel = !this._showExecutionPanel;
|
|
3515
3519
|
};
|
|
3516
|
-
this.
|
|
3517
|
-
|
|
3518
|
-
|
|
3520
|
+
this._toggleSideActionBarExpanded = () => {
|
|
3521
|
+
this.sideActionBarExpanded = !this.sideActionBarExpanded;
|
|
3522
|
+
};
|
|
3523
|
+
this._toggleSidePanel = (e) => {
|
|
3519
3524
|
if (!e.target) {
|
|
3520
3525
|
return;
|
|
3521
3526
|
}
|
|
@@ -3524,18 +3529,18 @@ const ArcgisArcadeEditor = class {
|
|
|
3524
3529
|
this.openedSidePanel = panelName === this.openedSidePanel ? "none" : panelName;
|
|
3525
3530
|
if (this.openedSidePanel === "none") {
|
|
3526
3531
|
// Reset focus on the code editor if no panel displayed
|
|
3527
|
-
|
|
3532
|
+
this._codeEditorElt?.setFocus().catch(console.error);
|
|
3528
3533
|
}
|
|
3529
3534
|
};
|
|
3530
|
-
this._openArcadeHelp = () => window.open(DevelopersWebSitePath, "Arcade Help");
|
|
3535
|
+
this._openArcadeHelp = () => void window.open(DevelopersWebSitePath, "Arcade Help");
|
|
3531
3536
|
this._emitScriptChange = (e) => {
|
|
3532
3537
|
e.stopPropagation();
|
|
3533
3538
|
this.scriptChange.emit(e.detail);
|
|
3534
3539
|
};
|
|
3535
|
-
this._insertAsSnippet =
|
|
3536
|
-
this._insertAsText =
|
|
3537
|
-
this._onResultPanelChange = (e) => (this._resultPanel = e.detail);
|
|
3538
|
-
this._onExecutionPanelClose = () => (this._showExecutionPanel = false);
|
|
3540
|
+
this._insertAsSnippet = (e) => void this._codeEditorElt?.insertSnippet(e.detail).catch(console.error);
|
|
3541
|
+
this._insertAsText = (e) => void this._codeEditorElt?.insertText(e.detail).catch(console.error);
|
|
3542
|
+
this._onResultPanelChange = (e) => void (this._resultPanel = e.detail);
|
|
3543
|
+
this._onExecutionPanelClose = () => void (this._showExecutionPanel = false);
|
|
3539
3544
|
this._lang = "";
|
|
3540
3545
|
this._t9nLocale = "";
|
|
3541
3546
|
this._t9nStrings = undefined;
|
|
@@ -3562,13 +3567,13 @@ const ArcgisArcadeEditor = class {
|
|
|
3562
3567
|
if (newValue === oldValue) {
|
|
3563
3568
|
return;
|
|
3564
3569
|
}
|
|
3565
|
-
this._updateEditorProfile();
|
|
3570
|
+
this._updateEditorProfile().catch(console.error);
|
|
3566
3571
|
}
|
|
3567
3572
|
_testDataChanged(newValue, oldValue) {
|
|
3568
3573
|
if (newValue === oldValue || !this._showExecutionPanel) {
|
|
3569
3574
|
return;
|
|
3570
3575
|
}
|
|
3571
|
-
this._executeScript();
|
|
3576
|
+
this._executeScript().catch(console.error);
|
|
3572
3577
|
}
|
|
3573
3578
|
_snippetChanged(newValue, oldValue) {
|
|
3574
3579
|
if (newValue === oldValue) {
|
|
@@ -3619,14 +3624,6 @@ const ArcgisArcadeEditor = class {
|
|
|
3619
3624
|
const script = await this._codeEditorElt?.getValue();
|
|
3620
3625
|
return await executeScript(editorProfile.definition, script, this.testData);
|
|
3621
3626
|
}
|
|
3622
|
-
/**
|
|
3623
|
-
* Returns the Arcade output type for the script.
|
|
3624
|
-
* @deprecated Use getTestResult
|
|
3625
|
-
* @internal
|
|
3626
|
-
*/
|
|
3627
|
-
async getOutputType() {
|
|
3628
|
-
return (await this.getTestResult()).type;
|
|
3629
|
-
}
|
|
3630
3627
|
/**
|
|
3631
3628
|
* Allows to change theme colors
|
|
3632
3629
|
* @internal
|
|
@@ -3635,13 +3632,12 @@ const ArcgisArcadeEditor = class {
|
|
|
3635
3632
|
const theme = k(this._hostElement);
|
|
3636
3633
|
updateThemeColors(theme, colorRules);
|
|
3637
3634
|
if (colorRules === undefined) {
|
|
3638
|
-
|
|
3635
|
+
colorRulesKeys.forEach((key) => {
|
|
3639
3636
|
this._hostElement.style.removeProperty(`--arcgis-arcade-editor-${key}`);
|
|
3640
3637
|
});
|
|
3641
3638
|
return;
|
|
3642
3639
|
}
|
|
3643
|
-
|
|
3644
|
-
// @ts-expect-error
|
|
3640
|
+
colorRulesKeys.forEach((key) => {
|
|
3645
3641
|
const foreground = colorRules[key];
|
|
3646
3642
|
if (!foreground) {
|
|
3647
3643
|
return;
|
|
@@ -3682,14 +3678,14 @@ const ArcgisArcadeEditor = class {
|
|
|
3682
3678
|
contextMenuOrder: 1,
|
|
3683
3679
|
run: () => {
|
|
3684
3680
|
if (this.testData) {
|
|
3685
|
-
this._executeScript();
|
|
3681
|
+
this._executeScript().catch(console.error);
|
|
3686
3682
|
}
|
|
3687
3683
|
}
|
|
3688
3684
|
});
|
|
3689
3685
|
await this._codeEditorElt?.setFocus();
|
|
3690
3686
|
}
|
|
3691
3687
|
disconnectedCallback() {
|
|
3692
|
-
|
|
3688
|
+
q(this);
|
|
3693
3689
|
arcadeDefaults.disposeApiContextForModel(this._modelId);
|
|
3694
3690
|
arcadeDefaults.disposeEditorProfileForModel(this._modelId);
|
|
3695
3691
|
while (this._disposables.length) {
|
|
@@ -3740,22 +3736,45 @@ const ArcgisArcadeEditor = class {
|
|
|
3740
3736
|
}
|
|
3741
3737
|
//#endregion
|
|
3742
3738
|
//#region Rendering the Action Bar
|
|
3739
|
+
renderAction({ id, label, icon, active, panelName, onClick = this._toggleSidePanel }) {
|
|
3740
|
+
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)))));
|
|
3741
|
+
}
|
|
3743
3742
|
renderSideActionBar() {
|
|
3744
3743
|
if (this.hideSideBar) {
|
|
3745
3744
|
return null;
|
|
3746
3745
|
}
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3746
|
+
console.log("expanded", this.sideActionBarExpanded);
|
|
3747
|
+
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({
|
|
3748
|
+
id: "profile-variables-action",
|
|
3749
|
+
label: this._t9nStrings?.profilevariables ?? "Profile variables",
|
|
3750
|
+
icon: "profile-variables",
|
|
3751
|
+
active: this.openedSidePanel === "variables",
|
|
3752
|
+
panelName: "variables"
|
|
3753
|
+
}), this.renderAction({
|
|
3754
|
+
id: "function-action",
|
|
3755
|
+
label: this._t9nStrings?.constantsandfunctions ?? "Constants and functions",
|
|
3756
|
+
icon: "function",
|
|
3757
|
+
active: this.openedSidePanel === "api",
|
|
3758
|
+
panelName: "api"
|
|
3759
|
+
}), this.suggestions?.length
|
|
3760
|
+
? this.renderAction({
|
|
3761
|
+
id: "suggestions-action",
|
|
3762
|
+
label: this._t9nStrings?.suggestions ?? "Suggestions",
|
|
3763
|
+
icon: "lightbulb",
|
|
3764
|
+
active: this.openedSidePanel === "suggestions",
|
|
3765
|
+
panelName: "suggestions"
|
|
3766
|
+
})
|
|
3767
|
+
: null, this.hideDocumentationActions
|
|
3768
|
+
? null
|
|
3769
|
+
: this.renderAction({
|
|
3770
|
+
id: "developer-website-action",
|
|
3771
|
+
label: this._t9nStrings?.help ?? "Help",
|
|
3772
|
+
icon: "question",
|
|
3773
|
+
active: false,
|
|
3774
|
+
panelName: "none",
|
|
3775
|
+
onClick: this._openArcadeHelp
|
|
3776
|
+
}))));
|
|
3777
|
+
}
|
|
3759
3778
|
//#endregion
|
|
3760
3779
|
//#region Render Side Panel
|
|
3761
3780
|
renderSidePanel() {
|
|
@@ -3796,62 +3815,7 @@ const ArcgisArcadeEditor = class {
|
|
|
3796
3815
|
};
|
|
3797
3816
|
ArcgisArcadeEditor.style = arcadeEditorCss;
|
|
3798
3817
|
|
|
3799
|
-
const
|
|
3800
|
-
const indentType = new Array(indentSpecs.size + 1).join(indentSpecs.char);
|
|
3801
|
-
function createPushFunc(p) {
|
|
3802
|
-
return (substring) => `\\${p.push(substring)}\\`;
|
|
3803
|
-
}
|
|
3804
|
-
function createPopFunc(p) {
|
|
3805
|
-
return (_, offset) => p[offset - 1] ?? "";
|
|
3806
|
-
}
|
|
3807
|
-
function indent(index, indentType) {
|
|
3808
|
-
return new Array(index + 1).join(indentType);
|
|
3809
|
-
}
|
|
3810
|
-
function jsonFormat(json) {
|
|
3811
|
-
// Convert to string and extract backslashes and strings
|
|
3812
|
-
const p = [];
|
|
3813
|
-
const pushFunc = createPushFunc(p);
|
|
3814
|
-
const jsonString = JSON.stringify(json)
|
|
3815
|
-
.replace(/\\./gu, pushFunc)
|
|
3816
|
-
.replace(/(".*?"|'.*?')/gu, pushFunc)
|
|
3817
|
-
.replace(/\s+/u, "");
|
|
3818
|
-
// Indent and insert newlines
|
|
3819
|
-
let indentIndex = 0;
|
|
3820
|
-
let out = "";
|
|
3821
|
-
for (let i = 0; i < jsonString.length; i++) {
|
|
3822
|
-
const c = jsonString.charAt(i);
|
|
3823
|
-
switch (c) {
|
|
3824
|
-
case "{":
|
|
3825
|
-
case "[":
|
|
3826
|
-
indentIndex += 1;
|
|
3827
|
-
out += `${c}\n${indent(indentIndex, indentType)}`;
|
|
3828
|
-
break;
|
|
3829
|
-
case "}":
|
|
3830
|
-
case "]":
|
|
3831
|
-
indentIndex -= 1;
|
|
3832
|
-
out += `\n${indent(indentIndex, indentType)}${c}`;
|
|
3833
|
-
break;
|
|
3834
|
-
case ",":
|
|
3835
|
-
out += `,\n${indent(indentIndex, indentType)}`;
|
|
3836
|
-
break;
|
|
3837
|
-
case ":":
|
|
3838
|
-
out += ": ";
|
|
3839
|
-
break;
|
|
3840
|
-
default:
|
|
3841
|
-
out += c;
|
|
3842
|
-
break;
|
|
3843
|
-
}
|
|
3844
|
-
}
|
|
3845
|
-
// Strip whitespace from numeric arrays and put backslashes
|
|
3846
|
-
// and strings back in
|
|
3847
|
-
const popFunc = createPopFunc(p);
|
|
3848
|
-
return out
|
|
3849
|
-
.replace(/\[[\d,\s]+?\]/gu, (m) => m.replace(/\s/gu, ""))
|
|
3850
|
-
.replace(/\\(\d+)\\/gu, popFunc) // strings
|
|
3851
|
-
.replace(/\\(\d+)\\/gu, popFunc); // backslashes in strings
|
|
3852
|
-
}
|
|
3853
|
-
|
|
3854
|
-
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-half)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}: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-half)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .color-info{color:var(--calcite-color-info)}:host .color-error{color:var(--calcite-color-danger)}:host .color-success{color:var(--calcite-color-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-three-quarter)}:host .console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-three-quarter);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-quarter)}: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-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)}";
|
|
3818
|
+
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-half)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}: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-half)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);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-three-quarter)}:host .console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-three-quarter);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-quarter)}: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)}";
|
|
3855
3819
|
|
|
3856
3820
|
//#region Specialized Constants
|
|
3857
3821
|
const treeProps = {
|
|
@@ -3872,10 +3836,10 @@ function renderDictionaryProperty(key) {
|
|
|
3872
3836
|
return (h(Fragment, null, h("span", { class: "dictionary-property" }, key), h("span", null, ":\u00A0")));
|
|
3873
3837
|
}
|
|
3874
3838
|
function renderDictionaryAsJsonTree(value, subtree = false) {
|
|
3875
|
-
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", { class: "string-value" },
|
|
3839
|
+
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", { class: "string-value" }, JSON.stringify(value.castAsJson(), undefined, 2))));
|
|
3876
3840
|
}
|
|
3877
3841
|
function renderGeometryTree(value, subtree = false) {
|
|
3878
|
-
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty("type"), value.type)), h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty("value"), h("span", { class: "string-value" },
|
|
3842
|
+
return (h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty("type"), value.type)), h("calcite-tree-item", null, h("div", { class: "tree-item-label" }, renderDictionaryProperty("value"), h("span", { class: "string-value" }, JSON.stringify(value, undefined, 2))))));
|
|
3879
3843
|
}
|
|
3880
3844
|
function renderSimpleValue(arcadeResult) {
|
|
3881
3845
|
switch (arcadeResult.type) {
|
|
@@ -3883,7 +3847,7 @@ function renderSimpleValue(arcadeResult) {
|
|
|
3883
3847
|
case "null":
|
|
3884
3848
|
return h("span", { class: "constant-value" }, arcadeResult.type);
|
|
3885
3849
|
case "text":
|
|
3886
|
-
return h("span", { class: "string-value" },
|
|
3850
|
+
return h("span", { class: "string-value" }, D(arcadeResult.value));
|
|
3887
3851
|
case "number":
|
|
3888
3852
|
return h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
3889
3853
|
case "boolean":
|
|
@@ -3891,9 +3855,9 @@ function renderSimpleValue(arcadeResult) {
|
|
|
3891
3855
|
case "date":
|
|
3892
3856
|
return h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
3893
3857
|
case "dateOnly":
|
|
3894
|
-
return h("span", { class: "string-value" },
|
|
3858
|
+
return h("span", { class: "string-value" }, D(formatArcadeResultDateOnly(arcadeResult)));
|
|
3895
3859
|
case "time":
|
|
3896
|
-
return h("span", { class: "string-value" },
|
|
3860
|
+
return h("span", { class: "string-value" }, D(formatArcadeResultTimeOnly(arcadeResult)));
|
|
3897
3861
|
default:
|
|
3898
3862
|
return null;
|
|
3899
3863
|
}
|
|
@@ -3940,7 +3904,7 @@ const ArcgisArcadeResults = class {
|
|
|
3940
3904
|
await B(this, getAssetPath("./assets"));
|
|
3941
3905
|
}
|
|
3942
3906
|
disconnectedCallback() {
|
|
3943
|
-
|
|
3907
|
+
q(this);
|
|
3944
3908
|
}
|
|
3945
3909
|
// #endregion
|
|
3946
3910
|
//#region Private Methods
|
|
@@ -3967,18 +3931,18 @@ const ArcgisArcadeResults = class {
|
|
|
3967
3931
|
return h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
3968
3932
|
}
|
|
3969
3933
|
const iconClass = this.result?.type === "error" ? "color-error" : "color-success";
|
|
3970
|
-
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label:
|
|
3934
|
+
return (h("calcite-list", null, this.result ? (h(Fragment, null, h("calcite-list-item", { label: Z(this._t9nStrings?.lastexecutionformat, {
|
|
3971
3935
|
timeStamp: new Intl.DateTimeFormat(this._t9nLocale, {
|
|
3972
3936
|
dateStyle: "medium",
|
|
3973
3937
|
timeStyle: "medium"
|
|
3974
3938
|
}).format(this.result.timeStamp)
|
|
3975
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
3939
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: Z(this._t9nStrings?.compilationtimeformat, {
|
|
3976
3940
|
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
3977
3941
|
style: "unit",
|
|
3978
3942
|
unit: "millisecond",
|
|
3979
3943
|
maximumFractionDigits: 2
|
|
3980
3944
|
}).format(this.result.compilationTime ?? 0)
|
|
3981
|
-
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label:
|
|
3945
|
+
}) }, h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), h("calcite-list-item", { label: Z(this._t9nStrings?.executiontimeformat, {
|
|
3982
3946
|
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
3983
3947
|
style: "unit",
|
|
3984
3948
|
unit: "millisecond",
|
|
@@ -3995,7 +3959,7 @@ const ArcgisArcadeResults = class {
|
|
|
3995
3959
|
}
|
|
3996
3960
|
switch (this.result?.type) {
|
|
3997
3961
|
case "error":
|
|
3998
|
-
return (h("div", { class: "result-value-simple flex-adjustable" },
|
|
3962
|
+
return (h("div", { class: "result-value-simple flex-adjustable" }, Z(this._t9nStrings?.executionerrorformat, {
|
|
3999
3963
|
message: this.result.value
|
|
4000
3964
|
})));
|
|
4001
3965
|
case "null":
|
|
@@ -4032,7 +3996,7 @@ const ArcgisArcadeResults = class {
|
|
|
4032
3996
|
renderArrayHeader(arcadeResult) {
|
|
4033
3997
|
const items = arcadeResult.value ?? [];
|
|
4034
3998
|
const leftoverCount = Math.max(items.length - MaxArrayItems, 0);
|
|
4035
|
-
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0",
|
|
3999
|
+
return (h(Fragment, null, h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (h("span", null, "\u00A0", Z(this._t9nStrings?.showingfirstitemsformat, {
|
|
4036
4000
|
count: MaxArrayItems.toString()
|
|
4037
4001
|
}))) : null));
|
|
4038
4002
|
}
|
|
@@ -4078,7 +4042,7 @@ const ArcgisArcadeResults = class {
|
|
|
4078
4042
|
}
|
|
4079
4043
|
}
|
|
4080
4044
|
renderFeatureSetLabel(arcadeResult) {
|
|
4081
|
-
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0",
|
|
4045
|
+
return (h("div", { class: "value-type" }, h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (h("span", null, "\u00A0", Z(this._t9nStrings?.showingfirstitemsformat, {
|
|
4082
4046
|
count: BatchSize.toString()
|
|
4083
4047
|
}))) : null));
|
|
4084
4048
|
}
|
|
@@ -4107,10 +4071,10 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4107
4071
|
registerInstance(this, hostRef);
|
|
4108
4072
|
this.close = createEvent(this, "close", 3);
|
|
4109
4073
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
4110
|
-
|
|
4111
|
-
|
|
4074
|
+
this._updateFilterValue = (e) => {
|
|
4075
|
+
this._filterValue = e.target?.value ?? "";
|
|
4076
|
+
};
|
|
4112
4077
|
this._emitItemSelected = (e) => {
|
|
4113
|
-
// @ts-expect-error
|
|
4114
4078
|
const item = e.target?.["data-item"];
|
|
4115
4079
|
if (!item) {
|
|
4116
4080
|
return;
|
|
@@ -4122,7 +4086,6 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4122
4086
|
}
|
|
4123
4087
|
};
|
|
4124
4088
|
this._showSuggestionDetail = (e) => {
|
|
4125
|
-
// @ts-expect-error
|
|
4126
4089
|
const item = e.target?.["data-item"];
|
|
4127
4090
|
if (!item) {
|
|
4128
4091
|
return;
|
|
@@ -4130,8 +4093,12 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4130
4093
|
e.stopPropagation();
|
|
4131
4094
|
this._selectedSuggestion = item;
|
|
4132
4095
|
};
|
|
4133
|
-
this._emitClose = () =>
|
|
4134
|
-
|
|
4096
|
+
this._emitClose = () => {
|
|
4097
|
+
this.close.emit();
|
|
4098
|
+
};
|
|
4099
|
+
this._beforeBack = async () => {
|
|
4100
|
+
this._selectedSuggestion = undefined;
|
|
4101
|
+
};
|
|
4135
4102
|
this._lang = "";
|
|
4136
4103
|
this._t9nLocale = "";
|
|
4137
4104
|
this._t9nStrings = undefined;
|
|
@@ -4153,7 +4120,7 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4153
4120
|
disconnectedCallback() {
|
|
4154
4121
|
this._flowObserver?.disconnect();
|
|
4155
4122
|
this._themeChangedListner?.dispose();
|
|
4156
|
-
|
|
4123
|
+
q(this);
|
|
4157
4124
|
}
|
|
4158
4125
|
// #endregion
|
|
4159
4126
|
//#region Private Methods
|
|
@@ -4171,7 +4138,7 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4171
4138
|
// When switching between flow the same reference is reused
|
|
4172
4139
|
this._flowObserver = new MutationObserver(() => {
|
|
4173
4140
|
// Get the last panel and try to set focus on the input element
|
|
4174
|
-
|
|
4141
|
+
W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
4175
4142
|
});
|
|
4176
4143
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
4177
4144
|
}
|
|
@@ -4201,7 +4168,7 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4201
4168
|
return (h("calcite-flow-item", { heading: this._t9nStrings?.suggestions, closable: true, onCalciteFlowItemClose: this._emitClose, beforeBack: this._beforeBack }, h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", "icon-start": "code", scale: "s", onClick: this._emitItemSelected, ref: (e) => void e?.setFocus(), "data-item": suggestion }, this._t9nStrings?.insert), h("calcite-block", { open: true, heading: suggestion.label, description: suggestion.description }, h("div", { innerHTML: convertMarkdownString(suggestion.documentation) }), h("pre", null, h("code", { ref: (e) => e === undefined ? undefined : void colorizeCodeElement(e, suggestion.code).catch(console.error) })))));
|
|
4202
4169
|
}
|
|
4203
4170
|
render() {
|
|
4204
|
-
return (h(Host, null, h("style", null, this._colorizeStyle), h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { heading: this._t9nStrings?.suggestions, closable: true, onCalciteFlowItemClose: this._emitClose }, h(
|
|
4171
|
+
return (h(Host, null, h("style", null, this._colorizeStyle), h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { heading: this._t9nStrings?.suggestions, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), h("calcite-list", null, this.renderSuggestionGroups())), this.renderSuggestionFlowItem())));
|
|
4205
4172
|
}
|
|
4206
4173
|
static get assetsDirs() { return ["assets"]; }
|
|
4207
4174
|
get _hostElement() { return getElement(this); }
|
|
@@ -4213,21 +4180,30 @@ ArcgisArcadeSuggestions.style = arcadeSuggestionsCss;
|
|
|
4213
4180
|
|
|
4214
4181
|
const arcadeVariablesCss = ":host{background-color:var(--calcite-color-foreground-1)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .sticky{position:sticky;top:0px;z-index:10}:host calcite-flow{height:100%}";
|
|
4215
4182
|
|
|
4183
|
+
function stopEnterPropagation(e) {
|
|
4184
|
+
if (e.key === "Enter") {
|
|
4185
|
+
e.stopPropagation();
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4216
4188
|
const ArcgisArcadeVariables = class {
|
|
4217
4189
|
constructor(hostRef) {
|
|
4218
4190
|
registerInstance(this, hostRef);
|
|
4219
4191
|
this.close = createEvent(this, "close", 3);
|
|
4220
4192
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
4221
|
-
|
|
4222
|
-
|
|
4193
|
+
this._updateFilterValue = (e) => {
|
|
4194
|
+
this._filterValue = e.target.value;
|
|
4195
|
+
};
|
|
4223
4196
|
this._beforeBack = async () => {
|
|
4224
4197
|
this.removeLastPanelRenderer();
|
|
4225
4198
|
this._filterValue = "";
|
|
4226
4199
|
};
|
|
4227
|
-
this._emitClose = () =>
|
|
4228
|
-
|
|
4200
|
+
this._emitClose = () => {
|
|
4201
|
+
this.close.emit();
|
|
4202
|
+
};
|
|
4203
|
+
this._backToTop = () => {
|
|
4204
|
+
this._flowItemRenderers = [];
|
|
4205
|
+
};
|
|
4229
4206
|
this._emitItemSelected = (e) => {
|
|
4230
|
-
// @ts-expect-error
|
|
4231
4207
|
const variable = e.target?.["data-item"];
|
|
4232
4208
|
if (!variable || variable.nonInteractive) {
|
|
4233
4209
|
return;
|
|
@@ -4238,13 +4214,7 @@ const ArcgisArcadeVariables = class {
|
|
|
4238
4214
|
this.itemSelected.emit(variable.snippet);
|
|
4239
4215
|
}
|
|
4240
4216
|
};
|
|
4241
|
-
this._stopEnterPropagation = (e) => {
|
|
4242
|
-
if (e.key === "Enter") {
|
|
4243
|
-
e.stopPropagation();
|
|
4244
|
-
}
|
|
4245
|
-
};
|
|
4246
4217
|
this._showCollectionPanel = (e) => {
|
|
4247
|
-
// @ts-expect-error
|
|
4248
4218
|
const collectionVariable = e.target?.["data-item"];
|
|
4249
4219
|
if (!collectionVariable) {
|
|
4250
4220
|
return;
|
|
@@ -4270,7 +4240,7 @@ const ArcgisArcadeVariables = class {
|
|
|
4270
4240
|
await B(this, getAssetPath("./assets"));
|
|
4271
4241
|
}
|
|
4272
4242
|
disconnectedCallback() {
|
|
4273
|
-
|
|
4243
|
+
q(this);
|
|
4274
4244
|
this._flowObserver?.disconnect();
|
|
4275
4245
|
}
|
|
4276
4246
|
// #endregion
|
|
@@ -4295,7 +4265,7 @@ const ArcgisArcadeVariables = class {
|
|
|
4295
4265
|
// When switching between flow the same reference is reused
|
|
4296
4266
|
this._flowObserver = new MutationObserver(() => {
|
|
4297
4267
|
// Get the last panel and try to set focus on the input element
|
|
4298
|
-
|
|
4268
|
+
W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
4299
4269
|
});
|
|
4300
4270
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
4301
4271
|
}
|
|
@@ -4313,17 +4283,23 @@ const ArcgisArcadeVariables = class {
|
|
|
4313
4283
|
let loading = this.loading;
|
|
4314
4284
|
if (!loading && !collection.loaded) {
|
|
4315
4285
|
// Request to load and update mutation counter when done
|
|
4316
|
-
collection
|
|
4286
|
+
collection
|
|
4287
|
+
.loadSource()
|
|
4288
|
+
.then(() => setTimeout(() => {
|
|
4317
4289
|
this._mutationCounter += 1;
|
|
4318
|
-
}))
|
|
4290
|
+
}))
|
|
4291
|
+
.catch(() => {
|
|
4292
|
+
console.error("Error loading collection");
|
|
4293
|
+
loading = false;
|
|
4294
|
+
});
|
|
4319
4295
|
loading = true;
|
|
4320
4296
|
}
|
|
4321
|
-
return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h(
|
|
4297
|
+
return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
|
|
4322
4298
|
};
|
|
4323
4299
|
}
|
|
4324
4300
|
renderEditorVariables(collection) {
|
|
4325
4301
|
// Filter the variables. Skip group, we will filter the children later on.
|
|
4326
|
-
const filterExpression =
|
|
4302
|
+
const filterExpression = K(this._filterValue);
|
|
4327
4303
|
const filteredVariables = collection.variables.filter((variable) => variable.passFilter(filterExpression));
|
|
4328
4304
|
if (!filteredVariables.length) {
|
|
4329
4305
|
return h("div", { class: "notice-container" }, this._t9nStrings?.noitems ?? "No item");
|
|
@@ -4336,7 +4312,7 @@ const ArcgisArcadeVariables = class {
|
|
|
4336
4312
|
// Group is a collection but we represent it differently
|
|
4337
4313
|
return (h("calcite-list-item-group", { heading: variable.getLabel() }, this.renderEditorVariables(variable)));
|
|
4338
4314
|
default:
|
|
4339
|
-
return (h("calcite-list-item", { label: variable.getLabel(), description: variable.getDescription(), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": variable }, variable.isCollection ? (h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "", scale: "s", icon: "chevron-right", iconFlipRtl: true, onClick: this._showCollectionPanel, onKeyPress:
|
|
4315
|
+
return (h("calcite-list-item", { label: variable.getLabel(), description: variable.getDescription(), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": variable }, variable.isCollection ? (h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "", scale: "s", icon: "chevron-right", iconFlipRtl: true, onClick: this._showCollectionPanel, onKeyPress: stopEnterPropagation, "data-item": variable })) : null, variable.icon ? h("calcite-icon", { icon: variable.icon, scale: "s", slot: "content-start" }) : null));
|
|
4340
4316
|
}
|
|
4341
4317
|
}
|
|
4342
4318
|
render() {
|