@arcgis/coding-components 4.29.0-beta.113 → 4.29.0-beta.114
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/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-4088f191.js → p-104faef1.js} +1 -1
- package/dist/arcgis-coding-components/{p-1d1df020.js → p-11260ad2.js} +2 -2
- package/dist/arcgis-coding-components/{p-ed0acf1d.js → p-250c4b22.js} +2 -2
- package/dist/arcgis-coding-components/{p-8fa7b6b3.js → p-48890e35.js} +2 -2
- package/dist/arcgis-coding-components/{p-b7f6269a.js → p-784e3f96.js} +2 -2
- package/dist/arcgis-coding-components/p-7d2dfc64.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-b2b27bbe.js → p-85155f58.js} +2 -2
- package/dist/arcgis-coding-components/{p-4b7291cc.js → p-b2b0c44f.js} +1 -1
- package/dist/arcgis-coding-components/p-b500b786.js +6 -0
- package/dist/arcgis-coding-components/{p-e4fb8f11.js → p-c0c4fb2f.js} +11 -11
- package/dist/arcgis-coding-components/{p-e1eaafa9.js → p-da1cdcf4.js} +2 -2
- package/dist/arcgis-coding-components/{p-e530878b.js → p-de2d19d6.js} +2 -2
- package/dist/cjs/{arcade-defaults-4a549303.js → arcade-defaults-8ddd7bac.js} +25 -24
- package/dist/cjs/{arcade-mode-6c189663.js → arcade-mode-2524f6e6.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-b7198c84.js} +1 -1
- package/dist/cjs/{cssMode-245d6467.js → cssMode-9a63e99f.js} +3 -3
- package/dist/cjs/{html-2774c64f.js → html-015e78d7.js} +3 -3
- package/dist/cjs/{htmlMode-0606c7e3.js → htmlMode-a1e1ea15.js} +3 -3
- package/dist/cjs/{index-b518646d.js → index-f1ec1eca.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-6b11fc9d.js → javascript-f5ac3a3a.js} +4 -4
- package/dist/cjs/{jsonMode-11883f07.js → jsonMode-0b9bb979.js} +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{tsMode-4de8b5c1.js → tsMode-891b5e96.js} +3 -3
- package/dist/cjs/{typescript-96d879a2.js → typescript-fc10fc52.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 +1 -1
- 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-f71d29a1.js} +21 -21
- package/dist/esm/{arcade-mode-95cf5178.js → arcade-mode-4a6bbc9f.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-8fb92af1.js} +1 -1
- package/dist/esm/{cssMode-3fae4ab5.js → cssMode-7637a9c8.js} +3 -3
- package/dist/esm/{html-961458b7.js → html-0766032d.js} +3 -3
- package/dist/esm/{htmlMode-33dab68c.js → htmlMode-5caa8195.js} +3 -3
- package/dist/esm/{index-751e780b.js → index-b43ed451.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-996fdadb.js → javascript-561d79ed.js} +4 -4
- package/dist/esm/{jsonMode-d3634539.js → jsonMode-2e7d35c7.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{tsMode-e2bb6f87.js → tsMode-d3aced71.js} +3 -3
- package/dist/esm/{typescript-e9a34331.js → typescript-6be08b04.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,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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
9
|
-
require('./index-
|
|
8
|
+
const arcadeDefaults = require('./arcade-defaults-8ddd7bac.js');
|
|
9
|
+
require('./index-f1ec1eca.js');
|
|
10
10
|
|
|
11
11
|
/*!-----------------------------------------------------------------------------
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
9
|
-
require('./index-
|
|
8
|
+
const arcadeDefaults = require('./arcade-defaults-8ddd7bac.js');
|
|
9
|
+
require('./index-f1ec1eca.js');
|
|
10
10
|
|
|
11
11
|
/*!-----------------------------------------------------------------------------
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
11
|
-
require('./index-
|
|
10
|
+
const arcadeDefaults = require('./arcade-defaults-8ddd7bac.js');
|
|
11
|
+
require('./index-f1ec1eca.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const typescript = require('./typescript-
|
|
9
|
-
require('./arcade-defaults-
|
|
10
|
-
require('./index-
|
|
8
|
+
const typescript = require('./typescript-fc10fc52.js');
|
|
9
|
+
require('./arcade-defaults-8ddd7bac.js');
|
|
10
|
+
require('./index-f1ec1eca.js');
|
|
11
11
|
|
|
12
12
|
/*!-----------------------------------------------------------------------------
|
|
13
13
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
9
|
-
require('./index-
|
|
8
|
+
const arcadeDefaults = require('./arcade-defaults-8ddd7bac.js');
|
|
9
|
+
require('./index-f1ec1eca.js');
|
|
10
10
|
|
|
11
11
|
/*!-----------------------------------------------------------------------------
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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.114
|
|
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-f1ec1eca.js');
|
|
11
11
|
|
|
12
12
|
const defineCustomElements = (win, options) => {
|
|
13
13
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
9
|
-
require('./index-
|
|
8
|
+
const arcadeDefaults = require('./arcade-defaults-8ddd7bac.js');
|
|
9
|
+
require('./index-f1ec1eca.js');
|
|
10
10
|
|
|
11
11
|
/*!-----------------------------------------------------------------------------
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
const arcadeDefaults = require('./arcade-defaults-
|
|
9
|
-
require('./index-
|
|
8
|
+
const arcadeDefaults = require('./arcade-defaults-8ddd7bac.js');
|
|
9
|
+
require('./index-f1ec1eca.js');
|
|
10
10
|
|
|
11
11
|
/*!-----------------------------------------------------------------------------
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1,14 +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.114
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, a as colorizedAllCodeElements } from './markdown.js';
|
|
8
|
-
import { S as StickyFilterInput } from './functional-components.js';
|
|
9
8
|
import { f as filterCollection } from './utilities.js';
|
|
10
9
|
import { Uri } from 'monaco-editor';
|
|
11
|
-
import { B,
|
|
10
|
+
import { B, q, W, G } from './index2.js';
|
|
12
11
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
13
12
|
import { g as getArcadeWorker } from './arcade-contribution.js';
|
|
14
13
|
import '@esri/calcite-components/dist/components/calcite-list-item-group.js';
|
|
@@ -18,6 +17,7 @@ import '@esri/calcite-components/dist/components/calcite-flow-item.js';
|
|
|
18
17
|
import '@esri/calcite-components/dist/components/calcite-button.js';
|
|
19
18
|
import '@esri/calcite-components/dist/components/calcite-block.js';
|
|
20
19
|
import '@esri/calcite-components/dist/components/calcite-flow.js';
|
|
20
|
+
import '@esri/calcite-components/dist/components/calcite-input.js';
|
|
21
21
|
import '@esri/calcite-components/dist/components/calcite-loader.js';
|
|
22
22
|
import '@esri/calcite-components/dist/components/calcite-list.js';
|
|
23
23
|
|
|
@@ -31,7 +31,6 @@ const ArcgisArcadeApi = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeApi e
|
|
|
31
31
|
this.close = createEvent(this, "close", 3);
|
|
32
32
|
this.itemSelected = createEvent(this, "itemSelected", 3);
|
|
33
33
|
this._emitItemSelected = (e) => {
|
|
34
|
-
// @ts-expect-error
|
|
35
34
|
const item = e.target?.["data-item"];
|
|
36
35
|
if (!item) {
|
|
37
36
|
return;
|
|
@@ -50,8 +49,11 @@ const ArcgisArcadeApi = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeApi e
|
|
|
50
49
|
const keyEvent = e;
|
|
51
50
|
if (!keyEvent.key || keyEvent.key === "Enter") {
|
|
52
51
|
e.preventDefault();
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const item = e.target?.["data-item"];
|
|
53
|
+
if (!item) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.itemSelected.emit(item.completion.insertText);
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
59
|
this._selectItem = (e) => {
|
|
@@ -59,14 +61,14 @@ const ArcgisArcadeApi = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeApi e
|
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
e.stopPropagation();
|
|
62
|
-
|
|
63
|
-
this._selectedApiItem = e.target["data-item"];
|
|
64
|
+
this._selectedApiItem = e.target?.["data-item"];
|
|
64
65
|
};
|
|
65
66
|
this._unselectItem = async () => {
|
|
66
67
|
this._selectedApiItem = undefined;
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
this._updateFilterValue = (e) => {
|
|
70
|
+
this._filterValue = e.target?.value ?? "";
|
|
71
|
+
};
|
|
70
72
|
this._lang = "";
|
|
71
73
|
this._t9nLocale = "";
|
|
72
74
|
this._t9nStrings = undefined;
|
|
@@ -88,12 +90,12 @@ const ArcgisArcadeApi = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeApi e
|
|
|
88
90
|
if (!this.modelId || key !== Uri.parse(this.modelId).toString()) {
|
|
89
91
|
return;
|
|
90
92
|
}
|
|
91
|
-
this._updateApiLibrary();
|
|
93
|
+
this._updateApiLibrary().catch(console.error);
|
|
92
94
|
});
|
|
93
|
-
this._updateApiLibrary();
|
|
95
|
+
await this._updateApiLibrary();
|
|
94
96
|
}
|
|
95
97
|
disconnectedCallback() {
|
|
96
|
-
|
|
98
|
+
q(this);
|
|
97
99
|
this._flowObserver?.disconnect();
|
|
98
100
|
this._themeChangedListner?.dispose();
|
|
99
101
|
}
|
|
@@ -138,7 +140,7 @@ const ArcgisArcadeApi = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeApi e
|
|
|
138
140
|
// When switching between flow the same reference is reused
|
|
139
141
|
this._flowObserver = new MutationObserver(() => {
|
|
140
142
|
// Get the last panel and try to set focus on the input element
|
|
141
|
-
|
|
143
|
+
W(ref.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
142
144
|
});
|
|
143
145
|
this._flowObserver.observe(ref, { attributes: true, attributeFilter: ["id"], childList: true });
|
|
144
146
|
}
|
|
@@ -149,25 +151,25 @@ const ArcgisArcadeApi = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeApi e
|
|
|
149
151
|
if (!filteredApiItems.length) {
|
|
150
152
|
return null;
|
|
151
153
|
}
|
|
152
|
-
return (h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (h("calcite-list-item", { label:
|
|
154
|
+
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 }))))));
|
|
153
155
|
}
|
|
154
156
|
renderApiItemFlowItem() {
|
|
155
157
|
const apiItem = this._selectedApiItem;
|
|
156
158
|
if (!apiItem) {
|
|
157
159
|
return null;
|
|
158
160
|
}
|
|
159
|
-
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:
|
|
161
|
+
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) => {
|
|
160
162
|
if (!e) {
|
|
161
163
|
return;
|
|
162
164
|
}
|
|
163
165
|
e.innerHTML = convertMarkdownString(apiItem.examples);
|
|
164
|
-
colorizedAllCodeElements(e);
|
|
166
|
+
colorizedAllCodeElements(e).catch(console.error);
|
|
165
167
|
} })) : null)));
|
|
166
168
|
}
|
|
167
169
|
render() {
|
|
168
170
|
const categories = (this._apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
|
|
169
171
|
const empty = categories.every((g) => !g);
|
|
170
|
-
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(
|
|
172
|
+
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())));
|
|
171
173
|
}
|
|
172
174
|
static get assetsDirs() { return ["assets"]; }
|
|
173
175
|
get _hostElement() { return this; }
|
|
@@ -1,19 +1,20 @@
|
|
|
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.114
|
|
5
5
|
*/
|
|
6
6
|
import { languages } from 'monaco-editor';
|
|
7
7
|
import { b as arcadeDefaults } from './arcade-defaults.js';
|
|
8
8
|
import { a as importRequest } from './fields.js';
|
|
9
|
-
import {
|
|
9
|
+
import { i as ie, s as se } from './index2.js';
|
|
10
10
|
|
|
11
11
|
function isMonacoEnvironmentSetup() {
|
|
12
|
-
return !!
|
|
12
|
+
return !!window.MonacoEnvironment?.getWorkerUrl;
|
|
13
13
|
}
|
|
14
14
|
const additionalLanguageWorkersMap = new Map();
|
|
15
|
+
let _assetsPath = "";
|
|
15
16
|
function getAssetsPath() {
|
|
16
|
-
return
|
|
17
|
+
return _assetsPath;
|
|
17
18
|
}
|
|
18
19
|
function setupMonacoEnvironment(assetsPath) {
|
|
19
20
|
//
|
|
@@ -21,10 +22,10 @@ function setupMonacoEnvironment(assetsPath) {
|
|
|
21
22
|
if (isMonacoEnvironmentSetup()) {
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
25
|
+
_assetsPath = assetsPath;
|
|
24
26
|
// Since we are using workers, monaco needs to find them.
|
|
25
27
|
// Using the global MonacoEnvironment.
|
|
26
|
-
|
|
27
|
-
assetsPath,
|
|
28
|
+
window.MonacoEnvironment = {
|
|
28
29
|
getWorker: async (_, languageId) => {
|
|
29
30
|
// Manufacture the url for the web worker
|
|
30
31
|
let url = additionalLanguageWorkersMap.get(languageId) ?? `${assetsPath}/code-editor/editor.worker.js`;
|
|
@@ -47,7 +48,7 @@ function setupMonacoEnvironment(assetsPath) {
|
|
|
47
48
|
break;
|
|
48
49
|
}
|
|
49
50
|
// If we have a relative path or we are on same orgin, we can use the default js implementation
|
|
50
|
-
if (!
|
|
51
|
+
if (!ie(url) || se(url, globalThis.location.href, true)) {
|
|
51
52
|
return new Worker(url, { name: languageId });
|
|
52
53
|
}
|
|
53
54
|
// For cross orgin, we will load the worker code as a string and manufacture a blob
|
|
@@ -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.114
|
|
5
5
|
*/
|
|
6
6
|
import { Emitter, Uri } from 'monaco-editor';
|
|
7
7
|
import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
|
|
8
8
|
import { i as importLayersFeatureLayer, a as importRequest, s as supportedFields, n as newPortalPortalItem, b as newWebScene, c as newWebMap, f as fieldAlias, d as fieldTypeToIconName, e as fieldTypeToArcadeType } from './fields.js';
|
|
9
9
|
import { p as portalItemPageUrl } from './utilities.js';
|
|
10
|
-
import {
|
|
10
|
+
import { e as ee, t as te, G, Z, E, v } from './index2.js';
|
|
11
11
|
import { getAssetPath } from '@stencil/core/internal/client';
|
|
12
12
|
|
|
13
13
|
//#region core adapter fix
|
|
@@ -414,9 +414,9 @@ class ProfileItemBase {
|
|
|
414
414
|
// If the component is under RTL, the string is messed up.
|
|
415
415
|
// It is converted from $feature to feature$, This is not acceptable since the label
|
|
416
416
|
// represents a variable name. We are adding in front of the $ sign a right to left mark.
|
|
417
|
-
return
|
|
417
|
+
return G(this._label);
|
|
418
418
|
}
|
|
419
|
-
return
|
|
419
|
+
return Z(this._profile?.intlStrings[this._label.code], this._label.formatValues);
|
|
420
420
|
}
|
|
421
421
|
/**
|
|
422
422
|
* Returns the description string.
|
|
@@ -428,7 +428,7 @@ class ProfileItemBase {
|
|
|
428
428
|
if (typeof this.description === "string") {
|
|
429
429
|
return this.description;
|
|
430
430
|
}
|
|
431
|
-
return
|
|
431
|
+
return Z(this._profile?.intlStrings[this.description.code], this.description.formatValues);
|
|
432
432
|
}
|
|
433
433
|
/**
|
|
434
434
|
* Returns true if the item pass the filter test
|
|
@@ -669,7 +669,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
669
669
|
return this._profile?.intlStrings.layer ?? "layer";
|
|
670
670
|
}
|
|
671
671
|
async loadSource() {
|
|
672
|
-
if (
|
|
672
|
+
if (ee(this._loadPromise) && te(this._loadPromise)) {
|
|
673
673
|
return await this._loadPromise;
|
|
674
674
|
}
|
|
675
675
|
this._loadPromise = this._loadSource();
|
|
@@ -937,7 +937,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
937
937
|
nonInteractive: true
|
|
938
938
|
}, [new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })], { exposeRelationships: true, sourceTableId: source.layerId });
|
|
939
939
|
}));
|
|
940
|
-
relationshipsGroup.variables = relationshipItems.filter(
|
|
940
|
+
relationshipsGroup.variables = relationshipItems.filter(ee);
|
|
941
941
|
if (!relationshipsGroup.variables.length) {
|
|
942
942
|
return null;
|
|
943
943
|
}
|
|
@@ -1095,7 +1095,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1095
1095
|
return this._profile?.intlStrings.featureservice ?? "featureservice";
|
|
1096
1096
|
}
|
|
1097
1097
|
async loadSource() {
|
|
1098
|
-
if (
|
|
1098
|
+
if (ee(this._loadPromise) && te(this._loadPromise)) {
|
|
1099
1099
|
return await this._loadPromise;
|
|
1100
1100
|
}
|
|
1101
1101
|
this._loadPromise = this._loadSource();
|
|
@@ -1511,7 +1511,7 @@ class ArcadeLanguageServiceDefaults {
|
|
|
1511
1511
|
if (isPredefinedProfile(definition)) {
|
|
1512
1512
|
definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
1513
1513
|
}
|
|
1514
|
-
const intlStrings = await
|
|
1514
|
+
const intlStrings = await v(apiContext.locale, getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
1515
1515
|
if (!intlStrings) {
|
|
1516
1516
|
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
1517
1517
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
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.114
|
|
5
5
|
*/
|
|
6
6
|
import { editor, MarkerSeverity, Range, languages, Emitter } from 'monaco-editor';
|
|
7
7
|
import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat } from 'vscode-languageserver-types';
|
|
8
|
+
import { r as re } from './index2.js';
|
|
8
9
|
|
|
9
10
|
var j={False:"false",Null:"null",True:"true"},f={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},Fe=["++","--"],Qe=["-","+","!","~"],Ze=["=","/=","*=","%=","+=","-="],Xe=["||","&&"],Lt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var U=[[],[],[]];Fe.forEach(t=>U[t.length-1]?.push(t));Qe.forEach(t=>U[t.length-1]?.push(t));Xe.forEach(t=>U[t.length-1]?.push(t));Ze.forEach(t=>U[t.length-1]?.push(t));Lt.forEach(t=>U[t.length-1]?.push(t));var ht=Object.values(f),dt=Object.values(j);dt.map(t=>({label:t,kind:CompletionItemKind.Constant}));ht.map(t=>({label:t,kind:CompletionItemKind.Keyword}));
|
|
10
11
|
|
|
@@ -230,16 +231,13 @@ class DiagnosticsAdapter {
|
|
|
230
231
|
if (languageId !== this._languageId) {
|
|
231
232
|
return;
|
|
232
233
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}, 500);
|
|
241
|
-
}));
|
|
242
|
-
this._doValidate(model, languageId);
|
|
234
|
+
const debouncedValidate = re(() => {
|
|
235
|
+
this._doValidate(model, languageId).catch((err) => {
|
|
236
|
+
throw err;
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
this._listener.set(model.uri.toString(), model.onDidChangeContent(debouncedValidate));
|
|
240
|
+
this._doValidate(model, languageId).catch(console.error);
|
|
243
241
|
};
|
|
244
242
|
const onModelRemoved = (model) => {
|
|
245
243
|
const uriStr = model.uri.toString();
|
|
@@ -269,7 +267,7 @@ class DiagnosticsAdapter {
|
|
|
269
267
|
this._disposables.push(defaults.onModelContextDidChange((key) => {
|
|
270
268
|
editor.getModels().forEach((model) => {
|
|
271
269
|
if (model.getLanguageId() === this._languageId && model.uri.toString() === key) {
|
|
272
|
-
this._doValidate(model, this._languageId);
|
|
270
|
+
this._doValidate(model, this._languageId).catch(console.error);
|
|
273
271
|
}
|
|
274
272
|
});
|
|
275
273
|
}));
|