@itwin/core-frontend 4.0.0-dev.70 → 4.0.0-dev.72

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 (130) hide show
  1. package/CHANGELOG.md +74 -37
  2. package/lib/cjs/BingLocation.d.ts.map +1 -1
  3. package/lib/cjs/BingLocation.js +4 -5
  4. package/lib/cjs/BingLocation.js.map +1 -1
  5. package/lib/cjs/BriefcaseConnection.js.map +1 -1
  6. package/lib/cjs/NativeApp.d.ts.map +1 -1
  7. package/lib/cjs/NativeApp.js +0 -3
  8. package/lib/cjs/NativeApp.js.map +1 -1
  9. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -2
  10. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  11. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js +6 -20
  12. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  13. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts +1 -1
  14. package/lib/cjs/RealityDataSourceContextShareImpl.d.ts.map +1 -1
  15. package/lib/cjs/RealityDataSourceContextShareImpl.js +2 -11
  16. package/lib/cjs/RealityDataSourceContextShareImpl.js.map +1 -1
  17. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +4 -2
  18. package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
  19. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +4 -12
  20. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  21. package/lib/cjs/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
  22. package/lib/cjs/extension/providers/RemoteExtensionProvider.js +1 -8
  23. package/lib/cjs/extension/providers/RemoteExtensionProvider.js.map +1 -1
  24. package/lib/cjs/render/primitives/PointCloudPrimitive.d.ts +1 -1
  25. package/lib/cjs/render/primitives/PointCloudPrimitive.d.ts.map +1 -1
  26. package/lib/cjs/render/primitives/PointCloudPrimitive.js.map +1 -1
  27. package/lib/cjs/render/webgl/AttributeBuffers.d.ts +1 -1
  28. package/lib/cjs/render/webgl/AttributeBuffers.d.ts.map +1 -1
  29. package/lib/cjs/render/webgl/AttributeBuffers.js.map +1 -1
  30. package/lib/cjs/render/webgl/PointCloud.js +1 -1
  31. package/lib/cjs/render/webgl/PointCloud.js.map +1 -1
  32. package/lib/cjs/request/Request.d.ts +17 -143
  33. package/lib/cjs/request/Request.d.ts.map +1 -1
  34. package/lib/cjs/request/Request.js +46 -303
  35. package/lib/cjs/request/Request.js.map +1 -1
  36. package/lib/cjs/tile/PntsReader.d.ts +5 -1
  37. package/lib/cjs/tile/PntsReader.d.ts.map +1 -1
  38. package/lib/cjs/tile/PntsReader.js +28 -25
  39. package/lib/cjs/tile/PntsReader.js.map +1 -1
  40. package/lib/cjs/tile/RealityTileLoader.d.ts.map +1 -1
  41. package/lib/cjs/tile/RealityTileLoader.js +14 -3
  42. package/lib/cjs/tile/RealityTileLoader.js.map +1 -1
  43. package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -1
  44. package/lib/cjs/tile/map/ArcGISTileMap.js +1 -5
  45. package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
  46. package/lib/cjs/tile/map/BingElevation.d.ts.map +1 -1
  47. package/lib/cjs/tile/map/BingElevation.js +6 -16
  48. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  49. package/lib/cjs/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  50. package/lib/cjs/tile/map/CesiumTerrainProvider.js +12 -18
  51. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  52. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  53. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +1 -3
  54. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  55. package/lib/cjs/tile/map/MapLayerSources.js +1 -1
  56. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  57. package/lib/cjs/tile/map/WmsCapabilities.d.ts.map +1 -1
  58. package/lib/cjs/tile/map/WmsCapabilities.js +3 -6
  59. package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
  60. package/lib/cjs/tile/map/WmtsCapabilities.d.ts.map +1 -1
  61. package/lib/cjs/tile/map/WmtsCapabilities.js +3 -6
  62. package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
  63. package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
  64. package/lib/cjs/tools/ViewTool.js +0 -3
  65. package/lib/cjs/tools/ViewTool.js.map +1 -1
  66. package/lib/esm/BingLocation.d.ts.map +1 -1
  67. package/lib/esm/BingLocation.js +4 -5
  68. package/lib/esm/BingLocation.js.map +1 -1
  69. package/lib/esm/BriefcaseConnection.js.map +1 -1
  70. package/lib/esm/NativeApp.d.ts.map +1 -1
  71. package/lib/esm/NativeApp.js +0 -3
  72. package/lib/esm/NativeApp.js.map +1 -1
  73. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts +1 -2
  74. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.d.ts.map +1 -1
  75. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js +6 -20
  76. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  77. package/lib/esm/RealityDataSourceContextShareImpl.d.ts +1 -1
  78. package/lib/esm/RealityDataSourceContextShareImpl.d.ts.map +1 -1
  79. package/lib/esm/RealityDataSourceContextShareImpl.js +2 -11
  80. package/lib/esm/RealityDataSourceContextShareImpl.js.map +1 -1
  81. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +4 -2
  82. package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
  83. package/lib/esm/RealityDataSourceTilesetUrlImpl.js +4 -12
  84. package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  85. package/lib/esm/extension/providers/RemoteExtensionProvider.d.ts.map +1 -1
  86. package/lib/esm/extension/providers/RemoteExtensionProvider.js +1 -8
  87. package/lib/esm/extension/providers/RemoteExtensionProvider.js.map +1 -1
  88. package/lib/esm/render/primitives/PointCloudPrimitive.d.ts +1 -1
  89. package/lib/esm/render/primitives/PointCloudPrimitive.d.ts.map +1 -1
  90. package/lib/esm/render/primitives/PointCloudPrimitive.js.map +1 -1
  91. package/lib/esm/render/webgl/AttributeBuffers.d.ts +1 -1
  92. package/lib/esm/render/webgl/AttributeBuffers.d.ts.map +1 -1
  93. package/lib/esm/render/webgl/AttributeBuffers.js.map +1 -1
  94. package/lib/esm/render/webgl/PointCloud.js +1 -1
  95. package/lib/esm/render/webgl/PointCloud.js.map +1 -1
  96. package/lib/esm/request/Request.d.ts +17 -143
  97. package/lib/esm/request/Request.d.ts.map +1 -1
  98. package/lib/esm/request/Request.js +42 -275
  99. package/lib/esm/request/Request.js.map +1 -1
  100. package/lib/esm/tile/PntsReader.d.ts +5 -1
  101. package/lib/esm/tile/PntsReader.d.ts.map +1 -1
  102. package/lib/esm/tile/PntsReader.js +29 -26
  103. package/lib/esm/tile/PntsReader.js.map +1 -1
  104. package/lib/esm/tile/RealityTileLoader.d.ts.map +1 -1
  105. package/lib/esm/tile/RealityTileLoader.js +14 -3
  106. package/lib/esm/tile/RealityTileLoader.js.map +1 -1
  107. package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -1
  108. package/lib/esm/tile/map/ArcGISTileMap.js +1 -5
  109. package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
  110. package/lib/esm/tile/map/BingElevation.d.ts.map +1 -1
  111. package/lib/esm/tile/map/BingElevation.js +6 -16
  112. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  113. package/lib/esm/tile/map/CesiumTerrainProvider.d.ts.map +1 -1
  114. package/lib/esm/tile/map/CesiumTerrainProvider.js +12 -18
  115. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  116. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
  117. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -3
  118. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  119. package/lib/esm/tile/map/MapLayerSources.js +2 -2
  120. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  121. package/lib/esm/tile/map/WmsCapabilities.d.ts.map +1 -1
  122. package/lib/esm/tile/map/WmsCapabilities.js +3 -6
  123. package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
  124. package/lib/esm/tile/map/WmtsCapabilities.d.ts.map +1 -1
  125. package/lib/esm/tile/map/WmtsCapabilities.js +3 -6
  126. package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
  127. package/lib/esm/tools/ViewTool.d.ts.map +1 -1
  128. package/lib/esm/tools/ViewTool.js +0 -3
  129. package/lib/esm/tools/ViewTool.js.map +1 -1
  130. package/package.json +21 -27
package/CHANGELOG.md CHANGED
@@ -1,6 +1,43 @@
1
1
  # Change Log - @itwin/core-frontend
2
2
 
3
- This log was last generated on Wed, 08 Feb 2023 14:58:40 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 12 Apr 2023 13:12:42 GMT and should not be manually modified.
4
+
5
+ ## 3.7.2
6
+ Wed, 12 Apr 2023 13:12:42 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.7.1
11
+ Mon, 03 Apr 2023 15:15:37 GMT
12
+
13
+ ### Updates
14
+
15
+ - Add an option for ViewCreator3d to make all subcategories visible.
16
+
17
+ ## 3.7.0
18
+ Wed, 29 Mar 2023 15:02:27 GMT
19
+
20
+ ### Updates
21
+
22
+ - Deprecate IModelConnection's query, queryRowCount, and restartQuery methods.
23
+ - Deprecated IModelAppOptions.rpcInterfaces in favor of using platform-specific RPC manager.
24
+ - Fixed clipping problem with decorators.
25
+ - Localize tooltips for view clip decorations.
26
+
27
+ ## 3.6.3
28
+ Mon, 27 Mar 2023 16:26:47 GMT
29
+
30
+ _Version update only_
31
+
32
+ ## 3.6.2
33
+ Fri, 17 Mar 2023 17:52:32 GMT
34
+
35
+ _Version update only_
36
+
37
+ ## 3.6.1
38
+ Fri, 24 Feb 2023 22:00:48 GMT
39
+
40
+ _Version update only_
4
41
 
5
42
  ## 3.6.0
6
43
  Wed, 08 Feb 2023 14:58:40 GMT
@@ -324,7 +361,7 @@ Tue, 29 Mar 2022 20:53:47 GMT
324
361
  - Promote QuantityFormatter from beta to public.
325
362
  - Now initializing Unit alternate display labels from UNIT_EXTRA_DATA. Minimal changes to support Units schema retrieval from backend iModels.
326
363
  - Functions that fit a view to a volume accept an optional MarginOptions specifying how tightly to fit.
327
- - Defaulting to the internal BasicUnitsProvider if QuantityFormatter units provider initialization fails.
364
+ - Defaulting to the internal BasicUnitsProvider if QuantityFormatter units provider initialization fails.
328
365
  - Ensure view attachments referencing section drawings transform the spatial view's clip into sheet coordinates.
329
366
  - Switched to more flexible extension api
330
367
  - Generalize the concept of a TileUser to include types other than Viewports.
@@ -420,7 +457,7 @@ Mon, 24 Jan 2022 14:00:52 GMT
420
457
  - rename to @itwin/core-frontend
421
458
  - Support reading non-binary glTF assets.
422
459
  - Fix non-locatable override for point clouds
423
- - separate OnViewExtentsError from ViewChangeOptions
460
+ - separate OnViewExtentsError from ViewChangeOptions
424
461
  - Support to open OPC file from any server
425
462
  - Enhancements and improvements to particle systems.
426
463
  - Removed WebAppViewer
@@ -944,7 +981,7 @@ Fri, 02 Apr 2021 13:18:42 GMT
944
981
 
945
982
  - Polish up InteractiveEditingSession API and promote to beta.
946
983
  - rework Authentication to use IpcHost
947
- - Fixed isAuthorized check.
984
+ - Fixed isAuthorized check.
948
985
  - Fix GPU Profiler for display-test-app
949
986
  - Grid drawing code
950
987
  - fixed z for edges and polylines when extended behind the eye
@@ -961,7 +998,7 @@ Fri, 02 Apr 2021 13:18:42 GMT
961
998
  - Align scheduling of tile content requests more closely with capabilities of HTTP and RPC.
962
999
  - Support for Bump Tool Settings
963
1000
  - Add missing ViewState.viewFlags setter.
964
- - Simplified web app signIn, following the pattern established for desktops. The logic for silent signin has now been moved to WebViewerApp.
1001
+ - Simplified web app signIn, following the pattern established for desktops. The logic for silent signin has now been moved to WebViewerApp.
965
1002
 
966
1003
  ## 2.13.0
967
1004
  Tue, 09 Mar 2021 20:28:13 GMT
@@ -1266,8 +1303,8 @@ Fri, 02 Oct 2020 18:03:32 GMT
1266
1303
 
1267
1304
  - Added MapLayerSettingsService to persist custom map sources between sessions for same project/model
1268
1305
  - Support authorization via URL suffix for Cesium ion. Handle PBR texture.
1269
- - Fixes to front end methods to pull, merge and push.
1270
- - Fixed desktop authorization after recent changes.
1306
+ - Fixes to front end methods to pull, merge and push.
1307
+ - Fixed desktop authorization after recent changes.
1271
1308
  - Support literal double-quote characters in quoted key-in arguments.
1272
1309
  - Restore reality model and schedule script init - inadvertently removed.
1273
1310
  - Generate normals for 3d view decorations.
@@ -1364,7 +1401,7 @@ Thu, 20 Aug 2020 20:57:09 GMT
1364
1401
 
1365
1402
  ### Updates
1366
1403
 
1367
- - Change to use toast message to inform user of extension loaded.
1404
+ - Change to use toast message to inform user of extension loaded.
1368
1405
  - Decorators can now optionally have their decorations cached to achieve a potential performance benefit.
1369
1406
  - Introduce IModelApp security options (including CSRF protection).
1370
1407
  - Fixed Web Accessibility issues
@@ -1502,7 +1539,7 @@ Wed, 06 May 2020 13:17:49 GMT
1502
1539
 
1503
1540
  ### Updates
1504
1541
 
1505
- - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
1542
+ - Fixed setup of UserInfo from browser clients, and more cleanups to AccessToken API.
1506
1543
  - Add a peerDependency on @bentley/extension-client
1507
1544
  - lookAtViewAlignedVolume should adjust view delta for limits and not fail.
1508
1545
  - Show min/max window error for mouse wheel zoom.
@@ -1515,7 +1552,7 @@ Wed, 06 May 2020 13:17:49 GMT
1515
1552
  - `IModelApp.shutdown()` is now async.
1516
1553
  - Make locate work for background map with depth turned off.
1517
1554
  - Setup initialization of briefcase cache for offline workflows. (VSTS#286489)
1518
- - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1555
+ - Monitor progress of downloading briefcases, ability to cancel download of briefcases.
1519
1556
  - Introduce BriefcaseConnection, make IModelConnection abstract
1520
1557
  - Remove ^ for ulas client dep in the frontend"
1521
1558
  - Improve performance of shadow display on macOS by avoiding frequent calls to gl.getParameter().
@@ -1528,7 +1565,7 @@ Wed, 06 May 2020 13:17:49 GMT
1528
1565
  - WebGL Compatibility functionality moved to webgl-compatibility package
1529
1566
  - Added support for backward slashes in erroneous URLs of Reality Data in PW Context Share
1530
1567
  - Reality models now cast and receive solar shadows.
1531
- - NativeApp.deleteBriefcase should work in offline scenarios.
1568
+ - NativeApp.deleteBriefcase should work in offline scenarios.
1532
1569
  - Dont reproject tiles if GeoLocation from tool.
1533
1570
  - Support for progress/cancel from ios
1534
1571
  - Ensure view decorations are scaled based on device-pixel ratio.
@@ -1572,14 +1609,14 @@ Wed, 06 May 2020 13:17:49 GMT
1572
1609
  - Ensure the view updates in response to changes to terrain transparency.
1573
1610
  - openBriefcase should not access internet.
1574
1611
  - Fix material color inappropriately being applied in SolidFill mode when feature symbology overrides are in effect.
1575
- - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1576
- - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1577
- - Differentiated RemoteBriefcaseConnection-s from LocalBriefcaseConnection-s for use in web and native applications. These are now sub-classes of the abstract base class BriefcaseConnection.
1578
- - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1612
+ - Added NativeApp.deleteBriefcase, avoided authorization exceptions when offline.
1613
+ - Refactored NativeApp API and RPC interfaces. This continues to be WIP.
1614
+ - Differentiated RemoteBriefcaseConnection-s from LocalBriefcaseConnection-s for use in web and native applications. These are now sub-classes of the abstract base class BriefcaseConnection.
1615
+ - Setup ability to use NativeApp.openBriefcase() in offline scenarios.
1579
1616
  - add new interface for native app
1580
- - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1617
+ - VSTS#217447, 162382: Cleanups to implementation of downloading/opening/discovering briefcases in native applications (WIP).
1581
1618
  - initialize connectivity status on NativeApp.startup() and unregister callback on NativeApp.shutdown()
1582
- - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1619
+ - VSTS#296110: Setup a way to close briefcases when the native application is offline.
1583
1620
  - Remove named clip code, we ended up not wanting to save clips independent of saved views.
1584
1621
  - Renamed OIDC constructs for consistency; Removed SAML support.
1585
1622
  - Support OrbitGT point cloud dislay.
@@ -1593,7 +1630,7 @@ Wed, 06 May 2020 13:17:49 GMT
1593
1630
  - Ensure unused tile trees are purged at regular intervals.
1594
1631
  - Added API in MessageManager to display either a Toast or Sticky message using React components.
1595
1632
  - Always accept point on reality model when snapping and remove message about nearest snap.
1596
- - Optimize reality tile display.
1633
+ - Optimize reality tile display.
1597
1634
  - Add mechanism to preload reality tiles included in an expanded frustum. Support display of ellipsoidal map tiles without depth buffering.
1598
1635
  - Reduce the number of surface shader variations by 75%
1599
1636
  - react to new clients packages from imodeljs-clients
@@ -1674,7 +1711,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1674
1711
  - Fix regression causing background map to be affected by view's symbology overrides.
1675
1712
  - Added support for backward slashes in erroneous URLs of Reality Data in PW Context Share
1676
1713
  - Prevent reuse of cached tiles after project extents change.
1677
- - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1714
+ - VSTS#256133: Fixed issue with reopening connections if the backend crashes. Fixes to integration tests.
1678
1715
  - Fix incorrect aspect ratio for 3d view attachments.
1679
1716
  - Overriding transparency of a textured surface or raster text multiplies the texture alpha by the override rather than replacing it.
1680
1717
  - Better documentation of OidcDesktopClient/IOidcFrontendClient
@@ -1687,7 +1724,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
1687
1724
  - Resolve circular dependencies between tile-related types.
1688
1725
  - Support for TypeDoc 0.16.8
1689
1726
  - Mark as deprecated classes and interfaces that have moved to bentley/ui-abstract.
1690
- - Change feature tracking API for plugins as requested by Design Review.
1727
+ - Change feature tracking API for plugins as requested by Design Review.
1691
1728
  - EN: #124601 - Initial implementation of WebGL2
1692
1729
 
1693
1730
  ## 1.11.0
@@ -1722,7 +1759,7 @@ Tue, 07 Jan 2020 19:44:01 GMT
1722
1759
 
1723
1760
  ### Updates
1724
1761
 
1725
- - Clear reality tile children loading flag when selecting.
1762
+ - Clear reality tile children loading flag when selecting.
1726
1763
  - Animate change view operations
1727
1764
  - Average the gpu profiler times for the last 120 frames instead of updating each frame; also simplify PerformnaceMetrics
1728
1765
  - Implement tile availability testing for Cesium World Terrain.
@@ -1765,7 +1802,7 @@ Tue, 10 Dec 2019 18:08:56 GMT
1765
1802
  - Code quality report fixes
1766
1803
  - Make iModel.js viewports adhere to DPI of a host display.
1767
1804
  - Code cleanup from codeQL hits
1768
- - Setup OidcDesktopClient for Electron use cases.
1805
+ - Setup OidcDesktopClient for Electron use cases.
1769
1806
  - Don't execute our event loop if there is no need
1770
1807
  - Fix regression causing animation to be uneven.
1771
1808
  - Fix warnings from static analysis
@@ -1829,7 +1866,7 @@ Fri, 01 Nov 2019 13:28:37 GMT
1829
1866
  - Anisotropic filting of draped map tiles.
1830
1867
  - Add debug tool for drape frustum.
1831
1868
  - Added MarkerSet.changeViewport
1832
- - Allow sub classes of OidcBrowserClient to override the settings passed to the underlying oidc-client library.
1869
+ - Allow sub classes of OidcBrowserClient to override the settings passed to the underlying oidc-client library.
1833
1870
  - Tweaks to ambient occlusion settings.
1834
1871
  - Fixed issues with use of OIDC AuthCode workflow in Electron and Single Page Applications.
1835
1872
  - Update DefaultToolSettingsProvider to create responisve UI.
@@ -1857,7 +1894,7 @@ Fri, 01 Nov 2019 13:28:37 GMT
1857
1894
  - Fixed bug that caused duplicated points to be handled improperly in batched spatial<->geocoord conversions
1858
1895
  - MarkerSet applies only to a single ScreenViewport
1859
1896
  - Make viewport member of MarkerSet public
1860
- - More OIDC fixes for logout of electron apps.
1897
+ - More OIDC fixes for logout of electron apps.
1861
1898
  - Improve performance for multiple viewports.
1862
1899
  - Added New badge for UI items
1863
1900
  - Cross-platform function to open an image in a new window.
@@ -1910,7 +1947,7 @@ Mon, 30 Sep 2019 22:28:48 GMT
1910
1947
  - Added Cesium ION logo; fixed exception when opening a second viewport while terrain, shadows, or planar classification are enabled.
1911
1948
  - Add checkbrowser.js, refine i18n in Tool
1912
1949
  - Don't try to correct clip plane handle location when plane has been moved outside project extents. Updated image for two finger drag svg.
1913
- - Refine frustum calculation for planar projection to create a tighter fit.
1950
+ - Refine frustum calculation for planar projection to create a tighter fit.
1914
1951
  - Added ViewManager.getElementToolTip for overriding default persistent element tooltip.
1915
1952
  - Various EVSM shadow tweaks
1916
1953
  - Fix scenario in which a tile request is canceled after its http request completes and it remains perpetually in the request queue.
@@ -1973,7 +2010,7 @@ Tue, 10 Sep 2019 12:09:49 GMT
1973
2010
  - Support reality model masking via black classifier geometry.
1974
2011
  - Support nearest snap for reality models.
1975
2012
  - Remove doubling of planar classifier size. This caused excessive generation time.
1976
- - Refine texture projection calculation to include height range (for terrain).
2013
+ - Refine texture projection calculation to include height range (for terrain).
1977
2014
  - Ensure DisplayStyle3dState.sunDirection is synchronized with DisplayStyle3dSettings JSON.
1978
2015
  - Clip volume applied to view also applies to reality models.
1979
2016
  - Added SetupCameraTool for defining camera by eye point and target point.
@@ -2046,7 +2083,7 @@ Wed, 24 Jul 2019 11:47:26 GMT
2046
2083
  - Various OIDC related fixes - Bugs: 148507, 148508, Product Backlog Items: 148510, 148517, 148522.
2047
2084
  - Add PluginUiManager class and PluginUiProvider interface that will be used by Plugins to specify UI components to add to an iModeljs application.
2048
2085
  - Choose handle location for for section plane that is visible in the view.
2049
- - Temporarily undid change to save tokens in local storage.
2086
+ - Temporarily undid change to save tokens in local storage.
2050
2087
  - Added ToolAssistance support and Tool.iconSpec
2051
2088
  - The WebGL rendering system now takes advantage of Vertex Array Objects if they are available via an extension. These provide a measurable performance increase in certain datasets.
2052
2089
 
@@ -2079,7 +2116,7 @@ Mon, 01 Jul 2019 19:04:29 GMT
2079
2116
  - Allow index.html to set a CDN from which to load imodeljs external modules.
2080
2117
  - Make Viewport.invaildateDecorations @beta, was @internal
2081
2118
  - Add default unhandled exception handler to ToolAdmin
2082
- - Added feature tracking info to UserInfo obtained by OidcBrowserClient.
2119
+ - Added feature tracking info to UserInfo obtained by OidcBrowserClient.
2083
2120
  - Ensure we never have two active snap or tooltip requests
2084
2121
  - Refine tile selection for map tiles
2085
2122
  - Prevent default symbology overrides applying to subcategories whose appearances were explicitly overridden.
@@ -2099,7 +2136,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
2099
2136
  ### Updates
2100
2137
 
2101
2138
  - RPC system now accepts only basic values (primitives, "interface" objects, and binary).
2102
- - Updated release tags.
2139
+ - Updated release tags.
2103
2140
  - Added Viewport.changeViewedModel2d
2104
2141
  - Clip shape tool should only set AccuDraw rotation on 1st point.
2105
2142
  - Fix a prompt. Clip from element change to ignore selection set containing clip transient.
@@ -2132,7 +2169,7 @@ Mon, 03 Jun 2019 18:09:39 GMT
2132
2169
  - Set max tiles to skip to 1 for reality model tiles. (better user experience)
2133
2170
  - Set release tags for TiledGraphicsProvider classes
2134
2171
  - Reload tile tree if animation id changes
2135
- - Removed use of OidcClientWrapper.
2172
+ - Removed use of OidcClientWrapper.
2136
2173
  - Add cSpell comment.
2137
2174
  - Rename terrain to backgroundMap.
2138
2175
  - Add IModelApp.queryRenderCompatibility() API to allow querying of any rendering limitations of a client system.
@@ -2167,7 +2204,7 @@ Mon, 13 May 2019 15:52:05 GMT
2167
2204
  - Save ClipVector on ViewState instead of always creating new one from json.
2168
2205
  - Set initial GL state to match default
2169
2206
  - Dispose of planar classifiers.
2170
- - Add spatial classifier UX
2207
+ - Add spatial classifier UX
2171
2208
  - Hide clip decoration during modify. Easier right-click/touch tap support for non-handle pickable decoration.
2172
2209
  - Add orientation option button to toolsettings for ClipByPlane/ClipByShape tools.
2173
2210
  - ConvexClipPlaneSet modify handles. Make EmphasizeElements internal.
@@ -2237,7 +2274,7 @@ Mon, 13 May 2019 15:52:05 GMT
2237
2274
  - Remove "assembly lock" from SelectTool now that SelectionScope has been implemented.
2238
2275
  - Remove IModelApp subclasses
2239
2276
  - Remove IModelConnection.openStandalone and IModelConnection.closeStandalone
2240
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
2277
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
2241
2278
  - Allow tile content to be requested without edge data, reducing tile size and download time.
2242
2279
  - Support image textures larger than WebGL capabilities by resizing them.
2243
2280
  - Update icons-generic-webfont version to latest available.
@@ -2318,7 +2355,7 @@ Wed, 06 Mar 2019 15:41:22 GMT
2318
2355
  - Fix clipping volume being inconsistently applied to view.
2319
2356
  - Don't make textures transparent unless technique enables it.
2320
2357
  - Fix incorrect "fit view" behavior when empty tiles exist.
2321
- - Handle relative subpaths in reality model tile trees. Handle Y for axis/
2358
+ - Handle relative subpaths in reality model tile trees. Handle Y for axis/
2322
2359
  - Fix handling of null animation visibility - should be 100% not 0.
2323
2360
  - Added spatial <-> cartographic methods that check/use the geographic coordinate system before using ecef location.
2324
2361
  - DefaultViewTouchTool should not call handleEvent until it's installed as the active ViewTool.
@@ -2340,10 +2377,10 @@ Wed, 06 Mar 2019 15:41:22 GMT
2340
2377
  - Omit animation branches that are not visible.
2341
2378
  - Improve efficiency and completeness of SubCategory loading for ViewStates.
2342
2379
  - Save BUILD_SEMVER to globally accessible map. PluginAdmin and Plugin classes defined. IModelJsLoader improved.
2343
- - Add optional iModel argument to EntityState.clone
2380
+ - Add optional iModel argument to EntityState.clone
2344
2381
  - Added GeometricModelState.queryModelRange
2345
2382
  - Added creatorId, new method to list RD per project, identified numerous area for changes WIP
2346
- - IModelConnection.close() always disposes the briefcase held at the backend in the case of ReadWrite connections.
2383
+ - IModelConnection.close() always disposes the briefcase held at the backend in the case of ReadWrite connections.
2347
2384
  - Implemented spatial criterai when searching through all reality data associated to a project.
2348
2385
  - Problem with root document of reality data not in root of blob. Tiles could not be fetched. Root path is added to tiles names.
2349
2386
  - Threading issue accessing Reality Data, RealityData class was transformed to be the main data access object instead of the client that was used by most/all reality data causing cache data clash and mix between many reality data.
@@ -2403,7 +2440,7 @@ Thu, 10 Jan 2019 22:46:17 GMT
2403
2440
  - Fix IModelJsLoader to ensure react loaded before bwc.
2404
2441
  - MeasureLocationTool show lat/long and altitude.
2405
2442
  - Make raster text locate behave better.
2406
- - Removed default OIDC scopes. All applications must now explicitly pass the required scopes.
2443
+ - Removed default OIDC scopes. All applications must now explicitly pass the required scopes.
2407
2444
  - Can now await result from QuantityFormatter. Report delta relative to ACS when context lock enabled. Cleanup "Measure.Points" plug-in example until real measure tools are available.
2408
2445
  - Quantity formatter now allows async method to get FormatterSpec that can be used to format quantities.
2409
2446
  - QuantityFormatter.formatQuantity is now the only method to format quantities.
@@ -2572,7 +2609,7 @@ Mon, 12 Nov 2018 16:42:10 GMT
2572
2609
 
2573
2610
  ### Updates
2574
2611
 
2575
- - Hydrated briefcases for ReadOnly cases from the latest checkpoint, rather than the seed files. This significantly improves performance of IModelDb/IModelConnection.open() for typical cases.
2612
+ - Hydrated briefcases for ReadOnly cases from the latest checkpoint, rather than the seed files. This significantly improves performance of IModelDb/IModelConnection.open() for typical cases.
2576
2613
 
2577
2614
  ## 0.165.0
2578
2615
  Mon, 12 Nov 2018 15:47:00 GMT
@@ -1 +1 @@
1
- {"version":3,"file":"BingLocation.d.ts","sourceRoot":"","sources":["../../src/BingLocation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,wBAAwB,CAAS;;IASzC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;CAsB7E"}
1
+ {"version":3,"file":"BingLocation.d.ts","sourceRoot":"","sources":["../../src/BingLocation.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,wBAAwB,CAAS;;IASzC;;;;OAIG;IACU,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;CAqB7E"}
@@ -21,7 +21,7 @@ class BingLocationProvider {
21
21
  if (IModelApp_1.IModelApp.mapLayerFormatRegistry.configOptions.BingMaps) {
22
22
  bingKey = IModelApp_1.IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value;
23
23
  }
24
- this._locationRequestTemplate = "https://dev.virtualearth.net/REST/v1/Locations?query={query}&key={BingMapsAPIKey}".replace("{BingMapsAPIKey}", bingKey);
24
+ this._locationRequestTemplate = `https://dev.virtualearth.net/REST/v1/Locations?query={query}&key=${bingKey}`;
25
25
  }
26
26
  /** Return the location of a query (or undefined if not found). The strings "Space Needle" (a landmark) and "1 Microsoft Way Redmond WA" (an address) are examples of query strings with location information.
27
27
  * These strings can be specified as a structured URL parameter or as a query parameter value. See [Bing Location Services documentation](https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-query) for additional
@@ -30,11 +30,10 @@ class BingLocationProvider {
30
30
  */
31
31
  async getLocation(query) {
32
32
  const requestUrl = this._locationRequestTemplate.replace("{query}", query);
33
- const requestOptions = { method: "GET", responseType: "json" };
34
33
  try {
35
- const locationResponse = await (0, Request_1.request)(requestUrl, requestOptions);
36
- const point = locationResponse.body.resourceSets[0].resources[0].point;
37
- const bbox = locationResponse.body.resourceSets[0].resources[0].bbox;
34
+ const locationResponse = await (0, Request_1.request)(requestUrl, "json");
35
+ const point = locationResponse.resourceSets[0].resources[0].point;
36
+ const bbox = locationResponse.resourceSets[0].resources[0].bbox;
38
37
  const southLatitude = bbox[0];
39
38
  const westLongitude = bbox[1];
40
39
  const northLatitude = bbox[2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C;YAC9B,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO;gBACL,MAAM,EAAE,0BAAY,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrG,IAAI,EAAE;oBACJ,SAAS,EAAE,0BAAY,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;oBAC1F,SAAS,EAAE,0BAAY,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;iBAC3F;aACF,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;CACF;AArCD,oDAqCC","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\n\r\nimport { Cartographic } from \"@itwin/core-common\";\r\nimport { request, RequestOptions, Response } from \"./request/Request\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { GlobalLocation } from \"./ViewGlobalLocation\";\r\n\r\n/** Provides an interface to the [Bing Maps location services](https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/).\r\n * @public\r\n * @extensions\r\n */\r\nexport class BingLocationProvider {\r\n private _locationRequestTemplate: string;\r\n\r\n constructor() {\r\n let bingKey = \"\";\r\n if (IModelApp.mapLayerFormatRegistry.configOptions.BingMaps) {\r\n bingKey = IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value;\r\n }\r\n this._locationRequestTemplate = \"https://dev.virtualearth.net/REST/v1/Locations?query={query}&key={BingMapsAPIKey}\".replace(\"{BingMapsAPIKey}\", bingKey);\r\n }\r\n /** Return the location of a query (or undefined if not found). The strings \"Space Needle\" (a landmark) and \"1 Microsoft Way Redmond WA\" (an address) are examples of query strings with location information.\r\n * These strings can be specified as a structured URL parameter or as a query parameter value. See [Bing Location Services documentation](https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-query) for additional\r\n * information on queries.\r\n * @public\r\n */\r\n public async getLocation(query: string): Promise<GlobalLocation | undefined> {\r\n const requestUrl = this._locationRequestTemplate.replace(\"{query}\", query);\r\n const requestOptions: RequestOptions = { method: \"GET\", responseType: \"json\" };\r\n try {\r\n const locationResponse: Response = await request(requestUrl, requestOptions);\r\n const point = locationResponse.body.resourceSets[0].resources[0].point;\r\n const bbox = locationResponse.body.resourceSets[0].resources[0].bbox;\r\n const southLatitude = bbox[0];\r\n const westLongitude = bbox[1];\r\n const northLatitude = bbox[2];\r\n const eastLongitude = bbox[3];\r\n return {\r\n center: Cartographic.fromDegrees({ longitude: point.coordinates[1], latitude: point.coordinates[0] }),\r\n area: {\r\n southwest: Cartographic.fromDegrees({ longitude: westLongitude, latitude: southLatitude }),\r\n northeast: Cartographic.fromDegrees({ longitude: eastLongitude, latitude: northLatitude }),\r\n },\r\n };\r\n } catch (error) {\r\n return undefined;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BingLocation.js","sourceRoot":"","sources":["../../src/BingLocation.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAkD;AAClD,+CAA4C;AAC5C,2CAAwC;AAGxC;;;GAGG;AACH,MAAa,oBAAoB;IAG/B;QACE,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,IAAI,qBAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,QAAQ,EAAE;YAC3D,OAAO,GAAG,qBAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;SACzE;QACD,IAAI,CAAC,wBAAwB,GAAG,o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","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\n\r\nimport { Cartographic } from \"@itwin/core-common\";\r\nimport { request } from \"./request/Request\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { GlobalLocation } from \"./ViewGlobalLocation\";\r\n\r\n/** Provides an interface to the [Bing Maps location services](https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/).\r\n * @public\r\n * @extensions\r\n */\r\nexport class BingLocationProvider {\r\n private _locationRequestTemplate: string;\r\n\r\n constructor() {\r\n let bingKey = \"\";\r\n if (IModelApp.mapLayerFormatRegistry.configOptions.BingMaps) {\r\n bingKey = IModelApp.mapLayerFormatRegistry.configOptions.BingMaps.value;\r\n }\r\n this._locationRequestTemplate = `https://dev.virtualearth.net/REST/v1/Locations?query={query}&key=${bingKey}`;\r\n }\r\n /** Return the location of a query (or undefined if not found). The strings \"Space Needle\" (a landmark) and \"1 Microsoft Way Redmond WA\" (an address) are examples of query strings with location information.\r\n * These strings can be specified as a structured URL parameter or as a query parameter value. See [Bing Location Services documentation](https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-query) for additional\r\n * information on queries.\r\n * @public\r\n */\r\n public async getLocation(query: string): Promise<GlobalLocation | undefined> {\r\n const requestUrl = this._locationRequestTemplate.replace(\"{query}\", query);\r\n try {\r\n const locationResponse = await request(requestUrl, \"json\");\r\n const point = locationResponse.resourceSets[0].resources[0].point;\r\n const bbox = locationResponse.resourceSets[0].resources[0].bbox;\r\n const southLatitude = bbox[0];\r\n const westLongitude = bbox[1];\r\n const northLatitude = bbox[2];\r\n const eastLongitude = bbox[3];\r\n return {\r\n center: Cartographic.fromDegrees({ longitude: point.coordinates[1], latitude: point.coordinates[0] }),\r\n area: {\r\n southwest: Cartographic.fromDegrees({ longitude: westLongitude, latitude: southLatitude }),\r\n northeast: Cartographic.fromDegrees({ longitude: eastLongitude, latitude: northLatitude }),\r\n },\r\n };\r\n } catch (error) {\r\n return undefined;\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseConnection.js","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+H;AAC/H,oDAG4B;AAC5B,mDAAgD;AAChD,mEAAgE;AAChE,2CAAwC;AACxC,yDAAsD;AACtD,qCAAkC;AAElC,8CAAqE;AACrE,yCAAsC;AAmDtC;;;GAGG;AACH,MAAM,kBAAkB;IAOtB,YAAmB,SAA8B;QAJhC,mBAAc,GAAG,IAAI,GAAG,EAAU,CAAC;QACnC,mBAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3C,cAAS,GAAmB,EAAE,CAAC;QAG9C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,iCAAiC;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;YAChF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;gBAC5B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;aACjD;QACH,CAAC,CAAC,CAAC,CAAC;QAEJ,8BAA8B;QAC9B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;YACzE,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,KAAK,MAAM,EAAE,IAAI,gCAAiB,CAAC,QAAQ,CAAC,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CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;CAMF;AApKD,kDAoKC","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 IModelConnection\r\n */\r\n\r\nimport { assert, BeEvent, CompressedId64Set, Guid, GuidString, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndex, ChangesetIndexAndId, getPullChangesIpcChannel, IModelConnectionProps, IModelError,\r\n PullChangesOptions as IpcAppPullChangesOptions, OpenBriefcaseProps, StandaloneOpenOptions,\r\n} from \"@itwin/core-common\";\r\nimport { BriefcaseTxns } from \"./BriefcaseTxns\";\r\nimport { GraphicalEditingScope } from \"./GraphicalEditingScope\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { IpcApp } from \"./IpcApp\";\r\nimport { ProgressCallback } from \"./request/Request\";\r\nimport { disposeTileTreesForGeometricModels } from \"./tile/internal\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/**\r\n * Download progress information.\r\n * @public\r\n */\r\nexport interface DownloadProgressInfo {\r\n /** Bytes downloaded. */\r\n loaded: number;\r\n /** Total size of the download in bytes. */\r\n total: number;\r\n}\r\n\r\n/**\r\n * Called to show progress during a download.\r\n * @public\r\n */\r\nexport type OnDownloadProgress = (progress: DownloadProgressInfo) => void;\r\n\r\n/**\r\n * Partial interface of AbortSignal.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\r\n * @beta\r\n */\r\nexport interface GenericAbortSignal {\r\n /** Add Listener for abort signal. */\r\n addEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\r\n /** Remove Listener for abort signal. */\r\n removeEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\r\n}\r\n\r\n/**\r\n * Options for pulling iModel changes.\r\n * @public\r\n */\r\nexport interface PullChangesOptions {\r\n /**\r\n * Function called regularly to report progress of changes download.\r\n * @deprecated in 3.6. Use [[downloadProgressCallback]] instead.\r\n */\r\n progressCallback?: ProgressCallback;\r\n /** Function called regularly to report progress of changes download. */\r\n downloadProgressCallback?: OnDownloadProgress;\r\n /** Interval for calling progress callback (in milliseconds). */\r\n progressInterval?: number;\r\n /** Signal for cancelling the download.\r\n * @beta\r\n */\r\n abortSignal?: GenericAbortSignal;\r\n}\r\n\r\n/** Keeps track of changes to models, buffering them until synchronization points.\r\n * While a GraphicalEditingScope is open, the changes are buffered until the scope exits, at which point they are processed.\r\n * Otherwise, the buffered changes are processed after undo/redo, commit, or pull+merge changes.\r\n */\r\nclass ModelChangeMonitor {\r\n private _editingScope?: GraphicalEditingScope;\r\n private readonly _briefcase: BriefcaseConnection;\r\n private readonly _deletedModels = new Set<string>();\r\n private readonly _modelIdToGuid = new Map<string, string>();\r\n private readonly _removals: VoidFunction[] = [];\r\n\r\n public constructor(briefcase: BriefcaseConnection) {\r\n this._briefcase = briefcase;\r\n\r\n // Buffer updated geometry guids.\r\n this._removals.push(briefcase.txns.onModelGeometryChanged.addListener((changes) => {\r\n for (const change of changes) {\r\n this._deletedModels.delete(change.id);\r\n this._modelIdToGuid.set(change.id, change.guid);\r\n }\r\n }));\r\n\r\n // Buffer deletions of models.\r\n this._removals.push(briefcase.txns.onModelsChanged.addListener((changes) => {\r\n if (changes.deleted) {\r\n for (const id of CompressedId64Set.iterable(changes.deleted)) {\r\n this._modelIdToGuid.delete(id);\r\n this._deletedModels.add(id);\r\n }\r\n }\r\n }));\r\n\r\n // Outside of an editing scope, we want to update viewport contents after commit, undo/redo, or merging changes.\r\n const maybeProcess = async () => {\r\n if (this.editingScope)\r\n return;\r\n\r\n const modelIds = Array.from(this._modelIdToGuid.keys());\r\n if (modelIds.length > 0)\r\n await IModelApp.tileAdmin.purgeTileTrees(this._briefcase, modelIds);\r\n\r\n this.processBuffered();\r\n };\r\n\r\n this._removals.push(briefcase.txns.onCommitted.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onAfterUndoRedo.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onChangesPulled.addListener(maybeProcess));\r\n }\r\n\r\n public async close(): Promise<void> {\r\n for (const removal of this._removals)\r\n removal();\r\n\r\n this._removals.length = 0;\r\n\r\n if (this._editingScope) {\r\n await this._editingScope.exit();\r\n this._editingScope = undefined;\r\n }\r\n }\r\n\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._editingScope;\r\n }\r\n\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n if (this._editingScope)\r\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\r\n\r\n this._editingScope = await GraphicalEditingScope.enter(this._briefcase);\r\n\r\n const removeGeomListener = this._editingScope.onGeometryChanges.addListener((changes) => {\r\n const modelIds = [];\r\n for (const change of changes)\r\n modelIds.push(change.id);\r\n\r\n this.invalidateScenes(modelIds);\r\n });\r\n\r\n this._editingScope.onExited.addOnce((scope) => {\r\n assert(scope === this._editingScope);\r\n this._editingScope = undefined;\r\n removeGeomListener();\r\n this.processBuffered();\r\n });\r\n\r\n return this._editingScope;\r\n }\r\n\r\n private processBuffered(): void {\r\n const models = this._briefcase.models;\r\n for (const [id, guid] of this._modelIdToGuid) {\r\n const model = models.getLoaded(id)?.asGeometricModel;\r\n if (model)\r\n model.geometryGuid = guid;\r\n }\r\n\r\n const modelIds = new Set<string>(this._modelIdToGuid.keys());\r\n for (const deleted of this._deletedModels) {\r\n modelIds.add(deleted);\r\n models.unload(deleted);\r\n }\r\n\r\n this.invalidateScenes(modelIds);\r\n disposeTileTreesForGeometricModels(modelIds, this._briefcase);\r\n\r\n this._briefcase.onBufferedModelChanges.raiseEvent(modelIds);\r\n\r\n this._modelIdToGuid.clear();\r\n this._deletedModels.clear();\r\n }\r\n\r\n private invalidateScenes(changedModels: Iterable<Id64String>): void {\r\n for (const user of IModelApp.tileAdmin.tileUsers) {\r\n if (user instanceof Viewport && user.iModel === this._briefcase) {\r\n for (const modelId of changedModels) {\r\n if (user.view.viewsModel(modelId)) {\r\n user.invalidateScene();\r\n user.setFeatureOverrideProviderChanged();\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].\r\n * For example, tools that want to create new elements can consult the briefcase's editor tool settings to\r\n * determine into which model and category to insert the elements.\r\n * Specialized tools are free to ignore these settings.\r\n * @see [[BriefcaseConnection.editorToolSettings]] to query or modify the current settings for a briefcase.\r\n * @see [CreateElementTool]($editor-frontend) for an example of a tool that uses these settings.\r\n * @alpha\r\n */\r\nexport class BriefcaseEditorToolSettings {\r\n private _category?: Id64String;\r\n private _model?: Id64String;\r\n\r\n /** An event raised just after the default [[category]] is changed. */\r\n public readonly onCategoryChanged = new BeEvent<(previousCategory: Id64String | undefined) => void>();\r\n\r\n /** An event raised just after the default [[model]] is changed. */\r\n public readonly onModelChanged = new BeEvent<(previousModel: Id64String | undefined) => void>();\r\n\r\n /** The [Category]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate category.\r\n * @see [[onCategoryChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetCategory]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get category(): Id64String | undefined {\r\n return this._category;\r\n }\r\n public set category(category: Id64String | undefined) {\r\n const previousCategory = this.category;\r\n if (category !== this.category) {\r\n this._category = category;\r\n this.onCategoryChanged.raiseEvent(previousCategory);\r\n }\r\n }\r\n\r\n /** The [Model]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate model.\r\n * @see [[onModelChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetModel]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get model(): Id64String | undefined {\r\n return this._model;\r\n }\r\n public set model(model: Id64String | undefined) {\r\n const previousModel = this.model;\r\n if (model !== this.model) {\r\n this._model = model;\r\n this.onModelChanged.raiseEvent(previousModel);\r\n }\r\n }\r\n}\r\n\r\n/** A connection to an editable briefcase on the backend. This class uses [Ipc]($docs/learning/IpcInterface.md) to communicate\r\n * to the backend and may only be used by [[IpcApp]]s.\r\n * @public\r\n */\r\nexport class BriefcaseConnection extends IModelConnection {\r\n protected _isClosed?: boolean;\r\n private readonly _modelsMonitor: ModelChangeMonitor;\r\n /** Default settings that can be used to control the behavior of [[Tool]]s that modify this briefcase.\r\n * @alpha\r\n */\r\n public readonly editorToolSettings = new BriefcaseEditorToolSettings();\r\n\r\n /** Manages local changes to the briefcase via [Txns]($docs/learning/InteractiveEditing.md). */\r\n public readonly txns: BriefcaseTxns;\r\n\r\n /** @internal */\r\n public override isBriefcaseConnection(): this is BriefcaseConnection { return true; }\r\n\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public override get iTwinId(): GuidString { return super.iTwinId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n /** The Guid that identifies this iModel. */\r\n public override get iModelId(): GuidString { return super.iModelId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n protected constructor(props: IModelConnectionProps, openMode: OpenMode) {\r\n super(props);\r\n this._openMode = openMode;\r\n this.txns = new BriefcaseTxns(this);\r\n this._modelsMonitor = new ModelChangeMonitor(this);\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */\r\n public static async openFile(briefcaseProps: OpenBriefcaseProps): Promise<BriefcaseConnection> {\r\n const iModelProps = await IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);\r\n const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? OpenMode.Readonly : OpenMode.ReadWrite);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [StandaloneDb]($backend)\r\n * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.\r\n */\r\n public static async openStandalone(filePath: string, openMode: OpenMode = OpenMode.ReadWrite, opts?: StandaloneOpenOptions): Promise<BriefcaseConnection> {\r\n const openResponse = await IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);\r\n const connection = new this(openResponse, openMode);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Returns `true` if [[close]] has already been called. */\r\n public get isClosed(): boolean { return this._isClosed === true; }\r\n\r\n /**\r\n * Close this BriefcaseConnection.\r\n * @note make sure to call [[saveChanges]] before calling this method. Unsaved local changes are abandoned.\r\n */\r\n public async close(): Promise<void> {\r\n if (this.isClosed)\r\n return;\r\n\r\n await this._modelsMonitor.close();\r\n\r\n this.beforeClose();\r\n this.txns.dispose();\r\n\r\n this._isClosed = true;\r\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\r\n }\r\n\r\n private requireTimeline() {\r\n if (this.iTwinId === Guid.empty)\r\n throw new IModelError(IModelStatus.WrongIModel, \"iModel has no timeline\");\r\n }\r\n\r\n /** Query if there are any pending Txns in this briefcase that are waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return this.txns.hasPendingTxns();\r\n }\r\n\r\n /** Commit pending changes to this briefcase.\r\n * @param description Optional description of the changes.\r\n */\r\n public async saveChanges(description?: string): Promise<void> {\r\n await IpcApp.appFunctionIpc.saveChanges(this.key, description);\r\n }\r\n\r\n /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase\r\n * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.\r\n * @param options Options for pulling changes.\r\n * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.\r\n */\r\n public async pullChanges(toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<void> {\r\n const removeListeners: VoidFunction[] = [];\r\n // eslint-disable-next-line deprecation/deprecation\r\n const shouldReportProgress = !!options?.progressCallback || !!options?.downloadProgressCallback;\r\n\r\n if (shouldReportProgress) {\r\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\r\n // eslint-disable-next-line deprecation/deprecation\r\n options?.progressCallback?.(data);\r\n options?.downloadProgressCallback?.(data);\r\n };\r\n\r\n const removeProgressListener = IpcApp.addListener(\r\n getPullChangesIpcChannel(this.iModelId),\r\n handleProgress,\r\n );\r\n removeListeners.push(removeProgressListener);\r\n }\r\n\r\n if (options?.abortSignal) {\r\n const abort = () => void IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);\r\n options?.abortSignal.addEventListener(\"abort\", abort);\r\n removeListeners.push(() => options?.abortSignal?.removeEventListener(\"abort\", abort));\r\n }\r\n\r\n this.requireTimeline();\r\n const ipcAppOptions: IpcAppPullChangesOptions = {\r\n reportProgress: shouldReportProgress,\r\n progressInterval: options?.progressInterval,\r\n enableCancellation: !!options?.abortSignal,\r\n };\r\n try {\r\n this.changeset = await IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);\r\n } finally {\r\n removeListeners.forEach((remove) => remove());\r\n }\r\n }\r\n\r\n /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.\r\n * @param description The description for the changeset\r\n * @returns the changesetId of the pushed changes\r\n * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.\r\n */\r\n public async pushChanges(description: string): Promise<ChangesetIndexAndId> {\r\n this.requireTimeline();\r\n return IpcApp.appFunctionIpc.pushChanges(this.key, description);\r\n }\r\n\r\n /** The current graphical editing scope, if one is in progress.\r\n * @see [[enterEditingScope]] to begin graphical editing.\r\n */\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._modelsMonitor.editingScope;\r\n }\r\n\r\n /** Return whether graphical editing is supported for this briefcase. It is not supported if the briefcase is read-only, or the briefcase contains a version of\r\n * the BisCore ECSchema older than v0.1.11.\r\n * @see [[enterEditingScope]] to enable graphical editing.\r\n */\r\n public async supportsGraphicalEditing(): Promise<boolean> {\r\n return IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);\r\n }\r\n\r\n /** Begin a new graphical editing scope.\r\n * @throws Error if an editing scope already exists or one could not be created.\r\n * @see [[GraphicalEditingScope.exit]] to exit the scope.\r\n * @see [[supportsGraphicalEditing]] to determine whether this method should be expected to succeed.\r\n * @see [[editingScope]] to obtain the current editing scope, if one is in progress.\r\n */\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n return this._modelsMonitor.enterEditingScope();\r\n }\r\n\r\n /** Strictly for tests - dispatched from ModelChangeMonitor.processBuffered.\r\n * @internal\r\n */\r\n public readonly onBufferedModelChanges = new BeEvent<(changedModelIds: Set<string>) => void>();\r\n}\r\n"]}
1
+ {"version":3,"file":"BriefcaseConnection.js","sourceRoot":"","sources":["../../src/BriefcaseConnection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+H;AAC/H,oDAG4B;AAC5B,mDAAgD;AAChD,mEAAgE;AAChE,2CAAwC;AACxC,yDAAsD;AACtD,qCAAkC;AAElC,8CAAqE;AACrE,yCAAsC;AAmDtC;;;GAGG;AACH,MAAM,kBAAkB;IAOtB,YAAmB,SAA8B;QAJhC,mBAAc,GAAG,IAAI,GAAG,EAAU,CAAC;QACnC,mBAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3C,cAAS,GAAmB,EAAE,CAAC;QAG9C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,iCAAiC;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;YAChF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;gBAC5B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtC,IAAI,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AW,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,wBAAwB;QACnC,OAAO,eAAM,CAAC,cAAc,CAAC,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;IACjD,CAAC;CAMF;AApKD,kDAoKC","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 IModelConnection\r\n */\r\n\r\nimport { assert, BeEvent, CompressedId64Set, Guid, GuidString, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndex, ChangesetIndexAndId, getPullChangesIpcChannel, IModelConnectionProps, IModelError,\r\n PullChangesOptions as IpcAppPullChangesOptions, OpenBriefcaseProps, StandaloneOpenOptions,\r\n} from \"@itwin/core-common\";\r\nimport { BriefcaseTxns } from \"./BriefcaseTxns\";\r\nimport { GraphicalEditingScope } from \"./GraphicalEditingScope\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { IpcApp } from \"./IpcApp\";\r\nimport { ProgressCallback } from \"./request/Request\";\r\nimport { disposeTileTreesForGeometricModels } from \"./tile/internal\";\r\nimport { Viewport } from \"./Viewport\";\r\n\r\n/**\r\n * Download progress information.\r\n * @public\r\n */\r\nexport interface DownloadProgressInfo {\r\n /** Bytes downloaded. */\r\n loaded: number;\r\n /** Total size of the download in bytes. */\r\n total: number;\r\n}\r\n\r\n/**\r\n * Called to show progress during a download.\r\n * @public\r\n */\r\nexport type OnDownloadProgress = (progress: DownloadProgressInfo) => void;\r\n\r\n/**\r\n * Partial interface of AbortSignal.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\r\n * @beta\r\n */\r\nexport interface GenericAbortSignal {\r\n /** Add Listener for abort signal. */\r\n addEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\r\n /** Remove Listener for abort signal. */\r\n removeEventListener: (type: \"abort\", listener: (this: GenericAbortSignal, ev: any) => any) => void;\r\n}\r\n\r\n/**\r\n * Options for pulling iModel changes.\r\n * @public\r\n */\r\nexport interface PullChangesOptions {\r\n /**\r\n * Function called regularly to report progress of changes download.\r\n * @deprecated in 3.6. Use [[downloadProgressCallback]] instead.\r\n */\r\n progressCallback?: ProgressCallback; // eslint-disable-line deprecation/deprecation\r\n /** Function called regularly to report progress of changes download. */\r\n downloadProgressCallback?: OnDownloadProgress;\r\n /** Interval for calling progress callback (in milliseconds). */\r\n progressInterval?: number;\r\n /** Signal for cancelling the download.\r\n * @beta\r\n */\r\n abortSignal?: GenericAbortSignal;\r\n}\r\n\r\n/** Keeps track of changes to models, buffering them until synchronization points.\r\n * While a GraphicalEditingScope is open, the changes are buffered until the scope exits, at which point they are processed.\r\n * Otherwise, the buffered changes are processed after undo/redo, commit, or pull+merge changes.\r\n */\r\nclass ModelChangeMonitor {\r\n private _editingScope?: GraphicalEditingScope;\r\n private readonly _briefcase: BriefcaseConnection;\r\n private readonly _deletedModels = new Set<string>();\r\n private readonly _modelIdToGuid = new Map<string, string>();\r\n private readonly _removals: VoidFunction[] = [];\r\n\r\n public constructor(briefcase: BriefcaseConnection) {\r\n this._briefcase = briefcase;\r\n\r\n // Buffer updated geometry guids.\r\n this._removals.push(briefcase.txns.onModelGeometryChanged.addListener((changes) => {\r\n for (const change of changes) {\r\n this._deletedModels.delete(change.id);\r\n this._modelIdToGuid.set(change.id, change.guid);\r\n }\r\n }));\r\n\r\n // Buffer deletions of models.\r\n this._removals.push(briefcase.txns.onModelsChanged.addListener((changes) => {\r\n if (changes.deleted) {\r\n for (const id of CompressedId64Set.iterable(changes.deleted)) {\r\n this._modelIdToGuid.delete(id);\r\n this._deletedModels.add(id);\r\n }\r\n }\r\n }));\r\n\r\n // Outside of an editing scope, we want to update viewport contents after commit, undo/redo, or merging changes.\r\n const maybeProcess = async () => {\r\n if (this.editingScope)\r\n return;\r\n\r\n const modelIds = Array.from(this._modelIdToGuid.keys());\r\n if (modelIds.length > 0)\r\n await IModelApp.tileAdmin.purgeTileTrees(this._briefcase, modelIds);\r\n\r\n this.processBuffered();\r\n };\r\n\r\n this._removals.push(briefcase.txns.onCommitted.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onAfterUndoRedo.addListener(maybeProcess));\r\n this._removals.push(briefcase.txns.onChangesPulled.addListener(maybeProcess));\r\n }\r\n\r\n public async close(): Promise<void> {\r\n for (const removal of this._removals)\r\n removal();\r\n\r\n this._removals.length = 0;\r\n\r\n if (this._editingScope) {\r\n await this._editingScope.exit();\r\n this._editingScope = undefined;\r\n }\r\n }\r\n\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._editingScope;\r\n }\r\n\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n if (this._editingScope)\r\n throw new Error(\"Cannot create an editing scope for an iModel that already has one\");\r\n\r\n this._editingScope = await GraphicalEditingScope.enter(this._briefcase);\r\n\r\n const removeGeomListener = this._editingScope.onGeometryChanges.addListener((changes) => {\r\n const modelIds = [];\r\n for (const change of changes)\r\n modelIds.push(change.id);\r\n\r\n this.invalidateScenes(modelIds);\r\n });\r\n\r\n this._editingScope.onExited.addOnce((scope) => {\r\n assert(scope === this._editingScope);\r\n this._editingScope = undefined;\r\n removeGeomListener();\r\n this.processBuffered();\r\n });\r\n\r\n return this._editingScope;\r\n }\r\n\r\n private processBuffered(): void {\r\n const models = this._briefcase.models;\r\n for (const [id, guid] of this._modelIdToGuid) {\r\n const model = models.getLoaded(id)?.asGeometricModel;\r\n if (model)\r\n model.geometryGuid = guid;\r\n }\r\n\r\n const modelIds = new Set<string>(this._modelIdToGuid.keys());\r\n for (const deleted of this._deletedModels) {\r\n modelIds.add(deleted);\r\n models.unload(deleted);\r\n }\r\n\r\n this.invalidateScenes(modelIds);\r\n disposeTileTreesForGeometricModels(modelIds, this._briefcase);\r\n\r\n this._briefcase.onBufferedModelChanges.raiseEvent(modelIds);\r\n\r\n this._modelIdToGuid.clear();\r\n this._deletedModels.clear();\r\n }\r\n\r\n private invalidateScenes(changedModels: Iterable<Id64String>): void {\r\n for (const user of IModelApp.tileAdmin.tileUsers) {\r\n if (user instanceof Viewport && user.iModel === this._briefcase) {\r\n for (const modelId of changedModels) {\r\n if (user.view.viewsModel(modelId)) {\r\n user.invalidateScene();\r\n user.setFeatureOverrideProviderChanged();\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** Settings that can be used to control the behavior of [[Tool]]s that modify a [[BriefcaseConnection]].\r\n * For example, tools that want to create new elements can consult the briefcase's editor tool settings to\r\n * determine into which model and category to insert the elements.\r\n * Specialized tools are free to ignore these settings.\r\n * @see [[BriefcaseConnection.editorToolSettings]] to query or modify the current settings for a briefcase.\r\n * @see [CreateElementTool]($editor-frontend) for an example of a tool that uses these settings.\r\n * @alpha\r\n */\r\nexport class BriefcaseEditorToolSettings {\r\n private _category?: Id64String;\r\n private _model?: Id64String;\r\n\r\n /** An event raised just after the default [[category]] is changed. */\r\n public readonly onCategoryChanged = new BeEvent<(previousCategory: Id64String | undefined) => void>();\r\n\r\n /** An event raised just after the default [[model]] is changed. */\r\n public readonly onModelChanged = new BeEvent<(previousModel: Id64String | undefined) => void>();\r\n\r\n /** The [Category]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate category.\r\n * @see [[onCategoryChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetCategory]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get category(): Id64String | undefined {\r\n return this._category;\r\n }\r\n public set category(category: Id64String | undefined) {\r\n const previousCategory = this.category;\r\n if (category !== this.category) {\r\n this._category = category;\r\n this.onCategoryChanged.raiseEvent(previousCategory);\r\n }\r\n }\r\n\r\n /** The [Model]($backend) into which new elements should be inserted by default.\r\n * Specialized tools are free to ignore this setting and instead use their own logic to select an appropriate model.\r\n * @see [[onModelChanged]] to be notified when this property is modified.\r\n * @see [CreateElementTool.targetModel]($editor-frontend) for an example of a tool that uses this setting.\r\n */\r\n public get model(): Id64String | undefined {\r\n return this._model;\r\n }\r\n public set model(model: Id64String | undefined) {\r\n const previousModel = this.model;\r\n if (model !== this.model) {\r\n this._model = model;\r\n this.onModelChanged.raiseEvent(previousModel);\r\n }\r\n }\r\n}\r\n\r\n/** A connection to an editable briefcase on the backend. This class uses [Ipc]($docs/learning/IpcInterface.md) to communicate\r\n * to the backend and may only be used by [[IpcApp]]s.\r\n * @public\r\n */\r\nexport class BriefcaseConnection extends IModelConnection {\r\n protected _isClosed?: boolean;\r\n private readonly _modelsMonitor: ModelChangeMonitor;\r\n /** Default settings that can be used to control the behavior of [[Tool]]s that modify this briefcase.\r\n * @alpha\r\n */\r\n public readonly editorToolSettings = new BriefcaseEditorToolSettings();\r\n\r\n /** Manages local changes to the briefcase via [Txns]($docs/learning/InteractiveEditing.md). */\r\n public readonly txns: BriefcaseTxns;\r\n\r\n /** @internal */\r\n public override isBriefcaseConnection(): this is BriefcaseConnection { return true; }\r\n\r\n /** The Guid that identifies the iTwin that owns this iModel. */\r\n public override get iTwinId(): GuidString { return super.iTwinId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n /** The Guid that identifies this iModel. */\r\n public override get iModelId(): GuidString { return super.iModelId!; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection\r\n\r\n protected constructor(props: IModelConnectionProps, openMode: OpenMode) {\r\n super(props);\r\n this._openMode = openMode;\r\n this.txns = new BriefcaseTxns(this);\r\n this._modelsMonitor = new ModelChangeMonitor(this);\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [BriefcaseDb]($backend). */\r\n public static async openFile(briefcaseProps: OpenBriefcaseProps): Promise<BriefcaseConnection> {\r\n const iModelProps = await IpcApp.appFunctionIpc.openBriefcase(briefcaseProps);\r\n const connection = new this({ ...briefcaseProps, ...iModelProps }, briefcaseProps.readonly ? OpenMode.Readonly : OpenMode.ReadWrite);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Open a BriefcaseConnection to a [StandaloneDb]($backend)\r\n * @note StandaloneDbs, by definition, may not push or pull changes. Attempting to do so will throw exceptions.\r\n */\r\n public static async openStandalone(filePath: string, openMode: OpenMode = OpenMode.ReadWrite, opts?: StandaloneOpenOptions): Promise<BriefcaseConnection> {\r\n const openResponse = await IpcApp.appFunctionIpc.openStandalone(filePath, openMode, opts);\r\n const connection = new this(openResponse, openMode);\r\n IModelConnection.onOpen.raiseEvent(connection);\r\n return connection;\r\n }\r\n\r\n /** Returns `true` if [[close]] has already been called. */\r\n public get isClosed(): boolean { return this._isClosed === true; }\r\n\r\n /**\r\n * Close this BriefcaseConnection.\r\n * @note make sure to call [[saveChanges]] before calling this method. Unsaved local changes are abandoned.\r\n */\r\n public async close(): Promise<void> {\r\n if (this.isClosed)\r\n return;\r\n\r\n await this._modelsMonitor.close();\r\n\r\n this.beforeClose();\r\n this.txns.dispose();\r\n\r\n this._isClosed = true;\r\n await IpcApp.appFunctionIpc.closeIModel(this._fileKey);\r\n }\r\n\r\n private requireTimeline() {\r\n if (this.iTwinId === Guid.empty)\r\n throw new IModelError(IModelStatus.WrongIModel, \"iModel has no timeline\");\r\n }\r\n\r\n /** Query if there are any pending Txns in this briefcase that are waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return this.txns.hasPendingTxns();\r\n }\r\n\r\n /** Commit pending changes to this briefcase.\r\n * @param description Optional description of the changes.\r\n */\r\n public async saveChanges(description?: string): Promise<void> {\r\n await IpcApp.appFunctionIpc.saveChanges(this.key, description);\r\n }\r\n\r\n /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase\r\n * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.\r\n * @param options Options for pulling changes.\r\n * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.\r\n */\r\n public async pullChanges(toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<void> {\r\n const removeListeners: VoidFunction[] = [];\r\n // eslint-disable-next-line deprecation/deprecation\r\n const shouldReportProgress = !!options?.progressCallback || !!options?.downloadProgressCallback;\r\n\r\n if (shouldReportProgress) {\r\n const handleProgress = (_evt: Event, data: { loaded: number, total: number }) => {\r\n // eslint-disable-next-line deprecation/deprecation\r\n options?.progressCallback?.(data);\r\n options?.downloadProgressCallback?.(data);\r\n };\r\n\r\n const removeProgressListener = IpcApp.addListener(\r\n getPullChangesIpcChannel(this.iModelId),\r\n handleProgress,\r\n );\r\n removeListeners.push(removeProgressListener);\r\n }\r\n\r\n if (options?.abortSignal) {\r\n const abort = () => void IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);\r\n options?.abortSignal.addEventListener(\"abort\", abort);\r\n removeListeners.push(() => options?.abortSignal?.removeEventListener(\"abort\", abort));\r\n }\r\n\r\n this.requireTimeline();\r\n const ipcAppOptions: IpcAppPullChangesOptions = {\r\n reportProgress: shouldReportProgress,\r\n progressInterval: options?.progressInterval,\r\n enableCancellation: !!options?.abortSignal,\r\n };\r\n try {\r\n this.changeset = await IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);\r\n } finally {\r\n removeListeners.forEach((remove) => remove());\r\n }\r\n }\r\n\r\n /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.\r\n * @param description The description for the changeset\r\n * @returns the changesetId of the pushed changes\r\n * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.\r\n */\r\n public async pushChanges(description: string): Promise<ChangesetIndexAndId> {\r\n this.requireTimeline();\r\n return IpcApp.appFunctionIpc.pushChanges(this.key, description);\r\n }\r\n\r\n /** The current graphical editing scope, if one is in progress.\r\n * @see [[enterEditingScope]] to begin graphical editing.\r\n */\r\n public get editingScope(): GraphicalEditingScope | undefined {\r\n return this._modelsMonitor.editingScope;\r\n }\r\n\r\n /** Return whether graphical editing is supported for this briefcase. It is not supported if the briefcase is read-only, or the briefcase contains a version of\r\n * the BisCore ECSchema older than v0.1.11.\r\n * @see [[enterEditingScope]] to enable graphical editing.\r\n */\r\n public async supportsGraphicalEditing(): Promise<boolean> {\r\n return IpcApp.appFunctionIpc.isGraphicalEditingSupported(this.key);\r\n }\r\n\r\n /** Begin a new graphical editing scope.\r\n * @throws Error if an editing scope already exists or one could not be created.\r\n * @see [[GraphicalEditingScope.exit]] to exit the scope.\r\n * @see [[supportsGraphicalEditing]] to determine whether this method should be expected to succeed.\r\n * @see [[editingScope]] to obtain the current editing scope, if one is in progress.\r\n */\r\n public async enterEditingScope(): Promise<GraphicalEditingScope> {\r\n return this._modelsMonitor.enterEditingScope();\r\n }\r\n\r\n /** Strictly for tests - dispatched from ModelChangeMonitor.processBuffered.\r\n * @internal\r\n */\r\n public readonly onBufferedModelChanges = new BeEvent<(changedModelIds: Set<string>) => void>();\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeApp.d.ts","sourceRoot":"","sources":["../../src/NativeApp.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAU,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,EACL,mBAAmB,EAAE,cAAc,EAAE,aAAa,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,mBAAmB,EACpG,kBAAkB,EACM,YAAY,EAAE,QAAQ,EACjE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA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,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;IAIpH,8BAA8B;IACjB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAIxD,0BAA0B;IACb,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;OAGG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzC,iCAAiC;IACpB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,sCAAsC;IACzB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -11,7 +11,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.Storage = exports.NativeApp = void 0;
12
12
  const core_bentley_1 = require("@itwin/core-bentley");
13
13
  const core_common_1 = require("@itwin/core-common");
14
- const Request_1 = require("./request/Request");
15
14
  const FrontendLoggerCategory_1 = require("./FrontendLoggerCategory");
16
15
  const IpcApp_1 = require("./IpcApp");
17
16
  const NativeAppLogger_1 = require("./NativeAppLogger");
@@ -34,7 +33,6 @@ class NativeApp {
34
33
  return IpcApp_1.IpcApp.callIpcChannel(core_common_1.nativeAppChannel, methodName, ...args);
35
34
  }
36
35
  static async setConnectivity(by, status) {
37
- Request_1.RequestGlobalOptions.online = (status === core_common_1.InternetConnectivityStatus.Online);
38
36
  await this.nativeAppIpc.overrideInternetConnectivity(by, status);
39
37
  }
40
38
  static hookBrowserConnectivityEvents() {
@@ -71,7 +69,6 @@ class NativeApp {
71
69
  NativeApp.hookBrowserConnectivityEvents();
72
70
  // initialize current online state.
73
71
  if (window.navigator.onLine) {
74
- Request_1.RequestGlobalOptions.online = window.navigator.onLine;
75
72
  await this.setConnectivity(core_common_1.OverriddenBy.Browser, window.navigator.onLine ? core_common_1.InternetConnectivityStatus.Online : core_common_1.InternetConnectivityStatus.Offline);
76
73
  }
77
74
  }