@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
@@ -120557,7 +120557,7 @@ registerLanguage({
120557
120557
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
120558
120558
  loader: () => {
120559
120559
  {
120560
- return Promise.resolve().then(function () { return require('./html-4a747b36.js'); });
120560
+ return Promise.resolve().then(function () { return require('./html-198d0fbe.js'); });
120561
120561
  }
120562
120562
  }
120563
120563
  });
@@ -120577,7 +120577,7 @@ registerLanguage({
120577
120577
  mimetypes: ["text/javascript"],
120578
120578
  loader: () => {
120579
120579
  {
120580
- return Promise.resolve().then(function () { return require('./javascript-51f1b49d.js'); });
120580
+ return Promise.resolve().then(function () { return require('./javascript-c39cbb25.js'); });
120581
120581
  }
120582
120582
  }
120583
120583
  });
@@ -120595,7 +120595,7 @@ registerLanguage({
120595
120595
  mimetypes: ["text/typescript"],
120596
120596
  loader: () => {
120597
120597
  {
120598
- return Promise.resolve().then(function () { return require('./typescript-795a538e.js'); });
120598
+ return Promise.resolve().then(function () { return require('./typescript-ee8ec13b.js'); });
120599
120599
  }
120600
120600
  }
120601
120601
  });
@@ -120716,7 +120716,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3("less", optionsDefault$1, m
120716
120716
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
120717
120717
  function getMode$3() {
120718
120718
  {
120719
- return Promise.resolve().then(function () { return require('./cssMode-bc43621f.js'); });
120719
+ return Promise.resolve().then(function () { return require('./cssMode-1569c17b.js'); });
120720
120720
  }
120721
120721
  }
120722
120722
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -120841,7 +120841,7 @@ monaco_editor_core_exports$2.languages.html = {
120841
120841
  };
120842
120842
  function getMode$2() {
120843
120843
  {
120844
- return Promise.resolve().then(function () { return require('./htmlMode-c11513d8.js'); });
120844
+ return Promise.resolve().then(function () { return require('./htmlMode-cb94b682.js'); });
120845
120845
  }
120846
120846
  }
120847
120847
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -120943,7 +120943,7 @@ var jsonDefaults = new LanguageServiceDefaultsImpl$1("json", diagnosticDefault,
120943
120943
  monaco_editor_core_exports$1.languages.json = { jsonDefaults };
120944
120944
  function getMode$1() {
120945
120945
  {
120946
- return Promise.resolve().then(function () { return require('./jsonMode-3985bbe9.js'); });
120946
+ return Promise.resolve().then(function () { return require('./jsonMode-23c556fc.js'); });
120947
120947
  }
120948
120948
  }
120949
120949
  monaco_editor_core_exports$1.languages.register({
@@ -121212,7 +121212,7 @@ monaco_editor_core_exports.languages.typescript = {
121212
121212
  };
121213
121213
  function getMode() {
121214
121214
  {
121215
- return Promise.resolve().then(function () { return require('./tsMode-b2b3fb82.js'); });
121215
+ return Promise.resolve().then(function () { return require('./tsMode-f2bafe49.js'); });
121216
121216
  }
121217
121217
  }
121218
121218
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -169000,47 +169000,83 @@ async function newWebMap(definition) {
169000
169000
  function isSupportedLayerInstance(item) {
169001
169001
  return (!!item &&
169002
169002
  typeof item === "object" &&
169003
+ "declaredClass" in item &&
169003
169004
  typeof item.declaredClass === "string" &&
169004
169005
  item.declaredClass.startsWith("esri.layers."));
169005
169006
  }
169006
169007
  function isFeatureSetInstance(item) {
169007
169008
  return (!!item &&
169008
169009
  typeof item === "object" &&
169010
+ "declaredClass" in item &&
169009
169011
  typeof item.declaredClass === "string" &&
169010
169012
  item.declaredClass === "esri.rest.support.FeatureSet");
169011
169013
  }
169012
169014
  function isQueryableLayerInstance(item) {
169013
169015
  return (!!item &&
169014
169016
  typeof item === "object" &&
169017
+ "declaredClass" in item &&
169015
169018
  typeof item.declaredClass === "string" &&
169016
169019
  item.declaredClass.startsWith("esri.layers.") &&
169017
169020
  "fields" in item &&
169021
+ "queryFeatures" in item &&
169018
169022
  typeof item.queryFeatures === "function");
169019
169023
  }
169024
+ function isSubtypeSublayerInstance(item) {
169025
+ return (!!item &&
169026
+ typeof item === "object" &&
169027
+ "declaredClass" in item &&
169028
+ typeof item.declaredClass === "string" &&
169029
+ item.declaredClass === "esri.layers.support.SubtypeSublayer");
169030
+ }
169020
169031
  function isGroupLayerInstance(item) {
169021
169032
  return (!!item &&
169022
169033
  typeof item === "object" &&
169034
+ "declaredClass" in item &&
169023
169035
  typeof item.declaredClass === "string" &&
169024
169036
  item.declaredClass === "esri.layers.GroupLayer");
169025
169037
  }
169026
169038
  function isWebMapInstance(item) {
169027
- return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
169039
+ return (!!item &&
169040
+ typeof item === "object" &&
169041
+ "declaredClass" in item &&
169042
+ typeof item.declaredClass === "string" &&
169043
+ item.declaredClass === "esri.WebMap");
169028
169044
  }
169029
169045
  function isPortalItemDefinition(item) {
169030
- return !!item && typeof item === "object" && item.portalItem != null;
169046
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169031
169047
  }
169032
169048
  function isFeatureLayerItemDefinition(item) {
169033
- return !!item && typeof item === "object" && item.portalItem != null;
169049
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169034
169050
  }
169035
169051
  function isFieldsDefinition(item) {
169036
- return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
169052
+ return (!!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields) && !("declaredClass" in item));
169037
169053
  }
169038
169054
  function isUrlDefinition(item) {
169039
- return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in item);
169055
+ return (!!item && typeof item === "object" && "url" in item && typeof item.url === "string" && !("declaredClass" in item));
169056
+ }
169057
+ function isSubtypeInstance(item) {
169058
+ return (!!item &&
169059
+ typeof item === "object" &&
169060
+ "declaredClass" in item &&
169061
+ item.declaredClass === "esri.layers.support.Subtype");
169062
+ }
169063
+ function isCodedValueDomainInstance(item) {
169064
+ return (!!item &&
169065
+ typeof item === "object" &&
169066
+ "declaredClass" in item &&
169067
+ item.declaredClass === "esri.layers.support.CodedValueDomain");
169068
+ }
169069
+ function isInheritedDomainInstance(item) {
169070
+ return (!!item &&
169071
+ typeof item === "object" &&
169072
+ "declaredClass" in item &&
169073
+ item.declaredClass === "esri.layers.support.InheritedDomain");
169040
169074
  }
169041
169075
  function isPredefinedProfile(item) {
169042
169076
  return (!!item &&
169043
169077
  typeof item === "object" &&
169078
+ "id" in item &&
169079
+ "definitions" in item &&
169044
169080
  typeof item.id === "string" &&
169045
169081
  typeof item.definitions === "object" &&
169046
169082
  !Array.isArray(item.definitions));
@@ -169163,41 +169199,40 @@ function supportedFields(fields) {
169163
169199
  });
169164
169200
  }
169165
169201
 
169166
- function resolveIntlPath(dictionary, path) {
169167
- if (!dictionary) {
169168
- return "";
169169
- }
169170
- const pathSegments = path.split(".");
169171
- let pathSegment = pathSegments.shift();
169172
- let entry = dictionary;
169173
- while (entry && pathSegment) {
169174
- // @ts-expect-error
169175
- entry = entry[pathSegment];
169176
- pathSegment = pathSegments.shift();
169177
- }
169178
- return typeof entry === "string" ? entry : path;
169202
+ function isTitleCapableSource(item) {
169203
+ return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
169179
169204
  }
169180
- function isTypesCapabaleLayer(item) {
169181
- return !!item?.typeIdField;
169205
+ function isUrlCapableSource(item) {
169206
+ return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
169207
+ }
169208
+ function isLayerIdCapableSource(item) {
169209
+ return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
169210
+ }
169211
+ function isFeatureTypesCapableLayer(item) {
169212
+ return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
169213
+ }
169214
+ function isSubtypesCapableLayer(item) {
169215
+ return !!item && typeof item === "object" && "subtypeField" in item && "subtypes" in item;
169182
169216
  }
169183
169217
  function isDomainsCapableLayer(item) {
169184
- return typeof item?.getFieldDomain === "function";
169218
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169185
169219
  }
169186
169220
  function isRelationshipsCapableLayer(item) {
169187
- return Array.isArray(item?.relationships) && typeof item?.url === "string";
169221
+ return (isLayerIdCapableSource(item) &&
169222
+ "relationships" in item &&
169223
+ "url" in item &&
169224
+ Array.isArray(item.relationships) &&
169225
+ typeof item.url === "string");
169188
169226
  }
169189
169227
  function isTableCapableLayer(item) {
169190
- return typeof item?.isTable === "boolean";
169228
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169191
169229
  }
169192
169230
  function isLoadableSource(item) {
169193
- return typeof item?.load === "function";
169231
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169194
169232
  }
169195
169233
  //#endregion
169196
169234
  //#region Support Functions
169197
169235
  async function getRelatedFeatureLayer(layer, relationship) {
169198
- if (!relationship) {
169199
- return null;
169200
- }
169201
169236
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
169202
169237
  await relatedFeatureLayer.load();
169203
169238
  return relatedFeatureLayer;
@@ -169210,7 +169245,23 @@ function sortFields(layer) {
169210
169245
  if (secondField.type === "oid") {
169211
169246
  return 1;
169212
169247
  }
169213
- if (isTypesCapabaleLayer(layer)) {
169248
+ if (isSubtypeSublayerInstance(layer)) {
169249
+ if (firstField.name === layer.parent.subtypeField) {
169250
+ return -1;
169251
+ }
169252
+ if (secondField.name === layer.parent.subtypeField) {
169253
+ return 1;
169254
+ }
169255
+ }
169256
+ if (isSubtypesCapableLayer(layer)) {
169257
+ if (firstField.name === layer.subtypeField) {
169258
+ return -1;
169259
+ }
169260
+ if (secondField.name === layer.subtypeField) {
169261
+ return 1;
169262
+ }
169263
+ }
169264
+ if (isFeatureTypesCapableLayer(layer)) {
169214
169265
  if (firstField.name === layer.typeIdField) {
169215
169266
  return -1;
169216
169267
  }
@@ -169221,20 +169272,19 @@ function sortFields(layer) {
169221
169272
  return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
169222
169273
  };
169223
169274
  }
169224
- function getSubtypesProperties(profile, types, field) {
169275
+ function getTypeOrSubtypeDomainGroup(profile, types, field) {
169225
169276
  // Try the coded domain first
169226
- const group = getDomainValuesProperties(profile, field.domain, { code: "subtypes" });
169227
- if (group) {
169228
- return group;
169277
+ if (isCodedValueDomainInstance(field.domain)) {
169278
+ return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
169229
169279
  }
169230
- // No coded domain for the subtypes, we will manufacture it
169231
- const values = types.map((t) => new ValueVariable({ profile, label: `${t.id}`, description: t.name, snippet: `"${t.id}"` }));
169280
+ // No coded domain, we will manufacture it
169281
+ const values = types.map((t) => {
169282
+ const label = isSubtypeInstance(t) ? t.code : t.id;
169283
+ return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
169284
+ });
169232
169285
  return new GroupOfVariables(profile, { code: "subtypes" }, values);
169233
169286
  }
169234
- function getDomainValuesProperties(profile, domain, label) {
169235
- if (!domain || domain.type !== "coded-value") {
169236
- return null;
169237
- }
169287
+ function getCodedValueDomainGroup(profile, domain, label) {
169238
169288
  const values = domain.codedValues.map((v) => new ValueVariable({
169239
169289
  profile,
169240
169290
  label: `${v.code}`,
@@ -169244,29 +169294,33 @@ function getDomainValuesProperties(profile, domain, label) {
169244
169294
  }));
169245
169295
  return new GroupOfVariables(profile, label, values);
169246
169296
  }
169247
- function getDomainValuesBySubtypeGroup(profile, types, field) {
169297
+ function getDomainValuesGroup(profile, types, field) {
169248
169298
  const variables = [];
169249
- types.forEach((t) => {
169250
- let domain = t.domains[field.name];
169299
+ if (types.length === 0) {
169300
+ return null;
169301
+ }
169302
+ types.forEach((type) => {
169303
+ let domain = type.domains[field.name];
169251
169304
  if (!domain) {
169252
169305
  return;
169253
169306
  }
169254
- if (domain.type === "inherited") {
169307
+ if (isInheritedDomainInstance(domain)) {
169255
169308
  domain = field.domain;
169256
169309
  return;
169257
169310
  }
169258
- const domainValuesGroup = getDomainValuesProperties(profile, domain, {
169311
+ if (!isCodedValueDomainInstance(domain)) {
169312
+ return;
169313
+ }
169314
+ const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
169259
169315
  code: "domainvaluesfortypeformat",
169260
169316
  formatValues: {
169261
169317
  fieldName: field.alias ?? field.name,
169262
- typeName: t.name
169318
+ typeName: type.name
169263
169319
  }
169264
169320
  });
169265
- if (!domainValuesGroup) {
169266
- return;
169267
- }
169268
- const label = `${t.id}`;
169269
- const snippet = `"${t.id}""`;
169321
+ const id = isSubtypeInstance(type) ? type.code : type.id;
169322
+ const label = `${id}`;
169323
+ const snippet = `"${id}""`;
169270
169324
  const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
169271
169325
  subtypeDictionary.variables = [domainValuesGroup];
169272
169326
  variables.push(subtypeDictionary);
@@ -169276,6 +169330,9 @@ function getDomainValuesBySubtypeGroup(profile, types, field) {
169276
169330
  }
169277
169331
  return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
169278
169332
  }
169333
+ function areAllDomainsInherited(types, field) {
169334
+ return types.every((type) => type.domains[field.name].type === "inherited");
169335
+ }
169279
169336
  // const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
169280
169337
  const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
169281
169338
  function getMemberExpressionProperty(prop, includeDot = true) {
@@ -169303,10 +169360,6 @@ async function supportedSourceFromDefinition(definition) {
169303
169360
  else {
169304
169361
  source = await newFeatureLayer(definition);
169305
169362
  }
169306
- if (!source) {
169307
- console.error("Invalid FeatureSetDefinition", definition);
169308
- return null;
169309
- }
169310
169363
  if (isLoadableSource(source)) {
169311
169364
  await source.load();
169312
169365
  }
@@ -169342,10 +169395,7 @@ function filterFeatureLayerInfos(layers, queryCapability) {
169342
169395
  //#endregion
169343
169396
  //#region Functions to Editor Variables to a language service variables
169344
169397
  async function variablesToLSVariable(editorVariables, kind = main.CompletionItemKind.Variable) {
169345
- if (!editorVariables) {
169346
- return [];
169347
- }
169348
- const properties = await Promise.all(editorVariables.map(async (editorVariable) => {
169398
+ return await Promise.all(editorVariables.map(async (editorVariable) => {
169349
169399
  switch (editorVariable.type) {
169350
169400
  case "dictionary":
169351
169401
  return await dictionaryToLSDictionary(editorVariable, kind);
@@ -169355,7 +169405,6 @@ async function variablesToLSVariable(editorVariables, kind = main.CompletionItem
169355
169405
  return variableToLSVariable(editorVariable, kind);
169356
169406
  }
169357
169407
  }));
169358
- return properties.filter((p) => p);
169359
169408
  }
169360
169409
  function variableToLSVariable(editorVariable, kind) {
169361
169410
  const { name, type } = editorVariable;
@@ -169473,7 +169522,7 @@ async function dictionaryToLSDictionary(editorDictionary, kind) {
169473
169522
  previous += ` \n${description}`;
169474
169523
  }
169475
169524
  return previous;
169476
- }, description ?? "");
169525
+ }, description);
169477
169526
  return {
169478
169527
  name,
169479
169528
  description,
@@ -169528,7 +169577,7 @@ class ProfileItemBase {
169528
169577
  if (typeof this.description === "string") {
169529
169578
  return this.description;
169530
169579
  }
169531
- return D(this._profile?.intlStrings[this.description.code ?? ""], this.description.formatValues);
169580
+ return D(this._profile?.intlStrings[this.description.code], this.description.formatValues);
169532
169581
  }
169533
169582
  /**
169534
169583
  * Returns true if the item pass the filter test
@@ -169551,7 +169600,7 @@ class VariableBase extends ProfileItemBase {
169551
169600
  super(props.profile, props.label, props.description ?? props.declaration?.description);
169552
169601
  this.declaration = props.declaration ?? {};
169553
169602
  this.name = props.declaration?.name ?? "";
169554
- this.snippet = props.snippet || "";
169603
+ this.snippet = props.snippet ?? "";
169555
169604
  this.nonInteractive = props.nonInteractive ?? false;
169556
169605
  this.filterDescription = props.filterDescription ?? false;
169557
169606
  this.icon = props.icon;
@@ -169569,7 +169618,7 @@ class ValueVariable extends VariableBase {
169569
169618
  }
169570
169619
  getDescription() {
169571
169620
  if (this.description == null) {
169572
- return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
169621
+ return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
169573
169622
  }
169574
169623
  return super.getDescription();
169575
169624
  }
@@ -169590,7 +169639,7 @@ class ArrayVariable extends VariableBase {
169590
169639
  }
169591
169640
  getDescription() {
169592
169641
  if (this.description == null) {
169593
- return resolveIntlPath(this._profile?.intlStrings, this.type.toLowerCase()) ?? "";
169642
+ return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
169594
169643
  }
169595
169644
  return super.getDescription();
169596
169645
  }
@@ -169605,8 +169654,8 @@ class ArrayVariable extends VariableBase {
169605
169654
  * collection is ready or not.
169606
169655
  */
169607
169656
  class CollectionBasedVariable extends VariableBase {
169608
- constructor(props) {
169609
- super(props);
169657
+ constructor() {
169658
+ super(...arguments);
169610
169659
  this.isCollection = true;
169611
169660
  this._loaded = true;
169612
169661
  /**
@@ -169742,21 +169791,19 @@ class SourceBasedVariable extends CollectionBasedVariable {
169742
169791
  this._definition = props.declaration?.definition;
169743
169792
  }
169744
169793
  get title() {
169745
- return this._source?.title ?? "";
169794
+ return isTitleCapableSource(this._source) ? this._source.title : "";
169746
169795
  }
169747
169796
  get url() {
169748
- return this._definition?.url ?? "";
169797
+ return isUrlCapableSource(this._source) ? this._source.url : "";
169749
169798
  }
169750
169799
  get informationUrl() {
169751
169800
  if (!this.loaded) {
169752
169801
  return null;
169753
169802
  }
169754
- const url = this._source?.url;
169755
- if (!url) {
169803
+ if (!this.url) {
169756
169804
  return null;
169757
169805
  }
169758
- const layerId = this._source?.layerId ?? "";
169759
- return `${url}/${layerId}`;
169806
+ return isLayerIdCapableSource(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
169760
169807
  }
169761
169808
  get informationType() {
169762
169809
  return this._profile?.intlStrings.layer ?? "layer";
@@ -169768,16 +169815,19 @@ class SourceBasedVariable extends CollectionBasedVariable {
169768
169815
  this._loadPromise = this._loadSource();
169769
169816
  return await this._loadPromise;
169770
169817
  }
169818
+ _getValueSnippet(field) {
169819
+ return this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169820
+ }
169771
169821
  _getFieldProperty(field) {
169772
169822
  // Check if the field is the type id field or of the field has a coded domain.
169773
169823
  // If it has then the property will be an exanpdable property (dictionary).
169774
169824
  // Otherwise just return a simple value property.
169775
- const subtypesOrDomainValuesDictionary = this._getSubtypesOrDomainValuesDictionary(field);
169825
+ const subtypesOrDomainValuesDictionary = this._getDomainDictionary(field);
169776
169826
  if (subtypesOrDomainValuesDictionary) {
169777
169827
  return subtypesOrDomainValuesDictionary;
169778
169828
  }
169779
169829
  // Create the value property
169780
- const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169830
+ const valueSnippet = this._getValueSnippet(field);
169781
169831
  return new ValueVariable({
169782
169832
  profile: this._profile,
169783
169833
  label: valueSnippet,
@@ -169787,12 +169837,113 @@ class SourceBasedVariable extends CollectionBasedVariable {
169787
169837
  filterDescription: true
169788
169838
  });
169789
169839
  }
169790
- _getSubtypesOrDomainValuesDictionary(field) {
169840
+ get _domainSource() {
169841
+ if (isSubtypeSublayerInstance(this._source)) {
169842
+ return this._source.parent;
169843
+ }
169844
+ return isDomainsCapableLayer(this._source) ? this._source : null;
169845
+ }
169846
+ _getDomainDictionary(field) {
169847
+ if (!isDomainsCapableLayer(this._domainSource)) {
169848
+ return null;
169849
+ }
169850
+ // Note we have multiple scenarios:
169851
+ // - Layers without subtypes or feature types: We will check if the field has a domain
169852
+ // - Layers with only subtypes: We will parse the subtypes metadata and create a dictionary
169853
+ // - Layers with only feature types: We will parse the feature types metadata
169854
+ // - Layers with both subtypes and feature types: we will actually use the subtypes metadata
169855
+ // Summary, we will always use the subtypes metadata if available.
169856
+ if (isSubtypesCapableLayer(this._domainSource)) {
169857
+ return this._getSubtypeDomainDictionary(field);
169858
+ }
169859
+ if (isFeatureTypesCapableLayer(this._domainSource)) {
169860
+ return this._getFeatureTypeDomainDictionary(field);
169861
+ }
169862
+ return this._getFieldDomainDictionary(field);
169863
+ }
169864
+ _getSubtypeDomainDictionary(field) {
169865
+ // SHould be tested before calling this function
169866
+ if (!isSubtypesCapableLayer(this._domainSource)) {
169867
+ return null;
169868
+ }
169869
+ // If the source is the subtype sublayer then the subtype value is already set.
169870
+ // It doesn't make sense to show the subtypes for the subtype field.
169871
+ // For the other field, the getFieldDomain will return the domain for the subtype.
169872
+ if (isSubtypeSublayerInstance(this._source)) {
169873
+ if (field.name === this._domainSource.subtypeField) {
169874
+ return null;
169875
+ }
169876
+ return this._getFieldDomainDictionary(field);
169877
+ }
169878
+ // The code here shoud be executed for layers that have subtypes but are not subtype sublayers.
169879
+ // Sepcial case for the subtype field
169880
+ if (field.name === this._domainSource.subtypeField) {
169881
+ const domainDictionary = this._createDomainDictionary(field);
169882
+ domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._domainSource.subtypes, field));
169883
+ return domainDictionary;
169884
+ }
169885
+ // Check if all the domains for the field in the types are inherited.
169886
+ // If it is we can simplify the structure by avoiding splitting in subtypes
169887
+ if (areAllDomainsInherited(this._domainSource.subtypes, field)) {
169888
+ return this._getFieldDomainDictionary(field);
169889
+ }
169890
+ // We have domains per subtype
169891
+ // We need to go thru each types and create a dictionary.
169892
+ const domainValuesBySubtypeGroup = getDomainValuesGroup(this._profile, this._domainSource.subtypes, field);
169893
+ if (!domainValuesBySubtypeGroup) {
169894
+ return null;
169895
+ }
169896
+ const domainDictionary = this._createDomainDictionary(field);
169897
+ domainDictionary.variables.push(domainValuesBySubtypeGroup);
169898
+ return domainDictionary;
169899
+ }
169900
+ _getFeatureTypeDomainDictionary(field) {
169901
+ // SHould be tested before calling this function
169902
+ if (!isFeatureTypesCapableLayer(this._domainSource)) {
169903
+ return null;
169904
+ }
169905
+ // Special case for the type id field
169906
+ if (field.name === this._domainSource.typeIdField) {
169907
+ const domainDictionary = this._createDomainDictionary(field);
169908
+ domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._domainSource.types, field));
169909
+ return domainDictionary;
169910
+ }
169911
+ // Check if all the domains for the field in the types are inherited.
169912
+ // If it is we can simplify the structure by avoiding splitting in subtypes
169913
+ if (areAllDomainsInherited(this._domainSource.types, field)) {
169914
+ return this._getFieldDomainDictionary(field);
169915
+ }
169916
+ // We have domains per feature type
169917
+ // We need to go thru each types and create a dictionary.
169918
+ const domainValuesByFeatureTypeGroup = getDomainValuesGroup(this._profile, this._domainSource.types, field);
169919
+ if (!domainValuesByFeatureTypeGroup) {
169920
+ return null;
169921
+ }
169922
+ const domainDictionary = this._createDomainDictionary(field);
169923
+ domainDictionary.variables.push(domainValuesByFeatureTypeGroup);
169924
+ return domainDictionary;
169925
+ }
169926
+ _getFieldDomainDictionary(field) {
169927
+ // SHould be tested before calling this function
169791
169928
  if (!isDomainsCapableLayer(this._source)) {
169792
169929
  return null;
169793
169930
  }
169794
- // Create the domain dictionary, we may not use it
169795
- const valueSnippet = this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
169931
+ const fieldDomain = this._source.getFieldDomain(field.name);
169932
+ if (!isCodedValueDomainInstance(fieldDomain)) {
169933
+ return null;
169934
+ }
169935
+ const domainValuesGroup = getCodedValueDomainGroup(this._profile, fieldDomain, {
169936
+ code: "domainvalues"
169937
+ });
169938
+ const domainDictionary = this._createDomainDictionary(field);
169939
+ domainDictionary.variables.push(domainValuesGroup);
169940
+ return domainDictionary;
169941
+ }
169942
+ _createDomainDictionary(field) {
169943
+ // Create the domain dictionary.
169944
+ // The dictionary will have a header group and a value group.
169945
+ // At this point we are only creating the header group in the dictionary.
169946
+ const valueSnippet = this._getValueSnippet(field);
169796
169947
  const domainDictionary = new DictionaryVariable({
169797
169948
  profile: this._profile,
169798
169949
  label: valueSnippet,
@@ -169810,13 +169961,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
169810
169961
  })
169811
169962
  ]);
169812
169963
  domainDictionary.variables = [headerGroup];
169813
- // If it is the subtype field then get its coded domain values
169814
- if (isTypesCapabaleLayer(this._source) && field.name === this._source.typeIdField) {
169815
- const subtypesGroup = getSubtypesProperties(this._profile, this._source.types, field);
169816
- domainDictionary.variables.push(subtypesGroup);
169817
- return domainDictionary;
169818
- }
169819
- // Since its' not the subtype field then add the snippet for the domain name
169964
+ // Add the DomainName snippet if the type is feature
169820
169965
  if (this.type === "feature") {
169821
169966
  const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
169822
169967
  headerGroup.variables.push(new ValueVariable({
@@ -169826,29 +169971,6 @@ class SourceBasedVariable extends CollectionBasedVariable {
169826
169971
  snippet: domainNameSnippet
169827
169972
  }));
169828
169973
  }
169829
- if (isTypesCapabaleLayer(this._source)) {
169830
- // Check if all the domains for the field in the types are inherited.
169831
- // If it is we can simplify the structure by avoiding splitting in subtypes
169832
- const allInherited = this._source.types.every((t) => t.domains[field.name].type === "inherited");
169833
- if (!allInherited) {
169834
- // We have domains per subtype
169835
- // We need to go thru each types and create a dictionary.
169836
- const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
169837
- if (!domainValuesBySubtypeGroup) {
169838
- return null;
169839
- }
169840
- domainDictionary.variables.push(domainValuesBySubtypeGroup);
169841
- return domainDictionary;
169842
- }
169843
- }
169844
- // Either we have types but all the domains are inherited or we don't have types
169845
- const domainValuesGroup = getDomainValuesProperties(this._profile, this._source.getFieldDomain(field.name), {
169846
- code: "domainvalues"
169847
- });
169848
- if (!domainValuesGroup) {
169849
- return null;
169850
- }
169851
- domainDictionary.variables.push(domainValuesGroup);
169852
169974
  return domainDictionary;
169853
169975
  }
169854
169976
  async _getRelationshipsProperty() {
@@ -170058,7 +170180,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170058
170180
  : {
170059
170181
  code: "webmapformat",
170060
170182
  formatValues: {
170061
- webMapTitle: this._featureSetCollections.source.portalItem.title ?? "Untitled map"
170183
+ webMapTitle: this._featureSetCollections.source.portalItem.title || "Untitled map"
170062
170184
  }
170063
170185
  };
170064
170186
  const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-82737060.js');
3
+ const arcadeDefaults = require('./arcade-defaults-51a9667c.js');
4
4
  require('./index-ac186201.js');
5
5
 
6
6
  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:arcadeDefaults.main.CompletionItemKind.Constant}));nt.map(e=>({label:e,kind:arcadeDefaults.main.CompletionItemKind.Keyword}));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-ac186201.js');
6
- const arcadeDefaults = require('./arcade-defaults-82737060.js');
6
+ const arcadeDefaults = require('./arcade-defaults-51a9667c.js');
7
7
 
8
8
  async function colorizeCode(code) {
9
9
  return await arcadeDefaults.editor.colorize(code, "arcade", { tabSize: 2 });
@@ -3019,7 +3019,7 @@ async function getArcadeWorker(uri) {
3019
3019
  * @returns mode for arcade
3020
3020
  */
3021
3021
  async function getMode() {
3022
- return await Promise.resolve().then(function () { return require('./arcade-mode-b21b24cc.js'); });
3022
+ return await Promise.resolve().then(function () { return require('./arcade-mode-7705211c.js'); });
3023
3023
  }
3024
3024
  // Register the language in Monaco
3025
3025
  arcadeDefaults.languages.register({