@itwin/imodel-components-react 4.0.0-dev.2 → 4.0.0-dev.20

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 (226) hide show
  1. package/CHANGELOG.md +139 -2
  2. package/LICENSE.md +1 -1
  3. package/README.md +2 -2
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  5. package/lib/cjs/imodel-components-react/UiIModelComponents.js +3 -7
  6. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +2 -2
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +6 -2
  9. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +9 -4
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  13. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +4 -4
  14. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +5 -1
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  16. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  17. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +10 -4
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  20. package/lib/cjs/imodel-components-react/color/HueSlider.js +5 -1
  21. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  22. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +5 -1
  23. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  24. package/lib/cjs/imodel-components-react/color/Swatch.js +5 -1
  25. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/color/Swatch.scss +1 -2
  27. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +5 -1
  28. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +1 -1
  30. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +5 -1
  31. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  32. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +1 -1
  33. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +5 -1
  34. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +1 -1
  36. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  37. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +11 -4
  38. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  39. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  40. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +5 -1
  41. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +1 -1
  43. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +6 -2
  44. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  45. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  46. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +5 -1
  47. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  48. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +4 -24
  49. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  50. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +46 -54
  51. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  52. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  53. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  54. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +16 -6
  55. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  56. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  57. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +6 -2
  58. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  59. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  60. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +7 -4
  61. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  62. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  63. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +10 -5
  64. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  65. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +6 -3
  66. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  67. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +6 -3
  68. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  69. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +10 -10
  70. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  71. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +8 -5
  72. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  73. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +5 -1
  74. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  75. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +5 -1
  76. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  77. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +5 -1
  78. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  79. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +5 -1
  80. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  81. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +5 -1
  82. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +5 -1
  84. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  85. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +5 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  87. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +5 -1
  88. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +5 -1
  90. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  91. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +6 -3
  92. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  93. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +5 -1
  94. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  96. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +22 -23
  97. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  98. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +5 -1
  99. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  100. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +2 -2
  101. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  102. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +12 -4
  103. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  104. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +9 -12
  105. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +5 -1
  106. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  107. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +8 -15
  108. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  109. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +13 -5
  110. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  111. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  112. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +5 -1
  113. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  114. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +3 -6
  115. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  116. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +59 -19
  117. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  118. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  119. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +3 -32
  120. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  121. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  122. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +1 -1
  123. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  124. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +12 -10
  125. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  126. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +1 -1
  127. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  128. package/lib/cjs/imodel-components-react.d.ts +0 -1
  129. package/lib/cjs/imodel-components-react.d.ts.map +1 -1
  130. package/lib/cjs/imodel-components-react.js +5 -2
  131. package/lib/cjs/imodel-components-react.js.map +1 -1
  132. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  133. package/lib/esm/imodel-components-react/UiIModelComponents.js +4 -7
  134. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  135. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +2 -2
  136. package/lib/esm/imodel-components-react/color/AlphaSlider.js +1 -1
  137. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  138. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  139. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +5 -4
  140. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  141. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +4 -4
  142. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  143. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +6 -4
  144. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  145. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  146. package/lib/esm/imodel-components-react/color/Swatch.scss +1 -2
  147. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +1 -1
  148. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +1 -1
  149. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +1 -1
  150. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  151. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +7 -4
  152. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  153. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  154. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +1 -1
  155. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +2 -1
  156. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  157. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  158. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +4 -24
  159. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  160. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +42 -52
  161. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  162. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  163. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  164. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +12 -5
  165. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  166. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  167. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +1 -1
  168. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  169. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  170. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +2 -3
  171. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  172. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  173. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +6 -5
  174. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  175. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +1 -2
  176. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  177. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +1 -2
  178. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  179. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +5 -9
  180. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  181. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +3 -4
  182. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  183. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +1 -2
  184. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  185. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  186. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +22 -23
  187. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  188. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +2 -2
  189. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  190. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +7 -3
  191. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  192. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +9 -12
  193. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +8 -15
  194. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  195. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +10 -6
  196. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  197. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  198. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +3 -6
  199. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  200. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +47 -11
  201. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  202. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  203. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +3 -32
  204. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  205. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  206. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +1 -1
  207. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  208. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +7 -9
  209. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  210. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +2 -1
  211. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  212. package/lib/esm/imodel-components-react.d.ts +0 -1
  213. package/lib/esm/imodel-components-react.d.ts.map +1 -1
  214. package/lib/esm/imodel-components-react.js +0 -1
  215. package/lib/esm/imodel-components-react.js.map +1 -1
  216. package/package.json +38 -39
  217. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  218. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  219. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +0 -146
  220. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  221. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +0 -94
  222. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  223. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  224. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +0 -123
  225. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  226. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +0 -94
@@ -4,35 +4,6 @@
4
4
  import { ColorDef } from "@itwin/core-common";
5
5
  import { ScreenViewport } from "@itwin/core-frontend";
6
6
  import { GenericUiEventArgs } from "@itwin/appui-abstract";
7
- /**
8
- * A range of time which can be used to focus in on activities scheduled around a milestone.
9
- * @public
10
- */
11
- export interface MilestoneRange {
12
- start: Date;
13
- end: Date;
14
- }
15
- /**
16
- * A Milestone event that is to be noted in the timeline.
17
- * @internal
18
- * @deprecated
19
- */
20
- export interface Milestone {
21
- /** uniqueId of milestone */
22
- id: string;
23
- /** milestone date */
24
- date: Date;
25
- parentId?: string;
26
- /** Milestone label that is display if space allows */
27
- label?: string;
28
- /** Milestone description that is show as tooltip */
29
- description?: string;
30
- /** animation range that includes milestone */
31
- range?: MilestoneRange;
32
- /** Set to true if read only. */
33
- readonly?: boolean;
34
- children?: Milestone[];
35
- }
36
7
  /** The timeline scale.
37
8
  * @public
38
9
  */
@@ -81,13 +52,13 @@ export interface PlaybackSettings {
81
52
  * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.
82
53
  * @public
83
54
  */
84
- export declare type AnimationFractionChangeHandler = (animationFraction: number) => void;
55
+ export type AnimationFractionChangeHandler = (animationFraction: number) => void;
85
56
  /**
86
57
  * An interface used to notify Handlers of Playback Settings changes.
87
58
  * Contains the settings to be used.
88
59
  * @public
89
60
  */
90
- export declare type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;
61
+ export type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;
91
62
  /** Actions for Pause/Play event
92
63
  * @public
93
64
  */
@@ -141,7 +112,7 @@ export interface TimelineDataProvider {
141
112
  * Contains the settings to be used.
142
113
  * @alpha
143
114
  */
144
- export declare type SolarPlaybackProgressHandler = (time: Date) => void;
115
+ export type SolarPlaybackProgressHandler = (time: Date) => void;
145
116
  /** Data Provider interface for getting and setting solar position
146
117
  * @alpha
147
118
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,iBAAiB;IACjB,KAAK,IAAA;IACL,oBAAoB;IACpB,QAAQ,IAAA;IACR,kBAAkB;IAClB,MAAM,IAAA;IACN,gBAAgB;IAChB,IAAI,IAAA;IACJ,iBAAiB;IACjB,KAAK,IAAA;CACN;AAED;;GAEG;AACH,oBAAY,mBAAmB;IAC7B,qDAAqD;IACrD,UAAU,IAAA;IACV,sEAAsE;IACtE,WAAW,IAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kDAAkD;IAClD,SA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AAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,mBAAmB;IACnB,WAAW,EAAE,QAAQ,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;sGACkG;IAClG,cAAc,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAsCH;;GAEG;AACH,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,iBAAiB;IACjB,mDAAK,CAAA;IACL,oBAAoB;IACpB,yDAAQ,CAAA;IACR,kBAAkB;IAClB,qDAAM,CAAA;IACN,gBAAgB;IAChB,iDAAI,CAAA;IACJ,iBAAiB;IACjB,mDAAK,CAAA;AACP,CAAC,EAXW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAWxB;AAED;;GAEG;AACH,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,qDAAqD;IACrD,yEAAU,CAAA;IACV,sEAAsE;IACtE,2EAAW,CAAA;AACb,CAAC,EALW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAK9B;AAoCD;;GAEG;AACH,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,yEAAM,CAAA;IACN,uEAAK,CAAA;IACL,qEAAI,CAAA;AACN,CAAC,EAJW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAIlC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\n\nimport { ColorDef } from \"@itwin/core-common\";\nimport { ScreenViewport } from \"@itwin/core-frontend\";\nimport { GenericUiEventArgs } from \"@itwin/appui-abstract\";\n\n/**\n * A range of time which can be used to focus in on activities scheduled around a milestone.\n * @public\n */\nexport interface MilestoneRange {\n start: Date;\n end: Date;\n}\n\n/**\n * A Milestone event that is to be noted in the timeline.\n * @internal\n * @deprecated\n */\nexport interface Milestone {\n /** uniqueId of milestone */\n id: string;\n /** milestone date */\n date: Date;\n parentId?: string;\n /** Milestone label that is display if space allows */\n label?: string;\n /** Milestone description that is show as tooltip */\n description?: string;\n /** animation range that includes milestone */\n range?: MilestoneRange;\n /** Set to true if read only. */\n readonly?: boolean;\n // eslint-disable-next-line deprecation/deprecation\n children?: Milestone[];\n}\n\n/** The timeline scale.\n * @public\n */\nexport enum TimelineScale {\n /** Show years */\n Years,\n /** Show quarters */\n Quarters,\n /** Show months */\n Months,\n /** Show days */\n Days,\n /** Show hours */\n Hours,\n}\n\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\n * @public\n */\nexport enum TimelineDateDisplay {\n /** Display time axis using actual start/end dates */\n ActualTime,\n /** Display time axis using time relative to actual start/end dates */\n ProjectTime,\n}\n\n/**\n * Playback Settings.\n * @public\n */\nexport interface PlaybackSettings {\n /** time in milliseconds to play animation from start date to end date */\n duration?: number;\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\n loop?: boolean;\n /** If true a minimal set of data is displayed. */\n minimized?: boolean;\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\n playbackStart?: Date;\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\n playbackEnd?: Date;\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\n allowMilestoneEdits?: boolean;\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\n dateDisplay?: TimelineDateDisplay;\n}\n\n/**\n * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.\n * @public\n */\nexport type AnimationFractionChangeHandler = (animationFraction: number) => void;\n\n/**\n * An interface used to notify Handlers of Playback Settings changes.\n * Contains the settings to be used.\n * @public\n */\nexport type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;\n\n/** Actions for Pause/Play event\n * @public\n */\nexport enum TimelinePausePlayAction {\n Toggle,\n Pause,\n Play,\n}\n/** Args for event to pause or play the timeline component\n * @public\n */\nexport interface TimelinePausePlayArgs extends GenericUiEventArgs {\n timelineAction: TimelinePausePlayAction;\n}\n/** Interface for a timeline data provider class\n * @public\n */\nexport interface TimelineDataProvider {\n /** uniqueId of provider */\n id: string;\n /** view id when viewport is initially assigned */\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n /** Starting date for entire timeline */\n start?: Date;\n /** End date for entire timeline */\n end?: Date;\n /** Current animation fraction from 0.0 to 1.0 */\n animationFraction?: number;\n getSettings(): PlaybackSettings;\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\n initialDuration: number;\n /** Called to get the duration of the Playback. */\n duration: number;\n /** If true the playback will continuously loop. */\n loop: boolean;\n /** Called to save the playback settings */\n updateSettings(settings: PlaybackSettings): void;\n /** Async call to load milestone and settings data */\n loadTimelineData(): Promise<boolean>;\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n}\n\n/**\n * An interface used to notify Handlers of Playback progress.\n * Contains the settings to be used.\n * @alpha\n */\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\n\n/** Data Provider interface for getting and setting solar position\n * @alpha\n */\nexport interface SolarDataProvider {\n // View Id used to determine sunrise and sunset\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n // set to true is timeline should be shown - return false if view is not set to display shadow.\n readonly shouldShowTimeline: boolean;\n /** Starting date for entire timeline */\n day: Date;\n /** Starting time for day in milliseconds */\n readonly dayStartMs: number;\n /** Time of day for sun */\n readonly timeOfDay: Date;\n /** Called during playback to update animation */\n onTimeChanged?: SolarPlaybackProgressHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n /** Time of Sunrise to nearest minute */\n readonly sunrise: Date;\n /** time of Sunrise to nearest minute */\n readonly sunset: Date;\n /** shadow color */\n shadowColor: ColorDef;\n /** timezone offset for local project time */\n readonly timeZoneOffset: number;\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\n * current time and the value is adjusted to be the same date and time at the project location. */\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH;;GAEG;AACH,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,iBAAiB;IACjB,mDAAK,CAAA;IACL,oBAAoB;IACpB,yDAAQ,CAAA;IACR,kBAAkB;IAClB,qDAAM,CAAA;IACN,gBAAgB;IAChB,iDAAI,CAAA;IACJ,iBAAiB;IACjB,mDAAK,CAAA;AACP,CAAC,EAXW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAWxB;AAED;;GAEG;AACH,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,qDAAqD;IACrD,yEAAU,CAAA;IACV,sEAAsE;IACtE,2EAAW,CAAA;AACb,CAAC,EALW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAK9B;AAoCD;;GAEG;AACH,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,yEAAM,CAAA;IACN,uEAAK,CAAA;IACL,qEAAI,CAAA;AACN,CAAC,EAJW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAIlC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\n\nimport { ColorDef } from \"@itwin/core-common\";\nimport { ScreenViewport } from \"@itwin/core-frontend\";\nimport { GenericUiEventArgs } from \"@itwin/appui-abstract\";\n\n/** The timeline scale.\n * @public\n */\nexport enum TimelineScale {\n /** Show years */\n Years,\n /** Show quarters */\n Quarters,\n /** Show months */\n Months,\n /** Show days */\n Days,\n /** Show hours */\n Hours,\n}\n\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\n * @public\n */\nexport enum TimelineDateDisplay {\n /** Display time axis using actual start/end dates */\n ActualTime,\n /** Display time axis using time relative to actual start/end dates */\n ProjectTime,\n}\n\n/**\n * Playback Settings.\n * @public\n */\nexport interface PlaybackSettings {\n /** time in milliseconds to play animation from start date to end date */\n duration?: number;\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\n loop?: boolean;\n /** If true a minimal set of data is displayed. */\n minimized?: boolean;\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\n playbackStart?: Date;\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\n playbackEnd?: Date;\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\n allowMilestoneEdits?: boolean;\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\n dateDisplay?: TimelineDateDisplay;\n}\n\n/**\n * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.\n * @public\n */\nexport type AnimationFractionChangeHandler = (animationFraction: number) => void;\n\n/**\n * An interface used to notify Handlers of Playback Settings changes.\n * Contains the settings to be used.\n * @public\n */\nexport type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;\n\n/** Actions for Pause/Play event\n * @public\n */\nexport enum TimelinePausePlayAction {\n Toggle,\n Pause,\n Play,\n}\n/** Args for event to pause or play the timeline component\n * @public\n */\nexport interface TimelinePausePlayArgs extends GenericUiEventArgs {\n timelineAction: TimelinePausePlayAction;\n}\n/** Interface for a timeline data provider class\n * @public\n */\nexport interface TimelineDataProvider {\n /** uniqueId of provider */\n id: string;\n /** view id when viewport is initially assigned */\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n /** Starting date for entire timeline */\n start?: Date;\n /** End date for entire timeline */\n end?: Date;\n /** Current animation fraction from 0.0 to 1.0 */\n animationFraction?: number;\n getSettings(): PlaybackSettings;\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\n initialDuration: number;\n /** Called to get the duration of the Playback. */\n duration: number;\n /** If true the playback will continuously loop. */\n loop: boolean;\n /** Called to save the playback settings */\n updateSettings(settings: PlaybackSettings): void;\n /** Async call to load milestone and settings data */\n loadTimelineData(): Promise<boolean>;\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n}\n\n/**\n * An interface used to notify Handlers of Playback progress.\n * Contains the settings to be used.\n * @alpha\n */\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\n\n/** Data Provider interface for getting and setting solar position\n * @alpha\n */\nexport interface SolarDataProvider {\n // View Id used to determine sunrise and sunset\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n // set to true is timeline should be shown - return false if view is not set to display shadow.\n readonly shouldShowTimeline: boolean;\n /** Starting date for entire timeline */\n day: Date;\n /** Starting time for day in milliseconds */\n readonly dayStartMs: number;\n /** Time of day for sun */\n readonly timeOfDay: Date;\n /** Called during playback to update animation */\n onTimeChanged?: SolarPlaybackProgressHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n /** Time of Sunrise to nearest minute */\n readonly sunrise: Date;\n /** time of Sunrise to nearest minute */\n readonly sunset: Date;\n /** shadow color */\n shadowColor: ColorDef;\n /** timezone offset for local project time */\n readonly timeZoneOffset: number;\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\n * current time and the value is adjusted to be the same date and time at the project location. */\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\n}\n"]}
@@ -8,7 +8,7 @@ import { CommonProps } from "@itwin/core-react";
8
8
  /** Type for a ViewState prop
9
9
  * @public
10
10
  */
11
- export declare type ViewStateProp = ViewState | (() => ViewState);
11
+ export type ViewStateProp = ViewState | (() => ViewState);
12
12
  /**
13
13
  * Properties for [[ViewportComponent]] component.
14
14
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EACM,gBAAgB,EAAE,cAAc,EAC3C,cAAc,EAAgB,WAAW,EAC/B,SAAS,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD;;GAEG;AACH,oBAAY,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwQrD"}
1
+ {"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EACM,gBAAgB,EAAE,cAAc,EAC3C,cAAc,EAAgB,WAAW,EAC/B,SAAS,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwQrD"}
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -40,7 +44,7 @@ const ViewportComponentEvents_1 = require("./ViewportComponentEvents");
40
44
  function ViewportComponent(props) {
41
45
  const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride, tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;
42
46
  // istanbul ignore next
43
- const viewManagerRef = React.useRef(viewManagerOverride !== null && viewManagerOverride !== void 0 ? viewManagerOverride : core_frontend_1.IModelApp.viewManager);
47
+ const viewManagerRef = React.useRef(viewManagerOverride ?? core_frontend_1.IModelApp.viewManager);
44
48
  const tentativePointOverrideRef = React.useRef(tentativePointOverride);
45
49
  const screenViewportCreated = React.useRef(false);
46
50
  const viewportDiv = React.useRef(null);
@@ -86,10 +90,9 @@ function ViewportComponent(props) {
86
90
  };
87
91
  const targetPoint = React.useRef(null);
88
92
  const getRotatePoint = (vp) => {
89
- var _a, _b;
90
93
  const lastTargetPoint = targetPoint.current;
91
94
  // istanbul ignore next
92
- const tentativePoint = (_a = tentativePointOverrideRef.current) !== null && _a !== void 0 ? _a : core_frontend_1.IModelApp.tentativePoint;
95
+ const tentativePoint = tentativePointOverrideRef.current ?? core_frontend_1.IModelApp.tentativePoint;
93
96
  // istanbul ignore else
94
97
  if (tentativePoint.isActive)
95
98
  return tentativePoint.getPoint();
@@ -114,7 +117,7 @@ function ViewportComponent(props) {
114
117
  const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(core_common_1.NpcCenter), vp.pixelsFromInches(core_frontend_1.ToolSettings.viewToolPickRadiusInches));
115
118
  targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());
116
119
  // istanbul ignore next
117
- return (_b = targetPoint.current) !== null && _b !== void 0 ? _b : vp.view.getCenter();
120
+ return targetPoint.current ?? vp.view.getCenter();
118
121
  };
119
122
  const handleCubeRotationChangeEvent = (args) => {
120
123
  const viewManager = viewManagerRef.current;
@@ -222,8 +225,8 @@ function ViewportComponent(props) {
222
225
  core_bentley_1.Logger.logError("ViewportComponent", `A Viewstate or a viewId and imodel must be provided`);
223
226
  }
224
227
  // istanbul ignore next
225
- if (isMounted.current && ((currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isOpen) || (currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isBlank))) {
226
- setInitialViewState(currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.clone());
228
+ if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {
229
+ setInitialViewState(currentViewState?.clone());
227
230
  }
228
231
  }
229
232
  if (undefined === initialViewState)
@@ -232,11 +235,10 @@ function ViewportComponent(props) {
232
235
  const [viewOverlay, setViewOverlay] = React.useState(null);
233
236
  // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.
234
237
  React.useEffect(() => {
235
- var _a;
236
238
  const parentDiv = viewportDiv.current;
237
239
  const viewManager = viewManagerRef.current;
238
240
  // istanbul ignore next
239
- if (parentDiv && initialViewState && ((initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isOpen) || (initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isBlank))) {
241
+ if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {
240
242
  if (!screenViewportCreated.current) {
241
243
  const screenViewport = getScreenViewport(parentDiv, initialViewState);
242
244
  screenViewportRef.current = screenViewport;
@@ -249,7 +251,7 @@ function ViewportComponent(props) {
249
251
  }
250
252
  else {
251
253
  // istanbul ignore next
252
- (_a = screenViewportRef.current) === null || _a === void 0 ? void 0 : _a.changeView(initialViewState);
254
+ screenViewportRef.current?.changeView(initialViewState);
253
255
  }
254
256
  }
255
257
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,sDAAyD;AACzD,wDAA0D;AAC1D,oDAA+C;AAC/C,wDAI8B;AAG9B,uEAEmC;AAkCnC;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAC9E,sBAAsB,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACpH,uBAAuB;IACvB,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAm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AgB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/C,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAmB,EAAE,EAAE;QAClE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,aAAa;YACf,aAAa,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,cAAc,GAAwB;QAC1C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU;KACpD,CAAC;IAEF,MAAM,gBAAgB,GAAwB;QAC5C,GAAG,KAAK;QACR,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;KAC9B,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QAEjD;YACE,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;YACD,WAAW,CACX,CACC,CACP,CAAC;AACJ,CAAC;AAxQD,8CAwQC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport * as React from \"react\";\nimport { Id64String, Logger } from \"@itwin/core-bentley\";\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\nimport { NpcCenter } from \"@itwin/core-common\";\nimport {\n IModelApp, IModelConnection, ScreenViewport,\n TentativePoint, ToolSettings, ViewManager,\n Viewport, ViewState,\n} from \"@itwin/core-frontend\";\n\nimport { CommonProps } from \"@itwin/core-react\";\nimport {\n CubeRotationChangeEventArgs, DrawingViewportChangeEventArgs, StandardRotationChangeEventArgs, ViewportComponentEvents,\n} from \"./ViewportComponentEvents\";\n\n/** Type for a ViewState prop\n * @public\n */\nexport type ViewStateProp = ViewState | (() => ViewState);\n\n/**\n * Properties for [[ViewportComponent]] component.\n * @public\n */\nexport interface ViewportProps extends CommonProps {\n /** IModel to display */\n imodel: IModelConnection;\n /** Id of a default view definition to load as a starting point */\n viewDefinitionId?: Id64String;\n /** ViewState to use as a starting point */\n viewState?: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: (v: ScreenViewport) => void;\n /** controlId for this content component @internal */\n controlId?: string;\n /** @internal */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** @internal */\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\n /** @internal used only for testing */\n viewManagerOverride?: ViewManager;\n /** @internal used only for testing */\n screenViewportOverride?: typeof ScreenViewport;\n /** @internal used only for testing */\n tentativePointOverride?: TentativePoint;\n}\n\n/**\n * A viewport React component that creates a ScreenViewport.\n * @public\n */\nexport function ViewportComponent(props: ViewportProps) {\n const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride,\n tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;\n // istanbul ignore next\n const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\n const screenViewportCreated = React.useRef(false);\n const viewportDiv = React.useRef<HTMLDivElement>(null);\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\n const isMounted = React.useRef(false);\n const viewClassFullName = React.useRef(\"\");\n const viewId = React.useRef(\"0\");\n\n // istanbul ignore next\n const handleViewChanged = (vp: Viewport) => {\n // istanbul ignore next\n if (!(vp.iModel.isOpen || vp.iModel.isBlank))\n return;\n ViewportComponentEvents.setViewMatrix(vp);\n if (viewClassFullName.current !== vp.view.classFullName) {\n setTimeout(() => {\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({ viewport: vp, oldName: viewClassFullName.current, newName: vp.view.classFullName });\n viewClassFullName.current = vp.view.classFullName;\n });\n }\n if (viewId.current !== vp.view.id) {\n setTimeout(() => {\n ViewportComponentEvents.onViewIdChangedEvent.emit({ viewport: vp, oldId: viewId.current, newId: vp.view.id });\n viewId.current = vp.view.id;\n });\n }\n };\n\n const handleStandardRotationChangeEvent = (args: StandardRotationChangeEventArgs) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\n currentScreenViewport.view.setRotationAboutPoint(ViewState.getStandardViewMatrix(args.standardRotation));\n currentScreenViewport.synchWithView();\n }\n };\n\n const handleDrawingViewportChangeEvent = (args: DrawingViewportChangeEventArgs) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\n currentScreenViewport.view.setOrigin(args.origin);\n currentScreenViewport.view.setRotation(args.rotation);\n currentScreenViewport.synchWithView({ noSaveInUndo: args.complete !== true });\n }\n };\n\n const targetPoint = React.useRef<Point3d | null>(null);\n\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\n const lastTargetPoint = targetPoint.current;\n // istanbul ignore next\n const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\n // istanbul ignore else\n if (tentativePoint.isActive)\n return tentativePoint.getPoint();\n\n // istanbul ignore else\n if (undefined !== vp.viewCmdTargetCenter) {\n const testPt = vp.worldToView(vp.viewCmdTargetCenter);\n const viewRect = vp.viewRect;\n if (viewRect.containsPoint(testPt))\n return vp.viewCmdTargetCenter;\n vp.viewCmdTargetCenter = undefined;\n }\n\n // istanbul ignore else\n if (null !== lastTargetPoint) {\n const testPt = vp.worldToView(lastTargetPoint);\n const viewRect = vp.viewRect.clone();\n viewRect.scaleAboutCenter(0.25, 0.25);\n // istanbul ignore next hard to reach because of mocks\n if (viewRect.containsPoint(testPt))\n return lastTargetPoint;\n targetPoint.current = null;\n }\n\n const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));\n targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());\n // istanbul ignore next\n return targetPoint.current ?? vp.view.getCenter();\n };\n\n const handleCubeRotationChangeEvent = (args: CubeRotationChangeEventArgs) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n // istanbul ignore else\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\n const rotMatrix = args.rotMatrix;\n // istanbul ignore else\n if (currentScreenViewport.rotation !== rotMatrix) {\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\n const center = getRotatePoint(currentScreenViewport);\n const targetMatrix = inverse.multiplyMatrixMatrix(currentScreenViewport.view.getRotation());\n const worldTransform = Transform.createFixedPointAndMatrix(center, targetMatrix);\n const frustum = currentScreenViewport.getWorldFrustum();\n frustum.multiply(worldTransform);\n currentScreenViewport.view.setupFromFrustum(frustum);\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\n }\n }\n };\n\n const handleDisconnectFromViewManager = () => {\n const screenViewport = screenViewportRef.current;\n if (screenViewport) {\n const viewManager = IModelApp.viewManager;\n screenViewport.onViewChanged.removeListener(handleViewChanged);\n screenViewportRef.current = null;\n screenViewportCreated.current = false;\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(handleDrawingViewportChangeEvent);\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(handleCubeRotationChangeEvent);\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(handleStandardRotationChangeEvent);\n viewManager.dropViewport(screenViewport, true);\n }\n };\n\n // istanbul ignore next\n const handleWindowUnload = () => {\n const parentDiv = viewportDiv.current;\n if (parentDiv) {\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n if (parentWindow !== window) {\n handleDisconnectFromViewManager();\n }\n }\n };\n\n const getScreenViewport = (parentDiv: HTMLDivElement, inViewState: ViewState) => {\n // istanbul ignore next\n const screenViewportFactory = screenViewportOverride ? screenViewportOverride : ScreenViewport;\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n parentWindow.addEventListener(\"unload\", handleWindowUnload, true); // listener clear after being called\n ViewportComponentEvents.initialize();\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(handleStandardRotationChangeEvent);\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\n screenViewportCreated.current = true;\n viewClassFullName.current = screenViewport.view.classFullName;\n viewId.current = screenViewport.view.id;\n screenViewport.onViewChanged.addListener(handleViewChanged);\n return screenViewport;\n };\n\n React.useEffect(() => {\n isMounted.current = true;\n Logger.logInfo(\"ViewportComponent\", `mounting ViewportComponent for controlId=${controlId}`);\n\n return () => {\n isMounted.current = false;\n Logger.logInfo(\"ViewportComponent\", `un-mounting ViewportComponent for controlId=${controlId}`);\n handleDisconnectFromViewManager();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [initialViewState, setInitialViewState] = React.useState<ViewState | undefined>(() => {\n if (viewState) {\n if (typeof viewState === \"function\")\n return viewState().clone();\n else\n return viewState.clone();\n }\n return undefined;\n });\n\n React.useEffect(() => {\n setInitialViewState(undefined);\n }, [viewDefinitionId, viewState]);\n React.useEffect(() => {\n async function fetchInitialViewstate() {\n let currentViewState: ViewState | undefined;\n if (viewState) {\n if (typeof viewState === \"function\")\n currentViewState = viewState();\n else\n currentViewState = viewState;\n } else if (viewDefinitionId && imodel) {\n try {\n currentViewState = await imodel.views.load(viewDefinitionId);\n // istanbul ignore next\n if (!currentViewState) {\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\n }\n } catch (_e) {\n // istanbul ignore next\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\n }\n } else {\n Logger.logError(\"ViewportComponent\", `A Viewstate or a viewId and imodel must be provided`);\n }\n // istanbul ignore next\n if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {\n setInitialViewState(currentViewState?.clone());\n }\n }\n if (undefined === initialViewState)\n fetchInitialViewstate(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\n\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\n\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\n React.useEffect(() => {\n const parentDiv = viewportDiv.current;\n const viewManager = viewManagerRef.current;\n // istanbul ignore next\n if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {\n if (!screenViewportCreated.current) {\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\n screenViewportRef.current = screenViewport;\n\n if (viewportRef)\n viewportRef(screenViewport);\n\n Logger.logInfo(\"ViewportComponent\", `processing viewManager.addViewport for controlId=${controlId}`);\n viewManager.addViewport(screenViewport);\n\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\n } else {\n // istanbul ignore next\n screenViewportRef.current?.changeView(initialViewState);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [controlId, initialViewState, viewportRef]);\n\n const handleContextMenu = React.useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n if (onContextMenu)\n onContextMenu(e);\n }, [onContextMenu]);\n\n const parentDivStyle: React.CSSProperties = {\n height: \"100%\", width: \"100%\", position: \"relative\",\n };\n\n const viewportDivStyle: React.CSSProperties = {\n ...style,\n height: \"100%\", width: \"100%\",\n };\n\n return (\n <div style={parentDivStyle} data-item-id={controlId}\n >\n <>\n <div\n ref={viewportDiv}\n data-testid=\"viewport-component\"\n className={className}\n style={viewportDivStyle}\n onContextMenu={handleContextMenu}\n />\n {viewOverlay}\n </>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ViewportComponent.js","sourceRoot":"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,WAAW,CAAC,cAAc,CAAC,CAAC;gBAExC,6HAA6H;gBAC7H,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aACxE;iBAAM;gBACL,uBAAuB;gBACvB,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;aACzD;SACF;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/C,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAmB,EAAE,EAAE;QAClE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,aAAa;YACf,aAAa,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,cAAc,GAAwB;QAC1C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU;KACpD,CAAC;IAEF,MAAM,gBAAgB,GAAwB;QAC5C,GAAG,KAAK;QACR,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;KAC9B,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QAEjD;YACE,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;YACD,WAAW,CACX,CACC,CACP,CAAC;AACJ,CAAC;AAxQD,8CAwQC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport * as React from \"react\";\nimport { Id64String, Logger } from \"@itwin/core-bentley\";\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\nimport { NpcCenter } from \"@itwin/core-common\";\nimport {\n IModelApp, IModelConnection, ScreenViewport,\n TentativePoint, ToolSettings, ViewManager,\n Viewport, ViewState,\n} from \"@itwin/core-frontend\";\n\nimport { CommonProps } from \"@itwin/core-react\";\nimport {\n CubeRotationChangeEventArgs, DrawingViewportChangeEventArgs, StandardRotationChangeEventArgs, ViewportComponentEvents,\n} from \"./ViewportComponentEvents\";\n\n/** Type for a ViewState prop\n * @public\n */\nexport type ViewStateProp = ViewState | (() => ViewState);\n\n/**\n * Properties for [[ViewportComponent]] component.\n * @public\n */\nexport interface ViewportProps extends CommonProps {\n /** IModel to display */\n imodel: IModelConnection;\n /** Id of a default view definition to load as a starting point */\n viewDefinitionId?: Id64String;\n /** ViewState to use as a starting point */\n viewState?: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: (v: ScreenViewport) => void;\n /** controlId for this content component @internal */\n controlId?: string;\n /** @internal */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** @internal */\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\n /** @internal used only for testing */\n viewManagerOverride?: ViewManager;\n /** @internal used only for testing */\n screenViewportOverride?: typeof ScreenViewport;\n /** @internal used only for testing */\n tentativePointOverride?: TentativePoint;\n}\n\n/**\n * A viewport React component that creates a ScreenViewport.\n * @public\n */\nexport function ViewportComponent(props: ViewportProps) {\n const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride,\n tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;\n // istanbul ignore next\n const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\n const screenViewportCreated = React.useRef(false);\n const viewportDiv = React.useRef<HTMLDivElement>(null);\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\n const isMounted = React.useRef(false);\n const viewClassFullName = React.useRef(\"\");\n const viewId = React.useRef(\"0\");\n\n // istanbul ignore next\n const handleViewChanged = (vp: Viewport) => {\n // istanbul ignore next\n if (!(vp.iModel.isOpen || vp.iModel.isBlank))\n return;\n ViewportComponentEvents.setViewMatrix(vp);\n if (viewClassFullName.current !== vp.view.classFullName) {\n setTimeout(() => {\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({ viewport: vp, oldName: viewClassFullName.current, newName: vp.view.classFullName });\n viewClassFullName.current = vp.view.classFullName;\n });\n }\n if (viewId.current !== vp.view.id) {\n setTimeout(() => {\n ViewportComponentEvents.onViewIdChangedEvent.emit({ viewport: vp, oldId: viewId.current, newId: vp.view.id });\n viewId.current = vp.view.id;\n });\n }\n };\n\n const handleStandardRotationChangeEvent = (args: StandardRotationChangeEventArgs) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\n currentScreenViewport.view.setRotationAboutPoint(ViewState.getStandardViewMatrix(args.standardRotation));\n currentScreenViewport.synchWithView();\n }\n };\n\n const handleDrawingViewportChangeEvent = (args: DrawingViewportChangeEventArgs) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\n currentScreenViewport.view.setOrigin(args.origin);\n currentScreenViewport.view.setRotation(args.rotation);\n currentScreenViewport.synchWithView({ noSaveInUndo: args.complete !== true });\n }\n };\n\n const targetPoint = React.useRef<Point3d | null>(null);\n\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\n const lastTargetPoint = targetPoint.current;\n // istanbul ignore next\n const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\n // istanbul ignore else\n if (tentativePoint.isActive)\n return tentativePoint.getPoint();\n\n // istanbul ignore else\n if (undefined !== vp.viewCmdTargetCenter) {\n const testPt = vp.worldToView(vp.viewCmdTargetCenter);\n const viewRect = vp.viewRect;\n if (viewRect.containsPoint(testPt))\n return vp.viewCmdTargetCenter;\n vp.viewCmdTargetCenter = undefined;\n }\n\n // istanbul ignore else\n if (null !== lastTargetPoint) {\n const testPt = vp.worldToView(lastTargetPoint);\n const viewRect = vp.viewRect.clone();\n viewRect.scaleAboutCenter(0.25, 0.25);\n // istanbul ignore next hard to reach because of mocks\n if (viewRect.containsPoint(testPt))\n return lastTargetPoint;\n targetPoint.current = null;\n }\n\n const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));\n targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());\n // istanbul ignore next\n return targetPoint.current ?? vp.view.getCenter();\n };\n\n const handleCubeRotationChangeEvent = (args: CubeRotationChangeEventArgs) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n // istanbul ignore else\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\n const rotMatrix = args.rotMatrix;\n // istanbul ignore else\n if (currentScreenViewport.rotation !== rotMatrix) {\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\n const center = getRotatePoint(currentScreenViewport);\n const targetMatrix = inverse.multiplyMatrixMatrix(currentScreenViewport.view.getRotation());\n const worldTransform = Transform.createFixedPointAndMatrix(center, targetMatrix);\n const frustum = currentScreenViewport.getWorldFrustum();\n frustum.multiply(worldTransform);\n currentScreenViewport.view.setupFromFrustum(frustum);\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\n }\n }\n };\n\n const handleDisconnectFromViewManager = () => {\n const screenViewport = screenViewportRef.current;\n if (screenViewport) {\n const viewManager = IModelApp.viewManager;\n screenViewport.onViewChanged.removeListener(handleViewChanged);\n screenViewportRef.current = null;\n screenViewportCreated.current = false;\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(handleDrawingViewportChangeEvent);\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(handleCubeRotationChangeEvent);\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(handleStandardRotationChangeEvent);\n viewManager.dropViewport(screenViewport, true);\n }\n };\n\n // istanbul ignore next\n const handleWindowUnload = () => {\n const parentDiv = viewportDiv.current;\n if (parentDiv) {\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n if (parentWindow !== window) {\n handleDisconnectFromViewManager();\n }\n }\n };\n\n const getScreenViewport = (parentDiv: HTMLDivElement, inViewState: ViewState) => {\n // istanbul ignore next\n const screenViewportFactory = screenViewportOverride ? screenViewportOverride : ScreenViewport;\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n parentWindow.addEventListener(\"unload\", handleWindowUnload, true); // listener clear after being called\n ViewportComponentEvents.initialize();\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(handleStandardRotationChangeEvent);\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\n screenViewportCreated.current = true;\n viewClassFullName.current = screenViewport.view.classFullName;\n viewId.current = screenViewport.view.id;\n screenViewport.onViewChanged.addListener(handleViewChanged);\n return screenViewport;\n };\n\n React.useEffect(() => {\n isMounted.current = true;\n Logger.logInfo(\"ViewportComponent\", `mounting ViewportComponent for controlId=${controlId}`);\n\n return () => {\n isMounted.current = false;\n Logger.logInfo(\"ViewportComponent\", `un-mounting ViewportComponent for controlId=${controlId}`);\n handleDisconnectFromViewManager();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [initialViewState, setInitialViewState] = React.useState<ViewState | undefined>(() => {\n if (viewState) {\n if (typeof viewState === \"function\")\n return viewState().clone();\n else\n return viewState.clone();\n }\n return undefined;\n });\n\n React.useEffect(() => {\n setInitialViewState(undefined);\n }, [viewDefinitionId, viewState]);\n React.useEffect(() => {\n async function fetchInitialViewstate() {\n let currentViewState: ViewState | undefined;\n if (viewState) {\n if (typeof viewState === \"function\")\n currentViewState = viewState();\n else\n currentViewState = viewState;\n } else if (viewDefinitionId && imodel) {\n try {\n currentViewState = await imodel.views.load(viewDefinitionId);\n // istanbul ignore next\n if (!currentViewState) {\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\n }\n } catch (_e) {\n // istanbul ignore next\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\n }\n } else {\n Logger.logError(\"ViewportComponent\", `A Viewstate or a viewId and imodel must be provided`);\n }\n // istanbul ignore next\n if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {\n setInitialViewState(currentViewState?.clone());\n }\n }\n if (undefined === initialViewState)\n fetchInitialViewstate(); // eslint-disable-line @typescript-eslint/no-floating-promises\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\n\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\n\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\n React.useEffect(() => {\n const parentDiv = viewportDiv.current;\n const viewManager = viewManagerRef.current;\n // istanbul ignore next\n if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {\n if (!screenViewportCreated.current) {\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\n screenViewportRef.current = screenViewport;\n\n if (viewportRef)\n viewportRef(screenViewport);\n\n Logger.logInfo(\"ViewportComponent\", `processing viewManager.addViewport for controlId=${controlId}`);\n viewManager.addViewport(screenViewport);\n\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\n } else {\n // istanbul ignore next\n screenViewportRef.current?.changeView(initialViewState);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [controlId, initialViewState, viewportRef]);\n\n const handleContextMenu = React.useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n if (onContextMenu)\n onContextMenu(e);\n }, [onContextMenu]);\n\n const parentDivStyle: React.CSSProperties = {\n height: \"100%\", width: \"100%\", position: \"relative\",\n };\n\n const viewportDivStyle: React.CSSProperties = {\n ...style,\n height: \"100%\", width: \"100%\",\n };\n\n return (\n <div style={parentDivStyle} data-item-id={controlId}\n >\n <>\n <div\n ref={viewportDiv}\n data-testid=\"viewport-component\"\n className={className}\n style={viewportDivStyle}\n onContextMenu={handleContextMenu}\n />\n {viewOverlay}\n </>\n </div>\n );\n}\n"]}
@@ -92,7 +92,6 @@ class ViewportComponentEvents {
92
92
  });
93
93
  }
94
94
  }
95
- exports.ViewportComponentEvents = ViewportComponentEvents;
96
95
  ViewportComponentEvents.face = Cube_1.Face.None;
97
96
  ViewportComponentEvents.origin = core_geometry_1.Point3d.createZero();
98
97
  ViewportComponentEvents.extents = core_geometry_1.Vector3d.createZero();
@@ -103,4 +102,5 @@ ViewportComponentEvents.onStandardRotationChangeEvent = new StandardRotationChan
103
102
  ViewportComponentEvents.onViewRotationChangeEvent = new ViewRotationChangeEvent();
104
103
  ViewportComponentEvents.onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();
105
104
  ViewportComponentEvents.onViewIdChangedEvent = new ViewIdChangedEvent();
105
+ exports.ViewportComponentEvents = ViewportComponentEvents;
106
106
  //# sourceMappingURL=ViewportComponentEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAmE;AACnE,wDAAwG;AACxG,0DAAgD;AAChD,iDAA8C;AAW9C;;GAEG;AACH,MAAa,0BAA2B,SAAQ,wBAAuC;CAAI;AAA3F,gEAA2F;AAW3F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AASrF;;GAEG;AACH,MAAa,2BAA4B,SAAQ,wBAAwC;CAAI;AAA7F,kEAA6F;AAU7F;;GAEG;AACH,MAAa,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C;IAEM,MAAM,CAAC,mBAAmB,CAAC,gBAAgC;QAChE,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAChE,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAkB,EAAE,aAAsB;QACpE,8CAA8C;QAC9C,UAAU,CAAC,GAAG,EAAE;YACd,uBAAuB;YACvB,IAAI,QAAQ,CAAC,IAAI,EAAE;gBACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;gBAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;aAClD;YACD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;;AA5DH,0DA6DC;AA3Ce,4BAAI,GAAG,WAAI,CAAC,IAAI,CAAC;AACR,8BAAM,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC9B,+BAAO,GAAG,wBAAQ,CAAC,UAAU,EAAE,CAAC;AAChC,sCAAc,GAAG,wBAAQ,CAAC,cAAc,EAAE,CAAC;AAC3C,oDAA4B,GAAG,IAAI,0BAA0B,EAAE,CAAC;AAChE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,qDAA6B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAClE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,uDAA+B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AACtE,4CAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport { IModelApp, SelectedViewportChangedArgs, StandardViewId, Viewport } from \"@itwin/core-frontend\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Face } from \"../navigationaids/Cube\";\n\n/** Arguments for [[DrawingViewportChangeEvent]]\n * @public\n */\nexport interface DrawingViewportChangeEventArgs {\n rotation: Matrix3d;\n origin: Point3d;\n complete: boolean;\n}\n\n/** Drawing View Change event\n * @public\n */\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> { }\n\n/** Arguments for [[CubeRotationChangeEvent]]\n * @public\n */\nexport interface CubeRotationChangeEventArgs {\n rotMatrix: Matrix3d;\n face: Face;\n complete?: boolean;\n}\n\n/** 3d Cube Rotation Change event\n * @public\n */\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> { }\n\n/** Arguments for [[StandardRotationChangeEvent]]\n * @public\n */\nexport interface StandardRotationChangeEventArgs {\n standardRotation: StandardViewId;\n}\n\n/** Standard Rotation Change event\n * @public\n */\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> { }\n\n/** Arguments for [[ViewRotationChangeEvent]]\n * @public\n */\nexport interface ViewRotationChangeEventArgs {\n viewport: Viewport;\n animationTime?: number;\n}\n\n/** View Rotation Change event\n * @public\n */\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> { }\n\n/** Arguments for [[ViewClassFullNameChangedEvent]]\n * @public\n */\nexport interface ViewClassFullNameChangedEventArgs {\n viewport: Viewport;\n oldName: string;\n newName: string;\n}\n\n/** View Class Full Name Change event\n * @public\n */\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> { }\n\n/** Arguments for [[ViewIdChangedEvent]]\n * @public\n */\nexport interface ViewIdChangedEventArgs {\n viewport: Viewport;\n oldId: string;\n newId: string;\n}\n\n/** View Id Change event\n * @public\n */\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> { }\n\n/** Viewport Rotation events and methods\n * @public\n */\nexport class ViewportComponentEvents {\n private static _removeListener?: () => void;\n\n public static initialize() {\n if (undefined !== this._removeListener)\n return;\n\n this._removeListener = IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);\n }\n\n /** @internal - for unit testing */\n public static terminate() {\n if (this._removeListener) {\n this._removeListener();\n this._removeListener = undefined;\n }\n }\n\n public static face = Face.None;\n public static readonly origin = Point3d.createZero();\n public static readonly extents = Vector3d.createZero();\n public static readonly rotationMatrix = Matrix3d.createIdentity();\n public static readonly onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();\n public static readonly onCubeRotationChangeEvent = new CubeRotationChangeEvent();\n public static readonly onStandardRotationChangeEvent = new StandardRotationChangeEvent();\n public static readonly onViewRotationChangeEvent = new ViewRotationChangeEvent();\n public static readonly onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\n\n private static handleSelectedViewportChanged(args: SelectedViewportChangedArgs): void {\n if (args.current)\n ViewportComponentEvents.setViewMatrix(args.current);\n }\n\n public static setCubeMatrix(rotMatrix: Matrix3d, face = Face.None, complete: boolean = false): void {\n this.rotationMatrix.setFrom(rotMatrix);\n this.face = face;\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\n }\n\n public static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete: boolean = false): void {\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\n }\n\n public static setStandardRotation(standardRotation: StandardViewId): void {\n this.onStandardRotationChangeEvent.emit({ standardRotation });\n }\n\n public static setViewMatrix(viewport: Viewport, animationTime?: number): void {\n // When handling onViewChanged, use setTimeout\n setTimeout(() => {\n // istanbul ignore next\n if (viewport.view) {\n this.origin.setFrom(viewport.view.getOrigin());\n this.extents.setFrom(viewport.view.getExtents());\n }\n this.rotationMatrix.setFrom(viewport.rotation);\n\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAmE;AACnE,wDAAwG;AACxG,0DAAgD;AAChD,iDAA8C;AAW9C;;GAEG;AACH,MAAa,0BAA2B,SAAQ,wBAAuC;CAAI;AAA3F,gEAA2F;AAW3F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AASrF;;GAEG;AACH,MAAa,2BAA4B,SAAQ,wBAAwC;CAAI;AAA7F,kEAA6F;AAU7F;;GAEG;AACH,MAAa,uBAAwB,SAAQ,wBAAoC;CAAI;AAArF,0DAAqF;AAWrF;;GAEG;AACH,MAAa,6BAA8B,SAAQ,wBAA0C;CAAI;AAAjG,sEAAiG;AAWjG;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAA+B;CAAI;AAA3E,gDAA2E;AAE3E;;GAEG;AACH,MAAa,uBAAuB;IAG3B,MAAM,CAAC,UAAU;QACtB,IAAI,SAAS,KAAK,IAAI,CAAC,eAAe;YACpC,OAAO;QAET,IAAI,CAAC,eAAe,GAAG,yBAAS,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,uBAAuB,CAAC,6BAA6B,CAAC,CAAC;IAC5I,CAAC;IAED,mCAAmC;IAC5B,MAAM,CAAC,SAAS;QACrB,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;SAClC;IACH,CAAC;IAaO,MAAM,CAAC,6BAA6B,CAAC,IAAiC;QAC5E,I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CAAC,CAAC;IACL,CAAC;;AA1Ca,4BAAI,GAAG,WAAI,CAAC,IAAI,CAAC;AACR,8BAAM,GAAG,uBAAO,CAAC,UAAU,EAAE,CAAC;AAC9B,+BAAO,GAAG,wBAAQ,CAAC,UAAU,EAAE,CAAC;AAChC,sCAAc,GAAG,wBAAQ,CAAC,cAAc,EAAE,CAAC;AAC3C,oDAA4B,GAAG,IAAI,0BAA0B,EAAE,CAAC;AAChE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,qDAA6B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAClE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,uDAA+B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AACtE,4CAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AA3B5D,0DAAuB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport { IModelApp, SelectedViewportChangedArgs, StandardViewId, Viewport } from \"@itwin/core-frontend\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Face } from \"../navigationaids/Cube\";\n\n/** Arguments for [[DrawingViewportChangeEvent]]\n * @public\n */\nexport interface DrawingViewportChangeEventArgs {\n rotation: Matrix3d;\n origin: Point3d;\n complete: boolean;\n}\n\n/** Drawing View Change event\n * @public\n */\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> { }\n\n/** Arguments for [[CubeRotationChangeEvent]]\n * @public\n */\nexport interface CubeRotationChangeEventArgs {\n rotMatrix: Matrix3d;\n face: Face;\n complete?: boolean;\n}\n\n/** 3d Cube Rotation Change event\n * @public\n */\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> { }\n\n/** Arguments for [[StandardRotationChangeEvent]]\n * @public\n */\nexport interface StandardRotationChangeEventArgs {\n standardRotation: StandardViewId;\n}\n\n/** Standard Rotation Change event\n * @public\n */\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> { }\n\n/** Arguments for [[ViewRotationChangeEvent]]\n * @public\n */\nexport interface ViewRotationChangeEventArgs {\n viewport: Viewport;\n animationTime?: number;\n}\n\n/** View Rotation Change event\n * @public\n */\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> { }\n\n/** Arguments for [[ViewClassFullNameChangedEvent]]\n * @public\n */\nexport interface ViewClassFullNameChangedEventArgs {\n viewport: Viewport;\n oldName: string;\n newName: string;\n}\n\n/** View Class Full Name Change event\n * @public\n */\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> { }\n\n/** Arguments for [[ViewIdChangedEvent]]\n * @public\n */\nexport interface ViewIdChangedEventArgs {\n viewport: Viewport;\n oldId: string;\n newId: string;\n}\n\n/** View Id Change event\n * @public\n */\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> { }\n\n/** Viewport Rotation events and methods\n * @public\n */\nexport class ViewportComponentEvents {\n private static _removeListener?: () => void;\n\n public static initialize() {\n if (undefined !== this._removeListener)\n return;\n\n this._removeListener = IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);\n }\n\n /** @internal - for unit testing */\n public static terminate() {\n if (this._removeListener) {\n this._removeListener();\n this._removeListener = undefined;\n }\n }\n\n public static face = Face.None;\n public static readonly origin = Point3d.createZero();\n public static readonly extents = Vector3d.createZero();\n public static readonly rotationMatrix = Matrix3d.createIdentity();\n public static readonly onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();\n public static readonly onCubeRotationChangeEvent = new CubeRotationChangeEvent();\n public static readonly onStandardRotationChangeEvent = new StandardRotationChangeEvent();\n public static readonly onViewRotationChangeEvent = new ViewRotationChangeEvent();\n public static readonly onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\n\n private static handleSelectedViewportChanged(args: SelectedViewportChangedArgs): void {\n if (args.current)\n ViewportComponentEvents.setViewMatrix(args.current);\n }\n\n public static setCubeMatrix(rotMatrix: Matrix3d, face = Face.None, complete: boolean = false): void {\n this.rotationMatrix.setFrom(rotMatrix);\n this.face = face;\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\n }\n\n public static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete: boolean = false): void {\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\n }\n\n public static setStandardRotation(standardRotation: StandardViewId): void {\n this.onStandardRotationChangeEvent.emit({ standardRotation });\n }\n\n public static setViewMatrix(viewport: Viewport, animationTime?: number): void {\n // When handling onViewChanged, use setTimeout\n setTimeout(() => {\n // istanbul ignore next\n if (viewport.view) {\n this.origin.setFrom(viewport.view.getOrigin());\n this.extents.setFrom(viewport.view.getExtents());\n }\n this.rotationMatrix.setFrom(viewport.rotation);\n\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\n });\n }\n}\n"]}
@@ -2,7 +2,6 @@ export { UiIModelComponents } from "./imodel-components-react/UiIModelComponents
2
2
  export * from "./imodel-components-react/color/AlphaSlider";
3
3
  export * from "./imodel-components-react/color/ColorPickerButton";
4
4
  export * from "./imodel-components-react/color/ColorPickerDialog";
5
- export * from "./imodel-components-react/color/ColorPickerPanel";
6
5
  export * from "./imodel-components-react/color/ColorPickerPopup";
7
6
  export * from "./imodel-components-react/color/getCSSColorFromDef";
8
7
  export * from "./imodel-components-react/color/HueSlider";
@@ -1 +1 @@
1
- {"version":3,"file":"imodel-components-react.d.ts","sourceRoot":"","sources":["../../src/imodel-components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kDAAkD,CAAC;AACjE,cAAc,wCAAwC,CAAC;AAEvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sDAAsD,CAAC;AAErE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yDAAyD,CAAC;AAExE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,+DAA+D,CAAC;AAE9E,cAAc,sDAAsD,CAAC;AACrE,cAAc,0DAA0D,CAAC;AACzE,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AACpE,cAAc,0DAA0D,CAAC;AACzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8DAA8D,CAAC;AAE7E,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,0DAA0D,CAAC;AAEzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAE3E;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
1
+ {"version":3,"file":"imodel-components-react.d.ts","sourceRoot":"","sources":["../../src/imodel-components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kDAAkD,CAAC;AACjE,cAAc,wCAAwC,CAAC;AAEvD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sDAAsD,CAAC;AAErE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yDAAyD,CAAC;AAExE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,+DAA+D,CAAC;AAE9E,cAAc,sDAAsD,CAAC;AACrE,cAAc,0DAA0D,CAAC;AACzE,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AACpE,cAAc,0DAA0D,CAAC;AACzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8DAA8D,CAAC;AAE7E,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,0DAA0D,CAAC;AAEzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAE3E;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
@@ -5,7 +5,11 @@
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
7
  if (k2 === undefined) k2 = k;
8
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
9
13
  }) : (function(o, m, k, k2) {
10
14
  if (k2 === undefined) k2 = k;
11
15
  o[k2] = m[k];
@@ -21,7 +25,6 @@ Object.defineProperty(exports, "UiIModelComponents", { enumerable: true, get: fu
21
25
  __exportStar(require("./imodel-components-react/color/AlphaSlider"), exports);
22
26
  __exportStar(require("./imodel-components-react/color/ColorPickerButton"), exports);
23
27
  __exportStar(require("./imodel-components-react/color/ColorPickerDialog"), exports);
24
- __exportStar(require("./imodel-components-react/color/ColorPickerPanel"), exports);
25
28
  __exportStar(require("./imodel-components-react/color/ColorPickerPopup"), exports);
26
29
  __exportStar(require("./imodel-components-react/color/getCSSColorFromDef"), exports);
27
30
  __exportStar(require("./imodel-components-react/color/HueSlider"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../../src/imodel-components-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;AAE/F,qEAAqE;AAErE,mFAAkF;AAAzE,wHAAA,kBAAkB,OAAA;AAE3B,8EAA4D;AAC5D,oFAAkE;AAClE,oFAAkE;AAClE,mFAAiE;AACjE,mFAAiE;AACjE,qFAAmE;AACnE,4EAA0D;AAC1D,mFAAiE;AACjE,yEAAuD;AAEvD,gFAA8D;AAC9D,iFAA+D;AAE/D,iFAA+D;AAC/D,uFAAqE;AAErE,8EAA4D;AAC5D,0FAAwE;AAExE,gFAA8D;AAC9D,6FAA2E;AAC3E,gGAA8E;AAE9E,uFAAqE;AACrE,2FAAyE;AACzE,wFAAsE;AACtE,sFAAoE;AACpE,2FAAyE;AACzE,uFAAqE;AACrE,6FAA2E;AAC3E,+FAA6E;AAE7E,gFAA8D;AAC9D,8FAA4E;AAC5E,gFAA8D;AAC9D,kFAAgE;AAChE,8EAA4D;AAC5D,uFAAqE;AACrE,mFAAiE;AACjE,2FAAyE;AAEzE,uFAAqE;AACrE,6FAA2E;AAE3E;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents\";\n\nexport * from \"./imodel-components-react/color/AlphaSlider\";\nexport * from \"./imodel-components-react/color/ColorPickerButton\";\nexport * from \"./imodel-components-react/color/ColorPickerDialog\";\nexport * from \"./imodel-components-react/color/ColorPickerPanel\";\nexport * from \"./imodel-components-react/color/ColorPickerPopup\";\nexport * from \"./imodel-components-react/color/getCSSColorFromDef\";\nexport * from \"./imodel-components-react/color/HueSlider\";\nexport * from \"./imodel-components-react/color/SaturationPicker\";\nexport * from \"./imodel-components-react/color/Swatch\";\n\nexport * from \"./imodel-components-react/editors/ColorEditor\";\nexport * from \"./imodel-components-react/editors/WeightEditor\";\n\nexport * from \"./imodel-components-react/inputs/QuantityInput\";\nexport * from \"./imodel-components-react/inputs/QuantityNumberInput\";\n\nexport * from \"./imodel-components-react/lineweight/Swatch\";\nexport * from \"./imodel-components-react/lineweight/WeightPickerButton\";\n\nexport * from \"./imodel-components-react/navigationaids/Cube\";\nexport * from \"./imodel-components-react/navigationaids/CubeNavigationAid\";\nexport * from \"./imodel-components-react/navigationaids/DrawingNavigationAid\";\n\nexport * from \"./imodel-components-react/quantityformat/FormatPanel\";\nexport * from \"./imodel-components-react/quantityformat/FormatPrecision\";\nexport * from \"./imodel-components-react/quantityformat/FormatSample\";\nexport * from \"./imodel-components-react/quantityformat/FormatType\";\nexport * from \"./imodel-components-react/quantityformat/FormatUnitLabel\";\nexport * from \"./imodel-components-react/quantityformat/FormatUnits\";\nexport * from \"./imodel-components-react/quantityformat/MiscFormatOptions\";\nexport * from \"./imodel-components-react/quantityformat/QuantityFormatPanel\";\n\nexport * from \"./imodel-components-react/timeline/interfaces\";\nexport * from \"./imodel-components-react/timeline/BaseTimelineDataProvider\";\nexport * from \"./imodel-components-react/timeline/InlineEdit\";\nexport * from \"./imodel-components-react/timeline/PlayerButton\";\nexport * from \"./imodel-components-react/timeline/Scrubber\";\nexport * from \"./imodel-components-react/timeline/TimelineComponent\";\nexport * from \"./imodel-components-react/timeline/SolarTimeline\";\nexport * from \"./imodel-components-react/timeline/BaseSolarDataProvider\";\n\nexport * from \"./imodel-components-react/viewport/ViewportComponent\";\nexport * from \"./imodel-components-react/viewport/ViewportComponentEvents\";\n\n/** @docs-package-description\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\n * For more information, see [learning about imodel-components-react]($docs/learning/ui/imodel-components/index.md).\n */\n/**\n * @docs-group-description Color\n * Classes and components for working with and picking a Color.\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Cube\n * Component for 3D Cube.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input for IModelApps.\n */\n/**\n * @docs-group-description LineWeight\n * Classes and components for working with and picking a Line Weight.\n */\n/**\n * @docs-group-description NavigationAids\n * Classes and components for working with Navigation Aids.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description QuantityFormat\n * Classes and components for working with a Quantity Formats.\n */\n/**\n * @docs-group-description Timeline\n * Classes and components that provide a timeline\n */\n/**\n * @docs-group-description Viewport\n * Classes and components for working with a Viewport.\n */\n"]}
1
+ {"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../../src/imodel-components-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,qEAAqE;AAErE,mFAAkF;AAAzE,wHAAA,kBAAkB,OAAA;AAE3B,8EAA4D;AAC5D,oFAAkE;AAClE,oFAAkE;AAClE,mFAAiE;AACjE,qFAAmE;AACnE,4EAA0D;AAC1D,mFAAiE;AACjE,yEAAuD;AAEvD,gFAA8D;AAC9D,iFAA+D;AAE/D,iFAA+D;AAC/D,uFAAqE;AAErE,8EAA4D;AAC5D,0FAAwE;AAExE,gFAA8D;AAC9D,6FAA2E;AAC3E,gGAA8E;AAE9E,uFAAqE;AACrE,2FAAyE;AACzE,wFAAsE;AACtE,sFAAoE;AACpE,2FAAyE;AACzE,uFAAqE;AACrE,6FAA2E;AAC3E,+FAA6E;AAE7E,gFAA8D;AAC9D,8FAA4E;AAC5E,gFAA8D;AAC9D,kFAAgE;AAChE,8EAA4D;AAC5D,uFAAqE;AACrE,mFAAiE;AACjE,2FAAyE;AAEzE,uFAAqE;AACrE,6FAA2E;AAE3E;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents\";\n\nexport * from \"./imodel-components-react/color/AlphaSlider\";\nexport * from \"./imodel-components-react/color/ColorPickerButton\";\nexport * from \"./imodel-components-react/color/ColorPickerDialog\";\nexport * from \"./imodel-components-react/color/ColorPickerPopup\";\nexport * from \"./imodel-components-react/color/getCSSColorFromDef\";\nexport * from \"./imodel-components-react/color/HueSlider\";\nexport * from \"./imodel-components-react/color/SaturationPicker\";\nexport * from \"./imodel-components-react/color/Swatch\";\n\nexport * from \"./imodel-components-react/editors/ColorEditor\";\nexport * from \"./imodel-components-react/editors/WeightEditor\";\n\nexport * from \"./imodel-components-react/inputs/QuantityInput\";\nexport * from \"./imodel-components-react/inputs/QuantityNumberInput\";\n\nexport * from \"./imodel-components-react/lineweight/Swatch\";\nexport * from \"./imodel-components-react/lineweight/WeightPickerButton\";\n\nexport * from \"./imodel-components-react/navigationaids/Cube\";\nexport * from \"./imodel-components-react/navigationaids/CubeNavigationAid\";\nexport * from \"./imodel-components-react/navigationaids/DrawingNavigationAid\";\n\nexport * from \"./imodel-components-react/quantityformat/FormatPanel\";\nexport * from \"./imodel-components-react/quantityformat/FormatPrecision\";\nexport * from \"./imodel-components-react/quantityformat/FormatSample\";\nexport * from \"./imodel-components-react/quantityformat/FormatType\";\nexport * from \"./imodel-components-react/quantityformat/FormatUnitLabel\";\nexport * from \"./imodel-components-react/quantityformat/FormatUnits\";\nexport * from \"./imodel-components-react/quantityformat/MiscFormatOptions\";\nexport * from \"./imodel-components-react/quantityformat/QuantityFormatPanel\";\n\nexport * from \"./imodel-components-react/timeline/interfaces\";\nexport * from \"./imodel-components-react/timeline/BaseTimelineDataProvider\";\nexport * from \"./imodel-components-react/timeline/InlineEdit\";\nexport * from \"./imodel-components-react/timeline/PlayerButton\";\nexport * from \"./imodel-components-react/timeline/Scrubber\";\nexport * from \"./imodel-components-react/timeline/TimelineComponent\";\nexport * from \"./imodel-components-react/timeline/SolarTimeline\";\nexport * from \"./imodel-components-react/timeline/BaseSolarDataProvider\";\n\nexport * from \"./imodel-components-react/viewport/ViewportComponent\";\nexport * from \"./imodel-components-react/viewport/ViewportComponentEvents\";\n\n/** @docs-package-description\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\n * For more information, see [learning about imodel-components-react]($docs/learning/ui/imodel-components/index.md).\n */\n/**\n * @docs-group-description Color\n * Classes and components for working with and picking a Color.\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Cube\n * Component for 3D Cube.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input for IModelApps.\n */\n/**\n * @docs-group-description LineWeight\n * Classes and components for working with and picking a Line Weight.\n */\n/**\n * @docs-group-description NavigationAids\n * Classes and components for working with Navigation Aids.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description QuantityFormat\n * Classes and components for working with a Quantity Formats.\n */\n/**\n * @docs-group-description Timeline\n * Classes and components that provide a timeline\n */\n/**\n * @docs-group-description Viewport\n * Classes and components for working with a Viewport.\n */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiIModelComponents.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAIA;;GAEG;AASH;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;OAEG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB/C,gEAAgE;WAClD,SAAS;IAMvB,4DAA4D;IAC5D,WAAkB,WAAW,IAAI,OAAO,CAA4C;IAEpF,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,gBAAgB;IAChB,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAQvD,gBAAgB;WACF,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;CAM/C"}
1
+ {"version":3,"file":"UiIModelComponents.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAIA;;GAEG;AAQH;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IAEpC;;OAEG;WACiB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB/C,gEAAgE;WAClD,SAAS;IAMvB,4DAA4D;IAC5D,WAAkB,WAAW,IAAI,OAAO,CAA4C;IAEpF,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;IAED,gBAAgB;IAChB,WAAkB,WAAW,IAAI,MAAM,CAEtC;IAED;;OAEG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAQvD,gBAAgB;WACF,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;CAM/C"}
@@ -5,7 +5,6 @@
5
5
  /** @packageDocumentation
6
6
  * @module Common
7
7
  */
8
- import { enablePatches } from "immer";
9
8
  import { Logger } from "@itwin/core-bentley";
10
9
  import { IModelApp } from "@itwin/core-frontend";
11
10
  import { getClassName } from "@itwin/appui-abstract";
@@ -15,18 +14,16 @@ import { EmptyLocalization } from "@itwin/core-common";
15
14
  * Manages the localization service for the imodel-components-react package.
16
15
  * @public
17
16
  */
18
- export class UiIModelComponents {
17
+ class UiIModelComponents {
19
18
  /**
20
19
  * initialize UiIModelComponents.
21
20
  */
22
21
  static async initialize() {
23
- var _a;
24
22
  if (UiIModelComponents._initialized) {
25
23
  Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);
26
24
  return;
27
25
  }
28
- enablePatches();
29
- await ((_a = IModelApp.localization) === null || _a === void 0 ? void 0 : _a.registerNamespace(UiIModelComponents.localizationNamespace));
26
+ await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);
30
27
  if (!IModelApp.localization) {
31
28
  // it should only get here in unit test where IModelApp is not setup
32
29
  const localization = new EmptyLocalization();
@@ -40,8 +37,7 @@ export class UiIModelComponents {
40
37
  }
41
38
  /** Unregisters the UiIModelComponents localization namespace */
42
39
  static terminate() {
43
- var _a;
44
- (_a = IModelApp.localization) === null || _a === void 0 ? void 0 : _a.unregisterNamespace(UiIModelComponents.localizationNamespace);
40
+ IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);
45
41
  UiComponents.terminate();
46
42
  UiIModelComponents._initialized = false;
47
43
  }
@@ -73,4 +69,5 @@ export class UiIModelComponents {
73
69
  }
74
70
  }
75
71
  UiIModelComponents._initialized = false;
72
+ export { UiIModelComponents };
76
73
  //# sourceMappingURL=UiIModelComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE;YACnC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,8CAA8C,CAAC,CAAC;YACtH,OAAO;SACR;QAED,aAAa,EAAE,CAAC;QAChB,MAAM,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA,CAAC;QAE1F,IAAI,CAAC,SAAS,CAAC,YAAY,EA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SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA9Dc,+BAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport { enablePatches } from \"immer\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { getClassName } from \"@itwin/appui-abstract\";\nimport { UiComponents } from \"@itwin/components-react\";\nimport { EmptyLocalization } from \"@itwin/core-common\";\n\n/**\n * Manages the localization service for the imodel-components-react package.\n * @public\n */\nexport class UiIModelComponents {\n private static _initialized = false;\n\n /**\n * initialize UiIModelComponents.\n */\n public static async initialize(): Promise<void> {\n if (UiIModelComponents._initialized) {\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\n return;\n }\n\n enablePatches();\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\n\n if (!IModelApp.localization) {\n // it should only get here in unit test where IModelApp is not setup\n const localization = new EmptyLocalization();\n await localization.initialize();\n await UiComponents.initialize(localization);\n } else {\n await UiComponents.initialize(IModelApp.localization);\n }\n\n UiIModelComponents._initialized = true;\n }\n\n /** Unregisters the UiIModelComponents localization namespace */\n public static terminate() {\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\n UiComponents.terminate();\n UiIModelComponents._initialized = false;\n }\n\n /** Determines if UiIModelComponents has been initialized */\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiIModelComponents\";\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"imodel-components-react\";\n }\n\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\n return \"\";\n }\n return IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });\n }\n\n /** @internal */\n public static loggerCategory(obj: any): string {\n const className = getClassName(obj);\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\n return category;\n }\n\n}\n"]}
1
+ {"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAa,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE;YACnC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,8CAA8C,CAAC,CAAC;YACtH,OAAO;SACR;QAED,MAAM,SAAS,CAAC,YAAY,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;QAE1F,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC3B,oEAAoE;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G,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA7Dc,+BAAY,GAAG,KAAK,CAAC;SADzB,kBAAkB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Common\n */\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { getClassName } from \"@itwin/appui-abstract\";\nimport { UiComponents } from \"@itwin/components-react\";\nimport { EmptyLocalization } from \"@itwin/core-common\";\n\n/**\n * Manages the localization service for the imodel-components-react package.\n * @public\n */\nexport class UiIModelComponents {\n private static _initialized = false;\n\n /**\n * initialize UiIModelComponents.\n */\n public static async initialize(): Promise<void> {\n if (UiIModelComponents._initialized) {\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\n return;\n }\n\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\n\n if (!IModelApp.localization) {\n // it should only get here in unit test where IModelApp is not setup\n const localization = new EmptyLocalization();\n await localization.initialize();\n await UiComponents.initialize(localization);\n } else {\n await UiComponents.initialize(IModelApp.localization);\n }\n\n UiIModelComponents._initialized = true;\n }\n\n /** Unregisters the UiIModelComponents localization namespace */\n public static terminate() {\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\n UiComponents.terminate();\n UiIModelComponents._initialized = false;\n }\n\n /** Determines if UiIModelComponents has been initialized */\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiIModelComponents\";\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"imodel-components-react\";\n }\n\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\n return \"\";\n }\n return IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });\n }\n\n /** @internal */\n public static loggerCategory(obj: any): string {\n const className = getClassName(obj);\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\n return category;\n }\n\n}\n"]}
@@ -5,7 +5,7 @@ import "./AlphaSlider.scss";
5
5
  import * as React from "react";
6
6
  import { CommonProps } from "@itwin/core-react";
7
7
  /** Properties for the [[AlphaSlider]] React component
8
- * @beta
8
+ * @public
9
9
  */
10
10
  export interface AlphaSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
11
11
  /** true if slider is oriented horizontal, else vertical orientation is assumed */
@@ -16,7 +16,7 @@ export interface AlphaSliderProps extends React.HTMLAttributes<HTMLDivElement>,
16
16
  alpha: number;
17
17
  }
18
18
  /** AlphaSlider component used to set the alpha value.
19
- * @beta
19
+ * @public
20
20
  */
21
21
  export declare class AlphaSlider extends React.PureComponent<AlphaSliderProps> {
22
22
  private _container;
@@ -11,7 +11,7 @@ import * as React from "react";
11
11
  import { UiIModelComponents } from "../UiIModelComponents";
12
12
  import { SpecialKey } from "@itwin/appui-abstract";
13
13
  /** AlphaSlider component used to set the alpha value.
14
- * @beta
14
+ * @public
15
15
  */
16
16
  export class AlphaSlider extends React.PureComponent {
17
17
  /** @internal */