@arcgis/coding-components 4.29.0-beta.106 → 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-4a303362.js → p-02ccc496.js} +2 -2
  4. package/dist/arcgis-coding-components/{p-feace5dd.js → p-0da6eb96.js} +1 -1
  5. package/dist/arcgis-coding-components/{p-4b27350e.js → p-4ae25593.js} +2 -2
  6. package/dist/arcgis-coding-components/{p-50b6a7b0.js → p-630ccf17.js} +10 -10
  7. package/dist/arcgis-coding-components/{p-243ebec0.js → p-664bca0c.js} +2 -2
  8. package/dist/arcgis-coding-components/{p-6ef051be.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-49edfded.js → p-c1993cad.js} +2 -2
  11. package/dist/arcgis-coding-components/{p-563852d4.js → p-c72266dd.js} +2 -2
  12. package/dist/arcgis-coding-components/{p-b2cf4413.js → p-cf01c224.js} +2 -2
  13. package/dist/arcgis-coding-components/{p-3a99e42d.js → p-cffb1101.js} +2 -2
  14. package/dist/arcgis-coding-components/{p-39e15385.js → p-e3c317aa.js} +1 -1
  15. package/dist/cjs/{arcade-defaults-646624d2.js → arcade-defaults-c23503e3.js} +214 -186
  16. package/dist/cjs/{arcade-mode-1a1ca08b.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-b47bf04d.js → css-5f31bd3e.js} +1 -1
  20. package/dist/cjs/{cssMode-619368e7.js → cssMode-ff492b59.js} +3 -3
  21. package/dist/cjs/{html-eb9548ca.js → html-1c2bd19b.js} +3 -3
  22. package/dist/cjs/{htmlMode-78a30987.js → htmlMode-c41a13a0.js} +3 -3
  23. package/dist/cjs/{index-8ffe572c.js → index-5b78b967.js} +1 -1
  24. package/dist/cjs/index.cjs.js +3 -3
  25. package/dist/cjs/{javascript-8ccb9efd.js → javascript-df448d9d.js} +4 -4
  26. package/dist/cjs/{jsonMode-c1011baf.js → jsonMode-84bbbd5c.js} +3 -3
  27. package/dist/cjs/loader.cjs.js +2 -2
  28. package/dist/cjs/{tsMode-50f29f5b.js → tsMode-2a17886d.js} +3 -3
  29. package/dist/cjs/{typescript-28048dfb.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-9580166e.js → arcade-defaults-76893f90.js} +214 -186
  51. package/dist/esm/{arcade-mode-30ce5e7d.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-96f30c46.js → css-df075703.js} +1 -1
  55. package/dist/esm/{cssMode-405cf05c.js → cssMode-29792b94.js} +3 -3
  56. package/dist/esm/{html-dbe2e22c.js → html-8af94c18.js} +3 -3
  57. package/dist/esm/{htmlMode-314f2362.js → htmlMode-9b0c0d01.js} +3 -3
  58. package/dist/esm/{index-ad0aa031.js → index-e24c1311.js} +1 -1
  59. package/dist/esm/index.js +3 -3
  60. package/dist/esm/{javascript-7abc2fbd.js → javascript-405fba1f.js} +4 -4
  61. package/dist/esm/{jsonMode-38e2687b.js → jsonMode-8e88248b.js} +3 -3
  62. package/dist/esm/loader.js +3 -3
  63. package/dist/esm/{tsMode-3249efaa.js → tsMode-dd509037.js} +3 -3
  64. package/dist/esm/{typescript-05c0fa91.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-766b1b43.entry.js +0 -6
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
- * v4.29.0-beta.106
4
+ * v4.29.0-beta.108
5
5
  */
6
6
  'use strict';
7
7
 
8
- const index = require('./index-8ffe572c.js');
8
+ const index = require('./index-5b78b967.js');
9
9
 
10
10
  function _interopNamespace(e) {
11
11
  if (e && e.__esModule) return e;
@@ -120544,7 +120544,7 @@ registerLanguage({
120544
120544
  mimetypes: ["text/css"],
120545
120545
  loader: () => {
120546
120546
  {
120547
- return Promise.resolve().then(function () { return require('./css-b47bf04d.js'); });
120547
+ return Promise.resolve().then(function () { return require('./css-5f31bd3e.js'); });
120548
120548
  }
120549
120549
  }
120550
120550
  });
@@ -120562,7 +120562,7 @@ registerLanguage({
120562
120562
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
120563
120563
  loader: () => {
120564
120564
  {
120565
- return Promise.resolve().then(function () { return require('./html-eb9548ca.js'); });
120565
+ return Promise.resolve().then(function () { return require('./html-1c2bd19b.js'); });
120566
120566
  }
120567
120567
  }
120568
120568
  });
@@ -120582,7 +120582,7 @@ registerLanguage({
120582
120582
  mimetypes: ["text/javascript"],
120583
120583
  loader: () => {
120584
120584
  {
120585
- return Promise.resolve().then(function () { return require('./javascript-8ccb9efd.js'); });
120585
+ return Promise.resolve().then(function () { return require('./javascript-df448d9d.js'); });
120586
120586
  }
120587
120587
  }
120588
120588
  });
@@ -120600,7 +120600,7 @@ registerLanguage({
120600
120600
  mimetypes: ["text/typescript"],
120601
120601
  loader: () => {
120602
120602
  {
120603
- return Promise.resolve().then(function () { return require('./typescript-28048dfb.js'); });
120603
+ return Promise.resolve().then(function () { return require('./typescript-8bd442e6.js'); });
120604
120604
  }
120605
120605
  }
120606
120606
  });
@@ -120721,7 +120721,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
120721
120721
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
120722
120722
  function getMode$3() {
120723
120723
  {
120724
- return Promise.resolve().then(function () { return require('./cssMode-619368e7.js'); });
120724
+ return Promise.resolve().then(function () { return require('./cssMode-ff492b59.js'); });
120725
120725
  }
120726
120726
  }
120727
120727
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -120846,7 +120846,7 @@ monaco_editor_core_exports$2.languages.html = {
120846
120846
  };
120847
120847
  function getMode$2() {
120848
120848
  {
120849
- return Promise.resolve().then(function () { return require('./htmlMode-78a30987.js'); });
120849
+ return Promise.resolve().then(function () { return require('./htmlMode-c41a13a0.js'); });
120850
120850
  }
120851
120851
  }
120852
120852
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -120948,7 +120948,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
120948
120948
  monaco_editor_core_exports$1.languages.json = { jsonDefaults };
120949
120949
  function getMode$1() {
120950
120950
  {
120951
- return Promise.resolve().then(function () { return require('./jsonMode-c1011baf.js'); });
120951
+ return Promise.resolve().then(function () { return require('./jsonMode-84bbbd5c.js'); });
120952
120952
  }
120953
120953
  }
120954
120954
  monaco_editor_core_exports$1.languages.register({
@@ -121217,7 +121217,7 @@ monaco_editor_core_exports.languages.typescript = {
121217
121217
  };
121218
121218
  function getMode() {
121219
121219
  {
121220
- return Promise.resolve().then(function () { return require('./tsMode-50f29f5b.js'); });
121220
+ return Promise.resolve().then(function () { return require('./tsMode-2a17886d.js'); });
121221
121221
  }
121222
121222
  }
121223
121223
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -168967,6 +168967,10 @@ async function importPortalPortalItem() {
168967
168967
  const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/portal/PortalItem.js')); });
168968
168968
  return module.default;
168969
168969
  }
168970
+ async function newPortalPortalItem(properties) {
168971
+ const ModConstructor = await importPortalPortalItem();
168972
+ return new ModConstructor(properties);
168973
+ }
168970
168974
  async function importWebMap() {
168971
168975
  if (amd) {
168972
168976
  return requireModule("esri/WebMap");
@@ -168974,6 +168978,10 @@ async function importWebMap() {
168974
168978
  const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebMap.js')); });
168975
168979
  return module.default;
168976
168980
  }
168981
+ async function newWebMap(properties) {
168982
+ const ModConstructor = await importWebMap();
168983
+ return new ModConstructor(properties);
168984
+ }
168977
168985
  async function importWebScene() {
168978
168986
  if (amd) {
168979
168987
  return requireModule("esri/WebScene");
@@ -169000,19 +169008,14 @@ async function importRequest() {
169000
169008
  return module.default;
169001
169009
  }
169002
169010
 
169003
- async function newPortalItem(definition) {
169004
- const PortalItem = await importPortalPortalItem();
169005
- return new PortalItem(definition);
169006
- }
169011
+ //#region core adapter fix
169007
169012
  async function newFeatureLayer(definition) {
169008
169013
  const FeatureLayer = await importLayersFeatureLayer();
169009
169014
  // Fix title for the layer. Instead of defaulting to the map viewer style.
169010
169015
  return new FeatureLayer({ ...definition, sublayerTitleMode: "service-name" });
169011
169016
  }
169012
- async function newWebMap(definition) {
169013
- const WebMap = await importWebMap();
169014
- return new WebMap(definition);
169015
- }
169017
+ //#endregion
169018
+ //#region Type Guards
169016
169019
  function isSupportedLayerInstance(item) {
169017
169020
  return (!!item &&
169018
169021
  typeof item === "object" &&
@@ -169097,6 +169100,86 @@ function isPredefinedProfile(item) {
169097
169100
  typeof item.definitions === "object" &&
169098
169101
  !Array.isArray(item.definitions));
169099
169102
  }
169103
+ function isTitleCapableSource(item) {
169104
+ return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169105
+ }
169106
+ function isUrlCapableSource(item) {
169107
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169108
+ }
169109
+ function isLayerIdCapableSource(item) {
169110
+ return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169111
+ }
169112
+ function isFeatureTypesCapableLayer(item) {
169113
+ return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169114
+ }
169115
+ function isDomainsCapableLayer(item) {
169116
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169117
+ }
169118
+ function isSubtypeFieldCapableLayer(item) {
169119
+ return !!item && typeof item === "object" && "subtypeField" in item;
169120
+ }
169121
+ function isSubtypesCapableLayer(item) {
169122
+ return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
169123
+ }
169124
+ function isRelationshipsCapableLayer(item) {
169125
+ return (isLayerIdCapableSource(item) &&
169126
+ "relationships" in item &&
169127
+ "url" in item &&
169128
+ Array.isArray(item.relationships) &&
169129
+ typeof item.url === "string");
169130
+ }
169131
+ function isTableCapableLayer(item) {
169132
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169133
+ }
169134
+ function isLoadableSource(item) {
169135
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169136
+ }
169137
+ //#endregion
169138
+ //#region Service Metadata
169139
+ async function supportedSourceFromDefinition(definition) {
169140
+ if (!definition) {
169141
+ return null;
169142
+ }
169143
+ let source = null;
169144
+ if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
169145
+ source = definition;
169146
+ }
169147
+ else {
169148
+ source = await newFeatureLayer(definition);
169149
+ }
169150
+ if (isLoadableSource(source)) {
169151
+ await source.load();
169152
+ }
169153
+ return source;
169154
+ }
169155
+ async function serviceMetaData(url) {
169156
+ url += "/layers";
169157
+ const request = await importRequest();
169158
+ const response = await request(url, { responseType: "json", query: { f: "json" } });
169159
+ const data = {
169160
+ layers: response.data?.layers ?? [],
169161
+ tables: response.data?.tables ?? []
169162
+ };
169163
+ const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
169164
+ const layers = filterFeatureLayerInfos(data.layers, queryCapability);
169165
+ const tables = filterFeatureLayerInfos(data.tables, queryCapability);
169166
+ return { layers, tables };
169167
+ }
169168
+ function filterFeatureLayerInfos(layers, queryCapability) {
169169
+ return layers.filter((layer) => {
169170
+ if (layer.type !== "Feature Layer" && layer.type !== "Table") {
169171
+ return false;
169172
+ }
169173
+ const capabilities = layer.capabilities
169174
+ ? layer.capabilities
169175
+ .toLowerCase()
169176
+ .split(",")
169177
+ .map((value) => value.trim())
169178
+ : [];
169179
+ return capabilities.includes(queryCapability);
169180
+ });
169181
+ }
169182
+ //#endregion
169100
169183
 
169101
169184
  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}}
169102
169185
 
@@ -169215,42 +169298,8 @@ function supportedFields(fields) {
169215
169298
  });
169216
169299
  }
169217
169300
 
169218
- function isTitleCapableSource(item) {
169219
- return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169220
- }
169221
- function isUrlCapableSource(item) {
169222
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169223
- }
169224
- function isLayerIdCapableSource(item) {
169225
- return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169226
- }
169227
- function isFeatureTypesCapableLayer(item) {
169228
- return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169229
- }
169230
- function isDomainsCapableLayer(item) {
169231
- return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169232
- }
169233
- function isSubtypeFieldCapableLayer(item) {
169234
- return !!item && typeof item === "object" && "subtypeField" in item;
169235
- }
169236
- function isSubtypesCapableLayer(item) {
169237
- return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
169238
- }
169239
- function isRelationshipsCapableLayer(item) {
169240
- return (isLayerIdCapableSource(item) &&
169241
- "relationships" in item &&
169242
- "url" in item &&
169243
- Array.isArray(item.relationships) &&
169244
- typeof item.url === "string");
169245
- }
169246
- function isTableCapableLayer(item) {
169247
- return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169248
- }
169249
- function isLoadableSource(item) {
169250
- return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169251
- }
169252
169301
  //#endregion
169253
- //#region Support Functions
169302
+ //#region Support functions
169254
169303
  async function getRelatedFeatureLayer(layer, relationship) {
169255
169304
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
169256
169305
  await relatedFeatureLayer.load();
@@ -169291,64 +169340,6 @@ function sortFields(layer) {
169291
169340
  return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
169292
169341
  };
169293
169342
  }
169294
- function getTypeOrSubtypeDomainGroup(profile, types, field) {
169295
- // Try the coded domain first
169296
- if (isCodedValueDomainInstance(field.domain)) {
169297
- return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
169298
- }
169299
- // No coded domain, we will manufacture it
169300
- const values = types?.map((t) => {
169301
- const label = isSubtypeInstance(t) ? t.code : t.id;
169302
- return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
169303
- }) ?? [];
169304
- return new GroupOfVariables(profile, { code: "subtypes" }, values);
169305
- }
169306
- function getCodedValueDomainGroup(profile, domain, label) {
169307
- const values = domain.codedValues.map((v) => new ValueVariable({
169308
- profile,
169309
- label: `${v.code}`,
169310
- description: v.name,
169311
- snippet: `"${v.code}"`,
169312
- filterDescription: true
169313
- }));
169314
- return new GroupOfVariables(profile, label, values);
169315
- }
169316
- function getDomainValuesGroup(profile, types, field) {
169317
- const variables = [];
169318
- if (!types || types.length === 0) {
169319
- return null;
169320
- }
169321
- types.forEach((type) => {
169322
- let domain = type.domains[field.name];
169323
- if (!domain) {
169324
- return;
169325
- }
169326
- if (isInheritedDomainInstance(domain)) {
169327
- domain = field.domain;
169328
- return;
169329
- }
169330
- if (!isCodedValueDomainInstance(domain)) {
169331
- return;
169332
- }
169333
- const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
169334
- code: "domainvaluesfortypeformat",
169335
- formatValues: {
169336
- fieldName: field.alias ?? field.name,
169337
- typeName: type.name
169338
- }
169339
- });
169340
- const id = isSubtypeInstance(type) ? type.code : type.id;
169341
- const label = `${id}`;
169342
- const snippet = `"${id}""`;
169343
- const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
169344
- subtypeDictionary.variables = [domainValuesGroup];
169345
- variables.push(subtypeDictionary);
169346
- });
169347
- if (!variables.length) {
169348
- return null;
169349
- }
169350
- return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
169351
- }
169352
169343
  function areAllDomainsInherited(types, field) {
169353
169344
  return types?.every((type) => type.domains[field.name]?.type === "inherited") ?? false;
169354
169345
  }
@@ -169367,52 +169358,7 @@ function assembleMemberExpression(obj, prop) {
169367
169358
  return `${obj}${getMemberExpressionProperty(prop)}`;
169368
169359
  }
169369
169360
  //#endregion
169370
- //#region Sources
169371
- async function supportedSourceFromDefinition(definition) {
169372
- if (!definition) {
169373
- return null;
169374
- }
169375
- let source = null;
169376
- if (isSupportedLayerInstance(definition) || isFeatureSetInstance(definition) || isFieldsDefinition(definition)) {
169377
- source = definition;
169378
- }
169379
- else {
169380
- source = await newFeatureLayer(definition);
169381
- }
169382
- if (isLoadableSource(source)) {
169383
- await source.load();
169384
- }
169385
- return source;
169386
- }
169387
- async function serviceMetaData(url) {
169388
- url += "/layers";
169389
- const request = await importRequest();
169390
- const response = await request(url, { responseType: "json", query: { f: "json" } });
169391
- const data = {
169392
- layers: response.data?.layers ?? [],
169393
- tables: response.data?.tables ?? []
169394
- };
169395
- const queryCapability = url.endsWith("MapServer/layers") ? "data" : "query";
169396
- const layers = filterFeatureLayerInfos(data.layers, queryCapability);
169397
- const tables = filterFeatureLayerInfos(data.tables, queryCapability);
169398
- return { layers, tables };
169399
- }
169400
- function filterFeatureLayerInfos(layers, queryCapability) {
169401
- return layers.filter((layer) => {
169402
- if (layer.type !== "Feature Layer" && layer.type !== "Table") {
169403
- return false;
169404
- }
169405
- const capabilities = layer.capabilities
169406
- ? layer.capabilities
169407
- .toLowerCase()
169408
- .split(",")
169409
- .map((value) => value.trim())
169410
- : [];
169411
- return capabilities.includes(queryCapability);
169412
- });
169413
- }
169414
- //#endregion
169415
- //#region Functions to Editor Variables to a language service variables
169361
+ //#region Editor Profile to Language Service Profile functions
169416
169362
  async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
169417
169363
  return await Promise.all(editorVariables.map(async (editorVariable) => {
169418
169364
  switch (editorVariable.type) {
@@ -169673,8 +169619,9 @@ class ArrayVariable extends VariableBase {
169673
169619
  * collection is ready or not.
169674
169620
  */
169675
169621
  class CollectionBasedVariable extends VariableBase {
169676
- constructor() {
169677
- super(...arguments);
169622
+ constructor(owner, props) {
169623
+ super(props);
169624
+ this.owner = owner;
169678
169625
  this.isCollection = true;
169679
169626
  this._loaded = true;
169680
169627
  /**
@@ -169684,6 +169631,15 @@ class CollectionBasedVariable extends VariableBase {
169684
169631
  */
169685
169632
  this.variables = [];
169686
169633
  }
169634
+ get breadcrumb() {
169635
+ // If there's an owner, prepend its breadcrumb and append the current name
169636
+ if (this.owner) {
169637
+ const ownerBreadcrumb = this.owner.breadcrumb;
169638
+ return ownerBreadcrumb ? `${ownerBreadcrumb} > ${this.name}` : this.name;
169639
+ }
169640
+ // If there's no owner, this is the root element, so just return its name
169641
+ return this.name;
169642
+ }
169687
169643
  /**
169688
169644
  * Returns true if the collection has been loaded
169689
169645
  */
@@ -169719,8 +169675,8 @@ class GroupOfVariables extends ProfileItemBase {
169719
169675
  }
169720
169676
  }
169721
169677
  class DictionaryVariable extends CollectionBasedVariable {
169722
- constructor(props) {
169723
- super(props);
169678
+ constructor(owner, props) {
169679
+ super(owner, props);
169724
169680
  this.type = "dictionary";
169725
169681
  /**
169726
169682
  * The variables that the dictionary holds. It is different than the variables.
@@ -169758,23 +169714,26 @@ class DictionaryVariable extends CollectionBasedVariable {
169758
169714
  case "text":
169759
169715
  case "boolean":
169760
169716
  case "date":
169717
+ case "dateOnly":
169718
+ case "time":
169761
169719
  case "geometry":
169720
+ case "knowledgeGraph":
169762
169721
  return new ValueVariable({ profile: this._profile, declaration, label: snippet, snippet });
169763
169722
  case "feature":
169764
- return new FeatureVariable({ profile: this._profile, declaration, label: snippet, snippet });
169723
+ return new FeatureVariable(this, { profile: this._profile, declaration, label: snippet, snippet });
169765
169724
  case "featureSet":
169766
- return new FeatureSetVariable({ profile: this._profile, declaration, label: snippet, snippet }, [
169725
+ return new FeatureSetVariable(this, { profile: this._profile, declaration, label: snippet, snippet }, [
169767
169726
  new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })
169768
169727
  ]);
169769
169728
  case "featureSetCollection":
169770
- return new FeatureSetCollectionVariable({
169729
+ return new FeatureSetCollectionVariable(this, {
169771
169730
  profile: this._profile,
169772
169731
  declaration,
169773
169732
  label: snippet,
169774
169733
  snippet
169775
169734
  });
169776
169735
  case "dictionary":
169777
- return new DictionaryVariable({
169736
+ return new DictionaryVariable(this, {
169778
169737
  profile: this._profile,
169779
169738
  declaration,
169780
169739
  label: snippet,
@@ -169788,7 +169747,7 @@ class DictionaryVariable extends CollectionBasedVariable {
169788
169747
  snippet
169789
169748
  });
169790
169749
  default:
169791
- console.error("Invalid profile variable", declaration);
169750
+ console.error("Editor profile: Invalid profile variable", declaration);
169792
169751
  return null;
169793
169752
  }
169794
169753
  }
@@ -169802,8 +169761,8 @@ class DictionaryVariable extends CollectionBasedVariable {
169802
169761
  }
169803
169762
  }
169804
169763
  class SourceBasedVariable extends CollectionBasedVariable {
169805
- constructor(props, relationshipsProperties) {
169806
- super(props);
169764
+ constructor(owner, props, relationshipsProperties) {
169765
+ super(owner, props);
169807
169766
  this.relationshipsProperties = relationshipsProperties;
169808
169767
  this._source = null;
169809
169768
  this._loaded = false;
@@ -169902,7 +169861,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169902
169861
  // Sepcial case for the subtype field
169903
169862
  if (field.name === this._source.subtypeField) {
169904
169863
  const domainDictionary = this._createDomainDictionary(field);
169905
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.subtypes, field));
169864
+ domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, field));
169906
169865
  return domainDictionary;
169907
169866
  }
169908
169867
  // Check if all the domains for the field in the types are inherited.
@@ -169912,7 +169871,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169912
169871
  }
169913
169872
  // We have domains per subtype
169914
169873
  // We need to go thru each types and create a dictionary.
169915
- const domainValuesBySubtypeGroup = getDomainValuesGroup(this._profile, this._source.subtypes, field);
169874
+ const domainValuesBySubtypeGroup = this._getDomainValuesGroup(this._source.subtypes, field);
169916
169875
  if (!domainValuesBySubtypeGroup) {
169917
169876
  return null;
169918
169877
  }
@@ -169928,7 +169887,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169928
169887
  // Special case for the type id field
169929
169888
  if (field.name === this._source.typeIdField) {
169930
169889
  const domainDictionary = this._createDomainDictionary(field);
169931
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.types, field));
169890
+ domainDictionary.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, field));
169932
169891
  return domainDictionary;
169933
169892
  }
169934
169893
  // Check if all the domains for the field in the types are inherited.
@@ -169938,7 +169897,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169938
169897
  }
169939
169898
  // We have domains per feature type
169940
169899
  // We need to go thru each types and create a dictionary.
169941
- const domainValuesByFeatureTypeGroup = getDomainValuesGroup(this._profile, this._source.types, field);
169900
+ const domainValuesByFeatureTypeGroup = this._getDomainValuesGroup(this._source.types, field);
169942
169901
  if (!domainValuesByFeatureTypeGroup) {
169943
169902
  return null;
169944
169903
  }
@@ -169955,24 +169914,93 @@ class SourceBasedVariable extends CollectionBasedVariable {
169955
169914
  if (!isCodedValueDomainInstance(fieldDomain)) {
169956
169915
  return null;
169957
169916
  }
169958
- const domainValuesGroup = getCodedValueDomainGroup(this._profile, fieldDomain, {
169917
+ const domainValuesGroup = this._getCodedValueDomainGroup(fieldDomain, {
169959
169918
  code: "domainvalues"
169960
169919
  });
169961
169920
  const domainDictionary = this._createDomainDictionary(field);
169962
169921
  domainDictionary.variables.push(domainValuesGroup);
169963
169922
  return domainDictionary;
169964
169923
  }
169924
+ _getTypeOrSubtypeDomainGroup(types, field) {
169925
+ // Try the coded domain first
169926
+ if (isCodedValueDomainInstance(field.domain)) {
169927
+ return this._getCodedValueDomainGroup(field.domain, { code: "subtypes" });
169928
+ }
169929
+ // No coded domain, we will manufacture it
169930
+ const values = types?.map((t) => {
169931
+ const label = isSubtypeInstance(t) ? t.code : t.id;
169932
+ return new ValueVariable({
169933
+ profile: this._profile,
169934
+ label: `${label}`,
169935
+ description: t.name,
169936
+ snippet: `"${label}"`
169937
+ });
169938
+ }) ?? [];
169939
+ return new GroupOfVariables(this._profile, { code: "subtypes" }, values);
169940
+ }
169941
+ _getCodedValueDomainGroup(domain, label) {
169942
+ const values = domain.codedValues.map((v) => new ValueVariable({
169943
+ profile: this._profile,
169944
+ label: `${v.code}`,
169945
+ description: v.name,
169946
+ snippet: `"${v.code}"`,
169947
+ filterDescription: true
169948
+ }));
169949
+ return new GroupOfVariables(this._profile, label, values);
169950
+ }
169951
+ _getDomainValuesGroup(types, field) {
169952
+ const variables = [];
169953
+ if (!types || types.length === 0) {
169954
+ return null;
169955
+ }
169956
+ types.forEach((type) => {
169957
+ let domain = type.domains[field.name];
169958
+ if (!domain) {
169959
+ return;
169960
+ }
169961
+ if (isInheritedDomainInstance(domain)) {
169962
+ domain = field.domain;
169963
+ return;
169964
+ }
169965
+ if (!isCodedValueDomainInstance(domain)) {
169966
+ return;
169967
+ }
169968
+ const domainValuesGroup = this._getCodedValueDomainGroup(domain, {
169969
+ code: "domainvaluesfortypeformat",
169970
+ formatValues: {
169971
+ fieldName: field.alias ?? field.name,
169972
+ typeName: type.name
169973
+ }
169974
+ });
169975
+ const id = isSubtypeInstance(type) ? type.code : type.id;
169976
+ const label = `${id}`;
169977
+ const snippet = `"${id}""`;
169978
+ const subtypeDictionary = new DictionaryVariable(this, {
169979
+ profile: this._profile,
169980
+ label,
169981
+ snippet,
169982
+ declaration: { name: field.alias ?? field.name }
169983
+ });
169984
+ subtypeDictionary.variables = [domainValuesGroup];
169985
+ variables.push(subtypeDictionary);
169986
+ });
169987
+ if (!variables.length) {
169988
+ return null;
169989
+ }
169990
+ return new GroupOfVariables(this._profile, { code: "domainvaluesbysubtypes" }, variables);
169991
+ }
169965
169992
  _createDomainDictionary(field) {
169966
169993
  // Create the domain dictionary.
169967
169994
  // The dictionary will have a header group and a value group.
169968
169995
  // At this point we are only creating the header group in the dictionary.
169969
169996
  const valueSnippet = this._getValueSnippet(field);
169970
- const domainDictionary = new DictionaryVariable({
169997
+ const domainDictionary = new DictionaryVariable(this, {
169971
169998
  profile: this._profile,
169972
169999
  label: valueSnippet,
169973
170000
  description: field.alias ?? field.name,
169974
170001
  snippet: valueSnippet,
169975
- icon: "form-dropdown"
170002
+ icon: "form-dropdown",
170003
+ declaration: { name: field.alias ?? field.name }
169976
170004
  });
169977
170005
  // Add the header group
169978
170006
  const headerGroup = new GroupOfVariables(this._profile, field.alias ?? field.name, [
@@ -170016,7 +170044,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
170016
170044
  return null;
170017
170045
  }
170018
170046
  const snippet = `FeatureSetByRelationshipName(${this.snippet}, "${relationship.name}")`;
170019
- return new FeatureSetVariable({
170047
+ return new FeatureSetVariable(this, {
170020
170048
  profile: this._profile,
170021
170049
  declaration: { definition: relatedLayer },
170022
170050
  label: relatedLayer.title,
@@ -170032,8 +170060,8 @@ class SourceBasedVariable extends CollectionBasedVariable {
170032
170060
  }
170033
170061
  }
170034
170062
  class FeatureVariable extends SourceBasedVariable {
170035
- constructor(props) {
170036
- super(props, { exposeRelationships: true });
170063
+ constructor(owner, props) {
170064
+ super(owner, props, { exposeRelationships: true });
170037
170065
  this.type = "feature";
170038
170066
  }
170039
170067
  get title() {
@@ -170101,11 +170129,11 @@ class FeatureVariable extends SourceBasedVariable {
170101
170129
  }
170102
170130
  }
170103
170131
  class FeatureSetVariable extends SourceBasedVariable {
170104
- constructor(props, featureSetSnippets = [],
170132
+ constructor(owner, props, featureSetSnippets = [],
170105
170133
  // Relationships for feature set if only supported if the feature set is actually
170106
170134
  // representing a relationsip feature layer for a feature source.
170107
170135
  relationshipProps) {
170108
- super(props, relationshipProps);
170136
+ super(owner, props, relationshipProps);
170109
170137
  this.featureSetSnippets = featureSetSnippets;
170110
170138
  this.type = "featureSet";
170111
170139
  }
@@ -170152,8 +170180,8 @@ class FeatureSetVariable extends SourceBasedVariable {
170152
170180
  }
170153
170181
  }
170154
170182
  class FeatureSetCollectionVariable extends CollectionBasedVariable {
170155
- constructor(props) {
170156
- super(props);
170183
+ constructor(owner, props) {
170184
+ super(owner, props);
170157
170185
  this.type = "featureSetCollection";
170158
170186
  this._featureSetCollections = null;
170159
170187
  this._loaded = false;
@@ -170261,7 +170289,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170261
170289
  };
170262
170290
  }
170263
170291
  async _featureSetCollectionFromPortalItem(definition) {
170264
- const portalItem = await newPortalItem(definition);
170292
+ const portalItem = await newPortalPortalItem(definition);
170265
170293
  await portalItem.load();
170266
170294
  switch (portalItem.type) {
170267
170295
  case "Web Map": {
@@ -170320,9 +170348,9 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170320
170348
  return layerVariables;
170321
170349
  }
170322
170350
  _createFeatureSetVariable(featureLayer, isFromWebMap = false) {
170323
- return new FeatureSetVariable({
170351
+ return new FeatureSetVariable(this, {
170324
170352
  profile: this._profile,
170325
- declaration: { definition: featureLayer },
170353
+ declaration: { name: featureLayer.title, definition: featureLayer },
170326
170354
  label: featureLayer.title,
170327
170355
  description: "",
170328
170356
  nonInteractive: true
@@ -170360,7 +170388,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170360
170388
  class EditorProfile extends DictionaryVariable {
170361
170389
  constructor(definition, intlStrings, locale = "en") {
170362
170390
  // Delay the load of the variable declarations so we have a `this`
170363
- super({
170391
+ super(undefined, {
170364
170392
  profile: null,
170365
170393
  declaration: { properties: [] }
170366
170394
  });