@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.
Files changed (37) hide show
  1. package/dist/cdn/{UNTQC5M2.js → 44MLHT3A.js} +1 -1
  2. package/dist/cdn/{5JKSRJZY.js → 7YLRIYVH.js} +1 -1
  3. package/dist/cdn/{3B6KNFHK.js → BQLG62QR.js} +4 -4
  4. package/dist/cdn/{KKQIZTTK.js → F7IHWMK7.js} +1 -1
  5. package/dist/cdn/{NZY7KXAF.js → H75CMJQP.js} +1 -1
  6. package/dist/cdn/{Z56TGOZF.js → HVHTW7TF.js} +2 -2
  7. package/dist/cdn/JS62T4I5.js +4 -0
  8. package/dist/cdn/{N2FN7LBN.js → K7O73D3Q.js} +1 -1
  9. package/dist/cdn/{3YWUK77P.js → L2AQ5FXC.js} +1 -1
  10. package/dist/cdn/{DEWLD2VE.js → NXNOBP7G.js} +1 -1
  11. package/dist/cdn/{EPMYM35I.js → OPWQ5CNY.js} +1 -1
  12. package/dist/cdn/{3FSDLLYC.js → QWLPT7LO.js} +1 -1
  13. package/dist/cdn/{BYO7RLJT.js → T7GEIGWF.js} +1 -1
  14. package/dist/cdn/{QXQAIN3R.js → TDEKR2LM.js} +1 -1
  15. package/dist/cdn/TDYUEEOH.js +2 -0
  16. package/dist/cdn/WNUR7N3L.js +6 -0
  17. package/dist/cdn/XEUCI6KC.js +2 -0
  18. package/dist/cdn/{D2RP5367.js → ZGBZ6BXY.js} +1 -1
  19. package/dist/cdn/assets/code-editor/arcade.worker.js +8 -0
  20. package/dist/cdn/assets/code-editor/sql-expr.worker.js +2192 -2186
  21. package/dist/cdn/index.js +1 -1
  22. package/dist/chunks/arcade-defaults.js +84 -84
  23. package/dist/chunks/arcade-mode.js +2 -2
  24. package/dist/chunks/language-defaults-base.js +3 -2
  25. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +101 -96
  26. package/dist/components/arcgis-arcade-editor/customElement.d.ts +5 -1
  27. package/dist/components/arcgis-arcade-editor/customElement.js +72 -59
  28. package/dist/components/arcgis-arcade-results/customElement.js +13 -13
  29. package/dist/docs/api.json +1 -1
  30. package/dist/docs/docs.json +1 -1
  31. package/dist/docs/vscode.html-custom-data.json +1 -1
  32. package/dist/docs/web-types.json +1 -1
  33. package/package.json +5 -5
  34. package/dist/cdn/6QWZ6LSH.js +0 -2
  35. package/dist/cdn/ASVCAO4G.js +0 -4
  36. package/dist/cdn/MY63AUW2.js +0 -2
  37. 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("./ASVCAO4G.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./6QWZ6LSH.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./D2RP5367.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./UNTQC5M2.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./N2FN7LBN.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./3C7TCPV5.js")],"arcgis-code-viewer":[()=>import("./EPMYM35I.js"),"language,round"],"arcgis-editor-variables":[()=>import("./DTZPALJA.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./NZY7KXAF.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./QXQAIN3R.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)
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 g, a as D, b as v, c as F, d as S, e as M, f as A, m as L, L as k, E } from "./language-defaults-base.js";
3
- import { supportedLocales as I, fetchT9nStringsBundle as C } from "@arcgis/toolkit/intl";
4
- import { g as h } from "./runtime.js";
5
- import { CompletionItemKind as T, InsertTextFormat as p, InsertTextMode as f } from "vscode-languageserver-types";
6
- import { getDeclaredPixelMembers as j } from "@arcgis/core/applications/Components/arcadeEditorUtils.js";
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 $(e) {
9
- const { apiVersion: r, bundles: n, hiddenApiItems: i } = e.toEditorProfileDefinition(), t = await P(e.dictionaryVariables);
10
- return { apiVersion: r, bundles: n, variables: t, hiddenApiItems: i?.map((s) => s.toLowerCase()) };
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 P(e, r = T.Variable) {
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 q(n, r);
17
+ return await Q(n, i);
18
18
  case "pixel":
19
- return await _(n, r);
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 K(n, r);
26
+ return await _(n, i);
27
27
  default:
28
- return B(n, r);
28
+ return K(n, i);
29
29
  }
30
30
  })
31
31
  );
32
32
  }
33
- function B(e, r) {
34
- const { name: n, type: i } = e, t = e.getDescription();
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: i,
38
+ type: r,
39
39
  completion: {
40
40
  label: n,
41
41
  detail: n,
42
- insertText: n,
42
+ insertText: s,
43
43
  insertTextMode: f.asIs,
44
44
  insertTextFormat: p.PlainText,
45
- kind: r,
45
+ kind: i,
46
46
  documentation: { kind: "markdown", value: t }
47
47
  }
48
48
  };
49
49
  }
50
- async function K(e, r) {
51
- const n = await e.loadSource(), { name: i } = e, t = e.getDescription(), s = {
52
- label: i,
53
- detail: i,
54
- insertText: i,
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: r
57
+ kind: i
58
58
  }, o = {
59
- name: i,
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] = A(n.fields, t, !0);
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 _(e, r) {
71
- const n = await e.loadSource(), i = e.toProfileVariableDefinition();
72
- if (i.type !== "pixel")
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: r
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 || !i.definition)
88
+ if (!n || !r.definition)
89
89
  return a;
90
- const c = await j(n), [d, l] = L(c, s);
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 q(e, r) {
94
- const { name: n, dictionaryVariables: i } = e, t = e.getDescription(), s = i.reduce((o, a) => {
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 P(i, T.Field),
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: r,
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 r = x.get(e);
121
- if (r)
122
- return r;
123
- if (!I.has(e))
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(h(`./assets/arcade-language/profiles/arcade-profiles.t9n.${e}.json`));
127
- return n.ok ? Q(e, await n.json()) : e === "en" ? null : await y("en");
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 Q(e, r) {
133
+ function U(e, i) {
134
134
  const n = /* @__PURE__ */ new Map();
135
- return r.forEach((i) => {
136
- n.set(i.id, i);
135
+ return i.forEach((r) => {
136
+ n.set(r.id, r);
137
137
  }), x.set(e, n), n;
138
138
  }
139
- async function U(e, r = "en") {
140
- return (await y(r))?.get(e) ?? null;
139
+ async function z(e, i = "en") {
140
+ return (await y(i))?.get(e) ?? null;
141
141
  }
142
- function z(e) {
142
+ function G(e) {
143
143
  return !!e && typeof e == "object" && "additionalVariables" in e && Array.isArray(e.additionalVariables);
144
144
  }
145
- function G(e) {
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: G(e.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 H(e, r = "en") {
167
- if (!g(e))
166
+ async function J(e, i = "en") {
167
+ if (!h(e))
168
168
  return;
169
- const n = await U(e.id, r);
169
+ const n = await z(e.id, i);
170
170
  if (!n)
171
171
  return;
172
- const i = {
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 i.variables.push(
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 M(s) ? i.variables.push({ ...t, type: "feature", definition: s }) : void 0;
191
+ return S(s) ? r.variables.push({ ...t, type: "feature", definition: s }) : void 0;
192
192
  case "pixel":
193
- return S(s) ? i.variables.push({ ...t, type: t.type, definition: s }) : void 0;
193
+ return M(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
194
194
  case "voxel":
195
- return F(s) ? i.variables.push({ ...t, type: t.type, definition: s }) : void 0;
195
+ return F(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
196
196
  case "featureSet":
197
- return v(s) ? i.variables.push({ ...t, type: t.type, definition: s }) : void 0;
197
+ return v(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
198
198
  case "featureSetCollection":
199
- return D(s) ? i.variables.push({ ...t, type: t.type, definition: s }) : void 0;
199
+ return D(s) ? r.variables.push({ ...t, type: t.type, definition: s }) : void 0;
200
200
  default:
201
- return i.variables.push(m(t));
201
+ return r.variables.push(m(t));
202
202
  }
203
- }), z(e) && i.variables.push(...e.additionalVariables ?? []), i;
203
+ }), G(e) && r.variables.push(...e.additionalVariables ?? []), r;
204
204
  }
205
- const J = [
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 N(e) {
218
- return !!e && typeof e == "object" && "type" in e && typeof e.type == "string" && J.includes(e.type);
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 O = {
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
- N(e)
223
+ O(e)
224
224
  )
225
225
  };
226
- class R extends k {
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(r, n, i = { locale: "en" }) {
258
- const t = this._getApiKey(r), o = (this.#e.get(t) || Promise.resolve()).then(async () => {
259
- const c = n, d = g(c) ? await H(c, i.locale) : c, l = await C(
260
- i.locale,
261
- h("./assets/editor-profile/t9n"),
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 ${i.locale}`);
266
- this.disposeForModel(r);
267
- const w = new E(
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
- i.locale,
271
- O
270
+ r.locale,
271
+ R
272
272
  );
273
273
  this._modelToProfileMap.set(t, w);
274
- const b = await $(w);
275
- this.updateApiContextForModel(r, {
276
- locale: i.locale,
274
+ const b = await B(w);
275
+ this.updateApiContextForModel(i, {
276
+ locale: r.locale,
277
277
  profile: b,
278
- snippets: i.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 R(), te = {
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
- te as a,
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*)(\.|;|\/|,|\)|\]|\}|$))/u,
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: [
@@ -1030,8 +1030,9 @@ export {
1030
1030
  tt as d,
1031
1031
  J as e,
1032
1032
  nt as f,
1033
- Se as g,
1034
- Ce as h,
1033
+ T as g,
1034
+ Se as h,
1035
1035
  st as i,
1036
+ Ce as j,
1036
1037
  ot as m
1037
1038
  };