@arcgis/coding-components 4.29.0-beta.107 → 4.29.0-beta.108

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 (74) hide show
  1. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  2. package/dist/arcgis-coding-components/index.esm.js +2 -2
  3. package/dist/arcgis-coding-components/{p-4ab89e7d.js → p-02ccc496.js} +2 -2
  4. package/dist/arcgis-coding-components/{p-94436a35.js → p-0da6eb96.js} +1 -1
  5. package/dist/arcgis-coding-components/{p-599777f8.js → p-4ae25593.js} +2 -2
  6. package/dist/arcgis-coding-components/{p-54956a0b.js → p-630ccf17.js} +10 -10
  7. package/dist/arcgis-coding-components/{p-ee0405a5.js → p-664bca0c.js} +2 -2
  8. package/dist/arcgis-coding-components/{p-91bbadd0.js → p-930f8ade.js} +3 -3
  9. package/dist/arcgis-coding-components/p-c06a8ded.entry.js +6 -0
  10. package/dist/arcgis-coding-components/{p-1f288af6.js → p-c1993cad.js} +2 -2
  11. package/dist/arcgis-coding-components/{p-2c94e34e.js → p-c72266dd.js} +2 -2
  12. package/dist/arcgis-coding-components/{p-4990e8c6.js → p-cf01c224.js} +2 -2
  13. package/dist/arcgis-coding-components/{p-1e9a909a.js → p-cffb1101.js} +2 -2
  14. package/dist/arcgis-coding-components/{p-a2dcc80b.js → p-e3c317aa.js} +1 -1
  15. package/dist/cjs/{arcade-defaults-da037f39.js → arcade-defaults-c23503e3.js} +214 -186
  16. package/dist/cjs/{arcade-mode-84768b0f.js → arcade-mode-fe4cdb2f.js} +3 -3
  17. package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +23 -20
  18. package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
  19. package/dist/cjs/{css-373c87ad.js → css-5f31bd3e.js} +1 -1
  20. package/dist/cjs/{cssMode-174c6a14.js → cssMode-ff492b59.js} +3 -3
  21. package/dist/cjs/{html-34d84912.js → html-1c2bd19b.js} +3 -3
  22. package/dist/cjs/{htmlMode-560580bc.js → htmlMode-c41a13a0.js} +3 -3
  23. package/dist/cjs/{index-a28e8c4d.js → index-5b78b967.js} +1 -1
  24. package/dist/cjs/index.cjs.js +3 -3
  25. package/dist/cjs/{javascript-0e9272ba.js → javascript-df448d9d.js} +4 -4
  26. package/dist/cjs/{jsonMode-f03296f5.js → jsonMode-84bbbd5c.js} +3 -3
  27. package/dist/cjs/loader.cjs.js +2 -2
  28. package/dist/cjs/{tsMode-61a0f476.js → tsMode-2a17886d.js} +3 -3
  29. package/dist/cjs/{typescript-3bc44ecc.js → typescript-8bd442e6.js} +3 -3
  30. package/dist/components/arcade-api.js +1 -1
  31. package/dist/components/arcade-contribution.js +2 -2
  32. package/dist/components/arcade-defaults.js +165 -145
  33. package/dist/components/arcade-mode.js +1 -1
  34. package/dist/components/arcade-results.js +2 -2
  35. package/dist/components/arcade-suggestions.js +1 -1
  36. package/dist/components/arcade-variables.js +19 -16
  37. package/dist/components/arcgis-arcade-api.js +1 -1
  38. package/dist/components/arcgis-arcade-editor.js +1 -1
  39. package/dist/components/arcgis-arcade-results.js +1 -1
  40. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  41. package/dist/components/arcgis-arcade-variables.js +1 -1
  42. package/dist/components/arcgis-code-editor.js +1 -1
  43. package/dist/components/code-editor.js +1 -1
  44. package/dist/components/fields.js +10 -2
  45. package/dist/components/functional-components.js +1 -1
  46. package/dist/components/index.js +1 -1
  47. package/dist/components/index2.js +1 -1
  48. package/dist/components/markdown.js +1 -1
  49. package/dist/components/utilities.js +1 -1
  50. package/dist/esm/{arcade-defaults-b0a0d60e.js → arcade-defaults-76893f90.js} +214 -186
  51. package/dist/esm/{arcade-mode-886ad2c6.js → arcade-mode-184b9a72.js} +3 -3
  52. package/dist/esm/arcgis-arcade-api_6.entry.js +23 -20
  53. package/dist/esm/arcgis-coding-components.js +3 -3
  54. package/dist/esm/{css-97e0bca1.js → css-df075703.js} +1 -1
  55. package/dist/esm/{cssMode-af0b0322.js → cssMode-29792b94.js} +3 -3
  56. package/dist/esm/{html-5b306e7f.js → html-8af94c18.js} +3 -3
  57. package/dist/esm/{htmlMode-ade22305.js → htmlMode-9b0c0d01.js} +3 -3
  58. package/dist/esm/{index-318ffb0c.js → index-e24c1311.js} +1 -1
  59. package/dist/esm/index.js +3 -3
  60. package/dist/esm/{javascript-e24d6f51.js → javascript-405fba1f.js} +4 -4
  61. package/dist/esm/{jsonMode-dcc1e54f.js → jsonMode-8e88248b.js} +3 -3
  62. package/dist/esm/loader.js +3 -3
  63. package/dist/esm/{tsMode-3c62ab70.js → tsMode-dd509037.js} +3 -3
  64. package/dist/esm/{typescript-b5ee74fa.js → typescript-affc39d2.js} +3 -3
  65. package/dist/loader/cdn.js +1 -1
  66. package/dist/loader/index.cjs.js +1 -1
  67. package/dist/loader/index.es2017.js +1 -1
  68. package/dist/loader/index.js +1 -1
  69. package/dist/types/components/arcade-variables/arcade-variables.d.ts +0 -1
  70. package/dist/types/utils/profile/editor-profile.d.ts +47 -62
  71. package/dist/types/utils/profile/types.d.ts +122 -1
  72. package/dist/types/utils/profile/utils.d.ts +22 -9
  73. package/package.json +8 -8
  74. package/dist/arcgis-coding-components/p-0afd6c41.entry.js +0 -6
@@ -1,28 +1,23 @@
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.107
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  import { Emitter, Uri } from 'monaco-editor';
7
7
  import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
8
- import { i as importPortalPortalItem, a as importLayersFeatureLayer, b as importWebMap, s as supportedFields, n as newWebScene, c as importRequest, f as fieldTypeToIconName, d as fieldTypeToArcadeType } from './fields.js';
8
+ import { i as importLayersFeatureLayer, a as importRequest, s as supportedFields, n as newPortalPortalItem, b as newWebScene, c as newWebMap, f as fieldTypeToIconName, d as fieldTypeToArcadeType } from './fields.js';
9
9
  import { p as portalItemPageUrl } from './utilities.js';
10
10
  import { Y, e as ee, Z, K, E, N } from './index2.js';
11
11
  import { getAssetPath } from '@stencil/core/internal/client';
12
12
 
13
- async function newPortalItem(definition) {
14
- const PortalItem = await importPortalPortalItem();
15
- return new PortalItem(definition);
16
- }
13
+ //#region core adapter fix
17
14
  async function newFeatureLayer(definition) {
18
15
  const FeatureLayer = await importLayersFeatureLayer();
19
16
  // Fix title for the layer. Instead of defaulting to the map viewer style.
20
17
  return new FeatureLayer({ ...definition, sublayerTitleMode: "service-name" });
21
18
  }
22
- async function newWebMap(definition) {
23
- const WebMap = await importWebMap();
24
- return new WebMap(definition);
25
- }
19
+ //#endregion
20
+ //#region Type Guards
26
21
  function isSupportedLayerInstance(item) {
27
22
  return (!!item &&
28
23
  typeof item === "object" &&
@@ -107,7 +102,6 @@ function isPredefinedProfile(item) {
107
102
  typeof item.definitions === "object" &&
108
103
  !Array.isArray(item.definitions));
109
104
  }
110
-
111
105
  function isTitleCapableSource(item) {
112
106
  return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
113
107
  }
@@ -143,7 +137,54 @@ function isLoadableSource(item) {
143
137
  return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
144
138
  }
145
139
  //#endregion
146
- //#region Support Functions
140
+ //#region Service Metadata
141
+ async function supportedSourceFromDefinition(definition) {
142
+ if (!definition) {
143
+ return null;
144
+ }
145
+ let source = null;
146
+ if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
147
+ source = definition;
148
+ }
149
+ else {
150
+ source = await newFeatureLayer(definition);
151
+ }
152
+ if (isLoadableSource(source)) {
153
+ await source.load();
154
+ }
155
+ return source;
156
+ }
157
+ async function serviceMetaData(url) {
158
+ url += "/layers";
159
+ const request = await importRequest();
160
+ const response = await request(url, { responseType: "json", query: { f: "json" } });
161
+ const data = {
162
+ layers: response.data?.layers ?? [],
163
+ tables: response.data?.tables ?? []
164
+ };
165
+ const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
166
+ const layers = filterFeatureLayerInfos(data.layers, queryCapability);
167
+ const tables = filterFeatureLayerInfos(data.tables, queryCapability);
168
+ return { layers, tables };
169
+ }
170
+ function filterFeatureLayerInfos(layers, queryCapability) {
171
+ return layers.filter((layer) => {
172
+ if (layer.type !== "Feature Layer" && layer.type !== "Table") {
173
+ return false;
174
+ }
175
+ const capabilities = layer.capabilities
176
+ ? layer.capabilities
177
+ .toLowerCase()
178
+ .split(",")
179
+ .map((value) => value.trim())
180
+ : [];
181
+ return capabilities.includes(queryCapability);
182
+ });
183
+ }
184
+ //#endregion
185
+
186
+ //#endregion
187
+ //#region Support functions
147
188
  async function getRelatedFeatureLayer(layer, relationship) {
148
189
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
149
190
  await relatedFeatureLayer.load();
@@ -184,64 +225,6 @@ function sortFields(layer) {
184
225
  return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
185
226
  };
186
227
  }
187
- function getTypeOrSubtypeDomainGroup(profile, types, field) {
188
- // Try the coded domain first
189
- if (isCodedValueDomainInstance(field.domain)) {
190
- return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
191
- }
192
- // No coded domain, we will manufacture it
193
- const values = types?.map((t) => {
194
- const label = isSubtypeInstance(t) ? t.code : t.id;
195
- return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
196
- }) ?? [];
197
- return new GroupOfVariables(profile, { code: "subtypes" }, values);
198
- }
199
- function getCodedValueDomainGroup(profile, domain, label) {
200
- const values = domain.codedValues.map((v) => new ValueVariable({
201
- profile,
202
- label: `${v.code}`,
203
- description: v.name,
204
- snippet: `"${v.code}"`,
205
- filterDescription: true
206
- }));
207
- return new GroupOfVariables(profile, label, values);
208
- }
209
- function getDomainValuesGroup(profile, types, field) {
210
- const variables = [];
211
- if (!types || types.length === 0) {
212
- return null;
213
- }
214
- types.forEach((type) => {
215
- let domain = type.domains[field.name];
216
- if (!domain) {
217
- return;
218
- }
219
- if (isInheritedDomainInstance(domain)) {
220
- domain = field.domain;
221
- return;
222
- }
223
- if (!isCodedValueDomainInstance(domain)) {
224
- return;
225
- }
226
- const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
227
- code: "domainvaluesfortypeformat",
228
- formatValues: {
229
- fieldName: field.alias ?? field.name,
230
- typeName: type.name
231
- }
232
- });
233
- const id = isSubtypeInstance(type) ? type.code : type.id;
234
- const label = `${id}`;
235
- const snippet = `"${id}""`;
236
- const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
237
- subtypeDictionary.variables = [domainValuesGroup];
238
- variables.push(subtypeDictionary);
239
- });
240
- if (!variables.length) {
241
- return null;
242
- }
243
- return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
244
- }
245
228
  function areAllDomainsInherited(types, field) {
246
229
  return types?.every((type) => type.domains[field.name]?.type === "inherited") ?? false;
247
230
  }
@@ -260,52 +243,7 @@ function assembleMemberExpression(obj, prop) {
260
243
  return `${obj}${getMemberExpressionProperty(prop)}`;
261
244
  }
262
245
  //#endregion
263
- //#region Sources
264
- async function supportedSourceFromDefinition(definition) {
265
- if (!definition) {
266
- return null;
267
- }
268
- let source = null;
269
- if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
270
- source = definition;
271
- }
272
- else {
273
- source = await newFeatureLayer(definition);
274
- }
275
- if (isLoadableSource(source)) {
276
- await source.load();
277
- }
278
- return source;
279
- }
280
- async function serviceMetaData(url) {
281
- url += "/layers";
282
- const request = await importRequest();
283
- const response = await request(url, { responseType: "json", query: { f: "json" } });
284
- const data = {
285
- layers: response.data?.layers ?? [],
286
- tables: response.data?.tables ?? []
287
- };
288
- const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
289
- const layers = filterFeatureLayerInfos(data.layers, queryCapability);
290
- const tables = filterFeatureLayerInfos(data.tables, queryCapability);
291
- return { layers, tables };
292
- }
293
- function filterFeatureLayerInfos(layers, queryCapability) {
294
- return layers.filter((layer) => {
295
- if (layer.type !== "Feature Layer" && layer.type !== "Table") {
296
- return false;
297
- }
298
- const capabilities = layer.capabilities
299
- ? layer.capabilities
300
- .toLowerCase()
301
- .split(",")
302
- .map((value) => value.trim())
303
- : [];
304
- return capabilities.includes(queryCapability);
305
- });
306
- }
307
- //#endregion
308
- //#region Functions to Editor Variables to a language service variables
246
+ //#region Editor Profile to Language Service Profile functions
309
247
  async function variablesToLSVariable(editorVariables, kind = CompletionItemKind.Variable) {
310
248
  return await Promise.all(editorVariables.map(async (editorVariable) => {
311
249
  switch (editorVariable.type) {
@@ -566,8 +504,9 @@ class ArrayVariable extends VariableBase {
566
504
  * collection is ready or not.
567
505
  */
568
506
  class CollectionBasedVariable extends VariableBase {
569
- constructor() {
570
- super(...arguments);
507
+ constructor(owner, props) {
508
+ super(props);
509
+ this.owner = owner;
571
510
  this.isCollection = true;
572
511
  this._loaded = true;
573
512
  /**
@@ -577,6 +516,15 @@ class CollectionBasedVariable extends VariableBase {
577
516
  */
578
517
  this.variables = [];
579
518
  }
519
+ get breadcrumb() {
520
+ // If there's an owner, prepend its breadcrumb and append the current name
521
+ if (this.owner) {
522
+ const ownerBreadcrumb = this.owner.breadcrumb;
523
+ return ownerBreadcrumb ? `${ownerBreadcrumb} > ${this.name}` : this.name;
524
+ }
525
+ // If there's no owner, this is the root element, so just return its name
526
+ return this.name;
527
+ }
580
528
  /**
581
529
  * Returns true if the collection has been loaded
582
530
  */
@@ -612,8 +560,8 @@ class GroupOfVariables extends ProfileItemBase {
612
560
  }
613
561
  }
614
562
  class DictionaryVariable extends CollectionBasedVariable {
615
- constructor(props) {
616
- super(props);
563
+ constructor(owner, props) {
564
+ super(owner, props);
617
565
  this.type = "dictionary";
618
566
  /**
619
567
  * The variables that the dictionary holds. It is different than the variables.
@@ -651,23 +599,26 @@ class DictionaryVariable extends CollectionBasedVariable {
651
599
  case "text":
652
600
  case "boolean":
653
601
  case "date":
602
+ case "dateOnly":
603
+ case "time":
654
604
  case "geometry":
605
+ case "knowledgeGraph":
655
606
  return new ValueVariable({ profile: this._profile, declaration, label: snippet, snippet });
656
607
  case "feature":
657
- return new FeatureVariable({ profile: this._profile, declaration, label: snippet, snippet });
608
+ return new FeatureVariable(this, { profile: this._profile, declaration, label: snippet, snippet });
658
609
  case "featureSet":
659
- return new FeatureSetVariable({ profile: this._profile, declaration, label: snippet, snippet }, [
610
+ return new FeatureSetVariable(this, { profile: this._profile, declaration, label: snippet, snippet }, [
660
611
  new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })
661
612
  ]);
662
613
  case "featureSetCollection":
663
- return new FeatureSetCollectionVariable({
614
+ return new FeatureSetCollectionVariable(this, {
664
615
  profile: this._profile,
665
616
  declaration,
666
617
  label: snippet,
667
618
  snippet
668
619
  });
669
620
  case "dictionary":
670
- return new DictionaryVariable({
621
+ return new DictionaryVariable(this, {
671
622
  profile: this._profile,
672
623
  declaration,
673
624
  label: snippet,
@@ -681,7 +632,7 @@ class DictionaryVariable extends CollectionBasedVariable {
681
632
  snippet
682
633
  });
683
634
  default:
684
- console.error("Invalid profile variable", declaration);
635
+ console.error("Editor profile: Invalid profile variable", declaration);
685
636
  return null;
686
637
  }
687
638
  }
@@ -695,8 +646,8 @@ class DictionaryVariable extends CollectionBasedVariable {
695
646
  }
696
647
  }
697
648
  class SourceBasedVariable extends CollectionBasedVariable {
698
- constructor(props, relationshipsProperties) {
699
- super(props);
649
+ constructor(owner, props, relationshipsProperties) {
650
+ super(owner, props);
700
651
  this.relationshipsProperties = relationshipsProperties;
701
652
  this._source = null;
702
653
  this._loaded = false;
@@ -795,7 +746,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
795
746
  // Sepcial case for the subtype field
796
747
  if (field.name === this._source.subtypeField) {
797
748
  const domainDictionary = this._createDomainDictionary(field);
798
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.subtypes, field));
749
+ domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, field));
799
750
  return domainDictionary;
800
751
  }
801
752
  // Check if all the domains for the field in the types are inherited.
@@ -805,7 +756,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
805
756
  }
806
757
  // We have domains per subtype
807
758
  // We need to go thru each types and create a dictionary.
808
- const domainValuesBySubtypeGroup = getDomainValuesGroup(this._profile, this._source.subtypes, field);
759
+ const domainValuesBySubtypeGroup = this._getDomainValuesGroup(this._source.subtypes, field);
809
760
  if (!domainValuesBySubtypeGroup) {
810
761
  return null;
811
762
  }
@@ -821,7 +772,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
821
772
  // Special case for the type id field
822
773
  if (field.name === this._source.typeIdField) {
823
774
  const domainDictionary = this._createDomainDictionary(field);
824
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.types, field));
775
+ domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, field));
825
776
  return domainDictionary;
826
777
  }
827
778
  // Check if all the domains for the field in the types are inherited.
@@ -831,7 +782,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
831
782
  }
832
783
  // We have domains per feature type
833
784
  // We need to go thru each types and create a dictionary.
834
- const domainValuesByFeatureTypeGroup = getDomainValuesGroup(this._profile, this._source.types, field);
785
+ const domainValuesByFeatureTypeGroup = this._getDomainValuesGroup(this._source.types, field);
835
786
  if (!domainValuesByFeatureTypeGroup) {
836
787
  return null;
837
788
  }
@@ -848,24 +799,93 @@ class SourceBasedVariable extends CollectionBasedVariable {
848
799
  if (!isCodedValueDomainInstance(fieldDomain)) {
849
800
  return null;
850
801
  }
851
- const domainValuesGroup = getCodedValueDomainGroup(this._profile, fieldDomain, {
802
+ const domainValuesGroup = this._getCodedValueDomainGroup(fieldDomain, {
852
803
  code: "domainvalues"
853
804
  });
854
805
  const domainDictionary = this._createDomainDictionary(field);
855
806
  domainDictionary.variables.push(domainValuesGroup);
856
807
  return domainDictionary;
857
808
  }
809
+ _getTypeOrSubtypeDomainGroup(types, field) {
810
+ // Try the coded domain first
811
+ if (isCodedValueDomainInstance(field.domain)) {
812
+ return this._getCodedValueDomainGroup(field.domain, { code: "subtypes" });
813
+ }
814
+ // No coded domain, we will manufacture it
815
+ const values = types?.map((t) => {
816
+ const label = isSubtypeInstance(t) ? t.code : t.id;
817
+ return new ValueVariable({
818
+ profile: this._profile,
819
+ label: `${label}`,
820
+ description: t.name,
821
+ snippet: `"${label}"`
822
+ });
823
+ }) ?? [];
824
+ return new GroupOfVariables(this._profile, { code: "subtypes" }, values);
825
+ }
826
+ _getCodedValueDomainGroup(domain, label) {
827
+ const values = domain.codedValues.map((v) => new ValueVariable({
828
+ profile: this._profile,
829
+ label: `${v.code}`,
830
+ description: v.name,
831
+ snippet: `"${v.code}"`,
832
+ filterDescription: true
833
+ }));
834
+ return new GroupOfVariables(this._profile, label, values);
835
+ }
836
+ _getDomainValuesGroup(types, field) {
837
+ const variables = [];
838
+ if (!types || types.length === 0) {
839
+ return null;
840
+ }
841
+ types.forEach((type) => {
842
+ let domain = type.domains[field.name];
843
+ if (!domain) {
844
+ return;
845
+ }
846
+ if (isInheritedDomainInstance(domain)) {
847
+ domain = field.domain;
848
+ return;
849
+ }
850
+ if (!isCodedValueDomainInstance(domain)) {
851
+ return;
852
+ }
853
+ const domainValuesGroup = this._getCodedValueDomainGroup(domain, {
854
+ code: "domainvaluesfortypeformat",
855
+ formatValues: {
856
+ fieldName: field.alias ?? field.name,
857
+ typeName: type.name
858
+ }
859
+ });
860
+ const id = isSubtypeInstance(type) ? type.code : type.id;
861
+ const label = `${id}`;
862
+ const snippet = `"${id}""`;
863
+ const subtypeDictionary = new DictionaryVariable(this, {
864
+ profile: this._profile,
865
+ label,
866
+ snippet,
867
+ declaration: { name: field.alias ?? field.name }
868
+ });
869
+ subtypeDictionary.variables = [domainValuesGroup];
870
+ variables.push(subtypeDictionary);
871
+ });
872
+ if (!variables.length) {
873
+ return null;
874
+ }
875
+ return new GroupOfVariables(this._profile, { code: "domainvaluesbysubtypes" }, variables);
876
+ }
858
877
  _createDomainDictionary(field) {
859
878
  // Create the domain dictionary.
860
879
  // The dictionary will have a header group and a value group.
861
880
  // At this point we are only creating the header group in the dictionary.
862
881
  const valueSnippet = this._getValueSnippet(field);
863
- const domainDictionary = new DictionaryVariable({
882
+ const domainDictionary = new DictionaryVariable(this, {
864
883
  profile: this._profile,
865
884
  label: valueSnippet,
866
885
  description: field.alias ?? field.name,
867
886
  snippet: valueSnippet,
868
- icon: "form-dropdown"
887
+ icon: "form-dropdown",
888
+ declaration: { name: field.alias ?? field.name }
869
889
  });
870
890
  // Add the header group
871
891
  const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
@@ -909,7 +929,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
909
929
  return null;
910
930
  }
911
931
  const snippet = `FeatureSetByRelationshipName(${this.snippet}, "${relationship.name}")`;
912
- return new FeatureSetVariable({
932
+ return new FeatureSetVariable(this, {
913
933
  profile: this._profile,
914
934
  declaration: { definition: relatedLayer },
915
935
  label: relatedLayer.title,
@@ -925,8 +945,8 @@ class SourceBasedVariable extends CollectionBasedVariable {
925
945
  }
926
946
  }
927
947
  class FeatureVariable extends SourceBasedVariable {
928
- constructor(props) {
929
- super(props, { exposeRelationships: true });
948
+ constructor(owner, props) {
949
+ super(owner, props, { exposeRelationships: true });
930
950
  this.type = "feature";
931
951
  }
932
952
  get title() {
@@ -994,11 +1014,11 @@ class FeatureVariable extends SourceBasedVariable {
994
1014
  }
995
1015
  }
996
1016
  class FeatureSetVariable extends SourceBasedVariable {
997
- constructor(props, featureSetSnippets = [],
1017
+ constructor(owner, props, featureSetSnippets = [],
998
1018
  // Relationships for feature set if only supported if the feature set is actually
999
1019
  // representing a relationsip feature layer for a feature source.
1000
1020
  relationshipProps) {
1001
- super(props, relationshipProps);
1021
+ super(owner, props, relationshipProps);
1002
1022
  this.featureSetSnippets = featureSetSnippets;
1003
1023
  this.type = "featureSet";
1004
1024
  }
@@ -1045,8 +1065,8 @@ class FeatureSetVariable extends SourceBasedVariable {
1045
1065
  }
1046
1066
  }
1047
1067
  class FeatureSetCollectionVariable extends CollectionBasedVariable {
1048
- constructor(props) {
1049
- super(props);
1068
+ constructor(owner, props) {
1069
+ super(owner, props);
1050
1070
  this.type = "featureSetCollection";
1051
1071
  this._featureSetCollections = null;
1052
1072
  this._loaded = false;
@@ -1154,7 +1174,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
1154
1174
  };
1155
1175
  }
1156
1176
  async _featureSetCollectionFromPortalItem(definition) {
1157
- const portalItem = await newPortalItem(definition);
1177
+ const portalItem = await newPortalPortalItem(definition);
1158
1178
  await portalItem.load();
1159
1179
  switch (portalItem.type) {
1160
1180
  case "Web Map": {
@@ -1213,9 +1233,9 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
1213
1233
  return layerVariables;
1214
1234
  }
1215
1235
  _createFeatureSetVariable(featureLayer, isFromWebMap = false) {
1216
- return new FeatureSetVariable({
1236
+ return new FeatureSetVariable(this, {
1217
1237
  profile: this._profile,
1218
- declaration: { definition: featureLayer },
1238
+ declaration: { name: featureLayer.title, definition: featureLayer },
1219
1239
  label: featureLayer.title,
1220
1240
  description: "",
1221
1241
  nonInteractive: true
@@ -1253,7 +1273,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
1253
1273
  class EditorProfile extends DictionaryVariable {
1254
1274
  constructor(definition, intlStrings, locale = "en") {
1255
1275
  // Delay the load of the variable declarations so we have a `this`
1256
- super({
1276
+ super(undefined, {
1257
1277
  profile: null,
1258
1278
  declaration: { properties: [] }
1259
1279
  });
@@ -1,7 +1,7 @@
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.107
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  import { editor, MarkerSeverity, Range, languages, Emitter } from 'monaco-editor';
7
7
  import { CompletionItemKind, DiagnosticSeverity, InsertTextFormat } from 'vscode-languageserver-types';
@@ -1,7 +1,7 @@
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.107
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h, Fragment, Host } from '@stencil/core/internal/client';
7
7
  import { e as importArcade, s as supportedFields } from './fields.js';
@@ -292,7 +292,7 @@ function jsonFormat(json) {
292
292
  .replace(/\\(\d+)\\/gu, popFunc); // backslashes in strings
293
293
  }
294
294
 
295
- const arcadeResultsCss = ":host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2)}:host .flex-adjustable{flex:1 1 auto;overflow:hidden}:host .flex-row{display:flex;flex-direction:row;overflow:hidden}:host .flex-column{display:flex;flex-direction:column;overflow:hidden}:host .y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}:host header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}:host .ltr-container{direction:ltr}:host calcite-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host calcite-action-bar calcite-action-group:last-child{border-inline-end-width:0px}:host calcite-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-half)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .color-info{color:var(--calcite-color-info)}:host .color-error{color:var(--calcite-color-danger)}:host .color-success{color:var(--calcite-color-success)}:host [class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-three-quarter)}:host .console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-three-quarter);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}:host .result-value-table table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap}:host .result-value-table table thead{background-color:var(--calcite-color-foreground-2)}:host .result-value-table table tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}:host .result-value-table table th,:host .result-value-table table td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-quarter)}:host .result-value-table table th .string-value,:host .result-value-table table td .string-value{white-space:pre}:host .result-value-table table th{font-weight:var(--calcite-font-weight-medium)}:host .tree-item-label,:host .number-value,:host .string-value,:host .boolean-value{font-family:var(--calcite-code-family)}:host .tree-item-label,:host .value-type{color:var(--calcite-text-2);font-weight:var(--calcite-font-weight-normal)}:host .dictionary-property{color:var(--arcgis-arcade-editor-identifier)}:host .number-value{color:var(--arcgis-arcade-editor-number)}:host .string-value{color:var(--arcgis-arcade-editor-string);white-space:pre-wrap}:host .constant-value{color:var(--arcgis-arcade-editor-constant)}:host .date-value{color:var(--arcgis-arcade-editor-date)}";
295
+ 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)}";
296
296
 
297
297
  //#region Specialized Constants
298
298
  const treeProps = {
@@ -1,7 +1,7 @@
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.107
4
+ * v4.29.0-beta.108
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, b as colorizeCodeElement } from './markdown.js';
@@ -1,7 +1,7 @@
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.107
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h } from '@stencil/core/internal/client';
7
7
  import { S as StickyFilterInput } from './functional-components.js';
@@ -18,6 +18,11 @@ import '@esri/calcite-components/dist/components/calcite-flow.js';
18
18
 
19
19
  const arcadeVariablesCss = ":host{background-color:var(--calcite-color-foreground-1)}:host .notice-container{margin:var(--calcite-spacing-quarter);padding:var(--calcite-spacing-half);background-color:var(--calcite-color-foreground-1)}:host .sticky{position:sticky;top:0px;z-index:10}:host calcite-flow{height:100%}";
20
20
 
21
+ function stopEnterPropagation(e) {
22
+ if (e.key === "Enter") {
23
+ e.stopPropagation();
24
+ }
25
+ }
21
26
  const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcadeVariables extends HTMLElement {
22
27
  constructor() {
23
28
  super();
@@ -25,16 +30,14 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
25
30
  this.__attachShadow();
26
31
  this.close = createEvent(this, "close", 3);
27
32
  this.itemSelected = createEvent(this, "itemSelected", 3);
28
- // @ts-expect-error
29
- this._updateFilterValue = (e) => (this._filterValue = e.target?.value ?? "");
33
+ this._updateFilterValue = (e) => (this._filterValue = e.target.value);
30
34
  this._beforeBack = async () => {
31
35
  this.removeLastPanelRenderer();
32
36
  this._filterValue = "";
33
37
  };
34
- this._emitClose = () => this.close.emit();
35
- this._backToTop = () => (this._flowItemRenderers = []);
38
+ this._emitClose = () => void this.close.emit();
39
+ this._backToTop = () => void (this._flowItemRenderers = []);
36
40
  this._emitItemSelected = (e) => {
37
- // @ts-expect-error
38
41
  const variable = e.target?.["data-item"];
39
42
  if (!variable || variable.nonInteractive) {
40
43
  return;
@@ -45,13 +48,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
45
48
  this.itemSelected.emit(variable.snippet);
46
49
  }
47
50
  };
48
- this._stopEnterPropagation = (e) => {
49
- if (e.key === "Enter") {
50
- e.stopPropagation();
51
- }
52
- };
53
51
  this._showCollectionPanel = (e) => {
54
- // @ts-expect-error
55
52
  const collectionVariable = e.target?.["data-item"];
56
53
  if (!collectionVariable) {
57
54
  return;
@@ -120,12 +117,18 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
120
117
  let loading = this.loading;
121
118
  if (!loading && !collection.loaded) {
122
119
  // Request to load and update mutation counter when done
123
- collection.loadSource().then(() => setTimeout(() => {
120
+ collection
121
+ .loadSource()
122
+ .then(() => setTimeout(() => {
124
123
  this._mutationCounter += 1;
125
- }));
124
+ }))
125
+ .catch(() => {
126
+ console.error("Error loading collection");
127
+ loading = false;
128
+ });
126
129
  loading = true;
127
130
  }
128
- return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h(StickyFilterInput, { filterValue: this._filterValue, onCalciteInputInput: this._updateFilterValue }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
131
+ return (h("calcite-flow-item", { heading: this._t9nStrings?.profilevariables, description: collection.breadcrumb, beforeBack: this._beforeBack, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-action", { slot: "header-actions-end", text: this._t9nStrings?.backtotop ?? "Back to top", scale: "m", hidden: topPanel, icon: "chevrons-left", iconFlipRtl: true, onClick: this._backToTop }), h(StickyFilterInput, { filterValue: this._filterValue, onCalciteInputInput: this._updateFilterValue }), loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this._t9nStrings?.loading ?? "Loading" })) : (h("calcite-list", null, this.renderEditorVariables(collection)))));
129
132
  };
130
133
  }
131
134
  renderEditorVariables(collection) {
@@ -143,7 +146,7 @@ const ArcgisArcadeVariables = /*@__PURE__*/ proxyCustomElement(class ArcgisArcad
143
146
  // Group is a collection but we represent it differently
144
147
  return (h("calcite-list-item-group", { heading: variable.getLabel() }, this.renderEditorVariables(variable)));
145
148
  default:
146
- return (h("calcite-list-item", { label: variable.getLabel(), description: variable.getDescription(), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": variable }, variable.isCollection ? (h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "", scale: "s", icon: "chevron-right", iconFlipRtl: true, onClick: this._showCollectionPanel, onKeyPress: this._stopEnterPropagation, "data-item": variable })) : null, variable.icon ? h("calcite-icon", { icon: variable.icon, scale: "s", slot: "content-start" }) : null));
149
+ return (h("calcite-list-item", { label: variable.getLabel(), description: variable.getDescription(), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": variable }, variable.isCollection ? (h("calcite-action", { slot: "actions-end", text: this._t9nStrings?.expand ?? "", scale: "s", icon: "chevron-right", iconFlipRtl: true, onClick: this._showCollectionPanel, onKeyPress: stopEnterPropagation, "data-item": variable })) : null, variable.icon ? h("calcite-icon", { icon: variable.icon, scale: "s", slot: "content-start" }) : null));
147
150
  }
148
151
  }
149
152
  render() {
@@ -1,7 +1,7 @@
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.107
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  import { A as ArcgisArcadeApi$1, d as defineCustomElement$1 } from './arcade-api.js';
7
7
 
@@ -1,7 +1,7 @@
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.107
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, getAssetPath, h as h$1, Fragment, Host } from '@stencil/core/internal/client';
7
7
  import { editor, KeyCode } from 'monaco-editor';