@arcgis/core 5.2.0-next.144 → 5.2.0-next.146

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 (138) hide show
  1. package/analysis/AreaMeasurementAnalysis.d.ts +11 -1
  2. package/analysis/DirectLineMeasurementAnalysis.d.ts +11 -1
  3. package/analysis/DistanceMeasurementAnalysis.d.ts +8 -0
  4. package/arcade/featureSetUtils.js +1 -1
  5. package/arcgisGlobal.d.ts +5 -5
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{1ede8666d804c553803e.js → 0b6941781e35ce0f7274.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{a0d459bdb91ee892d4b6.js → 116293b1ee788a89ce1e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/18f20fd43ec9ce03cef1.js +1 -0
  10. package/assets/esri/core/workers/chunks/{8959a825f5e1ce6f38ac.js → 1c65ab9ed611c322ce27.js} +1 -1
  11. package/assets/esri/core/workers/chunks/257910cca66dc5df465e.js +1 -0
  12. package/assets/esri/core/workers/chunks/2e096537a3a5555a4a93.js +1 -0
  13. package/assets/esri/core/workers/chunks/{8ba32d3a0df4a206ef1c.js → 392bcef780df52fb4cca.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d4926545193414cf2f16.js → 4ed8655770a3e018e366.js} +1 -1
  15. package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +1 -0
  16. package/assets/esri/core/workers/chunks/532a1b6ff9a7c950e325.js +1 -0
  17. package/assets/esri/core/workers/chunks/56a24061589f4a968818.js +1 -0
  18. package/assets/esri/core/workers/chunks/{5b3cfe95314a75a735c1.js → 588e677f33df86a595bf.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{25e6013e2c095629b236.js → 58c252289411b0d86473.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{1c0975c2dd1d0e2710bb.js → 6883a5c6883eccaddf64.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{f74e32d2ffe81778826b.js → 6c1d5577a17a5c8ccf39.js} +1 -1
  22. package/assets/esri/core/workers/chunks/6c83398cf586ecea0eb1.js +1 -0
  23. package/assets/esri/core/workers/chunks/{e521bb9ee2030245c3ce.js → 6f358116f79021ff9687.js} +1 -1
  24. package/assets/esri/core/workers/chunks/76196c414e48834f7b92.js +1 -0
  25. package/assets/esri/core/workers/chunks/{cbe6c0f32608cb504695.js → 776ae25a34352d3468bc.js} +1 -1
  26. package/assets/esri/core/workers/chunks/77ebacfdf8e57f2e03f1.js +1118 -0
  27. package/assets/esri/core/workers/chunks/794e5a67a88cb10c1a19.js +1 -0
  28. package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +1 -0
  29. package/assets/esri/core/workers/chunks/{fccbb902fe08448f91de.js → 9c1e69ac82e2bf746191.js} +1 -1
  30. package/assets/esri/core/workers/chunks/aba42885c5d6b2b5fe7f.js +1 -0
  31. package/assets/esri/core/workers/chunks/b61008f28b788f759e2a.js +1 -0
  32. package/assets/esri/core/workers/chunks/{402a82c77420254831bc.js → b7d77dd2abb255fd2e5a.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8b54589f173259c1ba55.js → b8054adc45bca069b948.js} +1 -1
  34. package/assets/esri/core/workers/chunks/ba48045a81acc4cda927.js +1 -0
  35. package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +1 -0
  36. package/assets/esri/core/workers/chunks/d4f038e04c42aed588c1.js +1 -0
  37. package/assets/esri/core/workers/chunks/d90a3bfd45b5ed4092e0.js +1 -0
  38. package/assets/esri/core/workers/chunks/{43fc42405167a5537039.js → f095cf98940e3f95d51e.js} +1 -1
  39. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +0 -2
  40. package/assets/esri/themes/dark/main.css +1 -1
  41. package/assets/esri/themes/light/main.css +1 -1
  42. package/assets/esri/themes/light/view.css +1 -1
  43. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  44. package/{basemaps/BasemapCollection.d.ts → basemapGallery/BasemapGalleryModel.d.ts} +8 -8
  45. package/{basemaps/BasemapCollection.js → basemapGallery/BasemapGalleryModel.js} +1 -1
  46. package/{basemaps → basemapGallery}/BasemapsSource.d.ts +1 -1
  47. package/{basemaps → basemapGallery}/BasemapsSource.js +1 -1
  48. package/{basemaps → basemapGallery}/LocalBasemapsSource.d.ts +2 -2
  49. package/{basemaps → basemapGallery}/LocalBasemapsSource.js +1 -1
  50. package/{basemaps → basemapGallery}/PortalBasemapsSource.d.ts +2 -2
  51. package/{basemaps → basemapGallery}/PortalBasemapsSource.js +1 -1
  52. package/{basemaps → basemapGallery}/support/BasemapItem.d.ts +2 -2
  53. package/{basemaps → basemapGallery}/support/BasemapItem.js +1 -1
  54. package/{basemaps → basemapGallery}/types.d.ts +2 -2
  55. package/chunks/GlobalIllumination.glsl.js +4 -2
  56. package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
  57. package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
  58. package/config.js +1 -1
  59. package/core/colorUtils.js +1 -1
  60. package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
  61. package/kernel.js +1 -1
  62. package/layers/ParquetLayer.d.ts +9 -8
  63. package/layers/ParquetLayer.js +1 -1
  64. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  65. package/layers/graphics/transferFeatures.js +1 -1
  66. package/layers/raster/datasets/TIFFRaster.js +1 -1
  67. package/layers/support/ParquetPortalItemData.d.ts +2 -0
  68. package/layers/support/ParquetPortalItemData.js +1 -1
  69. package/layers/support/PortalItemData.d.ts +21 -0
  70. package/layers/support/parquetUtils.d.ts +1 -1
  71. package/layers/support/types.d.ts +1 -1
  72. package/package.json +2 -2
  73. package/symbols/cim/cimAnalyzer.js +1 -1
  74. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +4 -4
  75. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +4 -4
  76. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  77. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  78. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  79. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  80. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -0
  81. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +2 -1
  82. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  83. package/views/3d/layers/support/FeatureMemory.js +1 -1
  84. package/views/3d/layers/support/FeatureTile.js +1 -1
  85. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  86. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  87. package/views/3d/support/PBFDecoder.js +1 -1
  88. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +16 -11
  89. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  90. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
  91. package/views/SceneView.d.ts +4 -10
  92. package/views/View.d.ts +4 -12
  93. package/views/interactive/options/SnappingOptions.d.ts +29 -12
  94. package/views/interactive/options/TooltipOptions.d.ts +9 -1
  95. package/views/interactive/options/ValueOptions.d.ts +9 -2
  96. package/views/interactive/options/ViewOptions.d.ts +82 -6
  97. package/views/interactive/support/Units.d.ts +1 -0
  98. package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +2 -2
  99. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  100. package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -3
  101. package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -2
  102. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -2
  103. package/widgets/BasemapGallery/types.d.ts +3 -3
  104. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  105. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  106. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  107. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +6 -0
  108. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  109. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  110. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  111. package/widgets/BatchAttributeForm.js +1 -1
  112. package/widgets/Editor/EditorViewModel.d.ts +13 -8
  113. package/widgets/Editor.d.ts +9 -9
  114. package/widgets/FeatureForm.d.ts +2 -2
  115. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  116. package/widgets/Sketch/SketchViewModel.d.ts +13 -8
  117. package/widgets/Sketch.d.ts +9 -9
  118. package/assets/esri/core/workers/chunks/14a3808427deaaa85bf2.js +0 -1
  119. package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +0 -1
  120. package/assets/esri/core/workers/chunks/260dcb79dfd0f981949f.js +0 -1
  121. package/assets/esri/core/workers/chunks/303676d1b10676c9cab4.js +0 -1
  122. package/assets/esri/core/workers/chunks/37a636f61cfe89c6bfd1.js +0 -1
  123. package/assets/esri/core/workers/chunks/4097edb2ad522dff50ce.js +0 -1
  124. package/assets/esri/core/workers/chunks/4a0216ee6382d9276f1c.js +0 -1
  125. package/assets/esri/core/workers/chunks/55766692b578e60dd70e.js +0 -1742
  126. package/assets/esri/core/workers/chunks/57970d43cdcc5cf57a30.js +0 -1
  127. package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +0 -1
  128. package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +0 -1
  129. package/assets/esri/core/workers/chunks/8e7a33cc1f83063043f2.js +0 -1
  130. package/assets/esri/core/workers/chunks/a23272a7a47a95f6ddea.js +0 -1
  131. package/assets/esri/core/workers/chunks/cbdebdfa5f2cded29d0d.js +0 -1
  132. package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +0 -1
  133. package/assets/esri/core/workers/chunks/d56780290e0218d3e9de.js +0 -1
  134. package/assets/esri/core/workers/chunks/de24fc414a3f243d675e.js +0 -1
  135. package/assets/esri/core/workers/chunks/e22d45aeef293a5ffb78.js +0 -1
  136. package/assets/esri/core/workers/chunks/ea746d9bbea170719a1c.js +0 -1
  137. package/assets/esri/core/workers/chunks/f0c0c02730fe0d948fc1.js +0 -1
  138. /package/{basemaps → basemapGallery}/support/basemapCompatibilityUtils.js +0 -0
package/views/View.d.ts CHANGED
@@ -162,17 +162,13 @@ export interface ViewProperties<TLayerView extends LayerView = LayerView> extend
162
162
  */
163
163
  navigation?: NavigationProperties;
164
164
  /**
165
- * Configures snapping, tooltips, and measurement units for supported components and analyses configured to inherit these options from the view.
166
- *
167
- * Snapping is disabled by default in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and enabled by default in a
168
- * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Tooltips are disabled by default.
165
+ * Configures snapping, tooltips, display units, and input units for supported components, view models, and analyses.
166
+ * See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for supported options, exceptions, and opt-in requirements.
169
167
  *
170
168
  * > [!IMPORTANT]
171
169
  * >
172
170
  * > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
173
171
  *
174
- * See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for details.
175
- *
176
172
  * @beta
177
173
  * @since 5.2
178
174
  */
@@ -603,17 +599,13 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
603
599
  get navigation(): Navigation;
604
600
  set navigation(value: NavigationProperties);
605
601
  /**
606
- * Configures snapping, tooltips, and measurement units for supported components and analyses configured to inherit these options from the view.
607
- *
608
- * Snapping is disabled by default in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and enabled by default in a
609
- * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Tooltips are disabled by default.
602
+ * Configures snapping, tooltips, display units, and input units for supported components, view models, and analyses.
603
+ * See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for supported options, exceptions, and opt-in requirements.
610
604
  *
611
605
  * > [!IMPORTANT]
612
606
  * >
613
607
  * > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
614
608
  *
615
- * See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for details.
616
- *
617
609
  * @beta
618
610
  * @since 5.2
619
611
  */
@@ -8,7 +8,11 @@ import type { ReadonlyArrayOrCollection } from "../../../core/Collection.js";
8
8
  /** @since 5.2 */
9
9
  export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions, "attributeRulesEnabled" | "distance" | "enabled" | "featureEnabled" | "gridEnabled" | "selfEnabled">> {
10
10
  /**
11
- * List of sources for feature snapping. Please refer to [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) for additional information on what layer sources are supported.
11
+ * List of sources for feature snapping. See [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) for supported layer sources.
12
+ *
13
+ * When used through [ViewOptions.snapping](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#snapping), supported layers in the view's map are
14
+ * used automatically if this property has not been explicitly configured. Explicitly configuring this property
15
+ * replaces the automatic source list.
12
16
  *
13
17
  * @since 5.2
14
18
  */
@@ -16,18 +20,24 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
16
20
  }
17
21
 
18
22
  /**
19
- * The `SnappingOptions` class allows users to configure snapping for their editing or drawing experience in both the [Sketch.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/#snappingOptions) and [Editor.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#snappingOptions) widgets.
23
+ * Configures snapping while drawing, editing, or placing analyses.
24
+ *
25
+ * Use [view.options.snapping](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#snapping) to share snapping options across supported
26
+ * components, view models, and analyses. See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for supported tools and opt-in requirements.
20
27
  *
21
- * Snapping options provide the ability to specify whether an application will utilize self snapping, feature snapping, or both. Both are described below.
28
+ * Snapping can also be configured on the [Sketch](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-sketch/)
29
+ * and [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/) components or their view models,
30
+ * [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/) and [EditorViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/).
22
31
  *
23
- * It is also possible to toggle snapping by pressing and holding down the `CTRL` key. This toggles the snapping on/off.
32
+ * Enable self snapping, feature snapping, or both, as described below.
33
+ * In tools that support the shortcut, holding down the `CTRL` key temporarily toggles snapping on or off.
24
34
  *
25
35
  * #### Self snapping (Geometry guides)
26
36
  * Self snapping is set via the [selfEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) property. This means that while a user is actively creating or updating a feature or graphic, they will see visualizations to help identify perpendicular and parallel lines, in addition to visualizations which aid in snapping to an extension of an existing feature. The following briefly demonstrates what self snapping looks like in a 2D application. Although this is shown for 2D, the same premise applies for 3D as well.
27
37
  *
28
38
  * <video src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-self-2d.webm" aria-label="self-snapping" autoplay muted playsinline loop></video>
29
39
  * #### Feature snapping
30
- * Feature snapping is set via the [featureEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) property. It provides the ability to snap vertices of a graphic or feature that is currently being drawn or reshaped to that of an existing feature's vertex, edge, or end point. These existing features belong to layers within the [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) and must be specified in the [featureSources](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureSources) property. The following two images demonstrate feature snapping in a 2D application. Similar to self snapping, the same premise applies for 3D as well.
40
+ * Feature snapping is set via the [featureEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) property. It provides the ability to snap vertices of a graphic or feature that is currently being drawn or reshaped to that of an existing feature's vertex, edge, or end point. These existing features belong to layers within the [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/). See [featureSources](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureSources) for configuring sources or using the automatic sources provided by view options. The following two images demonstrate feature snapping in a 2D application. Similar to self snapping, the same premise applies for 3D as well.
31
41
  *
32
42
  * <video src="https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/sketch/snapping-feature-2d.webm" aria-label="feature-snapping-create" autoplay muted playsinline loop></video>
33
43
  *
@@ -57,6 +67,7 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
57
67
  * @see [Sketch](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/)
58
68
  * @see [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/)
59
69
  * @see [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/)
70
+ * @see [Sample - View options for snapping, tooltips and units](https://developers.arcgis.com/javascript/latest/sample-code/view-options/)
60
71
  * @see [Sample - Sketch widget](https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/)
61
72
  * @see [Sample - Sketch in 3D](https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/)
62
73
  * @see [Sample - Edit features in 3D with the Editor widget](https://developers.arcgis.com/javascript/latest/sample-code/editor-3d/)
@@ -70,7 +81,7 @@ export interface SnappingOptionsProperties extends Partial<Pick<SnappingOptions,
70
81
  * layer: graphicsLayer,
71
82
  * view: view,
72
83
  * snappingOptions: { // autocasts to SnappingOptions()
73
- * enabled: true, // global snapping is turned on
84
+ * enabled: true, // snapping is turned on
74
85
  * // assigns a collection of FeatureSnappingLayerSource() and enables feature snapping on this layer
75
86
  * featureSources: [{ layer: graphicsLayer, enabled: true }]
76
87
  * }
@@ -96,22 +107,29 @@ export default class SnappingOptions extends SnappingOptionsSuperclass {
96
107
  */
97
108
  accessor distance: number;
98
109
  /**
99
- * Global configuration to turn snapping on or off. Note that snapping is
100
- * turned off by default.
110
+ * Indicates whether snapping is enabled.
111
+ *
112
+ * The default is `false` for a new SnappingOptions instance. Snapping configured through
113
+ * [ViewOptions.snapping](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#snapping) is disabled by default in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)
114
+ * and enabled by default in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
101
115
  *
102
116
  * @default false
103
117
  * @since 5.2
104
118
  */
105
119
  accessor enabled: boolean;
106
120
  /**
107
- * Global configuration option to turn feature snapping on or off.
121
+ * Indicates whether feature snapping is enabled.
108
122
  *
109
123
  * @default true
110
124
  * @since 5.2
111
125
  */
112
126
  accessor featureEnabled: boolean;
113
127
  /**
114
- * List of sources for feature snapping. Please refer to [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) for additional information on what layer sources are supported.
128
+ * List of sources for feature snapping. See [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) for supported layer sources.
129
+ *
130
+ * When used through [ViewOptions.snapping](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#snapping), supported layers in the view's map are
131
+ * used automatically if this property has not been explicitly configured. Explicitly configuring this property
132
+ * replaces the automatic source list.
115
133
  *
116
134
  * @since 5.2
117
135
  */
@@ -148,8 +166,7 @@ export default class SnappingOptions extends SnappingOptionsSuperclass {
148
166
  */
149
167
  accessor gridEnabled: boolean;
150
168
  /**
151
- * Global configuration option to turn self snapping (within one feature while
152
- * either drawing or reshaping) on or off.
169
+ * Indicates whether self snapping is enabled within one feature while drawing or reshaping.
153
170
  *
154
171
  * @default true
155
172
  * @since 5.2
@@ -22,7 +22,14 @@ export interface TooltipOptionsProperties extends Partial<Pick<TooltipOptions, "
22
22
  }
23
23
 
24
24
  /**
25
- * The `TooltipOptions` class allows users to configure the tooltips which are shown while sketching, editing or placing analyses.
25
+ * Configures tooltips shown while drawing, editing, or placing analyses.
26
+ *
27
+ * Use [view.options.tooltips](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#tooltips) to share tooltip options across supported
28
+ * components, view models, and analyses. See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for supported tools and opt-in requirements.
29
+ *
30
+ * Tooltips can also be configured on the [Sketch](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-sketch/)
31
+ * and [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/) components or their view models,
32
+ * [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/) and [EditorViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/).
26
33
  *
27
34
  * To enter the tooltip UI's [input mode](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/TooltipOptions/#inputEnabled),
28
35
  * press the `Tab` key while drawing a new feature, or when editing a point, mesh, or a selected vertex.
@@ -86,6 +93,7 @@ export interface TooltipOptionsProperties extends Partial<Pick<TooltipOptions, "
86
93
  * @since 5.2
87
94
  * @see [LabelOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/LabelOptions/)
88
95
  * @see [ValueOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ValueOptions/)
96
+ * @see [Sample - View options for snapping, tooltips and units](https://developers.arcgis.com/javascript/latest/sample-code/view-options/)
89
97
  * @see [Sample - Sketch in 3D](https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/)
90
98
  * @see [Sample - Edit features in 3D with the Editor widget](https://developers.arcgis.com/javascript/latest/sample-code/editor-3d/)
91
99
  */
@@ -20,8 +20,15 @@ export interface ValueOptionsProperties extends Partial<Pick<ValueOptions, "dire
20
20
  }
21
21
 
22
22
  /**
23
- * The `ValueOptions` class allows users to configure how numerical values and
24
- * constraints behave while sketching, editing or placing analyses.
23
+ * Configures numerical values and constraints for Sketch and Editor and their view models only.
24
+ *
25
+ * Set these options through the [Sketch component's valueOptions](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-sketch/#valueOptions),
26
+ * [Sketch.valueOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/#valueOptions), [Editor.valueOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/#valueOptions),
27
+ * [SketchViewModel.valueOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/#valueOptions), or [EditorViewModel.valueOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/#valueOptions).
28
+ *
29
+ * To configure `displayUnits` and `inputUnits` on the view for supported components, view models, and analyses, use
30
+ * [ViewOptions.displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits) and
31
+ * [ViewOptions.inputUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#inputUnits) instead.
25
32
  *
26
33
  * @since 5.2
27
34
  * @see [LabelOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/LabelOptions/)
@@ -16,6 +16,10 @@ export interface ViewOptionsProperties {
16
16
  /**
17
17
  * Units for displaying measurements, such as lengths, areas, and volumes.
18
18
  *
19
+ * Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
20
+ * A display unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
21
+ * without changing the view's options or the units used by other components, view models, or analyses.
22
+ *
19
23
  * @since 5.2
20
24
  */
21
25
  displayUnits?: UnitsProperties;
@@ -23,6 +27,10 @@ export interface ViewOptionsProperties {
23
27
  * Units for interpreting numeric values entered by the user.
24
28
  *
25
29
  * Input units may differ from [displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits).
30
+ * Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
31
+ * An input unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
32
+ * without changing the view's options or the units used by other components, view models, or analyses.
33
+ * These options control numeric input in the UI, not the spatial reference or stored coordinates of a geometry.
26
34
  *
27
35
  * @since 5.2
28
36
  */
@@ -39,7 +47,7 @@ export interface ViewOptionsProperties {
39
47
  * >
40
48
  * > These options currently do not apply to [AreaMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/) or
41
49
  * > [DistanceMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/), including their measurement components.
42
- * > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit settings configured through
50
+ * > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit options configured through
43
51
  * > `view.options` still apply. Support for `view.options.snapping` in these analyses and components is planned for a future release.
44
52
  *
45
53
  * @since 5.2
@@ -48,7 +56,15 @@ export interface ViewOptionsProperties {
48
56
  /**
49
57
  * Options for tooltips shown while sketching, editing, or placing analyses.
50
58
  *
51
- * Tooltips are disabled by default.
59
+ * Tooltips are disabled by default in both [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
60
+ *
61
+ * > [!WARNING]
62
+ * >
63
+ * > **Known Limitations**
64
+ * >
65
+ * > The [Volume Measurement](https://developers.arcgis.com/javascript/latest/references/core/analysis/VolumeMeasurementAnalysis/) cut-fill elevation tooltip remains enabled
66
+ * > independently of these options. Its display and input units can still inherit
67
+ * > [ViewOptions.displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits) and [ViewOptions.inputUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#inputUnits).
52
68
  *
53
69
  * @since 5.2
54
70
  */
@@ -56,15 +72,59 @@ export interface ViewOptionsProperties {
56
72
  }
57
73
 
58
74
  /**
59
- * Stores snapping, tooltip, and measurement unit options for supported components and analyses configured to inherit these options from the view.
60
- * Configure these options through [View.options](https://developers.arcgis.com/javascript/latest/references/core/views/View/#options).
75
+ * Configures snapping, tooltips, display units, and input units for supported components, view models, and analyses through [View.options](https://developers.arcgis.com/javascript/latest/references/core/views/View/#options).
76
+ *
77
+ * Unlike inherited snapping and tooltip options, display and input units can be overridden individually through
78
+ * unit properties exposed by a component, view model, or analysis.
79
+ * For example, setting [DistanceMeasurementAnalysis.unit](https://developers.arcgis.com/javascript/latest/references/core/analysis/DistanceMeasurementAnalysis/#unit) to `feet` overrides
80
+ * [view.options.displayUnits.length](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/support/Units/#length) for that analysis without changing the view's configuration or other analyses.
81
+ * Setting the analysis unit back to `null` restores the unit configured through `view.options.displayUnits.length`.
61
82
  *
62
83
  * > [!IMPORTANT]
63
84
  * >
64
85
  * > These options are not saved in a [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/).
65
86
  *
87
+ * The following table shows which components, view models, and analyses inherit each option from `view.options`.
88
+ *
89
+ * - **✓**: The option is inherited, with explicit component, view model, or analysis **units** taking precedence as described above.
90
+ * - `Opt-in`: The option is inherited only when the component's or view model's `useViewOptions` property is `true`.
91
+ * - ✗: The capability exists but does not inherit the option from the view. See the corresponding footnote.
92
+ * - `N/A`: The capability is unavailable for that component or analysis (for example, Area Measurement 3D does not support tooltips at all).
93
+ *
94
+ * | Component or analysis | Inherits `view.options.snapping` | Inherits `view.options.tooltips` | Inherits `view.options.displayUnits` | Inherits `view.options.inputUnits` |
95
+ * | --- | :---: | :---: | :---: | :---: |
96
+ * | Area Measurement 2D | ✗¹ | **✓** | **✓** | **✓** |
97
+ * | Area Measurement 3D | **✓** | N/A | **✓** | N/A |
98
+ * | Distance Measurement 2D | ✗¹ | **✓** | **✓** | **✓** |
99
+ * | Direct Line Measurement 3D | **✓** | N/A | **✓** | N/A |
100
+ * | Elevation Profile | **✓** | N/A | **✓** | N/A |
101
+ * | Line of Sight | **✓** | **✓** | **✓** | **✓** |
102
+ * | Viewshed | **✓** | **✓** | **✓** | **✓** |
103
+ * | Length Dimension | **✓** | N/A | **✓** | N/A |
104
+ * | Volume Measurement | **✓** | ✗² | **✓** | **✓** |
105
+ * | Sketch | Opt-in³ | Opt-in³ | Opt-in³ | Opt-in³ |
106
+ * | Editor | Opt-in³ | Opt-in³ | Opt-in³ | Opt-in³ |
107
+ *
108
+ * 1. For 2D measurements, configure snapping through the component's own `snappingOptions`,
109
+ * [AreaMeasurementAnalysisView2D.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/#snappingOptions), or
110
+ * [DistanceMeasurementAnalysisView2D.snappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/#snappingOptions).
111
+ * Support for `view.options.snapping` is planned for a future release.
112
+ * 2. The Volume Measurement cut-fill elevation tooltip remains enabled independently of
113
+ * `view.options.tooltips`.
114
+ * 3. For Sketch and Editor, including [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/) and [EditorViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/EditorViewModel/),
115
+ * set the component's or view model's `useViewOptions` property to `true` (default: `false`) to use options on the view.
116
+ * Changes to this property apply to the next create or update operation, not an operation already in progress.
117
+ *
118
+ * When this property is `true`:
119
+ *
120
+ * - Snapping and tooltip options specified on the component or view model are preserved but ignored.
121
+ * - The corresponding controls in the component's Settings menu are hidden.
122
+ * - Where unit properties are exposed, explicit units override those configured through `view.options` per measurement type.
123
+ * - Set an explicit unit to `null` or `undefined` to use the unit from `view.options` for that measurement type again.
124
+ *
66
125
  * @beta
67
126
  * @since 5.2
127
+ * @see [Sample - View options for snapping, tooltips and units](https://developers.arcgis.com/javascript/latest/sample-code/view-options/)
68
128
  */
69
129
  export default class ViewOptions extends Accessor {
70
130
  /** @since 5.2 */
@@ -72,6 +132,10 @@ export default class ViewOptions extends Accessor {
72
132
  /**
73
133
  * Units for displaying measurements, such as lengths, areas, and volumes.
74
134
  *
135
+ * Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
136
+ * A display unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
137
+ * without changing the view's options or the units used by other components, view models, or analyses.
138
+ *
75
139
  * @since 5.2
76
140
  */
77
141
  get displayUnits(): Units;
@@ -80,6 +144,10 @@ export default class ViewOptions extends Accessor {
80
144
  * Units for interpreting numeric values entered by the user.
81
145
  *
82
146
  * Input units may differ from [displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits).
147
+ * Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis.
148
+ * An input unit set directly on a component, view model, or analysis overrides the corresponding unit on the view,
149
+ * without changing the view's options or the units used by other components, view models, or analyses.
150
+ * These options control numeric input in the UI, not the spatial reference or stored coordinates of a geometry.
83
151
  *
84
152
  * @since 5.2
85
153
  */
@@ -97,7 +165,7 @@ export default class ViewOptions extends Accessor {
97
165
  * >
98
166
  * > These options currently do not apply to [AreaMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/AreaMeasurementAnalysisView2D/) or
99
167
  * > [DistanceMeasurementAnalysisView2D](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/DistanceMeasurementAnalysisView2D/), including their measurement components.
100
- * > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit settings configured through
168
+ * > Configure `snappingOptions` on the analysis view or component instead. Tooltip and unit options configured through
101
169
  * > `view.options` still apply. Support for `view.options.snapping` in these analyses and components is planned for a future release.
102
170
  *
103
171
  * @since 5.2
@@ -107,7 +175,15 @@ export default class ViewOptions extends Accessor {
107
175
  /**
108
176
  * Options for tooltips shown while sketching, editing, or placing analyses.
109
177
  *
110
- * Tooltips are disabled by default.
178
+ * Tooltips are disabled by default in both [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
179
+ *
180
+ * > [!WARNING]
181
+ * >
182
+ * > **Known Limitations**
183
+ * >
184
+ * > The [Volume Measurement](https://developers.arcgis.com/javascript/latest/references/core/analysis/VolumeMeasurementAnalysis/) cut-fill elevation tooltip remains enabled
185
+ * > independently of these options. Its display and input units can still inherit
186
+ * > [ViewOptions.displayUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#displayUnits) and [ViewOptions.inputUnits](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/#inputUnits).
111
187
  *
112
188
  * @since 5.2
113
189
  */
@@ -10,6 +10,7 @@ export interface UnitsProperties extends Partial<Pick<Units, "area" | "length" |
10
10
  * Each quantity accepts a specific unit or measurement system (`"metric"` or `"imperial"`).
11
11
  *
12
12
  * @since 5.2
13
+ * @see [Sample - View options for snapping, tooltips and units](https://developers.arcgis.com/javascript/latest/sample-code/view-options/)
13
14
  */
14
15
  export default class Units extends Accessor {
15
16
  /** @since 5.2 */
@@ -11,7 +11,7 @@ import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
11
11
  import type { LocalBasemapsSourceProperties } from "./support/LocalBasemapsSource.js";
12
12
  import type { PortalBasemapsSourceProperties } from "./support/PortalBasemapsSource.js";
13
13
 
14
- /** @deprecated since version 5.2. Use [BasemapCollectionProperties](https://developers.arcgis.com/javascript/latest/references/core/basemaps/BasemapCollection/#BasemapCollectionProperties) instead. */
14
+ /** @deprecated since version 5.2. Use [BasemapGalleryModelProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/BasemapGalleryModel/#BasemapGalleryModelProperties) instead. */
15
15
  export interface BasemapGalleryViewModelProperties extends LoadableMixinProperties, Partial<Pick<BasemapGalleryViewModel, "view">> {
16
16
  /** The map's [Map.basemap](https://developers.arcgis.com/javascript/latest/references/core/Map/#basemap). */
17
17
  activeBasemap?: BasemapProperties | string | null;
@@ -31,7 +31,7 @@ export type BasemapGalleryViewModelState = "disabled" | "loading" | "ready" | "u
31
31
  /**
32
32
  * Provides the logic for the [BasemapGallery widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-gallery/).
33
33
  *
34
- * @deprecated since version 5.2. Use [BasemapCollection](https://developers.arcgis.com/javascript/latest/references/core/basemaps/BasemapCollection/) instead.
34
+ * @deprecated since version 5.2. Use [BasemapGalleryModel](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/BasemapGalleryModel/) instead.
35
35
  * @since 4.3
36
36
  * @see [BasemapGallery widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) - _Deprecated since 4.32. Use the [Basemap Gallery component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-gallery/) instead._
37
37
  * @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecatedModule as n}from"../../core/deprecate.js";import{Loadable as r,isLoadable as i}from"../../core/Loadable.js";import a from"../../core/Logger.js";import{watch as o,on as s,when as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as d,isLoaded as f,load as p}from"../../geometry/projectionUtils.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";import{basemapEnsureType as g}from"../../support/basemapEnsureType.js";import{contentEquals as _}from"../../support/basemapUtils.js";import{default3DCompatibility as v,default2DCompatibility as y}from"./support/basemapCompatibilityUtils.js";import b from"./support/BasemapGalleryItem.js";import x from"./support/LocalBasemapsSource.js";import S from"./support/PortalBasemapsSource.js";const C=t.ofType(b);function w(e){return e&&e.declaredClass===`esri.portal.Portal`}function T(e){return e&&!(e instanceof S)&&(!!e.portal||!!e.query)}function E(e){return e&&`basemaps`in e&&`state`in e&&`refresh`in e}let D=class extends r{constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new C,this.view=null,e?.suppressDeprecationWarning||n(a.getLogger(this),`esri.widgets.BasemapGallery.BasemapGalleryViewModel`,{version:`5.2`,replacement:`Use the @arcgis/core/basemaps/BasemapCollection class instead.`,warnOnce:!0}),this.source=new S}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){let e=()=>this._recreateItems();this.addHandles([o(()=>this.state===`ready`?this.compatibilityFunction:null,()=>this._updateItems()),s(()=>this.source?.basemaps,`change`,e,{onListenerAdd:e}),c(()=>this.view,()=>{this.source instanceof S&&(this.source.viewType=this.view?.type)},{once:!0})])}destroy(){let e=this.source.basemaps.find(e=>e===this.activeBasemap);e&&this.source.basemaps.remove(e),this.source?.destroy()}get activeBasemap(){return this.view?.map?.basemap??null}set activeBasemap(e){let t=this.view;if(!t?.map)return;if(e=g(e),!e||!t.ready){t.map.basemap=e,this._clearOverride(`activeBasemap`);return}let n=e.spatialReference||this.items?.find(t=>this.basemapEquals(e,t.basemap))?.spatialReference;if(n&&`spatialReferenceLocked`in t&&!t.spatialReferenceLocked){let r=t.spatialReference;if(n!=null&&!m(r,n)&&!d(t.spatialReference,n)&&!f()){this._override(`activeBasemap`,e),this._loadingProjectionEngine=!0,p().then(()=>{this._get(`activeBasemap`)===e&&(t.map.basemap=e,t.spatialReference=n,this._clearOverride(`activeBasemap`))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});return}t.map.basemap=e,this._clearOverride(`activeBasemap`),n!=null&&!m(t.spatialReference,n)&&(t.spatialReference=n)}else t.map.basemap=e,this._clearOverride(`activeBasemap`)}get activeBasemapIndex(){let{state:e,activeBasemap:t}=this;return e===`ready`?this._findBasemapIndex(t):-1}get compatibilityFunction(){return this.view?.type===`3d`?v:y}set compatibilityFunction(e){this._overrideIfSome(`compatibilityFunction`,e)}get source(){return this._get(`source`)}set source(e){(Array.isArray(e)||t.isCollection(e))&&(e=new x({basemaps:Array.isArray(e)?new t(e):e})),w(e)&&(e=new S({portal:e})),T(e)&&(e=new S(e)),E(e)||(e=null),this._set(`source`,e)}get state(){return!this.view?.ready||!this.source?`disabled`:h(this.view)&&!this.view.inGeographicLayout?`unsupported`:this._loadingProjectionEngine?`loading`:`ready`}basemapEquals(e,t){return _(e,t)}refresh(){this._recreateItems()}load(){return this.loadSource()}loadSource(e){return this.addResolvingPromise(i(this.source)?this.source.load(e):null),Promise.resolve(this)}_findBasemapIndex(e){let{items:t}=this,n=t.findIndex(t=>t.basemap===e);return n===-1?t.findIndex(t=>this.basemapEquals(t.basemap,e)):n}_recreateItems(){let e=this.source?.basemaps??[],{view:t,compatibilityFunction:n}=this,r=new Map(this.items.map(e=>[e.basemap,e])),i=e.map(e=>{let i=r.get(e);return i?(r.delete(e),i):new b({basemap:e,compatibilityFunction:n,view:t})});this.items.removeAll(),this.items.addMany(i),r.forEach(e=>e.destroy())}_updateItems(){for(let e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};e([l()],D.prototype,`_loadingProjectionEngine`,void 0),e([l()],D.prototype,`activeBasemap`,null),e([l({readOnly:!0})],D.prototype,`activeBasemapIndex`,null),e([l()],D.prototype,`compatibilityFunction`,null),e([l({readOnly:!0,type:C})],D.prototype,`items`,void 0),e([l()],D.prototype,`source`,null),e([l({readOnly:!0})],D.prototype,`state`,null),e([l()],D.prototype,`view`,void 0),D=e([u(`esri.widgets.BasemapGallery.BasemapGalleryViewModel`)],D);const O=D;export{O as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecatedModule as n}from"../../core/deprecate.js";import{Loadable as r,isLoadable as i}from"../../core/Loadable.js";import a from"../../core/Logger.js";import{watch as o,on as s,when as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as d,isLoaded as f,load as p}from"../../geometry/projectionUtils.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";import{basemapEnsureType as g}from"../../support/basemapEnsureType.js";import{contentEquals as _}from"../../support/basemapUtils.js";import{default3DCompatibility as v,default2DCompatibility as y}from"./support/basemapCompatibilityUtils.js";import b from"./support/BasemapGalleryItem.js";import x from"./support/LocalBasemapsSource.js";import S from"./support/PortalBasemapsSource.js";const C=t.ofType(b);function w(e){return e&&e.declaredClass===`esri.portal.Portal`}function T(e){return e&&!(e instanceof S)&&(!!e.portal||!!e.query)}function E(e){return e&&`basemaps`in e&&`state`in e&&`refresh`in e}let D=class extends r{constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new C,this.view=null,e?.suppressDeprecationWarning||n(a.getLogger(this),`esri.widgets.BasemapGallery.BasemapGalleryViewModel`,{version:`5.2`,replacement:`Use the @arcgis/core/basemapGallery/BasemapGalleryModel class instead.`,warnOnce:!0}),this.source=new S}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){let e=()=>this._recreateItems();this.addHandles([o(()=>this.state===`ready`?this.compatibilityFunction:null,()=>this._updateItems()),s(()=>this.source?.basemaps,`change`,e,{onListenerAdd:e}),c(()=>this.view,()=>{this.source instanceof S&&(this.source.viewType=this.view?.type)},{once:!0})])}destroy(){let e=this.source.basemaps.find(e=>e===this.activeBasemap);e&&this.source.basemaps.remove(e),this.source?.destroy()}get activeBasemap(){return this.view?.map?.basemap??null}set activeBasemap(e){let t=this.view;if(!t?.map)return;if(e=g(e),!e||!t.ready){t.map.basemap=e,this._clearOverride(`activeBasemap`);return}let n=e.spatialReference||this.items?.find(t=>this.basemapEquals(e,t.basemap))?.spatialReference;if(n&&`spatialReferenceLocked`in t&&!t.spatialReferenceLocked){let r=t.spatialReference;if(n!=null&&!m(r,n)&&!d(t.spatialReference,n)&&!f()){this._override(`activeBasemap`,e),this._loadingProjectionEngine=!0,p().then(()=>{this._get(`activeBasemap`)===e&&(t.map.basemap=e,t.spatialReference=n,this._clearOverride(`activeBasemap`))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});return}t.map.basemap=e,this._clearOverride(`activeBasemap`),n!=null&&!m(t.spatialReference,n)&&(t.spatialReference=n)}else t.map.basemap=e,this._clearOverride(`activeBasemap`)}get activeBasemapIndex(){let{state:e,activeBasemap:t}=this;return e===`ready`?this._findBasemapIndex(t):-1}get compatibilityFunction(){return this.view?.type===`3d`?v:y}set compatibilityFunction(e){this._overrideIfSome(`compatibilityFunction`,e)}get source(){return this._get(`source`)}set source(e){(Array.isArray(e)||t.isCollection(e))&&(e=new x({basemaps:Array.isArray(e)?new t(e):e})),w(e)&&(e=new S({portal:e})),T(e)&&(e=new S(e)),E(e)||(e=null),this._set(`source`,e)}get state(){return!this.view?.ready||!this.source?`disabled`:h(this.view)&&!this.view.inGeographicLayout?`unsupported`:this._loadingProjectionEngine?`loading`:`ready`}basemapEquals(e,t){return _(e,t)}refresh(){this._recreateItems()}load(){return this.loadSource()}loadSource(e){return this.addResolvingPromise(i(this.source)?this.source.load(e):null),Promise.resolve(this)}_findBasemapIndex(e){let{items:t}=this,n=t.findIndex(t=>t.basemap===e);return n===-1?t.findIndex(t=>this.basemapEquals(t.basemap,e)):n}_recreateItems(){let e=this.source?.basemaps??[],{view:t,compatibilityFunction:n}=this,r=new Map(this.items.map(e=>[e.basemap,e])),i=e.map(e=>{let i=r.get(e);return i?(r.delete(e),i):new b({basemap:e,compatibilityFunction:n,view:t})});this.items.removeAll(),this.items.addMany(i),r.forEach(e=>e.destroy())}_updateItems(){for(let e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};e([l()],D.prototype,`_loadingProjectionEngine`,void 0),e([l()],D.prototype,`activeBasemap`,null),e([l({readOnly:!0})],D.prototype,`activeBasemapIndex`,null),e([l()],D.prototype,`compatibilityFunction`,null),e([l({readOnly:!0,type:C})],D.prototype,`items`,void 0),e([l()],D.prototype,`source`,null),e([l({readOnly:!0})],D.prototype,`state`,null),e([l()],D.prototype,`view`,void 0),D=e([u(`esri.widgets.BasemapGallery.BasemapGalleryViewModel`)],D);const O=D;export{O as default};
@@ -4,17 +4,17 @@ import type EsriError from "../../../core/Error.js";
4
4
  import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../../core/Identifiable.js";
5
5
  import type { MapViewOrSceneView } from "../../../views/MapViewOrSceneView.js";
6
6
 
7
- /** @deprecated since version 5.2. Use [BasemapItemProperties](https://developers.arcgis.com/javascript/latest/references/core/basemaps/support/BasemapItem/#BasemapItemProperties) instead. */
7
+ /** @deprecated since version 5.2. Use [BasemapItemProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/support/BasemapItem/#BasemapItemProperties) instead. */
8
8
  export interface BasemapGalleryItemProperties extends IdentifiableMixinProperties, Partial<Pick<BasemapGalleryItem, "basemap" | "view">> {}
9
9
 
10
- /** @deprecated since version 5.2. Use [BasemapItemState](https://developers.arcgis.com/javascript/latest/references/core/basemaps/support/BasemapItem/#BasemapItemState) instead. */
10
+ /** @deprecated since version 5.2. Use [BasemapItemState](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/support/BasemapItem/#BasemapItemState) instead. */
11
11
  export type BasemapGalleryItemState = "ready" | "loading" | "error";
12
12
 
13
13
  /**
14
14
  * The BasemapGalleryItem class represents one of the [BasemapGalleryViewModel.items](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#items)
15
15
  * in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/).
16
16
  *
17
- * @deprecated since version 5.2. Use [BasemapItem](https://developers.arcgis.com/javascript/latest/references/core/basemaps/support/BasemapItem/) instead.
17
+ * @deprecated since version 5.2. Use [BasemapItem](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/support/BasemapItem/) instead.
18
18
  * @since 4.3
19
19
  * @see [BasemapGalleryViewModel.items](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#items)
20
20
  */
@@ -5,7 +5,7 @@ import type { BasemapsSourceState } from "../types.js";
5
5
  import type { BasemapProperties } from "../../../Basemap.js";
6
6
  import type { ReadonlyArrayOrCollection } from "../../../core/Collection.js";
7
7
 
8
- /** @deprecated since version 5.2. Use [LocalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/basemaps/LocalBasemapsSource/#LocalBasemapsSourceProperties) instead. */
8
+ /** @deprecated since version 5.2. Use [LocalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/LocalBasemapsSource/#LocalBasemapsSourceProperties) instead. */
9
9
  export interface LocalBasemapsSourceProperties {
10
10
  /** A collection of [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/)s. */
11
11
  basemaps?: ReadonlyArrayOrCollection<BasemapProperties>;
@@ -15,7 +15,7 @@ export interface LocalBasemapsSourceProperties {
15
15
  * The LocalBasemapsSource class is a Collection-driven [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/) [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
16
16
  * in the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/) or [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) widget.
17
17
  *
18
- * @deprecated since version 5.2. Use [LocalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemaps/LocalBasemapsSource/) instead.
18
+ * @deprecated since version 5.2. Use [LocalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/LocalBasemapsSource/) instead.
19
19
  * @since 4.3
20
20
  * @see [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
21
21
  * @see [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/)
@@ -8,7 +8,7 @@ import type { BasemapFilter, BasemapsSourceState, UpdateBasemapsCallback } from
8
8
  import type { LocalBasemapsSourceProperties } from "./LocalBasemapsSource.js";
9
9
  import type { PortalProperties } from "../../../portal/Portal.js";
10
10
 
11
- /** @deprecated since version 5.2. Use [PortalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/basemaps/PortalBasemapsSource/#PortalBasemapsSourceProperties) instead. */
11
+ /** @deprecated since version 5.2. Use [PortalBasemapsSourceProperties](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/#PortalBasemapsSourceProperties) instead. */
12
12
  export interface PortalBasemapsSourceProperties extends LocalBasemapsSourceProperties, LoadableMixinProperties, Partial<Pick<PortalBasemapsSource, "filterFunction" | "query" | "updateBasemapsCallback">> {
13
13
  /** The Portal from which to fetch basemaps. */
14
14
  portal?: PortalProperties;
@@ -18,7 +18,7 @@ export interface PortalBasemapsSourceProperties extends LocalBasemapsSourcePrope
18
18
  * The PortalBasemapsSource class is a Portal-driven [Basemap](https://developers.arcgis.com/javascript/latest/references/core/Basemap/) [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
19
19
  * in the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/) or [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/) widget.
20
20
  *
21
- * @deprecated since version 5.2. Use [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemaps/PortalBasemapsSource/) instead.
21
+ * @deprecated since version 5.2. Use [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/PortalBasemapsSource/) instead.
22
22
  * @since 4.3
23
23
  * @see [BasemapGalleryViewModel.source](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/BasemapGalleryViewModel/#source)
24
24
  * @see [BasemapGallery](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapGallery/)
@@ -10,7 +10,7 @@ import type Basemap from "../../Basemap.js";
10
10
  * @param index - The index of the Basemap being assessed.
11
11
  * @param array - The array of basemaps being filtered.
12
12
  * @returns Returns true if the test passes, false otherwise.
13
- * @deprecated since version 5.2. Use [BasemapFilter](https://developers.arcgis.com/javascript/latest/references/core/basemaps/types/#BasemapFilter) instead.
13
+ * @deprecated since version 5.2. Use [BasemapFilter](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/types/#BasemapFilter) instead.
14
14
  * @since 5.0
15
15
  */
16
16
  export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) => boolean | Promise<boolean>;
@@ -23,7 +23,7 @@ export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) =>
23
23
  *
24
24
  * @param items - An array of basemaps that have been fetched and filtered from the Portal.
25
25
  * @returns The array of basemaps to display in the BasemapGallery widget.
26
- * @deprecated since version 5.2. Use [UpdateBasemapsCallback](https://developers.arcgis.com/javascript/latest/references/core/basemaps/types/#UpdateBasemapsCallback) instead.
26
+ * @deprecated since version 5.2. Use [UpdateBasemapsCallback](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/types/#UpdateBasemapsCallback) instead.
27
27
  * @since 5.0
28
28
  * @example
29
29
  * // Create custom basemap to be added to the array of portal basemaps
@@ -71,7 +71,7 @@ export type BasemapFilter = (item: Basemap, index: number, array: Basemap[]) =>
71
71
  export type UpdateBasemapsCallback = (items: Basemap[]) => Basemap[] | Promise<Basemap[]>;
72
72
 
73
73
  /**
74
- * @deprecated since version 5.2. Use [BasemapsSourceState](https://developers.arcgis.com/javascript/latest/references/core/basemaps/types/#BasemapsSourceState) instead.
74
+ * @deprecated since version 5.2. Use [BasemapsSourceState](https://developers.arcgis.com/javascript/latest/references/core/basemapGallery/types/#BasemapsSourceState) instead.
75
75
  * @since 5.0
76
76
  */
77
77
  export type BasemapsSourceState = "ready" | "loading" | "not-loaded";