@arcgis/coding-components 4.29.0-beta.113 → 4.29.0-beta.115
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-1d1df020.js → p-6e8b9fe5.js} +2 -2
- package/dist/arcgis-coding-components/{p-e530878b.js → p-7a93bb3b.js} +2 -2
- package/dist/arcgis-coding-components/{p-4b7291cc.js → p-9cb71acd.js} +1 -1
- package/dist/arcgis-coding-components/p-a204229b.entry.js +6 -0
- package/dist/arcgis-coding-components/p-af7e61b6.js +6 -0
- package/dist/arcgis-coding-components/{p-4088f191.js → p-ba6773e0.js} +1 -1
- package/dist/arcgis-coding-components/{p-e1eaafa9.js → p-d8743a57.js} +2 -2
- package/dist/arcgis-coding-components/{p-ed0acf1d.js → p-d96dc356.js} +2 -2
- package/dist/arcgis-coding-components/{p-e4fb8f11.js → p-dfbc8c11.js} +11 -11
- package/dist/arcgis-coding-components/{p-8fa7b6b3.js → p-e67455ae.js} +2 -2
- package/dist/arcgis-coding-components/{p-b2b27bbe.js → p-e8238684.js} +2 -2
- package/dist/arcgis-coding-components/{p-b7f6269a.js → p-f71b9ff8.js} +2 -2
- package/dist/cjs/{arcade-defaults-4a549303.js → arcade-defaults-72ad69bb.js} +34 -30
- package/dist/cjs/{arcade-mode-6c189663.js → arcade-mode-d0e254e7.js} +11 -14
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +100 -135
- package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
- package/dist/cjs/{css-6f7dcd5a.js → css-7e80b850.js} +1 -1
- package/dist/cjs/{cssMode-245d6467.js → cssMode-acc88f93.js} +3 -3
- package/dist/cjs/{html-2774c64f.js → html-c634cfab.js} +3 -3
- package/dist/cjs/{htmlMode-0606c7e3.js → htmlMode-7446fade.js} +3 -3
- package/dist/cjs/{index-b518646d.js → index-135d850f.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-6b11fc9d.js → javascript-7de4f2e5.js} +4 -4
- package/dist/cjs/{jsonMode-11883f07.js → jsonMode-ba23faf1.js} +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{tsMode-4de8b5c1.js → tsMode-f95cf2a3.js} +3 -3
- package/dist/cjs/{typescript-96d879a2.js → typescript-fd97c5c9.js} +3 -3
- package/dist/components/arcade-api.js +20 -18
- package/dist/components/arcade-contribution.js +8 -7
- package/dist/components/arcade-defaults.js +9 -9
- package/dist/components/arcade-mode.js +10 -12
- package/dist/components/arcade-results.js +27 -81
- package/dist/components/arcade-suggestions.js +15 -12
- package/dist/components/arcade-variables.js +16 -10
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +16 -12
- 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 +10 -7
- 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-1e50716f.js → arcade-defaults-341d3ba2.js} +30 -27
- package/dist/esm/{arcade-mode-95cf5178.js → arcade-mode-c6b62779.js} +11 -14
- package/dist/esm/arcgis-arcade-api_6.entry.js +100 -135
- package/dist/esm/arcgis-coding-components.js +3 -3
- package/dist/esm/{css-e2349c2b.js → css-a5c8eae7.js} +1 -1
- package/dist/esm/{cssMode-3fae4ab5.js → cssMode-2775c361.js} +3 -3
- package/dist/esm/{html-961458b7.js → html-21177d74.js} +3 -3
- package/dist/esm/{htmlMode-33dab68c.js → htmlMode-f07e5f14.js} +3 -3
- package/dist/esm/{index-751e780b.js → index-17ee3129.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-996fdadb.js → javascript-e4b517d9.js} +4 -4
- package/dist/esm/{jsonMode-d3634539.js → jsonMode-ca5b2b48.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{tsMode-e2bb6f87.js → tsMode-fe489f62.js} +3 -3
- package/dist/esm/{typescript-e9a34331.js → typescript-2541a3e5.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/utils/arcade-monaco/arcade-contribution.d.ts +2 -2
- package/dist/types/utils/constants.d.ts +2 -2
- package/dist/types/utils/markdown.d.ts +3 -0
- package/package.json +8 -8
- package/dist/arcgis-coding-components/p-6c13dba0.entry.js +0 -6
- package/dist/arcgis-coding-components/p-d80df481.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,14 +1,14 @@
|
|
|
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-beta.
|
|
4
|
+
* v4.29.0-beta.115
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
|
-
const index = require('./index-
|
|
11
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
10
|
+
const index = require('./index-135d850f.js');
|
|
11
|
+
const arcadeDefaults = require('./arcade-defaults-72ad69bb.js');
|
|
12
12
|
|
|
13
13
|
async function colorizeCode(code) {
|
|
14
14
|
return await arcadeDefaults.editor.colorize(code, "arcade", { tabSize: 2 });
|
|
@@ -24,24 +24,23 @@ async function colorizeCodeElement(e, text) {
|
|
|
24
24
|
if (!e || e.tagName !== "CODE") {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
+
// eslint-disable-next-line require-atomic-updates
|
|
27
28
|
e.innerHTML = await colorizeCode(text ?? "");
|
|
28
29
|
}
|
|
29
30
|
function generateColorizeStyles() {
|
|
31
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
30
32
|
const themeService = arcadeDefaults.StandaloneServices.get(arcadeDefaults.IStandaloneThemeService);
|
|
31
33
|
const theme = themeService.getColorTheme();
|
|
32
34
|
return arcadeDefaults.generateTokensCSSForColorMap(theme.tokenTheme.getColorMap());
|
|
35
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
33
36
|
}
|
|
34
37
|
function onColorizeThemeChanged(func) {
|
|
38
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
35
39
|
const themeService = arcadeDefaults.StandaloneServices.get(arcadeDefaults.IStandaloneThemeService);
|
|
36
40
|
return themeService.onDidColorThemeChange(() => func());
|
|
41
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
37
42
|
}
|
|
38
43
|
|
|
39
|
-
const StickyFilterInput = ({ filterValue, ...rest }) => (
|
|
40
|
-
// TODO: Remove when calcite-input bug with scale is fixed
|
|
41
|
-
// @ts-expect-error
|
|
42
|
-
index.h("div", { class: "sticky", scale: "m" },
|
|
43
|
-
index.h("calcite-input", { value: filterValue, icon: "magnifying-glass", clearable: true, ...rest })));
|
|
44
|
-
|
|
45
44
|
var marked_umd = arcadeDefaults.createCommonjsModule(function (module, exports) {
|
|
46
45
|
/**
|
|
47
46
|
* marked v5.1.2 - a markdown parser
|
|
@@ -2919,6 +2918,7 @@ var marked_umd = arcadeDefaults.createCommonjsModule(function (module, exports)
|
|
|
2919
2918
|
}));
|
|
2920
2919
|
});
|
|
2921
2920
|
|
|
2921
|
+
// Set up the marked library to use GitHub Flavored Markdown and to use the custom renderer for links.
|
|
2922
2922
|
marked_umd.marked.use({
|
|
2923
2923
|
gfm: true,
|
|
2924
2924
|
renderer: {
|
|
@@ -2927,6 +2927,9 @@ marked_umd.marked.use({
|
|
|
2927
2927
|
}
|
|
2928
2928
|
}
|
|
2929
2929
|
});
|
|
2930
|
+
/**
|
|
2931
|
+
* Converts a markdown string to HTML using the marked library.
|
|
2932
|
+
*/
|
|
2930
2933
|
function convertMarkdownString(value) {
|
|
2931
2934
|
value ?? (value = "");
|
|
2932
2935
|
const result = marked_umd.marked(typeof value === "string" ? value : value.value, {
|
|
@@ -2939,11 +2942,12 @@ function convertMarkdownString(value) {
|
|
|
2939
2942
|
}
|
|
2940
2943
|
|
|
2941
2944
|
function isMonacoEnvironmentSetup() {
|
|
2942
|
-
return !!
|
|
2945
|
+
return !!window.MonacoEnvironment?.getWorkerUrl;
|
|
2943
2946
|
}
|
|
2944
2947
|
const additionalLanguageWorkersMap = new Map();
|
|
2948
|
+
let _assetsPath = "";
|
|
2945
2949
|
function getAssetsPath() {
|
|
2946
|
-
return
|
|
2950
|
+
return _assetsPath;
|
|
2947
2951
|
}
|
|
2948
2952
|
function setupMonacoEnvironment(assetsPath) {
|
|
2949
2953
|
//
|
|
@@ -2951,10 +2955,10 @@ function setupMonacoEnvironment(assetsPath) {
|
|
|
2951
2955
|
if (isMonacoEnvironmentSetup()) {
|
|
2952
2956
|
return;
|
|
2953
2957
|
}
|
|
2958
|
+
_assetsPath = assetsPath;
|
|
2954
2959
|
// Since we are using workers, monaco needs to find them.
|
|
2955
2960
|
// Using the global MonacoEnvironment.
|
|
2956
|
-
|
|
2957
|
-
assetsPath,
|
|
2961
|
+
window.MonacoEnvironment = {
|
|
2958
2962
|
getWorker: async (_, languageId) => {
|
|
2959
2963
|
// Manufacture the url for the web worker
|
|
2960
2964
|
let url = additionalLanguageWorkersMap.get(languageId) ?? `${assetsPath}/code-editor/editor.worker.js`;
|
|
@@ -2977,7 +2981,7 @@ function setupMonacoEnvironment(assetsPath) {
|
|
|
2977
2981
|
break;
|
|
2978
2982
|
}
|
|
2979
2983
|
// If we have a relative path or we are on same orgin, we can use the default js implementation
|
|
2980
|
-
if (!arcadeDefaults.
|
|
2984
|
+
if (!arcadeDefaults.ie(url) || arcadeDefaults.se(url, globalThis.location.href, true)) {
|
|
2981
2985
|
return new Worker(url, { name: languageId });
|
|
2982
2986
|
}
|
|
2983
2987
|
// For cross orgin, we will load the worker code as a string and manufacture a blob
|
|
@@ -3024,7 +3028,7 @@ async function getArcadeWorker(uri) {
|
|
|
3024
3028
|
* @returns mode for arcade
|
|
3025
3029
|
*/
|
|
3026
3030
|
async function getMode() {
|
|
3027
|
-
return await Promise.resolve().then(function () { return require('./arcade-mode-
|
|
3031
|
+
return await Promise.resolve().then(function () { return require('./arcade-mode-d0e254e7.js'); });
|
|
3028
3032
|
}
|
|
3029
3033
|
// Register the language in Monaco
|
|
3030
3034
|
arcadeDefaults.languages.register({
|
|
@@ -3056,7 +3060,6 @@ const ArcgisArcadeApi = class {
|
|
|
3056
3060
|
this.close = index.createEvent(this, "close", 3);
|
|
3057
3061
|
this.itemSelected = index.createEvent(this, "itemSelected", 3);
|
|
3058
3062
|
this._emitItemSelected = (e) => {
|
|
3059
|
-
// @ts-expect-error
|
|
3060
3063
|
const item = e.target?.["data-item"];
|
|
3061
3064
|
if (!item) {
|
|
3062
3065
|
return;
|
|
@@ -3075,8 +3078,11 @@ const ArcgisArcadeApi = class {
|
|
|
3075
3078
|
const keyEvent = e;
|
|
3076
3079
|
if (!keyEvent.key || keyEvent.key === "Enter") {
|
|
3077
3080
|
e.preventDefault();
|
|
3078
|
-
|
|
3079
|
-
|
|
3081
|
+
const item = e.target?.["data-item"];
|
|
3082
|
+
if (!item) {
|
|
3083
|
+
return;
|
|
3084
|
+
}
|
|
3085
|
+
this.itemSelected.emit(item.completion.insertText);
|
|
3080
3086
|
}
|
|
3081
3087
|
};
|
|
3082
3088
|
this._selectItem = (e) => {
|
|
@@ -3084,14 +3090,14 @@ const ArcgisArcadeApi = class {
|
|
|
3084
3090
|
return;
|
|
3085
3091
|
}
|
|
3086
3092
|
e.stopPropagation();
|
|
3087
|
-
|
|
3088
|
-
this._selectedApiItem = e.target["data-item"];
|
|
3093
|
+
this._selectedApiItem = e.target?.["data-item"];
|
|
3089
3094
|
};
|
|
3090
3095
|
this._unselectItem = async () => {
|
|
3091
3096
|
this._selectedApiItem = undefined;
|
|
3092
3097
|
};
|
|
3093
|
-
|
|
3094
|
-
|
|
3098
|
+
this._updateFilterValue = (e) => {
|
|
3099
|
+
this._filterValue = e.target?.value ?? "";
|
|
3100
|
+
};
|
|
3095
3101
|
this._lang = "";
|
|
3096
3102
|
this._t9nLocale = "";
|
|
3097
3103
|
this._t9nStrings = undefined;
|
|
@@ -3113,12 +3119,12 @@ const ArcgisArcadeApi = class {
|
|
|
3113
3119
|
if (!this.modelId || key !== arcadeDefaults.Uri.parse(this.modelId).toString()) {
|
|
3114
3120
|
return;
|
|
3115
3121
|
}
|
|
3116
|
-
this._updateApiLibrary();
|
|
3122
|
+
this._updateApiLibrary().catch(console.error);
|
|
3117
3123
|
});
|
|
3118
|
-
this._updateApiLibrary();
|
|
3124
|
+
await this._updateApiLibrary();
|
|
3119
3125
|
}
|
|
3120
3126
|
disconnectedCallback() {
|
|
3121
|
-
arcadeDefaults.
|
|
3127
|
+
arcadeDefaults.q(this);
|
|
3122
3128
|
this._flowObserver?.disconnect();
|
|
3123
3129
|
this._themeChangedListner?.dispose();
|
|
3124
3130
|
}
|
|
@@ -3163,7 +3169,7 @@ const ArcgisArcadeApi = class {
|
|
|
3163
3169
|
// When switching between flow the same reference is reused
|
|
3164
3170
|
this._flowObserver = new MutationObserver(() => {
|
|
3165
3171
|
// Get the last panel and try to set focus on the input element
|
|
3166
|
-
arcadeDefaults.
|
|
3172
|
+
arcadeDefaults.W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
3167
3173
|
});
|
|
3168
3174
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
3169
3175
|
}
|
|
@@ -3174,25 +3180,25 @@ const ArcgisArcadeApi = class {
|
|
|
3174
3180
|
if (!filteredApiItems.length) {
|
|
3175
3181
|
return null;
|
|
3176
3182
|
}
|
|
3177
|
-
return (index.h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (index.h("calcite-list-item", { label: arcadeDefaults.
|
|
3183
|
+
return (index.h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (index.h("calcite-list-item", { label: arcadeDefaults.G(apiItem.completion.detail), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": apiItem }, index.h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "Expand", icon: "chevron-right", iconFlipRtl: true, scale: "s", onClick: this._selectItem, "data-item": apiItem }))))));
|
|
3178
3184
|
}
|
|
3179
3185
|
renderApiItemFlowItem() {
|
|
3180
3186
|
const apiItem = this._selectedApiItem;
|
|
3181
3187
|
if (!apiItem) {
|
|
3182
3188
|
return null;
|
|
3183
3189
|
}
|
|
3184
|
-
return (index.h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, beforeBack: this._unselectItem, closable: true, onCalciteFlowItemClose: this._emitClose }, this.hideDocumentationActions ? null : (index.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)), index.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"), index.h("calcite-block", { open: true, heading: arcadeDefaults.
|
|
3190
|
+
return (index.h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, beforeBack: this._unselectItem, closable: true, onCalciteFlowItemClose: this._emitClose }, this.hideDocumentationActions ? null : (index.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)), index.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"), index.h("calcite-block", { open: true, heading: arcadeDefaults.G(apiItem.completion.detail) }, index.h("div", { innerHTML: convertMarkdownString(apiItem.completion.documentation) }), apiItem.examples ? (index.h("div", { ref: (e) => {
|
|
3185
3191
|
if (!e) {
|
|
3186
3192
|
return;
|
|
3187
3193
|
}
|
|
3188
3194
|
e.innerHTML = convertMarkdownString(apiItem.examples);
|
|
3189
|
-
colorizedAllCodeElements(e);
|
|
3195
|
+
colorizedAllCodeElements(e).catch(console.error);
|
|
3190
3196
|
} })) : null)));
|
|
3191
3197
|
}
|
|
3192
3198
|
render() {
|
|
3193
3199
|
const categories = (this._apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
|
|
3194
3200
|
const empty = categories.every((g) => !g);
|
|
3195
|
-
return (index.h(index.Host, null, index.h("style", null, this._colorizeStyle), index.h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, index.h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, index.h(
|
|
3201
|
+
return (index.h(index.Host, null, index.h("style", null, this._colorizeStyle), index.h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, index.h("calcite-flow-item", { heading: this._t9nStrings?.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this._preparingApi ? (index.h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (index.h("calcite-list", null, empty ? index.h("div", { class: "notice-container" }, this._t9nStrings?.noitems ?? "No items") : categories))), this.renderApiItemFlowItem())));
|
|
3196
3202
|
}
|
|
3197
3203
|
static get assetsDirs() { return ["assets"]; }
|
|
3198
3204
|
get _hostElement() { return index.getElement(this); }
|
|
@@ -3358,17 +3364,18 @@ function formatArcadeResultDateOnly(dateObject) {
|
|
|
3358
3364
|
function formatArcadeResultTimeOnly(dateObject) {
|
|
3359
3365
|
return dateObject.value.toString();
|
|
3360
3366
|
}
|
|
3361
|
-
async function
|
|
3362
|
-
|
|
3363
|
-
|
|
3367
|
+
async function convertScriptOutputToArcadeResult(scriptOutput, timeZone = "system") {
|
|
3368
|
+
const arcadeResult = valueToArcadeResult(scriptOutput);
|
|
3369
|
+
if (arcadeResult.type !== "featureSet") {
|
|
3370
|
+
return arcadeResult;
|
|
3364
3371
|
}
|
|
3365
3372
|
// Feature Set needs to be loaded
|
|
3366
|
-
await
|
|
3373
|
+
await arcadeResult.value.load();
|
|
3367
3374
|
// Create the first iterator
|
|
3368
|
-
|
|
3375
|
+
arcadeResult.iterator = arcadeResult.value.iterator({ aborted: false });
|
|
3369
3376
|
// Load the first batch of items
|
|
3370
|
-
|
|
3371
|
-
return
|
|
3377
|
+
arcadeResult.features = (await arcadeResult.iterator.nextBatchAsArcadeFeatures(BatchSize, timeZone)) ?? [];
|
|
3378
|
+
return arcadeResult;
|
|
3372
3379
|
}
|
|
3373
3380
|
async function executeScript(editorProfile, script, testContext, console) {
|
|
3374
3381
|
//
|
|
@@ -3396,12 +3403,12 @@ async function executeScript(editorProfile, script, testContext, console) {
|
|
|
3396
3403
|
// Execute the script
|
|
3397
3404
|
const scriptOutput = await executor.executeAsync(profileVariableInstances, executeContext);
|
|
3398
3405
|
// Convert script output to arcade result object and load data if necessary
|
|
3399
|
-
const
|
|
3406
|
+
const arcadeResult = await convertScriptOutputToArcadeResult(scriptOutput, timeZone);
|
|
3400
3407
|
// Timestamp and measure cost
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
return
|
|
3408
|
+
arcadeResult.timeStamp = timeStamp;
|
|
3409
|
+
arcadeResult.compilationTime = t1 - t0;
|
|
3410
|
+
arcadeResult.executionTime = performance.now() - t1;
|
|
3411
|
+
return arcadeResult;
|
|
3405
3412
|
//
|
|
3406
3413
|
}
|
|
3407
3414
|
catch (error) {
|
|
@@ -3511,9 +3518,13 @@ const ArcgisArcadeEditor = class {
|
|
|
3511
3518
|
this._executingScript = false;
|
|
3512
3519
|
})(), 0);
|
|
3513
3520
|
};
|
|
3514
|
-
this._toggleShowExecutionPanel = () =>
|
|
3515
|
-
|
|
3516
|
-
|
|
3521
|
+
this._toggleShowExecutionPanel = () => {
|
|
3522
|
+
this._showExecutionPanel = !this._showExecutionPanel;
|
|
3523
|
+
};
|
|
3524
|
+
this._toggleSideActionBarExpanded = () => {
|
|
3525
|
+
this.sideActionBarExpanded = !this.sideActionBarExpanded;
|
|
3526
|
+
};
|
|
3527
|
+
this._toggleSidePanel = (e) => {
|
|
3517
3528
|
if (!e.target) {
|
|
3518
3529
|
return;
|
|
3519
3530
|
}
|
|
@@ -3522,7 +3533,7 @@ const ArcgisArcadeEditor = class {
|
|
|
3522
3533
|
this.openedSidePanel = panelName === this.openedSidePanel ? "none" : panelName;
|
|
3523
3534
|
if (this.openedSidePanel === "none") {
|
|
3524
3535
|
// Reset focus on the code editor if no panel displayed
|
|
3525
|
-
|
|
3536
|
+
this._codeEditorElt?.setFocus().catch(console.error);
|
|
3526
3537
|
}
|
|
3527
3538
|
};
|
|
3528
3539
|
this._openArcadeHelp = () => void window.open(DevelopersWebSitePath, "Arcade Help");
|
|
@@ -3530,8 +3541,8 @@ const ArcgisArcadeEditor = class {
|
|
|
3530
3541
|
e.stopPropagation();
|
|
3531
3542
|
this.scriptChange.emit(e.detail);
|
|
3532
3543
|
};
|
|
3533
|
-
this._insertAsSnippet =
|
|
3534
|
-
this._insertAsText =
|
|
3544
|
+
this._insertAsSnippet = (e) => void this._codeEditorElt?.insertSnippet(e.detail).catch(console.error);
|
|
3545
|
+
this._insertAsText = (e) => void this._codeEditorElt?.insertText(e.detail).catch(console.error);
|
|
3535
3546
|
this._onResultPanelChange = (e) => void (this._resultPanel = e.detail);
|
|
3536
3547
|
this._onExecutionPanelClose = () => void (this._showExecutionPanel = false);
|
|
3537
3548
|
this._lang = "";
|
|
@@ -3678,7 +3689,7 @@ const ArcgisArcadeEditor = class {
|
|
|
3678
3689
|
await this._codeEditorElt?.setFocus();
|
|
3679
3690
|
}
|
|
3680
3691
|
disconnectedCallback() {
|
|
3681
|
-
arcadeDefaults.
|
|
3692
|
+
arcadeDefaults.q(this);
|
|
3682
3693
|
arcadeDefaults.arcadeDefaults.disposeApiContextForModel(this._modelId);
|
|
3683
3694
|
arcadeDefaults.arcadeDefaults.disposeEditorProfileForModel(this._modelId);
|
|
3684
3695
|
while (this._disposables.length) {
|
|
@@ -3776,11 +3787,11 @@ const ArcgisArcadeEditor = class {
|
|
|
3776
3787
|
}
|
|
3777
3788
|
switch (this.openedSidePanel) {
|
|
3778
3789
|
case "api":
|
|
3779
|
-
return (index.h("arcgis-arcade-api", { class: "side-panel flex-panel border-inline-start", modelId: this._modelId, hideDocumentationActions: this.hideDocumentationActions, onItemSelected:
|
|
3790
|
+
return (index.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" }));
|
|
3780
3791
|
case "variables":
|
|
3781
|
-
return (index.h("arcgis-arcade-variables", { class: "side-panel flex-panel border-inline-start", loading: this._preparingProfile, modelId: this._modelId, onItemSelected:
|
|
3792
|
+
return (index.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" }));
|
|
3782
3793
|
case "suggestions":
|
|
3783
|
-
return (index.h("arcgis-arcade-suggestions", { class: "side-panel flex-panel border-inline-start", suggestions: this.suggestions, onItemSelected:
|
|
3794
|
+
return (index.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" }));
|
|
3784
3795
|
default:
|
|
3785
3796
|
return null;
|
|
3786
3797
|
}
|
|
@@ -3808,61 +3819,6 @@ const ArcgisArcadeEditor = class {
|
|
|
3808
3819
|
};
|
|
3809
3820
|
ArcgisArcadeEditor.style = arcadeEditorCss;
|
|
3810
3821
|
|
|
3811
|
-
const indentSpecs = { char: " ", size: 2 };
|
|
3812
|
-
const indentType = new Array(indentSpecs.size + 1).join(indentSpecs.char);
|
|
3813
|
-
function createPushFunc(p) {
|
|
3814
|
-
return (substring) => `\\${p.push(substring)}\\`;
|
|
3815
|
-
}
|
|
3816
|
-
function createPopFunc(p) {
|
|
3817
|
-
return (_, offset) => p[offset - 1] ?? "";
|
|
3818
|
-
}
|
|
3819
|
-
function indent(index, indentType) {
|
|
3820
|
-
return new Array(index + 1).join(indentType);
|
|
3821
|
-
}
|
|
3822
|
-
function jsonFormat(json) {
|
|
3823
|
-
// Convert to string and extract backslashes and strings
|
|
3824
|
-
const p = [];
|
|
3825
|
-
const pushFunc = createPushFunc(p);
|
|
3826
|
-
const jsonString = JSON.stringify(json)
|
|
3827
|
-
.replace(/\\./gu, pushFunc)
|
|
3828
|
-
.replace(/(".*?"|'.*?')/gu, pushFunc)
|
|
3829
|
-
.replace(/\s+/u, "");
|
|
3830
|
-
// Indent and insert newlines
|
|
3831
|
-
let indentIndex = 0;
|
|
3832
|
-
let out = "";
|
|
3833
|
-
for (let i = 0; i < jsonString.length; i++) {
|
|
3834
|
-
const c = jsonString.charAt(i);
|
|
3835
|
-
switch (c) {
|
|
3836
|
-
case "{":
|
|
3837
|
-
case "[":
|
|
3838
|
-
indentIndex += 1;
|
|
3839
|
-
out += `${c}\n${indent(indentIndex, indentType)}`;
|
|
3840
|
-
break;
|
|
3841
|
-
case "}":
|
|
3842
|
-
case "]":
|
|
3843
|
-
indentIndex -= 1;
|
|
3844
|
-
out += `\n${indent(indentIndex, indentType)}${c}`;
|
|
3845
|
-
break;
|
|
3846
|
-
case ",":
|
|
3847
|
-
out += `,\n${indent(indentIndex, indentType)}`;
|
|
3848
|
-
break;
|
|
3849
|
-
case ":":
|
|
3850
|
-
out += ": ";
|
|
3851
|
-
break;
|
|
3852
|
-
default:
|
|
3853
|
-
out += c;
|
|
3854
|
-
break;
|
|
3855
|
-
}
|
|
3856
|
-
}
|
|
3857
|
-
// Strip whitespace from numeric arrays and put backslashes
|
|
3858
|
-
// and strings back in
|
|
3859
|
-
const popFunc = createPopFunc(p);
|
|
3860
|
-
return out
|
|
3861
|
-
.replace(/\[[\d,\s]+?\]/gu, (m) => m.replace(/\s/gu, ""))
|
|
3862
|
-
.replace(/\\(\d+)\\/gu, popFunc) // strings
|
|
3863
|
-
.replace(/\\(\d+)\\/gu, popFunc); // backslashes in strings
|
|
3864
|
-
}
|
|
3865
|
-
|
|
3866
3822
|
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)}";
|
|
3867
3823
|
|
|
3868
3824
|
//#region Specialized Constants
|
|
@@ -3884,10 +3840,10 @@ function renderDictionaryProperty(key) {
|
|
|
3884
3840
|
return (index.h(index.Fragment, null, index.h("span", { class: "dictionary-property" }, key), index.h("span", null, ":\u00A0")));
|
|
3885
3841
|
}
|
|
3886
3842
|
function renderDictionaryAsJsonTree(value, subtree = false) {
|
|
3887
|
-
return (index.h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, index.h("calcite-tree-item", { class: "string-value" },
|
|
3843
|
+
return (index.h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, index.h("calcite-tree-item", { class: "string-value" }, JSON.stringify(value.castAsJson(), undefined, 2))));
|
|
3888
3844
|
}
|
|
3889
3845
|
function renderGeometryTree(value, subtree = false) {
|
|
3890
|
-
return (index.h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, index.h("calcite-tree-item", null, index.h("div", { class: "tree-item-label" }, renderDictionaryProperty("type"), value.type)), index.h("calcite-tree-item", null, index.h("div", { class: "tree-item-label" }, renderDictionaryProperty("value"), index.h("span", { class: "string-value" },
|
|
3846
|
+
return (index.h("calcite-tree", { slot: subtree ? "children" : undefined, ...treeProps }, index.h("calcite-tree-item", null, index.h("div", { class: "tree-item-label" }, renderDictionaryProperty("type"), value.type)), index.h("calcite-tree-item", null, index.h("div", { class: "tree-item-label" }, renderDictionaryProperty("value"), index.h("span", { class: "string-value" }, JSON.stringify(value, undefined, 2))))));
|
|
3891
3847
|
}
|
|
3892
3848
|
function renderSimpleValue(arcadeResult) {
|
|
3893
3849
|
switch (arcadeResult.type) {
|
|
@@ -3895,7 +3851,7 @@ function renderSimpleValue(arcadeResult) {
|
|
|
3895
3851
|
case "null":
|
|
3896
3852
|
return index.h("span", { class: "constant-value" }, arcadeResult.type);
|
|
3897
3853
|
case "text":
|
|
3898
|
-
return index.h("span", { class: "string-value" }, arcadeDefaults.
|
|
3854
|
+
return index.h("span", { class: "string-value" }, arcadeDefaults.D(arcadeResult.value));
|
|
3899
3855
|
case "number":
|
|
3900
3856
|
return index.h("span", { class: "number-value" }, arcadeResult.value.toString());
|
|
3901
3857
|
case "boolean":
|
|
@@ -3903,9 +3859,9 @@ function renderSimpleValue(arcadeResult) {
|
|
|
3903
3859
|
case "date":
|
|
3904
3860
|
return index.h("span", { class: "date-value" }, formatArcadeResultDate(arcadeResult));
|
|
3905
3861
|
case "dateOnly":
|
|
3906
|
-
return index.h("span", { class: "string-value" }, arcadeDefaults.
|
|
3862
|
+
return index.h("span", { class: "string-value" }, arcadeDefaults.D(formatArcadeResultDateOnly(arcadeResult)));
|
|
3907
3863
|
case "time":
|
|
3908
|
-
return index.h("span", { class: "string-value" }, arcadeDefaults.
|
|
3864
|
+
return index.h("span", { class: "string-value" }, arcadeDefaults.D(formatArcadeResultTimeOnly(arcadeResult)));
|
|
3909
3865
|
default:
|
|
3910
3866
|
return null;
|
|
3911
3867
|
}
|
|
@@ -3952,7 +3908,7 @@ const ArcgisArcadeResults = class {
|
|
|
3952
3908
|
await arcadeDefaults.B(this, index.getAssetPath("./assets"));
|
|
3953
3909
|
}
|
|
3954
3910
|
disconnectedCallback() {
|
|
3955
|
-
arcadeDefaults.
|
|
3911
|
+
arcadeDefaults.q(this);
|
|
3956
3912
|
}
|
|
3957
3913
|
// #endregion
|
|
3958
3914
|
//#region Private Methods
|
|
@@ -3979,18 +3935,18 @@ const ArcgisArcadeResults = class {
|
|
|
3979
3935
|
return index.h("calcite-loader", { scale: "s", type: "indeterminate", label: "" });
|
|
3980
3936
|
}
|
|
3981
3937
|
const iconClass = this.result?.type === "error" ? "color-error" : "color-success";
|
|
3982
|
-
return (index.h("calcite-list", null, this.result ? (index.h(index.Fragment, null, index.h("calcite-list-item", { label: arcadeDefaults.
|
|
3938
|
+
return (index.h("calcite-list", null, this.result ? (index.h(index.Fragment, null, index.h("calcite-list-item", { label: arcadeDefaults.Z(this._t9nStrings?.lastexecutionformat, {
|
|
3983
3939
|
timeStamp: new Intl.DateTimeFormat(this._t9nLocale, {
|
|
3984
3940
|
dateStyle: "medium",
|
|
3985
3941
|
timeStyle: "medium"
|
|
3986
3942
|
}).format(this.result.timeStamp)
|
|
3987
|
-
}) }, index.h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), index.h("calcite-list-item", { label: arcadeDefaults.
|
|
3943
|
+
}) }, index.h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), index.h("calcite-list-item", { label: arcadeDefaults.Z(this._t9nStrings?.compilationtimeformat, {
|
|
3988
3944
|
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
3989
3945
|
style: "unit",
|
|
3990
3946
|
unit: "millisecond",
|
|
3991
3947
|
maximumFractionDigits: 2
|
|
3992
3948
|
}).format(this.result.compilationTime ?? 0)
|
|
3993
|
-
}) }, index.h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), index.h("calcite-list-item", { label: arcadeDefaults.
|
|
3949
|
+
}) }, index.h("calcite-icon", { slot: "content-start", icon: "information", scale: "s", class: iconClass })), index.h("calcite-list-item", { label: arcadeDefaults.Z(this._t9nStrings?.executiontimeformat, {
|
|
3994
3950
|
time: new Intl.NumberFormat(this._t9nLocale, {
|
|
3995
3951
|
style: "unit",
|
|
3996
3952
|
unit: "millisecond",
|
|
@@ -4007,7 +3963,7 @@ const ArcgisArcadeResults = class {
|
|
|
4007
3963
|
}
|
|
4008
3964
|
switch (this.result?.type) {
|
|
4009
3965
|
case "error":
|
|
4010
|
-
return (index.h("div", { class: "result-value-simple flex-adjustable" }, arcadeDefaults.
|
|
3966
|
+
return (index.h("div", { class: "result-value-simple flex-adjustable" }, arcadeDefaults.Z(this._t9nStrings?.executionerrorformat, {
|
|
4011
3967
|
message: this.result.value
|
|
4012
3968
|
})));
|
|
4013
3969
|
case "null":
|
|
@@ -4044,7 +4000,7 @@ const ArcgisArcadeResults = class {
|
|
|
4044
4000
|
renderArrayHeader(arcadeResult) {
|
|
4045
4001
|
const items = arcadeResult.value ?? [];
|
|
4046
4002
|
const leftoverCount = Math.max(items.length - MaxArrayItems, 0);
|
|
4047
|
-
return (index.h(index.Fragment, null, index.h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (index.h("span", null, "\u00A0", arcadeDefaults.
|
|
4003
|
+
return (index.h(index.Fragment, null, index.h("span", null, `${arcadeResult.type}(${items.length ?? 0})`), leftoverCount > 0 ? (index.h("span", null, "\u00A0", arcadeDefaults.Z(this._t9nStrings?.showingfirstitemsformat, {
|
|
4048
4004
|
count: MaxArrayItems.toString()
|
|
4049
4005
|
}))) : null));
|
|
4050
4006
|
}
|
|
@@ -4090,7 +4046,7 @@ const ArcgisArcadeResults = class {
|
|
|
4090
4046
|
}
|
|
4091
4047
|
}
|
|
4092
4048
|
renderFeatureSetLabel(arcadeResult) {
|
|
4093
|
-
return (index.h("div", { class: "value-type" }, index.h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (index.h("span", null, "\u00A0", arcadeDefaults.
|
|
4049
|
+
return (index.h("div", { class: "value-type" }, index.h("span", null, arcadeResult.type, ":"), arcadeResult.features.length >= BatchSize ? (index.h("span", null, "\u00A0", arcadeDefaults.Z(this._t9nStrings?.showingfirstitemsformat, {
|
|
4094
4050
|
count: BatchSize.toString()
|
|
4095
4051
|
}))) : null));
|
|
4096
4052
|
}
|
|
@@ -4119,10 +4075,10 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4119
4075
|
index.registerInstance(this, hostRef);
|
|
4120
4076
|
this.close = index.createEvent(this, "close", 3);
|
|
4121
4077
|
this.itemSelected = index.createEvent(this, "itemSelected", 3);
|
|
4122
|
-
|
|
4123
|
-
|
|
4078
|
+
this._updateFilterValue = (e) => {
|
|
4079
|
+
this._filterValue = e.target?.value ?? "";
|
|
4080
|
+
};
|
|
4124
4081
|
this._emitItemSelected = (e) => {
|
|
4125
|
-
// @ts-expect-error
|
|
4126
4082
|
const item = e.target?.["data-item"];
|
|
4127
4083
|
if (!item) {
|
|
4128
4084
|
return;
|
|
@@ -4134,7 +4090,6 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4134
4090
|
}
|
|
4135
4091
|
};
|
|
4136
4092
|
this._showSuggestionDetail = (e) => {
|
|
4137
|
-
// @ts-expect-error
|
|
4138
4093
|
const item = e.target?.["data-item"];
|
|
4139
4094
|
if (!item) {
|
|
4140
4095
|
return;
|
|
@@ -4142,8 +4097,12 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4142
4097
|
e.stopPropagation();
|
|
4143
4098
|
this._selectedSuggestion = item;
|
|
4144
4099
|
};
|
|
4145
|
-
this._emitClose = () =>
|
|
4146
|
-
|
|
4100
|
+
this._emitClose = () => {
|
|
4101
|
+
this.close.emit();
|
|
4102
|
+
};
|
|
4103
|
+
this._beforeBack = async () => {
|
|
4104
|
+
this._selectedSuggestion = undefined;
|
|
4105
|
+
};
|
|
4147
4106
|
this._lang = "";
|
|
4148
4107
|
this._t9nLocale = "";
|
|
4149
4108
|
this._t9nStrings = undefined;
|
|
@@ -4165,7 +4124,7 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4165
4124
|
disconnectedCallback() {
|
|
4166
4125
|
this._flowObserver?.disconnect();
|
|
4167
4126
|
this._themeChangedListner?.dispose();
|
|
4168
|
-
arcadeDefaults.
|
|
4127
|
+
arcadeDefaults.q(this);
|
|
4169
4128
|
}
|
|
4170
4129
|
// #endregion
|
|
4171
4130
|
//#region Private Methods
|
|
@@ -4183,7 +4142,7 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4183
4142
|
// When switching between flow the same reference is reused
|
|
4184
4143
|
this._flowObserver = new MutationObserver(() => {
|
|
4185
4144
|
// Get the last panel and try to set focus on the input element
|
|
4186
|
-
arcadeDefaults.
|
|
4145
|
+
arcadeDefaults.W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
4187
4146
|
});
|
|
4188
4147
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
4189
4148
|
}
|
|
@@ -4213,7 +4172,7 @@ const ArcgisArcadeSuggestions = class {
|
|
|
4213
4172
|
return (index.h("calcite-flow-item", { heading: this._t9nStrings?.suggestions, closable: true, onCalciteFlowItemClose: this._emitClose, beforeBack: this._beforeBack }, index.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), index.h("calcite-block", { open: true, heading: suggestion.label, description: suggestion.description }, index.h("div", { innerHTML: convertMarkdownString(suggestion.documentation) }), index.h("pre", null, index.h("code", { ref: (e) => e === undefined ? undefined : void colorizeCodeElement(e, suggestion.code).catch(console.error) })))));
|
|
4214
4173
|
}
|
|
4215
4174
|
render() {
|
|
4216
|
-
return (index.h(index.Host, null, index.h("style", null, this._colorizeStyle), index.h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, index.h("calcite-flow-item", { heading: this._t9nStrings?.suggestions, closable: true, onCalciteFlowItemClose: this._emitClose }, index.h(
|
|
4175
|
+
return (index.h(index.Host, null, index.h("style", null, this._colorizeStyle), index.h("calcite-flow", { ref: (ref) => this.flowFocusHandler(ref) }, index.h("calcite-flow-item", { heading: this._t9nStrings?.suggestions, closable: true, onCalciteFlowItemClose: this._emitClose }, index.h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), index.h("calcite-list", null, this.renderSuggestionGroups())), this.renderSuggestionFlowItem())));
|
|
4217
4176
|
}
|
|
4218
4177
|
static get assetsDirs() { return ["assets"]; }
|
|
4219
4178
|
get _hostElement() { return index.getElement(this); }
|
|
@@ -4235,13 +4194,19 @@ const ArcgisArcadeVariables = class {
|
|
|
4235
4194
|
index.registerInstance(this, hostRef);
|
|
4236
4195
|
this.close = index.createEvent(this, "close", 3);
|
|
4237
4196
|
this.itemSelected = index.createEvent(this, "itemSelected", 3);
|
|
4238
|
-
this._updateFilterValue = (e) =>
|
|
4197
|
+
this._updateFilterValue = (e) => {
|
|
4198
|
+
this._filterValue = e.target.value;
|
|
4199
|
+
};
|
|
4239
4200
|
this._beforeBack = async () => {
|
|
4240
4201
|
this.removeLastPanelRenderer();
|
|
4241
4202
|
this._filterValue = "";
|
|
4242
4203
|
};
|
|
4243
|
-
this._emitClose = () =>
|
|
4244
|
-
|
|
4204
|
+
this._emitClose = () => {
|
|
4205
|
+
this.close.emit();
|
|
4206
|
+
};
|
|
4207
|
+
this._backToTop = () => {
|
|
4208
|
+
this._flowItemRenderers = [];
|
|
4209
|
+
};
|
|
4245
4210
|
this._emitItemSelected = (e) => {
|
|
4246
4211
|
const variable = e.target?.["data-item"];
|
|
4247
4212
|
if (!variable || variable.nonInteractive) {
|
|
@@ -4279,7 +4244,7 @@ const ArcgisArcadeVariables = class {
|
|
|
4279
4244
|
await arcadeDefaults.B(this, index.getAssetPath("./assets"));
|
|
4280
4245
|
}
|
|
4281
4246
|
disconnectedCallback() {
|
|
4282
|
-
arcadeDefaults.
|
|
4247
|
+
arcadeDefaults.q(this);
|
|
4283
4248
|
this._flowObserver?.disconnect();
|
|
4284
4249
|
}
|
|
4285
4250
|
// #endregion
|
|
@@ -4304,7 +4269,7 @@ const ArcgisArcadeVariables = class {
|
|
|
4304
4269
|
// When switching between flow the same reference is reused
|
|
4305
4270
|
this._flowObserver = new MutationObserver(() => {
|
|
4306
4271
|
// Get the last panel and try to set focus on the input element
|
|
4307
|
-
arcadeDefaults.
|
|
4272
|
+
arcadeDefaults.W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
4308
4273
|
});
|
|
4309
4274
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
4310
4275
|
}
|
|
@@ -4333,12 +4298,12 @@ const ArcgisArcadeVariables = class {
|
|
|
4333
4298
|
});
|
|
4334
4299
|
loading = true;
|
|
4335
4300
|
}
|
|
4336
|
-
return (index.h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, index.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 }), index.h(
|
|
4301
|
+
return (index.h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, index.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 }), index.h("calcite-input", { value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), loading ? (index.h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (index.h("calcite-list", null, this.renderEditorVariables(collection)))));
|
|
4337
4302
|
};
|
|
4338
4303
|
}
|
|
4339
4304
|
renderEditorVariables(collection) {
|
|
4340
4305
|
// Filter the variables. Skip group, we will filter the children later on.
|
|
4341
|
-
const filterExpression = arcadeDefaults.
|
|
4306
|
+
const filterExpression = arcadeDefaults.K(this._filterValue);
|
|
4342
4307
|
const filteredVariables = collection.variables.filter((variable) => variable.passFilter(filterExpression));
|
|
4343
4308
|
if (!filteredVariables.length) {
|
|
4344
4309
|
return index.h("div", { class: "notice-container" }, this._t9nStrings?.noitems ?? "No item");
|
|
@@ -1,13 +1,13 @@
|
|
|
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-beta.
|
|
4
|
+
* v4.29.0-beta.115
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
|
-
const index = require('./index-
|
|
10
|
+
const index = require('./index-135d850f.js');
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -1,12 +1,12 @@
|
|
|
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-beta.
|
|
4
|
+
* v4.29.0-beta.115
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
9
|
-
require('./index-
|
|
8
|
+
const arcadeDefaults = require('./arcade-defaults-72ad69bb.js');
|
|
9
|
+
require('./index-135d850f.js');
|
|
10
10
|
|
|
11
11
|
/*!-----------------------------------------------------------------------------
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|