@arcgis/coding-components 5.1.0-next.0 → 5.1.0-next.10
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/cdn/{UNTQC5M2.js → 44MLHT3A.js} +1 -1
- package/dist/cdn/{5JKSRJZY.js → 7YLRIYVH.js} +1 -1
- package/dist/cdn/{3B6KNFHK.js → BQLG62QR.js} +4 -4
- package/dist/cdn/{KKQIZTTK.js → F7IHWMK7.js} +1 -1
- package/dist/cdn/{NZY7KXAF.js → H75CMJQP.js} +1 -1
- package/dist/cdn/{Z56TGOZF.js → HVHTW7TF.js} +2 -2
- package/dist/cdn/JS62T4I5.js +4 -0
- package/dist/cdn/{N2FN7LBN.js → K7O73D3Q.js} +1 -1
- package/dist/cdn/{3YWUK77P.js → L2AQ5FXC.js} +1 -1
- package/dist/cdn/{DEWLD2VE.js → NXNOBP7G.js} +1 -1
- package/dist/cdn/{EPMYM35I.js → OPWQ5CNY.js} +1 -1
- package/dist/cdn/{3FSDLLYC.js → QWLPT7LO.js} +1 -1
- package/dist/cdn/{BYO7RLJT.js → T7GEIGWF.js} +1 -1
- package/dist/cdn/{QXQAIN3R.js → TDEKR2LM.js} +1 -1
- package/dist/cdn/TDYUEEOH.js +2 -0
- package/dist/cdn/WNUR7N3L.js +6 -0
- package/dist/cdn/XEUCI6KC.js +2 -0
- package/dist/cdn/{D2RP5367.js → ZGBZ6BXY.js} +1 -1
- package/dist/cdn/assets/code-editor/arcade.worker.js +8 -0
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +2192 -2186
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/arcade-defaults.js +84 -84
- package/dist/chunks/arcade-mode.js +2 -2
- package/dist/chunks/language-defaults-base.js +3 -2
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +101 -96
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +5 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +72 -59
- package/dist/components/arcgis-arcade-results/customElement.js +13 -13
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/6QWZ6LSH.js +0 -2
- package/dist/cdn/ASVCAO4G.js +0 -4
- package/dist/cdn/MY63AUW2.js +0 -2
- package/dist/cdn/RXNRHK3U.js +0 -6
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{I as s,u as e}from"./EMMNZESW.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./
|
|
2
|
+
import{I as s,u as e}from"./EMMNZESW.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./JS62T4I5.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./TDYUEEOH.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./ZGBZ6BXY.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./44MLHT3A.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./K7O73D3Q.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./3C7TCPV5.js")],"arcgis-code-viewer":[()=>import("./OPWQ5CNY.js"),"language,round"],"arcgis-editor-variables":[()=>import("./DTZPALJA.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./H75CMJQP.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./TDEKR2LM.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
|
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { i as
|
|
3
|
-
import { supportedLocales as
|
|
4
|
-
import { g as
|
|
5
|
-
import { CompletionItemKind as
|
|
6
|
-
import { getDeclaredPixelMembers as
|
|
2
|
+
import { i as h, a as D, b as v, c as F, d as M, e as S, g as A, f as L, m as k, L as E, E as I } from "./language-defaults-base.js";
|
|
3
|
+
import { supportedLocales as C, fetchT9nStringsBundle as j } from "@arcgis/toolkit/intl";
|
|
4
|
+
import { g as P } from "./runtime.js";
|
|
5
|
+
import { CompletionItemKind as g, InsertTextFormat as p, InsertTextMode as f } from "vscode-languageserver-types";
|
|
6
|
+
import { getDeclaredPixelMembers as $ } from "@arcgis/core/applications/Components/arcadeEditorUtils.js";
|
|
7
7
|
import "@arcgis/toolkit/type";
|
|
8
|
-
async function
|
|
9
|
-
const { apiVersion:
|
|
10
|
-
return { apiVersion:
|
|
8
|
+
async function B(e) {
|
|
9
|
+
const { apiVersion: i, bundles: n, hiddenApiItems: r } = e.toEditorProfileDefinition(), t = await T(e.dictionaryVariables);
|
|
10
|
+
return { apiVersion: i, bundles: n, variables: t, hiddenApiItems: r?.map((s) => s.toLowerCase()) };
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
12
|
+
async function T(e, i = g.Variable) {
|
|
13
13
|
return await Promise.all(
|
|
14
14
|
e.map(async (n) => {
|
|
15
15
|
switch (n.type) {
|
|
16
16
|
case "dictionary":
|
|
17
|
-
return await
|
|
17
|
+
return await Q(n, i);
|
|
18
18
|
case "pixel":
|
|
19
|
-
return await
|
|
19
|
+
return await q(n, i);
|
|
20
20
|
// Voxel is equivalent to features in regards to the languageservice.
|
|
21
21
|
// They both have equivalent fields, but some voxel fields are different types (arrays)
|
|
22
22
|
// than what is reported in .fields, so in the sidebar we treat a bit differently.
|
|
23
23
|
// In autocomplete we don't differentiate types, so we can use the same logic as features.
|
|
24
24
|
case "voxel":
|
|
25
25
|
case "feature":
|
|
26
|
-
return await
|
|
26
|
+
return await _(n, i);
|
|
27
27
|
default:
|
|
28
|
-
return
|
|
28
|
+
return K(n, i);
|
|
29
29
|
}
|
|
30
30
|
})
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const { name: n, type:
|
|
33
|
+
function K(e, i) {
|
|
34
|
+
const { name: n, type: r } = e, t = e.getDescription(), s = i === g.Field ? A(n, !1) : n;
|
|
35
35
|
return {
|
|
36
36
|
name: n,
|
|
37
37
|
description: t,
|
|
38
|
-
type:
|
|
38
|
+
type: r,
|
|
39
39
|
completion: {
|
|
40
40
|
label: n,
|
|
41
41
|
detail: n,
|
|
42
|
-
insertText:
|
|
42
|
+
insertText: s,
|
|
43
43
|
insertTextMode: f.asIs,
|
|
44
44
|
insertTextFormat: p.PlainText,
|
|
45
|
-
kind:
|
|
45
|
+
kind: i,
|
|
46
46
|
documentation: { kind: "markdown", value: t }
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
51
|
-
const n = await e.loadSource(), { name:
|
|
52
|
-
label:
|
|
53
|
-
detail:
|
|
54
|
-
insertText:
|
|
50
|
+
async function _(e, i) {
|
|
51
|
+
const n = await e.loadSource(), { name: r } = e, t = e.getDescription(), s = {
|
|
52
|
+
label: r,
|
|
53
|
+
detail: r,
|
|
54
|
+
insertText: r,
|
|
55
55
|
insertTextMode: f.asIs,
|
|
56
56
|
insertTextFormat: p.PlainText,
|
|
57
|
-
kind:
|
|
57
|
+
kind: i
|
|
58
58
|
}, o = {
|
|
59
|
-
name:
|
|
59
|
+
name: r,
|
|
60
60
|
description: t,
|
|
61
61
|
type: "dictionary",
|
|
62
62
|
properties: [],
|
|
@@ -64,12 +64,12 @@ async function K(e, r) {
|
|
|
64
64
|
};
|
|
65
65
|
if (!n)
|
|
66
66
|
return o;
|
|
67
|
-
const [a, c] =
|
|
67
|
+
const [a, c] = L(n.fields, t, !0);
|
|
68
68
|
return o.properties = a, s.documentation = { kind: "markdown", value: c }, o;
|
|
69
69
|
}
|
|
70
|
-
async function
|
|
71
|
-
const n = await e.loadSource(),
|
|
72
|
-
if (
|
|
70
|
+
async function q(e, i) {
|
|
71
|
+
const n = await e.loadSource(), r = e.toProfileVariableDefinition();
|
|
72
|
+
if (r.type !== "pixel")
|
|
73
73
|
throw new Error("Incorrect definition passed to pixel variable");
|
|
74
74
|
const { name: t } = e, s = e.getDescription(), o = {
|
|
75
75
|
label: t,
|
|
@@ -77,7 +77,7 @@ async function _(e, r) {
|
|
|
77
77
|
insertText: t,
|
|
78
78
|
insertTextMode: f.asIs,
|
|
79
79
|
insertTextFormat: p.PlainText,
|
|
80
|
-
kind:
|
|
80
|
+
kind: i
|
|
81
81
|
}, a = {
|
|
82
82
|
name: t,
|
|
83
83
|
description: s,
|
|
@@ -85,13 +85,13 @@ async function _(e, r) {
|
|
|
85
85
|
properties: [],
|
|
86
86
|
completion: o
|
|
87
87
|
};
|
|
88
|
-
if (!n || !
|
|
88
|
+
if (!n || !r.definition)
|
|
89
89
|
return a;
|
|
90
|
-
const c = await
|
|
90
|
+
const c = await $(n), [d, l] = k(c, s);
|
|
91
91
|
return a.properties = d, o.documentation = { kind: "markdown", value: l }, a;
|
|
92
92
|
}
|
|
93
|
-
async function
|
|
94
|
-
const { name: n, dictionaryVariables:
|
|
93
|
+
async function Q(e, i) {
|
|
94
|
+
const { name: n, dictionaryVariables: r } = e, t = e.getDescription(), s = r.reduce((o, a) => {
|
|
95
95
|
o !== "" && (o += `
|
|
96
96
|
|
|
97
97
|
`), o += `**${a.name}**
|
|
@@ -104,45 +104,45 @@ ${c}`), o;
|
|
|
104
104
|
name: n,
|
|
105
105
|
description: t,
|
|
106
106
|
type: "dictionary",
|
|
107
|
-
properties: await
|
|
107
|
+
properties: await T(r, g.Field),
|
|
108
108
|
completion: {
|
|
109
109
|
label: n,
|
|
110
110
|
detail: n,
|
|
111
111
|
insertText: n,
|
|
112
112
|
insertTextMode: f.asIs,
|
|
113
113
|
insertTextFormat: p.PlainText,
|
|
114
|
-
kind:
|
|
114
|
+
kind: i,
|
|
115
115
|
documentation: { kind: "markdown", value: s }
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
async function y(e = "en") {
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
return
|
|
123
|
-
if (!
|
|
120
|
+
const i = x.get(e);
|
|
121
|
+
if (i)
|
|
122
|
+
return i;
|
|
123
|
+
if (!C.has(e))
|
|
124
124
|
return await y("en");
|
|
125
125
|
try {
|
|
126
|
-
const n = await fetch(
|
|
127
|
-
return n.ok ?
|
|
126
|
+
const n = await fetch(P(`./assets/arcade-language/profiles/arcade-profiles.t9n.${e}.json`));
|
|
127
|
+
return n.ok ? U(e, await n.json()) : e === "en" ? null : await y("en");
|
|
128
128
|
} catch {
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
const x = /* @__PURE__ */ new Map();
|
|
133
|
-
function
|
|
133
|
+
function U(e, i) {
|
|
134
134
|
const n = /* @__PURE__ */ new Map();
|
|
135
|
-
return
|
|
136
|
-
n.set(
|
|
135
|
+
return i.forEach((r) => {
|
|
136
|
+
n.set(r.id, r);
|
|
137
137
|
}), x.set(e, n), n;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
return (await y(
|
|
139
|
+
async function z(e, i = "en") {
|
|
140
|
+
return (await y(i))?.get(e) ?? null;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function G(e) {
|
|
143
143
|
return !!e && typeof e == "object" && "additionalVariables" in e && Array.isArray(e.additionalVariables);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function H(e) {
|
|
146
146
|
return e?.map(m);
|
|
147
147
|
}
|
|
148
148
|
function m(e) {
|
|
@@ -151,7 +151,7 @@ function m(e) {
|
|
|
151
151
|
return {
|
|
152
152
|
...e,
|
|
153
153
|
type: e.type,
|
|
154
|
-
properties:
|
|
154
|
+
properties: H(e.properties)
|
|
155
155
|
};
|
|
156
156
|
case "array":
|
|
157
157
|
return {
|
|
@@ -163,13 +163,13 @@ function m(e) {
|
|
|
163
163
|
return { ...e, type: e.type };
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
167
|
-
if (!
|
|
166
|
+
async function J(e, i = "en") {
|
|
167
|
+
if (!h(e))
|
|
168
168
|
return;
|
|
169
|
-
const n = await
|
|
169
|
+
const n = await z(e.id, i);
|
|
170
170
|
if (!n)
|
|
171
171
|
return;
|
|
172
|
-
const
|
|
172
|
+
const r = {
|
|
173
173
|
bundles: [...n.bundles],
|
|
174
174
|
variables: [],
|
|
175
175
|
hiddenApiItems: e.hiddenApiItems?.map((t) => t.toLowerCase())
|
|
@@ -180,7 +180,7 @@ async function H(e, r = "en") {
|
|
|
180
180
|
const s = e.definitions[t.name];
|
|
181
181
|
switch (t.type) {
|
|
182
182
|
case "dictionary":
|
|
183
|
-
return
|
|
183
|
+
return r.variables.push(
|
|
184
184
|
m({
|
|
185
185
|
...t,
|
|
186
186
|
type: t.type,
|
|
@@ -188,21 +188,21 @@ async function H(e, r = "en") {
|
|
|
188
188
|
})
|
|
189
189
|
);
|
|
190
190
|
case "feature":
|
|
191
|
-
return
|
|
191
|
+
return S(s) ? r.variables.push({ ...t, type: "feature", definition: s }) : void 0;
|
|
192
192
|
case "pixel":
|
|
193
|
-
return
|
|
193
|
+
return M(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
|
|
194
194
|
case "voxel":
|
|
195
|
-
return F(s) ?
|
|
195
|
+
return F(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
|
|
196
196
|
case "featureSet":
|
|
197
|
-
return v(s) ?
|
|
197
|
+
return v(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
|
|
198
198
|
case "featureSetCollection":
|
|
199
|
-
return D(s) ?
|
|
199
|
+
return D(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
|
|
200
200
|
default:
|
|
201
|
-
return
|
|
201
|
+
return r.variables.push(m(t));
|
|
202
202
|
}
|
|
203
|
-
}),
|
|
203
|
+
}), G(e) && r.variables.push(...e.additionalVariables ?? []), r;
|
|
204
204
|
}
|
|
205
|
-
const
|
|
205
|
+
const N = [
|
|
206
206
|
"catalog-footprint",
|
|
207
207
|
"catalog",
|
|
208
208
|
"csv",
|
|
@@ -214,16 +214,16 @@ const J = [
|
|
|
214
214
|
"subtype-sublayer",
|
|
215
215
|
"wfs"
|
|
216
216
|
];
|
|
217
|
-
function
|
|
218
|
-
return !!e && typeof e == "object" && "type" in e && typeof e.type == "string" &&
|
|
217
|
+
function O(e) {
|
|
218
|
+
return !!e && typeof e == "object" && "type" in e && typeof e.type == "string" && N.includes(e.type);
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const R = {
|
|
221
221
|
filterFsCollectionLayersFromMap: (e) => (
|
|
222
222
|
// only some layers are supported in arcade feature sets, one example: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/10715
|
|
223
|
-
|
|
223
|
+
O(e)
|
|
224
224
|
)
|
|
225
225
|
};
|
|
226
|
-
class
|
|
226
|
+
class W extends E {
|
|
227
227
|
/**
|
|
228
228
|
* Per-model update chaining to serialize profile updates.
|
|
229
229
|
*
|
|
@@ -254,28 +254,28 @@ class R extends k {
|
|
|
254
254
|
* @param locale The locale to use for the model context.
|
|
255
255
|
* @returns The EditorProfile for the model.
|
|
256
256
|
*/
|
|
257
|
-
async setProfileForModel(
|
|
258
|
-
const t = this._getApiKey(
|
|
259
|
-
const c = n, d =
|
|
260
|
-
|
|
261
|
-
|
|
257
|
+
async setProfileForModel(i, n, r = { locale: "en" }) {
|
|
258
|
+
const t = this._getApiKey(i), o = (this.#e.get(t) || Promise.resolve()).then(async () => {
|
|
259
|
+
const c = n, d = h(c) ? await J(c, r.locale) : c, l = await j(
|
|
260
|
+
r.locale,
|
|
261
|
+
P("./assets/editor-profile/t9n"),
|
|
262
262
|
"messages."
|
|
263
263
|
);
|
|
264
264
|
if (!l)
|
|
265
|
-
throw new Error(`Failed to load the language bundle for ${
|
|
266
|
-
this.disposeForModel(
|
|
267
|
-
const w = new
|
|
265
|
+
throw new Error(`Failed to load the language bundle for ${r.locale}`);
|
|
266
|
+
this.disposeForModel(i);
|
|
267
|
+
const w = new I(
|
|
268
268
|
d,
|
|
269
269
|
l,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
r.locale,
|
|
271
|
+
R
|
|
272
272
|
);
|
|
273
273
|
this._modelToProfileMap.set(t, w);
|
|
274
|
-
const b = await
|
|
275
|
-
this.updateApiContextForModel(
|
|
276
|
-
locale:
|
|
274
|
+
const b = await B(w);
|
|
275
|
+
this.updateApiContextForModel(i, {
|
|
276
|
+
locale: r.locale,
|
|
277
277
|
profile: b,
|
|
278
|
-
snippets:
|
|
278
|
+
snippets: r.snippets
|
|
279
279
|
});
|
|
280
280
|
}), a = o.finally(() => {
|
|
281
281
|
this.#e.get(t) === a && this.#e.delete(t);
|
|
@@ -283,11 +283,11 @@ class R extends k {
|
|
|
283
283
|
return this.#e.set(t, a), await o;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const u = new
|
|
286
|
+
const u = new W(), ne = {
|
|
287
287
|
setProfileForModel: u.setProfileForModel.bind(u),
|
|
288
288
|
getApiLibraryForModel: u.getApiLibraryForModel.bind(u)
|
|
289
289
|
};
|
|
290
290
|
export {
|
|
291
|
-
|
|
291
|
+
ne as a,
|
|
292
292
|
u as b
|
|
293
293
|
};
|
|
@@ -118,7 +118,7 @@ const F = [
|
|
|
118
118
|
{ include: "@whitespace" },
|
|
119
119
|
// regular expression: ensure it is terminated before beginning (otherwise it is an operator)
|
|
120
120
|
[
|
|
121
|
-
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(
|
|
121
|
+
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/u,
|
|
122
122
|
{ token: "regexp", bracket: "@open", next: "@regexp" }
|
|
123
123
|
],
|
|
124
124
|
// delimiters and operators
|
|
@@ -161,7 +161,7 @@ const F = [
|
|
|
161
161
|
// whitespace
|
|
162
162
|
{ include: "@whitespace" },
|
|
163
163
|
// from keyword
|
|
164
|
-
[/from/u, { token: "keyword", next: "@popall" }]
|
|
164
|
+
[/from(?=\s)/u, { token: "keyword", next: "@popall" }]
|
|
165
165
|
],
|
|
166
166
|
// State after `for` keyword: expects '('
|
|
167
167
|
forLoopInit: [
|