@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,9 +1,9 @@
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
- import { g as getAssetPath } from './index-318ffb0c.js';
6
+ import { g as getAssetPath } from './index-e24c1311.js';
7
7
 
8
8
  /**
9
9
  * Returns the last element of an array.
@@ -120522,7 +120522,7 @@ registerLanguage({
120522
120522
  mimetypes: ["text/css"],
120523
120523
  loader: () => {
120524
120524
  {
120525
- return import('./css-97e0bca1.js');
120525
+ return import('./css-df075703.js');
120526
120526
  }
120527
120527
  }
120528
120528
  });
@@ -120540,7 +120540,7 @@ registerLanguage({
120540
120540
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
120541
120541
  loader: () => {
120542
120542
  {
120543
- return import('./html-5b306e7f.js');
120543
+ return import('./html-8af94c18.js');
120544
120544
  }
120545
120545
  }
120546
120546
  });
@@ -120560,7 +120560,7 @@ registerLanguage({
120560
120560
  mimetypes: ["text/javascript"],
120561
120561
  loader: () => {
120562
120562
  {
120563
- return import('./javascript-e24d6f51.js');
120563
+ return import('./javascript-405fba1f.js');
120564
120564
  }
120565
120565
  }
120566
120566
  });
@@ -120578,7 +120578,7 @@ registerLanguage({
120578
120578
  mimetypes: ["text/typescript"],
120579
120579
  loader: () => {
120580
120580
  {
120581
- return import('./typescript-b5ee74fa.js');
120581
+ return import('./typescript-affc39d2.js');
120582
120582
  }
120583
120583
  }
120584
120584
  });
@@ -120699,7 +120699,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
120699
120699
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
120700
120700
  function getMode$3() {
120701
120701
  {
120702
- return import('./cssMode-af0b0322.js');
120702
+ return import('./cssMode-29792b94.js');
120703
120703
  }
120704
120704
  }
120705
120705
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -120824,7 +120824,7 @@ monaco_editor_core_exports$2.languages.html = {
120824
120824
  };
120825
120825
  function getMode$2() {
120826
120826
  {
120827
- return import('./htmlMode-ade22305.js');
120827
+ return import('./htmlMode-9b0c0d01.js');
120828
120828
  }
120829
120829
  }
120830
120830
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -120926,7 +120926,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
120926
120926
  monaco_editor_core_exports$1.languages.json = { jsonDefaults };
120927
120927
  function getMode$1() {
120928
120928
  {
120929
- return import('./jsonMode-dcc1e54f.js');
120929
+ return import('./jsonMode-8e88248b.js');
120930
120930
  }
120931
120931
  }
120932
120932
  monaco_editor_core_exports$1.languages.register({
@@ -121195,7 +121195,7 @@ monaco_editor_core_exports.languages.typescript = {
121195
121195
  };
121196
121196
  function getMode() {
121197
121197
  {
121198
- return import('./tsMode-3c62ab70.js');
121198
+ return import('./tsMode-dd509037.js');
121199
121199
  }
121200
121200
  }
121201
121201
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -168945,6 +168945,10 @@ async function importPortalPortalItem() {
168945
168945
  const module = await import('@arcgis/core/portal/PortalItem.js');
168946
168946
  return module.default;
168947
168947
  }
168948
+ async function newPortalPortalItem(properties) {
168949
+ const ModConstructor = await importPortalPortalItem();
168950
+ return new ModConstructor(properties);
168951
+ }
168948
168952
  async function importWebMap() {
168949
168953
  if (amd) {
168950
168954
  return requireModule("esri/WebMap");
@@ -168952,6 +168956,10 @@ async function importWebMap() {
168952
168956
  const module = await import('@arcgis/core/WebMap.js');
168953
168957
  return module.default;
168954
168958
  }
168959
+ async function newWebMap(properties) {
168960
+ const ModConstructor = await importWebMap();
168961
+ return new ModConstructor(properties);
168962
+ }
168955
168963
  async function importWebScene() {
168956
168964
  if (amd) {
168957
168965
  return requireModule("esri/WebScene");
@@ -168978,19 +168986,14 @@ async function importRequest() {
168978
168986
  return module.default;
168979
168987
  }
168980
168988
 
168981
- async function newPortalItem(definition) {
168982
- const PortalItem = await importPortalPortalItem();
168983
- return new PortalItem(definition);
168984
- }
168989
+ //#region core adapter fix
168985
168990
  async function newFeatureLayer(definition) {
168986
168991
  const FeatureLayer = await importLayersFeatureLayer();
168987
168992
  // Fix title for the layer. Instead of defaulting to the map viewer style.
168988
168993
  return new FeatureLayer({ ...definition, sublayerTitleMode: "service-name" });
168989
168994
  }
168990
- async function newWebMap(definition) {
168991
- const WebMap = await importWebMap();
168992
- return new WebMap(definition);
168993
- }
168995
+ //#endregion
168996
+ //#region Type Guards
168994
168997
  function isSupportedLayerInstance(item) {
168995
168998
  return (!!item &&
168996
168999
  typeof item === "object" &&
@@ -169075,6 +169078,86 @@ function isPredefinedProfile(item) {
169075
169078
  typeof item.definitions === "object" &&
169076
169079
  !Array.isArray(item.definitions));
169077
169080
  }
169081
+ function isTitleCapableSource(item) {
169082
+ return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169083
+ }
169084
+ function isUrlCapableSource(item) {
169085
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169086
+ }
169087
+ function isLayerIdCapableSource(item) {
169088
+ return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169089
+ }
169090
+ function isFeatureTypesCapableLayer(item) {
169091
+ return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169092
+ }
169093
+ function isDomainsCapableLayer(item) {
169094
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169095
+ }
169096
+ function isSubtypeFieldCapableLayer(item) {
169097
+ return !!item && typeof item === "object" && "subtypeField" in item;
169098
+ }
169099
+ function isSubtypesCapableLayer(item) {
169100
+ return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
169101
+ }
169102
+ function isRelationshipsCapableLayer(item) {
169103
+ return (isLayerIdCapableSource(item) &&
169104
+ "relationships" in item &&
169105
+ "url" in item &&
169106
+ Array.isArray(item.relationships) &&
169107
+ typeof item.url === "string");
169108
+ }
169109
+ function isTableCapableLayer(item) {
169110
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169111
+ }
169112
+ function isLoadableSource(item) {
169113
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169114
+ }
169115
+ //#endregion
169116
+ //#region Service Metadata
169117
+ async function supportedSourceFromDefinition(definition) {
169118
+ if (!definition) {
169119
+ return null;
169120
+ }
169121
+ let source = null;
169122
+ if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
169123
+ source = definition;
169124
+ }
169125
+ else {
169126
+ source = await newFeatureLayer(definition);
169127
+ }
169128
+ if (isLoadableSource(source)) {
169129
+ await source.load();
169130
+ }
169131
+ return source;
169132
+ }
169133
+ async function serviceMetaData(url) {
169134
+ url += "/layers";
169135
+ const request = await importRequest();
169136
+ const response = await request(url, { responseType: "json", query: { f: "json" } });
169137
+ const data = {
169138
+ layers: response.data?.layers ?? [],
169139
+ tables: response.data?.tables ?? []
169140
+ };
169141
+ const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
169142
+ const layers = filterFeatureLayerInfos(data.layers, queryCapability);
169143
+ const tables = filterFeatureLayerInfos(data.tables, queryCapability);
169144
+ return { layers, tables };
169145
+ }
169146
+ function filterFeatureLayerInfos(layers, queryCapability) {
169147
+ return layers.filter((layer) => {
169148
+ if (layer.type !== "Feature Layer" && layer.type !== "Table") {
169149
+ return false;
169150
+ }
169151
+ const capabilities = layer.capabilities
169152
+ ? layer.capabilities
169153
+ .toLowerCase()
169154
+ .split(",")
169155
+ .map((value) => value.trim())
169156
+ : [];
169157
+ return capabilities.includes(queryCapability);
169158
+ });
169159
+ }
169160
+ //#endregion
169078
169161
 
169079
169162
  var h=class{constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n;});}};function S(e,t){let n=e;for(;n;){if(n===t)return !0;if(!n.parentNode)return !1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode;}return !1}function x(e,t,n=()=>{}){if(!t||t.length<=0)return;let r=new MutationObserver(o=>{for(let s of o)S(e,s.target)&&n();});return r.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0}),r}function T(e,t){let n=e;for(;n;){let r=n.closest(t);if(r)return r;let o=n.getRootNode();if(o===document)return null;n=o.host;}return null}function k(e){let t=T(e,":is(.calcite-mode-light, .calcite-mode-dark)");return t&&t.classList.contains("calcite-mode-dark")?"dark":"light"}function f(e,t,n){return T(e,`[${t}]`)?.getAttribute(t)??n}function M(e){return e.nodeType===Node.ELEMENT_NODE}function d(e,t=""){if(!M(e))return !1;if(e.matches(t))return setTimeout(()=>e?.setFocus(),0),!0;for(let r=0;r<e.children.length;r++)if(d(e.children[r],t))return !0;let n=e.shadowRoot;if(n){for(let r=0;r<n.children.length;r++)if(d(n.children[r],t))return !0}return !1}function F(e,t){if(!e?.shadowRoot)return;if(e.hasAttribute("hydrated")||e.hasAttribute("calcite-hydrated")){d(e,t);return}let n=new MutationObserver(()=>{n.disconnect(),d(e,t);});n.observe(e,{attributes:!0,attributeFilter:["hydrated","calcite-hydrated"]});}function c(e){let t="";for(let n=0;n<e;n++)t+=((1+Math.random())*65536|0).toString(16).substring(1);return t}function U(){return [c(2),c(1),c(1),c(1),c(3)].join("-")}var E=new Set(["ar","bg","bs","ca","cs","da","de","el","en","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nl","nb","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"]),a=new Map;async function N(e,t,n=""){let r=`${t}/${n}${e}.json`;if(a.has(r))return a.get(r);try{let o=await fetch(r);if(o.ok){let i=await o.json();return a.set(r,i),i}if(e==="en"){a.set(r,void 0);return}let s=await N("en",t,n);return a.set(r,s),s}catch{a.set(r,void 0);return}}function R(e){let t=f(e,"lang",navigator.language||"en");if(E.has(t))return {lang:t,t9nLocale:t};let n=t.slice(0,2);return {lang:t,t9nLocale:E.has(n)?n:"en"}}var p=new WeakMap,m=new WeakMap,C=new WeakMap;async function B(e,t,n){m.set(e,t),p.set(e,x(e._hostElement,["lang"],()=>{b(e,n);})),await b(e,n);}function H(e){p.get(e)?.disconnect(),p.delete(e),m.delete(e);}async function b(e,t){let{lang:n,t9nLocale:r}=R(e._hostElement);if(n===e._lang&&r===e._t9nLocale||(n!==e._lang&&(e._lang=n),r===e._t9nLocale))return;let o=C.get(e);if(!o){let s=m.get(e)??"",i=e._hostElement.tagName.toLowerCase().replace("arcgis-",""),l=`${s}/${i}/t9n`,u=`${i}.t9n.`;o=await N(r,l,u);}e._t9nLocale=r,e._t9nStrings=o,await t?.call(e);}var v='"',w="'";function L(e,t){return new Array(t+1).join(e)}function Q(e){let t=v,n=w;e.includes(t)&&!e.includes(n)&&(n=v,t=w);let o=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${n})+)`,"gu");e=e.replace(o,(i,l,u,g)=>l+u+L(n,g.length/2));let s=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${t}+)`,"gu");return e=e.replace(s,(i,l,u,g)=>l+u+L(`\\${t}`,g.length)),t+e+t}function D(e){let t=e?e.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu,"\\$&"):"^.*$";return new RegExp(t,"i")}function K(e,t={}){return (e??"").replace(/\{(.*?)\}/gu,(n,r)=>t[r]??n)}function Z(e){return `\u200E${e??""}\u200E`}function Y(e){return e!==null}function ee(e){return e!==void 0}function oe(e,t,n=!1){if(!e||!t)return !1;let r=new URL(e),o=new URL(t);return !n&&r.protocol!==o.protocol||r.host==null||o.host==null?!1:r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port}function se(e){try{return new URL(e),!0}catch{return !1}}
169080
169163
 
@@ -169193,42 +169276,8 @@ function supportedFields(fields) {
169193
169276
  });
169194
169277
  }
169195
169278
 
169196
- function isTitleCapableSource(item) {
169197
- return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169198
- }
169199
- function isUrlCapableSource(item) {
169200
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169201
- }
169202
- function isLayerIdCapableSource(item) {
169203
- return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169204
- }
169205
- function isFeatureTypesCapableLayer(item) {
169206
- return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169207
- }
169208
- function isDomainsCapableLayer(item) {
169209
- return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169210
- }
169211
- function isSubtypeFieldCapableLayer(item) {
169212
- return !!item && typeof item === "object" && "subtypeField" in item;
169213
- }
169214
- function isSubtypesCapableLayer(item) {
169215
- return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
169216
- }
169217
- function isRelationshipsCapableLayer(item) {
169218
- return (isLayerIdCapableSource(item) &&
169219
- "relationships" in item &&
169220
- "url" in item &&
169221
- Array.isArray(item.relationships) &&
169222
- typeof item.url === "string");
169223
- }
169224
- function isTableCapableLayer(item) {
169225
- return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169226
- }
169227
- function isLoadableSource(item) {
169228
- return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169229
- }
169230
169279
  //#endregion
169231
- //#region Support Functions
169280
+ //#region Support functions
169232
169281
  async function getRelatedFeatureLayer(layer, relationship) {
169233
169282
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
169234
169283
  await relatedFeatureLayer.load();
@@ -169269,64 +169318,6 @@ function sortFields(layer) {
169269
169318
  return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
169270
169319
  };
169271
169320
  }
169272
- function getTypeOrSubtypeDomainGroup(profile, types, field) {
169273
- // Try the coded domain first
169274
- if (isCodedValueDomainInstance(field.domain)) {
169275
- return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
169276
- }
169277
- // No coded domain, we will manufacture it
169278
- const values = types?.map((t) => {
169279
- const label = isSubtypeInstance(t) ? t.code : t.id;
169280
- return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
169281
- }) ?? [];
169282
- return new GroupOfVariables(profile, { code: "subtypes" }, values);
169283
- }
169284
- function getCodedValueDomainGroup(profile, domain, label) {
169285
- const values = domain.codedValues.map((v) => new ValueVariable({
169286
- profile,
169287
- label: `${v.code}`,
169288
- description: v.name,
169289
- snippet: `"${v.code}"`,
169290
- filterDescription: true
169291
- }));
169292
- return new GroupOfVariables(profile, label, values);
169293
- }
169294
- function getDomainValuesGroup(profile, types, field) {
169295
- const variables = [];
169296
- if (!types || types.length === 0) {
169297
- return null;
169298
- }
169299
- types.forEach((type) => {
169300
- let domain = type.domains[field.name];
169301
- if (!domain) {
169302
- return;
169303
- }
169304
- if (isInheritedDomainInstance(domain)) {
169305
- domain = field.domain;
169306
- return;
169307
- }
169308
- if (!isCodedValueDomainInstance(domain)) {
169309
- return;
169310
- }
169311
- const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
169312
- code: "domainvaluesfortypeformat",
169313
- formatValues: {
169314
- fieldName: field.alias ?? field.name,
169315
- typeName: type.name
169316
- }
169317
- });
169318
- const id = isSubtypeInstance(type) ? type.code : type.id;
169319
- const label = `${id}`;
169320
- const snippet = `"${id}""`;
169321
- const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
169322
- subtypeDictionary.variables = [domainValuesGroup];
169323
- variables.push(subtypeDictionary);
169324
- });
169325
- if (!variables.length) {
169326
- return null;
169327
- }
169328
- return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
169329
- }
169330
169321
  function areAllDomainsInherited(types, field) {
169331
169322
  return types?.every((type) => type.domains[field.name]?.type === "inherited") ?? false;
169332
169323
  }
@@ -169345,52 +169336,7 @@ function assembleMemberExpression(obj, prop) {
169345
169336
  return `${obj}${getMemberExpressionProperty(prop)}`;
169346
169337
  }
169347
169338
  //#endregion
169348
- //#region Sources
169349
- async function supportedSourceFromDefinition(definition) {
169350
- if (!definition) {
169351
- return null;
169352
- }
169353
- let source = null;
169354
- if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
169355
- source = definition;
169356
- }
169357
- else {
169358
- source = await newFeatureLayer(definition);
169359
- }
169360
- if (isLoadableSource(source)) {
169361
- await source.load();
169362
- }
169363
- return source;
169364
- }
169365
- async function serviceMetaData(url) {
169366
- url += "/layers";
169367
- const request = await importRequest();
169368
- const response = await request(url, { responseType: "json", query: { f: "json" } });
169369
- const data = {
169370
- layers: response.data?.layers ?? [],
169371
- tables: response.data?.tables ?? []
169372
- };
169373
- const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
169374
- const layers = filterFeatureLayerInfos(data.layers, queryCapability);
169375
- const tables = filterFeatureLayerInfos(data.tables, queryCapability);
169376
- return { layers, tables };
169377
- }
169378
- function filterFeatureLayerInfos(layers, queryCapability) {
169379
- return layers.filter((layer) => {
169380
- if (layer.type !== "Feature Layer" && layer.type !== "Table") {
169381
- return false;
169382
- }
169383
- const capabilities = layer.capabilities
169384
- ? layer.capabilities
169385
- .toLowerCase()
169386
- .split(",")
169387
- .map((value) => value.trim())
169388
- : [];
169389
- return capabilities.includes(queryCapability);
169390
- });
169391
- }
169392
- //#endregion
169393
- //#region Functions to Editor Variables to a language service variables
169339
+ //#region Editor Profile to Language Service Profile functions
169394
169340
  async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
169395
169341
  return await Promise.all(editorVariables.map(async (editorVariable) => {
169396
169342
  switch (editorVariable.type) {
@@ -169651,8 +169597,9 @@ class ArrayVariable extends VariableBase {
169651
169597
  * collection is ready or not.
169652
169598
  */
169653
169599
  class CollectionBasedVariable extends VariableBase {
169654
- constructor() {
169655
- super(...arguments);
169600
+ constructor(owner, props) {
169601
+ super(props);
169602
+ this.owner = owner;
169656
169603
  this.isCollection = true;
169657
169604
  this._loaded = true;
169658
169605
  /**
@@ -169662,6 +169609,15 @@ class CollectionBasedVariable extends VariableBase {
169662
169609
  */
169663
169610
  this.variables = [];
169664
169611
  }
169612
+ get breadcrumb() {
169613
+ // If there's an owner, prepend its breadcrumb and append the current name
169614
+ if (this.owner) {
169615
+ const ownerBreadcrumb = this.owner.breadcrumb;
169616
+ return ownerBreadcrumb ? `${ownerBreadcrumb} > ${this.name}` : this.name;
169617
+ }
169618
+ // If there's no owner, this is the root element, so just return its name
169619
+ return this.name;
169620
+ }
169665
169621
  /**
169666
169622
  * Returns true if the collection has been loaded
169667
169623
  */
@@ -169697,8 +169653,8 @@ class GroupOfVariables extends ProfileItemBase {
169697
169653
  }
169698
169654
  }
169699
169655
  class DictionaryVariable extends CollectionBasedVariable {
169700
- constructor(props) {
169701
- super(props);
169656
+ constructor(owner, props) {
169657
+ super(owner, props);
169702
169658
  this.type = "dictionary";
169703
169659
  /**
169704
169660
  * The variables that the dictionary holds. It is different than the variables.
@@ -169736,23 +169692,26 @@ class DictionaryVariable extends CollectionBasedVariable {
169736
169692
  case "text":
169737
169693
  case "boolean":
169738
169694
  case "date":
169695
+ case "dateOnly":
169696
+ case "time":
169739
169697
  case "geometry":
169698
+ case "knowledgeGraph":
169740
169699
  return new ValueVariable({ profile: this._profile, declaration, label: snippet, snippet });
169741
169700
  case "feature":
169742
- return new FeatureVariable({ profile: this._profile, declaration, label: snippet, snippet });
169701
+ return new FeatureVariable(this, { profile: this._profile, declaration, label: snippet, snippet });
169743
169702
  case "featureSet":
169744
- return new FeatureSetVariable({ profile: this._profile, declaration, label: snippet, snippet }, [
169703
+ return new FeatureSetVariable(this, { profile: this._profile, declaration, label: snippet, snippet }, [
169745
169704
  new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })
169746
169705
  ]);
169747
169706
  case "featureSetCollection":
169748
- return new FeatureSetCollectionVariable({
169707
+ return new FeatureSetCollectionVariable(this, {
169749
169708
  profile: this._profile,
169750
169709
  declaration,
169751
169710
  label: snippet,
169752
169711
  snippet
169753
169712
  });
169754
169713
  case "dictionary":
169755
- return new DictionaryVariable({
169714
+ return new DictionaryVariable(this, {
169756
169715
  profile: this._profile,
169757
169716
  declaration,
169758
169717
  label: snippet,
@@ -169766,7 +169725,7 @@ class DictionaryVariable extends CollectionBasedVariable {
169766
169725
  snippet
169767
169726
  });
169768
169727
  default:
169769
- console.error("Invalid profile variable", declaration);
169728
+ console.error("Editor profile: Invalid profile variable", declaration);
169770
169729
  return null;
169771
169730
  }
169772
169731
  }
@@ -169780,8 +169739,8 @@ class DictionaryVariable extends CollectionBasedVariable {
169780
169739
  }
169781
169740
  }
169782
169741
  class SourceBasedVariable extends CollectionBasedVariable {
169783
- constructor(props, relationshipsProperties) {
169784
- super(props);
169742
+ constructor(owner, props, relationshipsProperties) {
169743
+ super(owner, props);
169785
169744
  this.relationshipsProperties = relationshipsProperties;
169786
169745
  this._source = null;
169787
169746
  this._loaded = false;
@@ -169880,7 +169839,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169880
169839
  // Sepcial case for the subtype field
169881
169840
  if (field.name === this._source.subtypeField) {
169882
169841
  const domainDictionary = this._createDomainDictionary(field);
169883
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.subtypes, field));
169842
+ domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, field));
169884
169843
  return domainDictionary;
169885
169844
  }
169886
169845
  // Check if all the domains for the field in the types are inherited.
@@ -169890,7 +169849,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169890
169849
  }
169891
169850
  // We have domains per subtype
169892
169851
  // We need to go thru each types and create a dictionary.
169893
- const domainValuesBySubtypeGroup = getDomainValuesGroup(this._profile, this._source.subtypes, field);
169852
+ const domainValuesBySubtypeGroup = this._getDomainValuesGroup(this._source.subtypes, field);
169894
169853
  if (!domainValuesBySubtypeGroup) {
169895
169854
  return null;
169896
169855
  }
@@ -169906,7 +169865,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169906
169865
  // Special case for the type id field
169907
169866
  if (field.name === this._source.typeIdField) {
169908
169867
  const domainDictionary = this._createDomainDictionary(field);
169909
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.types, field));
169868
+ domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, field));
169910
169869
  return domainDictionary;
169911
169870
  }
169912
169871
  // Check if all the domains for the field in the types are inherited.
@@ -169916,7 +169875,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169916
169875
  }
169917
169876
  // We have domains per feature type
169918
169877
  // We need to go thru each types and create a dictionary.
169919
- const domainValuesByFeatureTypeGroup = getDomainValuesGroup(this._profile, this._source.types, field);
169878
+ const domainValuesByFeatureTypeGroup = this._getDomainValuesGroup(this._source.types, field);
169920
169879
  if (!domainValuesByFeatureTypeGroup) {
169921
169880
  return null;
169922
169881
  }
@@ -169933,24 +169892,93 @@ class SourceBasedVariable extends CollectionBasedVariable {
169933
169892
  if (!isCodedValueDomainInstance(fieldDomain)) {
169934
169893
  return null;
169935
169894
  }
169936
- const domainValuesGroup = getCodedValueDomainGroup(this._profile, fieldDomain, {
169895
+ const domainValuesGroup = this._getCodedValueDomainGroup(fieldDomain, {
169937
169896
  code: "domainvalues"
169938
169897
  });
169939
169898
  const domainDictionary = this._createDomainDictionary(field);
169940
169899
  domainDictionary.variables.push(domainValuesGroup);
169941
169900
  return domainDictionary;
169942
169901
  }
169902
+ _getTypeOrSubtypeDomainGroup(types, field) {
169903
+ // Try the coded domain first
169904
+ if (isCodedValueDomainInstance(field.domain)) {
169905
+ return this._getCodedValueDomainGroup(field.domain, { code: "subtypes" });
169906
+ }
169907
+ // No coded domain, we will manufacture it
169908
+ const values = types?.map((t) => {
169909
+ const label = isSubtypeInstance(t) ? t.code : t.id;
169910
+ return new ValueVariable({
169911
+ profile: this._profile,
169912
+ label: `${label}`,
169913
+ description: t.name,
169914
+ snippet: `"${label}"`
169915
+ });
169916
+ }) ?? [];
169917
+ return new GroupOfVariables(this._profile, { code: "subtypes" }, values);
169918
+ }
169919
+ _getCodedValueDomainGroup(domain, label) {
169920
+ const values = domain.codedValues.map((v) => new ValueVariable({
169921
+ profile: this._profile,
169922
+ label: `${v.code}`,
169923
+ description: v.name,
169924
+ snippet: `"${v.code}"`,
169925
+ filterDescription: true
169926
+ }));
169927
+ return new GroupOfVariables(this._profile, label, values);
169928
+ }
169929
+ _getDomainValuesGroup(types, field) {
169930
+ const variables = [];
169931
+ if (!types || types.length === 0) {
169932
+ return null;
169933
+ }
169934
+ types.forEach((type) => {
169935
+ let domain = type.domains[field.name];
169936
+ if (!domain) {
169937
+ return;
169938
+ }
169939
+ if (isInheritedDomainInstance(domain)) {
169940
+ domain = field.domain;
169941
+ return;
169942
+ }
169943
+ if (!isCodedValueDomainInstance(domain)) {
169944
+ return;
169945
+ }
169946
+ const domainValuesGroup = this._getCodedValueDomainGroup(domain, {
169947
+ code: "domainvaluesfortypeformat",
169948
+ formatValues: {
169949
+ fieldName: field.alias ?? field.name,
169950
+ typeName: type.name
169951
+ }
169952
+ });
169953
+ const id = isSubtypeInstance(type) ? type.code : type.id;
169954
+ const label = `${id}`;
169955
+ const snippet = `"${id}""`;
169956
+ const subtypeDictionary = new DictionaryVariable(this, {
169957
+ profile: this._profile,
169958
+ label,
169959
+ snippet,
169960
+ declaration: { name: field.alias ?? field.name }
169961
+ });
169962
+ subtypeDictionary.variables = [domainValuesGroup];
169963
+ variables.push(subtypeDictionary);
169964
+ });
169965
+ if (!variables.length) {
169966
+ return null;
169967
+ }
169968
+ return new GroupOfVariables(this._profile, { code: "domainvaluesbysubtypes" }, variables);
169969
+ }
169943
169970
  _createDomainDictionary(field) {
169944
169971
  // Create the domain dictionary.
169945
169972
  // The dictionary will have a header group and a value group.
169946
169973
  // At this point we are only creating the header group in the dictionary.
169947
169974
  const valueSnippet = this._getValueSnippet(field);
169948
- const domainDictionary = new DictionaryVariable({
169975
+ const domainDictionary = new DictionaryVariable(this, {
169949
169976
  profile: this._profile,
169950
169977
  label: valueSnippet,
169951
169978
  description: field.alias ?? field.name,
169952
169979
  snippet: valueSnippet,
169953
- icon: "form-dropdown"
169980
+ icon: "form-dropdown",
169981
+ declaration: { name: field.alias ?? field.name }
169954
169982
  });
169955
169983
  // Add the header group
169956
169984
  const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
@@ -169994,7 +170022,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169994
170022
  return null;
169995
170023
  }
169996
170024
  const snippet = `FeatureSetByRelationshipName(${this.snippet}, "${relationship.name}")`;
169997
- return new FeatureSetVariable({
170025
+ return new FeatureSetVariable(this, {
169998
170026
  profile: this._profile,
169999
170027
  declaration: { definition: relatedLayer },
170000
170028
  label: relatedLayer.title,
@@ -170010,8 +170038,8 @@ class SourceBasedVariable extends CollectionBasedVariable {
170010
170038
  }
170011
170039
  }
170012
170040
  class FeatureVariable extends SourceBasedVariable {
170013
- constructor(props) {
170014
- super(props, { exposeRelationships: true });
170041
+ constructor(owner, props) {
170042
+ super(owner, props, { exposeRelationships: true });
170015
170043
  this.type = "feature";
170016
170044
  }
170017
170045
  get title() {
@@ -170079,11 +170107,11 @@ class FeatureVariable extends SourceBasedVariable {
170079
170107
  }
170080
170108
  }
170081
170109
  class FeatureSetVariable extends SourceBasedVariable {
170082
- constructor(props, featureSetSnippets = [],
170110
+ constructor(owner, props, featureSetSnippets = [],
170083
170111
  // Relationships for feature set if only supported if the feature set is actually
170084
170112
  // representing a relationsip feature layer for a feature source.
170085
170113
  relationshipProps) {
170086
- super(props, relationshipProps);
170114
+ super(owner, props, relationshipProps);
170087
170115
  this.featureSetSnippets = featureSetSnippets;
170088
170116
  this.type = "featureSet";
170089
170117
  }
@@ -170130,8 +170158,8 @@ class FeatureSetVariable extends SourceBasedVariable {
170130
170158
  }
170131
170159
  }
170132
170160
  class FeatureSetCollectionVariable extends CollectionBasedVariable {
170133
- constructor(props) {
170134
- super(props);
170161
+ constructor(owner, props) {
170162
+ super(owner, props);
170135
170163
  this.type = "featureSetCollection";
170136
170164
  this._featureSetCollections = null;
170137
170165
  this._loaded = false;
@@ -170239,7 +170267,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170239
170267
  };
170240
170268
  }
170241
170269
  async _featureSetCollectionFromPortalItem(definition) {
170242
- const portalItem = await newPortalItem(definition);
170270
+ const portalItem = await newPortalPortalItem(definition);
170243
170271
  await portalItem.load();
170244
170272
  switch (portalItem.type) {
170245
170273
  case "Web Map": {
@@ -170298,9 +170326,9 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170298
170326
  return layerVariables;
170299
170327
  }
170300
170328
  _createFeatureSetVariable(featureLayer, isFromWebMap = false) {
170301
- return new FeatureSetVariable({
170329
+ return new FeatureSetVariable(this, {
170302
170330
  profile: this._profile,
170303
- declaration: { definition: featureLayer },
170331
+ declaration: { name: featureLayer.title, definition: featureLayer },
170304
170332
  label: featureLayer.title,
170305
170333
  description: "",
170306
170334
  nonInteractive: true
@@ -170338,7 +170366,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170338
170366
  class EditorProfile extends DictionaryVariable {
170339
170367
  constructor(definition, intlStrings, locale = "en") {
170340
170368
  // Delay the load of the variable declarations so we have a `this`
170341
- super({
170369
+ super(undefined, {
170342
170370
  profile: null,
170343
170371
  declaration: { properties: [] }
170344
170372
  });