@arcgis/map-components 5.2.0-next.120 → 5.2.0-next.121

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 (189) hide show
  1. package/dist/cdn/{YZUEPMQZ.js → 24SNB22W.js} +1 -1
  2. package/dist/cdn/33C5FBRZ.js +2 -0
  3. package/dist/cdn/{POEFPML6.js → 55AZTWOF.js} +1 -1
  4. package/dist/cdn/{2DDAZ3QO.js → 56PUZWIU.js} +1 -1
  5. package/dist/cdn/{23KFFLAG.js → 5E2DZJWK.js} +1 -1
  6. package/dist/cdn/{U35IJFNU.js → 6VR7MKOM.js} +1 -1
  7. package/dist/cdn/6XJFRQ75.js +2 -0
  8. package/dist/cdn/{UJVNCEXT.js → 7KWX2CED.js} +1 -1
  9. package/dist/cdn/7WBDTHNZ.js +2 -0
  10. package/dist/cdn/{RRC7AD75.js → ALEBI75Z.js} +1 -1
  11. package/dist/cdn/BAV6JF4F.js +2 -0
  12. package/dist/cdn/{HNMWTX7W.js → BEZWJEYM.js} +1 -1
  13. package/dist/cdn/{KKDZFKGV.js → BFVEHL3M.js} +1 -1
  14. package/dist/cdn/{LCNYVSCF.js → BTQUD5J4.js} +1 -1
  15. package/dist/cdn/DAPKG4DY.js +2 -0
  16. package/dist/cdn/DOR5MVML.js +2 -0
  17. package/dist/cdn/{GN4BH6SY.js → EMJLCAFX.js} +1 -1
  18. package/dist/cdn/{F5EC22X4.js → ESISPXFF.js} +1 -1
  19. package/dist/cdn/{2L6YCWXJ.js → EUV2XFUO.js} +1 -1
  20. package/dist/cdn/{LBVSFCZG.js → FR7ARNMJ.js} +1 -1
  21. package/dist/cdn/GC4D3K6B.js +2 -0
  22. package/dist/cdn/{BFGF2JTH.js → GLOUXFQV.js} +1 -1
  23. package/dist/cdn/GYTTYWIC.js +2 -0
  24. package/dist/cdn/{W5O3OCTG.js → H5FV4C72.js} +1 -1
  25. package/dist/cdn/{JKZMOIRA.js → HGCKG3CA.js} +1 -1
  26. package/dist/cdn/{P2X5UYZB.js → I2IBXGQM.js} +1 -1
  27. package/dist/cdn/{CWQN57H6.js → IZ7UWAQP.js} +1 -1
  28. package/dist/cdn/{Z3JADSL3.js → J4TWDZII.js} +1 -1
  29. package/dist/cdn/{CST7D7GR.js → JGHPNDIO.js} +1 -1
  30. package/dist/cdn/{OMZESNEM.js → JOOXDIS7.js} +1 -1
  31. package/dist/cdn/{KGBACXRG.js → JRFQGFRL.js} +1 -1
  32. package/dist/cdn/{ZSQCIUGN.js → KIHX5LRN.js} +1 -1
  33. package/dist/cdn/{FAN45DMA.js → LM6RYRCS.js} +1 -1
  34. package/dist/cdn/{REDWVTQJ.js → LP2PF2VT.js} +1 -1
  35. package/dist/cdn/{4IB44LRA.js → LWW6FUI2.js} +1 -1
  36. package/dist/cdn/{LH33ZRF7.js → MFBQRTJ3.js} +1 -1
  37. package/dist/cdn/{5RBUI62E.js → MLJ5RYY3.js} +1 -1
  38. package/dist/cdn/{WWGWIJMC.js → NZSCPBS7.js} +1 -1
  39. package/dist/cdn/{PQTX5YLB.js → OKW62U6T.js} +1 -1
  40. package/dist/cdn/{3OQZ3SMG.js → OPLR5W7O.js} +1 -1
  41. package/dist/cdn/{JD46SR26.js → Q6LQ5BUX.js} +1 -1
  42. package/dist/cdn/{HGYJFGKA.js → QGFWUN5S.js} +1 -1
  43. package/dist/cdn/{X7KSMNND.js → QIEX43LK.js} +1 -1
  44. package/dist/cdn/{B6JX5OWP.js → QNHJY7QE.js} +1 -1
  45. package/dist/cdn/RVJTWRVG.js +2 -0
  46. package/dist/cdn/{2KN3VFRG.js → TH6TT77M.js} +1 -1
  47. package/dist/cdn/TIDNGXMD.js +2 -0
  48. package/dist/cdn/{6XZKWBWD.js → TVZZB4KV.js} +1 -1
  49. package/dist/cdn/{XO3NPMHQ.js → UA5FRNJG.js} +1 -1
  50. package/dist/cdn/{SEMVPT7E.js → UJUD6U2G.js} +1 -1
  51. package/dist/cdn/{MZZGKPLV.js → UXUG6DBJ.js} +1 -1
  52. package/dist/cdn/{TL7OKFLN.js → V7BQUMJL.js} +1 -1
  53. package/dist/cdn/{TNY5ERJS.js → VSJ3MYSY.js} +1 -1
  54. package/dist/cdn/{IR2RGKT4.js → WC2DVIUW.js} +1 -1
  55. package/dist/cdn/{Q6MJXAPZ.js → WNLOSRMS.js} +1 -1
  56. package/dist/cdn/{6SKPV2U5.js → XGZ36AOT.js} +1 -1
  57. package/dist/cdn/{NEQHSO5U.js → XP4IZ2KQ.js} +1 -1
  58. package/dist/cdn/{D3F6S7NU.js → XQKZNHH7.js} +1 -1
  59. package/dist/cdn/{3VGRIUOZ.js → Y3Y3AB5L.js} +1 -1
  60. package/dist/cdn/{CONE7FEI.js → YG4HDEP3.js} +1 -1
  61. package/dist/cdn/Z44GSKHZ.js +2 -0
  62. package/dist/cdn/{EZVWEV6T.js → ZSVZL6PT.js} +1 -1
  63. package/dist/cdn/assets/feature-form-next/t9n/messages.ar.json +1 -1
  64. package/dist/cdn/assets/feature-form-next/t9n/messages.bg.json +1 -1
  65. package/dist/cdn/assets/feature-form-next/t9n/messages.ca.json +1 -1
  66. package/dist/cdn/assets/feature-form-next/t9n/messages.cs.json +1 -1
  67. package/dist/cdn/assets/feature-form-next/t9n/messages.da.json +1 -1
  68. package/dist/cdn/assets/feature-form-next/t9n/messages.de.json +1 -1
  69. package/dist/cdn/assets/feature-form-next/t9n/messages.el.json +1 -1
  70. package/dist/cdn/assets/feature-form-next/t9n/messages.en.json +1 -1
  71. package/dist/cdn/assets/feature-form-next/t9n/messages.es.json +1 -1
  72. package/dist/cdn/assets/feature-form-next/t9n/messages.et.json +1 -1
  73. package/dist/cdn/assets/feature-form-next/t9n/messages.fi.json +1 -1
  74. package/dist/cdn/assets/feature-form-next/t9n/messages.fr.json +1 -1
  75. package/dist/cdn/assets/feature-form-next/t9n/messages.he.json +1 -1
  76. package/dist/cdn/assets/feature-form-next/t9n/messages.hr.json +1 -1
  77. package/dist/cdn/assets/feature-form-next/t9n/messages.hu.json +1 -1
  78. package/dist/cdn/assets/feature-form-next/t9n/messages.id.json +1 -1
  79. package/dist/cdn/assets/feature-form-next/t9n/messages.it.json +1 -1
  80. package/dist/cdn/assets/feature-form-next/t9n/messages.ja.json +1 -1
  81. package/dist/cdn/assets/feature-form-next/t9n/messages.ko.json +1 -1
  82. package/dist/cdn/assets/feature-form-next/t9n/messages.lt.json +1 -1
  83. package/dist/cdn/assets/feature-form-next/t9n/messages.lv.json +1 -1
  84. package/dist/cdn/assets/feature-form-next/t9n/messages.nl.json +1 -1
  85. package/dist/cdn/assets/feature-form-next/t9n/messages.no.json +1 -1
  86. package/dist/cdn/assets/feature-form-next/t9n/messages.pl.json +1 -1
  87. package/dist/cdn/assets/feature-form-next/t9n/messages.pt-BR.json +1 -1
  88. package/dist/cdn/assets/feature-form-next/t9n/messages.pt-PT.json +1 -1
  89. package/dist/cdn/assets/feature-form-next/t9n/messages.ro.json +1 -1
  90. package/dist/cdn/assets/feature-form-next/t9n/messages.ru.json +1 -1
  91. package/dist/cdn/assets/feature-form-next/t9n/messages.sk.json +1 -1
  92. package/dist/cdn/assets/feature-form-next/t9n/messages.sl.json +1 -1
  93. package/dist/cdn/assets/feature-form-next/t9n/messages.sr.json +1 -1
  94. package/dist/cdn/assets/feature-form-next/t9n/messages.sv.json +1 -1
  95. package/dist/cdn/assets/feature-form-next/t9n/messages.th.json +1 -1
  96. package/dist/cdn/assets/feature-form-next/t9n/messages.tr.json +1 -1
  97. package/dist/cdn/assets/feature-form-next/t9n/messages.uk.json +1 -1
  98. package/dist/cdn/assets/feature-form-next/t9n/messages.vi.json +1 -1
  99. package/dist/cdn/assets/feature-form-next/t9n/messages.zh-CN.json +1 -1
  100. package/dist/cdn/assets/feature-form-next/t9n/messages.zh-TW.json +1 -1
  101. package/dist/cdn/assets/sketch/t9n/messages.ar.json +1 -1
  102. package/dist/cdn/assets/sketch/t9n/messages.bg.json +1 -1
  103. package/dist/cdn/assets/sketch/t9n/messages.bs.json +1 -1
  104. package/dist/cdn/assets/sketch/t9n/messages.ca.json +1 -1
  105. package/dist/cdn/assets/sketch/t9n/messages.cs.json +1 -1
  106. package/dist/cdn/assets/sketch/t9n/messages.da.json +1 -1
  107. package/dist/cdn/assets/sketch/t9n/messages.de.json +1 -1
  108. package/dist/cdn/assets/sketch/t9n/messages.el.json +1 -1
  109. package/dist/cdn/assets/sketch/t9n/messages.es.json +1 -1
  110. package/dist/cdn/assets/sketch/t9n/messages.et.json +1 -1
  111. package/dist/cdn/assets/sketch/t9n/messages.fi.json +1 -1
  112. package/dist/cdn/assets/sketch/t9n/messages.fr.json +1 -1
  113. package/dist/cdn/assets/sketch/t9n/messages.he.json +1 -1
  114. package/dist/cdn/assets/sketch/t9n/messages.hr.json +1 -1
  115. package/dist/cdn/assets/sketch/t9n/messages.hu.json +1 -1
  116. package/dist/cdn/assets/sketch/t9n/messages.id.json +1 -1
  117. package/dist/cdn/assets/sketch/t9n/messages.it.json +1 -1
  118. package/dist/cdn/assets/sketch/t9n/messages.ja.json +1 -1
  119. package/dist/cdn/assets/sketch/t9n/messages.ko.json +1 -1
  120. package/dist/cdn/assets/sketch/t9n/messages.lt.json +1 -1
  121. package/dist/cdn/assets/sketch/t9n/messages.lv.json +1 -1
  122. package/dist/cdn/assets/sketch/t9n/messages.nl.json +1 -1
  123. package/dist/cdn/assets/sketch/t9n/messages.no.json +1 -1
  124. package/dist/cdn/assets/sketch/t9n/messages.pl.json +1 -1
  125. package/dist/cdn/assets/sketch/t9n/messages.pt-BR.json +1 -1
  126. package/dist/cdn/assets/sketch/t9n/messages.pt-PT.json +1 -1
  127. package/dist/cdn/assets/sketch/t9n/messages.ro.json +1 -1
  128. package/dist/cdn/assets/sketch/t9n/messages.ru.json +1 -1
  129. package/dist/cdn/assets/sketch/t9n/messages.sk.json +1 -1
  130. package/dist/cdn/assets/sketch/t9n/messages.sl.json +1 -1
  131. package/dist/cdn/assets/sketch/t9n/messages.sr.json +1 -1
  132. package/dist/cdn/assets/sketch/t9n/messages.sv.json +1 -1
  133. package/dist/cdn/assets/sketch/t9n/messages.th.json +1 -1
  134. package/dist/cdn/assets/sketch/t9n/messages.tr.json +1 -1
  135. package/dist/cdn/assets/sketch/t9n/messages.uk.json +1 -1
  136. package/dist/cdn/assets/sketch/t9n/messages.vi.json +1 -1
  137. package/dist/cdn/assets/sketch/t9n/messages.zh-CN.json +1 -1
  138. package/dist/cdn/assets/sketch/t9n/messages.zh-HK.json +1 -1
  139. package/dist/cdn/assets/sketch/t9n/messages.zh-TW.json +1 -1
  140. package/dist/cdn/index.js +1 -1
  141. package/dist/cdn/main.css +1 -1
  142. package/dist/chunks/async-utils.js +3 -3
  143. package/dist/components/arcgis-attachment-validation-view/customElement.d.ts +81 -0
  144. package/dist/components/arcgis-attachment-validation-view/customElement.js +109 -0
  145. package/dist/components/arcgis-attachment-validation-view/index.d.ts +1 -0
  146. package/dist/components/arcgis-attachment-validation-view/index.js +2 -0
  147. package/dist/components/arcgis-basemap-gallery/customElement.d.ts +10 -9
  148. package/dist/components/arcgis-basemap-gallery/customElement.js +39 -28
  149. package/dist/components/arcgis-basemap-gallery-item/customElement.js +30 -30
  150. package/dist/components/arcgis-editor/customElement.d.ts +10 -2
  151. package/dist/components/arcgis-editor/customElement.js +2 -2
  152. package/dist/components/arcgis-expand/customElement.js +27 -21
  153. package/dist/components/arcgis-exploratory-analysis/customElement.d.ts +23 -0
  154. package/dist/components/arcgis-exploratory-analysis/customElement.js +50 -50
  155. package/dist/components/arcgis-feature-attachments/customElement.js +17 -17
  156. package/dist/components/arcgis-feature-form-field/customElement.d.ts +48 -0
  157. package/dist/components/arcgis-legend/customElement.d.ts +5 -6
  158. package/dist/components/arcgis-legend/customElement.js +5 -5
  159. package/dist/components/arcgis-link-chart/customElement.js +5 -2
  160. package/dist/components/arcgis-map/customElement.js +9 -6
  161. package/dist/components/arcgis-presentation/customElement.js +62 -62
  162. package/dist/components/arcgis-presentation-slide-list/customElement.js +1 -1
  163. package/dist/components/arcgis-scene/customElement.js +9 -6
  164. package/dist/components/arcgis-sketch/SketchComponentViewModel.d.ts +84 -0
  165. package/dist/components/arcgis-sketch/configuration.d.ts +33 -0
  166. package/dist/components/arcgis-sketch/customElement.d.ts +3 -2
  167. package/dist/components/arcgis-sketch/customElement.js +25 -21
  168. package/dist/docs/api.json +1 -1
  169. package/dist/docs/docs.json +1 -1
  170. package/dist/docs/vscode.html-custom-data.json +1 -1
  171. package/dist/docs/web-types.json +1 -1
  172. package/dist/index.d.ts +4 -0
  173. package/dist/loader.js +2 -1
  174. package/dist/types/lumina.d.ts +6 -1
  175. package/dist/types/preact.d.ts +7 -1
  176. package/dist/types/react.d.ts +8 -1
  177. package/dist/types/stencil.d.ts +6 -1
  178. package/package.json +7 -7
  179. package/dist/cdn/2OGEVHBC.js +0 -2
  180. package/dist/cdn/5PNAHYUT.js +0 -2
  181. package/dist/cdn/7AKMHKTT.js +0 -2
  182. package/dist/cdn/DDSMWDPS.js +0 -2
  183. package/dist/cdn/DOHO6T7Z.js +0 -2
  184. package/dist/cdn/IDE4IFH7.js +0 -2
  185. package/dist/cdn/IJTCIWOA.js +0 -2
  186. package/dist/cdn/IXVJQIMH.js +0 -2
  187. package/dist/cdn/KWJAKUM4.js +0 -2
  188. package/dist/cdn/WU7R423Z.js +0 -2
  189. /package/dist/cdn/{5DV4N5DK.js → OYD6YL32.js} +0 -0
@@ -0,0 +1,84 @@
1
+ import type Accessor from "@arcgis/core/core/Accessor.js";
2
+ import type VisibleElements from "@arcgis/core/widgets/Sketch/VisibleElements.js";
3
+ import type SelectionToolbarViewModel from "@arcgis/core/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js";
4
+ import type Graphic from "@arcgis/core/Graphic.js";
5
+ import type SelectionOperation from "@arcgis/core/views/selection/SelectionOperation.js";
6
+ import type { EventedAccessor } from "@arcgis/core/core/Evented.js";
7
+ import type { default as SketchViewModel } from "@arcgis/core/widgets/Sketch/SketchViewModel.js";
8
+ import type { CreateOptions, CreateTool, CustomActionProperties, CustomToolOptions, SelectionTool, SketchTool } from "@arcgis/core/widgets/Sketch/types.js";
9
+ import type { PluginConfiguration } from "@arcgis/core/views/draw/support/types.js";
10
+ import type { SelectionToolOptions } from "@arcgis/core/widgets/support/SelectionToolbar/types.js";
11
+ import type { KnownActionGroup } from "./configuration.js";
12
+ import type { MapViewOrSceneView } from "@arcgis/core/views/MapViewOrSceneView.js";
13
+
14
+ export interface SketchComponentViewModelProperties extends Partial<Pick<SketchComponentViewModel, "availableCreateTools" | "selectionViewModel" | "settingsPopoverOpen" | "sketchViewModel" | "view" | "visibleElements">> {}
15
+
16
+ /**
17
+ * Internal ViewModel to support rendering and separation of concerns for the Sketch component.
18
+ * Traditionally this would be called `SketchViewModel`, but that has taken on a life of its own
19
+ * and needs to maintain a stable public API; it is unfortunately lower level than we'd like
20
+ * for optimal use in our UI.
21
+ *
22
+ * This component encompasses all transformations from the state of SketchViewModel and
23
+ * SelectionToolbarViewModel and VisibleElements to state that can be trivially rendered by the view layer.
24
+ */
25
+ export class SketchComponentViewModel extends Accessor {
26
+ constructor(properties?: SketchComponentViewModelProperties);
27
+ get _activeSelectionTool(): "lasso-selection" | "rectangle-selection" | undefined;
28
+ get activePluginIds(): Set<PluginConfiguration["uniqueId"]> | undefined;
29
+ get activeTool(): SelectionTool | SketchTool | undefined;
30
+ accessor availableCreateTools: CreateTool[] | undefined;
31
+ get groupedActions(): KnownActionGroup[];
32
+ accessor selectionViewModel: SelectionViewModelLike;
33
+ /** @default false */
34
+ accessor settingsPopoverOpen: boolean;
35
+ accessor sketchViewModel: SketchViewModelLike | undefined;
36
+ get state(): SketchViewModelLike["state"];
37
+ get test(): {
38
+ activeCustomToolOptions: CustomToolOptions | undefined;
39
+ activeSelectionTool: "lasso-selection" | "rectangle-selection" | undefined;
40
+ selectionViewModel: SelectionViewModelLike;
41
+ };
42
+ accessor view: ViewLike | undefined;
43
+ accessor visibleElements: VisibleElements;
44
+ /**
45
+ * Guards against taking certain actions while geometry simplification is in progress.
46
+ *
47
+ * @param command
48
+ */
49
+ _executeWhenReady(command: () => Promise<void> | void): Promise<void>;
50
+ /** Cancels all operations, restoring a neutral, ready state. */
51
+ cancelAll(): void;
52
+ /**
53
+ * Initiates interactive creation of a sketch/drawing using the provided tool and options.
54
+ *
55
+ * @param tool - Tool to use for the drawing
56
+ * @param createOptions - Optional configuration of the drawling experience.
57
+ */
58
+ create(tool: CreateTool, createOptions?: CreateOptions): Promise<void>;
59
+ destroy(): void;
60
+ initialize(): void;
61
+ /**
62
+ * @param createToolOptions
63
+ * @param customActionOptions
64
+ */
65
+ setCustomTools(createToolOptions?: CustomToolOptions[] | null, customActionOptions?: CustomActionProperties[] | null): void;
66
+ toggleSettingsPopover(): void;
67
+ /**
68
+ * @param graphic
69
+ * @param updateOptions
70
+ */
71
+ update(graphic: Graphic | Graphic[], updateOptions?: Parameters<SketchViewModelLike["update"]>[1]): Promise<void>;
72
+ }
73
+
74
+ export type ViewLike = Pick<MapViewOrSceneView, "focus" | "type">;
75
+
76
+ export type SketchViewModelLike = EventedAccessor
77
+ & Pick<SketchViewModel, "@eventTypes" | "activeCreateToolDrawMode" | "activePluginConfigurations" | "activeTool" | "cancel" | "canRedo" | "canUndo" | "complete" | "create" | "creationMode" | "delete" | "duplicate" | "effectiveAvailablePlugins" | "firstPluginWithSwappableLeaf" | "geometrySimplificationInProgress" | "layer" | "multiplePluginsActive" | "redo" | "replaceLeaf" | "rootPlugins" | "state" | "toolTransitionInProgress" | "undo" | "update" | "updateGraphics" | "updateOnGraphicClick">;
78
+
79
+ export type SelectionViewModelLike = EventedAccessor
80
+ & Pick<SelectionToolbarViewModel, "@eventTypes" | "cancel" | "sources" | "view">
81
+ & {
82
+ activeOperation?: Pick<SelectionOperation, "toolName"> | null;
83
+ activate?: (options: SelectionToolOptions) => Pick<SelectionOperation, "toolName" | "type">;
84
+ };
@@ -0,0 +1,33 @@
1
+ import type { SketchGroupName } from "@arcgis/core/applications/ExperienceBuilder/sketchUtils.js";
2
+ import type { CustomActionProperties } from "@arcgis/core/widgets/Sketch/types.js";
3
+ import type { IconName } from "../types.js";
4
+ import type { ArcgisToolbarAction as ArcgisToolbarAction } from "@arcgis/common-components/components/arcgis-toolbar-action";
5
+
6
+ export interface KnownActionGroup {
7
+ name: SketchComponentGroupName;
8
+ commands: SketchAction[];
9
+ visible: boolean;
10
+ }
11
+
12
+ export type SketchComponentGroupName = SketchGroupName | "geometrySimplification";
13
+
14
+ export interface SketchAction {
15
+ active: boolean;
16
+ afterCreate?: CustomActionProperties["afterCreate"];
17
+ afterRemoved?: CustomActionProperties["afterRemoved"];
18
+ afterUpdate?: CustomActionProperties["afterUpdate"];
19
+ appearance?: ArcgisToolbarAction["appearance"];
20
+ disabled: boolean;
21
+ icon?: IconName;
22
+ id?: string;
23
+ kind?: ArcgisToolbarAction["kind"];
24
+ labelKey: string;
25
+ labelParameters?: Record<string, number | string>;
26
+ loading?: boolean;
27
+ tooltipKey?: string;
28
+ iconFlipRTL?: boolean;
29
+ refKey?: string;
30
+ textEnabled?: boolean;
31
+ renderAsAction?: boolean;
32
+ onClick: () => void;
33
+ }
@@ -13,8 +13,9 @@ import type Collection from "@arcgis/core/core/Collection.js";
13
13
  import type { SketchGroupName } from "@arcgis/core/applications/ExperienceBuilder/sketchUtils.js";
14
14
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
15
15
  import type { ArcgisReferenceElement, IconName } from "../types.js";
16
- import type { CreateOptions, CreateTool, UpdateEvent, UndoEvent, DuplicateEvent, RedoEvent, DeleteEvent, CreateEvent, CustomToolOptions, CustomActionProperties, SelectionTool, SketchTool, CreationMode, UpdateOptions, SketchPointSymbol, SketchPolygonSymbol, SketchPolylineSymbol } from "@arcgis/core/widgets/Sketch/types.js";
16
+ import type { CreateOptions, CreateTool, UpdateEvent, UndoEvent, DuplicateEvent, RedoEvent, DeleteEvent, CreateEvent, CustomToolOptions, CustomActionProperties, CreationMode, UpdateOptions, SketchPointSymbol, SketchPolygonSymbol, SketchPolylineSymbol } from "@arcgis/core/widgets/Sketch/types.js";
17
17
  import type { RelativePosition } from "./support.js";
18
+ import type { SketchComponentViewModel } from "./SketchComponentViewModel.js";
18
19
  import type { T9nMeta } from "@arcgis/lumina/controllers";
19
20
  import type { MapViewOrSceneView } from "@arcgis/core/views/MapViewOrSceneView.js";
20
21
  import type { Button as Button } from "@esri/calcite-components/components/calcite-button";
@@ -182,7 +183,7 @@ export abstract class ArcgisSketch extends LitElement {
182
183
  * To opt in to freehandPolyline and freehandPolygon tools, include them when setting availableCreateTools,
183
184
  * and hideCreateTools* properties.
184
185
  */
185
- get activeTool(): SelectionTool | SketchTool | undefined;
186
+ get activeTool(): SketchComponentViewModel["activeTool"];
186
187
  /**
187
188
  * If true, the component will not be destroyed automatically when it is
188
189
  * disconnected from the document. This is useful when you want to move the
@@ -1,13 +1,13 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as F } from "../../chunks/runtime.js";
3
- import { css as H, noChange as R, html as m } from "lit";
3
+ import { css as H, noChange as R, html as v } from "lit";
4
4
  import { substitute as q } from "@arcgis/core/intl.js";
5
5
  import { usePropertyChange as z, useWatchAttributes as N } from "@arcgis/lumina/controllers";
6
6
  import { reEmitEvent as f } from "@arcgis/lumina-toolkit/reEmitEvent";
7
7
  import j from "@arcgis/core/layers/GraphicsLayer.js";
8
8
  import J from "@arcgis/core/symbols/TextSymbol.js";
9
9
  import { LitElement as Q, createEvent as X, nothing as x } from "@arcgis/lumina";
10
- import { watch as v, on as Y, whenOnce as Z } from "@arcgis/core/core/reactiveUtils.js";
10
+ import { watch as m, on as Y, whenOnce as Z } from "@arcgis/core/core/reactiveUtils.js";
11
11
  import { u as ee } from "../../chunks/useT9n.js";
12
12
  import { m as te } from "../../chunks/useViewModel.js";
13
13
  import { V as T } from "../../chunks/visible-element.js";
@@ -106,7 +106,7 @@ function Te({
106
106
  }, n);
107
107
  }
108
108
  r(i());
109
- const p = v(
109
+ const p = m(
110
110
  i,
111
111
  (n) => {
112
112
  s(), n ? h(Ce, !0) : h(t == null ? 0 : be - (Date.now() - t), !1);
@@ -137,7 +137,7 @@ let l = class extends ne {
137
137
  }
138
138
  initialize() {
139
139
  this.selectionViewModel ??= new re({ persistSelection: !1 }), this.addHandles([
140
- v(
140
+ m(
141
141
  () => this.sketchViewModel,
142
142
  (i, e) => {
143
143
  i !== e && this._effectiveRenderStateCache.clear();
@@ -150,7 +150,7 @@ let l = class extends ne {
150
150
  this._effectiveGeometrySimplificationInProgress = i;
151
151
  }
152
152
  }),
153
- v(
153
+ m(
154
154
  () => this.view,
155
155
  (i) => {
156
156
  this.selectionViewModel.view = i;
@@ -158,7 +158,7 @@ let l = class extends ne {
158
158
  { initial: !0, sync: !0 }
159
159
  ),
160
160
  // Ensure the SelectionViewModel always has the latest layer
161
- v(
161
+ m(
162
162
  () => this.sketchViewModel?.layer,
163
163
  (i) => this.selectionViewModel.sources = i ? [i] : [],
164
164
  { initial: !0, sync: !0 }
@@ -167,7 +167,7 @@ let l = class extends ne {
167
167
  i.length && this.update(i);
168
168
  }),
169
169
  // Cancel active tool when selection activates
170
- v(
170
+ m(
171
171
  () => this.selectionViewModel.activeOperation,
172
172
  (i) => {
173
173
  i && (this.sketchViewModel?.cancel(), this._activeCustomToolOptions = void 0);
@@ -181,7 +181,7 @@ let l = class extends ne {
181
181
  i.state === "complete" && this.sketchViewModel?.creationMode !== "continuous" && (this._activeCustomToolOptions = void 0);
182
182
  }
183
183
  ),
184
- v(
184
+ m(
185
185
  () => this.visibleElements.settingsMenu,
186
186
  (i) => {
187
187
  i || (this.settingsPopoverOpen = !1);
@@ -720,22 +720,23 @@ class Me extends Q {
720
720
  constructor() {
721
721
  super(), this.#t = new l(), this.#o = _(), this.#s = _(), this._defaultGraphicsLayer = null, this._messages = ee(), this.test = {
722
722
  componentViewModel: this.#t
723
- }, this._groupLayoutPriorityOverrides = /* @__PURE__ */ new Map(), this._contextualToolLocation = "separate", this._refMap = se(), this.viewModel = Ee(this), this.view = this.viewModel.view, this.activeTool = this.#t.activeTool, this.autoDestroyDisabled = !1, this.createGraphic = this.viewModel.createGraphic, this.creationMode = this.viewModel.creationMode, this.defaultCreateOptions = this.viewModel.defaultCreateOptions, this.defaultGraphicsLayerDisabled = !1, this.defaultUpdateOptions = this.viewModel.defaultUpdateOptions, this.geometrySimplificationInProgress = this.viewModel.geometrySimplificationInProgress, this.icon = "pencil", this.label = this._messages?.componentLabel, this.labelOptions = this.viewModel.labelOptions, this.layer = this.viewModel.layer, this.layout = "horizontal", this.pointSymbol = this.viewModel.pointSymbol, this.polygonSymbol = this.viewModel.polygonSymbol, this.polylineSymbol = this.viewModel.polylineSymbol, this.visualScale = "m", this.snappingOptions = this.viewModel.snappingOptions, this.textSymbol = this.viewModel.textSymbol, this.toolbarKind = "floating", this.tooltipOptions = this.viewModel.tooltipOptions, this.valueOptions = this.viewModel.valueOptions, this.useLegacyCreateTools = this.viewModel.useLegacyCreateTools, this.updateOnGraphicClickDisabled = this.viewModel.updateOnGraphicClick, this.updateGraphics = this.viewModel.updateGraphics, this.arcgisCreate = f(() => this.viewModel, "create"), this.arcgisDelete = f(() => this.viewModel, "delete"), this.arcgisDuplicate = f(() => this.viewModel, "duplicate"), this.arcgisPropertyChange = z()("activeTool", "geometrySimplificationInProgress", "state"), this.arcgisReady = X(), this.arcgisRedo = f(() => this.viewModel, "redo"), this.arcgisUndo = f(() => this.viewModel, "undo"), this.arcgisUpdate = f(() => this.viewModel, "update"), N(["slot"], () => {
723
+ }, this._groupLayoutPriorityOverrides = /* @__PURE__ */ new Map(), this._contextualToolLocation = "separate", this._refMap = se(), this.viewModel = Ee(this), this.view = this.viewModel.view, this.autoDestroyDisabled = !1, this.createGraphic = this.viewModel.createGraphic, this.creationMode = this.viewModel.creationMode, this.defaultCreateOptions = this.viewModel.defaultCreateOptions, this.defaultGraphicsLayerDisabled = !1, this.defaultUpdateOptions = this.viewModel.defaultUpdateOptions, this.geometrySimplificationInProgress = this.viewModel.geometrySimplificationInProgress, this.icon = "pencil", this.label = this._messages?.componentLabel, this.labelOptions = this.viewModel.labelOptions, this.layer = this.viewModel.layer, this.layout = "horizontal", this.pointSymbol = this.viewModel.pointSymbol, this.polygonSymbol = this.viewModel.polygonSymbol, this.polylineSymbol = this.viewModel.polylineSymbol, this.visualScale = "m", this.snappingOptions = this.viewModel.snappingOptions, this.textSymbol = this.viewModel.textSymbol, this.toolbarKind = "floating", this.tooltipOptions = this.viewModel.tooltipOptions, this.valueOptions = this.viewModel.valueOptions, this.useLegacyCreateTools = this.viewModel.useLegacyCreateTools, this.updateOnGraphicClickDisabled = this.viewModel.updateOnGraphicClick, this.updateGraphics = this.viewModel.updateGraphics, this.arcgisCreate = f(() => this.viewModel, "create"), this.arcgisDelete = f(() => this.viewModel, "delete"), this.arcgisDuplicate = f(() => this.viewModel, "duplicate"), this.arcgisPropertyChange = z()("activeTool", "geometrySimplificationInProgress", "state"), this.arcgisReady = X(), this.arcgisRedo = f(() => this.viewModel, "redo"), this.arcgisUndo = f(() => this.viewModel, "undo"), this.arcgisUpdate = f(() => this.viewModel, "update"), N(["slot"], () => {
724
724
  this.requestUpdate();
725
725
  }), this.manager.onLifecycle(() => [
726
- v(() => this.el.view?.map, (e, t) => {
726
+ m(() => this.el.view?.map, (e, t) => {
727
727
  const o = this._defaultGraphicsLayer;
728
728
  o && (t?.allLayers.includes(o) && t.remove(o), o && !e?.allLayers.includes(o) && e?.add(o));
729
729
  }),
730
- v(() => this.el.view, (e) => {
730
+ m(() => this.el.view, (e) => {
731
731
  this.viewModel.view = e, this.#t.view = e ?? void 0;
732
732
  }, { initial: !0 }),
733
- v(() => this.viewModel, (e) => {
733
+ m(() => this.viewModel, (e) => {
734
734
  this.#t.sketchViewModel = e, this.viewModel.pluginManager.sketch = this;
735
735
  }, { initial: !0 }),
736
- v(() => this.#t.state, (e, t) => {
736
+ m(() => this.#t.state, (e, t) => {
737
737
  this.requestUpdate("state", t);
738
- }, { initial: !0 })
738
+ }, { initial: !0 }),
739
+ m(() => this.#t.activeTool, () => this.arcgisPropertyChange.emit({ name: "activeTool" }), { sync: !0 })
739
740
  ]), this.manager.onDestroy(() => {
740
741
  this._defaultGraphicsLayer && this.el.view?.map?.allLayers.includes(this._defaultGraphicsLayer) && this.el.view?.map?.remove(this._defaultGraphicsLayer), this._defaultGraphicsLayer?.destroy(), this._defaultGraphicsLayer = null, this.#t.destroy();
741
742
  });
@@ -753,6 +754,9 @@ class Me extends Q {
753
754
  #i;
754
755
  #o;
755
756
  #s;
757
+ get activeTool() {
758
+ return this.#t.activeTool;
759
+ }
756
760
  get visibleElements() {
757
761
  return this.#t.visibleElements;
758
762
  }
@@ -1044,11 +1048,11 @@ class Me extends Q {
1044
1048
  }
1045
1049
  render() {
1046
1050
  const e = this._refMap.get("settings")?.value?.actionElement, t = this.#t.groupedActions, { visualScale: o, layout: s, toolbarKind: r, relativePosition: h, _contextualToolLocation: p } = this, n = t.find(({ name: u }) => u === "selectionSet"), g = t.filter(({ name: u }) => u !== "selectionSet");
1047
- return m`<div class="toolbar-container"><arcgis-toolbar-stack .layout=${s} .toolbarKind=${r} .relativePosition=${h} .scale=${o} tooltip-appearance=calcite><arcgis-toolbar ${E(this.#o)}>${T({ hidden: !n?.visible || p !== "inline", children: this._renderActionGroup(n) })}${g.map((u) => this._renderActionGroup(u))}${T({ hidden: !n?.visible || p !== "inline-end", children: this._renderActionGroup(n) })}</arcgis-toolbar>${T({ hidden: !n?.visible || p !== "separate", children: m`<arcgis-toolbar>${this._renderActionGroup(n)}</arcgis-toolbar>` })}</arcgis-toolbar-stack></div>${T({ hidden: this.hideSettingsMenu, children: m`<arcgis-view-popover .open=${this.#t.settingsPopoverOpen} closable .heading=${this._messages.settings?.heading} .label=${this._messages.settings?.heading} .anchorElement=${e} .visualScale=${o} .actionBarElement=${this.#o.value?.barElement} @arcgisPropertyChange=${(u) => this.#t.settingsPopoverOpen = u.target.open ?? !1} .view=${this.view ?? void 0}>${this._renderSettings()}</arcgis-view-popover>` })}`;
1051
+ return v`<div class="toolbar-container"><arcgis-toolbar-stack .layout=${s} .toolbarKind=${r} .relativePosition=${h} .scale=${o} tooltip-appearance=calcite><arcgis-toolbar ${E(this.#o)}>${T({ hidden: !n?.visible || p !== "inline", children: this._renderActionGroup(n) })}${g.map((u) => this._renderActionGroup(u))}${T({ hidden: !n?.visible || p !== "inline-end", children: this._renderActionGroup(n) })}</arcgis-toolbar>${T({ hidden: !n?.visible || p !== "separate", children: v`<arcgis-toolbar>${this._renderActionGroup(n)}</arcgis-toolbar>` })}</arcgis-toolbar-stack></div>${T({ hidden: this.hideSettingsMenu, children: v`<arcgis-view-popover .open=${this.#t.settingsPopoverOpen} closable .heading=${this._messages.settings?.heading} .label=${this._messages.settings?.heading} .anchorElement=${e} .visualScale=${o} .actionBarElement=${this.#o.value?.barElement} @arcgisPropertyChange=${(u) => this.#t.settingsPopoverOpen = u.target.open ?? !1} .view=${this.view ?? void 0}>${this._renderSettings()}</arcgis-view-popover>` })}`;
1048
1052
  }
1049
1053
  _renderSettings() {
1050
1054
  const { autoDestroyDisabled: e, hideLabelsToggle: t, hideSnappingControls: o, hideTooltipsToggle: s, showSnappingControlsElementsHeader: r, view: h, viewModel: p } = this;
1051
- return m`<div class="editing-controls-panel"><arcgis-sketch-tooltip-controls .hideLabelsToggle=${t} .hideTooltipsToggle=${s} .directionMode=${p.valueOptions.directionMode} .labelsEnabled=${p.labelOptions.enabled} .tooltipsEnabled=${p.tooltipOptions.enabled} @arcgisPropertyChange=${(n) => {
1055
+ return v`<div class="editing-controls-panel"><arcgis-sketch-tooltip-controls .hideLabelsToggle=${t} .hideTooltipsToggle=${s} .directionMode=${p.valueOptions.directionMode} .labelsEnabled=${p.labelOptions.enabled} .tooltipsEnabled=${p.tooltipOptions.enabled} @arcgisPropertyChange=${(n) => {
1052
1056
  n.stopPropagation();
1053
1057
  const { labelsEnabled: g, tooltipsEnabled: u, directionMode: d } = n.currentTarget, b = this.viewModel;
1054
1058
  switch (n.detail.name) {
@@ -1062,7 +1066,7 @@ class Me extends Q {
1062
1066
  b.tooltipOptions.enabled = u;
1063
1067
  break;
1064
1068
  }
1065
- }}></arcgis-sketch-tooltip-controls>${o ? void 0 : m`<arcgis-snapping-controls .autoDestroyDisabled=${e} .view=${h} .visibleElements=${this.#e.snappingControlsElements} .snappingOptions=${p.snappingOptions} .showHeader=${r} @arcgisPropertyChange=${(n) => n.stopPropagation()}></arcgis-snapping-controls>`}</div>`;
1069
+ }}></arcgis-sketch-tooltip-controls>${o ? void 0 : v`<arcgis-snapping-controls .autoDestroyDisabled=${e} .view=${h} .visibleElements=${this.#e.snappingControlsElements} .snappingOptions=${p.snappingOptions} .showHeader=${r} @arcgisPropertyChange=${(n) => n.stopPropagation()}></arcgis-snapping-controls>`}</div>`;
1066
1070
  }
1067
1071
  _renderActionGroup({ visible: e, commands: t, name: o }) {
1068
1072
  if (!e || !t.length)
@@ -1070,16 +1074,16 @@ class Me extends Q {
1070
1074
  const { defaultPriority: s, groupKind: r, overflowLabel: h } = ye[o], n = (o === "geometrySimplification" ? void 0 : this._groupLayoutPriorityOverrides.get(o)) ?? s, g = t.map((d) => this._renderCommand(d)), u = I(`more.${h}`, this._messages);
1071
1075
  switch (r) {
1072
1076
  case "more-button":
1073
- return m`<arcgis-toolbar-group .priority=${n}><arcgis-toolbar-more-button .overflowActionLabel=${u} .priority=${n}>${g}</arcgis-toolbar-more-button></arcgis-toolbar-group>`;
1077
+ return v`<arcgis-toolbar-group .priority=${n}><arcgis-toolbar-more-button .overflowActionLabel=${u} .priority=${n}>${g}</arcgis-toolbar-more-button></arcgis-toolbar-group>`;
1074
1078
  case "split-button":
1075
- return m`<arcgis-toolbar-group .priority=${n}><arcgis-toolbar-split-button .overflowActionLabel=${u} .priority=${n}>${g}</arcgis-toolbar-split-button></arcgis-toolbar-group>`;
1079
+ return v`<arcgis-toolbar-group .priority=${n}><arcgis-toolbar-split-button .overflowActionLabel=${u} .priority=${n}>${g}</arcgis-toolbar-split-button></arcgis-toolbar-group>`;
1076
1080
  case "actions":
1077
- return m`<arcgis-toolbar-group .priority=${n}>${g}</arcgis-toolbar-group>`;
1081
+ return v`<arcgis-toolbar-group .priority=${n}>${g}</arcgis-toolbar-group>`;
1078
1082
  }
1079
1083
  }
1080
1084
  _renderCommand({ active: e, afterCreate: t, afterRemoved: o, afterUpdate: s, appearance: r, icon: h, disabled: p, id: n, kind: g, labelKey: u, labelParameters: d, loading: b, tooltipKey: W, iconFlipRTL: M, onClick: P, refKey: k, textEnabled: A, renderAsAction: K }) {
1081
1085
  const { _messages: O, _refMap: U, layout: L } = this, w = I(u, O), S = w === void 0 ? u : d ? q(w, d) : w, G = O?.[W] ?? S, $ = k ? B(U, k, _) : this.#s, V = { afterCreate: t, afterRemoved: o, afterUpdate: s };
1082
- return K ? m`<arcgis-toolbar-action .active=${e} .appearance=${r} .disabled=${p} .icon=${h} .iconFlipRtl=${M} id=${n ?? x} .kind=${g} .loading=${b} .labelText=${L === "horizontal" ? S : ""} .textEnabled=${A} .tooltipText=${L === "horizontal" && A ? "" : G} @arcgisToolbarItemSelected=${P} ${D(V)} ${E($)}></arcgis-toolbar-action>` : m`<arcgis-toolbar-item .active=${e} .disabled=${p} .icon=${h} id=${n ?? x} .iconFlipRtl=${M} .labelText=${S} .tooltipText=${G} @arcgisItemSelected=${P} ${D(V)} ${E($)}></arcgis-toolbar-item>`;
1086
+ return K ? v`<arcgis-toolbar-action .active=${e} .appearance=${r} .disabled=${p} .icon=${h} .iconFlipRtl=${M} id=${n ?? x} .kind=${g} .loading=${b} .labelText=${L === "horizontal" ? S : ""} .textEnabled=${A} .tooltipText=${L === "horizontal" && A ? "" : G} @arcgisToolbarItemSelected=${P} ${D(V)} ${E($)}></arcgis-toolbar-action>` : v`<arcgis-toolbar-item .active=${e} .disabled=${p} .icon=${h} id=${n ?? x} .iconFlipRtl=${M} .labelText=${S} .tooltipText=${G} @arcgisItemSelected=${P} ${D(V)} ${E($)}></arcgis-toolbar-item>`;
1083
1087
  }
1084
1088
  }
1085
1089
  F("arcgis-sketch", Me);