@arcgis/coding-components 4.29.0-beta.91 → 4.29.0-beta.92

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 (39) 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-7d0446b7.js → p-1d062d47.js} +1 -1
  4. package/dist/arcgis-coding-components/{p-dd581533.js → p-4c959bce.js} +7 -7
  5. package/dist/arcgis-coding-components/{p-4e045b71.js → p-590b795b.js} +1 -1
  6. package/dist/arcgis-coding-components/{p-3805737d.js → p-75ae922a.js} +1 -1
  7. package/dist/arcgis-coding-components/{p-9948e974.js → p-79707082.js} +1 -1
  8. package/dist/arcgis-coding-components/{p-d9ec0047.js → p-86772125.js} +1 -1
  9. package/dist/arcgis-coding-components/{p-d71ee7d2.js → p-a1a4f5fc.js} +1 -1
  10. package/dist/arcgis-coding-components/{p-c0b70189.entry.js → p-ac769046.entry.js} +1 -1
  11. package/dist/arcgis-coding-components/{p-c6fe6292.js → p-ca7059d4.js} +1 -1
  12. package/dist/arcgis-coding-components/{p-a55b2bdb.js → p-cdfe57a1.js} +1 -1
  13. package/dist/cjs/{arcade-defaults-fee084bd.js → arcade-defaults-7faf4d5f.js} +63 -37
  14. package/dist/cjs/{arcade-mode-ed4d78ef.js → arcade-mode-26b8bc7a.js} +1 -1
  15. package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +2 -2
  16. package/dist/cjs/{cssMode-cb971778.js → cssMode-90f06d02.js} +1 -1
  17. package/dist/cjs/{html-dca8feef.js → html-1aa8e458.js} +1 -1
  18. package/dist/cjs/{htmlMode-77dedc8a.js → htmlMode-d3283acc.js} +1 -1
  19. package/dist/cjs/index.cjs.js +1 -1
  20. package/dist/cjs/{javascript-2a1b9e40.js → javascript-7a4d9023.js} +2 -2
  21. package/dist/cjs/{jsonMode-8605bff0.js → jsonMode-73be73dc.js} +1 -1
  22. package/dist/cjs/{tsMode-20cd47cf.js → tsMode-95a699e0.js} +1 -1
  23. package/dist/cjs/{typescript-dc19566c.js → typescript-588df930.js} +1 -1
  24. package/dist/components/arcade-defaults.js +46 -31
  25. package/dist/components/fields.js +12 -1
  26. package/dist/esm/{arcade-defaults-95c55c4f.js → arcade-defaults-0bc49d1c.js} +63 -37
  27. package/dist/esm/{arcade-mode-ef0d116c.js → arcade-mode-01365fb8.js} +1 -1
  28. package/dist/esm/arcgis-arcade-api_6.entry.js +2 -2
  29. package/dist/esm/{cssMode-76fecc81.js → cssMode-edce5a89.js} +1 -1
  30. package/dist/esm/{html-2e721316.js → html-00b724af.js} +1 -1
  31. package/dist/esm/{htmlMode-47914b29.js → htmlMode-ad3459b7.js} +1 -1
  32. package/dist/esm/index.js +1 -1
  33. package/dist/esm/{javascript-35d95795.js → javascript-bdd52d83.js} +2 -2
  34. package/dist/esm/{jsonMode-cb730a27.js → jsonMode-7b4c07fb.js} +1 -1
  35. package/dist/esm/{tsMode-3f196357.js → tsMode-0bd06180.js} +1 -1
  36. package/dist/esm/{typescript-d0fbeecc.js → typescript-dfdad07a.js} +1 -1
  37. package/dist/types/utils/profile/editor-profile.d.ts +6 -4
  38. package/dist/types/utils/profile/utils.d.ts +11 -11
  39. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- import{p as t,o as e}from"./p-dd581533.js";import"./p-ccafed7f.js";
1
+ import{p as t,o as e}from"./p-4c959bce.js";import"./p-ccafed7f.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
@@ -1,4 +1,4 @@
1
- import{o as t}from"./p-dd581533.js";import"./p-ccafed7f.js";
1
+ import{o as t}from"./p-4c959bce.js";import"./p-ccafed7f.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
@@ -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-dca8feef.js'); });
120560
+ return Promise.resolve().then(function () { return require('./html-1aa8e458.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-2a1b9e40.js'); });
120580
+ return Promise.resolve().then(function () { return require('./javascript-7a4d9023.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-dc19566c.js'); });
120598
+ return Promise.resolve().then(function () { return require('./typescript-588df930.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-cb971778.js'); });
120719
+ return Promise.resolve().then(function () { return require('./cssMode-90f06d02.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-77dedc8a.js'); });
120844
+ return Promise.resolve().then(function () { return require('./htmlMode-d3283acc.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-8605bff0.js'); });
120946
+ return Promise.resolve().then(function () { return require('./jsonMode-73be73dc.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-20cd47cf.js'); });
121215
+ return Promise.resolve().then(function () { return require('./tsMode-95a699e0.js'); });
121216
121216
  }
121217
121217
  }
121218
121218
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -168969,6 +168969,17 @@ async function importWebMap() {
168969
168969
  const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebMap.js')); });
168970
168970
  return module.default;
168971
168971
  }
168972
+ async function importWebScene() {
168973
+ if (amd) {
168974
+ return requireModule("esri/WebScene");
168975
+ }
168976
+ const module = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@arcgis/core/WebScene.js')); });
168977
+ return module.default;
168978
+ }
168979
+ async function newWebScene(properties) {
168980
+ const ModConstructor = await importWebScene();
168981
+ return new ModConstructor(properties);
168982
+ }
168972
168983
  async function importArcade() {
168973
168984
  if (amd) {
168974
168985
  return requireModule("esri/arcade");
@@ -169000,48 +169011,59 @@ async function newWebMap(definition) {
169000
169011
  function isSupportedLayerInstance(item) {
169001
169012
  return (!!item &&
169002
169013
  typeof item === "object" &&
169014
+ "declaredClass" in item &&
169003
169015
  typeof item.declaredClass === "string" &&
169004
169016
  item.declaredClass.startsWith("esri.layers."));
169005
169017
  }
169006
169018
  function isFeatureSetInstance(item) {
169007
169019
  return (!!item &&
169008
169020
  typeof item === "object" &&
169021
+ "declaredClass" in item &&
169009
169022
  typeof item.declaredClass === "string" &&
169010
169023
  item.declaredClass === "esri.rest.support.FeatureSet");
169011
169024
  }
169012
169025
  function isQueryableLayerInstance(item) {
169013
169026
  return (!!item &&
169014
169027
  typeof item === "object" &&
169028
+ "declaredClass" in item &&
169015
169029
  typeof item.declaredClass === "string" &&
169016
169030
  item.declaredClass.startsWith("esri.layers.") &&
169017
169031
  "fields" in item &&
169032
+ "queryFeatures" in item &&
169018
169033
  typeof item.queryFeatures === "function");
169019
169034
  }
169020
169035
  function isGroupLayerInstance(item) {
169021
169036
  return (!!item &&
169022
169037
  typeof item === "object" &&
169038
+ "declaredClass" in item &&
169023
169039
  typeof item.declaredClass === "string" &&
169024
169040
  item.declaredClass === "esri.layers.GroupLayer");
169025
169041
  }
169026
- function isWebMapInstance(item) {
169027
- return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
169042
+ function isMapInstance(item) {
169043
+ return (!!item &&
169044
+ typeof item === "object" &&
169045
+ "declaredClass" in item &&
169046
+ typeof item.declaredClass === "string" &&
169047
+ (item.declaredClass === "esri.WebMap" || item.declaredClass === "esri.WebScene"));
169028
169048
  }
169029
169049
  function isPortalItemDefinition(item) {
169030
- return !!item && typeof item === "object" && item.portalItem != null;
169050
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169031
169051
  }
169032
169052
  function isFeatureLayerItemDefinition(item) {
169033
- return !!item && typeof item === "object" && item.portalItem != null;
169053
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
169034
169054
  }
169035
169055
  function isFieldsDefinition(item) {
169036
- return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
169056
+ return (!!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields) && !("declaredClass" in item));
169037
169057
  }
169038
169058
  function isUrlDefinition(item) {
169039
- return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in item);
169059
+ return (!!item && typeof item === "object" && "url" in item && typeof item.url === "string" && !("declaredClass" in item));
169040
169060
  }
169041
169061
  function isPredefinedProfile(item) {
169042
169062
  return (!!item &&
169043
169063
  typeof item === "object" &&
169064
+ "id" in item &&
169044
169065
  typeof item.id === "string" &&
169066
+ "definitions" in item &&
169045
169067
  typeof item.definitions === "object" &&
169046
169068
  !Array.isArray(item.definitions));
169047
169069
  }
@@ -169178,26 +169200,28 @@ function resolveIntlPath(dictionary, path) {
169178
169200
  return typeof entry === "string" ? entry : path;
169179
169201
  }
169180
169202
  function isTypesCapabaleLayer(item) {
169181
- return !!item?.typeIdField;
169203
+ return !!item && typeof item === "object" && "typeIdField" in item;
169182
169204
  }
169183
169205
  function isDomainsCapableLayer(item) {
169184
- return typeof item?.getFieldDomain === "function";
169206
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
169185
169207
  }
169186
169208
  function isRelationshipsCapableLayer(item) {
169187
- return Array.isArray(item?.relationships) && typeof item?.url === "string";
169209
+ return (!!item &&
169210
+ typeof item === "object" &&
169211
+ "relationships" in item &&
169212
+ "url" in item &&
169213
+ Array.isArray(item.relationships) &&
169214
+ typeof item.url === "string");
169188
169215
  }
169189
169216
  function isTableCapableLayer(item) {
169190
- return typeof item?.isTable === "boolean";
169217
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
169191
169218
  }
169192
169219
  function isLoadableSource(item) {
169193
- return typeof item?.load === "function";
169220
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
169194
169221
  }
169195
169222
  //#endregion
169196
169223
  //#region Support Functions
169197
169224
  async function getRelatedFeatureLayer(layer, relationship) {
169198
- if (!relationship) {
169199
- return null;
169200
- }
169201
169225
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
169202
169226
  await relatedFeatureLayer.load();
169203
169227
  return relatedFeatureLayer;
@@ -169303,10 +169327,6 @@ async function supportedSourceFromDefinition(definition) {
169303
169327
  else {
169304
169328
  source = await newFeatureLayer(definition);
169305
169329
  }
169306
- if (!source) {
169307
- console.error("Invalid FeatureSetDefinition", definition);
169308
- return null;
169309
- }
169310
169330
  if (isLoadableSource(source)) {
169311
169331
  await source.load();
169312
169332
  }
@@ -170087,8 +170107,8 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170087
170107
  if (!this._definition) {
170088
170108
  return null;
170089
170109
  }
170090
- if (isWebMapInstance(this._definition)) {
170091
- return await this._featureSetCollectionFromWebMap(this._definition);
170110
+ if (isMapInstance(this._definition)) {
170111
+ return await this._featureSetCollectionFromMap(this._definition);
170092
170112
  }
170093
170113
  if (isSupportedLayerInstance(this._definition)) {
170094
170114
  return await this._featureSetCollectionFromUrl(this._definition.url);
@@ -170104,23 +170124,29 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
170104
170124
  }
170105
170125
  return null;
170106
170126
  }
170107
- async _featureSetCollectionFromWebMap(definition) {
170108
- const webMap = isWebMapInstance(definition) ? definition : await newWebMap({ portalItem: definition });
170109
- await webMap.loadAll();
170127
+ async _featureSetCollectionFromMap(map) {
170128
+ // Make sure the map is loaded
170129
+ await map.loadAll();
170110
170130
  // Until jsapi fix a bug we have to load the table separately
170111
- await Promise.all(webMap.tables.map(async (t) => await t.load()));
170131
+ await Promise.all(map.tables.map(async (t) => (await t.load())));
170112
170132
  return {
170113
- layers: this._convertWebMapLayersToVariables(webMap.layers),
170114
- tables: this._convertWebMapLayersToVariables(webMap.tables, true),
170115
- source: webMap
170133
+ layers: this._convertWebMapLayersToVariables(map.layers),
170134
+ tables: this._convertWebMapLayersToVariables(map.tables, true),
170135
+ source: map
170116
170136
  };
170117
170137
  }
170118
170138
  async _featureSetCollectionFromPortalItem(definition) {
170119
170139
  const portalItem = await newPortalItem(definition);
170120
170140
  await portalItem.load();
170121
170141
  switch (portalItem.type) {
170122
- case "Web Map":
170123
- return await this._featureSetCollectionFromWebMap(portalItem);
170142
+ case "Web Map": {
170143
+ const webMap = await newWebMap({ portalItem });
170144
+ return await this._featureSetCollectionFromMap(webMap);
170145
+ }
170146
+ case "Web Scene": {
170147
+ const webScene = await newWebScene({ portalItem });
170148
+ return await this._featureSetCollectionFromMap(webScene);
170149
+ }
170124
170150
  case "Feature Service":
170125
170151
  return await this._featureSetCollectionFromUrl(portalItem.url);
170126
170152
  default:
@@ -170261,7 +170287,7 @@ function isFeatureSetDefinition(item) {
170261
170287
  isFeatureLayerItemDefinition(item));
170262
170288
  }
170263
170289
  function isFeatureSetCollectionDefinition(item) {
170264
- return isPortalItemDefinition(item) || isWebMapInstance(item) || isFeatureSetDefinition(item);
170290
+ return isPortalItemDefinition(item) || isMapInstance(item) || isFeatureSetDefinition(item);
170265
170291
  }
170266
170292
  /**
170267
170293
  * Get a PredefinedProfile for a locale. If not already loaded then fetch it.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  var j={False:"false",Null:"null",True:"true"},f={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},Fe=["++","--"],Qe=["-","+","!","~"],Ze=["=","/=","*=","%=","+=","-="],Xe=["||","&&"],Lt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var U=[[],[],[]];Fe.forEach(t=>U[t.length-1]?.push(t));Qe.forEach(t=>U[t.length-1]?.push(t));Xe.forEach(t=>U[t.length-1]?.push(t));Ze.forEach(t=>U[t.length-1]?.push(t));Lt.forEach(t=>U[t.length-1]?.push(t));var ht=Object.values(f),dt=Object.values(j);dt.map(t=>({label:t,kind:arcadeDefaults.main.CompletionItemKind.Constant}));ht.map(t=>({label:t,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-aaf14a3e.js');
6
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
6
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.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-ed4d78ef.js'); });
3022
+ return await Promise.resolve().then(function () { return require('./arcade-mode-26b8bc7a.js'); });
3023
3023
  }
3024
3024
  // Register the language in Monaco
3025
3025
  arcadeDefaults.languages.register({
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  /*!-----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  /*!-----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  /*!-----------------------------------------------------------------------------
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
5
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
6
6
  require('./index-aaf14a3e.js');
7
7
 
8
8
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const typescript = require('./typescript-dc19566c.js');
4
- require('./arcade-defaults-fee084bd.js');
3
+ const typescript = require('./typescript-588df930.js');
4
+ require('./arcade-defaults-7faf4d5f.js');
5
5
  require('./index-aaf14a3e.js');
6
6
 
7
7
  /*!-----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  /*!-----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  /*!-----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const arcadeDefaults = require('./arcade-defaults-fee084bd.js');
3
+ const arcadeDefaults = require('./arcade-defaults-7faf4d5f.js');
4
4
  require('./index-aaf14a3e.js');
5
5
 
6
6
  /*!-----------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import { Emitter, Uri } from 'monaco-editor';
2
2
  import { CompletionItemKind, InsertTextMode, InsertTextFormat } from 'vscode-languageserver-types';
3
- import { i as importPortalPortalItem, a as importLayersFeatureLayer, b as importWebMap, s as supportedFields, c as importRequest, f as fieldTypeToIconName, d as fieldTypeToArcadeType } from './fields.js';
3
+ import { i as importPortalPortalItem, a as importLayersFeatureLayer, b as importWebMap, s as supportedFields, n as newWebScene, c as importRequest, f as fieldTypeToIconName, d as fieldTypeToArcadeType } from './fields.js';
4
4
  import { p as portalItemPageUrl } from './utilities.js';
5
5
  import { V, X, G, D, E, N } from './index2.js';
6
6
  import { getAssetPath } from '@stencil/core/internal/client';
@@ -21,48 +21,59 @@ async function newWebMap(definition) {
21
21
  function isSupportedLayerInstance(item) {
22
22
  return (!!item &&
23
23
  typeof item === "object" &&
24
+ "declaredClass" in item &&
24
25
  typeof item.declaredClass === "string" &&
25
26
  item.declaredClass.startsWith("esri.layers."));
26
27
  }
27
28
  function isFeatureSetInstance(item) {
28
29
  return (!!item &&
29
30
  typeof item === "object" &&
31
+ "declaredClass" in item &&
30
32
  typeof item.declaredClass === "string" &&
31
33
  item.declaredClass === "esri.rest.support.FeatureSet");
32
34
  }
33
35
  function isQueryableLayerInstance(item) {
34
36
  return (!!item &&
35
37
  typeof item === "object" &&
38
+ "declaredClass" in item &&
36
39
  typeof item.declaredClass === "string" &&
37
40
  item.declaredClass.startsWith("esri.layers.") &&
38
41
  "fields" in item &&
42
+ "queryFeatures" in item &&
39
43
  typeof item.queryFeatures === "function");
40
44
  }
41
45
  function isGroupLayerInstance(item) {
42
46
  return (!!item &&
43
47
  typeof item === "object" &&
48
+ "declaredClass" in item &&
44
49
  typeof item.declaredClass === "string" &&
45
50
  item.declaredClass === "esri.layers.GroupLayer");
46
51
  }
47
- function isWebMapInstance(item) {
48
- return (!!item && typeof item === "object" && typeof item.declaredClass === "string" && item.declaredClass === "esri.WebMap");
52
+ function isMapInstance(item) {
53
+ return (!!item &&
54
+ typeof item === "object" &&
55
+ "declaredClass" in item &&
56
+ typeof item.declaredClass === "string" &&
57
+ (item.declaredClass === "esri.WebMap" || item.declaredClass === "esri.WebScene"));
49
58
  }
50
59
  function isPortalItemDefinition(item) {
51
- return !!item && typeof item === "object" && item.portalItem != null;
60
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
52
61
  }
53
62
  function isFeatureLayerItemDefinition(item) {
54
- return !!item && typeof item === "object" && item.portalItem != null;
63
+ return !!item && typeof item === "object" && "portalItem" in item && item.portalItem != null;
55
64
  }
56
65
  function isFieldsDefinition(item) {
57
- return !!item && typeof item === "object" && Array.isArray(item.fields) && !("declaredClass" in item);
66
+ return (!!item && typeof item === "object" && "fields" in item && Array.isArray(item.fields) && !("declaredClass" in item));
58
67
  }
59
68
  function isUrlDefinition(item) {
60
- return !!item && typeof item === "object" && typeof item.url === "string" && !("declaredClass" in item);
69
+ return (!!item && typeof item === "object" && "url" in item && typeof item.url === "string" && !("declaredClass" in item));
61
70
  }
62
71
  function isPredefinedProfile(item) {
63
72
  return (!!item &&
64
73
  typeof item === "object" &&
74
+ "id" in item &&
65
75
  typeof item.id === "string" &&
76
+ "definitions" in item &&
66
77
  typeof item.definitions === "object" &&
67
78
  !Array.isArray(item.definitions));
68
79
  }
@@ -82,26 +93,28 @@ function resolveIntlPath(dictionary, path) {
82
93
  return typeof entry === "string" ? entry : path;
83
94
  }
84
95
  function isTypesCapabaleLayer(item) {
85
- return !!item?.typeIdField;
96
+ return !!item && typeof item === "object" && "typeIdField" in item;
86
97
  }
87
98
  function isDomainsCapableLayer(item) {
88
- return typeof item?.getFieldDomain === "function";
99
+ return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
89
100
  }
90
101
  function isRelationshipsCapableLayer(item) {
91
- return Array.isArray(item?.relationships) && typeof item?.url === "string";
102
+ return (!!item &&
103
+ typeof item === "object" &&
104
+ "relationships" in item &&
105
+ "url" in item &&
106
+ Array.isArray(item.relationships) &&
107
+ typeof item.url === "string");
92
108
  }
93
109
  function isTableCapableLayer(item) {
94
- return typeof item?.isTable === "boolean";
110
+ return !!item && typeof item === "object" && "isTable" in item && typeof item.isTable === "boolean";
95
111
  }
96
112
  function isLoadableSource(item) {
97
- return typeof item?.load === "function";
113
+ return !!item && typeof item === "object" && "load" in item && typeof item.load === "function";
98
114
  }
99
115
  //#endregion
100
116
  //#region Support Functions
101
117
  async function getRelatedFeatureLayer(layer, relationship) {
102
- if (!relationship) {
103
- return null;
104
- }
105
118
  const relatedFeatureLayer = await newFeatureLayer({ url: `${layer.url}/${relationship.relatedTableId}` });
106
119
  await relatedFeatureLayer.load();
107
120
  return relatedFeatureLayer;
@@ -207,10 +220,6 @@ async function supportedSourceFromDefinition(definition) {
207
220
  else {
208
221
  source = await newFeatureLayer(definition);
209
222
  }
210
- if (!source) {
211
- console.error("Invalid FeatureSetDefinition", definition);
212
- return null;
213
- }
214
223
  if (isLoadableSource(source)) {
215
224
  await source.load();
216
225
  }
@@ -991,8 +1000,8 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
991
1000
  if (!this._definition) {
992
1001
  return null;
993
1002
  }
994
- if (isWebMapInstance(this._definition)) {
995
- return await this._featureSetCollectionFromWebMap(this._definition);
1003
+ if (isMapInstance(this._definition)) {
1004
+ return await this._featureSetCollectionFromMap(this._definition);
996
1005
  }
997
1006
  if (isSupportedLayerInstance(this._definition)) {
998
1007
  return await this._featureSetCollectionFromUrl(this._definition.url);
@@ -1008,23 +1017,29 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
1008
1017
  }
1009
1018
  return null;
1010
1019
  }
1011
- async _featureSetCollectionFromWebMap(definition) {
1012
- const webMap = isWebMapInstance(definition) ? definition : await newWebMap({ portalItem: definition });
1013
- await webMap.loadAll();
1020
+ async _featureSetCollectionFromMap(map) {
1021
+ // Make sure the map is loaded
1022
+ await map.loadAll();
1014
1023
  // Until jsapi fix a bug we have to load the table separately
1015
- await Promise.all(webMap.tables.map(async (t) => await t.load()));
1024
+ await Promise.all(map.tables.map(async (t) => (await t.load())));
1016
1025
  return {
1017
- layers: this._convertWebMapLayersToVariables(webMap.layers),
1018
- tables: this._convertWebMapLayersToVariables(webMap.tables, true),
1019
- source: webMap
1026
+ layers: this._convertWebMapLayersToVariables(map.layers),
1027
+ tables: this._convertWebMapLayersToVariables(map.tables, true),
1028
+ source: map
1020
1029
  };
1021
1030
  }
1022
1031
  async _featureSetCollectionFromPortalItem(definition) {
1023
1032
  const portalItem = await newPortalItem(definition);
1024
1033
  await portalItem.load();
1025
1034
  switch (portalItem.type) {
1026
- case "Web Map":
1027
- return await this._featureSetCollectionFromWebMap(portalItem);
1035
+ case "Web Map": {
1036
+ const webMap = await newWebMap({ portalItem });
1037
+ return await this._featureSetCollectionFromMap(webMap);
1038
+ }
1039
+ case "Web Scene": {
1040
+ const webScene = await newWebScene({ portalItem });
1041
+ return await this._featureSetCollectionFromMap(webScene);
1042
+ }
1028
1043
  case "Feature Service":
1029
1044
  return await this._featureSetCollectionFromUrl(portalItem.url);
1030
1045
  default:
@@ -1165,7 +1180,7 @@ function isFeatureSetDefinition(item) {
1165
1180
  isFeatureLayerItemDefinition(item));
1166
1181
  }
1167
1182
  function isFeatureSetCollectionDefinition(item) {
1168
- return isPortalItemDefinition(item) || isWebMapInstance(item) || isFeatureSetDefinition(item);
1183
+ return isPortalItemDefinition(item) || isMapInstance(item) || isFeatureSetDefinition(item);
1169
1184
  }
1170
1185
  /**
1171
1186
  * Get a PredefinedProfile for a locale. If not already loaded then fetch it.
@@ -25,6 +25,17 @@ async function importWebMap() {
25
25
  const module = await import('@arcgis/core/WebMap.js');
26
26
  return module.default;
27
27
  }
28
+ async function importWebScene() {
29
+ if (amd) {
30
+ return requireModule("esri/WebScene");
31
+ }
32
+ const module = await import('@arcgis/core/WebScene.js');
33
+ return module.default;
34
+ }
35
+ async function newWebScene(properties) {
36
+ const ModConstructor = await importWebScene();
37
+ return new ModConstructor(properties);
38
+ }
28
39
  async function importArcade() {
29
40
  if (amd) {
30
41
  return requireModule("esri/arcade");
@@ -122,4 +133,4 @@ function supportedFields(fields) {
122
133
  });
123
134
  }
124
135
 
125
- export { importLayersFeatureLayer as a, importWebMap as b, importRequest as c, fieldTypeToArcadeType as d, importArcade as e, fieldTypeToIconName as f, importPortalPortalItem as i, supportedFields as s };
136
+ export { importLayersFeatureLayer as a, importWebMap as b, importRequest as c, fieldTypeToArcadeType as d, importArcade as e, fieldTypeToIconName as f, importPortalPortalItem as i, newWebScene as n, supportedFields as s };