@itwin/core-frontend 3.0.0-dev.181 → 3.0.0-dev.185

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 (276) hide show
  1. package/CHANGELOG.md +89 -1
  2. package/lib/cjs/ApproximateTerrainHeights.d.ts.map +1 -1
  3. package/lib/cjs/ApproximateTerrainHeights.js +6 -2
  4. package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
  5. package/lib/cjs/BackgroundMapGeometry.d.ts +1 -1
  6. package/lib/cjs/BackgroundMapGeometry.d.ts.map +1 -1
  7. package/lib/cjs/BackgroundMapGeometry.js +2 -2
  8. package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
  9. package/lib/cjs/BingLocation.js +2 -2
  10. package/lib/cjs/BingLocation.js.map +1 -1
  11. package/lib/cjs/DisplayStyleState.d.ts +9 -3
  12. package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
  13. package/lib/cjs/DisplayStyleState.js +66 -41
  14. package/lib/cjs/DisplayStyleState.js.map +1 -1
  15. package/lib/cjs/FrontendLoggerCategory.d.ts +2 -8
  16. package/lib/cjs/FrontendLoggerCategory.d.ts.map +1 -1
  17. package/lib/cjs/FrontendLoggerCategory.js +2 -8
  18. package/lib/cjs/FrontendLoggerCategory.js.map +1 -1
  19. package/lib/cjs/ImageUtil.d.ts +3 -3
  20. package/lib/cjs/ImageUtil.js +3 -3
  21. package/lib/cjs/ImageUtil.js.map +1 -1
  22. package/lib/cjs/NativeApp.d.ts +1 -1
  23. package/lib/cjs/NativeApp.d.ts.map +1 -1
  24. package/lib/cjs/NativeApp.js +3 -3
  25. package/lib/cjs/NativeApp.js.map +1 -1
  26. package/lib/cjs/NoRenderApp.d.ts +0 -1
  27. package/lib/cjs/NoRenderApp.d.ts.map +1 -1
  28. package/lib/cjs/NoRenderApp.js +0 -1
  29. package/lib/cjs/NoRenderApp.js.map +1 -1
  30. package/lib/cjs/NotificationManager.d.ts +3 -1
  31. package/lib/cjs/NotificationManager.d.ts.map +1 -1
  32. package/lib/cjs/NotificationManager.js +2 -0
  33. package/lib/cjs/NotificationManager.js.map +1 -1
  34. package/lib/cjs/RealityDataSource.js +11 -6
  35. package/lib/cjs/RealityDataSource.js.map +1 -1
  36. package/lib/cjs/SheetViewState.js +2 -2
  37. package/lib/cjs/SheetViewState.js.map +1 -1
  38. package/lib/cjs/ViewContext.js.map +1 -1
  39. package/lib/cjs/ViewCreator2d.js +1 -1
  40. package/lib/cjs/ViewCreator2d.js.map +1 -1
  41. package/lib/cjs/ViewCreator3d.d.ts +1 -1
  42. package/lib/cjs/ViewCreator3d.d.ts.map +1 -1
  43. package/lib/cjs/ViewCreator3d.js +2 -2
  44. package/lib/cjs/ViewCreator3d.js.map +1 -1
  45. package/lib/cjs/ViewingSpace.js +1 -1
  46. package/lib/cjs/ViewingSpace.js.map +1 -1
  47. package/lib/cjs/Viewport.d.ts +27 -2
  48. package/lib/cjs/Viewport.d.ts.map +1 -1
  49. package/lib/cjs/Viewport.js +12 -2
  50. package/lib/cjs/Viewport.js.map +1 -1
  51. package/lib/cjs/core-frontend.d.ts +4 -0
  52. package/lib/cjs/core-frontend.d.ts.map +1 -1
  53. package/lib/cjs/core-frontend.js +4 -0
  54. package/lib/cjs/core-frontend.js.map +1 -1
  55. package/lib/cjs/render/GraphicBuilder.d.ts +6 -0
  56. package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
  57. package/lib/cjs/render/GraphicBuilder.js.map +1 -1
  58. package/lib/cjs/render/RenderTarget.d.ts +3 -2
  59. package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
  60. package/lib/cjs/render/RenderTarget.js +2 -1
  61. package/lib/cjs/render/RenderTarget.js.map +1 -1
  62. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
  63. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
  64. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js +2 -1
  65. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  66. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
  67. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js +1 -0
  68. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  69. package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
  70. package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
  71. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js +3 -3
  72. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  73. package/lib/cjs/render/webgl/BranchUniforms.d.ts.map +1 -1
  74. package/lib/cjs/render/webgl/BranchUniforms.js +8 -5
  75. package/lib/cjs/render/webgl/BranchUniforms.js.map +1 -1
  76. package/lib/cjs/render/webgl/SolarShadowMap.js +1 -1
  77. package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
  78. package/lib/cjs/render/webgl/System.d.ts +1 -1
  79. package/lib/cjs/render/webgl/Target.d.ts +2 -1
  80. package/lib/cjs/render/webgl/Target.d.ts.map +1 -1
  81. package/lib/cjs/render/webgl/Target.js +63 -1
  82. package/lib/cjs/render/webgl/Target.js.map +1 -1
  83. package/lib/cjs/request/Request.d.ts +167 -0
  84. package/lib/cjs/request/Request.d.ts.map +1 -0
  85. package/lib/cjs/request/Request.js +315 -0
  86. package/lib/cjs/request/Request.js.map +1 -0
  87. package/lib/cjs/tile/internal.d.ts +1 -0
  88. package/lib/cjs/tile/internal.d.ts.map +1 -1
  89. package/lib/cjs/tile/internal.js +1 -0
  90. package/lib/cjs/tile/internal.js.map +1 -1
  91. package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -1
  92. package/lib/cjs/tile/map/ArcGISTileMap.js +6 -2
  93. package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
  94. package/lib/cjs/tile/map/ArcGisTokenGenerator.js +3 -3
  95. package/lib/cjs/tile/map/ArcGisTokenGenerator.js.map +1 -1
  96. package/lib/cjs/tile/map/ArcGisUtilities.d.ts +1 -1
  97. package/lib/cjs/tile/map/ArcGisUtilities.d.ts.map +1 -1
  98. package/lib/cjs/tile/map/ArcGisUtilities.js +18 -10
  99. package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
  100. package/lib/cjs/tile/map/BingElevation.js +4 -4
  101. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  102. package/lib/cjs/tile/map/CesiumTerrainProvider.js +3 -3
  103. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  104. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +4 -4
  105. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  106. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
  107. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  108. package/lib/cjs/tile/map/MapLayerAuthentication.d.ts +20 -0
  109. package/lib/cjs/tile/map/MapLayerAuthentication.d.ts.map +1 -0
  110. package/lib/cjs/tile/map/MapLayerAuthentication.js +18 -0
  111. package/lib/cjs/tile/map/MapLayerAuthentication.js.map +1 -0
  112. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +6 -3
  113. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  114. package/lib/cjs/tile/map/MapLayerFormatRegistry.js +3 -1
  115. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  116. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +2 -2
  117. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  118. package/lib/cjs/tile/map/MapLayerImageryFormats.js +4 -2
  119. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  120. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +2 -2
  121. package/lib/cjs/tile/map/MapLayerImageryProvider.js +5 -5
  122. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  123. package/lib/cjs/tile/map/MapLayerSources.d.ts +3 -1
  124. package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
  125. package/lib/cjs/tile/map/MapLayerSources.js +5 -3
  126. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  127. package/lib/cjs/tile/map/MapTileLoader.js +2 -2
  128. package/lib/cjs/tile/map/MapTileLoader.js.map +1 -1
  129. package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +1 -1
  130. package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
  131. package/lib/cjs/tile/map/WmsCapabilities.d.ts +1 -1
  132. package/lib/cjs/tile/map/WmsCapabilities.js +2 -2
  133. package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
  134. package/lib/cjs/tile/map/WmtsCapabilities.d.ts +1 -1
  135. package/lib/cjs/tile/map/WmtsCapabilities.js +2 -2
  136. package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
  137. package/lib/cjs/tools/ViewTool.js +1 -1
  138. package/lib/cjs/tools/ViewTool.js.map +1 -1
  139. package/lib/esm/ApproximateTerrainHeights.d.ts.map +1 -1
  140. package/lib/esm/ApproximateTerrainHeights.js +6 -2
  141. package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
  142. package/lib/esm/BackgroundMapGeometry.d.ts +1 -1
  143. package/lib/esm/BackgroundMapGeometry.d.ts.map +1 -1
  144. package/lib/esm/BackgroundMapGeometry.js +2 -2
  145. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  146. package/lib/esm/BingLocation.js +1 -1
  147. package/lib/esm/BingLocation.js.map +1 -1
  148. package/lib/esm/DisplayStyleState.d.ts +9 -3
  149. package/lib/esm/DisplayStyleState.d.ts.map +1 -1
  150. package/lib/esm/DisplayStyleState.js +66 -41
  151. package/lib/esm/DisplayStyleState.js.map +1 -1
  152. package/lib/esm/FrontendLoggerCategory.d.ts +2 -8
  153. package/lib/esm/FrontendLoggerCategory.d.ts.map +1 -1
  154. package/lib/esm/FrontendLoggerCategory.js +2 -8
  155. package/lib/esm/FrontendLoggerCategory.js.map +1 -1
  156. package/lib/esm/ImageUtil.d.ts +3 -3
  157. package/lib/esm/ImageUtil.js +3 -3
  158. package/lib/esm/ImageUtil.js.map +1 -1
  159. package/lib/esm/NativeApp.d.ts +1 -1
  160. package/lib/esm/NativeApp.d.ts.map +1 -1
  161. package/lib/esm/NativeApp.js +1 -1
  162. package/lib/esm/NativeApp.js.map +1 -1
  163. package/lib/esm/NoRenderApp.d.ts +0 -1
  164. package/lib/esm/NoRenderApp.d.ts.map +1 -1
  165. package/lib/esm/NoRenderApp.js +0 -1
  166. package/lib/esm/NoRenderApp.js.map +1 -1
  167. package/lib/esm/NotificationManager.d.ts +3 -1
  168. package/lib/esm/NotificationManager.d.ts.map +1 -1
  169. package/lib/esm/NotificationManager.js +2 -0
  170. package/lib/esm/NotificationManager.js.map +1 -1
  171. package/lib/esm/RealityDataSource.js +9 -4
  172. package/lib/esm/RealityDataSource.js.map +1 -1
  173. package/lib/esm/SheetViewState.js +2 -2
  174. package/lib/esm/SheetViewState.js.map +1 -1
  175. package/lib/esm/ViewContext.js.map +1 -1
  176. package/lib/esm/ViewCreator2d.js +1 -1
  177. package/lib/esm/ViewCreator2d.js.map +1 -1
  178. package/lib/esm/ViewCreator3d.d.ts +1 -1
  179. package/lib/esm/ViewCreator3d.d.ts.map +1 -1
  180. package/lib/esm/ViewCreator3d.js +2 -2
  181. package/lib/esm/ViewCreator3d.js.map +1 -1
  182. package/lib/esm/ViewingSpace.js +1 -1
  183. package/lib/esm/ViewingSpace.js.map +1 -1
  184. package/lib/esm/Viewport.d.ts +27 -2
  185. package/lib/esm/Viewport.d.ts.map +1 -1
  186. package/lib/esm/Viewport.js +12 -2
  187. package/lib/esm/Viewport.js.map +1 -1
  188. package/lib/esm/core-frontend.d.ts +4 -0
  189. package/lib/esm/core-frontend.d.ts.map +1 -1
  190. package/lib/esm/core-frontend.js +4 -0
  191. package/lib/esm/core-frontend.js.map +1 -1
  192. package/lib/esm/render/GraphicBuilder.d.ts +6 -0
  193. package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
  194. package/lib/esm/render/GraphicBuilder.js.map +1 -1
  195. package/lib/esm/render/RenderTarget.d.ts +3 -2
  196. package/lib/esm/render/RenderTarget.d.ts.map +1 -1
  197. package/lib/esm/render/RenderTarget.js +2 -1
  198. package/lib/esm/render/RenderTarget.js.map +1 -1
  199. package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
  200. package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
  201. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js +2 -1
  202. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  203. package/lib/esm/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
  204. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js +1 -0
  205. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  206. package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
  207. package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
  208. package/lib/esm/render/primitives/mesh/MeshPrimitives.js +3 -3
  209. package/lib/esm/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  210. package/lib/esm/render/webgl/BranchUniforms.d.ts.map +1 -1
  211. package/lib/esm/render/webgl/BranchUniforms.js +8 -5
  212. package/lib/esm/render/webgl/BranchUniforms.js.map +1 -1
  213. package/lib/esm/render/webgl/SolarShadowMap.js +1 -1
  214. package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
  215. package/lib/esm/render/webgl/System.d.ts +1 -1
  216. package/lib/esm/render/webgl/Target.d.ts +2 -1
  217. package/lib/esm/render/webgl/Target.d.ts.map +1 -1
  218. package/lib/esm/render/webgl/Target.js +63 -1
  219. package/lib/esm/render/webgl/Target.js.map +1 -1
  220. package/lib/esm/request/Request.d.ts +167 -0
  221. package/lib/esm/request/Request.d.ts.map +1 -0
  222. package/lib/esm/request/Request.js +289 -0
  223. package/lib/esm/request/Request.js.map +1 -0
  224. package/lib/esm/tile/internal.d.ts +1 -0
  225. package/lib/esm/tile/internal.d.ts.map +1 -1
  226. package/lib/esm/tile/internal.js +1 -0
  227. package/lib/esm/tile/internal.js.map +1 -1
  228. package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -1
  229. package/lib/esm/tile/map/ArcGISTileMap.js +6 -2
  230. package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
  231. package/lib/esm/tile/map/ArcGisTokenGenerator.js +1 -1
  232. package/lib/esm/tile/map/ArcGisTokenGenerator.js.map +1 -1
  233. package/lib/esm/tile/map/ArcGisUtilities.d.ts +1 -1
  234. package/lib/esm/tile/map/ArcGisUtilities.d.ts.map +1 -1
  235. package/lib/esm/tile/map/ArcGisUtilities.js +14 -6
  236. package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
  237. package/lib/esm/tile/map/BingElevation.js +1 -1
  238. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  239. package/lib/esm/tile/map/CesiumTerrainProvider.js +1 -1
  240. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  241. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
  242. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  243. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
  244. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  245. package/lib/esm/tile/map/MapLayerAuthentication.d.ts +20 -0
  246. package/lib/esm/tile/map/MapLayerAuthentication.d.ts.map +1 -0
  247. package/lib/esm/tile/map/MapLayerAuthentication.js +15 -0
  248. package/lib/esm/tile/map/MapLayerAuthentication.js.map +1 -0
  249. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +6 -3
  250. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  251. package/lib/esm/tile/map/MapLayerFormatRegistry.js +3 -1
  252. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  253. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +2 -2
  254. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  255. package/lib/esm/tile/map/MapLayerImageryFormats.js +5 -3
  256. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  257. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +2 -2
  258. package/lib/esm/tile/map/MapLayerImageryProvider.js +2 -2
  259. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  260. package/lib/esm/tile/map/MapLayerSources.d.ts +3 -1
  261. package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
  262. package/lib/esm/tile/map/MapLayerSources.js +4 -2
  263. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  264. package/lib/esm/tile/map/MapTileLoader.js +1 -1
  265. package/lib/esm/tile/map/MapTileLoader.js.map +1 -1
  266. package/lib/esm/tile/map/TerrainMeshProvider.d.ts +1 -1
  267. package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
  268. package/lib/esm/tile/map/WmsCapabilities.d.ts +1 -1
  269. package/lib/esm/tile/map/WmsCapabilities.js +1 -1
  270. package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
  271. package/lib/esm/tile/map/WmtsCapabilities.d.ts +1 -1
  272. package/lib/esm/tile/map/WmtsCapabilities.js +1 -1
  273. package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
  274. package/lib/esm/tools/ViewTool.js +1 -1
  275. package/lib/esm/tools/ViewTool.js.map +1 -1
  276. package/package.json +28 -22
@@ -1 +1 @@
1
- {"version":3,"file":"NativeApp.js","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH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AAE,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAC5F,CAAE,CAAA;AAiBF,gEAAgE;AAClD,uCAA6B,GAAG,IAAI,OAAO,EAAiD,CAAA;AAU3F,kBAAQ,GAAG,KAAM,CAAA;AAmHlC;;;;GAIG;AACH,MAAM,OAAO,OAAO;IAClB,YAA4B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAI,CAAC;IAE3C,sEAAsE;IAC/D,KAAK,CAAC,YAAY,CAAC,GAAW;QACnC,OAAO,SAAS,CAAC,cAAc,CAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,8BAA8B;IACvB,KAAK,CAAC,OAAO,CAAC,GAAW;QAC9B,OAAO,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,0BAA0B;IACnB,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAmB;QACnD,OAAO,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,SAAS,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,iCAAiC;IAC1B,KAAK,CAAC,UAAU,CAAC,GAAW;QACjC,OAAO,SAAS,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,SAAS;QACpB,OAAO,SAAS,CAAC,cAAc,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { AsyncMethodsOf, BeEvent, GuidString, Logger, PromiseReturnType } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseDownloader, BriefcaseProps, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps,\r\n nativeAppChannel, NativeAppFunctions, NativeAppNotifications, nativeAppNotify, OverriddenBy,\r\n RequestNewBriefcaseProps, StorageValue, SyncMode,\r\n} from \"@itwin/core-common\";\r\nimport { ProgressCallback, RequestGlobalOptions } from \"@bentley/itwin-client\";\r\nimport { FrontendLoggerCategory } from \"./FrontendLoggerCategory\";\r\nimport { IpcApp, IpcAppOptions, NotificationHandler } from \"./IpcApp\";\r\nimport { NativeAppLogger } from \"./NativeAppLogger\";\r\n\r\n/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for\r\n * backwards compatibility, a [SyncMode]($common). If [SyncMode.PullAndPush]($common) is supplied, a new briefcaseId will be acquired.\r\n * @public\r\n */\r\nexport type DownloadBriefcaseId =\r\n { syncMode?: SyncMode, briefcaseId?: never } |\r\n { briefcaseId: number, syncMode?: never };\r\n\r\n/**\r\n* Options to download a briefcase\r\n* @public\r\n*/\r\nexport type DownloadBriefcaseOptions = DownloadBriefcaseId & {\r\n /** the full path for the briefcase file */\r\n fileName?: string;\r\n /** interval for calling progress function, in milliseconds */\r\n progressInterval?: number;\r\n};\r\n\r\n/** NativeApp notifications from backend */\r\nclass NativeAppNotifyHandler extends NotificationHandler implements NativeAppNotifications {\r\n public get channelName() { return nativeAppNotify; }\r\n public notifyInternetConnectivityChanged(status: InternetConnectivityStatus) {\r\n Logger.logInfo(FrontendLoggerCategory.NativeApp, \"Internet connectivity changed\");\r\n NativeApp.onInternetConnectivityChanged.raiseEvent(status);\r\n }\r\n}\r\n\r\n/**\r\n * Options for [[NativeApp.startup]]\r\n * @public\r\n */\r\nexport interface NativeAppOpts extends IpcAppOptions {\r\n nativeApp?: {};\r\n}\r\n\r\n/**\r\n * The frontend of a native application\r\n * @see [Native Applications]($docs/learning/NativeApps.md)\r\n * @public\r\n */\r\nexport class NativeApp {\r\n public static async callNativeHost<T extends AsyncMethodsOf<NativeAppFunctions>>(methodName: T, ...args: Parameters<NativeAppFunctions[T]>) {\r\n return IpcApp.callIpcChannel(nativeAppChannel, methodName, ...args) as PromiseReturnType<NativeAppFunctions[T]>;\r\n }\r\n\r\n private static _storages = new Map<string, Storage>();\r\n private static _onOnline = async () => {\r\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);\r\n };\r\n private static _onOffline = async () => {\r\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Offline);\r\n };\r\n private static async setConnectivity(by: OverriddenBy, status: InternetConnectivityStatus) {\r\n RequestGlobalOptions.online = (status === InternetConnectivityStatus.Online);\r\n await this.callNativeHost(\"overrideInternetConnectivity\", by, status);\r\n }\r\n private static hookBrowserConnectivityEvents() {\r\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\r\n window.addEventListener(\"online\", this._onOnline);\r\n window.addEventListener(\"offline\", this._onOffline);\r\n }\r\n }\r\n private static unhookBrowserConnectivityEvents() {\r\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\r\n window.removeEventListener(\"online\", this._onOnline);\r\n window.removeEventListener(\"offline\", this._onOffline);\r\n }\r\n }\r\n /** event called when internet connectivity changes, if known */\r\n public static onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\r\n\r\n /** determine whether the app currently has internet connectivity, if known */\r\n public static async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\r\n return this.callNativeHost(\"checkInternetConnectivity\");\r\n }\r\n /** @internal */\r\n public static async overrideInternetConnectivity(status: InternetConnectivityStatus): Promise<void> {\r\n return this.callNativeHost(\"overrideInternetConnectivity\", OverriddenBy.User, status);\r\n }\r\n private static _isValid = false;\r\n public static get isValid(): boolean { return this._isValid; }\r\n\r\n /**\r\n * This is called by either ElectronApp.startup or MobileApp.startup - it should not be called directly\r\n * @internal\r\n */\r\n public static async startup(ipc: IpcSocketFrontend, opts?: NativeAppOpts) {\r\n await IpcApp.startup(ipc, opts);\r\n if (this._isValid)\r\n return;\r\n this._isValid = true;\r\n\r\n NativeAppNotifyHandler.register(); // receives notifications from backend\r\n NativeApp.hookBrowserConnectivityEvents();\r\n\r\n // initialize current online state.\r\n if (window.navigator.onLine) {\r\n RequestGlobalOptions.online = window.navigator.onLine;\r\n await this.setConnectivity(OverriddenBy.Browser, window.navigator.onLine ? InternetConnectivityStatus.Online : InternetConnectivityStatus.Offline);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static async shutdown() {\r\n NativeApp.unhookBrowserConnectivityEvents();\r\n await NativeAppLogger.flush();\r\n await IpcApp.shutdown();\r\n this._isValid = false;\r\n }\r\n\r\n public static async requestDownloadBriefcase(iTwinId: string, iModelId: string, downloadOptions: DownloadBriefcaseOptions,\r\n asOf: IModelVersion = IModelVersion.latest(), progress?: ProgressCallback): Promise<BriefcaseDownloader> {\r\n\r\n let stopProgressEvents = () => { };\r\n if (progress !== undefined) {\r\n stopProgressEvents = IpcApp.addListener(`nativeApp.progress-${iModelId}`, (_evt: Event, data: { loaded: number, total: number }) => {\r\n progress(data);\r\n });\r\n }\r\n\r\n const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :\r\n (downloadOptions.syncMode === SyncMode.PullOnly ? 0 : await this.callNativeHost(\"acquireNewBriefcaseId\", iModelId));\r\n\r\n const fileName = downloadOptions.fileName ?? await this.getBriefcaseFileName({ briefcaseId, iModelId });\r\n const requestProps: RequestNewBriefcaseProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };\r\n\r\n const doDownload = async (): Promise<void> => {\r\n try {\r\n await this.callNativeHost(\"downloadBriefcase\", requestProps, progress !== undefined, downloadOptions.progressInterval);\r\n } finally {\r\n stopProgressEvents();\r\n }\r\n };\r\n\r\n const requestCancel = async (): Promise<boolean> => {\r\n const status = await this.callNativeHost(\"requestCancelDownloadBriefcase\", fileName);\r\n if (status)\r\n stopProgressEvents();\r\n return status;\r\n };\r\n\r\n return { briefcaseId, fileName, downloadPromise: doDownload(), requestCancel };\r\n }\r\n\r\n /** Get the full path filename for a briefcase within the briefcase cache */\r\n public static async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\r\n return this.callNativeHost(\"getBriefcaseFileName\", props);\r\n }\r\n\r\n /** Delete an existing briefcase\r\n * @param fileName the briefcase fileName\r\n */\r\n public static async deleteBriefcase(fileName: string): Promise<void> {\r\n await this.callNativeHost(\"deleteBriefcaseFiles\", fileName);\r\n }\r\n\r\n /** Get a list of all briefcase files held in the local briefcase cache directory */\r\n public static async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\r\n return this.callNativeHost(\"getCachedBriefcases\", iModelId);\r\n }\r\n\r\n /**\r\n * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.\r\n * @param name Should be a local filename without an extension.\r\n * @returns a Promise for the [[Storage]].\r\n */\r\n public static async openStorage(name: string): Promise<Storage> {\r\n if (this._storages.has(name))\r\n return this._storages.get(name)!;\r\n\r\n const storage = new Storage(await this.callNativeHost(\"storageMgrOpen\", name));\r\n this._storages.set(storage.id, storage);\r\n return storage;\r\n }\r\n\r\n /**\r\n * Close a Storage and optionally delete it.\r\n * @param storage normally not call directly instead use Storage.close()\r\n * @param deleteStorage if true, delete the storage from disk after closing it.\r\n */\r\n public static async closeStorage(storage: Storage, deleteStorage: boolean = false): Promise<void> {\r\n if (!this._storages.has(storage.id))\r\n throw new Error(`Storage [Id=${storage.id}] not open`);\r\n\r\n await this.callNativeHost(\"storageMgrClose\", storage.id, deleteStorage);\r\n this._storages.delete(storage.id);\r\n }\r\n\r\n /** Get the list of existing Storages on the local disk. */\r\n public static async getStorageNames(): Promise<string[]> {\r\n return NativeApp.callNativeHost(\"storageMgrNames\");\r\n }\r\n}\r\n\r\n/**\r\n * A local disk-based cache for key value pairs for NativeApps.\r\n * @note This should be used only for local caching, since its not guaranteed to exist permanently.\r\n * @public\r\n */\r\nexport class Storage {\r\n constructor(public readonly id: string) { }\r\n\r\n /** get the type of a value for a key, or undefined if not present. */\r\n public async getValueType(key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\r\n return NativeApp.callNativeHost(\"storageGetValueType\", this.id, key);\r\n }\r\n\r\n /** Get the value for a key */\r\n public async getData(key: string): Promise<StorageValue> {\r\n return NativeApp.callNativeHost(\"storageGet\", this.id, key);\r\n }\r\n\r\n /** Set value for a key */\r\n public async setData(key: string, value: StorageValue): Promise<void> {\r\n return NativeApp.callNativeHost(\"storageSet\", this.id, key, value);\r\n }\r\n\r\n /**\r\n * Return an array of all keys in this Storage.\r\n * @note This can be expensive, depending on the number of keys present.\r\n */\r\n public async getKeys(): Promise<string[]> {\r\n return NativeApp.callNativeHost(\"storageKeys\", this.id);\r\n }\r\n\r\n /** Remove a key and its data. */\r\n public async removeData(key: string): Promise<void> {\r\n return NativeApp.callNativeHost(\"storageRemove\", this.id, key);\r\n }\r\n\r\n /** Remove all keys and their data. */\r\n public async removeAll(): Promise<void> {\r\n return NativeApp.callNativeHost(\"storageRemoveAll\", this.id);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NativeApp.js","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH,OAAO,EAAkB,OAAO,EAAc,MAAM,EAAqB,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACgC,aAAa,EAAE,0BAA0B,EAC9E,gBAAgB,EAA8C,eAAe,EAAE,YAAY,EACnD,QAAQ,GACjD,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;A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CAAQ;IAAI,CAAC;IAE3C,sEAAsE;IAC/D,KAAK,CAAC,YAAY,CAAC,GAAW;QACnC,OAAO,SAAS,CAAC,cAAc,CAAC,qBAAqB,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,8BAA8B;IACvB,KAAK,CAAC,OAAO,CAAC,GAAW;QAC9B,OAAO,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,0BAA0B;IACnB,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAmB;QACnD,OAAO,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,OAAO;QAClB,OAAO,SAAS,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,iCAAiC;IAC1B,KAAK,CAAC,UAAU,CAAC,GAAW;QACjC,OAAO,SAAS,CAAC,cAAc,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;IAED,sCAAsC;IAC/B,KAAK,CAAC,SAAS;QACpB,OAAO,SAAS,CAAC,cAAc,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { AsyncMethodsOf, BeEvent, GuidString, Logger, PromiseReturnType } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseDownloader, BriefcaseProps, IModelVersion, InternetConnectivityStatus, IpcSocketFrontend, LocalBriefcaseProps,\r\n nativeAppChannel, NativeAppFunctions, NativeAppNotifications, nativeAppNotify, OverriddenBy,\r\n RequestNewBriefcaseProps, StorageValue, SyncMode,\r\n} from \"@itwin/core-common\";\r\nimport { ProgressCallback, RequestGlobalOptions } from \"./request/Request\";\r\nimport { FrontendLoggerCategory } from \"./FrontendLoggerCategory\";\r\nimport { IpcApp, IpcAppOptions, NotificationHandler } from \"./IpcApp\";\r\nimport { NativeAppLogger } from \"./NativeAppLogger\";\r\n\r\n/** Properties for specifying the BriefcaseId for downloading. May either specify a BriefcaseId directly (preferable) or, for\r\n * backwards compatibility, a [SyncMode]($common). If [SyncMode.PullAndPush]($common) is supplied, a new briefcaseId will be acquired.\r\n * @public\r\n */\r\nexport type DownloadBriefcaseId =\r\n { syncMode?: SyncMode, briefcaseId?: never } |\r\n { briefcaseId: number, syncMode?: never };\r\n\r\n/**\r\n* Options to download a briefcase\r\n* @public\r\n*/\r\nexport type DownloadBriefcaseOptions = DownloadBriefcaseId & {\r\n /** the full path for the briefcase file */\r\n fileName?: string;\r\n /** interval for calling progress function, in milliseconds */\r\n progressInterval?: number;\r\n};\r\n\r\n/** NativeApp notifications from backend */\r\nclass NativeAppNotifyHandler extends NotificationHandler implements NativeAppNotifications {\r\n public get channelName() { return nativeAppNotify; }\r\n public notifyInternetConnectivityChanged(status: InternetConnectivityStatus) {\r\n Logger.logInfo(FrontendLoggerCategory.NativeApp, \"Internet connectivity changed\");\r\n NativeApp.onInternetConnectivityChanged.raiseEvent(status);\r\n }\r\n}\r\n\r\n/**\r\n * Options for [[NativeApp.startup]]\r\n * @public\r\n */\r\nexport interface NativeAppOpts extends IpcAppOptions {\r\n nativeApp?: {};\r\n}\r\n\r\n/**\r\n * The frontend of a native application\r\n * @see [Native Applications]($docs/learning/NativeApps.md)\r\n * @public\r\n */\r\nexport class NativeApp {\r\n public static async callNativeHost<T extends AsyncMethodsOf<NativeAppFunctions>>(methodName: T, ...args: Parameters<NativeAppFunctions[T]>) {\r\n return IpcApp.callIpcChannel(nativeAppChannel, methodName, ...args) as PromiseReturnType<NativeAppFunctions[T]>;\r\n }\r\n\r\n private static _storages = new Map<string, Storage>();\r\n private static _onOnline = async () => {\r\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Online);\r\n };\r\n private static _onOffline = async () => {\r\n await NativeApp.setConnectivity(OverriddenBy.Browser, InternetConnectivityStatus.Offline);\r\n };\r\n private static async setConnectivity(by: OverriddenBy, status: InternetConnectivityStatus) {\r\n RequestGlobalOptions.online = (status === InternetConnectivityStatus.Online);\r\n await this.callNativeHost(\"overrideInternetConnectivity\", by, status);\r\n }\r\n private static hookBrowserConnectivityEvents() {\r\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\r\n window.addEventListener(\"online\", this._onOnline);\r\n window.addEventListener(\"offline\", this._onOffline);\r\n }\r\n }\r\n private static unhookBrowserConnectivityEvents() {\r\n if (typeof window === \"object\" && window.ononline && window.onoffline) {\r\n window.removeEventListener(\"online\", this._onOnline);\r\n window.removeEventListener(\"offline\", this._onOffline);\r\n }\r\n }\r\n /** event called when internet connectivity changes, if known */\r\n public static onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\r\n\r\n /** determine whether the app currently has internet connectivity, if known */\r\n public static async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\r\n return this.callNativeHost(\"checkInternetConnectivity\");\r\n }\r\n /** @internal */\r\n public static async overrideInternetConnectivity(status: InternetConnectivityStatus): Promise<void> {\r\n return this.callNativeHost(\"overrideInternetConnectivity\", OverriddenBy.User, status);\r\n }\r\n private static _isValid = false;\r\n public static get isValid(): boolean { return this._isValid; }\r\n\r\n /**\r\n * This is called by either ElectronApp.startup or MobileApp.startup - it should not be called directly\r\n * @internal\r\n */\r\n public static async startup(ipc: IpcSocketFrontend, opts?: NativeAppOpts) {\r\n await IpcApp.startup(ipc, opts);\r\n if (this._isValid)\r\n return;\r\n this._isValid = true;\r\n\r\n NativeAppNotifyHandler.register(); // receives notifications from backend\r\n NativeApp.hookBrowserConnectivityEvents();\r\n\r\n // initialize current online state.\r\n if (window.navigator.onLine) {\r\n RequestGlobalOptions.online = window.navigator.onLine;\r\n await this.setConnectivity(OverriddenBy.Browser, window.navigator.onLine ? InternetConnectivityStatus.Online : InternetConnectivityStatus.Offline);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static async shutdown() {\r\n NativeApp.unhookBrowserConnectivityEvents();\r\n await NativeAppLogger.flush();\r\n await IpcApp.shutdown();\r\n this._isValid = false;\r\n }\r\n\r\n public static async requestDownloadBriefcase(iTwinId: string, iModelId: string, downloadOptions: DownloadBriefcaseOptions,\r\n asOf: IModelVersion = IModelVersion.latest(), progress?: ProgressCallback): Promise<BriefcaseDownloader> {\r\n\r\n let stopProgressEvents = () => { };\r\n if (progress !== undefined) {\r\n stopProgressEvents = IpcApp.addListener(`nativeApp.progress-${iModelId}`, (_evt: Event, data: { loaded: number, total: number }) => {\r\n progress(data);\r\n });\r\n }\r\n\r\n const briefcaseId = (undefined !== downloadOptions.briefcaseId) ? downloadOptions.briefcaseId :\r\n (downloadOptions.syncMode === SyncMode.PullOnly ? 0 : await this.callNativeHost(\"acquireNewBriefcaseId\", iModelId));\r\n\r\n const fileName = downloadOptions.fileName ?? await this.getBriefcaseFileName({ briefcaseId, iModelId });\r\n const requestProps: RequestNewBriefcaseProps = { iModelId, briefcaseId, iTwinId, asOf: asOf.toJSON(), fileName };\r\n\r\n const doDownload = async (): Promise<void> => {\r\n try {\r\n await this.callNativeHost(\"downloadBriefcase\", requestProps, progress !== undefined, downloadOptions.progressInterval);\r\n } finally {\r\n stopProgressEvents();\r\n }\r\n };\r\n\r\n const requestCancel = async (): Promise<boolean> => {\r\n const status = await this.callNativeHost(\"requestCancelDownloadBriefcase\", fileName);\r\n if (status)\r\n stopProgressEvents();\r\n return status;\r\n };\r\n\r\n return { briefcaseId, fileName, downloadPromise: doDownload(), requestCancel };\r\n }\r\n\r\n /** Get the full path filename for a briefcase within the briefcase cache */\r\n public static async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\r\n return this.callNativeHost(\"getBriefcaseFileName\", props);\r\n }\r\n\r\n /** Delete an existing briefcase\r\n * @param fileName the briefcase fileName\r\n */\r\n public static async deleteBriefcase(fileName: string): Promise<void> {\r\n await this.callNativeHost(\"deleteBriefcaseFiles\", fileName);\r\n }\r\n\r\n /** Get a list of all briefcase files held in the local briefcase cache directory */\r\n public static async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\r\n return this.callNativeHost(\"getCachedBriefcases\", iModelId);\r\n }\r\n\r\n /**\r\n * Open a [[Storage]]. Creates a new Storage with that name if it does not already exist.\r\n * @param name Should be a local filename without an extension.\r\n * @returns a Promise for the [[Storage]].\r\n */\r\n public static async openStorage(name: string): Promise<Storage> {\r\n if (this._storages.has(name))\r\n return this._storages.get(name)!;\r\n\r\n const storage = new Storage(await this.callNativeHost(\"storageMgrOpen\", name));\r\n this._storages.set(storage.id, storage);\r\n return storage;\r\n }\r\n\r\n /**\r\n * Close a Storage and optionally delete it.\r\n * @param storage normally not call directly instead use Storage.close()\r\n * @param deleteStorage if true, delete the storage from disk after closing it.\r\n */\r\n public static async closeStorage(storage: Storage, deleteStorage: boolean = false): Promise<void> {\r\n if (!this._storages.has(storage.id))\r\n throw new Error(`Storage [Id=${storage.id}] not open`);\r\n\r\n await this.callNativeHost(\"storageMgrClose\", storage.id, deleteStorage);\r\n this._storages.delete(storage.id);\r\n }\r\n\r\n /** Get the list of existing Storages on the local disk. */\r\n public static async getStorageNames(): Promise<string[]> {\r\n return NativeApp.callNativeHost(\"storageMgrNames\");\r\n }\r\n}\r\n\r\n/**\r\n * A local disk-based cache for key value pairs for NativeApps.\r\n * @note This should be used only for local caching, since its not guaranteed to exist permanently.\r\n * @public\r\n */\r\nexport class Storage {\r\n constructor(public readonly id: string) { }\r\n\r\n /** get the type of a value for a key, or undefined if not present. */\r\n public async getValueType(key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\r\n return NativeApp.callNativeHost(\"storageGetValueType\", this.id, key);\r\n }\r\n\r\n /** Get the value for a key */\r\n public async getData(key: string): Promise<StorageValue> {\r\n return NativeApp.callNativeHost(\"storageGet\", this.id, key);\r\n }\r\n\r\n /** Set value for a key */\r\n public async setData(key: string, value: StorageValue): Promise<void> {\r\n return NativeApp.callNativeHost(\"storageSet\", this.id, key, value);\r\n }\r\n\r\n /**\r\n * Return an array of all keys in this Storage.\r\n * @note This can be expensive, depending on the number of keys present.\r\n */\r\n public async getKeys(): Promise<string[]> {\r\n return NativeApp.callNativeHost(\"storageKeys\", this.id);\r\n }\r\n\r\n /** Remove a key and its data. */\r\n public async removeData(key: string): Promise<void> {\r\n return NativeApp.callNativeHost(\"storageRemove\", this.id, key);\r\n }\r\n\r\n /** Remove all keys and their data. */\r\n public async removeAll(): Promise<void> {\r\n return NativeApp.callNativeHost(\"storageRemoveAll\", this.id);\r\n }\r\n}\r\n"]}
@@ -31,7 +31,6 @@ export declare class NullTarget extends RenderTarget {
31
31
  dispose(): void;
32
32
  updateViewRect(): boolean;
33
33
  readPixels(): void;
34
- readImage(): undefined;
35
34
  get screenSpaceEffects(): Iterable<string>;
36
35
  set screenSpaceEffects(_effects: Iterable<string>);
37
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NoRenderApp.d.ts","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,YAAY;IA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AAiB,SAAQ,YAAY;IAChD,IAAW,OAAO,IAAI,OAAO,CAAkB;IACxC,UAAU,IAAI,OAAO;IACrB,YAAY;IACZ,qBAAqB;IACrB,aAAa;IACb,iBAAiB;IACjB,mBAAmB;IACnB,WAAW;IACX,OAAO;;IAEE,mBAAmB;CACpC;AAED;;;;GAIG;AACH,qBAAa,WAAW;WACF,OAAO,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAKpE"}
@@ -34,7 +34,6 @@ export class NullTarget extends RenderTarget {
34
34
  dispose() { }
35
35
  updateViewRect() { return false; }
36
36
  readPixels() { }
37
- readImage() { return undefined; }
38
37
  get screenSpaceEffects() { return []; }
39
38
  set screenSpaceEffects(_effects) { }
40
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NoRenderApp.js","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAC1C,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,IAAW,gBAAgB,CAAC,SAAiB,IAAI,CAAC;IAClD,IAAW,YAAY,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IACtD,IAAW,QAAQ,KAAe,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,IAAW,yBAAyB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IACjE,IAAoB,iBAAiB,KAAwC,OAAO,SAAS,CAAC,CAAC,CAAC;IAChG,IAAoB,iBAAiB,CAAC,SAA4C,IAAI,CAAC;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AC,KAAK,CAAC,OAAO,CAAC,IAAuB;QACjD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACxC,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\nimport { AnimationBranchStates } from \"./render/GraphicBranch\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/**\r\n * A RenderTarget for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullTarget extends RenderTarget {\r\n public get analysisFraction(): number { return 0; }\r\n public set analysisFraction(_fraction: number) { }\r\n public get renderSystem() { return undefined as any; }\r\n public get viewRect(): ViewRect { return new ViewRect(); }\r\n public get wantInvertBlackBackground(): boolean { return false; }\r\n public override get animationBranches(): AnimationBranchStates | undefined { return undefined; }\r\n public override set animationBranches(_branches: AnimationBranchStates | undefined) { }\r\n public onDestroy(): void { }\r\n public override reset(): void { }\r\n public changeScene(): void { }\r\n public changeDynamics(): void { }\r\n public changeDecorations(): void { }\r\n public changeRenderPlan(): void { }\r\n public drawFrame(_sceneMilSecElapsed?: number): void { }\r\n public override overrideFeatureSymbology(): void { }\r\n public override setHiliteSet(): void { }\r\n public override setFlashed(): void { }\r\n public setViewRect(): void { }\r\n public override onResized(): void { }\r\n public override dispose(): void { }\r\n public updateViewRect(): boolean { return false; }\r\n public readPixels(): void { }\r\n public override readImage() { return undefined; }\r\n public get screenSpaceEffects(): Iterable<string> { return []; }\r\n public set screenSpaceEffects(_effects: Iterable<string>) { }\r\n}\r\n\r\n/**\r\n * A RenderSystem for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullRenderSystem extends RenderSystem {\r\n public get isValid(): boolean { return false; }\r\n public doIdleWork(): boolean { return false; }\r\n public createTarget() { return new NullTarget(); }\r\n public createOffscreenTarget() { return new NullTarget(); }\r\n public createGraphic() { return undefined as any; }\r\n public createGraphicList() { return undefined as any; }\r\n public createGraphicBranch() { return undefined as any; }\r\n public createBatch() { return undefined as any; }\r\n public dispose() { }\r\n public constructor() { super(); }\r\n public override createRenderGraphic() { return undefined; }\r\n}\r\n\r\n/**\r\n * A class for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NoRenderApp {\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n opts = opts ? opts : {};\r\n opts.renderSys = new NullRenderSystem();\r\n await IModelApp.startup(opts);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NoRenderApp.js","sourceRoot":"","sources":["../../src/NoRenderApp.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAC1C,IAAW,gBAAgB,KAAa,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,IAAW,gBAAgB,CAAC,SAAiB,IAAI,CAAC;IAClD,IAAW,YAAY,KAAK,OAAO,SAAgB,CAAC,CAAC,CAAC;IACtD,IAAW,QAAQ,KAAe,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,IAA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ACjB,mBAAmB,KAAK,OAAO,SAAS,CAAC,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACf,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAuB;QACjD,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACxC,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { IModelApp, IModelAppOptions } from \"./IModelApp\";\r\nimport { AnimationBranchStates } from \"./render/GraphicBranch\";\r\nimport { RenderSystem } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { ViewRect } from \"./ViewRect\";\r\n\r\n/**\r\n * A RenderTarget for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullTarget extends RenderTarget {\r\n public get analysisFraction(): number { return 0; }\r\n public set analysisFraction(_fraction: number) { }\r\n public get renderSystem() { return undefined as any; }\r\n public get viewRect(): ViewRect { return new ViewRect(); }\r\n public get wantInvertBlackBackground(): boolean { return false; }\r\n public override get animationBranches(): AnimationBranchStates | undefined { return undefined; }\r\n public override set animationBranches(_branches: AnimationBranchStates | undefined) { }\r\n public onDestroy(): void { }\r\n public override reset(): void { }\r\n public changeScene(): void { }\r\n public changeDynamics(): void { }\r\n public changeDecorations(): void { }\r\n public changeRenderPlan(): void { }\r\n public drawFrame(_sceneMilSecElapsed?: number): void { }\r\n public override overrideFeatureSymbology(): void { }\r\n public override setHiliteSet(): void { }\r\n public override setFlashed(): void { }\r\n public setViewRect(): void { }\r\n public override onResized(): void { }\r\n public override dispose(): void { }\r\n public updateViewRect(): boolean { return false; }\r\n public readPixels(): void { }\r\n public get screenSpaceEffects(): Iterable<string> { return []; }\r\n public set screenSpaceEffects(_effects: Iterable<string>) { }\r\n}\r\n\r\n/**\r\n * A RenderSystem for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NullRenderSystem extends RenderSystem {\r\n public get isValid(): boolean { return false; }\r\n public doIdleWork(): boolean { return false; }\r\n public createTarget() { return new NullTarget(); }\r\n public createOffscreenTarget() { return new NullTarget(); }\r\n public createGraphic() { return undefined as any; }\r\n public createGraphicList() { return undefined as any; }\r\n public createGraphicBranch() { return undefined as any; }\r\n public createBatch() { return undefined as any; }\r\n public dispose() { }\r\n public constructor() { super(); }\r\n public override createRenderGraphic() { return undefined; }\r\n}\r\n\r\n/**\r\n * A class for applications that must run in environments where WebGL is not present.\r\n * This is typically used in tests.\r\n * @internal\r\n */\r\nexport class NoRenderApp {\r\n public static async startup(opts?: IModelAppOptions): Promise<void> {\r\n opts = opts ? opts : {};\r\n opts.renderSys = new NullRenderSystem();\r\n await IModelApp.startup(opts);\r\n }\r\n}\r\n"]}
@@ -25,6 +25,7 @@ export declare enum OutputMessageType {
25
25
  */
26
26
  export declare enum OutputMessagePriority {
27
27
  None = 0,
28
+ Success = 1,
28
29
  Error = 10,
29
30
  Warning = 11,
30
31
  Info = 12,
@@ -65,7 +66,8 @@ export declare enum MessageBoxIconType {
65
66
  Information = 1,
66
67
  Question = 2,
67
68
  Warning = 3,
68
- Critical = 4
69
+ Critical = 4,
70
+ Success = 5
69
71
  }
70
72
  /** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].
71
73
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationManager.d.ts","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC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,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI;IAK7H,iDAAiD;IAC1C,YAAY,IAAI,IAAI;IAE3B;;;OAGG;IACI,oBAAoB,CAAC,aAAa,EAAE,KAAK,EAAE,iBAAiB,mBAA4B,GAAG,IAAI;IAEtG,gEAAgE;IACzD,mBAAmB,IAAI,IAAI;IAElC,mEAAmE;IAC5D,sBAAsB,IAAI,IAAI;IAErC;;OAEG;IACI,iBAAiB,CAAC,YAAY,EAAE,0BAA0B,GAAG,SAAS;IAI7E;;;;;;OAMG;IACI,cAAc,CAAC,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM,EAAE,eAAe,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,kBAAkB,GAAG,IAAI;IAKpK;;;;;;OAMG;IACI,wBAAwB,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM,EAAE,eAAe,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAMrK,OAAO,CAAC,yBAAyB;IAgBjC,OAAO,CAAC,kBAAkB;CAe3B"}
@@ -32,6 +32,7 @@ export var OutputMessageType;
32
32
  export var OutputMessagePriority;
33
33
  (function (OutputMessagePriority) {
34
34
  OutputMessagePriority[OutputMessagePriority["None"] = 0] = "None";
35
+ OutputMessagePriority[OutputMessagePriority["Success"] = 1] = "Success";
35
36
  OutputMessagePriority[OutputMessagePriority["Error"] = 10] = "Error";
36
37
  OutputMessagePriority[OutputMessagePriority["Warning"] = 11] = "Warning";
37
38
  OutputMessagePriority[OutputMessagePriority["Info"] = 12] = "Info";
@@ -77,6 +78,7 @@ export var MessageBoxIconType;
77
78
  MessageBoxIconType[MessageBoxIconType["Question"] = 2] = "Question";
78
79
  MessageBoxIconType[MessageBoxIconType["Warning"] = 3] = "Warning";
79
80
  MessageBoxIconType[MessageBoxIconType["Critical"] = 4] = "Critical";
81
+ MessageBoxIconType[MessageBoxIconType["Success"] = 5] = "Success";
80
82
  })(MessageBoxIconType || (MessageBoxIconType = {}));
81
83
  /** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].
82
84
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAS,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAoB,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,0BAA0B;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,uGAAuG;IACvG,2DAAS,CAAA;IACT,2GAA2G;IAC3G,+DAAW,CAAA;IACX,2FAA2F;IAC3F,6DAAU,CAAA;IACV,4EAA4E;IAC5E,qEAAc,CAAA;IACd,yBAAyB;IACzB,2DAAS,CAAA;AACX,CAAC,EAXW,iBAAiB,KAAjB,iBAAiB,QAW5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,iEAAQ,CAAA;IACR,oEAAU,CAAA;IACV,wEAAY,CAAA;IACZ,kEAAS,CAAA;IACT,oEAAU,CAAA;IACV,oEAAU,CAAA;AACZ,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,QAOhC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,2DAAQ,CAAA;IACR,+DAAU,CAAA;IACV,iEAAW,CA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,KAAK,CAAC;YACrC,KAAK,eAAe,CAAC,IAAI,CAAC;YAC1B;gBACE,OAAO,qBAAqB,CAAC,IAAI,CAAC;SACrC;IACH,CAAC;IAEO,kBAAkB,CAAC,aAAkC;QAC3D,QAAQ,aAAa,EAAE;YACrB,KAAK,kBAAkB,CAAC,KAAK;gBAC3B,OAAO,iBAAiB,CAAC,KAAK,CAAC;YACjC,KAAK,kBAAkB,CAAC,UAAU;gBAChC,OAAO,iBAAiB,CAAC,UAAU,CAAC;YACtC,KAAK,kBAAkB,CAAC,MAAM;gBAC5B,OAAO,iBAAiB,CAAC,MAAM,CAAC;YAClC,KAAK,kBAAkB,CAAC,KAAK;gBAC3B,OAAO,iBAAiB,CAAC,KAAK,CAAC;YACjC;gBACE,OAAO,SAAS,CAAC;SACpB;IACH,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Notifications\r\n */\r\nimport { BeDuration } from \"@itwin/core-bentley\";\r\nimport { Point2d, XAndY } from \"@itwin/core-geometry\";\r\nimport { DisplayMessageType, MessagePresenter, MessageSeverity, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { ToolAssistanceInstructions } from \"./tools/ToolAssistance\";\r\n\r\n// cSpell:words messagebox\r\n\r\n/** Describes the type and behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageType {\r\n /** Temporary message box displays at the top or bottom of the screen then disappears automatically. */\r\n Toast = 0,\r\n /** Message box displays near the cursor over a Viewport and is closed by calling `closePointerMessage`. */\r\n Pointer = 1,\r\n /** Message box displays at the top or bottom of the screen and contains a Close button. */\r\n Sticky = 2,\r\n /** Message box displays near an input field and contains a Close button. */\r\n InputField = 3,\r\n /** Modal message box. */\r\n Alert = 4,\r\n}\r\n\r\n/** Classifies a [[NotifyMessageDetails]] by its level of importance.\r\n * @public\r\n */\r\nexport enum OutputMessagePriority {\r\n None = 0,\r\n Error = 10,\r\n Warning = 11,\r\n Info = 12,\r\n Debug = 13,\r\n Fatal = 17,\r\n}\r\n\r\n/** Describes the alert behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageAlert {\r\n None = 0,\r\n Dialog = 1,\r\n Balloon = 2,\r\n}\r\n\r\n/** Reason for ending the activity message via endActivityMessage\r\n * @public\r\n */\r\nexport enum ActivityMessageEndReason {\r\n Completed = 0,\r\n Cancelled = 1,\r\n}\r\n\r\n/** Describes the set of buttons displayed in a message box opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxType {\r\n OkCancel,\r\n Ok,\r\n LargeOk,\r\n MediumAlert,\r\n YesNoCancel,\r\n YesNo,\r\n}\r\n\r\n/** Describes the icon displayed in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxIconType {\r\n NoSymbol = 0, // Means Don't draw Symbol\r\n Information = 1, // Lower Case i\r\n Question = 2, // Question Mark\r\n Warning = 3, // Exclamation Point\r\n Critical = 4, // Stop Sign\r\n}\r\n\r\n/** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxValue {\r\n Apply = 1,\r\n Reset = 2,\r\n Ok = 3,\r\n Cancel = 4,\r\n Default = 5,\r\n Yes = 6,\r\n No = 7,\r\n Retry = 8,\r\n Stop = 9,\r\n Help = 10,\r\n YesToAll = 11,\r\n NoToAll = 12,\r\n}\r\n\r\n/** Describes the behavior of a tooltip created using [[NotificationManager.openToolTip]].\r\n * @public\r\n */\r\nexport interface ToolTipOptions {\r\n duration?: BeDuration;\r\n placement?: string;\r\n}\r\n\r\n/** Describes a message to be displayed to the user.\r\n * @public\r\n */\r\nexport class NotifyMessageDetails {\r\n public displayTime = BeDuration.fromSeconds(5);\r\n public viewport?: HTMLElement;\r\n public inputField?: HTMLElement;\r\n public displayPoint?: Point2d;\r\n public relativePosition = RelativePosition.TopRight;\r\n\r\n /** Constructor\r\n * @param priority The priority this message should be accorded by the NotificationManager.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param msgType The type of message. Defaults to Toast.\r\n * @param openAlert Whether an alert box should be displayed or not, and if so what kind.\r\n */\r\n public constructor(public priority: OutputMessagePriority, public briefMessage: HTMLElement | string,\r\n public detailedMessage?: HTMLElement | string, public msgType = OutputMessageType.Toast, public openAlert = OutputMessageAlert.None) { }\r\n\r\n /** Set OutputMessageType.Pointer message details.\r\n * @param viewport Viewport over which to display the Pointer type message.\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public setPointerTypeDetails(viewport: HTMLElement, displayPoint: XAndY, relativePosition = RelativePosition.TopRight) {\r\n this.viewport = viewport;\r\n this.displayPoint = Point2d.fromJSON(displayPoint);\r\n this.relativePosition = relativePosition;\r\n this.msgType = OutputMessageType.Pointer;\r\n }\r\n\r\n /** Set OutputMessageType.InputField message details.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n */\r\n public setInputFieldTypeDetails(inputField: HTMLElement) {\r\n this.inputField = inputField;\r\n this.msgType = OutputMessageType.InputField;\r\n }\r\n}\r\n\r\n/** Specifies the details of an activity message to be displayed to the user.\r\n * @public\r\n */\r\nexport class ActivityMessageDetails {\r\n public wasCancelled = false;\r\n\r\n /**\r\n * @param showProgressBar Indicates whether to show the progress bar in the activity message dialog.\r\n * @param showPercentInMessage Indicates whether to show the percentage complete in the activity message text.\r\n * @param supportsCancellation Indicates whether to show the Cancel button, giving the user the ability to cancel the operation.\r\n * @param showDialogInitially Indicates whether to show the activity message dialog initially. User can click status bar to open it.\r\n */\r\n public constructor(public showProgressBar: boolean, public showPercentInMessage: boolean, public supportsCancellation: boolean, public showDialogInitially: boolean = true) { }\r\n\r\n /** Called from NotificationAdmin when the user cancels the activity. */\r\n public onActivityCancelled() { this.wasCancelled = true; }\r\n\r\n /** Called from NotificationAdmin when the activity completes successfully. */\r\n public onActivityCompleted() { this.wasCancelled = false; }\r\n}\r\n\r\n/** The NotificationManager controls the interaction with the user for prompts, error messages, and alert dialogs.\r\n * Implementations of the NotificationManager may present the information in different ways. For example, in\r\n * non-interactive sessions, these messages may be saved to a log file or simply discarded.\r\n * @public\r\n */\r\nexport class NotificationManager implements MessagePresenter {\r\n public readonly toolTipLocation = new Point2d();\r\n\r\n /** Output a prompt, given a localization key.\r\n * @param key The key of the localized string with the prompt message.\r\n */\r\n public outputPromptByKey(key: string) { this.outputPrompt(IModelApp.localization.getLocalizedString(key)); }\r\n\r\n /** Output a localized prompt to the user. A 'prompt' indicates an action the user should take to proceed.\r\n * @param _prompt The localized string with the prompt message.\r\n */\r\n public outputPrompt(_prompt: string) { }\r\n\r\n /** Output a message and/or alert to the user. */\r\n public outputMessage(_message: NotifyMessageDetails) { }\r\n\r\n /** Output a MessageBox and wait for response from the user.\r\n * @param _mbType The MessageBox type.\r\n * @param _message The message to display.\r\n * @param _icon The MessageBox icon type.\r\n * @return the response from the user.\r\n */\r\n public async openMessageBox(_mbType: MessageBoxType, _message: HTMLElement | string, _icon: MessageBoxIconType): Promise<MessageBoxValue> { return MessageBoxValue.Ok; }\r\n\r\n /**\r\n * Set up for activity messages.\r\n * @param _details The activity message details.\r\n * @return true if the message was displayed, false if an invalid priority is specified.\r\n */\r\n public setupActivityMessage(_details: ActivityMessageDetails) { return true; }\r\n\r\n /**\r\n * Output an activity message to the user.\r\n * @param _messageText The message text.\r\n * @param _percentComplete The percentage of completion.\r\n * @return true if the message was displayed, false if the message could not be displayed.\r\n */\r\n public outputActivityMessage(_messageText: HTMLElement | string, _percentComplete: number) { return true; }\r\n\r\n /**\r\n * End an activity message.\r\n * @param _reason The reason for the end of the Activity Message.\r\n * @return true if the message was ended successfully, false if the activityMessage could not be ended.\r\n */\r\n public endActivityMessage(_reason: ActivityMessageEndReason) { return true; }\r\n\r\n /** Return true if _showTooltip has an implementation and will display a tooltip. */\r\n public get isToolTipSupported(): boolean { return false; }\r\n\r\n /** Return true if the tooltip is currently open. */\r\n public get isToolTipOpen(): boolean { return false; }\r\n\r\n /** Implement to display a tooltip message at the specified location. */\r\n protected _showToolTip(_htmlElement: HTMLElement, _message: HTMLElement | string, _location?: XAndY, _options?: ToolTipOptions): void { }\r\n\r\n /** Show a tooltip window. Saves tooltip location for AccuSnap to test if cursor has moved far enough away to close tooltip.\r\n * @param htmlElement The HTMLElement that anchors the toolTip.\r\n * @param message What to display inside the ToolTip. May be a string or an HTMLElement.\r\n * @param location An optional location, relative to the origin of _htmlElement, for the ToolTip. If undefined, center of `htmlElement`\r\n * @param options Options that supply additional information about how the ToolTip should function.\r\n * @note If message is an HTMLElement, the notification manager will display the HTMLElement verbatim. This can represent a security\r\n * risk if any part the element is created from user input. Applications should be careful to *sanitize* any such input before\r\n * creating an HTMLElement to pass to this method.\r\n */\r\n public openToolTip(htmlElement: HTMLElement, message: HTMLElement | string, location?: XAndY, options?: ToolTipOptions): void {\r\n this.toolTipLocation.setFrom(location);\r\n this._showToolTip(htmlElement, message, location, options);\r\n }\r\n\r\n /** Clear the tooltip if it is currently open. */\r\n public clearToolTip(): void { }\r\n\r\n /** Update message position created with [[OutputMessageType.Pointer]].\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public updatePointerMessage(_displayPoint: XAndY, _relativePosition = RelativePosition.TopRight): void { }\r\n\r\n /** Close message created with [[OutputMessageType.Pointer]]. */\r\n public closePointerMessage(): void { }\r\n\r\n /** Close message created with [[OutputMessageType.InputField]]. */\r\n public closeInputFieldMessage(): void { }\r\n\r\n /** Setup tool assistance instructions for a tool. The instructions include the main instruction, which includes the current prompt.\r\n * @param instructions The tool assistance instructions.\r\n */\r\n public setToolAssistance(instructions: ToolAssistanceInstructions | undefined) {\r\n this.outputPrompt(instructions ? instructions.mainInstruction.text : \"\");\r\n }\r\n\r\n /**\r\n * Displays a notification message.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param messageType The type of message. Defaults to Toast.\r\n */\r\n public displayMessage(severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string, messageType?: DisplayMessageType): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage, this.convertMessageType(messageType));\r\n this.outputMessage(details);\r\n }\r\n\r\n /**\r\n * Displays an input field notification message.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n */\r\n public displayInputFieldMessage(inputField: HTMLElement, severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage);\r\n details.setInputFieldTypeDetails(inputField);\r\n this.outputMessage(details);\r\n }\r\n\r\n private convertSeverityToPriority(severity: MessageSeverity): OutputMessagePriority {\r\n switch (severity) {\r\n case MessageSeverity.Information:\r\n return OutputMessagePriority.Info;\r\n case MessageSeverity.Warning:\r\n return OutputMessagePriority.Warning;\r\n case MessageSeverity.Error:\r\n return OutputMessagePriority.Error;\r\n case MessageSeverity.Fatal:\r\n return OutputMessagePriority.Fatal;\r\n case MessageSeverity.None:\r\n default:\r\n return OutputMessagePriority.None;\r\n }\r\n }\r\n\r\n private convertMessageType(inMessageType?: DisplayMessageType): OutputMessageType | undefined {\r\n switch (inMessageType) {\r\n case DisplayMessageType.Alert:\r\n return OutputMessageType.Alert;\r\n case DisplayMessageType.InputField:\r\n return OutputMessageType.InputField;\r\n case DisplayMessageType.Sticky:\r\n return OutputMessageType.Sticky;\r\n case DisplayMessageType.Toast:\r\n return OutputMessageType.Toast;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"NotificationManager.js","sourceRoot":"","sources":["../../src/NotificationManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAS,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAoB,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,0BAA0B;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,uGAAuG;IACvG,2DAAS,CAAA;IACT,2GAA2G;IAC3G,+DAAW,CAAA;IACX,2FAA2F;IAC3F,6DAAU,CAAA;IACV,4EAA4E;IAC5E,qEAAc,CAAA;IACd,yBAAyB;IACzB,2DAAS,CAAA;AACX,CAAC,EAXW,iBAAiB,KAAjB,iBAAiB,QAW5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,iEAAQ,CAAA;IACR,uEAAW,CAAA;IACX,oEAAU,CAAA;IACV,wEAAY,CAAA;IACZ,kEAAS,CAAA;IACT,oEAAU,CAAA;IACV,oEAAU,CAAA;AACZ,CAAC,EARW,qBAAqB,KAArB,qBAAqB,QAQhC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,2DAAQ,CAAA;IACR,+DAAU,CAAA;IACV,iEAAW,CAAA;AACb,CAAC,EAJW,kBAAkB,KAAl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;YACrC,KAAK,eAAe,CAAC,IAAI,CAAC;YAC1B;gBACE,OAAO,qBAAqB,CAAC,IAAI,CAAC;SACrC;IACH,CAAC;IAEO,kBAAkB,CAAC,aAAkC;QAC3D,QAAQ,aAAa,EAAE;YACrB,KAAK,kBAAkB,CAAC,KAAK;gBAC3B,OAAO,iBAAiB,CAAC,KAAK,CAAC;YACjC,KAAK,kBAAkB,CAAC,UAAU;gBAChC,OAAO,iBAAiB,CAAC,UAAU,CAAC;YACtC,KAAK,kBAAkB,CAAC,MAAM;gBAC5B,OAAO,iBAAiB,CAAC,MAAM,CAAC;YAClC,KAAK,kBAAkB,CAAC,KAAK;gBAC3B,OAAO,iBAAiB,CAAC,KAAK,CAAC;YACjC;gBACE,OAAO,SAAS,CAAC;SACpB;IACH,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Notifications\r\n */\r\nimport { BeDuration } from \"@itwin/core-bentley\";\r\nimport { Point2d, XAndY } from \"@itwin/core-geometry\";\r\nimport { DisplayMessageType, MessagePresenter, MessageSeverity, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { ToolAssistanceInstructions } from \"./tools/ToolAssistance\";\r\n\r\n// cSpell:words messagebox\r\n\r\n/** Describes the type and behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageType {\r\n /** Temporary message box displays at the top or bottom of the screen then disappears automatically. */\r\n Toast = 0,\r\n /** Message box displays near the cursor over a Viewport and is closed by calling `closePointerMessage`. */\r\n Pointer = 1,\r\n /** Message box displays at the top or bottom of the screen and contains a Close button. */\r\n Sticky = 2,\r\n /** Message box displays near an input field and contains a Close button. */\r\n InputField = 3,\r\n /** Modal message box. */\r\n Alert = 4,\r\n}\r\n\r\n/** Classifies a [[NotifyMessageDetails]] by its level of importance.\r\n * @public\r\n */\r\nexport enum OutputMessagePriority {\r\n None = 0,\r\n Success = 1,\r\n Error = 10,\r\n Warning = 11,\r\n Info = 12,\r\n Debug = 13,\r\n Fatal = 17,\r\n}\r\n\r\n/** Describes the alert behavior of a [[NotifyMessageDetails]].\r\n * @public\r\n */\r\nexport enum OutputMessageAlert {\r\n None = 0,\r\n Dialog = 1,\r\n Balloon = 2,\r\n}\r\n\r\n/** Reason for ending the activity message via endActivityMessage\r\n * @public\r\n */\r\nexport enum ActivityMessageEndReason {\r\n Completed = 0,\r\n Cancelled = 1,\r\n}\r\n\r\n/** Describes the set of buttons displayed in a message box opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxType {\r\n OkCancel,\r\n Ok,\r\n LargeOk,\r\n MediumAlert,\r\n YesNoCancel,\r\n YesNo,\r\n}\r\n\r\n/** Describes the icon displayed in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxIconType {\r\n NoSymbol = 0, // Means Don't draw Symbol\r\n Information = 1, // Lower Case i\r\n Question = 2, // Question Mark\r\n Warning = 3, // Exclamation Point\r\n Critical = 4, // Stop Sign\r\n Success = 5, // check mark\r\n}\r\n\r\n/** Describes the possible return values produced when the user clicks a button in a messagebox opened using [[NotificationManager.openMessageBox]].\r\n * @public\r\n */\r\nexport enum MessageBoxValue {\r\n Apply = 1,\r\n Reset = 2,\r\n Ok = 3,\r\n Cancel = 4,\r\n Default = 5,\r\n Yes = 6,\r\n No = 7,\r\n Retry = 8,\r\n Stop = 9,\r\n Help = 10,\r\n YesToAll = 11,\r\n NoToAll = 12,\r\n}\r\n\r\n/** Describes the behavior of a tooltip created using [[NotificationManager.openToolTip]].\r\n * @public\r\n */\r\nexport interface ToolTipOptions {\r\n duration?: BeDuration;\r\n placement?: string;\r\n}\r\n\r\n/** Describes a message to be displayed to the user.\r\n * @public\r\n */\r\nexport class NotifyMessageDetails {\r\n public displayTime = BeDuration.fromSeconds(5);\r\n public viewport?: HTMLElement;\r\n public inputField?: HTMLElement;\r\n public displayPoint?: Point2d;\r\n public relativePosition = RelativePosition.TopRight;\r\n\r\n /** Constructor\r\n * @param priority The priority this message should be accorded by the NotificationManager.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param msgType The type of message. Defaults to Toast.\r\n * @param openAlert Whether an alert box should be displayed or not, and if so what kind.\r\n */\r\n public constructor(public priority: OutputMessagePriority, public briefMessage: HTMLElement | string,\r\n public detailedMessage?: HTMLElement | string, public msgType = OutputMessageType.Toast, public openAlert = OutputMessageAlert.None) { }\r\n\r\n /** Set OutputMessageType.Pointer message details.\r\n * @param viewport Viewport over which to display the Pointer type message.\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public setPointerTypeDetails(viewport: HTMLElement, displayPoint: XAndY, relativePosition = RelativePosition.TopRight) {\r\n this.viewport = viewport;\r\n this.displayPoint = Point2d.fromJSON(displayPoint);\r\n this.relativePosition = relativePosition;\r\n this.msgType = OutputMessageType.Pointer;\r\n }\r\n\r\n /** Set OutputMessageType.InputField message details.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n */\r\n public setInputFieldTypeDetails(inputField: HTMLElement) {\r\n this.inputField = inputField;\r\n this.msgType = OutputMessageType.InputField;\r\n }\r\n}\r\n\r\n/** Specifies the details of an activity message to be displayed to the user.\r\n * @public\r\n */\r\nexport class ActivityMessageDetails {\r\n public wasCancelled = false;\r\n\r\n /**\r\n * @param showProgressBar Indicates whether to show the progress bar in the activity message dialog.\r\n * @param showPercentInMessage Indicates whether to show the percentage complete in the activity message text.\r\n * @param supportsCancellation Indicates whether to show the Cancel button, giving the user the ability to cancel the operation.\r\n * @param showDialogInitially Indicates whether to show the activity message dialog initially. User can click status bar to open it.\r\n */\r\n public constructor(public showProgressBar: boolean, public showPercentInMessage: boolean, public supportsCancellation: boolean, public showDialogInitially: boolean = true) { }\r\n\r\n /** Called from NotificationAdmin when the user cancels the activity. */\r\n public onActivityCancelled() { this.wasCancelled = true; }\r\n\r\n /** Called from NotificationAdmin when the activity completes successfully. */\r\n public onActivityCompleted() { this.wasCancelled = false; }\r\n}\r\n\r\n/** The NotificationManager controls the interaction with the user for prompts, error messages, and alert dialogs.\r\n * Implementations of the NotificationManager may present the information in different ways. For example, in\r\n * non-interactive sessions, these messages may be saved to a log file or simply discarded.\r\n * @public\r\n */\r\nexport class NotificationManager implements MessagePresenter {\r\n public readonly toolTipLocation = new Point2d();\r\n\r\n /** Output a prompt, given a localization key.\r\n * @param key The key of the localized string with the prompt message.\r\n */\r\n public outputPromptByKey(key: string) { this.outputPrompt(IModelApp.localization.getLocalizedString(key)); }\r\n\r\n /** Output a localized prompt to the user. A 'prompt' indicates an action the user should take to proceed.\r\n * @param _prompt The localized string with the prompt message.\r\n */\r\n public outputPrompt(_prompt: string) { }\r\n\r\n /** Output a message and/or alert to the user. */\r\n public outputMessage(_message: NotifyMessageDetails) { }\r\n\r\n /** Output a MessageBox and wait for response from the user.\r\n * @param _mbType The MessageBox type.\r\n * @param _message The message to display.\r\n * @param _icon The MessageBox icon type.\r\n * @return the response from the user.\r\n */\r\n public async openMessageBox(_mbType: MessageBoxType, _message: HTMLElement | string, _icon: MessageBoxIconType): Promise<MessageBoxValue> { return MessageBoxValue.Ok; }\r\n\r\n /**\r\n * Set up for activity messages.\r\n * @param _details The activity message details.\r\n * @return true if the message was displayed, false if an invalid priority is specified.\r\n */\r\n public setupActivityMessage(_details: ActivityMessageDetails) { return true; }\r\n\r\n /**\r\n * Output an activity message to the user.\r\n * @param _messageText The message text.\r\n * @param _percentComplete The percentage of completion.\r\n * @return true if the message was displayed, false if the message could not be displayed.\r\n */\r\n public outputActivityMessage(_messageText: HTMLElement | string, _percentComplete: number) { return true; }\r\n\r\n /**\r\n * End an activity message.\r\n * @param _reason The reason for the end of the Activity Message.\r\n * @return true if the message was ended successfully, false if the activityMessage could not be ended.\r\n */\r\n public endActivityMessage(_reason: ActivityMessageEndReason) { return true; }\r\n\r\n /** Return true if _showTooltip has an implementation and will display a tooltip. */\r\n public get isToolTipSupported(): boolean { return false; }\r\n\r\n /** Return true if the tooltip is currently open. */\r\n public get isToolTipOpen(): boolean { return false; }\r\n\r\n /** Implement to display a tooltip message at the specified location. */\r\n protected _showToolTip(_htmlElement: HTMLElement, _message: HTMLElement | string, _location?: XAndY, _options?: ToolTipOptions): void { }\r\n\r\n /** Show a tooltip window. Saves tooltip location for AccuSnap to test if cursor has moved far enough away to close tooltip.\r\n * @param htmlElement The HTMLElement that anchors the toolTip.\r\n * @param message What to display inside the ToolTip. May be a string or an HTMLElement.\r\n * @param location An optional location, relative to the origin of _htmlElement, for the ToolTip. If undefined, center of `htmlElement`\r\n * @param options Options that supply additional information about how the ToolTip should function.\r\n * @note If message is an HTMLElement, the notification manager will display the HTMLElement verbatim. This can represent a security\r\n * risk if any part the element is created from user input. Applications should be careful to *sanitize* any such input before\r\n * creating an HTMLElement to pass to this method.\r\n */\r\n public openToolTip(htmlElement: HTMLElement, message: HTMLElement | string, location?: XAndY, options?: ToolTipOptions): void {\r\n this.toolTipLocation.setFrom(location);\r\n this._showToolTip(htmlElement, message, location, options);\r\n }\r\n\r\n /** Clear the tooltip if it is currently open. */\r\n public clearToolTip(): void { }\r\n\r\n /** Update message position created with [[OutputMessageType.Pointer]].\r\n * @param displayPoint Point at which to display the Pointer type message.\r\n * @param relativePosition Position relative to displayPoint at which to display the Pointer type message.\r\n */\r\n public updatePointerMessage(_displayPoint: XAndY, _relativePosition = RelativePosition.TopRight): void { }\r\n\r\n /** Close message created with [[OutputMessageType.Pointer]]. */\r\n public closePointerMessage(): void { }\r\n\r\n /** Close message created with [[OutputMessageType.InputField]]. */\r\n public closeInputFieldMessage(): void { }\r\n\r\n /** Setup tool assistance instructions for a tool. The instructions include the main instruction, which includes the current prompt.\r\n * @param instructions The tool assistance instructions.\r\n */\r\n public setToolAssistance(instructions: ToolAssistanceInstructions | undefined) {\r\n this.outputPrompt(instructions ? instructions.mainInstruction.text : \"\");\r\n }\r\n\r\n /**\r\n * Displays a notification message.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n * @param messageType The type of message. Defaults to Toast.\r\n */\r\n public displayMessage(severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string, messageType?: DisplayMessageType): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage, this.convertMessageType(messageType));\r\n this.outputMessage(details);\r\n }\r\n\r\n /**\r\n * Displays an input field notification message.\r\n * @param inputField Input field to which the message pertains. The message will be shown just below this input field element.\r\n * @param severity The severity of the message.\r\n * @param briefMessage A short message that conveys the simplest explanation of the issue.\r\n * @param detailedMessage An optional comprehensive message that explains the issue in detail and potentially offers a solution.\r\n */\r\n public displayInputFieldMessage(inputField: HTMLElement, severity: MessageSeverity, briefMessage: HTMLElement | string, detailedMessage?: HTMLElement | string): void {\r\n const details = new NotifyMessageDetails(this.convertSeverityToPriority(severity), briefMessage, detailedMessage);\r\n details.setInputFieldTypeDetails(inputField);\r\n this.outputMessage(details);\r\n }\r\n\r\n private convertSeverityToPriority(severity: MessageSeverity): OutputMessagePriority {\r\n switch (severity) {\r\n case MessageSeverity.Information:\r\n return OutputMessagePriority.Info;\r\n case MessageSeverity.Warning:\r\n return OutputMessagePriority.Warning;\r\n case MessageSeverity.Error:\r\n return OutputMessagePriority.Error;\r\n case MessageSeverity.Fatal:\r\n return OutputMessagePriority.Fatal;\r\n case MessageSeverity.None:\r\n default:\r\n return OutputMessagePriority.None;\r\n }\r\n }\r\n\r\n private convertMessageType(inMessageType?: DisplayMessageType): OutputMessageType | undefined {\r\n switch (inMessageType) {\r\n case DisplayMessageType.Alert:\r\n return OutputMessageType.Alert;\r\n case DisplayMessageType.InputField:\r\n return OutputMessageType.InputField;\r\n case DisplayMessageType.Sticky:\r\n return OutputMessageType.Sticky;\r\n case DisplayMessageType.Toast:\r\n return OutputMessageType.Toast;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n}\r\n"]}
@@ -5,7 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module Tiles
7
7
  */
8
- import { getJson, request } from "@bentley/itwin-client";
8
+ import { request } from "./request/Request";
9
9
  import { BentleyStatus, Logger } from "@itwin/core-bentley";
10
10
  import { IModelError, RealityDataFormat, RealityDataProvider } from "@itwin/core-common";
11
11
  import { FrontendLoggerCategory } from "./FrontendLoggerCategory";
@@ -214,8 +214,11 @@ class RealityDataSourceImpl {
214
214
  */
215
215
  async getRealityDataTileJson(accessToken, name, realityData) {
216
216
  const url = await realityData.getBlobUrl(accessToken, name);
217
- const data = await getJson(url.toString());
218
- return data;
217
+ const data = await request(url.toString(), {
218
+ method: "GET",
219
+ responseType: "json",
220
+ });
221
+ return data.body;
219
222
  }
220
223
  /**
221
224
  * This method returns the URL to access the actual 3d tiles from the service provider.
@@ -243,8 +246,10 @@ class RealityDataSourceImpl {
243
246
  }
244
247
  else if (this.key.provider === RealityDataProvider.CesiumIonAsset) {
245
248
  this._tilesetUrl = this.key.id;
246
- if (this.key.id === CesiumIonAssetProvider.osmBuildingId)
249
+ if (this.key.id === CesiumIonAssetProvider.osmBuildingId) {
247
250
  this._tilesetUrl = getCesiumOSMBuildingsUrl();
251
+ this._isUrlResolved = true;
252
+ }
248
253
  }
249
254
  return this._tilesetUrl;
250
255
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAkB,MAAM,uBAAuB,CAAC;AACzE,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AAC,CAAC;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,cAAc,CAAC,IAAY;QACtC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,cAAc,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,IAAI,KAAK,KAAK,SAAS,CAAC;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,IAAI,MAAM,IAAK,IAAI,CAAC,WAAW,EAAE;YAC/B,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACzE;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,IAAY;QACnC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,cAAc,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,IAAI,KAAK,KAAK,SAAS,CAAC;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,IAAI,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE;YAC9B,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACtE;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\nimport { getJson, request, RequestOptions } from \"@bentley/itwin-client\";\r\nimport { AccessToken, BentleyStatus, GuidString, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelError, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\nimport { FrontendLoggerCategory } from \"./FrontendLoggerCategory\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAccessTokenAndEndpointUrl, getCesiumOSMBuildingsUrl } from \"./tile/internal\";\r\n\r\n/**\r\n * This interface provide methods used to access a reality data from a reality data provider\r\n * @beta\r\n */\r\nexport interface RealityDataSource {\r\n readonly key: RealityDataSourceKey;\r\n readonly isContextShare: boolean;\r\n readonly realityDataId: string | undefined;\r\n /** Metatdata on the reality data source */\r\n readonly realityData: RealityData | undefined;\r\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\r\n readonly realityDataType: string | undefined;\r\n /**\r\n * This method returns the URL to obtain the Reality Data properties.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\r\n\r\n /**\r\n * Gets a reality data root document json\r\n * @returns tile data json\r\n * @internal\r\n */\r\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\r\n /**\r\n * Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n * @internal\r\n */\r\n getTileContent(name: string): Promise<any>;\r\n /**\r\n * Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n getTileJson(name: string): Promise<any>;\r\n}\r\n/** Utility functions for RealityDataSource\r\n * @beta\r\n */\r\nexport namespace RealityDataSource {\r\n /**\r\n * Create a RealityDataSourceKey from a tilesetUrl.\r\n * @param tilesetUrl the reality data attachment url\r\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\r\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\r\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\r\n */\r\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\r\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\r\n const provider = RealityDataProvider.CesiumIonAsset;\r\n // Keep url hidden and use a dummy id\r\n const cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId };\r\n return cesiumIonAssetKey;\r\n }\r\n\r\n // Try to extract realityDataId from URL and if not possible, use the url as the key\r\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\r\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n format = inputFormat ? inputFormat : info.format;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\r\n return contextShareKey;\r\n }\r\n\r\n // default to tileSetUrl\r\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\r\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\r\n return urlKey;\r\n }\r\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\r\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\r\n const format = inputFormat ? inputFormat : info.format;\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\r\n return contextShareKey;\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\r\n if(orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\r\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName,inputProvider,format);\r\n } else if (orbitGtBlob.rdsUrl) {\r\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl,inputProvider,format);\r\n }\r\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\r\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\r\n return { provider, format, id };\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\r\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\r\n return undefined;\r\n const splitIds = rdSourceKey.id.split(\":\");\r\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\r\n const sasToken = rdSourceKey.id.substr(sasTokenIndex+2);\r\n const orbitGtBlob: OrbitGtBlobProps = {\r\n accountName: splitIds[0],\r\n containerName: splitIds[1],\r\n blobFileName: splitIds[2],\r\n sasToken,\r\n };\r\n return orbitGtBlob;\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\r\n * @internal\r\n */\r\n export async function fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n return RealityDataSourceImpl.fromKey(rdSourceKey, iTwinId);\r\n }\r\n}\r\n\r\n/** This class provides access to the reality data provider services.\r\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\r\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\r\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\r\n * There is a one to one relationship between a reality data and the instances of present class.\r\n* @beta\r\n*/\r\nclass RealityDataSourceImpl implements RealityDataSource {\r\n public readonly key: RealityDataSourceKey;\r\n /** The URL that supplies the 3d tiles for displaying the reality model. */\r\n private _tilesetUrl: string | undefined;\r\n private _isUrlResolved: boolean = false;\r\n private _rd: RealityData | undefined;\r\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\r\n private _baseUrl: string = \"\";\r\n /** Request authorization for non PW ContextShare requests.*/\r\n private _requestAuthorization?: string;\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n protected constructor(props: RealityDataSourceProps) {\r\n this.key = props.sourceKey;\r\n this._isUrlResolved=false;\r\n }\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n public static fromProps(props: RealityDataSourceProps): RealityDataSource {\r\n return new RealityDataSourceImpl(props);\r\n }\r\n /**\r\n * Create an instance of this class from a source key and iTwin context/\r\n */\r\n public static async createFromKey(sourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n const rdSource = new RealityDataSourceImpl({sourceKey});\r\n let tilesetUrl: string | undefined;\r\n try {\r\n await rdSource.queryRealityData(iTwinId);\r\n tilesetUrl = await rdSource.getServiceUrl(iTwinId);\r\n } catch (e) {\r\n }\r\n\r\n return (tilesetUrl !== undefined) ? rdSource: undefined;\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n */\r\n public static async fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n return RealityDataSourceImpl.createFromKey(rdSourceKey, iTwinId);\r\n }\r\n public get isContextShare(): boolean {\r\n return (this.key.provider === RealityDataProvider.ContextShare);\r\n }\r\n /**\r\n * Returns Reality Data if available\r\n */\r\n public get realityData(): RealityData | undefined {\r\n return this._rd;\r\n }\r\n public get realityDataId(): string | undefined {\r\n const realityDataId = this.isContextShare ? this.key.id : undefined;\r\n return realityDataId;\r\n }\r\n /**\r\n * Returns Reality Data type if available\r\n */\r\n public get realityDataType(): string | undefined {\r\n return this._rd?.type;\r\n }\r\n public get iTwinId(): string | undefined {\r\n return this.key.iTwinId;\r\n }\r\n /**\r\n * Query Reality Data from provider\r\n */\r\n private async queryRealityData(iTwinId: GuidString | undefined) {\r\n if (this.isContextShare && !this._rd) {\r\n const token = await IModelApp.getAccessToken();\r\n if (token && this.realityDataId) {\r\n if (undefined === IModelApp.realityDataAccess)\r\n throw new Error(\"Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.\");\r\n this._rd = await IModelApp.realityDataAccess.getRealityData(token, iTwinId, this.realityDataId);\r\n // A reality data that has not root document set should not be considered.\r\n const rootDocument: string = this._rd.rootDocument ?? \"\";\r\n this.setBaseUrl(rootDocument);\r\n }\r\n }\r\n }\r\n // This is to set the root url from the provided root document path.\r\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\r\n // otherwise the full path to root document is given.\r\n // The base URL contains the base URL from which tile relative path are constructed.\r\n // The tile's path root will need to be reinserted for child tiles to return a 200\r\n private setBaseUrl(url: string): void {\r\n const urlParts = url.split(\"/\");\r\n urlParts.pop();\r\n if (urlParts.length === 0)\r\n this._baseUrl = \"\";\r\n else\r\n this._baseUrl = `${urlParts.join(\"/\")}/`;\r\n }\r\n private async _doRequest(url: string, responseType: string): Promise<any> {\r\n let options: RequestOptions = {\r\n method: \"GET\",\r\n responseType,\r\n };\r\n\r\n const authToken = this._requestAuthorization;\r\n if (authToken) {\r\n options = {\r\n ...options,\r\n headers: {\r\n authorization: authToken,\r\n },\r\n };\r\n }\r\n\r\n const data = await request(url, options);\r\n return data.body;\r\n }\r\n /**\r\n * Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n public async getRealityDataTileJson(accessToken: AccessToken, name: string, realityData: RealityData): Promise<any> {\r\n const url = await realityData.getBlobUrl(accessToken, name);\r\n\r\n const data = await getJson(url.toString());\r\n return data;\r\n }\r\n /**\r\n * This method returns the URL to access the actual 3d tiles from the service provider.\r\n * @returns string containing the URL to reality data.\r\n */\r\n public async getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined> {\r\n // If url was not resolved - resolve it\r\n if (this.isContextShare && !this._isUrlResolved) {\r\n const rdSourceKey = this.key;\r\n // we need to resolve tilesetURl from realityDataId and iTwinId\r\n if (undefined === IModelApp.realityDataAccess)\r\n throw new Error(\"Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.\");\r\n try {\r\n const resolvedITwinId = iTwinId ? iTwinId : rdSourceKey.iTwinId;\r\n\r\n this._tilesetUrl = await IModelApp.realityDataAccess.getRealityDataUrl(resolvedITwinId, rdSourceKey.id);\r\n this._isUrlResolved=true;\r\n } catch (e) {\r\n const errMsg = `Error getting URL from ContextShare using realityDataId=${rdSourceKey.id} and iTwinId=${iTwinId}`;\r\n Logger.logError(FrontendLoggerCategory.RealityData, errMsg);\r\n }\r\n } else if (this.key.provider === RealityDataProvider.TilesetUrl) {\r\n this._tilesetUrl = this.key.id;\r\n } else if (this.key.provider === RealityDataProvider.CesiumIonAsset ) {\r\n this._tilesetUrl = this.key.id;\r\n if (this.key.id === CesiumIonAssetProvider.osmBuildingId)\r\n this._tilesetUrl = getCesiumOSMBuildingsUrl();\r\n }\r\n return this._tilesetUrl;\r\n }\r\n /** TODO: This probably required three different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium */\r\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n if (this.isContextShare && token) {\r\n const realityData = this.realityData;\r\n\r\n if (!realityData)\r\n throw new Error(`Reality Data not defined`);\r\n\r\n if (!realityData.rootDocument)\r\n throw new Error(`Root document not defined for reality data: ${realityData.id}`);\r\n\r\n return this.getRealityDataTileJson(token, realityData.rootDocument, realityData);\r\n }\r\n\r\n let url = await this.getServiceUrl(iTwinId);\r\n if (!url)\r\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(url);\r\n if (cesiumAsset) {\r\n const tokenAndUrl = await getCesiumAccessTokenAndEndpointUrl(cesiumAsset.id, cesiumAsset.key);\r\n if (tokenAndUrl.url && tokenAndUrl.token) {\r\n url = tokenAndUrl.url;\r\n this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;\r\n }\r\n }\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n this.setBaseUrl(url);\r\n return this._doRequest(url, \"json\");\r\n }\r\n\r\n /**\r\n * Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n */\r\n public async getRealityDataTileContent(accessToken: AccessToken, name: string, realityData: RealityData): Promise<any> {\r\n const url = await realityData.getBlobUrl(accessToken, name);\r\n const options: RequestOptions = {\r\n method: \"GET\",\r\n responseType: \"arraybuffer\",\r\n };\r\n const data = await request(url.toString(), options);\r\n return data.body;\r\n }\r\n\r\n /**\r\n * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium\r\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileContent(name: string): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n const useRds = this.isContextShare && token !== undefined;\r\n const tileUrl = this._baseUrl + name;\r\n\r\n if (useRds && this.realityData) {\r\n return this.getRealityDataTileContent(token, tileUrl, this.realityData);\r\n }\r\n\r\n return this._doRequest(tileUrl, \"arraybuffer\");\r\n }\r\n\r\n /**\r\n * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium\r\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileJson(name: string): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n const useRds = this.isContextShare && token !== undefined;\r\n const tileUrl = this._baseUrl + name;\r\n\r\n if (useRds && this.realityData) {\r\n return this.getRealityDataTileJson(token, tileUrl, this.realityData);\r\n }\r\n\r\n return this._doRequest(tileUrl, \"json\");\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"RealityDataSource.js","sourceRoot":"","sources":["../../src/RealityDataSource.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,OAAO,EAAkB,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAiC,iBAAiB,EAAE,mBAAmB,EAAgD,MAAM,oBAAoB,CAAC;AACtK,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AA0C7I;;GAEG;AACH,MAAM,KAAW,iBAAiB,CAyEjC;AAzED,WAAiB,iBAAiB;IAChC;;;;;;OAMG;IACH,SAAgB,gBAAgB,CAAC,UAAkB,EAAE,aAAmC,EAAE,WAA+B;QACvH,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,sBAAsB,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;YACpD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,cAAc,CAAC;YACpD,qCAAqC;YACrC,MAAM,iBAAiB,GAAyB,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,sBAAsB,CAAC,aAAa,EAAE,CAAC;YAC/G,OAAO,iBAAiB,CAAC;SAC1B;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AAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErC,IAAI,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE;YAC9B,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SACtE;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\nimport { request, RequestOptions } from \"./request/Request\";\r\nimport { AccessToken, BentleyStatus, GuidString, Logger } from \"@itwin/core-bentley\";\r\nimport { IModelError, OrbitGtBlobProps, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\r\nimport { FrontendLoggerCategory } from \"./FrontendLoggerCategory\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { CesiumIonAssetProvider, ContextShareProvider, getCesiumAccessTokenAndEndpointUrl, getCesiumOSMBuildingsUrl } from \"./tile/internal\";\r\n\r\n/**\r\n * This interface provide methods used to access a reality data from a reality data provider\r\n * @beta\r\n */\r\nexport interface RealityDataSource {\r\n readonly key: RealityDataSourceKey;\r\n readonly isContextShare: boolean;\r\n readonly realityDataId: string | undefined;\r\n /** Metatdata on the reality data source */\r\n readonly realityData: RealityData | undefined;\r\n /** The reality data type (e.g.: \"RealityMesh3DTiles\", OPC, Terrain3DTiles, Cesium3DTiles, ... )*/\r\n readonly realityDataType: string | undefined;\r\n /**\r\n * This method returns the URL to obtain the Reality Data properties.\r\n * @param iTwinId id of associated iTwin project\r\n * @returns string containing the URL to reality data.\r\n */\r\n getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined>;\r\n\r\n /**\r\n * Gets a reality data root document json\r\n * @returns tile data json\r\n * @internal\r\n */\r\n getRootDocument(iTwinId: GuidString | undefined): Promise<any>;\r\n /**\r\n * Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n * @internal\r\n */\r\n getTileContent(name: string): Promise<any>;\r\n /**\r\n * Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n getTileJson(name: string): Promise<any>;\r\n}\r\n/** Utility functions for RealityDataSource\r\n * @beta\r\n */\r\nexport namespace RealityDataSource {\r\n /**\r\n * Create a RealityDataSourceKey from a tilesetUrl.\r\n * @param tilesetUrl the reality data attachment url\r\n * @param inputProvider identify the RealityDataProvider if known, otherwise function will try to extract it from the tilesetUrl\r\n * @param inputFormat identify the RealityDataFormat if known, otherwise function will try to extract it from the tilesetUrl\r\n * @returns the RealityDataSourceKey that uniquely identify a reality data for a provider\r\n */\r\n export function createKeyFromUrl(tilesetUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n let format = inputFormat ? inputFormat : RealityDataFormat.fromUrl(tilesetUrl);\r\n if (CesiumIonAssetProvider.isProviderUrl(tilesetUrl)) {\r\n const provider = RealityDataProvider.CesiumIonAsset;\r\n // Keep url hidden and use a dummy id\r\n const cesiumIonAssetKey: RealityDataSourceKey = { provider, format, id: CesiumIonAssetProvider.osmBuildingId };\r\n return cesiumIonAssetKey;\r\n }\r\n\r\n // Try to extract realityDataId from URL and if not possible, use the url as the key\r\n if (ContextShareProvider.isProviderUrl(tilesetUrl)) {\r\n const info = ContextShareProvider.getInfoFromUrl(tilesetUrl);\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n format = inputFormat ? inputFormat : info.format;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id, iTwinId: info.iTwinId };\r\n return contextShareKey;\r\n }\r\n\r\n // default to tileSetUrl\r\n const provider2 = inputProvider ? inputProvider : RealityDataProvider.TilesetUrl;\r\n const urlKey: RealityDataSourceKey = { provider: provider2, format, id: tilesetUrl };\r\n return urlKey;\r\n }\r\n /** @alpha - was used for a very specific case of point cloud (opc) attachment that should not be made public */\r\n export function createKeyFromBlobUrl(blobUrl: string, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const info = ContextShareProvider.getInfoFromBlobUrl(blobUrl);\r\n const format = inputFormat ? inputFormat : info.format;\r\n const provider = inputProvider ? inputProvider : info.provider;\r\n const contextShareKey: RealityDataSourceKey = { provider, format, id: info.id };\r\n return contextShareKey;\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createKeyFromOrbitGtBlobProps(orbitGtBlob: OrbitGtBlobProps, inputProvider?: RealityDataProvider, inputFormat?: RealityDataFormat): RealityDataSourceKey {\r\n const format = inputFormat ? inputFormat : RealityDataFormat.OPC;\r\n if (orbitGtBlob.blobFileName && orbitGtBlob.blobFileName.toLowerCase().startsWith(\"http\")) {\r\n return RealityDataSource.createKeyFromBlobUrl(orbitGtBlob.blobFileName, inputProvider, format);\r\n } else if (orbitGtBlob.rdsUrl) {\r\n return RealityDataSource.createKeyFromUrl(orbitGtBlob.rdsUrl, inputProvider, format);\r\n }\r\n const provider = inputProvider ? inputProvider : RealityDataProvider.OrbitGtBlob;\r\n const id = `${orbitGtBlob.accountName}:${orbitGtBlob.containerName}:${orbitGtBlob.blobFileName}:?${orbitGtBlob.sasToken}`;\r\n return { provider, format, id };\r\n }\r\n /** @alpha - OrbitGtBlobProps is alpha */\r\n export function createOrbitGtBlobPropsFromKey(rdSourceKey: RealityDataSourceKey): OrbitGtBlobProps | undefined {\r\n if (rdSourceKey.provider !== RealityDataProvider.OrbitGtBlob)\r\n return undefined;\r\n const splitIds = rdSourceKey.id.split(\":\");\r\n const sasTokenIndex = rdSourceKey.id.indexOf(\":?\");\r\n const sasToken = rdSourceKey.id.substr(sasTokenIndex + 2);\r\n const orbitGtBlob: OrbitGtBlobProps = {\r\n accountName: splitIds[0],\r\n containerName: splitIds[1],\r\n blobFileName: splitIds[2],\r\n sasToken,\r\n };\r\n return orbitGtBlob;\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n * There will aways be only one reality data RealityDataSource for a corresponding reality data source key.\r\n * @internal\r\n */\r\n export async function fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n return RealityDataSourceImpl.fromKey(rdSourceKey, iTwinId);\r\n }\r\n}\r\n\r\n/** This class provides access to the reality data provider services.\r\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\r\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\r\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\r\n * There is a one to one relationship between a reality data and the instances of present class.\r\n* @beta\r\n*/\r\nclass RealityDataSourceImpl implements RealityDataSource {\r\n public readonly key: RealityDataSourceKey;\r\n /** The URL that supplies the 3d tiles for displaying the reality model. */\r\n private _tilesetUrl: string | undefined;\r\n private _isUrlResolved: boolean = false;\r\n private _rd: RealityData | undefined;\r\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\r\n private _baseUrl: string = \"\";\r\n /** Request authorization for non PW ContextShare requests.*/\r\n private _requestAuthorization?: string;\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n protected constructor(props: RealityDataSourceProps) {\r\n this.key = props.sourceKey;\r\n this._isUrlResolved = false;\r\n }\r\n\r\n /** Construct a new reality data source.\r\n * @param props JSON representation of the reality data source\r\n */\r\n public static fromProps(props: RealityDataSourceProps): RealityDataSource {\r\n return new RealityDataSourceImpl(props);\r\n }\r\n /**\r\n * Create an instance of this class from a source key and iTwin context/\r\n */\r\n public static async createFromKey(sourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n const rdSource = new RealityDataSourceImpl({ sourceKey });\r\n let tilesetUrl: string | undefined;\r\n try {\r\n await rdSource.queryRealityData(iTwinId);\r\n tilesetUrl = await rdSource.getServiceUrl(iTwinId);\r\n } catch (e) {\r\n }\r\n\r\n return (tilesetUrl !== undefined) ? rdSource : undefined;\r\n }\r\n /** Return an instance of a RealityDataSource from a source key.\r\n */\r\n public static async fromKey(rdSourceKey: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\r\n return RealityDataSourceImpl.createFromKey(rdSourceKey, iTwinId);\r\n }\r\n public get isContextShare(): boolean {\r\n return (this.key.provider === RealityDataProvider.ContextShare);\r\n }\r\n /**\r\n * Returns Reality Data if available\r\n */\r\n public get realityData(): RealityData | undefined {\r\n return this._rd;\r\n }\r\n public get realityDataId(): string | undefined {\r\n const realityDataId = this.isContextShare ? this.key.id : undefined;\r\n return realityDataId;\r\n }\r\n /**\r\n * Returns Reality Data type if available\r\n */\r\n public get realityDataType(): string | undefined {\r\n return this._rd?.type;\r\n }\r\n public get iTwinId(): string | undefined {\r\n return this.key.iTwinId;\r\n }\r\n /**\r\n * Query Reality Data from provider\r\n */\r\n private async queryRealityData(iTwinId: GuidString | undefined) {\r\n if (this.isContextShare && !this._rd) {\r\n const token = await IModelApp.getAccessToken();\r\n if (token && this.realityDataId) {\r\n if (undefined === IModelApp.realityDataAccess)\r\n throw new Error(\"Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.\");\r\n this._rd = await IModelApp.realityDataAccess.getRealityData(token, iTwinId, this.realityDataId);\r\n // A reality data that has not root document set should not be considered.\r\n const rootDocument: string = this._rd.rootDocument ?? \"\";\r\n this.setBaseUrl(rootDocument);\r\n }\r\n }\r\n }\r\n // This is to set the root url from the provided root document path.\r\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\r\n // otherwise the full path to root document is given.\r\n // The base URL contains the base URL from which tile relative path are constructed.\r\n // The tile's path root will need to be reinserted for child tiles to return a 200\r\n private setBaseUrl(url: string): void {\r\n const urlParts = url.split(\"/\");\r\n urlParts.pop();\r\n if (urlParts.length === 0)\r\n this._baseUrl = \"\";\r\n else\r\n this._baseUrl = `${urlParts.join(\"/\")}/`;\r\n }\r\n private async _doRequest(url: string, responseType: string): Promise<any> {\r\n let options: RequestOptions = {\r\n method: \"GET\",\r\n responseType,\r\n };\r\n\r\n const authToken = this._requestAuthorization;\r\n if (authToken) {\r\n options = {\r\n ...options,\r\n headers: {\r\n authorization: authToken,\r\n },\r\n };\r\n }\r\n\r\n const data = await request(url, options);\r\n return data.body;\r\n }\r\n /**\r\n * Gets a tileset's app data json\r\n * @param name name or path of tile\r\n * @returns app data json object\r\n * @internal\r\n */\r\n public async getRealityDataTileJson(accessToken: AccessToken, name: string, realityData: RealityData): Promise<any> {\r\n const url = await realityData.getBlobUrl(accessToken, name);\r\n\r\n const data = await request(url.toString(), {\r\n method: \"GET\",\r\n responseType: \"json\",\r\n });\r\n return data.body;\r\n }\r\n\r\n /**\r\n * This method returns the URL to access the actual 3d tiles from the service provider.\r\n * @returns string containing the URL to reality data.\r\n */\r\n public async getServiceUrl(iTwinId: GuidString | undefined): Promise<string | undefined> {\r\n // If url was not resolved - resolve it\r\n if (this.isContextShare && !this._isUrlResolved) {\r\n const rdSourceKey = this.key;\r\n // we need to resolve tilesetURl from realityDataId and iTwinId\r\n if (undefined === IModelApp.realityDataAccess)\r\n throw new Error(\"Missing an implementation of RealityDataAccess on IModelApp, it is required to access reality data. Please provide an implementation to the IModelApp.startup using IModelAppOptions.realityDataAccess.\");\r\n try {\r\n const resolvedITwinId = iTwinId ? iTwinId : rdSourceKey.iTwinId;\r\n\r\n this._tilesetUrl = await IModelApp.realityDataAccess.getRealityDataUrl(resolvedITwinId, rdSourceKey.id);\r\n this._isUrlResolved = true;\r\n } catch (e) {\r\n const errMsg = `Error getting URL from ContextShare using realityDataId=${rdSourceKey.id} and iTwinId=${iTwinId}`;\r\n Logger.logError(FrontendLoggerCategory.RealityData, errMsg);\r\n }\r\n } else if (this.key.provider === RealityDataProvider.TilesetUrl) {\r\n this._tilesetUrl = this.key.id;\r\n } else if (this.key.provider === RealityDataProvider.CesiumIonAsset) {\r\n this._tilesetUrl = this.key.id;\r\n if (this.key.id === CesiumIonAssetProvider.osmBuildingId) {\r\n this._tilesetUrl = getCesiumOSMBuildingsUrl();\r\n this._isUrlResolved = true;\r\n }\r\n }\r\n return this._tilesetUrl;\r\n }\r\n /** TODO: This probably required three different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium */\r\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n if (this.isContextShare && token) {\r\n const realityData = this.realityData;\r\n\r\n if (!realityData)\r\n throw new Error(`Reality Data not defined`);\r\n\r\n if (!realityData.rootDocument)\r\n throw new Error(`Root document not defined for reality data: ${realityData.id}`);\r\n\r\n return this.getRealityDataTileJson(token, realityData.rootDocument, realityData);\r\n }\r\n\r\n let url = await this.getServiceUrl(iTwinId);\r\n if (!url)\r\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n const cesiumAsset = CesiumIonAssetProvider.parseCesiumUrl(url);\r\n if (cesiumAsset) {\r\n const tokenAndUrl = await getCesiumAccessTokenAndEndpointUrl(cesiumAsset.id, cesiumAsset.key);\r\n if (tokenAndUrl.url && tokenAndUrl.token) {\r\n url = tokenAndUrl.url;\r\n this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;\r\n }\r\n }\r\n\r\n // The following is only if the reality data is not stored on PW Context Share.\r\n this.setBaseUrl(url);\r\n return this._doRequest(url, \"json\");\r\n }\r\n\r\n /**\r\n * Gets tile content\r\n * @param name name or path of tile\r\n * @returns array buffer of tile content\r\n */\r\n public async getRealityDataTileContent(accessToken: AccessToken, name: string, realityData: RealityData): Promise<any> {\r\n const url = await realityData.getBlobUrl(accessToken, name);\r\n const options: RequestOptions = {\r\n method: \"GET\",\r\n responseType: \"arraybuffer\",\r\n };\r\n const data = await request(url.toString(), options);\r\n return data.body;\r\n }\r\n\r\n /**\r\n * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium\r\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileContent(name: string): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n const useRds = this.isContextShare && token !== undefined;\r\n const tileUrl = this._baseUrl + name;\r\n\r\n if (useRds && this.realityData) {\r\n return this.getRealityDataTileContent(token, tileUrl, this.realityData);\r\n }\r\n\r\n return this._doRequest(tileUrl, \"arraybuffer\");\r\n }\r\n\r\n /**\r\n * TODO: This probably required different realitydataSource implementations based on different provider -> locally hosted, RDS and cesium\r\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\r\n */\r\n public async getTileJson(name: string): Promise<any> {\r\n const token = await IModelApp.getAccessToken();\r\n const useRds = this.isContextShare && token !== undefined;\r\n const tileUrl = this._baseUrl + name;\r\n\r\n if (useRds && this.realityData) {\r\n return this.getRealityDataTileJson(token, tileUrl, this.realityData);\r\n }\r\n\r\n return this._doRequest(tileUrl, \"json\");\r\n }\r\n}\r\n\r\n"]}
@@ -654,7 +654,7 @@ class RasterAttachment {
654
654
  const skew = maxSize / height;
655
655
  view.setAspectRatioSkew(skew);
656
656
  if (true !== ((_b = (_a = props.jsonProperties) === null || _a === void 0 ? void 0 : _a.displayOptions) === null || _b === void 0 ? void 0 : _b.preserveBackground)) {
657
- // Make background color 100% transparent so that Viewport.readImage() will discard transparent pixels.
657
+ // Make background color 100% transparent so that Viewport.readImageBuffer() will discard transparent pixels.
658
658
  const bgColor = sheetView.displayStyle.backgroundColor.withAlpha(0);
659
659
  view.displayStyle.backgroundColor = bgColor;
660
660
  }
@@ -716,7 +716,7 @@ class RasterAttachment {
716
716
  createGraphics(vp) {
717
717
  var _a, _b;
718
718
  // Create a texture from the contents of the view.
719
- const image = vp.readImage(vp.viewRect, undefined, false);
719
+ const image = vp.readImageBuffer({ upsideDown: true });
720
720
  if (undefined === image)
721
721
  return undefined;
722
722
  const debugImage = false; // set to true to open a window displaying the captured image.