@arcgis/coding-components 4.29.0-beta.69 → 4.29.0-beta.70

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 (38) hide show
  1. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +1 -1
  2. package/dist/arcgis-coding-components/index.esm.js +1 -1
  3. package/dist/arcgis-coding-components/{p-ef6982d2.js → p-21871ede.js} +1 -1
  4. package/dist/arcgis-coding-components/{p-0c2f4384.js → p-3b2457f7.js} +7 -7
  5. package/dist/arcgis-coding-components/{p-d07b6214.js → p-45b5bca3.js} +1 -1
  6. package/dist/arcgis-coding-components/{p-723fc69e.js → p-59247049.js} +1 -1
  7. package/dist/arcgis-coding-components/{p-a73841b8.js → p-6e1f1ee0.js} +1 -1
  8. package/dist/arcgis-coding-components/{p-0f636dd2.js → p-8010edc0.js} +1 -1
  9. package/dist/arcgis-coding-components/{p-03b0ec9a.js → p-9301388a.js} +1 -1
  10. package/dist/arcgis-coding-components/{p-8fb41167.entry.js → p-be5ec0c4.entry.js} +1 -1
  11. package/dist/arcgis-coding-components/{p-4f5314f5.js → p-c0bf49ad.js} +1 -1
  12. package/dist/arcgis-coding-components/{p-7416105e.js → p-ec3e9c42.js} +1 -1
  13. package/dist/cjs/{arcade-defaults-51a9667c.js → arcade-defaults-82737060.js} +114 -236
  14. package/dist/cjs/{arcade-mode-7705211c.js → arcade-mode-b21b24cc.js} +1 -1
  15. package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +2 -2
  16. package/dist/cjs/{cssMode-1569c17b.js → cssMode-bc43621f.js} +1 -1
  17. package/dist/cjs/{html-198d0fbe.js → html-4a747b36.js} +1 -1
  18. package/dist/cjs/{htmlMode-cb94b682.js → htmlMode-c11513d8.js} +1 -1
  19. package/dist/cjs/index.cjs.js +1 -1
  20. package/dist/cjs/{javascript-c39cbb25.js → javascript-51f1b49d.js} +2 -2
  21. package/dist/cjs/{jsonMode-23c556fc.js → jsonMode-3985bbe9.js} +1 -1
  22. package/dist/cjs/{tsMode-f2bafe49.js → tsMode-b2b3fb82.js} +1 -1
  23. package/dist/cjs/{typescript-ee8ec13b.js → typescript-795a538e.js} +1 -1
  24. package/dist/components/arcade-defaults.js +108 -230
  25. package/dist/esm/{arcade-defaults-501b9076.js → arcade-defaults-375c8393.js} +114 -236
  26. package/dist/esm/{arcade-mode-f97a9a16.js → arcade-mode-2b1c4c38.js} +1 -1
  27. package/dist/esm/arcgis-arcade-api_6.entry.js +2 -2
  28. package/dist/esm/{cssMode-df00f38e.js → cssMode-2d3bbf6d.js} +1 -1
  29. package/dist/esm/{html-c506d52b.js → html-ba801b93.js} +1 -1
  30. package/dist/esm/{htmlMode-01fe416c.js → htmlMode-790fcdc3.js} +1 -1
  31. package/dist/esm/index.js +1 -1
  32. package/dist/esm/{javascript-2d3d5417.js → javascript-10081345.js} +2 -2
  33. package/dist/esm/{jsonMode-a5223892.js → jsonMode-d6de3d90.js} +1 -1
  34. package/dist/esm/{tsMode-019f7ae9.js → tsMode-2efadb1a.js} +1 -1
  35. package/dist/esm/{typescript-dd5fb7df.js → typescript-534a4558.js} +1 -1
  36. package/dist/types/utils/profile/editor-profile.d.ts +5 -19
  37. package/dist/types/utils/profile/utils.d.ts +11 -15
  38. package/package.json +6 -6
@@ -120535,7 +120535,7 @@ registerLanguage({
120535
120535
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
120536
120536
  loader: () => {
120537
120537
  {
120538
- return import('./html-c506d52b.js');
120538
+ return import('./html-ba801b93.js');
120539
120539
  }
120540
120540
  }
120541
120541
  });
@@ -120555,7 +120555,7 @@ registerLanguage({
120555
120555
  mimetypes: ["text/javascript"],
120556
120556
  loader: () => {
120557
120557
  {
120558
- return import('./javascript-2d3d5417.js');
120558
+ return import('./javascript-10081345.js');
120559
120559
  }
120560
120560
  }
120561
120561
  });
@@ -120573,7 +120573,7 @@ registerLanguage({
120573
120573
  mimetypes: ["text/typescript"],
120574
120574
  loader: () => {
120575
120575
  {
120576
- return import('./typescript-dd5fb7df.js');
120576
+ return import('./typescript-534a4558.js');
120577
120577
  }
120578
120578
  }
120579
120579
  });
@@ -120694,7 +120694,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
120694
120694
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
120695
120695
  function getMode$3() {
120696
120696
  {
120697
- return import('./cssMode-df00f38e.js');
120697
+ return import('./cssMode-2d3bbf6d.js');
120698
120698
  }
120699
120699
  }
120700
120700
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -120819,7 +120819,7 @@ monaco_editor_core_exports$2.languages.html = {
120819
120819
  };
120820
120820
  function getMode$2() {
120821
120821
  {
120822
- return import('./htmlMode-01fe416c.js');
120822
+ return import('./htmlMode-790fcdc3.js');
120823
120823
  }
120824
120824
  }
120825
120825
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -120921,7 +120921,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
120921
120921
  monaco_editor_core_exports$1.languages.json = { jsonDefaults };
120922
120922
  function getMode$1() {
120923
120923
  {
120924
- return import('./jsonMode-a5223892.js');
120924
+ return import('./jsonMode-d6de3d90.js');
120925
120925
  }
120926
120926
  }
120927
120927
  monaco_editor_core_exports$1.languages.register({
@@ -121190,7 +121190,7 @@ monaco_editor_core_exports.languages.typescript = {
121190
121190
  };
121191
121191
  function getMode() {
121192
121192
  {
121193
- return import('./tsMode-019f7ae9.js');
121193
+ return import('./tsMode-2efadb1a.js');
121194
121194
  }
121195
121195
  }
121196
121196
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -168978,83 +168978,47 @@ async function newWebMap(definition) {
168978
168978
  function isSupportedLayerInstance(item) {
168979
168979
  return (!!item &&
168980
168980
  typeof item === "object" &&
168981
- "declaredClass" in item &&
168982
168981
  typeof item.declaredClass === "string" &&
168983
168982
  item.declaredClass.startsWith("esri.layers."));
168984
168983
  }
168985
168984
  function isFeatureSetInstance(item) {
168986
168985
  return (!!item &&
168987
168986
  typeof item === "object" &&
168988
- "declaredClass" in item &&
168989
168987
  typeof item.declaredClass === "string" &&
168990
168988
  item.declaredClass === "esri.rest.support.FeatureSet");
168991
168989
  }
168992
168990
  function isQueryableLayerInstance(item) {
168993
168991
  return (!!item &&
168994
168992
  typeof item === "object" &&
168995
- "declaredClass" in item &&
168996
168993
  typeof item.declaredClass === "string" &&
168997
168994
  item.declaredClass.startsWith("esri.layers.") &&
168998
168995
  "fields" in item &&
168999
- "queryFeatures" in item &&
169000
168996
  typeof item.queryFeatures === "function");
169001
168997
  }
169002
- function isSubtypeSublayerInstance(item) {
169003
- return (!!item &&
169004
- typeof item === "object" &&
169005
- "declaredClass" in item &&
169006
- typeof item.declaredClass === "string" &&
169007
- item.declaredClass === "esri.layers.support.SubtypeSublayer");
169008
- }
169009
168998
  function isGroupLayerInstance(item) {
169010
168999
  return (!!item &&
169011
169000
  typeof item === "object" &&
169012
- "declaredClass" in item &&
169013
169001
  typeof item.declaredClass === "string" &&
169014
169002
  item.declaredClass === "esri.layers.GroupLayer");
169015
169003
  }
169016
169004
  function isWebMapInstance(item) {
169017
- return (!!item &&
169018
- typeof item === "object" &&
169019
- "declaredClass" in item &&
169020
- typeof item.declaredClass === "string" &&
169021
- item.declaredClass === "esri.WebMap");
169005
+ return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
169022
169006
  }
169023
169007
  function isPortalItemDefinition(item) {
169024
- return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169008
+ return !!item && typeof item === "object" && item.portalItem != null;
169025
169009
  }
169026
169010
  function isFeatureLayerItemDefinition(item) {
169027
- return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169011
+ return !!item && typeof item === "object" && item.portalItem != null;
169028
169012
  }
169029
169013
  function isFieldsDefinition(item) {
169030
- return (!!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields) && !("declaredClass" in item));
169014
+ return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
169031
169015
  }
169032
169016
  function isUrlDefinition(item) {
169033
- return (!!item && typeof item === "object" && "url" in item && typeof item.url === "string" && !("declaredClass" in item));
169034
- }
169035
- function isSubtypeInstance(item) {
169036
- return (!!item &&
169037
- typeof item === "object" &&
169038
- "declaredClass" in item &&
169039
- item.declaredClass === "esri.layers.support.Subtype");
169040
- }
169041
- function isCodedValueDomainInstance(item) {
169042
- return (!!item &&
169043
- typeof item === "object" &&
169044
- "declaredClass" in item &&
169045
- item.declaredClass === "esri.layers.support.CodedValueDomain");
169046
- }
169047
- function isInheritedDomainInstance(item) {
169048
- return (!!item &&
169049
- typeof item === "object" &&
169050
- "declaredClass" in item &&
169051
- item.declaredClass === "esri.layers.support.InheritedDomain");
169017
+ return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in item);
169052
169018
  }
169053
169019
  function isPredefinedProfile(item) {
169054
169020
  return (!!item &&
169055
169021
  typeof item === "object" &&
169056
- "id" in item &&
169057
- "definitions" in item &&
169058
169022
  typeof item.id === "string" &&
169059
169023
  typeof item.definitions === "object" &&
169060
169024
  !Array.isArray(item.definitions));
@@ -169177,40 +169141,41 @@ function supportedFields(fields) {
169177
169141
  });
169178
169142
  }
169179
169143
 
169180
- function isTitleCapableSource(item) {
169181
- return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169182
- }
169183
- function isUrlCapableSource(item) {
169184
- return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169185
- }
169186
- function isLayerIdCapableSource(item) {
169187
- return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169188
- }
169189
- function isFeatureTypesCapableLayer(item) {
169190
- return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169144
+ function resolveIntlPath(dictionary, path) {
169145
+ if (!dictionary) {
169146
+ return "";
169147
+ }
169148
+ const pathSegments = path.split(".");
169149
+ let pathSegment = pathSegments.shift();
169150
+ let entry = dictionary;
169151
+ while (entry && pathSegment) {
169152
+ // @ts-expect-error
169153
+ entry = entry[pathSegment];
169154
+ pathSegment = pathSegments.shift();
169155
+ }
169156
+ return typeof entry === "string" ? entry : path;
169191
169157
  }
169192
- function isSubtypesCapableLayer(item) {
169193
- return !!item && typeof item === "object" && "subtypeField" in item && "subtypes" in item;
169158
+ function isTypesCapabaleLayer(item) {
169159
+ return !!item?.typeIdField;
169194
169160
  }
169195
169161
  function isDomainsCapableLayer(item) {
169196
- return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169162
+ return typeof item?.getFieldDomain === "function";
169197
169163
  }
169198
169164
  function isRelationshipsCapableLayer(item) {
169199
- return (isLayerIdCapableSource(item) &&
169200
- "relationships" in item &&
169201
- "url" in item &&
169202
- Array.isArray(item.relationships) &&
169203
- typeof item.url === "string");
169165
+ return Array.isArray(item?.relationships) && typeof item?.url === "string";
169204
169166
  }
169205
169167
  function isTableCapableLayer(item) {
169206
- return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169168
+ return typeof item?.isTable === "boolean";
169207
169169
  }
169208
169170
  function isLoadableSource(item) {
169209
- return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169171
+ return typeof item?.load === "function";
169210
169172
  }
169211
169173
  //#endregion
169212
169174
  //#region Support Functions
169213
169175
  async function getRelatedFeatureLayer(layer, relationship) {
169176
+ if (!relationship) {
169177
+ return null;
169178
+ }
169214
169179
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
169215
169180
  await relatedFeatureLayer.load();
169216
169181
  return relatedFeatureLayer;
@@ -169223,23 +169188,7 @@ function sortFields(layer) {
169223
169188
  if (secondField.type === "oid") {
169224
169189
  return 1;
169225
169190
  }
169226
- if (isSubtypeSublayerInstance(layer)) {
169227
- if (firstField.name === layer.parent.subtypeField) {
169228
- return -1;
169229
- }
169230
- if (secondField.name === layer.parent.subtypeField) {
169231
- return 1;
169232
- }
169233
- }
169234
- if (isSubtypesCapableLayer(layer)) {
169235
- if (firstField.name === layer.subtypeField) {
169236
- return -1;
169237
- }
169238
- if (secondField.name === layer.subtypeField) {
169239
- return 1;
169240
- }
169241
- }
169242
- if (isFeatureTypesCapableLayer(layer)) {
169191
+ if (isTypesCapabaleLayer(layer)) {
169243
169192
  if (firstField.name === layer.typeIdField) {
169244
169193
  return -1;
169245
169194
  }
@@ -169250,19 +169199,20 @@ function sortFields(layer) {
169250
169199
  return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
169251
169200
  };
169252
169201
  }
169253
- function getTypeOrSubtypeDomainGroup(profile, types, field) {
169202
+ function getSubtypesProperties(profile, types, field) {
169254
169203
  // Try the coded domain first
169255
- if (isCodedValueDomainInstance(field.domain)) {
169256
- return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
169204
+ const group = getDomainValuesProperties(profile, field.domain, { code: "subtypes" });
169205
+ if (group) {
169206
+ return group;
169257
169207
  }
169258
- // No coded domain, we will manufacture it
169259
- const values = types.map((t) => {
169260
- const label = isSubtypeInstance(t) ? t.code : t.id;
169261
- return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
169262
- });
169208
+ // No coded domain for the subtypes, we will manufacture it
169209
+ const values = types.map((t) => new ValueVariable({ profile, label: `${t.id}`, description: t.name, snippet: `"${t.id}"` }));
169263
169210
  return new GroupOfVariables(profile, { code: "subtypes" }, values);
169264
169211
  }
169265
- function getCodedValueDomainGroup(profile, domain, label) {
169212
+ function getDomainValuesProperties(profile, domain, label) {
169213
+ if (!domain || domain.type !== "coded-value") {
169214
+ return null;
169215
+ }
169266
169216
  const values = domain.codedValues.map((v) => new ValueVariable({
169267
169217
  profile,
169268
169218
  label: `${v.code}`,
@@ -169272,33 +169222,29 @@ function getCodedValueDomainGroup(profile, domain, label) {
169272
169222
  }));
169273
169223
  return new GroupOfVariables(profile, label, values);
169274
169224
  }
169275
- function getDomainValuesGroup(profile, types, field) {
169225
+ function getDomainValuesBySubtypeGroup(profile, types, field) {
169276
169226
  const variables = [];
169277
- if (types.length === 0) {
169278
- return null;
169279
- }
169280
- types.forEach((type) => {
169281
- let domain = type.domains[field.name];
169227
+ types.forEach((t) => {
169228
+ let domain = t.domains[field.name];
169282
169229
  if (!domain) {
169283
169230
  return;
169284
169231
  }
169285
- if (isInheritedDomainInstance(domain)) {
169232
+ if (domain.type === "inherited") {
169286
169233
  domain = field.domain;
169287
169234
  return;
169288
169235
  }
169289
- if (!isCodedValueDomainInstance(domain)) {
169290
- return;
169291
- }
169292
- const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
169236
+ const domainValuesGroup = getDomainValuesProperties(profile, domain, {
169293
169237
  code: "domainvaluesfortypeformat",
169294
169238
  formatValues: {
169295
169239
  fieldName: field.alias ?? field.name,
169296
- typeName: type.name
169240
+ typeName: t.name
169297
169241
  }
169298
169242
  });
169299
- const id = isSubtypeInstance(type) ? type.code : type.id;
169300
- const label = `${id}`;
169301
- const snippet = `"${id}""`;
169243
+ if (!domainValuesGroup) {
169244
+ return;
169245
+ }
169246
+ const label = `${t.id}`;
169247
+ const snippet = `"${t.id}""`;
169302
169248
  const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
169303
169249
  subtypeDictionary.variables = [domainValuesGroup];
169304
169250
  variables.push(subtypeDictionary);
@@ -169308,9 +169254,6 @@ function getDomainValuesGroup(profile, types, field) {
169308
169254
  }
169309
169255
  return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
169310
169256
  }
169311
- function areAllDomainsInherited(types, field) {
169312
- return types.every((type) => type.domains[field.name].type === "inherited");
169313
- }
169314
169257
  // const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
169315
169258
  const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
169316
169259
  function getMemberExpressionProperty(prop, includeDot = true) {
@@ -169338,6 +169281,10 @@ async function supportedSourceFromDefinition(definition) {
169338
169281
  else {
169339
169282
  source = await newFeatureLayer(definition);
169340
169283
  }
169284
+ if (!source) {
169285
+ console.error("Invalid FeatureSetDefinition", definition);
169286
+ return null;
169287
+ }
169341
169288
  if (isLoadableSource(source)) {
169342
169289
  await source.load();
169343
169290
  }
@@ -169373,7 +169320,10 @@ function filterFeatureLayerInfos(layers, queryCapability) {
169373
169320
  //#endregion
169374
169321
  //#region Functions to Editor Variables to a language service variables
169375
169322
  async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
169376
- return await Promise.all(editorVariables.map(async (editorVariable) => {
169323
+ if (!editorVariables) {
169324
+ return [];
169325
+ }
169326
+ const properties = await Promise.all(editorVariables.map(async (editorVariable) => {
169377
169327
  switch (editorVariable.type) {
169378
169328
  case "dictionary":
169379
169329
  return await dictionaryToLSDictionary(editorVariable, kind);
@@ -169383,6 +169333,7 @@ async function variablesToLSVariable(editorVariables, kind = main.CompletionItem
169383
169333
  return variableToLSVariable(editorVariable, kind);
169384
169334
  }
169385
169335
  }));
169336
+ return properties.filter((p) => p);
169386
169337
  }
169387
169338
  function variableToLSVariable(editorVariable, kind) {
169388
169339
  const { name, type } = editorVariable;
@@ -169500,7 +169451,7 @@ async function dictionaryToLSDictionary(editorDictionary, kind) {
169500
169451
  previous += ` \n${description}`;
169501
169452
  }
169502
169453
  return previous;
169503
- }, description);
169454
+ }, description ?? "");
169504
169455
  return {
169505
169456
  name,
169506
169457
  description,
@@ -169555,7 +169506,7 @@ class ProfileItemBase {
169555
169506
  if (typeof this.description === "string") {
169556
169507
  return this.description;
169557
169508
  }
169558
- return D(this._profile?.intlStrings[this.description.code], this.description.formatValues);
169509
+ return D(this._profile?.intlStrings[this.description.code ?? ""], this.description.formatValues);
169559
169510
  }
169560
169511
  /**
169561
169512
  * Returns true if the item pass the filter test
@@ -169578,7 +169529,7 @@ class VariableBase extends ProfileItemBase {
169578
169529
  super(props.profile, props.label, props.description ?? props.declaration?.description);
169579
169530
  this.declaration = props.declaration ?? {};
169580
169531
  this.name = props.declaration?.name ?? "";
169581
- this.snippet = props.snippet ?? "";
169532
+ this.snippet = props.snippet || "";
169582
169533
  this.nonInteractive = props.nonInteractive ?? false;
169583
169534
  this.filterDescription = props.filterDescription ?? false;
169584
169535
  this.icon = props.icon;
@@ -169596,7 +169547,7 @@ class ValueVariable extends VariableBase {
169596
169547
  }
169597
169548
  getDescription() {
169598
169549
  if (this.description == null) {
169599
- return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
169550
+ return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
169600
169551
  }
169601
169552
  return super.getDescription();
169602
169553
  }
@@ -169617,7 +169568,7 @@ class ArrayVariable extends VariableBase {
169617
169568
  }
169618
169569
  getDescription() {
169619
169570
  if (this.description == null) {
169620
- return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
169571
+ return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
169621
169572
  }
169622
169573
  return super.getDescription();
169623
169574
  }
@@ -169632,8 +169583,8 @@ class ArrayVariable extends VariableBase {
169632
169583
  * collection is ready or not.
169633
169584
  */
169634
169585
  class CollectionBasedVariable extends VariableBase {
169635
- constructor() {
169636
- super(...arguments);
169586
+ constructor(props) {
169587
+ super(props);
169637
169588
  this.isCollection = true;
169638
169589
  this._loaded = true;
169639
169590
  /**
@@ -169769,19 +169720,21 @@ class SourceBasedVariable extends CollectionBasedVariable {
169769
169720
  this._definition = props.declaration?.definition;
169770
169721
  }
169771
169722
  get title() {
169772
- return isTitleCapableSource(this._source) ? this._source.title : "";
169723
+ return this._source?.title ?? "";
169773
169724
  }
169774
169725
  get url() {
169775
- return isUrlCapableSource(this._source) ? this._source.url : "";
169726
+ return this._definition?.url ?? "";
169776
169727
  }
169777
169728
  get informationUrl() {
169778
169729
  if (!this.loaded) {
169779
169730
  return null;
169780
169731
  }
169781
- if (!this.url) {
169732
+ const url = this._source?.url;
169733
+ if (!url) {
169782
169734
  return null;
169783
169735
  }
169784
- return isLayerIdCapableSource(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
169736
+ const layerId = this._source?.layerId ?? "";
169737
+ return `${url}/${layerId}`;
169785
169738
  }
169786
169739
  get informationType() {
169787
169740
  return this._profile?.intlStrings.layer ?? "layer";
@@ -169793,19 +169746,16 @@ class SourceBasedVariable extends CollectionBasedVariable {
169793
169746
  this._loadPromise = this._loadSource();
169794
169747
  return await this._loadPromise;
169795
169748
  }
169796
- _getValueSnippet(field) {
169797
- return this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169798
- }
169799
169749
  _getFieldProperty(field) {
169800
169750
  // Check if the field is the type id field or of the field has a coded domain.
169801
169751
  // If it has then the property will be an exanpdable property (dictionary).
169802
169752
  // Otherwise just return a simple value property.
169803
- const subtypesOrDomainValuesDictionary = this._getDomainDictionary(field);
169753
+ const subtypesOrDomainValuesDictionary = this._getSubtypesOrDomainValuesDictionary(field);
169804
169754
  if (subtypesOrDomainValuesDictionary) {
169805
169755
  return subtypesOrDomainValuesDictionary;
169806
169756
  }
169807
169757
  // Create the value property
169808
- const valueSnippet = this._getValueSnippet(field);
169758
+ const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169809
169759
  return new ValueVariable({
169810
169760
  profile: this._profile,
169811
169761
  label: valueSnippet,
@@ -169815,113 +169765,12 @@ class SourceBasedVariable extends CollectionBasedVariable {
169815
169765
  filterDescription: true
169816
169766
  });
169817
169767
  }
169818
- get _domainSource() {
169819
- if (isSubtypeSublayerInstance(this._source)) {
169820
- return this._source.parent;
169821
- }
169822
- return isDomainsCapableLayer(this._source) ? this._source : null;
169823
- }
169824
- _getDomainDictionary(field) {
169825
- if (!isDomainsCapableLayer(this._domainSource)) {
169826
- return null;
169827
- }
169828
- // Note we have multiple scenarios:
169829
- // - Layers without subtypes or feature types: We will check if the field has a domain
169830
- // - Layers with only subtypes: We will parse the subtypes metadata and create a dictionary
169831
- // - Layers with only feature types: We will parse the feature types metadata
169832
- // - Layers with both subtypes and feature types: we will actually use the subtypes metadata
169833
- // Summary, we will always use the subtypes metadata if available.
169834
- if (isSubtypesCapableLayer(this._domainSource)) {
169835
- return this._getSubtypeDomainDictionary(field);
169836
- }
169837
- if (isFeatureTypesCapableLayer(this._domainSource)) {
169838
- return this._getFeatureTypeDomainDictionary(field);
169839
- }
169840
- return this._getFieldDomainDictionary(field);
169841
- }
169842
- _getSubtypeDomainDictionary(field) {
169843
- // SHould be tested before calling this function
169844
- if (!isSubtypesCapableLayer(this._domainSource)) {
169845
- return null;
169846
- }
169847
- // If the source is the subtype sublayer then the subtype value is already set.
169848
- // It doesn't make sense to show the subtypes for the subtype field.
169849
- // For the other field, the getFieldDomain will return the domain for the subtype.
169850
- if (isSubtypeSublayerInstance(this._source)) {
169851
- if (field.name === this._domainSource.subtypeField) {
169852
- return null;
169853
- }
169854
- return this._getFieldDomainDictionary(field);
169855
- }
169856
- // The code here shoud be executed for layers that have subtypes but are not subtype sublayers.
169857
- // Sepcial case for the subtype field
169858
- if (field.name === this._domainSource.subtypeField) {
169859
- const domainDictionary = this._createDomainDictionary(field);
169860
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._domainSource.subtypes, field));
169861
- return domainDictionary;
169862
- }
169863
- // Check if all the domains for the field in the types are inherited.
169864
- // If it is we can simplify the structure by avoiding splitting in subtypes
169865
- if (areAllDomainsInherited(this._domainSource.subtypes, field)) {
169866
- return this._getFieldDomainDictionary(field);
169867
- }
169868
- // We have domains per subtype
169869
- // We need to go thru each types and create a dictionary.
169870
- const domainValuesBySubtypeGroup = getDomainValuesGroup(this._profile, this._domainSource.subtypes, field);
169871
- if (!domainValuesBySubtypeGroup) {
169872
- return null;
169873
- }
169874
- const domainDictionary = this._createDomainDictionary(field);
169875
- domainDictionary.variables.push(domainValuesBySubtypeGroup);
169876
- return domainDictionary;
169877
- }
169878
- _getFeatureTypeDomainDictionary(field) {
169879
- // SHould be tested before calling this function
169880
- if (!isFeatureTypesCapableLayer(this._domainSource)) {
169881
- return null;
169882
- }
169883
- // Special case for the type id field
169884
- if (field.name === this._domainSource.typeIdField) {
169885
- const domainDictionary = this._createDomainDictionary(field);
169886
- domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._domainSource.types, field));
169887
- return domainDictionary;
169888
- }
169889
- // Check if all the domains for the field in the types are inherited.
169890
- // If it is we can simplify the structure by avoiding splitting in subtypes
169891
- if (areAllDomainsInherited(this._domainSource.types, field)) {
169892
- return this._getFieldDomainDictionary(field);
169893
- }
169894
- // We have domains per feature type
169895
- // We need to go thru each types and create a dictionary.
169896
- const domainValuesByFeatureTypeGroup = getDomainValuesGroup(this._profile, this._domainSource.types, field);
169897
- if (!domainValuesByFeatureTypeGroup) {
169898
- return null;
169899
- }
169900
- const domainDictionary = this._createDomainDictionary(field);
169901
- domainDictionary.variables.push(domainValuesByFeatureTypeGroup);
169902
- return domainDictionary;
169903
- }
169904
- _getFieldDomainDictionary(field) {
169905
- // SHould be tested before calling this function
169768
+ _getSubtypesOrDomainValuesDictionary(field) {
169906
169769
  if (!isDomainsCapableLayer(this._source)) {
169907
169770
  return null;
169908
169771
  }
169909
- const fieldDomain = this._source.getFieldDomain(field.name);
169910
- if (!isCodedValueDomainInstance(fieldDomain)) {
169911
- return null;
169912
- }
169913
- const domainValuesGroup = getCodedValueDomainGroup(this._profile, fieldDomain, {
169914
- code: "domainvalues"
169915
- });
169916
- const domainDictionary = this._createDomainDictionary(field);
169917
- domainDictionary.variables.push(domainValuesGroup);
169918
- return domainDictionary;
169919
- }
169920
- _createDomainDictionary(field) {
169921
- // Create the domain dictionary.
169922
- // The dictionary will have a header group and a value group.
169923
- // At this point we are only creating the header group in the dictionary.
169924
- const valueSnippet = this._getValueSnippet(field);
169772
+ // Create the domain dictionary, we may not use it
169773
+ const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169925
169774
  const domainDictionary = new DictionaryVariable({
169926
169775
  profile: this._profile,
169927
169776
  label: valueSnippet,
@@ -169939,7 +169788,13 @@ class SourceBasedVariable extends CollectionBasedVariable {
169939
169788
  })
169940
169789
  ]);
169941
169790
  domainDictionary.variables = [headerGroup];
169942
- // Add the DomainName snippet if the type is feature
169791
+ // If it is the subtype field then get its coded domain values
169792
+ if (isTypesCapabaleLayer(this._source) && field.name === this._source.typeIdField) {
169793
+ const subtypesGroup = getSubtypesProperties(this._profile, this._source.types, field);
169794
+ domainDictionary.variables.push(subtypesGroup);
169795
+ return domainDictionary;
169796
+ }
169797
+ // Since its' not the subtype field then add the snippet for the domain name
169943
169798
  if (this.type === "feature") {
169944
169799
  const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
169945
169800
  headerGroup.variables.push(new ValueVariable({
@@ -169949,6 +169804,29 @@ class SourceBasedVariable extends CollectionBasedVariable {
169949
169804
  snippet: domainNameSnippet
169950
169805
  }));
169951
169806
  }
169807
+ if (isTypesCapabaleLayer(this._source)) {
169808
+ // Check if all the domains for the field in the types are inherited.
169809
+ // If it is we can simplify the structure by avoiding splitting in subtypes
169810
+ const allInherited = this._source.types.every((t) => t.domains[field.name].type === "inherited");
169811
+ if (!allInherited) {
169812
+ // We have domains per subtype
169813
+ // We need to go thru each types and create a dictionary.
169814
+ const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
169815
+ if (!domainValuesBySubtypeGroup) {
169816
+ return null;
169817
+ }
169818
+ domainDictionary.variables.push(domainValuesBySubtypeGroup);
169819
+ return domainDictionary;
169820
+ }
169821
+ }
169822
+ // Either we have types but all the domains are inherited or we don't have types
169823
+ const domainValuesGroup = getDomainValuesProperties(this._profile, this._source.getFieldDomain(field.name), {
169824
+ code: "domainvalues"
169825
+ });
169826
+ if (!domainValuesGroup) {
169827
+ return null;
169828
+ }
169829
+ domainDictionary.variables.push(domainValuesGroup);
169952
169830
  return domainDictionary;
169953
169831
  }
169954
169832
  async _getRelationshipsProperty() {
@@ -170158,7 +170036,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170158
170036
  : {
170159
170037
  code: "webmapformat",
170160
170038
  formatValues: {
170161
- webMapTitle: this._featureSetCollections.source.portalItem.title || "Untitled map"
170039
+ webMapTitle: this._featureSetCollections.source.portalItem.title ?? "Untitled map"
170162
170040
  }
170163
170041
  };
170164
170042
  const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
@@ -1,4 +1,4 @@
1
- import { r as main, e as editor, M as MarkerSeverity, R as Range, l as languages, E as Emitter } from './arcade-defaults-501b9076.js';
1
+ import { r as main, e as editor, M as MarkerSeverity, R as Range, l as languages, E as Emitter } from './arcade-defaults-375c8393.js';
2
2
  import './index-022fb97b.js';
3
3
 
4
4
  var fe=(e=>(e.False="false",e.Null="null",e.True="true",e))(fe||{}),ge=(e=>(e.Break="break",e.Continue="continue",e.Else="else",e.For="for",e.From="from",e.Function="function",e.If="if",e.Import="import",e.Export="export",e.In="in",e.Return="return",e.Var="var",e.While="while",e))(ge||{}),c=(e=>(e.AssignmentExpression="AssignmentExpression",e.ArrayExpression="ArrayExpression",e.BlockComment="BlockComment",e.BlockStatement="BlockStatement",e.BinaryExpression="BinaryExpression",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.ContinueStatement="ContinueStatement",e.EmptyStatement="EmptyStatement",e.ExpressionStatement="ExpressionStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExportSpecifier="ExportSpecifier",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.FunctionDeclaration="FunctionDeclaration",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.LineComment="LineComment",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.ObjectExpression="ObjectExpression",e.Program="Program",e.Property="Property",e.ReturnStatement="ReturnStatement",e.TemplateElement="TemplateElement",e.TemplateLiteral="TemplateLiteral",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement",e))(c||{}),me=["++","--"],We=["-","+","!","~"],qe=["=","/=","*=","%=","+=","-="],He=["||","&&"],Pt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],bt=(e=>(e[e.Unknown=0]="Unknown",e[e.BooleanLiteral=1]="BooleanLiteral",e[e.EOF=2]="EOF",e[e.Identifier=3]="Identifier",e[e.Keyword=4]="Keyword",e[e.NullLiteral=5]="NullLiteral",e[e.NumericLiteral=6]="NumericLiteral",e[e.Punctuator=7]="Punctuator",e[e.StringLiteral=8]="StringLiteral",e[e.Template=10]="Template",e))(bt||{}),It=(e=>(e.InvalidModuleUri="InvalidModuleUri",e.ForInOfLoopInitializer="ForInOfLoopInitializer",e.IdentiferExpected="IdentiferExpected",e.InvalidEscapedReservedWord="InvalidEscapedReservedWord",e.InvalidExpression="InvalidExpression",e.InvalidFunctionIdentifier="InvalidFunctionIdentifier",e.InvalidHexEscapeSequence="InvalidHexEscapeSequence",e.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",e.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",e.InvalidTemplateHead="InvalidTemplateHead",e.InvalidVariableAssignment="InvalidVariableAssignment",e.KeyMustBeString="KeyMustBeString",e.NoFunctionInsideBlock="NoFunctionInsideBlock",e.NoFunctionInsideFunction="NoFunctionInsideFunction",e.ModuleExportRootOnly="ModuleExportRootOnly",e.ModuleImportRootOnly="ModuleImportRootOnly",e.PunctuatorExpected="PunctuatorExpected",e.TemplateOctalLiteral="TemplateOctalLiteral",e.UnexpectedBoolean="UnexpectedBoolean",e.UnexpectedEndOfScript="UnexpectedEndOfScript",e.UnexpectedIdentifier="UnexpectedIdentifier",e.UnexpectedKeyword="UnexpectedKeyword",e.UnexpectedNull="UnexpectedNull",e.UnexpectedNumber="UnexpectedNumber",e.UnexpectedPunctuator="UnexpectedPunctuator",e.UnexpectedString="UnexpectedString",e.UnexpectedTemplate="UnexpectedTemplate",e.UnexpectedToken="UnexpectedToken",e))(It||{});var L=[[],[],[]];me.forEach(e=>L[e.length-1].push(e));We.forEach(e=>L[e.length-1].push(e));He.forEach(e=>L[e.length-1].push(e));qe.forEach(e=>L[e.length-1].push(e));Pt.forEach(e=>L[e.length-1].push(e));var nt=Object.values(ge),st=Object.values(fe);st.map(e=>({label:e,kind:main.CompletionItemKind.Constant}));nt.map(e=>({label:e,kind:main.CompletionItemKind.Keyword}));
@@ -1,5 +1,5 @@
1
1
  import { h, r as registerInstance, c as createEvent, g as getAssetPath, H as Host, a as getElement, F as Fragment } from './index-022fb97b.js';
2
- import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, n as ne, t as te, i as importRequest, l as languages, d as arcadeDefaults, W, U as Uri, B, j, f as filterCollection, G, h as importArcade, k as h$1, F, $, K as KeyCode, D, q, s as supportedFields, Q, R as Range, T, m as KeyMod } from './arcade-defaults-501b9076.js';
2
+ import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, n as ne, t as te, i as importRequest, l as languages, d as arcadeDefaults, W, U as Uri, B, j, f as filterCollection, G, h as importArcade, k as h$1, F, $, K as KeyCode, D, q, s as supportedFields, Q, R as Range, T, m as KeyMod } from './arcade-defaults-375c8393.js';
3
3
 
4
4
  async function colorizeCode(code) {
5
5
  return await editor.colorize(code, "arcade", { tabSize: 2 });
@@ -3015,7 +3015,7 @@ async function getArcadeWorker(uri) {
3015
3015
  * @returns mode for arcade
3016
3016
  */
3017
3017
  async function getMode() {
3018
- return await import('./arcade-mode-f97a9a16.js');
3018
+ return await import('./arcade-mode-2b1c4c38.js');
3019
3019
  }
3020
3020
  // Register the language in Monaco
3021
3021
  languages.register({
@@ -1,4 +1,4 @@
1
- import { o as monaco_editor_core_star } from './arcade-defaults-501b9076.js';
1
+ import { o as monaco_editor_core_star } from './arcade-defaults-375c8393.js';
2
2
  import './index-022fb97b.js';
3
3
 
4
4
  /*!-----------------------------------------------------------------------------