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

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-9301388a.js → p-03b0ec9a.js} +1 -1
  4. package/dist/arcgis-coding-components/{p-3b2457f7.js → p-0c2f4384.js} +7 -7
  5. package/dist/arcgis-coding-components/{p-8010edc0.js → p-0f636dd2.js} +1 -1
  6. package/dist/arcgis-coding-components/{p-c0bf49ad.js → p-4f5314f5.js} +1 -1
  7. package/dist/arcgis-coding-components/{p-59247049.js → p-723fc69e.js} +1 -1
  8. package/dist/arcgis-coding-components/{p-ec3e9c42.js → p-7416105e.js} +1 -1
  9. package/dist/arcgis-coding-components/{p-be5ec0c4.entry.js → p-8fb41167.entry.js} +1 -1
  10. package/dist/arcgis-coding-components/{p-6e1f1ee0.js → p-a73841b8.js} +1 -1
  11. package/dist/arcgis-coding-components/{p-45b5bca3.js → p-d07b6214.js} +1 -1
  12. package/dist/arcgis-coding-components/{p-21871ede.js → p-ef6982d2.js} +1 -1
  13. package/dist/cjs/{arcade-defaults-82737060.js → arcade-defaults-51a9667c.js} +236 -114
  14. package/dist/cjs/{arcade-mode-b21b24cc.js → arcade-mode-7705211c.js} +1 -1
  15. package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +2 -2
  16. package/dist/cjs/{cssMode-bc43621f.js → cssMode-1569c17b.js} +1 -1
  17. package/dist/cjs/{html-4a747b36.js → html-198d0fbe.js} +1 -1
  18. package/dist/cjs/{htmlMode-c11513d8.js → htmlMode-cb94b682.js} +1 -1
  19. package/dist/cjs/index.cjs.js +1 -1
  20. package/dist/cjs/{javascript-51f1b49d.js → javascript-c39cbb25.js} +2 -2
  21. package/dist/cjs/{jsonMode-3985bbe9.js → jsonMode-23c556fc.js} +1 -1
  22. package/dist/cjs/{tsMode-b2b3fb82.js → tsMode-f2bafe49.js} +1 -1
  23. package/dist/cjs/{typescript-795a538e.js → typescript-ee8ec13b.js} +1 -1
  24. package/dist/components/arcade-defaults.js +230 -108
  25. package/dist/esm/{arcade-defaults-375c8393.js → arcade-defaults-501b9076.js} +236 -114
  26. package/dist/esm/{arcade-mode-2b1c4c38.js → arcade-mode-f97a9a16.js} +1 -1
  27. package/dist/esm/arcgis-arcade-api_6.entry.js +2 -2
  28. package/dist/esm/{cssMode-2d3bbf6d.js → cssMode-df00f38e.js} +1 -1
  29. package/dist/esm/{html-ba801b93.js → html-c506d52b.js} +1 -1
  30. package/dist/esm/{htmlMode-790fcdc3.js → htmlMode-01fe416c.js} +1 -1
  31. package/dist/esm/index.js +1 -1
  32. package/dist/esm/{javascript-10081345.js → javascript-2d3d5417.js} +2 -2
  33. package/dist/esm/{jsonMode-d6de3d90.js → jsonMode-a5223892.js} +1 -1
  34. package/dist/esm/{tsMode-2efadb1a.js → tsMode-019f7ae9.js} +1 -1
  35. package/dist/esm/{typescript-534a4558.js → typescript-dd5fb7df.js} +1 -1
  36. package/dist/types/utils/profile/editor-profile.d.ts +19 -5
  37. package/dist/types/utils/profile/utils.d.ts +15 -11
  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-ba801b93.js');
120538
+ return import('./html-c506d52b.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-10081345.js');
120558
+ return import('./javascript-2d3d5417.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-534a4558.js');
120576
+ return import('./typescript-dd5fb7df.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-2d3bbf6d.js');
120697
+ return import('./cssMode-df00f38e.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-790fcdc3.js');
120822
+ return import('./htmlMode-01fe416c.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-d6de3d90.js');
120924
+ return import('./jsonMode-a5223892.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-2efadb1a.js');
121193
+ return import('./tsMode-019f7ae9.js');
121194
121194
  }
121195
121195
  }
121196
121196
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -168978,47 +168978,83 @@ async function newWebMap(definition) {
168978
168978
  function isSupportedLayerInstance(item) {
168979
168979
  return (!!item &&
168980
168980
  typeof item === "object" &&
168981
+ "declaredClass" in item &&
168981
168982
  typeof item.declaredClass === "string" &&
168982
168983
  item.declaredClass.startsWith("esri.layers."));
168983
168984
  }
168984
168985
  function isFeatureSetInstance(item) {
168985
168986
  return (!!item &&
168986
168987
  typeof item === "object" &&
168988
+ "declaredClass" in item &&
168987
168989
  typeof item.declaredClass === "string" &&
168988
168990
  item.declaredClass === "esri.rest.support.FeatureSet");
168989
168991
  }
168990
168992
  function isQueryableLayerInstance(item) {
168991
168993
  return (!!item &&
168992
168994
  typeof item === "object" &&
168995
+ "declaredClass" in item &&
168993
168996
  typeof item.declaredClass === "string" &&
168994
168997
  item.declaredClass.startsWith("esri.layers.") &&
168995
168998
  "fields" in item &&
168999
+ "queryFeatures" in item &&
168996
169000
  typeof item.queryFeatures === "function");
168997
169001
  }
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
+ }
168998
169009
  function isGroupLayerInstance(item) {
168999
169010
  return (!!item &&
169000
169011
  typeof item === "object" &&
169012
+ "declaredClass" in item &&
169001
169013
  typeof item.declaredClass === "string" &&
169002
169014
  item.declaredClass === "esri.layers.GroupLayer");
169003
169015
  }
169004
169016
  function isWebMapInstance(item) {
169005
- return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
169017
+ return (!!item &&
169018
+ typeof item === "object" &&
169019
+ "declaredClass" in item &&
169020
+ typeof item.declaredClass === "string" &&
169021
+ item.declaredClass === "esri.WebMap");
169006
169022
  }
169007
169023
  function isPortalItemDefinition(item) {
169008
- return !!item && typeof item === "object" && item.portalItem != null;
169024
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169009
169025
  }
169010
169026
  function isFeatureLayerItemDefinition(item) {
169011
- return !!item && typeof item === "object" && item.portalItem != null;
169027
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169012
169028
  }
169013
169029
  function isFieldsDefinition(item) {
169014
- return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
169030
+ return (!!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields) && !("declaredClass" in item));
169015
169031
  }
169016
169032
  function isUrlDefinition(item) {
169017
- return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in 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");
169018
169052
  }
169019
169053
  function isPredefinedProfile(item) {
169020
169054
  return (!!item &&
169021
169055
  typeof item === "object" &&
169056
+ "id" in item &&
169057
+ "definitions" in item &&
169022
169058
  typeof item.id === "string" &&
169023
169059
  typeof item.definitions === "object" &&
169024
169060
  !Array.isArray(item.definitions));
@@ -169141,41 +169177,40 @@ function supportedFields(fields) {
169141
169177
  });
169142
169178
  }
169143
169179
 
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;
169180
+ function isTitleCapableSource(item) {
169181
+ return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169157
169182
  }
169158
- function isTypesCapabaleLayer(item) {
169159
- return !!item?.typeIdField;
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;
169191
+ }
169192
+ function isSubtypesCapableLayer(item) {
169193
+ return !!item && typeof item === "object" && "subtypeField" in item && "subtypes" in item;
169160
169194
  }
169161
169195
  function isDomainsCapableLayer(item) {
169162
- return typeof item?.getFieldDomain === "function";
169196
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169163
169197
  }
169164
169198
  function isRelationshipsCapableLayer(item) {
169165
- return Array.isArray(item?.relationships) && typeof item?.url === "string";
169199
+ return (isLayerIdCapableSource(item) &&
169200
+ "relationships" in item &&
169201
+ "url" in item &&
169202
+ Array.isArray(item.relationships) &&
169203
+ typeof item.url === "string");
169166
169204
  }
169167
169205
  function isTableCapableLayer(item) {
169168
- return typeof item?.isTable === "boolean";
169206
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169169
169207
  }
169170
169208
  function isLoadableSource(item) {
169171
- return typeof item?.load === "function";
169209
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169172
169210
  }
169173
169211
  //#endregion
169174
169212
  //#region Support Functions
169175
169213
  async function getRelatedFeatureLayer(layer, relationship) {
169176
- if (!relationship) {
169177
- return null;
169178
- }
169179
169214
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
169180
169215
  await relatedFeatureLayer.load();
169181
169216
  return relatedFeatureLayer;
@@ -169188,7 +169223,23 @@ function sortFields(layer) {
169188
169223
  if (secondField.type === "oid") {
169189
169224
  return 1;
169190
169225
  }
169191
- if (isTypesCapabaleLayer(layer)) {
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)) {
169192
169243
  if (firstField.name === layer.typeIdField) {
169193
169244
  return -1;
169194
169245
  }
@@ -169199,20 +169250,19 @@ function sortFields(layer) {
169199
169250
  return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
169200
169251
  };
169201
169252
  }
169202
- function getSubtypesProperties(profile, types, field) {
169253
+ function getTypeOrSubtypeDomainGroup(profile, types, field) {
169203
169254
  // Try the coded domain first
169204
- const group = getDomainValuesProperties(profile, field.domain, { code: "subtypes" });
169205
- if (group) {
169206
- return group;
169255
+ if (isCodedValueDomainInstance(field.domain)) {
169256
+ return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
169207
169257
  }
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}"` }));
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
+ });
169210
169263
  return new GroupOfVariables(profile, { code: "subtypes" }, values);
169211
169264
  }
169212
- function getDomainValuesProperties(profile, domain, label) {
169213
- if (!domain || domain.type !== "coded-value") {
169214
- return null;
169215
- }
169265
+ function getCodedValueDomainGroup(profile, domain, label) {
169216
169266
  const values = domain.codedValues.map((v) => new ValueVariable({
169217
169267
  profile,
169218
169268
  label: `${v.code}`,
@@ -169222,29 +169272,33 @@ function getDomainValuesProperties(profile, domain, label) {
169222
169272
  }));
169223
169273
  return new GroupOfVariables(profile, label, values);
169224
169274
  }
169225
- function getDomainValuesBySubtypeGroup(profile, types, field) {
169275
+ function getDomainValuesGroup(profile, types, field) {
169226
169276
  const variables = [];
169227
- types.forEach((t) => {
169228
- let domain = t.domains[field.name];
169277
+ if (types.length === 0) {
169278
+ return null;
169279
+ }
169280
+ types.forEach((type) => {
169281
+ let domain = type.domains[field.name];
169229
169282
  if (!domain) {
169230
169283
  return;
169231
169284
  }
169232
- if (domain.type === "inherited") {
169285
+ if (isInheritedDomainInstance(domain)) {
169233
169286
  domain = field.domain;
169234
169287
  return;
169235
169288
  }
169236
- const domainValuesGroup = getDomainValuesProperties(profile, domain, {
169289
+ if (!isCodedValueDomainInstance(domain)) {
169290
+ return;
169291
+ }
169292
+ const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
169237
169293
  code: "domainvaluesfortypeformat",
169238
169294
  formatValues: {
169239
169295
  fieldName: field.alias ?? field.name,
169240
- typeName: t.name
169296
+ typeName: type.name
169241
169297
  }
169242
169298
  });
169243
- if (!domainValuesGroup) {
169244
- return;
169245
- }
169246
- const label = `${t.id}`;
169247
- const snippet = `"${t.id}""`;
169299
+ const id = isSubtypeInstance(type) ? type.code : type.id;
169300
+ const label = `${id}`;
169301
+ const snippet = `"${id}""`;
169248
169302
  const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
169249
169303
  subtypeDictionary.variables = [domainValuesGroup];
169250
169304
  variables.push(subtypeDictionary);
@@ -169254,6 +169308,9 @@ function getDomainValuesBySubtypeGroup(profile, types, field) {
169254
169308
  }
169255
169309
  return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
169256
169310
  }
169311
+ function areAllDomainsInherited(types, field) {
169312
+ return types.every((type) => type.domains[field.name].type === "inherited");
169313
+ }
169257
169314
  // const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
169258
169315
  const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
169259
169316
  function getMemberExpressionProperty(prop, includeDot = true) {
@@ -169281,10 +169338,6 @@ async function supportedSourceFromDefinition(definition) {
169281
169338
  else {
169282
169339
  source = await newFeatureLayer(definition);
169283
169340
  }
169284
- if (!source) {
169285
- console.error("Invalid FeatureSetDefinition", definition);
169286
- return null;
169287
- }
169288
169341
  if (isLoadableSource(source)) {
169289
169342
  await source.load();
169290
169343
  }
@@ -169320,10 +169373,7 @@ function filterFeatureLayerInfos(layers, queryCapability) {
169320
169373
  //#endregion
169321
169374
  //#region Functions to Editor Variables to a language service variables
169322
169375
  async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
169323
- if (!editorVariables) {
169324
- return [];
169325
- }
169326
- const properties = await Promise.all(editorVariables.map(async (editorVariable) => {
169376
+ return await Promise.all(editorVariables.map(async (editorVariable) => {
169327
169377
  switch (editorVariable.type) {
169328
169378
  case "dictionary":
169329
169379
  return await dictionaryToLSDictionary(editorVariable, kind);
@@ -169333,7 +169383,6 @@ async function variablesToLSVariable(editorVariables, kind = main.CompletionItem
169333
169383
  return variableToLSVariable(editorVariable, kind);
169334
169384
  }
169335
169385
  }));
169336
- return properties.filter((p) => p);
169337
169386
  }
169338
169387
  function variableToLSVariable(editorVariable, kind) {
169339
169388
  const { name, type } = editorVariable;
@@ -169451,7 +169500,7 @@ async function dictionaryToLSDictionary(editorDictionary, kind) {
169451
169500
  previous += ` \n${description}`;
169452
169501
  }
169453
169502
  return previous;
169454
- }, description ?? "");
169503
+ }, description);
169455
169504
  return {
169456
169505
  name,
169457
169506
  description,
@@ -169506,7 +169555,7 @@ class ProfileItemBase {
169506
169555
  if (typeof this.description === "string") {
169507
169556
  return this.description;
169508
169557
  }
169509
- return D(this._profile?.intlStrings[this.description.code ?? ""], this.description.formatValues);
169558
+ return D(this._profile?.intlStrings[this.description.code], this.description.formatValues);
169510
169559
  }
169511
169560
  /**
169512
169561
  * Returns true if the item pass the filter test
@@ -169529,7 +169578,7 @@ class VariableBase extends ProfileItemBase {
169529
169578
  super(props.profile, props.label, props.description ?? props.declaration?.description);
169530
169579
  this.declaration = props.declaration ?? {};
169531
169580
  this.name = props.declaration?.name ?? "";
169532
- this.snippet = props.snippet || "";
169581
+ this.snippet = props.snippet ?? "";
169533
169582
  this.nonInteractive = props.nonInteractive ?? false;
169534
169583
  this.filterDescription = props.filterDescription ?? false;
169535
169584
  this.icon = props.icon;
@@ -169547,7 +169596,7 @@ class ValueVariable extends VariableBase {
169547
169596
  }
169548
169597
  getDescription() {
169549
169598
  if (this.description == null) {
169550
- return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
169599
+ return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
169551
169600
  }
169552
169601
  return super.getDescription();
169553
169602
  }
@@ -169568,7 +169617,7 @@ class ArrayVariable extends VariableBase {
169568
169617
  }
169569
169618
  getDescription() {
169570
169619
  if (this.description == null) {
169571
- return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
169620
+ return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
169572
169621
  }
169573
169622
  return super.getDescription();
169574
169623
  }
@@ -169583,8 +169632,8 @@ class ArrayVariable extends VariableBase {
169583
169632
  * collection is ready or not.
169584
169633
  */
169585
169634
  class CollectionBasedVariable extends VariableBase {
169586
- constructor(props) {
169587
- super(props);
169635
+ constructor() {
169636
+ super(...arguments);
169588
169637
  this.isCollection = true;
169589
169638
  this._loaded = true;
169590
169639
  /**
@@ -169720,21 +169769,19 @@ class SourceBasedVariable extends CollectionBasedVariable {
169720
169769
  this._definition = props.declaration?.definition;
169721
169770
  }
169722
169771
  get title() {
169723
- return this._source?.title ?? "";
169772
+ return isTitleCapableSource(this._source) ? this._source.title : "";
169724
169773
  }
169725
169774
  get url() {
169726
- return this._definition?.url ?? "";
169775
+ return isUrlCapableSource(this._source) ? this._source.url : "";
169727
169776
  }
169728
169777
  get informationUrl() {
169729
169778
  if (!this.loaded) {
169730
169779
  return null;
169731
169780
  }
169732
- const url = this._source?.url;
169733
- if (!url) {
169781
+ if (!this.url) {
169734
169782
  return null;
169735
169783
  }
169736
- const layerId = this._source?.layerId ?? "";
169737
- return `${url}/${layerId}`;
169784
+ return isLayerIdCapableSource(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
169738
169785
  }
169739
169786
  get informationType() {
169740
169787
  return this._profile?.intlStrings.layer ?? "layer";
@@ -169746,16 +169793,19 @@ class SourceBasedVariable extends CollectionBasedVariable {
169746
169793
  this._loadPromise = this._loadSource();
169747
169794
  return await this._loadPromise;
169748
169795
  }
169796
+ _getValueSnippet(field) {
169797
+ return this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169798
+ }
169749
169799
  _getFieldProperty(field) {
169750
169800
  // Check if the field is the type id field or of the field has a coded domain.
169751
169801
  // If it has then the property will be an exanpdable property (dictionary).
169752
169802
  // Otherwise just return a simple value property.
169753
- const subtypesOrDomainValuesDictionary = this._getSubtypesOrDomainValuesDictionary(field);
169803
+ const subtypesOrDomainValuesDictionary = this._getDomainDictionary(field);
169754
169804
  if (subtypesOrDomainValuesDictionary) {
169755
169805
  return subtypesOrDomainValuesDictionary;
169756
169806
  }
169757
169807
  // Create the value property
169758
- const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169808
+ const valueSnippet = this._getValueSnippet(field);
169759
169809
  return new ValueVariable({
169760
169810
  profile: this._profile,
169761
169811
  label: valueSnippet,
@@ -169765,12 +169815,113 @@ class SourceBasedVariable extends CollectionBasedVariable {
169765
169815
  filterDescription: true
169766
169816
  });
169767
169817
  }
169768
- _getSubtypesOrDomainValuesDictionary(field) {
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
169769
169906
  if (!isDomainsCapableLayer(this._source)) {
169770
169907
  return null;
169771
169908
  }
169772
- // Create the domain dictionary, we may not use it
169773
- const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
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);
169774
169925
  const domainDictionary = new DictionaryVariable({
169775
169926
  profile: this._profile,
169776
169927
  label: valueSnippet,
@@ -169788,13 +169939,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169788
169939
  })
169789
169940
  ]);
169790
169941
  domainDictionary.variables = [headerGroup];
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
169942
+ // Add the DomainName snippet if the type is feature
169798
169943
  if (this.type === "feature") {
169799
169944
  const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
169800
169945
  headerGroup.variables.push(new ValueVariable({
@@ -169804,29 +169949,6 @@ class SourceBasedVariable extends CollectionBasedVariable {
169804
169949
  snippet: domainNameSnippet
169805
169950
  }));
169806
169951
  }
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);
169830
169952
  return domainDictionary;
169831
169953
  }
169832
169954
  async _getRelationshipsProperty() {
@@ -170036,7 +170158,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170036
170158
  : {
170037
170159
  code: "webmapformat",
170038
170160
  formatValues: {
170039
- webMapTitle: this._featureSetCollections.source.portalItem.title ?? "Untitled map"
170161
+ webMapTitle: this._featureSetCollections.source.portalItem.title || "Untitled map"
170040
170162
  }
170041
170163
  };
170042
170164
  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-375c8393.js';
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';
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-375c8393.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';
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-2b1c4c38.js');
3018
+ return await import('./arcade-mode-f97a9a16.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-375c8393.js';
1
+ import { o as monaco_editor_core_star } from './arcade-defaults-501b9076.js';
2
2
  import './index-022fb97b.js';
3
3
 
4
4
  /*!-----------------------------------------------------------------------------