@itwin/map-layers 5.4.4 → 5.6.0

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 (304) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/README.md +7 -7
  3. package/lib/cjs/BrowserStorage.d.ts.map +1 -1
  4. package/lib/cjs/BrowserStorage.js +23 -13
  5. package/lib/cjs/BrowserStorage.js.map +1 -1
  6. package/lib/cjs/CustomParamUtils.d.ts +1 -1
  7. package/lib/cjs/CustomParamUtils.d.ts.map +1 -1
  8. package/lib/cjs/CustomParamUtils.js +6 -3
  9. package/lib/cjs/CustomParamUtils.js.map +1 -1
  10. package/lib/cjs/CustomParamsMappingStorage.d.ts +1 -1
  11. package/lib/cjs/CustomParamsMappingStorage.d.ts.map +1 -1
  12. package/lib/cjs/CustomParamsMappingStorage.js +3 -3
  13. package/lib/cjs/CustomParamsMappingStorage.js.map +1 -1
  14. package/lib/cjs/CustomParamsStorage.d.ts +1 -1
  15. package/lib/cjs/CustomParamsStorage.d.ts.map +1 -1
  16. package/lib/cjs/CustomParamsStorage.js +3 -3
  17. package/lib/cjs/CustomParamsStorage.js.map +1 -1
  18. package/lib/cjs/MapLayerPreferences.d.ts +2 -1
  19. package/lib/cjs/MapLayerPreferences.d.ts.map +1 -1
  20. package/lib/cjs/MapLayerPreferences.js +50 -25
  21. package/lib/cjs/MapLayerPreferences.js.map +1 -1
  22. package/lib/cjs/MapLayersActionIds.d.ts +5 -0
  23. package/lib/cjs/MapLayersActionIds.d.ts.map +1 -0
  24. package/lib/cjs/MapLayersActionIds.js +10 -0
  25. package/lib/cjs/MapLayersActionIds.js.map +1 -0
  26. package/lib/cjs/MapLayersPrefBrowserStorage.d.ts.map +1 -1
  27. package/lib/cjs/MapLayersPrefBrowserStorage.js +4 -5
  28. package/lib/cjs/MapLayersPrefBrowserStorage.js.map +1 -1
  29. package/lib/cjs/PreferencesBrowserStorage.d.ts +17 -17
  30. package/lib/cjs/PreferencesBrowserStorage.d.ts.map +1 -1
  31. package/lib/cjs/PreferencesBrowserStorage.js +14 -14
  32. package/lib/cjs/PreferencesBrowserStorage.js.map +1 -1
  33. package/lib/cjs/map-layers.d.ts +1 -0
  34. package/lib/cjs/map-layers.d.ts.map +1 -1
  35. package/lib/cjs/map-layers.js +4 -3
  36. package/lib/cjs/map-layers.js.map +1 -1
  37. package/lib/cjs/mapLayers.d.ts +2 -2
  38. package/lib/cjs/mapLayers.d.ts.map +1 -1
  39. package/lib/cjs/mapLayers.js.map +1 -1
  40. package/lib/cjs/public/locales/en/mapLayers.json +179 -184
  41. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
  42. package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
  43. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +48 -18
  44. package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  45. package/lib/cjs/ui/Interfaces.d.ts +3 -3
  46. package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
  47. package/lib/cjs/ui/Interfaces.js.map +1 -1
  48. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +3 -2
  49. package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  50. package/lib/cjs/ui/MapLayersUiItemsProvider.js +2 -6
  51. package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
  52. package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  53. package/lib/cjs/ui/widget/AttachLayerPopupButton.js +81 -46
  54. package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
  55. package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
  56. package/lib/cjs/ui/widget/BasemapPanel.js +44 -25
  57. package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
  58. package/lib/cjs/ui/widget/BasemapPanel.scss +2 -4
  59. package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts +1 -1
  60. package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
  61. package/lib/cjs/ui/widget/ConfirmMessageDialog.js +31 -8
  62. package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
  63. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts +1 -1
  64. package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
  65. package/lib/cjs/ui/widget/CustomParamEditDialog.js +34 -20
  66. package/lib/cjs/ui/widget/CustomParamEditDialog.js.map +1 -1
  67. package/lib/cjs/ui/widget/CustomParamEditDialog.scss +1 -2
  68. package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  69. package/lib/cjs/ui/widget/CustomParamsSettings.js +42 -27
  70. package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -1
  71. package/lib/cjs/ui/widget/CustomParamsSettings.scss +7 -9
  72. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
  73. package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
  74. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +4 -2
  75. package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
  76. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +1 -1
  77. package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  78. package/lib/cjs/ui/widget/FeatureInfoWidget.js +34 -15
  79. package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
  80. package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts +1 -1
  81. package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
  82. package/lib/cjs/ui/widget/MapLayerActionButtons.js +30 -17
  83. package/lib/cjs/ui/widget/MapLayerActionButtons.js.map +1 -1
  84. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +2 -2
  85. package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  86. package/lib/cjs/ui/widget/MapLayerDroppable.js +64 -50
  87. package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
  88. package/lib/cjs/ui/widget/MapLayerManager.d.ts +2 -2
  89. package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
  90. package/lib/cjs/ui/widget/MapLayerManager.js +158 -84
  91. package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
  92. package/lib/cjs/ui/widget/MapLayerManager.scss +3 -6
  93. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
  94. package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  95. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +33 -13
  96. package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  97. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  98. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +36 -14
  99. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  100. package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
  101. package/lib/cjs/ui/widget/MapLayersWidget.d.ts +1 -1
  102. package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
  103. package/lib/cjs/ui/widget/MapLayersWidget.js +34 -11
  104. package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
  105. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
  106. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js +5 -8
  107. package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
  108. package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
  109. package/lib/cjs/ui/widget/MapManagerSettings.js +55 -56
  110. package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
  111. package/lib/cjs/ui/widget/MapManagerSettings.scss +1 -1
  112. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
  113. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  114. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js +33 -18
  115. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  116. package/lib/cjs/ui/widget/MapSelectFeaturesDialog.scss +1 -3
  117. package/lib/cjs/ui/widget/MapUrlDialog.d.ts +4 -3
  118. package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
  119. package/lib/cjs/ui/widget/MapUrlDialog.js +104 -81
  120. package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
  121. package/lib/cjs/ui/widget/MapUrlDialog.scss +6 -7
  122. package/lib/cjs/ui/widget/SelectApiKey.d.ts.map +1 -1
  123. package/lib/cjs/ui/widget/SelectApiKey.js +38 -10
  124. package/lib/cjs/ui/widget/SelectApiKey.js.map +1 -1
  125. package/lib/cjs/ui/widget/SelectCustomParam.d.ts.map +1 -1
  126. package/lib/cjs/ui/widget/SelectCustomParam.js +40 -11
  127. package/lib/cjs/ui/widget/SelectCustomParam.js.map +1 -1
  128. package/lib/cjs/ui/widget/SelectMapFormat.d.ts +3 -3
  129. package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
  130. package/lib/cjs/ui/widget/SelectMapFormat.js +36 -16
  131. package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
  132. package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts +2 -2
  133. package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
  134. package/lib/cjs/ui/widget/SubLayersDataProvider.js +13 -9
  135. package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
  136. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts +1 -1
  137. package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  138. package/lib/cjs/ui/widget/SubLayersPopupButton.js +30 -12
  139. package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
  140. package/lib/cjs/ui/widget/SubLayersTree.d.ts +2 -2
  141. package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
  142. package/lib/cjs/ui/widget/SubLayersTree.js +83 -45
  143. package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
  144. package/lib/cjs/ui/widget/SubLayersTree.scss +4 -7
  145. package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  146. package/lib/cjs/ui/widget/TransparencyPopupButton.js +33 -16
  147. package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
  148. package/lib/cjs/ui/widget/TransparencyPopupButton.scss +1 -2
  149. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
  150. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
  151. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js +2 -8
  152. package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
  153. package/lib/esm/BrowserStorage.d.ts.map +1 -1
  154. package/lib/esm/BrowserStorage.js +23 -13
  155. package/lib/esm/BrowserStorage.js.map +1 -1
  156. package/lib/esm/CustomParamUtils.d.ts +1 -1
  157. package/lib/esm/CustomParamUtils.d.ts.map +1 -1
  158. package/lib/esm/CustomParamUtils.js +6 -3
  159. package/lib/esm/CustomParamUtils.js.map +1 -1
  160. package/lib/esm/CustomParamsMappingStorage.d.ts +1 -1
  161. package/lib/esm/CustomParamsMappingStorage.d.ts.map +1 -1
  162. package/lib/esm/CustomParamsMappingStorage.js +3 -3
  163. package/lib/esm/CustomParamsMappingStorage.js.map +1 -1
  164. package/lib/esm/CustomParamsStorage.d.ts +1 -1
  165. package/lib/esm/CustomParamsStorage.d.ts.map +1 -1
  166. package/lib/esm/CustomParamsStorage.js +3 -3
  167. package/lib/esm/CustomParamsStorage.js.map +1 -1
  168. package/lib/esm/MapLayerPreferences.d.ts +2 -1
  169. package/lib/esm/MapLayerPreferences.d.ts.map +1 -1
  170. package/lib/esm/MapLayerPreferences.js +50 -25
  171. package/lib/esm/MapLayerPreferences.js.map +1 -1
  172. package/lib/esm/MapLayersActionIds.d.ts +5 -0
  173. package/lib/esm/MapLayersActionIds.d.ts.map +1 -0
  174. package/lib/esm/MapLayersActionIds.js +7 -0
  175. package/lib/esm/MapLayersActionIds.js.map +1 -0
  176. package/lib/esm/MapLayersPrefBrowserStorage.d.ts.map +1 -1
  177. package/lib/esm/MapLayersPrefBrowserStorage.js +4 -5
  178. package/lib/esm/MapLayersPrefBrowserStorage.js.map +1 -1
  179. package/lib/esm/PreferencesBrowserStorage.d.ts +17 -17
  180. package/lib/esm/PreferencesBrowserStorage.d.ts.map +1 -1
  181. package/lib/esm/PreferencesBrowserStorage.js +14 -14
  182. package/lib/esm/PreferencesBrowserStorage.js.map +1 -1
  183. package/lib/esm/map-layers.d.ts +1 -0
  184. package/lib/esm/map-layers.d.ts.map +1 -1
  185. package/lib/esm/map-layers.js +4 -3
  186. package/lib/esm/map-layers.js.map +1 -1
  187. package/lib/esm/mapLayers.d.ts +2 -2
  188. package/lib/esm/mapLayers.d.ts.map +1 -1
  189. package/lib/esm/mapLayers.js.map +1 -1
  190. package/lib/esm/public/locales/en/mapLayers.json +179 -184
  191. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
  192. package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
  193. package/lib/esm/ui/FeatureInfoUiItemsProvider.js +48 -18
  194. package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
  195. package/lib/esm/ui/Interfaces.d.ts +3 -3
  196. package/lib/esm/ui/Interfaces.d.ts.map +1 -1
  197. package/lib/esm/ui/Interfaces.js.map +1 -1
  198. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +3 -2
  199. package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
  200. package/lib/esm/ui/MapLayersUiItemsProvider.js +2 -6
  201. package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
  202. package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
  203. package/lib/esm/ui/widget/AttachLayerPopupButton.js +57 -45
  204. package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
  205. package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
  206. package/lib/esm/ui/widget/BasemapPanel.js +19 -23
  207. package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
  208. package/lib/esm/ui/widget/BasemapPanel.scss +2 -4
  209. package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +1 -1
  210. package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
  211. package/lib/esm/ui/widget/ConfirmMessageDialog.js +5 -5
  212. package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
  213. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts +1 -1
  214. package/lib/esm/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
  215. package/lib/esm/ui/widget/CustomParamEditDialog.js +9 -18
  216. package/lib/esm/ui/widget/CustomParamEditDialog.js.map +1 -1
  217. package/lib/esm/ui/widget/CustomParamEditDialog.scss +1 -2
  218. package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -1
  219. package/lib/esm/ui/widget/CustomParamsSettings.js +17 -25
  220. package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -1
  221. package/lib/esm/ui/widget/CustomParamsSettings.scss +7 -9
  222. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
  223. package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
  224. package/lib/esm/ui/widget/FeatureInfoDataProvider.js +4 -2
  225. package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
  226. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +1 -1
  227. package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
  228. package/lib/esm/ui/widget/FeatureInfoWidget.js +10 -14
  229. package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
  230. package/lib/esm/ui/widget/MapLayerActionButtons.d.ts +1 -1
  231. package/lib/esm/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
  232. package/lib/esm/ui/widget/MapLayerActionButtons.js +6 -16
  233. package/lib/esm/ui/widget/MapLayerActionButtons.js.map +1 -1
  234. package/lib/esm/ui/widget/MapLayerDroppable.d.ts +2 -2
  235. package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
  236. package/lib/esm/ui/widget/MapLayerDroppable.js +38 -47
  237. package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
  238. package/lib/esm/ui/widget/MapLayerManager.d.ts +2 -2
  239. package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
  240. package/lib/esm/ui/widget/MapLayerManager.js +134 -83
  241. package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
  242. package/lib/esm/ui/widget/MapLayerManager.scss +3 -6
  243. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
  244. package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
  245. package/lib/esm/ui/widget/MapLayerSettingsMenu.js +9 -12
  246. package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
  247. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
  248. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +11 -12
  249. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
  250. package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
  251. package/lib/esm/ui/widget/MapLayersWidget.d.ts +1 -1
  252. package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
  253. package/lib/esm/ui/widget/MapLayersWidget.js +9 -9
  254. package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
  255. package/lib/esm/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
  256. package/lib/esm/ui/widget/MapManagerMapLayersHeader.js +5 -8
  257. package/lib/esm/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
  258. package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
  259. package/lib/esm/ui/widget/MapManagerSettings.js +29 -53
  260. package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
  261. package/lib/esm/ui/widget/MapManagerSettings.scss +1 -1
  262. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
  263. package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
  264. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js +7 -15
  265. package/lib/esm/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
  266. package/lib/esm/ui/widget/MapSelectFeaturesDialog.scss +1 -3
  267. package/lib/esm/ui/widget/MapUrlDialog.d.ts +4 -3
  268. package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
  269. package/lib/esm/ui/widget/MapUrlDialog.js +79 -79
  270. package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
  271. package/lib/esm/ui/widget/MapUrlDialog.scss +6 -7
  272. package/lib/esm/ui/widget/SelectApiKey.d.ts.map +1 -1
  273. package/lib/esm/ui/widget/SelectApiKey.js +12 -7
  274. package/lib/esm/ui/widget/SelectApiKey.js.map +1 -1
  275. package/lib/esm/ui/widget/SelectCustomParam.d.ts.map +1 -1
  276. package/lib/esm/ui/widget/SelectCustomParam.js +14 -8
  277. package/lib/esm/ui/widget/SelectCustomParam.js.map +1 -1
  278. package/lib/esm/ui/widget/SelectMapFormat.d.ts +3 -3
  279. package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
  280. package/lib/esm/ui/widget/SelectMapFormat.js +11 -14
  281. package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
  282. package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +2 -2
  283. package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
  284. package/lib/esm/ui/widget/SubLayersDataProvider.js +13 -9
  285. package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
  286. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +1 -1
  287. package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
  288. package/lib/esm/ui/widget/SubLayersPopupButton.js +6 -11
  289. package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
  290. package/lib/esm/ui/widget/SubLayersTree.d.ts +2 -2
  291. package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
  292. package/lib/esm/ui/widget/SubLayersTree.js +59 -44
  293. package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
  294. package/lib/esm/ui/widget/SubLayersTree.scss +4 -7
  295. package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
  296. package/lib/esm/ui/widget/TransparencyPopupButton.js +8 -14
  297. package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
  298. package/lib/esm/ui/widget/TransparencyPopupButton.scss +1 -2
  299. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
  300. package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
  301. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js +2 -8
  302. package/lib/esm/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
  303. package/lib/public/locales/en/mapLayers.json +179 -184
  304. package/package.json +9 -21
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayerPreferences.js","sourceRoot":"","sources":["../../src/MapLayerPreferences.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,wDAA8G;AAC9G,sDAA0D;AAC1D,2CAA0C;AAU1C,gBAAgB;AAChB,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,yEAAS,CAAA;IACT,6EAAW,CAAA;IACX,+EAAY,CAAA;AACd,CAAC,EAJW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAInC;AASD;;;;;GAKG;AACH,MAAa,mBAAmB;IAU9B;;;;;;OAMG;IACI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,yBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,iDAAiD,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SACtI;QAED,IAAI;YACF,MAAM,kBAAkB,GAAG,MAAM,uBAAW,CAAC,WAAW,CAAC,GAAG,CAAC;gBAC3D,WAAW;gBACX,SAAS,EAAE,mBAAmB,CAAC,oBAAoB;gBACnD,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,QAAQ;aACT,CAAC,CAAC;YACH,IAAI,SAAS,KAAK,kBAAkB;gBAClC,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SACzC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,yBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,iDAAiD,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SACtI;QAED,MAAM,oBAAoB,GAAqB,EAAE,CAAC;QAClD,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;YACnC,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAe,EAAE,EAAE;gBACnC,MAAM,cAAc,GAAG,8BAAc,CAAC,QAAQ,CAAC,UAAwC,CAAC,CAAC;gBACzF,IAAI,cAAc;oBAChB,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAEO,MAAM,KAAK,oBAAoB;QACrC,OAAO,gCAAgC,CAAC;IAC1C,CAAC;;AAnTH,kDAoTC;AAnTC;;;;;;GAMG;AACoB,wCAAoB,GAAG,IAAI,sBAAO,EAA0G,CAAC,CAAC,mFAAmF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { IModelApp, MapLayerSource, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport { BeEvent, GuidString } from \"@itwin/core-bentley\";\nimport { MapLayersUI } from \"./mapLayers\";\n\n/** @internal */\nexport interface MapLayerPreferencesContent {\n url: string;\n name: string;\n formatId: string;\n transparentBackground: boolean | undefined;\n}\n\n/** @internal */\nexport enum MapLayerSourceChangeType {\n Added = 0,\n Removed = 1,\n Replaced = 2,\n}\n\n/** @internal */\nexport interface MapLayerSourceArg {\n readonly source: MapLayerSource;\n readonly iTwinId: GuidString;\n readonly iModelId: GuidString;\n}\n\n/** A wrapper around user preferences to provide a way to store [[MapLayerSettings]].\n *\n * Note: This is currently internal only and used directly by the MapLayersExtension. It makes use of the IModelApp.authorizationClient if it exists.\n *\n * @internal\n */\nexport class MapLayerPreferences {\n /** Event raised whenever a source is added, replaced or removed:\n * changeType : Type of changed occurred.\n * oldSource : Source that was removed or replaced.\n * newSource : Source that was added or replacement of oldSource.\n *\n * @see [[MapLayerSourceChangeType]]\n */\n public static readonly onLayerSourceChanged = new BeEvent<(changeType: MapLayerSourceChangeType, oldSource?: MapLayerSource, newSource?: MapLayerSource) => void>(); // Used to notify the frontend that it needs to update its list of available layers\n\n /** Store the Map Layer source preference. If the same setting exists at a higher level, an error will be thrown and the setting will not be updated.\n *\n * Returns false if the settings object would override some other settings object in a larger scope i.e. storing settings on model when\n * a project setting exists with same name or map layer url.\n * @param source source to be stored on the setting service\n * @param storeOnIModel if true store the settings object on the model, if false store it on the project\n */\n public static async storeSource(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\n if (!MapLayersUI.iTwinConfig)\n return false;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const sourceJSON = source.toJSON();\n if (!sourceJSON.formatId)\n return false;\n const mapLayerSetting: MapLayerPreferencesContent = {\n url: sourceJSON.url,\n name: sourceJSON.name,\n formatId: sourceJSON.formatId,\n transparentBackground: sourceJSON.transparentBackground,\n };\n\n const result: boolean = await MapLayerPreferences.delete(sourceJSON.url, sourceJSON.name, iTwinId, iModelId, storeOnIModel);\n if (result) {\n await MapLayersUI.iTwinConfig.save({\n accessToken,\n content: mapLayerSetting,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: sourceJSON.name,\n iTwinId,\n iModelId: storeOnIModel ? iModelId : undefined,\n });\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Added, undefined, MapLayerSource.fromJSON(mapLayerSetting));\n return true;\n } else {\n return false;\n }\n }\n\n /** Replace the old map layer source with a new map layer source.\n *\n * The source is replaced at the same level that the original source is defined. (i.e. if the old source is defined at a project level, the new source will also be defined there.)\n *\n * @param oldSource\n * @param newSource\n * @param iTwinId\n * @param iModelId\n */\n public static async replaceSource(oldSource: MapLayerSource, newSource: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\n if (!MapLayersUI.iTwinConfig)\n return;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n let storeOnIModel = false;\n try {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: oldSource.name,\n iTwinId,\n iModelId,\n });\n } catch (_err) {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: oldSource.name,\n iTwinId,\n });\n storeOnIModel = true;\n }\n\n const mapLayerSetting: MapLayerPreferencesContent = {\n url: newSource.url,\n name: newSource.name,\n formatId: newSource.formatId,\n transparentBackground: newSource.transparentBackground,\n };\n\n await MapLayersUI.iTwinConfig.save({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: newSource.name,\n iTwinId,\n iModelId: storeOnIModel ? iModelId : undefined,\n content: mapLayerSetting,\n });\n\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Replaced, oldSource, newSource);\n }\n\n /** Deletes the provided MapLayerSource by name from both the iTwin or iModel level.\n *\n * @param source The source to delete. The name is used to identify the source.\n * @param iTwinId\n * @param iModelId\n */\n public static async deleteByName(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\n if (!MapLayersUI.iTwinConfig)\n return;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n try {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: source.name,\n iTwinId,\n iModelId,\n });\n } catch (_err) {\n // failed to store based on iModelId, attempt using iTwinId\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: source.name,\n iTwinId,\n });\n }\n\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Removed, source, undefined);\n }\n\n /** Deletes the current setting with the provided key if it is defined at the same preference level.\n *\n * If the preference is defined within a different level, false will be returned indicating the setting should not be overriden.\n *\n * The two potential preference levels are iTwin and iModel.\n *\n * @param url\n * @param name\n * @param iTwinId\n * @param iModelId\n * @param storeOnIModel\n */\n private static async delete(url: string, name: string, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\n if (!MapLayersUI.iTwinConfig)\n return true;\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const iTwinPreferenceByName = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: name,\n iTwinId,\n });\n\n if (undefined !== iTwinPreferenceByName && storeOnIModel) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsAsProjectSetting\", { layer: iTwinPreferenceByName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return false;\n } else if (iTwinPreferenceByName) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: iTwinPreferenceByName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: iTwinPreferenceByName.name,\n iTwinId,\n });\n }\n\n // check if setting with url already exists, if it does, delete it\n const settingFromUrl = await MapLayerPreferences.getByUrl(url, iTwinId, undefined);\n if (settingFromUrl && storeOnIModel) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsAsProjectSetting\", { url: settingFromUrl.url, name: settingFromUrl.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return false;\n } else if (settingFromUrl) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", { url: settingFromUrl.url, oldName: settingFromUrl.name, newName: name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingFromUrl.name,\n iTwinId,\n });\n }\n\n if (iModelId) { // delete any settings on model so user can update them if theres collisions\n const settingOnIModelFromName = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: name,\n iTwinId,\n iModelId,\n });\n const settingFromUrlOnIModel = await MapLayerPreferences.getByUrl(url, iTwinId, iModelId);\n if (settingOnIModelFromName) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: settingOnIModelFromName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingOnIModelFromName.name,\n iTwinId,\n iModelId,\n });\n }\n if (settingFromUrlOnIModel) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", { url: settingFromUrlOnIModel.url, oldName: settingFromUrlOnIModel.name, newName: name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingFromUrlOnIModel.name,\n iTwinId,\n iModelId,\n });\n }\n }\n return true;\n }\n\n /** Attempts to get a map layer based off a specific url.\n * @param url\n * @param iTwinId\n * @param iModelId\n */\n public static async getByUrl(url: string, iTwinId: string, iModelId?: string): Promise<MapLayerPreferencesContent | undefined> {\n if (!MapLayersUI.iTwinConfig)\n return undefined;\n\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const settingResponse = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n iModelId,\n });\n\n if (undefined === settingResponse || 0 === settingResponse.length)\n return undefined;\n\n let savedMapLayer;\n settingResponse.settingsMap?.forEach((savedLayer: any) => {\n if (savedLayer.url === url) {\n savedMapLayer = savedLayer;\n }\n });\n return savedMapLayer;\n }\n\n /** Get all MapLayerSources from the user's preferences, iTwin setting and iModel settings.\n * @param iTwinId id of the iTwin\n * @param iModelId id of the iModel\n * @throws if any of the calls to grab settings fail.\n */\n public static async getSources(iTwinId: GuidString, iModelId?: GuidString): Promise<MapLayerSource[]> {\n if (!MapLayersUI.iTwinConfig)\n return [];\n const accessToken = undefined !== IModelApp.authorizationClient ? (await IModelApp.authorizationClient.getAccessToken()) : undefined;\n\n const mapLayerList = [];\n\n try {\n const userResultByProject = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n });\n if (undefined !== userResultByProject)\n mapLayerList.push(userResultByProject);\n } catch (err: any) {\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\n }\n\n try {\n const userResultByIModel = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n iModelId,\n });\n if (undefined !== userResultByIModel)\n mapLayerList.push(userResultByIModel);\n } catch (err: any) {\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\n }\n\n const savedMapLayerSources: MapLayerSource[] = [];\n for (const mapLayer of mapLayerList) {\n mapLayer.forEach((savedLayer: any) => {\n const mapLayerSource = MapLayerSource.fromJSON(savedLayer as MapLayerPreferencesContent);\n if (mapLayerSource)\n savedMapLayerSources.push(mapLayerSource);\n });\n }\n return savedMapLayerSources;\n }\n\n private static get _preferenceNamespace() {\n return \"MapLayerSource-SettingsService\";\n }\n}\n"]}
1
+ {"version":3,"file":"MapLayerPreferences.js","sourceRoot":"","sources":["../../src/MapLayerPreferences.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,wDAA8G;AAE9G,sDAA8C;AAC9C,2CAA0C;AAU1C,gBAAgB;AAChB,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,yEAAS,CAAA;IACT,6EAAW,CAAA;IACX,+EAAY,CAAA;AACd,CAAC,EAJW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAInC;AASD;;;;;GAKG;AACH,MAAa,mBAAmB;IAY9B;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,MAAsB,EAAE,OAAmB,EAAE,QAAqB,EAAE,aAAuB;QACzH,IAAI,CAAC,uBAAW,CAAC,WAAW,EAAE;YAC5B,OAAO,KAAK,CAAC;SACd;QACD,MAAM,WAAW,GAAG,SAAS,KAAK,yBAAS,CAA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W,CAAC,GAAG,CAAC;gBAC3D,WAAW;gBACX,SAAS,EAAE,mBAAmB,CAAC,oBAAoB;gBACnD,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,QAAQ;aACT,CAAC,CAAC;YACH,IAAI,SAAS,KAAK,kBAAkB,EAAE;gBACpC,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;aACvC;SACF;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,yBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,iDAAiD,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SACtI;QAED,MAAM,oBAAoB,GAAqB,EAAE,CAAC;QAClD,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;YACnC,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAe,EAAE,EAAE;gBACnC,MAAM,cAAc,GAAG,8BAAc,CAAC,QAAQ,CAAC,UAAwC,CAAC,CAAC;gBACzF,IAAI,cAAc,EAAE;oBAClB,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;iBAC3C;YACH,CAAC,CAAC,CAAC;SACJ;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAEO,MAAM,KAAK,oBAAoB;QACrC,OAAO,gCAAgC,CAAC;IAC1C,CAAC;;AA9UH,kDA+UC;AA9UC;;;;;;GAMG;AACoB,wCAAoB,GAAG,IAAI,sBAAO,EAEtD,CAAC,CAAC,mFAAmF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModelApp, MapLayerSource, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport type { GuidString } from \"@itwin/core-bentley\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { MapLayersUI } from \"./mapLayers\";\n\n/** @internal */\nexport interface MapLayerPreferencesContent {\n url: string;\n name: string;\n formatId: string;\n transparentBackground: boolean | undefined;\n}\n\n/** @internal */\nexport enum MapLayerSourceChangeType {\n Added = 0,\n Removed = 1,\n Replaced = 2,\n}\n\n/** @internal */\nexport interface MapLayerSourceArg {\n readonly source: MapLayerSource;\n readonly iTwinId: GuidString;\n readonly iModelId: GuidString;\n}\n\n/** A wrapper around user preferences to provide a way to store [[MapLayerSettings]].\n *\n * Note: This is currently internal only and used directly by the MapLayersExtension. It makes use of the IModelApp.authorizationClient if it exists.\n *\n * @internal\n */\nexport class MapLayerPreferences {\n /** Event raised whenever a source is added, replaced or removed:\n * changeType : Type of changed occurred.\n * oldSource : Source that was removed or replaced.\n * newSource : Source that was added or replacement of oldSource.\n *\n * @see [[MapLayerSourceChangeType]]\n */\n public static readonly onLayerSourceChanged = new BeEvent<\n (changeType: MapLayerSourceChangeType, oldSource?: MapLayerSource, newSource?: MapLayerSource) => void\n >(); // Used to notify the frontend that it needs to update its list of available layers\n\n /** Store the Map Layer source preference. If the same setting exists at a higher level, an error will be thrown and the setting will not be updated.\n *\n * Returns false if the settings object would override some other settings object in a larger scope i.e. storing settings on model when\n * a project setting exists with same name or map layer url.\n * @param source source to be stored on the setting service\n * @param storeOnIModel if true store the settings object on the model, if false store it on the project\n */\n public static async storeSource(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\n if (!MapLayersUI.iTwinConfig) {\n return false;\n }\n const accessToken = undefined !== IModelApp.authorizationClient ? await IModelApp.authorizationClient.getAccessToken() : undefined;\n\n const sourceJSON = source.toJSON();\n if (!sourceJSON.formatId) {\n return false;\n }\n const mapLayerSetting: MapLayerPreferencesContent = {\n url: sourceJSON.url,\n name: sourceJSON.name,\n formatId: sourceJSON.formatId,\n transparentBackground: sourceJSON.transparentBackground,\n };\n\n const result: boolean = await MapLayerPreferences.delete(sourceJSON.url, sourceJSON.name, iTwinId, iModelId, storeOnIModel);\n if (result) {\n await MapLayersUI.iTwinConfig.save({\n accessToken,\n content: mapLayerSetting,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: sourceJSON.name,\n iTwinId,\n iModelId: storeOnIModel ? iModelId : undefined,\n });\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Added, undefined, MapLayerSource.fromJSON(mapLayerSetting));\n return true;\n } else {\n return false;\n }\n }\n\n /** Replace the old map layer source with a new map layer source.\n *\n * The source is replaced at the same level that the original source is defined. (i.e. if the old source is defined at a project level, the new source will also be defined there.)\n *\n * @param oldSource\n * @param newSource\n * @param iTwinId\n * @param iModelId\n */\n public static async replaceSource(oldSource: MapLayerSource, newSource: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\n if (!MapLayersUI.iTwinConfig) {\n return;\n }\n const accessToken = undefined !== IModelApp.authorizationClient ? await IModelApp.authorizationClient.getAccessToken() : undefined;\n\n let storeOnIModel = false;\n try {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: oldSource.name,\n iTwinId,\n iModelId,\n });\n } catch (_err) {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: oldSource.name,\n iTwinId,\n });\n storeOnIModel = true;\n }\n\n const mapLayerSetting: MapLayerPreferencesContent = {\n url: newSource.url,\n name: newSource.name,\n formatId: newSource.formatId,\n transparentBackground: newSource.transparentBackground,\n };\n\n await MapLayersUI.iTwinConfig.save({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: newSource.name,\n iTwinId,\n iModelId: storeOnIModel ? iModelId : undefined,\n content: mapLayerSetting,\n });\n\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Replaced, oldSource, newSource);\n }\n\n /** Deletes the provided MapLayerSource by name from both the iTwin or iModel level.\n *\n * @param source The source to delete. The name is used to identify the source.\n * @param iTwinId\n * @param iModelId\n */\n public static async deleteByName(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise<void> {\n if (!MapLayersUI.iTwinConfig) {\n return;\n }\n const accessToken = undefined !== IModelApp.authorizationClient ? await IModelApp.authorizationClient.getAccessToken() : undefined;\n\n try {\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: source.name,\n iTwinId,\n iModelId,\n });\n } catch (_err) {\n // failed to store based on iModelId, attempt using iTwinId\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: source.name,\n iTwinId,\n });\n }\n\n MapLayerPreferences.onLayerSourceChanged.raiseEvent(MapLayerSourceChangeType.Removed, source, undefined);\n }\n\n /** Deletes the current setting with the provided key if it is defined at the same preference level.\n *\n * If the preference is defined within a different level, false will be returned indicating the setting should not be overriden.\n *\n * The two potential preference levels are iTwin and iModel.\n *\n * @param url\n * @param name\n * @param iTwinId\n * @param iModelId\n * @param storeOnIModel\n */\n private static async delete(url: string, name: string, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise<boolean> {\n if (!MapLayersUI.iTwinConfig) {\n return true;\n }\n const accessToken = undefined !== IModelApp.authorizationClient ? await IModelApp.authorizationClient.getAccessToken() : undefined;\n\n const iTwinPreferenceByName = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: name,\n iTwinId,\n });\n\n if (undefined !== iTwinPreferenceByName && storeOnIModel) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsAsProjectSetting\", {\n layer: iTwinPreferenceByName.name,\n });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return false;\n } else if (iTwinPreferenceByName) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: iTwinPreferenceByName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: iTwinPreferenceByName.name,\n iTwinId,\n });\n }\n\n // check if setting with url already exists, if it does, delete it\n const settingFromUrl = await MapLayerPreferences.getByUrl(url, iTwinId, undefined);\n if (settingFromUrl && storeOnIModel) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsAsProjectSetting\", {\n url: settingFromUrl.url,\n name: settingFromUrl.name,\n });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return false;\n } else if (settingFromUrl) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", {\n url: settingFromUrl.url,\n oldName: settingFromUrl.name,\n newName: name,\n });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingFromUrl.name,\n iTwinId,\n });\n }\n\n if (iModelId) {\n // delete any settings on model so user can update them if theres collisions\n const settingOnIModelFromName = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: name,\n iTwinId,\n iModelId,\n });\n const settingFromUrlOnIModel = await MapLayerPreferences.getByUrl(url, iTwinId, iModelId);\n if (settingOnIModelFromName) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerExistsOverwriting\", { layer: settingOnIModelFromName.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingOnIModelFromName.name,\n iTwinId,\n iModelId,\n });\n }\n if (settingFromUrlOnIModel) {\n const infoMessage = IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.LayerWithUrlExistsOverwriting\", {\n url: settingFromUrlOnIModel.url,\n oldName: settingFromUrlOnIModel.name,\n newName: name,\n });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, infoMessage));\n await MapLayersUI.iTwinConfig.delete({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: settingFromUrlOnIModel.name,\n iTwinId,\n iModelId,\n });\n }\n }\n return true;\n }\n\n /** Attempts to get a map layer based off a specific url.\n * @param url\n * @param iTwinId\n * @param iModelId\n */\n public static async getByUrl(url: string, iTwinId: string, iModelId?: string): Promise<MapLayerPreferencesContent | undefined> {\n if (!MapLayersUI.iTwinConfig) {\n return undefined;\n }\n\n const accessToken = undefined !== IModelApp.authorizationClient ? await IModelApp.authorizationClient.getAccessToken() : undefined;\n\n const settingResponse = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n iModelId,\n });\n\n if (undefined === settingResponse || 0 === settingResponse.length) {\n return undefined;\n }\n\n let savedMapLayer;\n settingResponse.settingsMap?.forEach((savedLayer: any) => {\n if (savedLayer.url === url) {\n savedMapLayer = savedLayer;\n }\n });\n return savedMapLayer;\n }\n\n /** Get all MapLayerSources from the user's preferences, iTwin setting and iModel settings.\n * @param iTwinId id of the iTwin\n * @param iModelId id of the iModel\n * @throws if any of the calls to grab settings fail.\n */\n public static async getSources(iTwinId: GuidString, iModelId?: GuidString): Promise<MapLayerSource[]> {\n if (!MapLayersUI.iTwinConfig) {\n return [];\n }\n const accessToken = undefined !== IModelApp.authorizationClient ? await IModelApp.authorizationClient.getAccessToken() : undefined;\n\n const mapLayerList = [];\n\n try {\n const userResultByProject = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n });\n if (undefined !== userResultByProject) {\n mapLayerList.push(userResultByProject);\n }\n } catch (err: any) {\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\n }\n\n try {\n const userResultByIModel = await MapLayersUI.iTwinConfig.get({\n accessToken,\n namespace: MapLayerPreferences._preferenceNamespace,\n key: \"\",\n iTwinId,\n iModelId,\n });\n if (undefined !== userResultByIModel) {\n mapLayerList.push(userResultByIModel);\n }\n } catch (err: any) {\n throw new Error(IModelApp.localization.getLocalizedString(\"mapLayers:CustomAttach.ErrorRetrieveUserProject\", { errorMessage: err }));\n }\n\n const savedMapLayerSources: MapLayerSource[] = [];\n for (const mapLayer of mapLayerList) {\n mapLayer.forEach((savedLayer: any) => {\n const mapLayerSource = MapLayerSource.fromJSON(savedLayer as MapLayerPreferencesContent);\n if (mapLayerSource) {\n savedMapLayerSources.push(mapLayerSource);\n }\n });\n }\n return savedMapLayerSources;\n }\n\n private static get _preferenceNamespace() {\n return \"MapLayerSource-SettingsService\";\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export declare enum MapLayersSyncUiEventId {
2
+ /** The display style settings map imagery has changed. */
3
+ MapImageryChanged = "mapimagerychanged"
4
+ }
5
+ //# sourceMappingURL=MapLayersActionIds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLayersActionIds.d.ts","sourceRoot":"","sources":["../../src/MapLayersActionIds.ts"],"names":[],"mappings":"AAEA,oBAAY,sBAAsB;IAChC,0DAA0D;IAC1D,iBAAiB,sBAAsB;CACxC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MapLayersSyncUiEventId = void 0;
5
+ var MapLayersSyncUiEventId;
6
+ (function (MapLayersSyncUiEventId) {
7
+ /** The display style settings map imagery has changed. */
8
+ MapLayersSyncUiEventId["MapImageryChanged"] = "mapimagerychanged";
9
+ })(MapLayersSyncUiEventId = exports.MapLayersSyncUiEventId || (exports.MapLayersSyncUiEventId = {}));
10
+ //# sourceMappingURL=MapLayersActionIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapLayersActionIds.js","sourceRoot":"","sources":["../../src/MapLayersActionIds.ts"],"names":[],"mappings":";AAAA,oEAAoE;;;AAEpE,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,0DAA0D;IAC1D,iEAAuC,CAAA;AACzC,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC","sourcesContent":["// Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n\nexport enum MapLayersSyncUiEventId {\n /** The display style settings map imagery has changed. */\n MapImageryChanged = \"mapimagerychanged\",\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayersPrefBrowserStorage.d.ts","sourceRoot":"","sources":["../../src/MapLayersPrefBrowserStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,qBAAa,2BAA4B,SAAQ,yBAAyB;;CAMzE"}
1
+ {"version":3,"file":"MapLayersPrefBrowserStorage.d.ts","sourceRoot":"","sources":["../../src/MapLayersPrefBrowserStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,qBAAa,2BAA4B,SAAQ,yBAAyB;;CAOzE"}
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.MapLayersPrefBrowserStorage = void 0;
8
8
  const PreferencesBrowserStorage_1 = require("./PreferencesBrowserStorage");
9
9
  class MapLayersPrefBrowserStorage extends PreferencesBrowserStorage_1.PreferencesBrowserStorage {
10
10
  constructor() {
11
- super("itwinjs.mapLayers", { throwOnDeleteMissingKey: true } // 'MapLayerPreferences.replaceSource' expect 'delete' to throw when there is no match for the provided key.
12
- );
11
+ super("itwinjs.mapLayers", { throwOnDeleteMissingKey: true });
13
12
  }
14
13
  }
15
14
  exports.MapLayersPrefBrowserStorage = MapLayersPrefBrowserStorage;
@@ -1 +1 @@
1
- {"version":3,"file":"MapLayersPrefBrowserStorage.js","sourceRoot":"","sources":["../../src/MapLayersPrefBrowserStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,2EAAwE;AAExE,MAAa,2BAA4B,SAAQ,qDAAyB;IACxE;QACE,KAAK,CAAC,mBAAmB,EACvB,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAG,4GAA4G;SACjJ,CAAC;IACJ,CAAC;CACF;AAND,kEAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { PreferencesBrowserStorage } from \"./PreferencesBrowserStorage\";\n\nexport class MapLayersPrefBrowserStorage extends PreferencesBrowserStorage {\n constructor() {\n super(\"itwinjs.mapLayers\",\n { throwOnDeleteMissingKey: true } // 'MapLayerPreferences.replaceSource' expect 'delete' to throw when there is no match for the provided key.\n );\n }\n}\n"]}
1
+ {"version":3,"file":"MapLayersPrefBrowserStorage.js","sourceRoot":"","sources":["../../src/MapLayersPrefBrowserStorage.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,2EAAwE;AAExE,MAAa,2BAA4B,SAAQ,qDAAyB;IACxE;QACE,KAAK,CACH,mBAAmB,EACnB,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAClC,CAAC;IACJ,CAAC;CACF;AAPD,kEAOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { PreferencesBrowserStorage } from \"./PreferencesBrowserStorage\";\n\nexport class MapLayersPrefBrowserStorage extends PreferencesBrowserStorage {\n constructor() {\n super(\n \"itwinjs.mapLayers\",\n { throwOnDeleteMissingKey: true }, // 'MapLayerPreferences.replaceSource' expect 'delete' to throw when there is no match for the provided key.\n );\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ITwinIdArg, PreferenceArg, PreferenceKeyArg, UserPreferencesAccess } from "@itwin/core-frontend";
1
+ import type { ITwinIdArg, PreferenceArg, PreferenceKeyArg, UserPreferencesAccess } from "@itwin/core-frontend";
2
2
  /** Index signature holding preferences content
3
3
  *
4
4
  * @internal
@@ -7,28 +7,28 @@ interface KeyContentProps {
7
7
  [preferenceKey: string]: any;
8
8
  }
9
9
  /**
10
- * @beta
11
- */
10
+ * @beta
11
+ */
12
12
  export interface PreferencesBrowserStorageOptions {
13
13
  /** indicate whether or not delete function should throw an error if the provided key cannot be found. */
14
14
  throwOnDeleteMissingKey?: boolean;
15
15
  }
16
16
  /** User preferences implementation using browser's local storage.
17
- * It creates storage item key in the form of:
18
- * <storageItemKeyPrefix>.<itwin_guid?>.<imodel_guid?>
19
- *
20
- * <itwin_guid> and <imodel_guid> being optional.
21
- *
22
- * Each entry in the storage is a serialized JSON of the following index signature:
23
- * {
24
- * "<preference_namespace?>.<preference_key>": {
25
- * ...
26
- * <preferences_json_content>
27
- * },
28
- * ...
29
- * }
17
+ * It creates storage item key in the form of:
18
+ * <storageItemKeyPrefix>.<itwin_guid?>.<imodel_guid?>
19
+ *
20
+ * <itwin_guid> and <imodel_guid> being optional.
21
+ *
22
+ * Each entry in the storage is a serialized JSON of the following index signature:
23
+ * {
24
+ * "<preference_namespace?>.<preference_key>": {
25
+ * ...
26
+ * <preferences_json_content>
27
+ * },
28
+ * ...
29
+ * }
30
30
  * @beta
31
- */
31
+ */
32
32
  export declare class PreferencesBrowserStorage implements UserPreferencesAccess {
33
33
  private readonly _options;
34
34
  private readonly _storageItemKeyPrefix;
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesBrowserStorage.d.ts","sourceRoot":"","sources":["../../src/PreferencesBrowserStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG1G;;;GAGG;AACH,UAAU,eAAe;IACvB,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,CAAC;CAC9B;AAED;;EAEE;AACF,MAAM,WAAW,gCAAgC;IAC/C,yGAAyG;IACzG,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;;;;;;;;;;;EAeE;AACF,qBAAa,yBAA0B,YAAW,qBAAqB;IAErE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+C;IACxE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;gBAEnC,oBAAoB,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gCAAgC;IAKjF,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,MAAM,CAAC,gBAAgB;IASlB,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,UAAU;IAKtC,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,UAAU;IAKzC,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,UAAU;CAIlD"}
1
+ {"version":3,"file":"PreferencesBrowserStorage.d.ts","sourceRoot":"","sources":["../../src/PreferencesBrowserStorage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG/G;;;GAGG;AACH,UAAU,eAAe;IACvB,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,yGAAyG;IACzG,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,yBAA0B,YAAW,qBAAqB;IACrE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+C;IACxE,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;gBAEnC,oBAAoB,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gCAAgC;IAKjF,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,MAAM,CAAC,gBAAgB;IASlB,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,UAAU;IAKtC,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,UAAU;IAKzC,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,UAAU;CAIlD"}
@@ -3,21 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PreferencesBrowserStorage = void 0;
4
4
  const BrowserStorage_1 = require("./BrowserStorage");
5
5
  /** User preferences implementation using browser's local storage.
6
- * It creates storage item key in the form of:
7
- * <storageItemKeyPrefix>.<itwin_guid?>.<imodel_guid?>
8
- *
9
- * <itwin_guid> and <imodel_guid> being optional.
10
- *
11
- * Each entry in the storage is a serialized JSON of the following index signature:
12
- * {
13
- * "<preference_namespace?>.<preference_key>": {
14
- * ...
15
- * <preferences_json_content>
16
- * },
17
- * ...
18
- * }
6
+ * It creates storage item key in the form of:
7
+ * <storageItemKeyPrefix>.<itwin_guid?>.<imodel_guid?>
8
+ *
9
+ * <itwin_guid> and <imodel_guid> being optional.
10
+ *
11
+ * Each entry in the storage is a serialized JSON of the following index signature:
12
+ * {
13
+ * "<preference_namespace?>.<preference_key>": {
14
+ * ...
15
+ * <preferences_json_content>
16
+ * },
17
+ * ...
18
+ * }
19
19
  * @beta
20
- */
20
+ */
21
21
  class PreferencesBrowserStorage {
22
22
  constructor(storageItemKeyPrefix, opts) {
23
23
  this._options = opts;
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesBrowserStorage.js","sourceRoot":"","sources":["../../src/PreferencesBrowserStorage.ts"],"names":[],"mappings":";;;AAKA,qDAAkD;AAkBlD;;;;;;;;;;;;;;;EAeE;AACF,MAAa,yBAAyB;IAKpC,YAAY,oBAA4B,EAAE,IAAuC;QAC/E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;IACpD,CAAC;IAEO,iBAAiB,CAAC,GAAe;QACvC,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,MAAM,WAAW,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,OAAO,GAAG,IAAI,CAAC,qBAAqB,GAAG,UAAU,GAAG,WAAW,EAAE,CAAC;IACpE,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,GAAqB;QACnD,IAAI,GAAG,CAAC,GAAG,EAAE;YACX,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACvD,OAAO,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;SAC7B;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAkC;QACjD,MAAM,OAAO,GAAG,IAAI,+BAAc,CAAkB,EAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC;QAChG,OAAO,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,GAAkC;QACpD,MAAM,OAAO,GAAG,IAAI,+BAAc,CAAkB,EAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC;QAChG,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,GAA+B;QAC/C,MAAM,OAAO,GAAG,IAAI,+BAAc,CAAkB,EAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC;QAChG,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF;AAvCD,8DAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ITwinIdArg, PreferenceArg, PreferenceKeyArg, UserPreferencesAccess } from \"@itwin/core-frontend\";\nimport { BrowserStorage } from \"./BrowserStorage\";\n\n/** Index signature holding preferences content\n *\n * @internal\n */\ninterface KeyContentProps {\n [preferenceKey: string]: any;\n}\n\n/**\n* @beta\n*/\nexport interface PreferencesBrowserStorageOptions {\n /** indicate whether or not delete function should throw an error if the provided key cannot be found. */\n throwOnDeleteMissingKey?: boolean;\n}\n\n/** User preferences implementation using browser's local storage.\n * It creates storage item key in the form of:\n * <storageItemKeyPrefix>.<itwin_guid?>.<imodel_guid?>\n *\n * <itwin_guid> and <imodel_guid> being optional.\n *\n * Each entry in the storage is a serialized JSON of the following index signature:\n * {\n * \"<preference_namespace?>.<preference_key>\": {\n * ...\n * <preferences_json_content>\n * },\n * ...\n * }\n * @beta\n*/\nexport class PreferencesBrowserStorage implements UserPreferencesAccess {\n\n private readonly _options: PreferencesBrowserStorageOptions | undefined;\n private readonly _storageItemKeyPrefix: string;\n\n constructor(storageItemKeyPrefix: string, opts?: PreferencesBrowserStorageOptions) {\n this._options = opts;\n this._storageItemKeyPrefix = storageItemKeyPrefix;\n }\n\n private getStorageItemKey(arg: ITwinIdArg) {\n const itwinIdStr = arg.iTwinId ? `.${arg.iTwinId}` : \"\";\n const imodelIdStr = arg.iModelId ? `.${arg.iModelId}` : \"\";\n return `${this._storageItemKeyPrefix}${itwinIdStr}${imodelIdStr}`;\n }\n\n private static getPreferenceKey(arg: PreferenceKeyArg) {\n if (arg.key) {\n const nsStr = arg.namespace ? `${arg.namespace}.` : \"\";\n return `${nsStr}${arg.key}`;\n }\n\n return \"\";\n }\n\n public async get(arg: PreferenceKeyArg & ITwinIdArg) {\n const storage = new BrowserStorage<KeyContentProps>({itemKeyName: this.getStorageItemKey(arg)});\n return storage.get(PreferencesBrowserStorage.getPreferenceKey(arg));\n }\n\n public async delete(arg: PreferenceKeyArg & ITwinIdArg) {\n const storage = new BrowserStorage<KeyContentProps>({itemKeyName: this.getStorageItemKey(arg)});\n storage.delete(PreferencesBrowserStorage.getPreferenceKey(arg));\n }\n\n public async save(arg: PreferenceArg & ITwinIdArg) {\n const storage = new BrowserStorage<KeyContentProps>({itemKeyName: this.getStorageItemKey(arg)});\n storage.save(PreferencesBrowserStorage.getPreferenceKey(arg), arg.content);\n }\n}\n"]}
1
+ {"version":3,"file":"PreferencesBrowserStorage.js","sourceRoot":"","sources":["../../src/PreferencesBrowserStorage.ts"],"names":[],"mappings":";;;AAKA,qDAAkD;AAkBlD;;;;;;;;;;;;;;;GAeG;AACH,MAAa,yBAAyB;IAIpC,YAAY,oBAA4B,EAAE,IAAuC;QAC/E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;IACpD,CAAC;IAEO,iBAAiB,CAAC,GAAe;QACvC,MAA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I,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClG,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF;AAtCD,8DAsCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { ITwinIdArg, PreferenceArg, PreferenceKeyArg, UserPreferencesAccess } from \"@itwin/core-frontend\";\nimport { BrowserStorage } from \"./BrowserStorage\";\n\n/** Index signature holding preferences content\n *\n * @internal\n */\ninterface KeyContentProps {\n [preferenceKey: string]: any;\n}\n\n/**\n * @beta\n */\nexport interface PreferencesBrowserStorageOptions {\n /** indicate whether or not delete function should throw an error if the provided key cannot be found. */\n throwOnDeleteMissingKey?: boolean;\n}\n\n/** User preferences implementation using browser's local storage.\n * It creates storage item key in the form of:\n * <storageItemKeyPrefix>.<itwin_guid?>.<imodel_guid?>\n *\n * <itwin_guid> and <imodel_guid> being optional.\n *\n * Each entry in the storage is a serialized JSON of the following index signature:\n * {\n * \"<preference_namespace?>.<preference_key>\": {\n * ...\n * <preferences_json_content>\n * },\n * ...\n * }\n * @beta\n */\nexport class PreferencesBrowserStorage implements UserPreferencesAccess {\n private readonly _options: PreferencesBrowserStorageOptions | undefined;\n private readonly _storageItemKeyPrefix: string;\n\n constructor(storageItemKeyPrefix: string, opts?: PreferencesBrowserStorageOptions) {\n this._options = opts;\n this._storageItemKeyPrefix = storageItemKeyPrefix;\n }\n\n private getStorageItemKey(arg: ITwinIdArg) {\n const itwinIdStr = arg.iTwinId ? `.${arg.iTwinId}` : \"\";\n const imodelIdStr = arg.iModelId ? `.${arg.iModelId}` : \"\";\n return `${this._storageItemKeyPrefix}${itwinIdStr}${imodelIdStr}`;\n }\n\n private static getPreferenceKey(arg: PreferenceKeyArg) {\n if (arg.key) {\n const nsStr = arg.namespace ? `${arg.namespace}.` : \"\";\n return `${nsStr}${arg.key}`;\n }\n\n return \"\";\n }\n\n public async get(arg: PreferenceKeyArg & ITwinIdArg) {\n const storage = new BrowserStorage<KeyContentProps>({ itemKeyName: this.getStorageItemKey(arg) });\n return storage.get(PreferencesBrowserStorage.getPreferenceKey(arg));\n }\n\n public async delete(arg: PreferenceKeyArg & ITwinIdArg) {\n const storage = new BrowserStorage<KeyContentProps>({ itemKeyName: this.getStorageItemKey(arg) });\n storage.delete(PreferencesBrowserStorage.getPreferenceKey(arg));\n }\n\n public async save(arg: PreferenceArg & ITwinIdArg) {\n const storage = new BrowserStorage<KeyContentProps>({ itemKeyName: this.getStorageItemKey(arg) });\n storage.save(PreferencesBrowserStorage.getPreferenceKey(arg), arg.content);\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export * from "./mapLayers";
2
+ export * from "./MapLayersActionIds";
2
3
  export * from "./MapLayersPrefBrowserStorage";
3
4
  export * from "./ui/Interfaces";
4
5
  export * from "./ui/MapLayersUiItemsProvider";
@@ -1 +1 @@
1
- {"version":3,"file":"map-layers.d.ts","sourceRoot":"","sources":["../../src/map-layers.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"map-layers.d.ts","sourceRoot":"","sources":["../../src/map-layers.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC"}
@@ -15,10 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*---------------------------------------------------------------------------------------------
18
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
19
- * See LICENSE.md in the project root for license terms and full copyright notice.
20
- *--------------------------------------------------------------------------------------------*/
18
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
19
+ * See LICENSE.md in the project root for license terms and full copyright notice.
20
+ *--------------------------------------------------------------------------------------------*/
21
21
  __exportStar(require("./mapLayers"), exports);
22
+ __exportStar(require("./MapLayersActionIds"), exports);
22
23
  __exportStar(require("./MapLayersPrefBrowserStorage"), exports);
23
24
  __exportStar(require("./ui/Interfaces"), exports);
24
25
  __exportStar(require("./ui/MapLayersUiItemsProvider"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"map-layers.js","sourceRoot":"","sources":["../../src/map-layers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,8CAA4B;AAC5B,gEAA8C;AAC9C,kDAAgC;AAChC,gEAA8C;AAC9C,kEAAgD;AAChD,8DAA4C","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\nexport * from \"./mapLayers\";\r\nexport * from \"./MapLayersPrefBrowserStorage\";\r\nexport * from \"./ui/Interfaces\";\r\nexport * from \"./ui/MapLayersUiItemsProvider\";\r\nexport * from \"./ui/FeatureInfoUiItemsProvider\";\r\nexport * from \"./ui/widget/MapLayersWidget\";\r\n"]}
1
+ {"version":3,"file":"map-layers.js","sourceRoot":"","sources":["../../src/map-layers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,8CAA4B;AAC5B,uDAAqC;AACrC,gEAA8C;AAC9C,kDAAgC;AAChC,gEAA8C;AAC9C,kEAAgD;AAChD,8DAA4C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nexport * from \"./mapLayers\";\nexport * from \"./MapLayersActionIds\";\nexport * from \"./MapLayersPrefBrowserStorage\";\nexport * from \"./ui/Interfaces\";\nexport * from \"./ui/MapLayersUiItemsProvider\";\nexport * from \"./ui/FeatureInfoUiItemsProvider\";\nexport * from \"./ui/widget/MapLayersWidget\";\n"]}
@@ -1,5 +1,5 @@
1
- import { Localization, TranslationOptions } from "@itwin/core-common";
2
- import { UserPreferencesAccess } from "@itwin/core-frontend";
1
+ import type { Localization, TranslationOptions } from "@itwin/core-common";
2
+ import type { UserPreferencesAccess } from "@itwin/core-frontend";
3
3
  export interface MapLayersConfig {
4
4
  localization?: Localization;
5
5
  /** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAa,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAe;IACxC,OAAc,YAAY,EAAE,YAAY,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAgB;IAClD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAwB;IAEpD,WAAkB,WAAW,IAAI,qBAAqB,GAAG,SAAS,CAEjE;IAED,wCAAwC;WACpB,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAUvE,4EAA4E;WAC9D,SAAS;IAIvB,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;WAEa,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;CAGtF"}
1
+ {"version":3,"file":"mapLayers.d.ts","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAe;IACxC,OAAc,YAAY,EAAE,YAAY,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAgB;IAClD,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAwB;IAEpD,WAAkB,WAAW,IAAI,qBAAqB,GAAG,SAAS,CAEjE;IAED,wCAAwC;WACpB,UAAU,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvE,4EAA4E;WAC9D,SAAS;IAIvB,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;WAEa,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM;CAGtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayers.js","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":";;;AAKA,wDAAwE;AAQxE;;;;;GAKG;AACH,MAAa,WAAW;IAMf,MAAM,KAAK,WAAW;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAwB;QACrD,mEAAmE;QACnE,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,yBAAS,CAAC,YAAY,CAAC;QAC1E,MAAM,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAC9C,WAAW,CAAC,qBAAqB,CAClC,CAAC;QAEF,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,WAAW,CAAC;IACjD,CAAC;IAED,4EAA4E;IACrE,MAAM,CAAC,SAAS;QACrB,yBAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,WAAW,CAAC,UAAU,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,GAAsB,EAAE,OAA4B;QAC1E,OAAO,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAC,GAAG,OAAO,EAAE,EAAE,EAAE,WAAW,CAAC,UAAU,EAAC,CAAC,CAAC;IACpG,CAAC;;AAjCH,kCAkCC;AAjCgB,sBAAU,GAAG,WAAW,CAAC;AAEzB,+BAAmB,GAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Localization, TranslationOptions } from \"@itwin/core-common\";\nimport { IModelApp, UserPreferencesAccess } from \"@itwin/core-frontend\";\n\nexport interface MapLayersConfig {\n localization?: Localization;\n /** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */\n iTwinConfig?: UserPreferencesAccess;\n}\n\n/** MapLayersUI is use when the package is used as a dependency to another app.\n * '''ts\n * await MapLayersUI.initialize({...MapLayersInitProps});\n * '''\n * @beta\n */\nexport class MapLayersUI {\n private static _defaultNs = \"mapLayers\";\n public static localization: Localization;\n private static _uiItemsProvidersId: string[] = [];\n private static _iTwinConfig?: UserPreferencesAccess;\n\n public static get iTwinConfig(): UserPreferencesAccess | undefined {\n return this._iTwinConfig;\n }\n\n /** Used to initialize the Map Layers */\n public static async initialize(config?: MapLayersConfig): Promise<void> {\n // register namespace containing localized strings for this package\n MapLayersUI.localization = config?.localization ?? IModelApp.localization;\n await MapLayersUI.localization.registerNamespace(\n MapLayersUI.localizationNamespace\n );\n\n MapLayersUI._iTwinConfig = config?.iTwinConfig;\n }\n\n /** Unregisters internationalization service namespace and UiItemManager */\n public static terminate() {\n IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersUI._defaultNs;\n }\n\n public static translate(key: string | string[], options?: TranslationOptions): string {\n return MapLayersUI.localization.getLocalizedString(key, {...options, ns: MapLayersUI._defaultNs});\n }\n}\n"]}
1
+ {"version":3,"file":"mapLayers.js","sourceRoot":"","sources":["../../src/mapLayers.ts"],"names":[],"mappings":";;;AAMA,wDAAiD;AAQjD;;;;;GAKG;AACH,MAAa,WAAW;IAMf,MAAM,KAAK,WAAW;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,wCAAwC;IACjC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAwB;QACrD,mEAAmE;QACnE,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,yBAAS,CAAC,YAAY,CAAC;QAC1E,MAAM,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;QAEpF,WAAW,CAAC,YAAY,GAAG,MAAM,EAAE,WAAW,CAAC;IACjD,CAAC;IAED,4EAA4E;IACrE,MAAM,CAAC,SAAS;QACrB,yBAAS,CAAC,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAChF,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,WAAW,CAAC,UAAU,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,GAAsB,EAAE,OAA4B;QAC1E,OAAO,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IACtG,CAAC;;AA/BH,kCAgCC;AA/BgB,sBAAU,GAAG,WAAW,CAAC;AAEzB,+BAAmB,GAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport type { Localization, TranslationOptions } from \"@itwin/core-common\";\nimport type { UserPreferencesAccess } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nexport interface MapLayersConfig {\n localization?: Localization;\n /** If an iTwinConfig is provided, it will be used to load the MapLayerSources that are stored. */\n iTwinConfig?: UserPreferencesAccess;\n}\n\n/** MapLayersUI is use when the package is used as a dependency to another app.\n * '''ts\n * await MapLayersUI.initialize({...MapLayersInitProps});\n * '''\n * @beta\n */\nexport class MapLayersUI {\n private static _defaultNs = \"mapLayers\";\n public static localization: Localization;\n private static _uiItemsProvidersId: string[] = [];\n private static _iTwinConfig?: UserPreferencesAccess;\n\n public static get iTwinConfig(): UserPreferencesAccess | undefined {\n return this._iTwinConfig;\n }\n\n /** Used to initialize the Map Layers */\n public static async initialize(config?: MapLayersConfig): Promise<void> {\n // register namespace containing localized strings for this package\n MapLayersUI.localization = config?.localization ?? IModelApp.localization;\n await MapLayersUI.localization.registerNamespace(MapLayersUI.localizationNamespace);\n\n MapLayersUI._iTwinConfig = config?.iTwinConfig;\n }\n\n /** Unregisters internationalization service namespace and UiItemManager */\n public static terminate() {\n IModelApp.localization.unregisterNamespace(MapLayersUI.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersUI._defaultNs;\n }\n\n public static translate(key: string | string[], options?: TranslationOptions): string {\n return MapLayersUI.localization.getLocalizedString(key, { ...options, ns: MapLayersUI._defaultNs });\n }\n}\n"]}