@finsemble/finsemble-ui 6.3.0 → 6.3.3

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 (546) hide show
  1. package/README.md +28 -28
  2. package/package.json +1 -1
  3. package/react/actions/favoriteActions.js.map +1 -1
  4. package/react/actions/linkerActions.js.map +1 -1
  5. package/react/actions/menuActions.js.map +1 -1
  6. package/react/actions/rootActions.js.map +1 -1
  7. package/react/actions/searchActions.js.map +1 -1
  8. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  9. package/react/actions/toolbarActions.js.map +1 -1
  10. package/react/actions/workspaceActions.js.map +1 -1
  11. package/react/assets/css/advancedAppLauncher.css +636 -636
  12. package/react/assets/css/appCatalog.css +1069 -1069
  13. package/react/assets/css/authentication.css +78 -78
  14. package/react/assets/css/button.css +220 -220
  15. package/react/assets/css/core/formElements.css +23 -23
  16. package/react/assets/css/core/icons.css +69 -69
  17. package/react/assets/css/core/notifications.css +75 -75
  18. package/react/assets/css/core/windowFrame.css +36 -36
  19. package/react/assets/css/dashbar.css +78 -78
  20. package/react/assets/css/defaultTheme.css +356 -356
  21. package/react/assets/css/dialogs.css +158 -158
  22. package/react/assets/css/favorites.css +101 -101
  23. package/react/assets/css/finsemble.css +38 -38
  24. package/react/assets/css/focus.css +4 -4
  25. package/react/assets/css/font-finance.css +385 -385
  26. package/react/assets/css/fonts/Open_Sans/LICENSE.txt +202 -202
  27. package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +118 -118
  28. package/react/assets/css/fonts/font-finance.svg +124 -124
  29. package/react/assets/css/fonts/icons-reference.html +1174 -1174
  30. package/react/assets/css/linkerWindow.css +124 -124
  31. package/react/assets/css/menus.css +195 -195
  32. package/react/assets/css/notificationsCenter.css +597 -597
  33. package/react/assets/css/processMonitor.css +213 -213
  34. package/react/assets/css/search.css +128 -128
  35. package/react/assets/css/shared/animations.css +99 -99
  36. package/react/assets/css/tags.css +136 -136
  37. package/react/assets/css/toolbar.css +413 -413
  38. package/react/assets/css/userPreferences.css +568 -568
  39. package/react/assets/css/windowTitleBar.css +652 -652
  40. package/react/assets/icons/check-square.svg +5 -5
  41. package/react/assets/icons/check.svg +3 -3
  42. package/react/assets/icons/chevron-left.svg +3 -3
  43. package/react/assets/icons/chevron-right.svg +3 -3
  44. package/react/assets/icons/copy.svg +10 -10
  45. package/react/assets/icons/exclamation-circle.svg +4 -4
  46. package/react/assets/icons/external-link.svg +12 -12
  47. package/react/assets/icons/flag.svg +10 -10
  48. package/react/assets/icons/folder.svg +3 -3
  49. package/react/assets/icons/font.svg +3 -3
  50. package/react/assets/icons/globe.svg +3 -3
  51. package/react/assets/icons/hdd.svg +9 -9
  52. package/react/assets/icons/key.svg +10 -10
  53. package/react/assets/icons/life-ring.svg +3 -3
  54. package/react/assets/icons/lock.svg +5 -5
  55. package/react/assets/icons/magic.svg +15 -15
  56. package/react/assets/icons/moon.svg +10 -10
  57. package/react/assets/icons/paint-roller.svg +3 -3
  58. package/react/assets/icons/pencil.svg +10 -10
  59. package/react/assets/icons/plus.svg +3 -3
  60. package/react/assets/icons/question-circle.svg +5 -5
  61. package/react/assets/icons/search.svg +3 -3
  62. package/react/assets/icons/sun.svg +9 -9
  63. package/react/assets/icons/times.svg +3 -3
  64. package/react/assets/icons/toggle-off.svg +6 -6
  65. package/react/assets/icons/toggle-on.svg +6 -6
  66. package/react/assets/icons/tools.svg +3 -3
  67. package/react/assets/icons/trash.svg +12 -12
  68. package/react/assets/icons/upload.svg +10 -10
  69. package/react/assets/icons/window.svg +3 -3
  70. package/react/componentTemplateGenerator.js +85 -85
  71. package/react/componentTemplateGenerator.js.map +1 -1
  72. package/react/components/FinsembleProvider.js.map +1 -1
  73. package/react/components/appCatalog/AppCatalog.js.map +1 -1
  74. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  75. package/react/components/appCatalog/components/AppCard.js.map +1 -1
  76. package/react/components/appCatalog/components/AppList.js.map +1 -1
  77. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  78. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  79. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  80. package/react/components/appCatalog/components/Hero.js.map +1 -1
  81. package/react/components/appCatalog/components/Home.js.map +1 -1
  82. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  83. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  84. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  85. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  86. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  87. package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
  88. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  89. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
  90. package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
  91. package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
  92. package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
  93. package/react/components/appCatalog/components/Tag.js.map +1 -1
  94. package/react/components/appCatalog/components/Toast.js.map +1 -1
  95. package/react/components/appCatalog/components/helpers.js.map +1 -1
  96. package/react/components/appCatalog/index.js.map +1 -1
  97. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  98. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  99. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  100. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  101. package/react/components/common/Button.js.map +1 -1
  102. package/react/components/common/ButtonIcon.js.map +1 -1
  103. package/react/components/common/ButtonRow.js.map +1 -1
  104. package/react/components/common/ButtonTile.js.map +1 -1
  105. package/react/components/common/Checkbox.js.map +1 -1
  106. package/react/components/common/ColorPicker.js.map +1 -1
  107. package/react/components/common/DropZone.js.map +1 -1
  108. package/react/components/common/DropdownButton.js.map +1 -1
  109. package/react/components/common/FileInput.js.map +1 -1
  110. package/react/components/common/FinsembleIcon.js.map +1 -1
  111. package/react/components/common/FinsembleSelect.js.map +1 -1
  112. package/react/components/common/FinsembleToggle.js.map +1 -1
  113. package/react/components/common/FontSizeSelector.js.map +1 -1
  114. package/react/components/common/Header.js.map +1 -1
  115. package/react/components/common/ImagePreview.js.map +1 -1
  116. package/react/components/common/LoadingSpinner.js.map +1 -1
  117. package/react/components/common/Tab.js.map +1 -1
  118. package/react/components/common/Tooltip.js.map +1 -1
  119. package/react/components/common/css/application-edit-page.css +117 -117
  120. package/react/components/common/css/application-list.css +47 -47
  121. package/react/components/common/css/button.css +164 -164
  122. package/react/components/common/css/color-picker.css +52 -52
  123. package/react/components/common/css/drop-zone.css +17 -17
  124. package/react/components/common/css/file-input.css +49 -49
  125. package/react/components/common/css/header.css +43 -43
  126. package/react/components/common/css/icon.css +13 -13
  127. package/react/components/common/css/image-preview.css +57 -57
  128. package/react/components/common/css/loading-spinner.css +39 -39
  129. package/react/components/common/css/selector.css +51 -51
  130. package/react/components/common/css/styles.css +128 -128
  131. package/react/components/common/css/tab.css +56 -56
  132. package/react/components/common/css/toggle.css +32 -32
  133. package/react/components/common/css/tooltip.css +78 -78
  134. package/react/components/common/file_helpers.js.map +1 -1
  135. package/react/components/common/fixtures/FinsembleIcon.css +4 -4
  136. package/react/components/common/helpers.js.map +1 -1
  137. package/react/components/common/stories/Button.stories.js.map +1 -1
  138. package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
  139. package/react/components/common/stories/ButtonRow.stories.js.map +1 -1
  140. package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
  141. package/react/components/common/stories/Checkbox.stories.js.map +1 -1
  142. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  143. package/react/components/common/stories/DropZone.stories.js.map +1 -1
  144. package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
  145. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  146. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  147. package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
  148. package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
  149. package/react/components/common/stories/FontSizeSelector.stories.js.map +1 -1
  150. package/react/components/common/stories/Header.stories.js.map +1 -1
  151. package/react/components/common/stories/ImagePreview.stories.js.map +1 -1
  152. package/react/components/common/stories/LoadingSpinner.stories.js.map +1 -1
  153. package/react/components/common/stories/Tab.stories.js.map +1 -1
  154. package/react/components/common/stories/Tooltip.stories.js.map +1 -1
  155. package/react/components/common/tests/ButtonRow.spec.js.map +1 -1
  156. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  157. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  158. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  159. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  160. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  161. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  162. package/react/components/common/tests/Header.spec.js.map +1 -1
  163. package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
  164. package/react/components/common/tests/Tab.spec.js.map +1 -1
  165. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  166. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  167. package/react/components/favorites/FavoritesShell.js.map +1 -1
  168. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  169. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  170. package/react/components/favorites/index.js.map +1 -1
  171. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  172. package/react/components/fdc3Resolver/ResolverDialog.css +126 -126
  173. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  174. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  175. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  176. package/react/components/icon/Icon.js.map +1 -1
  177. package/react/components/icon/index.js.map +1 -1
  178. package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
  179. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  180. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  181. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  182. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  183. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  184. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  185. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  186. package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
  187. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
  188. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
  189. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
  190. package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
  191. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  192. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +1 -1
  193. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  194. package/react/components/linker/LinkerMenu.js.map +1 -1
  195. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  196. package/react/components/linker/index.js.map +1 -1
  197. package/react/components/linker/remoteRedux.js.map +1 -1
  198. package/react/components/menu/Menu.js.map +1 -1
  199. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  200. package/react/components/menu/MenuContent.js.map +1 -1
  201. package/react/components/menu/MenuHotKey.js.map +1 -1
  202. package/react/components/menu/MenuItem.js.map +1 -1
  203. package/react/components/menu/MenuPortal.js.map +1 -1
  204. package/react/components/menu/MenuShell.js.map +1 -1
  205. package/react/components/menu/MenuToggle.js.map +1 -1
  206. package/react/components/menu/index.js.map +1 -1
  207. package/react/components/menu/keyboardNavigation.js.map +1 -1
  208. package/react/components/menu/menuContext.js.map +1 -1
  209. package/react/components/menu/menuHelpers.js.map +1 -1
  210. package/react/components/notifications/components/NoNotifications.js.map +1 -1
  211. package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
  212. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  213. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  214. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  215. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  216. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  217. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  218. package/react/components/notifications/components/shared/NotificationCardShell.js +1 -1
  219. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  220. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  221. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  222. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyContentLogo.js.map +1 -1
  223. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  224. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  225. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderLogo.js.map +1 -1
  226. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  227. package/react/components/notifications/components/views/CardView.js.map +1 -1
  228. package/react/components/notifications/components/views/ListView.js +1 -1
  229. package/react/components/notifications/components/views/ListView.js.map +1 -1
  230. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  231. package/react/components/notifications/constants.js.map +1 -1
  232. package/react/components/notifications/icons/Card.js.map +1 -1
  233. package/react/components/notifications/icons/Chevron.js.map +1 -1
  234. package/react/components/notifications/icons/CloseIcon.js.map +1 -1
  235. package/react/components/notifications/icons/EnvelopeClose.js.map +1 -1
  236. package/react/components/notifications/icons/EnvelopeOpen.js.map +1 -1
  237. package/react/components/notifications/icons/SnoozeIcon.js.map +1 -1
  238. package/react/components/notifications/index.js.map +1 -1
  239. package/react/components/notifications/notificationsContext.js.map +1 -1
  240. package/react/components/notifications/types.js.map +1 -1
  241. package/react/components/notifications/utils.js.map +1 -1
  242. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  243. package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -1
  244. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  245. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  246. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  247. package/react/components/processMonitor/constants.js.map +1 -1
  248. package/react/components/processMonitor/helpers.js.map +1 -1
  249. package/react/components/processMonitor/helpers.spec.js.map +1 -1
  250. package/react/components/processMonitor/index.js.map +1 -1
  251. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +1 -0
  252. package/react/components/processMonitor/stores/ProcessMonitorStore.js +2 -1
  253. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  254. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  255. package/react/components/quickComponentForm/index.js.map +1 -1
  256. package/react/components/quickComponentForm/quickComponent.css +3 -3
  257. package/react/components/search/Highlight.js.map +1 -1
  258. package/react/components/search/Highlight.spec.js.map +1 -1
  259. package/react/components/search/Highlight.stories.js.map +1 -1
  260. package/react/components/search/Search.js.map +1 -1
  261. package/react/components/search/SearchBestMatch.js.map +1 -1
  262. package/react/components/search/SearchInput.js.map +1 -1
  263. package/react/components/search/SearchProviderResults.js.map +1 -1
  264. package/react/components/search/SearchResult.js.map +1 -1
  265. package/react/components/search/SearchResults.js.map +1 -1
  266. package/react/components/search/index.js.map +1 -1
  267. package/react/components/shared/Animate.js.map +1 -1
  268. package/react/components/shared/BellIcon.js.map +1 -1
  269. package/react/components/shared/BellIconCrossed.js.map +1 -1
  270. package/react/components/shared/Button.js.map +1 -1
  271. package/react/components/shared/ConditionalWrapper.js.map +1 -1
  272. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  273. package/react/components/shared/NavigationButton.js.map +1 -1
  274. package/react/components/shared/Tag.js.map +1 -1
  275. package/react/components/shared/TagsMenu.js.map +1 -1
  276. package/react/components/shared/addProtocolToValidURL.js.map +1 -1
  277. package/react/components/shared/linkerUtil.js.map +1 -1
  278. package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
  279. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
  280. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
  281. package/react/components/shared/validateURL.js.map +1 -1
  282. package/react/components/shared/validateURL.spec.js.map +1 -1
  283. package/react/components/singleInputDialog/SingleInputDialog.css +3 -3
  284. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  285. package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
  286. package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
  287. package/react/components/singleInputDialog/index.js.map +1 -1
  288. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  289. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  290. package/react/components/smartDesktopDesigner/Appearance.css +94 -94
  291. package/react/components/smartDesktopDesigner/Appearance.helpers.js.map +1 -1
  292. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  293. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  294. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
  295. package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
  296. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
  297. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  298. package/react/components/smartDesktopDesigner/AssetsPage.css +26 -26
  299. package/react/components/smartDesktopDesigner/AssetsPage.js.map +1 -1
  300. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  301. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  302. package/react/components/smartDesktopDesigner/Content.js.map +1 -1
  303. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  304. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  305. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  306. package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
  307. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  308. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  309. package/react/components/smartDesktopDesigner/Navigation.js.map +1 -1
  310. package/react/components/smartDesktopDesigner/ProjectErrors.js.map +1 -1
  311. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +1 -1
  312. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  313. package/react/components/smartDesktopDesigner/PublishProgress.js.map +1 -1
  314. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  315. package/react/components/smartDesktopDesigner/ThemePage.css +110 -110
  316. package/react/components/smartDesktopDesigner/ThemePage.js.map +1 -1
  317. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  318. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  319. package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +1 -1
  320. package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
  321. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  322. package/react/components/smartDesktopDesigner/css/appearance.css +10 -10
  323. package/react/components/smartDesktopDesigner/css/applications.css +127 -127
  324. package/react/components/smartDesktopDesigner/css/authentication.css +125 -125
  325. package/react/components/smartDesktopDesigner/css/buttons.css +12 -12
  326. package/react/components/smartDesktopDesigner/css/export.css +163 -163
  327. package/react/components/smartDesktopDesigner/css/getting-started.css +6 -6
  328. package/react/components/smartDesktopDesigner/css/nav.css +93 -93
  329. package/react/components/smartDesktopDesigner/css/project-errors.css +15 -15
  330. package/react/components/smartDesktopDesigner/css/project-header.css +121 -121
  331. package/react/components/smartDesktopDesigner/css/styles.css +179 -179
  332. package/react/components/smartDesktopDesigner/css/views.css +16 -16
  333. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
  334. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
  335. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  336. package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +1 -1
  337. package/react/components/smartDesktopDesigner/fixtures/configTemplate.js.map +1 -1
  338. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  339. package/react/components/smartDesktopDesigner/fixtures/projectErrorsProps.js.map +1 -1
  340. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  341. package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +1 -1
  342. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  343. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  344. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  345. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
  346. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +1 -1
  347. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
  348. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +1 -1
  349. package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
  350. package/react/components/smartDesktopDesigner/stories/AssetsPage.stories.js.map +1 -1
  351. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
  352. package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
  353. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  354. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  355. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
  356. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
  357. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
  358. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +1 -1
  359. package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
  360. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
  361. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  362. package/react/components/smartDesktopDesigner/stories/ThemePage.stories.js.map +1 -1
  363. package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
  364. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  365. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +1 -1
  366. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
  367. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +1 -1
  368. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  369. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
  370. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  371. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  372. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
  373. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  374. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +1 -1
  375. package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
  376. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
  377. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  378. package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
  379. package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
  380. package/react/components/smartDesktopDesigner/themeDefinitions.js.map +1 -1
  381. package/react/components/system/System.js.map +1 -1
  382. package/react/components/system/System.spec.js.map +1 -1
  383. package/react/components/system/System.stories.js.map +1 -1
  384. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  385. package/react/components/system/index.js.map +1 -1
  386. package/react/components/toolbar/AutoArrange.js.map +1 -1
  387. package/react/components/toolbar/DragHandle.js.map +1 -1
  388. package/react/components/toolbar/MinimizeAll.js.map +1 -1
  389. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  390. package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
  391. package/react/components/toolbar/NotificationControl.js.map +1 -1
  392. package/react/components/toolbar/RevealAll.js.map +1 -1
  393. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  394. package/react/components/toolbar/RevealAll.stories.js.map +1 -1
  395. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  396. package/react/components/toolbar/ToolbarSection.js.map +1 -1
  397. package/react/components/toolbar/ToolbarShell.js.map +1 -1
  398. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  399. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
  400. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  401. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  402. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  403. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  404. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
  405. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  406. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  407. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  408. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  409. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
  410. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  411. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
  412. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  413. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  414. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
  415. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  416. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  417. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  418. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  419. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  420. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  421. package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
  422. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  423. package/react/components/toolbar/appLauncher/appLauncher.css +30 -30
  424. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  425. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  426. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  427. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  428. package/react/components/toolbar/index.js.map +1 -1
  429. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  430. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  431. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  432. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  433. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  434. package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +90 -90
  435. package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
  436. package/react/components/userPreferences/UserPreferenceTypes.js.map +1 -1
  437. package/react/components/userPreferences/UserPreferences.js.map +1 -1
  438. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  439. package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -1
  440. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  441. package/react/components/userPreferences/components/LeftNav.js.map +1 -1
  442. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  443. package/react/components/userPreferences/components/content/DashbarEditorItem.js.map +1 -1
  444. package/react/components/userPreferences/components/content/General.js.map +1 -1
  445. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  446. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  447. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  448. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  449. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  450. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  451. package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
  452. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
  453. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -1
  454. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  455. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -1
  456. package/react/components/userPreferences/index.js.map +1 -1
  457. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  458. package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
  459. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -1
  460. package/react/components/userPreferences/stories/General.stories.js.map +1 -1
  461. package/react/components/userPreferences/stories/Notifications.stories.js.map +1 -1
  462. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -1
  463. package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -1
  464. package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -1
  465. package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -1
  466. package/react/components/userPreferences/stories/WorkspaceComponents.stories.js.map +1 -1
  467. package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -1
  468. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -1
  469. package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -1
  470. package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -1
  471. package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -1
  472. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -1
  473. package/react/components/userPreferences/tests/General.spec.js.map +1 -1
  474. package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
  475. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -1
  476. package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -1
  477. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  478. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -1
  479. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  480. package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -1
  481. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -1
  482. package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -1
  483. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -1
  484. package/react/components/utils.js.map +1 -1
  485. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  486. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  487. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  488. package/react/components/windowTitleBar/components/center/TabRegion.js.map +1 -1
  489. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  490. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
  491. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  492. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
  493. package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
  494. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
  495. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  496. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  497. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  498. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  499. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  500. package/react/components/windowTitleBar/index.js.map +1 -1
  501. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  502. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
  503. package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
  504. package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
  505. package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
  506. package/react/components/yesNoDialog/YesNoDialog.css +3 -3
  507. package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
  508. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  509. package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
  510. package/react/components/yesNoDialog/index.js.map +1 -1
  511. package/react/components/yesNoDialog/timer.js.map +1 -1
  512. package/react/enzymeSetup.js.map +1 -1
  513. package/react/hooks/index.js.map +1 -1
  514. package/react/hooks/useAuth.js.map +1 -1
  515. package/react/hooks/useDeepEffect.js.map +1 -1
  516. package/react/hooks/useFavorites.js.map +1 -1
  517. package/react/hooks/useFavoritesShell.js.map +1 -1
  518. package/react/hooks/useHotkey.js.map +1 -1
  519. package/react/hooks/useLinker.js.map +1 -1
  520. package/react/hooks/useMenu.js.map +1 -1
  521. package/react/hooks/useNotifications.js.map +1 -1
  522. package/react/hooks/useOutsideClickDetector.js.map +1 -1
  523. package/react/hooks/usePubSub.js.map +1 -1
  524. package/react/hooks/useSearch.js.map +1 -1
  525. package/react/hooks/useToolbar.js.map +1 -1
  526. package/react/hooks/useWorkspace.js.map +1 -1
  527. package/react/reducers/favoriteReducer.js.map +1 -1
  528. package/react/reducers/linkerReducer.js.map +1 -1
  529. package/react/reducers/menuReducer.js.map +1 -1
  530. package/react/reducers/rootReducer.js.map +1 -1
  531. package/react/reducers/searchReducer.js.map +1 -1
  532. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  533. package/react/reducers/toolbarReducer.js.map +1 -1
  534. package/react/reducers/workspaceReducer.js.map +1 -1
  535. package/react/store.js.map +1 -1
  536. package/react/types/advancedAppLauncherTypes.js.map +1 -1
  537. package/react/types/dashbarTypes.js.map +1 -1
  538. package/react/types/favoriteTypes.js.map +1 -1
  539. package/react/types/fdc3.js.map +1 -1
  540. package/react/types/hotkeyTypes.js.map +1 -1
  541. package/react/types/iconTypes.js.map +1 -1
  542. package/react/types/linkerTypes.js.map +1 -1
  543. package/react/types/searchTypes.js.map +1 -1
  544. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  545. package/react/types/windowTitleBar.js.map +1 -1
  546. package/react/types/workspaceTypes.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Dashbar.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/Dashbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjG,OAAO,iCAAiC,CAAC;AAMzC,IAAI,eAAuB,CAAC;AAC5B,IAAI,kBAA0B,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAe,EAAE,EAAE;IACrF,MAAM,E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AM,EAAE,MAAqB,EAC7B,aAAa,EAAE,OAAO,CAAC,MAAM,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAC/B,CACF,CAAC,CACmB,CACtB;QACA,YAAY,KAAK,CAAC,IAAI,CACtB,6BAAK,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,aAAa;YAC9D;gBACC,2BAAG,SAAS,EAAC,SAAS,GAAK,CACrB,CACF,CACN;QACA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\r\nimport { DashbarItem } from \"./DashbarItem\";\r\nimport { Dashbar as DashbarType, DashbarItem as DashbarItemType, DashbarView } from \"../../../types/dashbarTypes\";\r\nimport { useToolbar } from \"../../../hooks/useToolbar\";\r\nimport { FinsembleDnDContext, AllowableDnDAxis } from \"../../legacyControls/FinsembleDnDContext\";\r\n\r\nimport \"../../../assets/css/dashbar.css\";\r\n\r\ntype DashbarViews = {\r\n\t[key: string]: DashbarView;\r\n} & {};\r\n\r\nlet cachedWidgetTop: number;\r\nlet cachedWidgetHeight: number;\r\n\r\nexport const Dashbar = ({ className, children, widgetTitleGenerator }: DashbarType) => {\r\n\tconst { dashbarItems, reorderDashbarItems, launchPreferences } = useToolbar();\r\n\r\n\tconst [widgets, setWidgets] = useState({});\r\n\tconst [horizontalBounds, setHorizontalBounds] = useState(0);\r\n\tconst [wasReorganized, setReorganized] = useState(false);\r\n\tconst [totalWidgetsWidth, setTotalWidgetsWidth] = useState(0);\r\n\tconst [isUpdatingState, setIsUpdatingState] = useState(false);\r\n\tconst [secondUpdateRequired, setSecondUpdateRequired] = useState(false);\r\n\r\n\tlet movingIndex: number | null = null; // The dasharItem index being dragged, null if none\r\n\tlet titleGrabPosition: number | null = null; // The mouse of event when a widget title is dragged\r\n\tlet offsetX: number | null = null; // The original grab location of a given view titlebar\r\n\r\n\tconst WIDGET_COUNT: number = Object.keys(widgets).length;\r\n\tconst SCROLL_BUTTON_WIDTH = 30;\r\n\r\n\tconst defaultWidgetTitleGenerator = (widget: DashbarView, titleRef: React.MutableRefObject<null>) => {\r\n\t\tconst handleWidgetTitleClick = () => {\r\n\t\t\tif (widget.raiseIntentOptions) {\r\n\t\t\t\tfdc3.raiseIntent(\r\n\t\t\t\t\twidget.raiseIntentOptions.intent,\r\n\t\t\t\t\twidget.raiseIntentOptions.context,\r\n\t\t\t\t\twidget.raiseIntentOptions.targetApp\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<div ref={titleRef} onClick={() => handleWidgetTitleClick()}>\r\n\t\t\t\t<span dangerouslySetInnerHTML={{ __html: widget.title }}></span>\r\n\t\t\t</div>\r\n\t\t);\r\n\t};\r\n\r\n\tconst titleGenerator = widgetTitleGenerator ?? defaultWidgetTitleGenerator;\r\n\r\n\t/**\r\n\t *\r\n\t * @param {object} params\r\n\t * @param {number} oldIndex The index of the item being moved\r\n\t * @param {number} newIndex The index to move the item to\r\n\t */\r\n\tconst reorderItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\r\n\t\tmovingIndex = null;\r\n\t\ttitleGrabPosition = null;\r\n\t\toffsetX = null;\r\n\t\tsetReorganized(true);\r\n\t\t// Update the redux store\r\n\t\treorderDashbarItems({ oldIndex, newIndex });\r\n\t};\r\n\r\n\tconst launchDashbar = () => {\r\n\t\tlaunchPreferences(\"Dashbar\");\r\n\t};\r\n\r\n\tconst { dashbar } = FSBL.Clients.WindowClient.getSpawnData();\r\n\r\n\t// Dashbar is disabled (no config in toolbar) or dashbar height is not specified\r\n\tif (!dashbar || !dashbar.height) {\r\n\t\treturn null;\r\n\t}\r\n\tconst toolbarHeight = finsembleWindow.windowOptions.height;\r\n\tconst dashbarHeight = `${dashbar.height}px`;\r\n\tconst verticalBounds = toolbarHeight - dashbar.height;\r\n\tconst widgetDividerWidth = dashbar.widgetDividerWidth || 0;\r\n\r\n\tconst wrapperClasses = `finsemble-dashbar ${className || \"\"}`.trim();\r\n\r\n\tconst getTotalWidth = () => {\r\n\t\tlet totalWidth = 0;\r\n\t\tdashbarItems.forEach((item: DashbarItemType) => {\r\n\t\t\ttotalWidth = totalWidth + item.width;\r\n\t\t});\r\n\t\treturn totalWidth;\r\n\t};\r\n\r\n\tconst [leftButtonTooltip, setLeftButtonTooltip] = useState(\"\");\r\n\tconst [rightButtonTooltip, setRightButtonTooltip] = useState(\"\");\r\n\r\n\tconst setWidgetsPositions = async (isCalledFromDashbar?: boolean) => {\r\n\t\tconst { data: bounds } = await finsembleWindow.getBounds();\r\n\t\tconst scrollButtonsEnabled = document.querySelectorAll(\"#dashbar-container > .chevron-container\").length > 0;\r\n\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\r\n\t\tlet toolbarWidth = bounds?.width ?? 0;\r\n\t\tif (scrollButtonsEnabled) toolbarWidth = toolbarWidth - 2 * SCROLL_BUTTON_WIDTH;\r\n\r\n\t\tlet tempLeft = 0;\r\n\t\tlet leftButtonSize = 0;\r\n\t\tif (scrollButtonsEnabled) {\r\n\t\t\ttempLeft = SCROLL_BUTTON_WIDTH;\r\n\t\t\tleftButtonSize = SCROLL_BUTTON_WIDTH;\r\n\t\t}\r\n\r\n\t\tlet leftItemsCount = 0;\r\n\t\tlet rightItemsCount = 0;\r\n\r\n\t\tfor (const element of elements) {\r\n\t\t\tconst rect = element.getBoundingClientRect();\r\n\t\t\tconst widget = (widgets as DashbarViews)[element.id];\r\n\t\t\t// Happens when widgets were removed, but dom-elements still exists. So just ignore.\r\n\t\t\tif (!widget) continue;\r\n\r\n\t\t\tif (rect.left < SCROLL_BUTTON_WIDTH && scrollButtonsEnabled) {\r\n\t\t\t\twidget.bounds.width = 0;\r\n\t\t\t\twidget.bounds.left = tempLeft;\r\n\t\t\t\tleftItemsCount++;\r\n\t\t\t} else {\r\n\t\t\t\twidget.bounds.width = rect.width - widgetDividerWidth;\r\n\t\t\t\twidget.bounds.left = tempLeft;\r\n\t\t\t}\r\n\t\t\ttempLeft = tempLeft + widget.bounds.width + widgetDividerWidth;\r\n\r\n\t\t\tlet offsetRight = rect.left + rect.width + widgetDividerWidth - leftButtonSize - toolbarWidth;\r\n\t\t\tif (offsetRight > 0) {\r\n\t\t\t\t// hide title for invisible items\r\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"hidden\";\r\n\t\t\t\twidget.bounds.width = 0;\r\n\t\t\t\trightItemsCount++;\r\n\t\t\t} else {\r\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"visible\";\r\n\t\t\t}\r\n\t\t\twidget.view.setBounds(widget.bounds);\r\n\t\t}\r\n\r\n\t\tsetLeftButtonTooltip(`${leftItemsCount} more`);\r\n\t\tsetRightButtonTooltip(`${rightItemsCount} more`);\r\n\r\n\t\t//double call for fix fake empty space between widgets while scrolling\r\n\t\tif (!isCalledFromDashbar) {\r\n\t\t\tawait setWidgetsPositions(true);\r\n\t\t}\r\n\t};\r\n\r\n\tconst addWidgets = async () => {\r\n\t\tconst _widgets: DashbarViews = widgets;\r\n\t\tlet tempHorizontalBounds = horizontalBounds;\r\n\r\n\t\tfor (const item of dashbarItems) {\r\n\t\t\tconst widgetBounds = {\r\n\t\t\t\ttop: verticalBounds,\r\n\t\t\t\tleft: tempHorizontalBounds,\r\n\t\t\t\twidth: item.width - widgetDividerWidth,\r\n\t\t\t\theight: item.height || dashbar.height,\r\n\t\t\t};\r\n\r\n\t\t\tif (!_widgets.hasOwnProperty(item.id)) {\r\n\t\t\t\tconst res: any = await finsembleWindow.addBrowserView({\r\n\t\t\t\t\turl: item.url,\r\n\t\t\t\t\tbounds: widgetBounds,\r\n\t\t\t\t\tallowAutoResize: false,\r\n\t\t\t\t});\r\n\r\n\t\t\t\t_widgets[item.id] = {\r\n\t\t\t\t\turl: item.url,\r\n\t\t\t\t\ttitle: item.title,\r\n\t\t\t\t\tbounds: widgetBounds,\r\n\t\t\t\t\tview: res,\r\n\t\t\t\t\twidth: item.width,\r\n\t\t\t\t\traiseIntentOptions: item.raiseIntentOptions,\r\n\t\t\t\t};\r\n\r\n\t\t\t\ttempHorizontalBounds = tempHorizontalBounds + item.width;\r\n\t\t\t}\r\n\t\t}\r\n\t\tsetWidgets(_widgets);\r\n\t\tsetHorizontalBounds(tempHorizontalBounds);\r\n\t};\r\n\r\n\tconst removeWidgets = () => {\r\n\t\tconst _widgets: DashbarViews = widgets;\r\n\t\t// Widgets is an object, with each key being a reference to an item in dashbarItems\r\n\t\t// but dashbarItems is an array of objects. Its necessary to loop through them to determine\r\n\t\t// the differences to figure out which items were removed.\r\n\t\tconst toRemove: string[] = [];\r\n\t\tObject.keys(_widgets).forEach((widgetId) => {\r\n\t\t\tlet found = false;\r\n\t\t\tfor (let i = 0; i < dashbarItems.length; i++) {\r\n\t\t\t\tconst dashItem = dashbarItems[i];\r\n\t\t\t\tif (dashItem.id === widgetId) {\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!found) {\r\n\t\t\t\ttoRemove.push(widgetId);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// toRemove is an array of widgetIds which were no longer found in dashbarItems\r\n\t\t// As items are removed, the remaining items have to be shuffled to fill the space\r\n\t\tfor (const id of toRemove) {\r\n\t\t\tif (_widgets.hasOwnProperty(id)) {\r\n\t\t\t\tlet tempNewHorizontalBounds = 0;\r\n\t\t\t\t_widgets[id].view.remove(() => {\r\n\t\t\t\t\tdelete _widgets[id];\r\n\t\t\t\t\t// Shuffle remaining views to fill any gaps that were left\r\n\t\t\t\t\tObject.values(_widgets).forEach((widget) => {\r\n\t\t\t\t\t\twidget.bounds = {\r\n\t\t\t\t\t\t\twidth: widget.bounds.width,\r\n\t\t\t\t\t\t\theight: widget.bounds.height,\r\n\t\t\t\t\t\t\tleft: tempNewHorizontalBounds,\r\n\t\t\t\t\t\t\ttop: widget.bounds.top,\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\twidget.view.setBounds(widget.bounds);\r\n\t\t\t\t\t\ttempNewHorizontalBounds = tempNewHorizontalBounds + widget.bounds.width;\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsetWidgets(_widgets);\r\n\t\t\t\t\tsetHorizontalBounds(tempNewHorizontalBounds);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tFSBL.Clients.Logger.system.error(`Error removing widget: ${id} from dashbar`);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tconst reorganizeWidgets = () => {\r\n\t\tconst _widgets: DashbarViews = widgets;\r\n\t\t// Each view needs to be resituated to fill any holes\r\n\t\t// left by views that have been removed. Use a tempBounds\r\n\t\t// int to keep track of new widths and set the overall width\r\n\t\t// once everything is re-seated\r\n\t\tlet tempBounds = 0;\r\n\t\tdashbarItems.forEach((item) => {\r\n\t\t\tconst widget = _widgets[item.id];\r\n\r\n\t\t\twidget.bounds = {\r\n\t\t\t\theight: cachedWidgetHeight || widget.bounds.height,\r\n\t\t\t\twidth: widget.bounds.width,\r\n\t\t\t\ttop: cachedWidgetTop || verticalBounds,\r\n\t\t\t\tleft: tempBounds,\r\n\t\t\t};\r\n\r\n\t\t\twidget.view.setBounds(widget.bounds);\r\n\r\n\t\t\tdelete _widgets[item.id];\r\n\t\t\t_widgets[item.id] = widget;\r\n\r\n\t\t\ttempBounds = tempBounds + item.width;\r\n\t\t});\r\n\r\n\t\tsetReorganized(false);\r\n\t\tsetWidgets(_widgets);\r\n\t\tsetHorizontalBounds(tempBounds);\r\n\t};\r\n\r\n\tconst updateItems = () => {\r\n\t\tconst doUpdate = async () => {\r\n\t\t\tif (dashbarItems.length > WIDGET_COUNT) {\r\n\t\t\t\t//Items have been added\r\n\t\t\t\tawait addWidgets();\r\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\r\n\t\t\t} else if (dashbarItems.length < WIDGET_COUNT) {\r\n\t\t\t\t//Items have been removed\r\n\t\t\t\tremoveWidgets();\r\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\r\n\t\t\t} else if (wasReorganized) {\r\n\t\t\t\tif (movingIndex) return;\r\n\t\t\t\t// Length is the same, order has changed\r\n\t\t\t\treorganizeWidgets();\r\n\t\t\t}\r\n\r\n\t\t\tawait setWidgetsPositions(true);\r\n\t\t\tsetIsUpdatingState(false);\r\n\t\t};\r\n\r\n\t\tif (isUpdatingState === false) {\r\n\t\t\tsetIsUpdatingState(true);\r\n\t\t\tdoUpdate();\r\n\t\t} else if (!secondUpdateRequired) {\r\n\t\t\tsetSecondUpdateRequired(true);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * When the distributed store's 'dashbaritems' is updated it will cause this hook to\r\n\t * execute. The local representation of widgets will be mutated, then a call to\r\n\t * setWidgets will re-render the component\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tupdateItems();\r\n\t}, [dashbarItems]);\r\n\r\n\t/**\r\n\t * DashbarItems can be changed very quickly before all widgets will be initialized.\r\n\t * Double-calling updateItems() fixes a bug.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tif (secondUpdateRequired && !isUpdatingState) {\r\n\t\t\tupdateItems();\r\n\t\t\tsetSecondUpdateRequired(false);\r\n\t\t}\r\n\t}, [isUpdatingState, secondUpdateRequired]);\r\n\r\n\t/**\r\n\t * Sets the title height as determined by the DashbarItem\r\n\t * component, since the CSS can be changed by the user\r\n\t * the component will render the title and pass back\r\n\t * computed height of that title, then the Dashbar will\r\n\t * make room for item\r\n\t *\r\n\t * @param {number} titleHeight The height of the span containing the title\r\n\t * @param {string} id The key'ed id of the view\r\n\t */\r\n\tconst setTitleHeight = (titleHeight: number, id: string) => {\r\n\t\tconst _widgets: DashbarViews = widgets;\r\n\t\tconst widget = _widgets[id];\r\n\t\tif (cachedWidgetTop) {\r\n\t\t\ttitleHeight = 0;\r\n\t\t}\r\n\r\n\t\tconst newBounds = {\r\n\t\t\ttop: cachedWidgetTop || widget.bounds.top + titleHeight,\r\n\t\t\tleft: widget.bounds.left,\r\n\t\t\theight: cachedWidgetHeight || widget.bounds.height - titleHeight,\r\n\t\t\twidth: widget.bounds.width,\r\n\t\t};\r\n\t\tcachedWidgetTop = newBounds.top;\r\n\t\tcachedWidgetHeight = newBounds.height;\r\n\r\n\t\twidget.view.setBounds(newBounds);\r\n\t\twidget.bounds = newBounds;\r\n\t\tsetWidgets(_widgets);\r\n\t};\r\n\r\n\t/**\r\n\t * When a view starts moving, bring it to the front\r\n\t *\r\n\t * @param {MouseEvent} event The event passed by react-sortable-hoc\r\n\t */\r\n\tconst startMove = (node: any, event: any) => {\r\n\t\tmovingIndex = node.index;\r\n\t\tif (offsetX === null && titleGrabPosition !== null) {\r\n\t\t\toffsetX = event.clientX - titleGrabPosition;\r\n\t\t}\r\n\t\tconst widget = Object.values(widgets)[node.index] as DashbarView;\r\n\t\twidget.view.bringToFront();\r\n\t};\r\n\r\n\t/**\r\n\t * Event triggered by view movement\r\n\t *\r\n\t * @param {MouseEvent} event\r\n\t */\r\n\tconst moveItem = (event: any) => {\r\n\t\tif (movingIndex !== null) {\r\n\t\t\tconst movingWidget = Object.values(widgets)[movingIndex] as DashbarView;\r\n\r\n\t\t\tmovingWidget.view.setBounds({\r\n\t\t\t\ttop: movingWidget.bounds.top,\r\n\t\t\t\theight: movingWidget.bounds.height,\r\n\t\t\t\twidth: movingWidget.bounds.width,\r\n\t\t\t\tleft: event.clientX - (offsetX || 0),\r\n\t\t\t});\r\n\r\n\t\t\t// Some completely not react very hacky stuff to make browserviews move in conjunction with the titles\r\n\t\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\r\n\t\t\tfor (const element of elements) {\r\n\t\t\t\tconst rect = element.getBoundingClientRect();\r\n\t\t\t\tconst widget = (widgets as any)[element.id];\r\n\t\t\t\tif (widget !== movingWidget && widget.bounds.left !== rect.left) {\r\n\t\t\t\t\twidget.bounds.left = rect.left;\r\n\t\t\t\t\twidget.view.setBounds(widget.bounds);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tconst setGrabLocation = (location: number) => {\r\n\t\ttitleGrabPosition = location;\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div className={wrapperClasses} style={{ height: dashbarHeight }}>\r\n\t\t\t{WIDGET_COUNT > 0 && (\r\n\t\t\t\t<FinsembleDnDContext\r\n\t\t\t\t\tonDragEnd={reorderItems}\r\n\t\t\t\t\tonDragStart={startMove}\r\n\t\t\t\t\tonDragMove={moveItem}\r\n\t\t\t\t\tonLayoutUpdate={setWidgetsPositions}\r\n\t\t\t\t\tclassName=\"finsemble-dashbar-section rearrange-region\"\r\n\t\t\t\t\tid=\"dashbar-container\"\r\n\t\t\t\t\taxis={AllowableDnDAxis.x}\r\n\t\t\t\t\tlockAxis={AllowableDnDAxis.x}\r\n\t\t\t\t\tallowHorizontalScroll={true}\r\n\t\t\t\t\tshowScrollButtonsTooltip={true}\r\n\t\t\t\t\tleftButtonTooltip={leftButtonTooltip}\r\n\t\t\t\t\trightButtonTooltip={rightButtonTooltip}\r\n\t\t\t\t>\r\n\t\t\t\t\t{Object.values(widgets).map((widget, i) => (\r\n\t\t\t\t\t\t<DashbarItem\r\n\t\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\t\tid={Object.keys(widgets)[i]}\r\n\t\t\t\t\t\t\tindex={i}\r\n\t\t\t\t\t\t\twidgetTitleGenerator={titleGenerator}\r\n\t\t\t\t\t\t\twidget={widget as DashbarView}\r\n\t\t\t\t\t\t\tdashbarHeight={dashbar.height}\r\n\t\t\t\t\t\t\twidgetDividerWidth={widgetDividerWidth}\r\n\t\t\t\t\t\t\tsetTitleHeight={setTitleHeight}\r\n\t\t\t\t\t\t\tsetGrabLocation={setGrabLocation}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</FinsembleDnDContext>\r\n\t\t\t)}\r\n\t\t\t{WIDGET_COUNT === 0 && (\r\n\t\t\t\t<div className=\"add-dashbar-item-button\" onClick={launchDashbar}>\r\n\t\t\t\t\t<span>\r\n\t\t\t\t\t\t<i className=\"ff-plus\"></i>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</div>\r\n\t\t\t)}\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"Dashbar.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/Dashbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjG,OAAO,iCAAiC,CAAC;AAMzC,IAAI,eAAuB,CAAC;AAC5B,IAAI,kBAA0B,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAe,EAAE,EAAE;IACrF,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,GAAG,UAAU,EAAE,CAAC;IAE9E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,C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EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;QAC9D,YAAY,GAAG,CAAC,IAAI,CACpB,oBAAC,mBAAmB,IACnB,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,SAAS,EACtB,UAAU,EAAE,QAAQ,EACpB,cAAc,EAAE,mBAAmB,EACnC,SAAS,EAAC,4CAA4C,EACtD,EAAE,EAAC,mBAAmB,EACtB,IAAI,EAAE,gBAAgB,CAAC,CAAC,EACxB,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAC5B,qBAAqB,EAAE,IAAI,EAC3B,wBAAwB,EAAE,IAAI,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,kBAAkB,EAAE,kBAAkB,IAErC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAC1C,oBAAC,WAAW,IACX,GAAG,EAAE,CAAC,EACN,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,CAAC,EACR,oBAAoB,EAAE,cAAc,EACpC,MAAM,EAAE,MAAqB,EAC7B,aAAa,EAAE,OAAO,CAAC,MAAM,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAC/B,CACF,CAAC,CACmB,CACtB;QACA,YAAY,KAAK,CAAC,IAAI,CACtB,6BAAK,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,aAAa;YAC9D;gBACC,2BAAG,SAAS,EAAC,SAAS,GAAK,CACrB,CACF,CACN;QACA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { DashbarItem } from \"./DashbarItem\";\nimport { Dashbar as DashbarType, DashbarItem as DashbarItemType, DashbarView } from \"../../../types/dashbarTypes\";\nimport { useToolbar } from \"../../../hooks/useToolbar\";\nimport { FinsembleDnDContext, AllowableDnDAxis } from \"../../legacyControls/FinsembleDnDContext\";\n\nimport \"../../../assets/css/dashbar.css\";\n\ntype DashbarViews = {\n\t[key: string]: DashbarView;\n} & {};\n\nlet cachedWidgetTop: number;\nlet cachedWidgetHeight: number;\n\nexport const Dashbar = ({ className, children, widgetTitleGenerator }: DashbarType) => {\n\tconst { dashbarItems, reorderDashbarItems, launchPreferences } = useToolbar();\n\n\tconst [widgets, setWidgets] = useState({});\n\tconst [horizontalBounds, setHorizontalBounds] = useState(0);\n\tconst [wasReorganized, setReorganized] = useState(false);\n\tconst [totalWidgetsWidth, setTotalWidgetsWidth] = useState(0);\n\tconst [isUpdatingState, setIsUpdatingState] = useState(false);\n\tconst [secondUpdateRequired, setSecondUpdateRequired] = useState(false);\n\n\tlet movingIndex: number | null = null; // The dasharItem index being dragged, null if none\n\tlet titleGrabPosition: number | null = null; // The mouse of event when a widget title is dragged\n\tlet offsetX: number | null = null; // The original grab location of a given view titlebar\n\n\tconst WIDGET_COUNT: number = Object.keys(widgets).length;\n\tconst SCROLL_BUTTON_WIDTH = 30;\n\n\tconst defaultWidgetTitleGenerator = (widget: DashbarView, titleRef: React.MutableRefObject<null>) => {\n\t\tconst handleWidgetTitleClick = () => {\n\t\t\tif (widget.raiseIntentOptions) {\n\t\t\t\tfdc3.raiseIntent(\n\t\t\t\t\twidget.raiseIntentOptions.intent,\n\t\t\t\t\twidget.raiseIntentOptions.context,\n\t\t\t\t\twidget.raiseIntentOptions.targetApp\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<div ref={titleRef} onClick={() => handleWidgetTitleClick()}>\n\t\t\t\t<span dangerouslySetInnerHTML={{ __html: widget.title }}></span>\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst titleGenerator = widgetTitleGenerator ?? defaultWidgetTitleGenerator;\n\n\t/**\n\t *\n\t * @param {object} params\n\t * @param {number} oldIndex The index of the item being moved\n\t * @param {number} newIndex The index to move the item to\n\t */\n\tconst reorderItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tmovingIndex = null;\n\t\ttitleGrabPosition = null;\n\t\toffsetX = null;\n\t\tsetReorganized(true);\n\t\t// Update the redux store\n\t\treorderDashbarItems({ oldIndex, newIndex });\n\t};\n\n\tconst launchDashbar = () => {\n\t\tlaunchPreferences(\"Dashbar\");\n\t};\n\n\tconst { dashbar } = FSBL.Clients.WindowClient.getSpawnData();\n\n\t// Dashbar is disabled (no config in toolbar) or dashbar height is not specified\n\tif (!dashbar || !dashbar.height) {\n\t\treturn null;\n\t}\n\tconst toolbarHeight = finsembleWindow.windowOptions.height;\n\tconst dashbarHeight = `${dashbar.height}px`;\n\tconst verticalBounds = toolbarHeight - dashbar.height;\n\tconst widgetDividerWidth = dashbar.widgetDividerWidth || 0;\n\n\tconst wrapperClasses = `finsemble-dashbar ${className || \"\"}`.trim();\n\n\tconst getTotalWidth = () => {\n\t\tlet totalWidth = 0;\n\t\tdashbarItems.forEach((item: DashbarItemType) => {\n\t\t\ttotalWidth = totalWidth + item.width;\n\t\t});\n\t\treturn totalWidth;\n\t};\n\n\tconst [leftButtonTooltip, setLeftButtonTooltip] = useState(\"\");\n\tconst [rightButtonTooltip, setRightButtonTooltip] = useState(\"\");\n\n\tconst setWidgetsPositions = async (isCalledFromDashbar?: boolean) => {\n\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\tconst scrollButtonsEnabled = document.querySelectorAll(\"#dashbar-container > .chevron-container\").length > 0;\n\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\n\t\tlet toolbarWidth = bounds?.width ?? 0;\n\t\tif (scrollButtonsEnabled) toolbarWidth = toolbarWidth - 2 * SCROLL_BUTTON_WIDTH;\n\n\t\tlet tempLeft = 0;\n\t\tlet leftButtonSize = 0;\n\t\tif (scrollButtonsEnabled) {\n\t\t\ttempLeft = SCROLL_BUTTON_WIDTH;\n\t\t\tleftButtonSize = SCROLL_BUTTON_WIDTH;\n\t\t}\n\n\t\tlet leftItemsCount = 0;\n\t\tlet rightItemsCount = 0;\n\n\t\tfor (const element of elements) {\n\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\tconst widget = (widgets as DashbarViews)[element.id];\n\t\t\t// Happens when widgets were removed, but dom-elements still exists. So just ignore.\n\t\t\tif (!widget) continue;\n\n\t\t\tif (rect.left < SCROLL_BUTTON_WIDTH && scrollButtonsEnabled) {\n\t\t\t\twidget.bounds.width = 0;\n\t\t\t\twidget.bounds.left = tempLeft;\n\t\t\t\tleftItemsCount++;\n\t\t\t} else {\n\t\t\t\twidget.bounds.width = rect.width - widgetDividerWidth;\n\t\t\t\twidget.bounds.left = tempLeft;\n\t\t\t}\n\t\t\ttempLeft = tempLeft + widget.bounds.width + widgetDividerWidth;\n\n\t\t\tlet offsetRight = rect.left + rect.width + widgetDividerWidth - leftButtonSize - toolbarWidth;\n\t\t\tif (offsetRight > 0) {\n\t\t\t\t// hide title for invisible items\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"hidden\";\n\t\t\t\twidget.bounds.width = 0;\n\t\t\t\trightItemsCount++;\n\t\t\t} else {\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"visible\";\n\t\t\t}\n\t\t\twidget.view.setBounds(widget.bounds);\n\t\t}\n\n\t\tsetLeftButtonTooltip(`${leftItemsCount} more`);\n\t\tsetRightButtonTooltip(`${rightItemsCount} more`);\n\n\t\t//double call for fix fake empty space between widgets while scrolling\n\t\tif (!isCalledFromDashbar) {\n\t\t\tawait setWidgetsPositions(true);\n\t\t}\n\t};\n\n\tconst addWidgets = async () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\tlet tempHorizontalBounds = horizontalBounds;\n\n\t\tfor (const item of dashbarItems) {\n\t\t\tconst widgetBounds = {\n\t\t\t\ttop: verticalBounds,\n\t\t\t\tleft: tempHorizontalBounds,\n\t\t\t\twidth: item.width - widgetDividerWidth,\n\t\t\t\theight: item.height || dashbar.height,\n\t\t\t};\n\n\t\t\tif (!_widgets.hasOwnProperty(item.id)) {\n\t\t\t\tconst res: any = await finsembleWindow.addBrowserView({\n\t\t\t\t\turl: item.url,\n\t\t\t\t\tbounds: widgetBounds,\n\t\t\t\t\tallowAutoResize: false,\n\t\t\t\t});\n\n\t\t\t\t_widgets[item.id] = {\n\t\t\t\t\turl: item.url,\n\t\t\t\t\ttitle: item.title,\n\t\t\t\t\tbounds: widgetBounds,\n\t\t\t\t\tview: res,\n\t\t\t\t\twidth: item.width,\n\t\t\t\t\traiseIntentOptions: item.raiseIntentOptions,\n\t\t\t\t};\n\n\t\t\t\ttempHorizontalBounds = tempHorizontalBounds + item.width;\n\t\t\t}\n\t\t}\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempHorizontalBounds);\n\t};\n\n\tconst removeWidgets = () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\t// Widgets is an object, with each key being a reference to an item in dashbarItems\n\t\t// but dashbarItems is an array of objects. Its necessary to loop through them to determine\n\t\t// the differences to figure out which items were removed.\n\t\tconst toRemove: string[] = [];\n\t\tObject.keys(_widgets).forEach((widgetId) => {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < dashbarItems.length; i++) {\n\t\t\t\tconst dashItem = dashbarItems[i];\n\t\t\t\tif (dashItem.id === widgetId) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\ttoRemove.push(widgetId);\n\t\t\t}\n\t\t});\n\n\t\t// toRemove is an array of widgetIds which were no longer found in dashbarItems\n\t\t// As items are removed, the remaining items have to be shuffled to fill the space\n\t\tfor (const id of toRemove) {\n\t\t\tif (_widgets.hasOwnProperty(id)) {\n\t\t\t\tlet tempNewHorizontalBounds = 0;\n\t\t\t\t_widgets[id].view.remove(() => {\n\t\t\t\t\tdelete _widgets[id];\n\t\t\t\t\t// Shuffle remaining views to fill any gaps that were left\n\t\t\t\t\tObject.values(_widgets).forEach((widget) => {\n\t\t\t\t\t\twidget.bounds = {\n\t\t\t\t\t\t\twidth: widget.bounds.width,\n\t\t\t\t\t\t\theight: widget.bounds.height,\n\t\t\t\t\t\t\tleft: tempNewHorizontalBounds,\n\t\t\t\t\t\t\ttop: widget.bounds.top,\n\t\t\t\t\t\t};\n\t\t\t\t\t\twidget.view.setBounds(widget.bounds);\n\t\t\t\t\t\ttempNewHorizontalBounds = tempNewHorizontalBounds + widget.bounds.width;\n\t\t\t\t\t});\n\t\t\t\t\tsetWidgets(_widgets);\n\t\t\t\t\tsetHorizontalBounds(tempNewHorizontalBounds);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(`Error removing widget: ${id} from dashbar`);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst reorganizeWidgets = () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\t// Each view needs to be resituated to fill any holes\n\t\t// left by views that have been removed. Use a tempBounds\n\t\t// int to keep track of new widths and set the overall width\n\t\t// once everything is re-seated\n\t\tlet tempBounds = 0;\n\t\tdashbarItems.forEach((item) => {\n\t\t\tconst widget = _widgets[item.id];\n\n\t\t\twidget.bounds = {\n\t\t\t\theight: cachedWidgetHeight || widget.bounds.height,\n\t\t\t\twidth: widget.bounds.width,\n\t\t\t\ttop: cachedWidgetTop || verticalBounds,\n\t\t\t\tleft: tempBounds,\n\t\t\t};\n\n\t\t\twidget.view.setBounds(widget.bounds);\n\n\t\t\tdelete _widgets[item.id];\n\t\t\t_widgets[item.id] = widget;\n\n\t\t\ttempBounds = tempBounds + item.width;\n\t\t});\n\n\t\tsetReorganized(false);\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempBounds);\n\t};\n\n\tconst updateItems = () => {\n\t\tconst doUpdate = async () => {\n\t\t\tif (dashbarItems.length > WIDGET_COUNT) {\n\t\t\t\t//Items have been added\n\t\t\t\tawait addWidgets();\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\n\t\t\t} else if (dashbarItems.length < WIDGET_COUNT) {\n\t\t\t\t//Items have been removed\n\t\t\t\tremoveWidgets();\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\n\t\t\t} else if (wasReorganized) {\n\t\t\t\tif (movingIndex) return;\n\t\t\t\t// Length is the same, order has changed\n\t\t\t\treorganizeWidgets();\n\t\t\t}\n\n\t\t\tawait setWidgetsPositions(true);\n\t\t\tsetIsUpdatingState(false);\n\t\t};\n\n\t\tif (isUpdatingState === false) {\n\t\t\tsetIsUpdatingState(true);\n\t\t\tdoUpdate();\n\t\t} else if (!secondUpdateRequired) {\n\t\t\tsetSecondUpdateRequired(true);\n\t\t}\n\t};\n\n\t/**\n\t * When the distributed store's 'dashbaritems' is updated it will cause this hook to\n\t * execute. The local representation of widgets will be mutated, then a call to\n\t * setWidgets will re-render the component\n\t */\n\tuseEffect(() => {\n\t\tupdateItems();\n\t}, [dashbarItems]);\n\n\t/**\n\t * DashbarItems can be changed very quickly before all widgets will be initialized.\n\t * Double-calling updateItems() fixes a bug.\n\t */\n\tuseEffect(() => {\n\t\tif (secondUpdateRequired && !isUpdatingState) {\n\t\t\tupdateItems();\n\t\t\tsetSecondUpdateRequired(false);\n\t\t}\n\t}, [isUpdatingState, secondUpdateRequired]);\n\n\t/**\n\t * Sets the title height as determined by the DashbarItem\n\t * component, since the CSS can be changed by the user\n\t * the component will render the title and pass back\n\t * computed height of that title, then the Dashbar will\n\t * make room for item\n\t *\n\t * @param {number} titleHeight The height of the span containing the title\n\t * @param {string} id The key'ed id of the view\n\t */\n\tconst setTitleHeight = (titleHeight: number, id: string) => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\tconst widget = _widgets[id];\n\t\tif (cachedWidgetTop) {\n\t\t\ttitleHeight = 0;\n\t\t}\n\n\t\tconst newBounds = {\n\t\t\ttop: cachedWidgetTop || widget.bounds.top + titleHeight,\n\t\t\tleft: widget.bounds.left,\n\t\t\theight: cachedWidgetHeight || widget.bounds.height - titleHeight,\n\t\t\twidth: widget.bounds.width,\n\t\t};\n\t\tcachedWidgetTop = newBounds.top;\n\t\tcachedWidgetHeight = newBounds.height;\n\n\t\twidget.view.setBounds(newBounds);\n\t\twidget.bounds = newBounds;\n\t\tsetWidgets(_widgets);\n\t};\n\n\t/**\n\t * When a view starts moving, bring it to the front\n\t *\n\t * @param {MouseEvent} event The event passed by react-sortable-hoc\n\t */\n\tconst startMove = (node: any, event: any) => {\n\t\tmovingIndex = node.index;\n\t\tif (offsetX === null && titleGrabPosition !== null) {\n\t\t\toffsetX = event.clientX - titleGrabPosition;\n\t\t}\n\t\tconst widget = Object.values(widgets)[node.index] as DashbarView;\n\t\twidget.view.bringToFront();\n\t};\n\n\t/**\n\t * Event triggered by view movement\n\t *\n\t * @param {MouseEvent} event\n\t */\n\tconst moveItem = (event: any) => {\n\t\tif (movingIndex !== null) {\n\t\t\tconst movingWidget = Object.values(widgets)[movingIndex] as DashbarView;\n\n\t\t\tmovingWidget.view.setBounds({\n\t\t\t\ttop: movingWidget.bounds.top,\n\t\t\t\theight: movingWidget.bounds.height,\n\t\t\t\twidth: movingWidget.bounds.width,\n\t\t\t\tleft: event.clientX - (offsetX || 0),\n\t\t\t});\n\n\t\t\t// Some completely not react very hacky stuff to make browserviews move in conjunction with the titles\n\t\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\n\t\t\tfor (const element of elements) {\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tconst widget = (widgets as any)[element.id];\n\t\t\t\tif (widget !== movingWidget && widget.bounds.left !== rect.left) {\n\t\t\t\t\twidget.bounds.left = rect.left;\n\t\t\t\t\twidget.view.setBounds(widget.bounds);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst setGrabLocation = (location: number) => {\n\t\ttitleGrabPosition = location;\n\t};\n\n\treturn (\n\t\t<div className={wrapperClasses} style={{ height: dashbarHeight }}>\n\t\t\t{WIDGET_COUNT > 0 && (\n\t\t\t\t<FinsembleDnDContext\n\t\t\t\t\tonDragEnd={reorderItems}\n\t\t\t\t\tonDragStart={startMove}\n\t\t\t\t\tonDragMove={moveItem}\n\t\t\t\t\tonLayoutUpdate={setWidgetsPositions}\n\t\t\t\t\tclassName=\"finsemble-dashbar-section rearrange-region\"\n\t\t\t\t\tid=\"dashbar-container\"\n\t\t\t\t\taxis={AllowableDnDAxis.x}\n\t\t\t\t\tlockAxis={AllowableDnDAxis.x}\n\t\t\t\t\tallowHorizontalScroll={true}\n\t\t\t\t\tshowScrollButtonsTooltip={true}\n\t\t\t\t\tleftButtonTooltip={leftButtonTooltip}\n\t\t\t\t\trightButtonTooltip={rightButtonTooltip}\n\t\t\t\t>\n\t\t\t\t\t{Object.values(widgets).map((widget, i) => (\n\t\t\t\t\t\t<DashbarItem\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tid={Object.keys(widgets)[i]}\n\t\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\t\twidgetTitleGenerator={titleGenerator}\n\t\t\t\t\t\t\twidget={widget as DashbarView}\n\t\t\t\t\t\t\tdashbarHeight={dashbar.height}\n\t\t\t\t\t\t\twidgetDividerWidth={widgetDividerWidth}\n\t\t\t\t\t\t\tsetTitleHeight={setTitleHeight}\n\t\t\t\t\t\t\tsetGrabLocation={setGrabLocation}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</FinsembleDnDContext>\n\t\t\t)}\n\t\t\t{WIDGET_COUNT === 0 && (\n\t\t\t\t<div className=\"add-dashbar-item-button\" onClick={launchDashbar}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<i className=\"ff-plus\"></i>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DashbarItem.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/DashbarItem.tsx"],"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S,GAAG;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,GAAG,kBAAkB,uCAAuC;KACzE,CAAC;IAEF,MAAM,KAAK,GAAG,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAErD,OAAO,CACN,oBAAC,kBAAkB,IAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY;QACrF,6BAAK,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,SAAS;YACvG,iCAAM,KAAK,CAAO;YAClB,6BAAK,SAAS,EAAC,aAAa,GAAO,CAC9B,CACc,CACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { useRef, useLayoutEffect } from \"react\";\r\nimport { FinsembleDraggable } from \"../../legacyControls/FinsembleDraggable\";\r\nimport { DashbarView } from \"../../../types/dashbarTypes\";\r\n\r\nimport \"../../../assets/css/dashbar.css\";\r\n\r\ntype DashbarItemProps = {\r\n\tid?: string;\r\n\tindex: number;\r\n\tclassName?: string;\r\n\theight?: number;\r\n\twidget: DashbarView;\r\n\tdashbarHeight?: number;\r\n\twidgetDividerWidth?: number;\r\n\tsetTitleHeight: Function;\r\n\tsetGrabLocation: Function;\r\n\twidgetTitleGenerator: Function;\r\n};\r\n\r\nexport const DashbarItem = ({\r\n\tid = `finsemble-draggable-${Date.now()}-${Math.random()}`,\r\n\tindex,\r\n\tclassName,\r\n\twidget,\r\n\theight,\r\n\tdashbarHeight,\r\n\twidgetDividerWidth,\r\n\tsetTitleHeight,\r\n\tsetGrabLocation,\r\n\twidgetTitleGenerator,\r\n}: DashbarItemProps) => {\r\n\tconst titleRef = useRef<HTMLDivElement>(null);\r\n\tconst divRef = useRef<HTMLDivElement>(null);\r\n\r\n\tuseLayoutEffect(() => {\r\n\t\tif (titleRef?.current && dashbarHeight) {\r\n\t\t\tconst { offsetHeight } = titleRef.current;\r\n\r\n\t\t\tconst titleHeight = height ? height + offsetHeight : offsetHeight;\r\n\t\t\tsetTitleHeight(titleHeight, id);\r\n\t\t}\r\n\t});\r\n\r\n\t/**\r\n\t * Sets the location the titlebar of a view is clicked on when a user grabs a dashbar item\r\n\t *\r\n\t * @param event\r\n\t */\r\n\tconst _setGrabLocation = () => {\r\n\t\tif (divRef?.current) {\r\n\t\t\tconst rect = (divRef.current as HTMLElement).getBoundingClientRect();\r\n\t\t\tsetGrabLocation(rect.left);\r\n\t\t}\r\n\t};\r\n\r\n\tconst wrapperClass = `finsemble-dashbar-item ${className || \"\"}`;\r\n\tconst itemStyle = {\r\n\t\tdisplay: \"flex\",\r\n\t\twidth: widget.width,\r\n\t\tborderRight: `${widgetDividerWidth}px solid var(--dashbar-divider-color)`,\r\n\t};\r\n\r\n\tconst title = widgetTitleGenerator(widget, titleRef);\r\n\r\n\treturn (\r\n\t\t<FinsembleDraggable draggableId={id} index={index} key={id} wrapperClass={wrapperClass}>\r\n\t\t\t<div ref={divRef} id={id} onMouseDown={_setGrabLocation} className=\"dashbar-item-frame\" style={itemStyle}>\r\n\t\t\t\t<div>{title}</div>\r\n\t\t\t\t<div className=\"empty-space\"></div>\r\n\t\t\t</div>\r\n\t\t</FinsembleDraggable>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"DashbarItem.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/DashbarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,OAAO,iCAAiC,CAAC;AAezC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC3B,EAAE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E,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY;QACrF,6BAAK,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,SAAS;YACvG,iCAAM,KAAK,CAAO;YAClB,6BAAK,SAAS,EAAC,aAAa,GAAO,CAC9B,CACc,CACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { useRef, useLayoutEffect } from \"react\";\nimport { FinsembleDraggable } from \"../../legacyControls/FinsembleDraggable\";\nimport { DashbarView } from \"../../../types/dashbarTypes\";\n\nimport \"../../../assets/css/dashbar.css\";\n\ntype DashbarItemProps = {\n\tid?: string;\n\tindex: number;\n\tclassName?: string;\n\theight?: number;\n\twidget: DashbarView;\n\tdashbarHeight?: number;\n\twidgetDividerWidth?: number;\n\tsetTitleHeight: Function;\n\tsetGrabLocation: Function;\n\twidgetTitleGenerator: Function;\n};\n\nexport const DashbarItem = ({\n\tid = `finsemble-draggable-${Date.now()}-${Math.random()}`,\n\tindex,\n\tclassName,\n\twidget,\n\theight,\n\tdashbarHeight,\n\twidgetDividerWidth,\n\tsetTitleHeight,\n\tsetGrabLocation,\n\twidgetTitleGenerator,\n}: DashbarItemProps) => {\n\tconst titleRef = useRef<HTMLDivElement>(null);\n\tconst divRef = useRef<HTMLDivElement>(null);\n\n\tuseLayoutEffect(() => {\n\t\tif (titleRef?.current && dashbarHeight) {\n\t\t\tconst { offsetHeight } = titleRef.current;\n\n\t\t\tconst titleHeight = height ? height + offsetHeight : offsetHeight;\n\t\t\tsetTitleHeight(titleHeight, id);\n\t\t}\n\t});\n\n\t/**\n\t * Sets the location the titlebar of a view is clicked on when a user grabs a dashbar item\n\t *\n\t * @param event\n\t */\n\tconst _setGrabLocation = () => {\n\t\tif (divRef?.current) {\n\t\t\tconst rect = (divRef.current as HTMLElement).getBoundingClientRect();\n\t\t\tsetGrabLocation(rect.left);\n\t\t}\n\t};\n\n\tconst wrapperClass = `finsemble-dashbar-item ${className || \"\"}`;\n\tconst itemStyle = {\n\t\tdisplay: \"flex\",\n\t\twidth: widget.width,\n\t\tborderRight: `${widgetDividerWidth}px solid var(--dashbar-divider-color)`,\n\t};\n\n\tconst title = widgetTitleGenerator(widget, titleRef);\n\n\treturn (\n\t\t<FinsembleDraggable draggableId={id} index={index} key={id} wrapperClass={wrapperClass}>\n\t\t\t<div ref={divRef} id={id} onMouseDown={_setGrabLocation} className=\"dashbar-item-frame\" style={itemStyle}>\n\t\t\t\t<div>{title}</div>\n\t\t\t\t<div className=\"empty-space\"></div>\n\t\t\t</div>\n\t\t</FinsembleDraggable>\n\t);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { ToolbarShell } from \"./ToolbarShell\";\r\nexport { AutoArrange } from \"./AutoArrange\";\r\nexport { MinimizeAll } from \"./MinimizeAll\";\r\nexport { NotificationControl } from \"./NotificationControl\";\r\nexport { RevealAll } from \"./RevealAll\";\r\nexport { ToolbarSection } from \"./ToolbarSection\";\r\nexport { AppLauncherMenu } from \"./appLauncher/AppLauncherMenu\";\r\nexport { AdvancedAppLauncherMenu } from \"./advancedAppLauncher/AdvancedAppLauncherMenu\";\r\nexport { WorkspaceManagementMenu } from \"./workspaceManagementMenu/WorkspaceManagementMenu\";\r\nexport { Dashbar } from \"./dashbar/Dashbar\";\r\nexport { DashbarItem } from \"./dashbar/DashbarItem\";\r\nexport { Search } from \"../search/Search\";\r\nexport { DragHandle } from \"./DragHandle\";\r\nexport { ToolbarIcon } from \"./ToolbarIcon\";\r\nexport { FavoritesShell } from \"../favorites/FavoritesShell\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { ToolbarShell } from \"./ToolbarShell\";\nexport { AutoArrange } from \"./AutoArrange\";\nexport { MinimizeAll } from \"./MinimizeAll\";\nexport { NotificationControl } from \"./NotificationControl\";\nexport { RevealAll } from \"./RevealAll\";\nexport { ToolbarSection } from \"./ToolbarSection\";\nexport { AppLauncherMenu } from \"./appLauncher/AppLauncherMenu\";\nexport { AdvancedAppLauncherMenu } from \"./advancedAppLauncher/AdvancedAppLauncherMenu\";\nexport { WorkspaceManagementMenu } from \"./workspaceManagementMenu/WorkspaceManagementMenu\";\nexport { Dashbar } from \"./dashbar/Dashbar\";\nexport { DashbarItem } from \"./dashbar/DashbarItem\";\nexport { Search } from \"../search/Search\";\nexport { DragHandle } from \"./DragHandle\";\nexport { ToolbarIcon } from \"./ToolbarIcon\";\nexport { FavoritesShell } from \"../favorites/FavoritesShell\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceManagementMenu.js","sourceRoot":"","sources":["../../../../src/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAGrE,OAAO,+BA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,CAAC,qBAAqB,EACvD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAC3C,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GACnC,CACA,CACH,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\r\n * Copyright 2017 by ChartIQ, Inc.\r\n * All rights reserved.\r\n */\r\nimport React from \"react\";\r\nimport { Actions as WorkspaceManagementMenuActions } from \"./stores/workspaceManagementMenuStore\";\r\nimport WorkspaceActions from \"./components/WorkspaceActions\";\r\nimport WorkspaceList from \"./components/WorkspaceList\";\r\nimport { Menu } from \"../../menu/Menu\";\r\nimport { storeManager } from \"./stores/workspaceManagementMenuStore\";\r\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\r\n\r\nimport \"./workspaceManagementMenu.css\";\r\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\r\n\r\ninterface IProps {\r\n\tid?: string;\r\n\tclassName?: string;\r\n\twidth?: number;\r\n\theight?: number;\r\n\tmaxHeight?: number;\r\n\ttitle?: React.ReactNode;\r\n\topenHotkey?: Array<string>;\r\n\tcloseHotkey?: Array<string>;\r\n}\r\ninterface IState {\r\n\tWorkspaceList: WorkspaceType[];\r\n\tactiveWorkspace: WorkspaceType | null;\r\n\tinitialized: boolean;\r\n\tisSwitchingWorkspaces: boolean;\r\n}\r\n\r\n/**\r\n * A button that opens the workspace management menu when clicked.\r\n */\r\nexport class WorkspaceManagementMenu extends React.Component<IProps, IState> {\r\n\tstore: StoreModel | null;\r\n\r\n\tconstructor(props: IProps) {\r\n\t\tsuper(props);\r\n\t\tthis.bindCorrectContext();\r\n\t\tthis.store = null;\r\n\t\tthis.state = {\r\n\t\t\tWorkspaceList: [],\r\n\t\t\tactiveWorkspace: null,\r\n\t\t\tinitialized: false,\r\n\t\t\tisSwitchingWorkspaces: false,\r\n\t\t};\r\n\t}\r\n\r\n\tbindCorrectContext() {\r\n\t\tthis.onStoreChange = this.onStoreChange.bind(this);\r\n\t\tthis.onInitialized = this.onInitialized.bind(this);\r\n\t}\r\n\r\n\tonInitialized(store: StoreModel) {\r\n\t\tthis.store = store;\r\n\t\tthis.store.addListener({ field: \"WorkspaceList\" }, this.onStoreChange);\r\n\t\tthis.store.addListener({ field: \"activeWorkspace\" }, this.onStoreChange);\r\n\t\tthis.store.addListener({ field: \"isSwitchingWorkspaces\" }, this.onStoreChange);\r\n\t\tthis.onStoreChange();\r\n\t\tthis.setState({\r\n\t\t\tinitialized: true,\r\n\t\t});\r\n\t}\r\n\r\n\tonStoreChange() {\r\n\t\tthis.setState({\r\n\t\t\tWorkspaceList: WorkspaceManagementMenuActions.getWorkspaceList(),\r\n\t\t\tactiveWorkspace: WorkspaceManagementMenuActions.getActiveWorkspace(),\r\n\t\t\tisSwitchingWorkspaces: WorkspaceManagementMenuActions.getIsSwitchingWorkspaces(),\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tstoreManager.addInitializedListener(this.onInitialized);\r\n\t\tstoreManager.initialize();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\r\n\t\tif (this.state.initialized) {\r\n\t\t\tthis.store?.removeListener({ field: \"WorkspaceList\" }, this.onStoreChange);\r\n\t\t\tthis.store?.removeListener({ field: \"activeWorkspace\" }, this.onStoreChange);\r\n\t\t\tthis.store?.removeListener({ field: \"isSwitchingWorkspaces\" }, this.onStoreChange);\r\n\t\t}\r\n\t}\r\n\r\n\trender() {\r\n\t\tlet completeProps = {\r\n\t\t\t...this.props,\r\n\t\t\twidth: this.props.width ?? 330,\r\n\t\t\tclassName: this.props.className ?? \"workspace-management-menu\",\r\n\t\t\tid: this.props.id ?? \"WorkspaceMenu\",\r\n\t\t\ttitle: this.state.activeWorkspace?.name,\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<Menu {...completeProps}>\r\n\t\t\t\t{this.state.initialized && this.state.activeWorkspace ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<WorkspaceActions />\r\n\t\t\t\t\t\t<WorkspaceList\r\n\t\t\t\t\t\t\tisSwitchingWorkspaces={this.state.isSwitchingWorkspaces}\r\n\t\t\t\t\t\t\tactiveWorkspace={this.state.activeWorkspace}\r\n\t\t\t\t\t\t\tworkspaces={this.state.WorkspaceList}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\t\t\t</Menu>\r\n\t\t);\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"WorkspaceManagementMenu.js","sourceRoot":"","sources":["../../../../src/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAGrE,OAAO,+BAA+B,CAAC;AAuBvC,MAAM,OAAO,uBAAwB,SAAQ,KAAK,CAAC,SAAyB;IAG3E,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG;YACZ,aAAa,EAAE,EAAE;YACjB,eAAe,EAAE,IAAI;YACrB,WAAW,EAAE,KAAK;YAClB,qBAAqB,EAAE,KAAK;SAC5B,CAAC;IACH,CAAC;IAED,kBAAkB;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,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K,0CAAE,cAAc,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAC7E,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;SACnF;IACF,CAAC;IAED,MAAM;;QACL,IAAI,aAAa,mCACb,IAAI,CAAC,KAAK,KACb,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,GAAG,EAC9B,SAAS,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,mCAAI,2BAA2B,EAC9D,EAAE,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,EAAE,mCAAI,eAAe,EACpC,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,eAAe,0CAAE,IAAI,GACvC,CAAC;QAEF,OAAO,CACN,oBAAC,IAAI,oBAAK,aAAa,GACrB,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CACvD;YACC,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,aAAa,IACb,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACvD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAC3C,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GACnC,CACA,CACH,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React from \"react\";\nimport { Actions as WorkspaceManagementMenuActions } from \"./stores/workspaceManagementMenuStore\";\nimport WorkspaceActions from \"./components/WorkspaceActions\";\nimport WorkspaceList from \"./components/WorkspaceList\";\nimport { Menu } from \"../../menu/Menu\";\nimport { storeManager } from \"./stores/workspaceManagementMenuStore\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\n\nimport \"./workspaceManagementMenu.css\";\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\n\ninterface IProps {\n\tid?: string;\n\tclassName?: string;\n\twidth?: number;\n\theight?: number;\n\tmaxHeight?: number;\n\ttitle?: React.ReactNode;\n\topenHotkey?: Array<string>;\n\tcloseHotkey?: Array<string>;\n}\ninterface IState {\n\tWorkspaceList: WorkspaceType[];\n\tactiveWorkspace: WorkspaceType | null;\n\tinitialized: boolean;\n\tisSwitchingWorkspaces: boolean;\n}\n\n/**\n * A button that opens the workspace management menu when clicked.\n */\nexport class WorkspaceManagementMenu extends React.Component<IProps, IState> {\n\tstore: StoreModel | null;\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t\tthis.store = null;\n\t\tthis.state = {\n\t\t\tWorkspaceList: [],\n\t\t\tactiveWorkspace: null,\n\t\t\tinitialized: false,\n\t\t\tisSwitchingWorkspaces: false,\n\t\t};\n\t}\n\n\tbindCorrectContext() {\n\t\tthis.onStoreChange = this.onStoreChange.bind(this);\n\t\tthis.onInitialized = this.onInitialized.bind(this);\n\t}\n\n\tonInitialized(store: StoreModel) {\n\t\tthis.store = store;\n\t\tthis.store.addListener({ field: \"WorkspaceList\" }, this.onStoreChange);\n\t\tthis.store.addListener({ field: \"activeWorkspace\" }, this.onStoreChange);\n\t\tthis.store.addListener({ field: \"isSwitchingWorkspaces\" }, this.onStoreChange);\n\t\tthis.onStoreChange();\n\t\tthis.setState({\n\t\t\tinitialized: true,\n\t\t});\n\t}\n\n\tonStoreChange() {\n\t\tthis.setState({\n\t\t\tWorkspaceList: WorkspaceManagementMenuActions.getWorkspaceList(),\n\t\t\tactiveWorkspace: WorkspaceManagementMenuActions.getActiveWorkspace(),\n\t\t\tisSwitchingWorkspaces: WorkspaceManagementMenuActions.getIsSwitchingWorkspaces(),\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\n\t\tif (this.state.initialized) {\n\t\t\tthis.store?.removeListener({ field: \"WorkspaceList\" }, this.onStoreChange);\n\t\t\tthis.store?.removeListener({ field: \"activeWorkspace\" }, this.onStoreChange);\n\t\t\tthis.store?.removeListener({ field: \"isSwitchingWorkspaces\" }, this.onStoreChange);\n\t\t}\n\t}\n\n\trender() {\n\t\tlet completeProps = {\n\t\t\t...this.props,\n\t\t\twidth: this.props.width ?? 330,\n\t\t\tclassName: this.props.className ?? \"workspace-management-menu\",\n\t\t\tid: this.props.id ?? \"WorkspaceMenu\",\n\t\t\ttitle: this.state.activeWorkspace?.name,\n\t\t};\n\n\t\treturn (\n\t\t\t<Menu {...completeProps}>\n\t\t\t\t{this.state.initialized && this.state.activeWorkspace ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<WorkspaceActions />\n\t\t\t\t\t\t<WorkspaceList\n\t\t\t\t\t\t\tisSwitchingWorkspaces={this.state.isSwitchingWorkspaces}\n\t\t\t\t\t\t\tactiveWorkspace={this.state.activeWorkspace}\n\t\t\t\t\t\t\tworkspaces={this.state.WorkspaceList}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : null}\n\t\t\t</Menu>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/Workspace.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAA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E,GAAG,IAAI,CAAC,KAAK,CAAC;QAIvF,MAAM,WAAW,GAAG,qBAAqB,IAAI,iBAAiB,CAAC;QAE/D,IAAI,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC,0BAA0B,CAAC;QAE3G,OAAO,CACN,oBAAC,QAAQ,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO;YAClD,6BAAK,SAAS,EAAC,eAAe;gBAC5B,WAAW,IAAI,8BAAM,SAAS,EAAC,aAAa,iBAAkB;gBAC9D,CAAC,WAAW,IAAI,UAAU,IAAI,UAAU,CAAC,SAAS,IAAI,8BAAM,SAAS,EAAE,UAAU,CAAC,SAAS,GAAS;gBACrG,8BAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,IACpD,SAAS,CAAC,IAAI,CACT;gBACP,6BAAK,SAAS,EAAC,0BAA0B;oBACvC,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI;oBACxF,oBAAC,aAAa,IACb,EAAE,EAAE,SAAS,CAAC,IAAI,EAClB,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAC,gBAAgB,GACzB,CACG,CACD,CACI,CACX,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\r\n * Copyright 2017 by ChartIQ, Inc.\r\n * All rights reserved.\r\n * This is a single workspace. When clicked, it requests that the app switch to the clicked workspace.\r\n */\r\n\r\nimport React from \"react\";\r\nimport { MenuItem } from \"../../../menu/MenuItem\";\r\nimport { Actions as WorkspaceManagementMenuActions } from \"../stores/workspaceManagementMenuStore\";\r\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\r\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\r\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\r\n\r\ntype WorkspaceActionType = WorkspaceType & {\r\n\tpermanent?: boolean;\r\n};\r\n\r\ninterface RemoveWorkspaceProps {\r\n\tworkspace: WorkspaceActionType;\r\n}\r\n\r\nconst RemoveWorkspace = (props: RemoveWorkspaceProps) => {\r\n\tconst { workspace } = props;\r\n\tconst { isFavorited, removeFavorite } = useFavorites();\r\n\tconst actuallyRemoveWorkspace = (e: React.MouseEvent) => {\r\n\t\te.preventDefault();\r\n\t\te.stopPropagation();\r\n\t\t// Trigger the remove. This will throw a dialog. It will return a boolean\r\n\t\t// for whether it was or was not deleted.\r\n\t\t// If the thing was deleted, remove it from favorites.\r\n\t\tWorkspaceManagementMenuActions.removeWorkspace(workspace, (wasDeleted) => {\r\n\t\t\tif (wasDeleted && isFavorited(workspace.name)) {\r\n\t\t\t\tremoveFavorite(workspace.name);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\treturn (\r\n\t\t<span onClick={actuallyRemoveWorkspace} className=\"menu-item-icon\">\r\n\t\t\t<i className=\"ff-adp-trash-outline\" title=\"Delete\"></i>\r\n\t\t</span>\r\n\t);\r\n};\r\n\r\ninterface IProps {\r\n\tisSwitchingWorkspaces: boolean;\r\n\tisActiveWorkspace: boolean;\r\n\tdragHandle: { iconClass: string };\r\n\tworkspace: WorkspaceActionType;\r\n\tmainAction: (data: { name: string }) => void;\r\n}\r\n\r\nexport default class Workspace extends React.Component<IProps> {\r\n\tconstructor(props: IProps) {\r\n\t\tsuper(props);\r\n\t\tthis.bindCorrectContext();\r\n\t}\r\n\r\n\t/**\r\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\r\n\t *\r\n\t * @memberof Workspace\r\n\t */\r\n\tbindCorrectContext() {\r\n\t\tthis.onClick = this.onClick.bind(this);\r\n\t}\r\n\r\n\t/**\r\n\t * When the main body of the component is clicked, we fire off the mainAction. By default this is to switch workspaces.\r\n\t *\r\n\t * @memberof Workspace\r\n\t */\r\n\tonClick() {\r\n\t\tthis.props.mainAction({\r\n\t\t\tname: this.props.workspace.name,\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Render method.\r\n\t *\r\n\t * @returns\r\n\t * @memberof Workspace\r\n\t */\r\n\trender() {\r\n\t\tconst { isSwitchingWorkspaces, workspace, isActiveWorkspace, dragHandle } = this.props;\r\n\r\n\t\t// Actions are remove and pin workspace.\r\n\r\n\t\tconst showSpinner = isSwitchingWorkspaces && isActiveWorkspace;\r\n\r\n\t\tlet classes = isActiveWorkspace ? \"menu-item active-workspace workspace-name\" : \"menu-item workspace-name\";\r\n\r\n\t\treturn (\r\n\t\t\t<MenuItem onClick={this.onClick} className={classes}>\r\n\t\t\t\t<div className=\"menu-item-row\">\r\n\t\t\t\t\t{showSpinner && <span className=\"fsbl-loader\">Loading...</span>}\r\n\t\t\t\t\t{!showSpinner && dragHandle && dragHandle.iconClass && <span className={dragHandle.iconClass}></span>}\r\n\t\t\t\t\t<span className=\"workspace-name\" title={workspace.name}>\r\n\t\t\t\t\t\t{workspace.name}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<div className=\"menu-item-row-push-right\">\r\n\t\t\t\t\t\t{!isActiveWorkspace && !workspace.permanent && <RemoveWorkspace workspace={workspace} />}\r\n\t\t\t\t\t\t<FavoriteMaker\r\n\t\t\t\t\t\t\tid={workspace.name}\r\n\t\t\t\t\t\t\tname={workspace.name}\r\n\t\t\t\t\t\t\tcategory={\"Workspace\"}\r\n\t\t\t\t\t\t\tclassName=\"menu-item-icon\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</MenuItem>\r\n\t\t);\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/Workspace.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,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AAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI;SAC/B,CAAC,CAAC;IACJ,CAAC;IAQD,MAAM;QACL,MAAM,EAAE,qBAAqB,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAIvF,MAAM,WAAW,GAAG,qBAAqB,IAAI,iBAAiB,CAAC;QAE/D,IAAI,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC,0BAA0B,CAAC;QAE3G,OAAO,CACN,oBAAC,QAAQ,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO;YAClD,6BAAK,SAAS,EAAC,eAAe;gBAC5B,WAAW,IAAI,8BAAM,SAAS,EAAC,aAAa,iBAAkB;gBAC9D,CAAC,WAAW,IAAI,UAAU,IAAI,UAAU,CAAC,SAAS,IAAI,8BAAM,SAAS,EAAE,UAAU,CAAC,SAAS,GAAS;gBACrG,8BAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,IACpD,SAAS,CAAC,IAAI,CACT;gBACP,6BAAK,SAAS,EAAC,0BAA0B;oBACvC,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI;oBACxF,oBAAC,aAAa,IACb,EAAE,EAAE,SAAS,CAAC,IAAI,EAClB,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAC,gBAAgB,GACzB,CACG,CACD,CACI,CACX,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is a single workspace. When clicked, it requests that the app switch to the clicked workspace.\n */\n\nimport React from \"react\";\nimport { MenuItem } from \"../../../menu/MenuItem\";\nimport { Actions as WorkspaceManagementMenuActions } from \"../stores/workspaceManagementMenuStore\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\n\ntype WorkspaceActionType = WorkspaceType & {\n\tpermanent?: boolean;\n};\n\ninterface RemoveWorkspaceProps {\n\tworkspace: WorkspaceActionType;\n}\n\nconst RemoveWorkspace = (props: RemoveWorkspaceProps) => {\n\tconst { workspace } = props;\n\tconst { isFavorited, removeFavorite } = useFavorites();\n\tconst actuallyRemoveWorkspace = (e: React.MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\t// Trigger the remove. This will throw a dialog. It will return a boolean\n\t\t// for whether it was or was not deleted.\n\t\t// If the thing was deleted, remove it from favorites.\n\t\tWorkspaceManagementMenuActions.removeWorkspace(workspace, (wasDeleted) => {\n\t\t\tif (wasDeleted && isFavorited(workspace.name)) {\n\t\t\t\tremoveFavorite(workspace.name);\n\t\t\t}\n\t\t});\n\t};\n\n\treturn (\n\t\t<span onClick={actuallyRemoveWorkspace} className=\"menu-item-icon\">\n\t\t\t<i className=\"ff-adp-trash-outline\" title=\"Delete\"></i>\n\t\t</span>\n\t);\n};\n\ninterface IProps {\n\tisSwitchingWorkspaces: boolean;\n\tisActiveWorkspace: boolean;\n\tdragHandle: { iconClass: string };\n\tworkspace: WorkspaceActionType;\n\tmainAction: (data: { name: string }) => void;\n}\n\nexport default class Workspace extends React.Component<IProps> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t}\n\n\t/**\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\n\t *\n\t * @memberof Workspace\n\t */\n\tbindCorrectContext() {\n\t\tthis.onClick = this.onClick.bind(this);\n\t}\n\n\t/**\n\t * When the main body of the component is clicked, we fire off the mainAction. By default this is to switch workspaces.\n\t *\n\t * @memberof Workspace\n\t */\n\tonClick() {\n\t\tthis.props.mainAction({\n\t\t\tname: this.props.workspace.name,\n\t\t});\n\t}\n\n\t/**\n\t * Render method.\n\t *\n\t * @returns\n\t * @memberof Workspace\n\t */\n\trender() {\n\t\tconst { isSwitchingWorkspaces, workspace, isActiveWorkspace, dragHandle } = this.props;\n\n\t\t// Actions are remove and pin workspace.\n\n\t\tconst showSpinner = isSwitchingWorkspaces && isActiveWorkspace;\n\n\t\tlet classes = isActiveWorkspace ? \"menu-item active-workspace workspace-name\" : \"menu-item workspace-name\";\n\n\t\treturn (\n\t\t\t<MenuItem onClick={this.onClick} className={classes}>\n\t\t\t\t<div className=\"menu-item-row\">\n\t\t\t\t\t{showSpinner && <span className=\"fsbl-loader\">Loading...</span>}\n\t\t\t\t\t{!showSpinner && dragHandle && dragHandle.iconClass && <span className={dragHandle.iconClass}></span>}\n\t\t\t\t\t<span className=\"workspace-name\" title={workspace.name}>\n\t\t\t\t\t\t{workspace.name}\n\t\t\t\t\t</span>\n\t\t\t\t\t<div className=\"menu-item-row-push-right\">\n\t\t\t\t\t\t{!isActiveWorkspace && !workspace.permanent && <RemoveWorkspace workspace={workspace} />}\n\t\t\t\t\t\t<FavoriteMaker\n\t\t\t\t\t\t\tid={workspace.name}\n\t\t\t\t\t\t\tname={workspace.name}\n\t\t\t\t\t\t\tcategory={\"Workspace\"}\n\t\t\t\t\t\t\tclassName=\"menu-item-icon\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</MenuItem>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceActions.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAQlD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAiB;IAGpE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,WAAW,GAAG;YAClB;gBACC,MAAM,EAAE,IAAI,CAAC,eAAe;gBAC5B,KAAK,EAAE,eAAe;gBACtB,EAAE,EAAE,cAAc;aAClB;YACD;gBACC,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,KAAK,EAAE,MAAM;gBACb,EAAE,EAAE,eAAe;aACnB;YACD;gBACC,MAAM,EAAE,IAAI,CAAC,eAAe;gBAC5B,KAAK,EAAE,SAAS;gBAChB,EAAE,EAAE,iBAAiB;aACrB;SACD,CAAC;IACH,CAAC;IAOD,eAAe;QACd,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,YAAY,EAAE,CAAC;IAC/C,CAAC;IAOD,aAAa;QACZ,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAOD,eAAe;QACd,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC;IAED,eAAe;QACd,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC;IAQD,MAAM;QAIL,OAAO,CACN,6BAAK,SAAS,EAAC,kCAAkC,IAC/C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACxC,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,IAC1C,MAAM,CAAC,KAAK,CACH,CACX,CAAC,CACG,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\r\n * Copyright 2017 by ChartIQ, Inc.\r\n * All rights reserved.\r\n * This is the list of actions the user can take; it's placed above the list of workspaces..\r\n */\r\nimport React from \"react\";\r\nimport { Actions as WorkspaceManagementMenuActions } from \"../stores/workspaceManagementMenuStore\";\r\nimport { MenuItem } from \"../../../menu/MenuItem\";\r\n\r\ninterface IProps {}\r\ntype UserActionsType = {\r\n\tmethod: () => void;\r\n\tlabel: string;\r\n\tid: string;\r\n};\r\nexport default class WorkspaceActions extends React.Component<IProps> {\r\n\tuserActions: UserActionsType[];\r\n\r\n\tconstructor(props: IProps) {\r\n\t\tsuper(props);\r\n\t\tthis.userActions = [\r\n\t\t\t{\r\n\t\t\t\tmethod: this.createWorkspace,\r\n\t\t\t\tlabel: \"New workspace\",\r\n\t\t\t\tid: \"NewWorkspace\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tmethod: this.saveWorkspace,\r\n\t\t\t\tlabel: \"Save\",\r\n\t\t\t\tid: \"SaveWorkspace\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tmethod: this.saveWorkspaceAs,\r\n\t\t\t\tlabel: \"Save as\",\r\n\t\t\t\tid: \"SaveWorkspaceAs\",\r\n\t\t\t},\r\n\t\t];\r\n\t}\r\n\r\n\t/**\r\n\t * Blurs window. Pops up a dialog asking for a name for the new workspace.\r\n\t *\r\n\t * @memberof WorkspaceActions\r\n\t */\r\n\tcreateWorkspace() {\r\n\t\tWorkspaceManagementMenuActions.blurWindow();\r\n\t\tWorkspaceManagementMenuActions.newWorkspace();\r\n\t}\r\n\r\n\t/**\r\n\t * Blurs window. Persists activeWorkspace to the storage.\r\n\t *\r\n\t * @memberof WorkspaceActions\r\n\t */\r\n\tsaveWorkspace() {\r\n\t\tWorkspaceManagementMenuActions.blurWindow();\r\n\t\tWorkspaceManagementMenuActions.saveWorkspace();\r\n\t}\r\n\r\n\t/**\r\n\t * Blurs window. Pops up a dialog asking for a name for the new workspace.\r\n\t *\r\n\t * @memberof WorkspaceActions\r\n\t */\r\n\tsaveWorkspaceAs() {\r\n\t\tWorkspaceManagementMenuActions.blurWindow();\r\n\t\tWorkspaceManagementMenuActions.saveWorkspaceAs();\r\n\t}\r\n\r\n\tshowPreferences() {\r\n\t\tWorkspaceManagementMenuActions.blurWindow();\r\n\t\tWorkspaceManagementMenuActions.showPreferences();\r\n\t}\r\n\r\n\t/**\r\n\t * Render method.\r\n\t *\r\n\t * @returns\r\n\t * @memberof WorkspaceActions\r\n\t */\r\n\trender() {\r\n\t\t/**\r\n\t\t * Iterates through the list of actions defined in the constructor, creating an `li` for each.\r\n\t\t */\r\n\t\treturn (\r\n\t\t\t<div className=\"menu-secondary workspace-actions\">\r\n\t\t\t\t{this.userActions.map((action, index) => (\r\n\t\t\t\t\t<MenuItem key={index} onClick={action.method}>\r\n\t\t\t\t\t\t{action.label}\r\n\t\t\t\t\t</MenuItem>\r\n\t\t\t\t))}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"WorkspaceActions.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAQlD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAiB;IAGpE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,WAAW,GAAG;YAClB;gBACC,MAAM,EAAE,IAAI,CAAC,eAAe;gBAC5B,KAAK,EAAE,eAAe;gBACtB,EAAE,EAAE,cAAc;aAClB;YACD;gBACC,MAAM,EAAE,IAAI,CAAC,aAAa;gBAC1B,KAAK,EAAE,MAAM;gBACb,EAAE,EAAE,eAAe;aACnB;YACD;gBACC,MAAM,EAAE,IAAI,CAAC,eAAe;gBAC5B,KAAK,EAAE,SAAS;gBAChB,EAAE,EAAE,iBAAiB;aACrB;SACD,CAAC;IACH,CAAC;IAOD,eAAe;QACd,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,YAAY,EAAE,CAAC;IAC/C,CAAC;IAOD,aAAa;QACZ,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAOD,eAAe;QACd,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC;IAED,eAAe;QACd,8BAA8B,CAAC,UAAU,EAAE,CAAC;QAC5C,8BAA8B,CAAC,eAAe,EAAE,CAAC;IAClD,CAAC;IAQD,MAAM;QAIL,OAAO,CACN,6BAAK,SAAS,EAAC,kCAAkC,IAC/C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACxC,oBAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,IAC1C,MAAM,CAAC,KAAK,CACH,CACX,CAAC,CACG,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is the list of actions the user can take; it's placed above the list of workspaces..\n */\nimport React from \"react\";\nimport { Actions as WorkspaceManagementMenuActions } from \"../stores/workspaceManagementMenuStore\";\nimport { MenuItem } from \"../../../menu/MenuItem\";\n\ninterface IProps {}\ntype UserActionsType = {\n\tmethod: () => void;\n\tlabel: string;\n\tid: string;\n};\nexport default class WorkspaceActions extends React.Component<IProps> {\n\tuserActions: UserActionsType[];\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.userActions = [\n\t\t\t{\n\t\t\t\tmethod: this.createWorkspace,\n\t\t\t\tlabel: \"New workspace\",\n\t\t\t\tid: \"NewWorkspace\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmethod: this.saveWorkspace,\n\t\t\t\tlabel: \"Save\",\n\t\t\t\tid: \"SaveWorkspace\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmethod: this.saveWorkspaceAs,\n\t\t\t\tlabel: \"Save as\",\n\t\t\t\tid: \"SaveWorkspaceAs\",\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Blurs window. Pops up a dialog asking for a name for the new workspace.\n\t *\n\t * @memberof WorkspaceActions\n\t */\n\tcreateWorkspace() {\n\t\tWorkspaceManagementMenuActions.blurWindow();\n\t\tWorkspaceManagementMenuActions.newWorkspace();\n\t}\n\n\t/**\n\t * Blurs window. Persists activeWorkspace to the storage.\n\t *\n\t * @memberof WorkspaceActions\n\t */\n\tsaveWorkspace() {\n\t\tWorkspaceManagementMenuActions.blurWindow();\n\t\tWorkspaceManagementMenuActions.saveWorkspace();\n\t}\n\n\t/**\n\t * Blurs window. Pops up a dialog asking for a name for the new workspace.\n\t *\n\t * @memberof WorkspaceActions\n\t */\n\tsaveWorkspaceAs() {\n\t\tWorkspaceManagementMenuActions.blurWindow();\n\t\tWorkspaceManagementMenuActions.saveWorkspaceAs();\n\t}\n\n\tshowPreferences() {\n\t\tWorkspaceManagementMenuActions.blurWindow();\n\t\tWorkspaceManagementMenuActions.showPreferences();\n\t}\n\n\t/**\n\t * Render method.\n\t *\n\t * @returns\n\t * @memberof WorkspaceActions\n\t */\n\trender() {\n\t\t/**\n\t\t * Iterates through the list of actions defined in the constructor, creating an `li` for each.\n\t\t */\n\t\treturn (\n\t\t\t<div className=\"menu-secondary workspace-actions\">\n\t\t\t\t{this.userActions.map((action, index) => (\n\t\t\t\t\t<MenuItem key={index} onClick={action.method}>\n\t\t\t\t\t\t{action.label}\n\t\t\t\t\t</MenuItem>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceList.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/Wor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AE,qBAAqB,GAC3C,CACkB,CACrB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CACN,oBAAC,mBAAmB,IAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAC,gBAAgB,IACxE,UAAU,CACU,CACtB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\r\n * Copyright 2017 by ChartIQ, Inc.\r\n * All rights reserved.\r\n * This is a list of workspaces that the user can click on, loading them.\r\n */\r\nimport React from \"react\";\r\nimport Workspace from \"./Workspace\";\r\nimport { Actions } from \"../stores/workspaceManagementMenuStore\";\r\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\r\nimport { FinsembleDnDContext } from \"../../../legacyControls/FinsembleDnDContext\";\r\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\r\n\r\ninterface IProps {\r\n\tisSwitchingWorkspaces: boolean;\r\n\tactiveWorkspace: WorkspaceType;\r\n\tworkspaces: WorkspaceType[];\r\n}\r\n\r\ntype ReorderType = {\r\n\toldIndex: number;\r\n\tnewIndex: number;\r\n};\r\nexport default class WorkspaceList extends React.Component<IProps> {\r\n\tconstructor(props: IProps) {\r\n\t\tsuper(props);\r\n\t\tthis.onDragEnd = this.onDragEnd.bind(this);\r\n\t}\r\n\r\n\tonDragEnd({ oldIndex, newIndex }: ReorderType) {\r\n\t\tActions.reorderWorkspaceList({ oldIndex, newIndex });\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { isSwitchingWorkspaces, activeWorkspace } = this.props;\r\n\t\tlet workspaces = this.props.workspaces.map((workspace, i) => {\r\n\t\t\t// Separate array for each workspace. This way, the activeWorkspace can be rendered without a trashcan.\r\n\t\t\tlet isActiveWorkspace = workspace.name === activeWorkspace.name;\r\n\t\t\tconst dragHandle = { iconClass: \"ff-adp-hamburger\" };\r\n\r\n\t\t\treturn (\r\n\t\t\t\t<FinsembleDraggable index={i} key={i} draggableId={workspace.name}>\r\n\t\t\t\t\t<Workspace\r\n\t\t\t\t\t\tkey={i}\r\n\t\t\t\t\t\tisActiveWorkspace={isActiveWorkspace}\r\n\t\t\t\t\t\tdragHandle={dragHandle}\r\n\t\t\t\t\t\tworkspace={workspace}\r\n\t\t\t\t\t\tmainAction={Actions.switchToWorkspace}\r\n\t\t\t\t\t\tisSwitchingWorkspaces={isSwitchingWorkspaces}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FinsembleDraggable>\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn (\r\n\t\t\t<FinsembleDnDContext onDragEnd={this.onDragEnd} className=\"workspace-list\">\r\n\t\t\t\t{workspaces}\r\n\t\t\t</FinsembleDnDContext>\r\n\t\t);\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"WorkspaceList.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/WorkspaceList.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAalF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAiB;IACjE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAe;QAC5C,OAAO,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM;QACL,MAAM,EAAE,qBAAqB,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC9D,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE;YAE3D,IAAI,iBAAiB,GAAG,SAAS,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,CAAC;YAChE,MAAM,UAAU,GAAG,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;YAErD,OAAO,CACN,oBAAC,kBAAkB,IAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,IAAI;gBAChE,oBAAC,SAAS,IACT,GAAG,EAAE,CAAC,EACN,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,OAAO,CAAC,iBAAiB,EACrC,qBAAqB,EAAE,qBAAqB,GAC3C,CACkB,CACrB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CACN,oBAAC,mBAAmB,IAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAC,gBAAgB,IACxE,UAAU,CACU,CACtB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is a list of workspaces that the user can click on, loading them.\n */\nimport React from \"react\";\nimport Workspace from \"./Workspace\";\nimport { Actions } from \"../stores/workspaceManagementMenuStore\";\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\nimport { FinsembleDnDContext } from \"../../../legacyControls/FinsembleDnDContext\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\n\ninterface IProps {\n\tisSwitchingWorkspaces: boolean;\n\tactiveWorkspace: WorkspaceType;\n\tworkspaces: WorkspaceType[];\n}\n\ntype ReorderType = {\n\toldIndex: number;\n\tnewIndex: number;\n};\nexport default class WorkspaceList extends React.Component<IProps> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.onDragEnd = this.onDragEnd.bind(this);\n\t}\n\n\tonDragEnd({ oldIndex, newIndex }: ReorderType) {\n\t\tActions.reorderWorkspaceList({ oldIndex, newIndex });\n\t}\n\n\trender() {\n\t\tconst { isSwitchingWorkspaces, activeWorkspace } = this.props;\n\t\tlet workspaces = this.props.workspaces.map((workspace, i) => {\n\t\t\t// Separate array for each workspace. This way, the activeWorkspace can be rendered without a trashcan.\n\t\t\tlet isActiveWorkspace = workspace.name === activeWorkspace.name;\n\t\t\tconst dragHandle = { iconClass: \"ff-adp-hamburger\" };\n\n\t\t\treturn (\n\t\t\t\t<FinsembleDraggable index={i} key={i} draggableId={workspace.name}>\n\t\t\t\t\t<Workspace\n\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\tisActiveWorkspace={isActiveWorkspace}\n\t\t\t\t\t\tdragHandle={dragHandle}\n\t\t\t\t\t\tworkspace={workspace}\n\t\t\t\t\t\tmainAction={Actions.switchToWorkspace}\n\t\t\t\t\t\tisSwitchingWorkspaces={isSwitchingWorkspaces}\n\t\t\t\t\t/>\n\t\t\t\t</FinsembleDraggable>\n\t\t\t);\n\t\t});\n\n\t\treturn (\n\t\t\t<FinsembleDnDContext onDragEnd={this.onDragEnd} className=\"workspace-list\">\n\t\t\t\t{workspaces}\n\t\t\t</FinsembleDnDContext>\n\t\t);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"workspaceManagementMenuStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAmBjD,MAAM,wBAAwB,GAAG,QAAQ,CAAC;AAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,IAAI,wBAAoC,CAAC;AACzC,IA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,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EACN,YAAY,EACZ,8BAA8B,IAAI,WAAW,EAC7C,UAAU,EACV,wBAAwB,IAAI,KAAK,EACjC,OAAO,EACP,QAAQ,GACR,CAAC","sourcesContent":["/*!\r\n * Copyright 2017 by ChartIQ, Inc.\r\n * All rights reserved.\r\n * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html\r\n */\r\nimport async from \"async\";\r\nimport { Util } from \"@finsemble/finsemble-core\";\r\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\r\nimport { StandardCallback, StandardError } from \"@finsemble/finsemble-core/types/types\";\r\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\r\nimport { types } from \"@finsemble/finsemble-core\";\r\n\r\ntype StandardErrorCallback = types.StandardErrorCallback;\r\n\r\ntype UserInputResponseType = {\r\n\tchoice: string;\r\n\tvalue?: string;\r\n};\r\ntype SaveWorkspaceWaterfallParams = {\r\n\tworkspaceExists: boolean;\r\n\tworkspaceName: string;\r\n\ttemplate: any;\r\n};\r\n\r\n// When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.\r\nconst SAVE_DIALOG_CANCEL_ERROR = \"Cancel\";\r\nconst NEGATIVE = \"Negative\";\r\nlet PROMPT_ON_SAVE = false;\r\nlet WorkspaceManagementStore: StoreModel;\r\nlet StoreClient: any;\r\nlet Logger: any;\r\nlet WorkspaceManagementGlobalStore: StoreModel;\r\n\r\n// Initial data for the store.\r\nconst defaultData = {\r\n\tactiveWorkspace: {},\r\n\tmenuWidth: 285,\r\n\tWorkspaceList: [],\r\n\tnewWorkspaceDialogIsActive: false,\r\n\t/**\r\n\t * State around whether the workspace is currently in the process of switching.\r\n\t *\r\n\t * For simplicity, we're storing this in the local store for now, but this precludes\r\n\t * other components from signaling that the workspace is changing. A consequence,\r\n\t * for example, is that if you switch workspaces uses a pin on the toolbar instead\r\n\t * of the workspace management menu, the spinner doesn't show up.\r\n\t */\r\n\tisSwitchingWorkspaces: false,\r\n\tisPromptingUser: false,\r\n};\r\n\r\nconst Actions = {\r\n\tautoSave: (callback: StandardCallback) => {\r\n\t\tconst activeName = FSBL.Clients.WorkspaceClient.activeWorkspace?.name;\r\n\t\tif (!PROMPT_ON_SAVE) {\r\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\r\n\t\t\t\t{\r\n\t\t\t\t\tname: activeName,\r\n\t\t\t\t\tforce: true,\r\n\t\t\t\t},\r\n\t\t\t\t(err: StandardError) => {\r\n\t\t\t\t\tcallback(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tcallback(null);\r\n\t\t}\r\n\t},\r\n\tinitialize: () => {\r\n\t\t// Gets the workspace list and sets the value in the store.\r\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaces((err: StandardError, workspaces: WorkspaceType[]) => {\r\n\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getWorkspaces\", workspaces);\r\n\t\t\tWorkspaceManagementStore.setValue({\r\n\t\t\t\tfield: \"WorkspaceList\",\r\n\t\t\t\tvalue: workspaces,\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t// Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.\r\n\t\tFSBL.Clients.WorkspaceClient.getActiveWorkspace(\r\n\t\t\t(err: StandardError, activeWorkspace: { data: WorkspaceType } | undefined) => {\r\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getActiveWorkspace\", activeWorkspace);\r\n\t\t\t\tWorkspaceManagementStore.setValue({\r\n\t\t\t\t\tfield: \"activeWorkspace\",\r\n\t\t\t\t\tvalue: activeWorkspace,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\t/**\r\n\t\t * We listen here for any workspace updates, and pass them to the store.\r\n\t\t * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,\r\n\t\t * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for\r\n\t\t * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.\r\n\t\t */\r\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.update\", (err, response) => {\r\n\t\t\tif (response.data && response.data.activeWorkspace) {\r\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init update\", response.data);\r\n\t\t\t\tWorkspaceManagementStore.setValue({\r\n\t\t\t\t\tfield: \"activeWorkspace\",\r\n\t\t\t\t\tvalue: response.data.activeWorkspace,\r\n\t\t\t\t});\r\n\t\t\t\tWorkspaceManagementStore.setValue({\r\n\t\t\t\t\tfield: \"WorkspaceList\",\r\n\t\t\t\t\tvalue: response.data.workspacesConfig,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tWorkspaceManagementGlobalStore.getValue({ field: \"owner\" }, (err: StandardError, data?: string) => {\r\n\t\t\tif (data !== finsembleWindow.name) return;\r\n\t\t\tWorkspaceManagementGlobalStore.Dispatcher.register((action) => {\r\n\t\t\t\tswitch (action.actionType) {\r\n\t\t\t\t\tcase \"switchToWorkspace\":\r\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore switchToWorkspace\", action.data);\r\n\t\t\t\t\t\tActions.switchToWorkspace(action.data);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"reorderWorkspace\":\r\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore reorderWorkspace\", action.data);\r\n\t\t\t\t\t\tActions.reorderWorkspaceList(action.data);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"removeWorkspace\":\r\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore removeWorkspace\", action.data);\r\n\t\t\t\t\t\tActions.removeWorkspace(\r\n\t\t\t\t\t\t\taction.data as {\r\n\t\t\t\t\t\t\t\tname: string;\r\n\t\t\t\t\t\t\t\thideModalOnClose: boolean;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"renameWorkspace\":\r\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore renameWorkspace\", action.data);\r\n\t\t\t\t\t\tActions.renameWorkspace(action.data);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t// Nothing to do here\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t},\r\n\r\n\t/*********************************************************************************************\r\n\t *\r\n\t *\t\t\t\t\t\t\t\tGETTERS/SETTERS\r\n\t *\r\n\t *********************************************************************************************/\r\n\tgetActiveWorkspace: () => WorkspaceManagementStore.getValue(\"activeWorkspace\") as WorkspaceType,\r\n\r\n\t// Get the name of the workspace that is currently being edited\r\n\tgetWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue(\"workspaceBeingEdited\") as string,\r\n\r\n\tgetWorkspaceList: () => WorkspaceManagementStore.getValue(\"WorkspaceList\") as WorkspaceType[],\r\n\r\n\tgetIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue(\"isSwitchingWorkspaces\") as boolean,\r\n\r\n\tsetIsSwitchingWorkspaces: (val: boolean) =>\r\n\t\tWorkspaceManagementStore.setValue({\r\n\t\t\tfield: \"isSwitchingWorkspaces\",\r\n\t\t\tvalue: val,\r\n\t\t}),\r\n\r\n\tgetIsPromptingUser: () => WorkspaceManagementStore.getValue(\"isPromptingUser\") as boolean,\r\n\r\n\tsetIsPromptingUser: (val: boolean) =>\r\n\t\tWorkspaceManagementStore.setValue({\r\n\t\t\tfield: \"isPromptingUser\",\r\n\t\t\tvalue: val,\r\n\t\t}),\r\n\r\n\t/*********************************************************************************************\r\n\t *\r\n\t *\t\t\t\t\t\t\t\tMain Workspace Actions\r\n\t *\r\n\t *********************************************************************************************/\r\n\r\n\t/**\r\n\t * Handles the complete workflow for creating a new workspace.\r\n\t * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.\r\n\t */\r\n\tnewWorkspace: function () {\r\n\t\tlet newWorkspaceName: string;\r\n\t\tLogger.system.log(\"New workspace - start.\");\r\n\t\tconst newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue(\"newWorkspaceDialogIsActive\");\r\n\r\n\t\ttype createItParams = {\r\n\t\t\tworkspaceName: string;\r\n\t\t};\r\n\t\t// Creates the new workspace.\r\n\t\tconst createIt = (params: createItParams, cb?: StandardCallback) => {\r\n\t\t\tLogger.system.log(\"createIt\", params);\r\n\t\t\tconst { workspaceName } = params;\r\n\t\t\tFSBL.Clients.WorkspaceClient.createNewWorkspace(workspaceName, {}, (err, response) => {\r\n\t\t\t\tLogger.system.log(\"createIt createNewWorkspace response\", workspaceName, response);\r\n\t\t\t\tnewWorkspaceName = response.workspaceName;\r\n\t\t\t\tif (cb) {\r\n\t\t\t\t\tcb(null, newWorkspaceName);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (!newWorkspaceDialogIsActive) {\r\n\t\t\tWorkspaceManagementStore.setValue({\r\n\t\t\t\tfield: \"newWorkspaceDialogIsActive\",\r\n\t\t\t\tvalue: true,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tActions.blurWindow();\r\n\t\tlet tasks: Function[] = [\r\n\t\t\tActions.autoSave,\r\n\t\t\tActions.spawnWorkspaceInputField,\r\n\t\t\tActions.validateWorkspaceInput,\r\n\t\t\tActions.checkIfWorkspaceAlreadyExists,\r\n\t\t\tActions.askIfUserWantsNewWorkspace,\r\n\t\t\tcreateIt,\r\n\t\t];\r\n\t\tif (PROMPT_ON_SAVE) {\r\n\t\t\ttasks = ([Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse] as Function[]).concat(tasks);\r\n\t\t}\r\n\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\r\n\t},\r\n\r\n\t/**\r\n\t * Handles the workflow for removing a workspace.\r\n\t * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,\r\n\t * and if the user says \"yes\", it will delete the workspace.\r\n\t */\r\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n\tremoveWorkspace: (data: { name: string; hideModalOnClose?: boolean }, cb = (val: any) => {}) => {\r\n\t\tconst workspaceName = data.name;\r\n\r\n\t\tconst dialogParams = {\r\n\t\t\ttitle: \"Delete this workspace?\",\r\n\t\t\tquestion: `Are you sure you want to delete the workspace \"${workspaceName}\"?`,\r\n\t\t\tshowNegativeButton: false,\r\n\t\t\taffirmativeResponseLabel: \"Delete\",\r\n\t\t\thideModalOnClose: data.hideModalOnClose,\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Invoked when the user interacts with the dialog.\r\n\t\t */\r\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\r\n\t\t\tif (response.choice === \"affirmative\") {\r\n\t\t\t\tcb(true);\r\n\t\t\t\tFSBL.Clients.WorkspaceClient.remove({\r\n\t\t\t\t\tname: workspaceName,\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tcb(false);\r\n\t\t\t}\r\n\t\t}\r\n\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\r\n\t},\r\n\t/**\r\n\t * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.\r\n\t */\r\n\tsaveWorkspace: (cb?: StandardErrorCallback) => {\r\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\r\n\t\tFSBL.Clients.WorkspaceClient.saveAs(\r\n\t\t\t{\r\n\t\t\t\tforce: true,\r\n\t\t\t\tname: activeWorkspace.name,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tcb?.(null);\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\treorderWorkspaceList: ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\r\n\t\tlet workspaces: WorkspaceType[] = WorkspaceManagementStore.getValue<WorkspaceType[]>({\r\n\t\t\tfield: \"WorkspaceList\",\r\n\t\t});\r\n\t\tconst workspaceToMove = workspaces[oldIndex];\r\n\t\tworkspaces.splice(oldIndex, 1);\r\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\r\n\t\tconst workspacesWithExpectedStructure = workspaces.map((WSName) => {\r\n\t\t\treturn {\r\n\t\t\t\tname: WSName,\r\n\t\t\t};\r\n\t\t});\r\n\t\tFSBL.Clients.WorkspaceClient.setWorkspaces(\r\n\t\t\t{\r\n\t\t\t\tworkspaces: workspacesWithExpectedStructure,\r\n\t\t\t},\r\n\t\t\t() => {}\r\n\t\t);\r\n\t\tWorkspaceManagementStore.setValue({\r\n\t\t\tfield: \"WorkspaceList\",\r\n\t\t\tvalue: workspaces,\r\n\t\t});\r\n\t},\r\n\trenameWorkspace: ({ oldName, newName }: { oldName: string; newName: string }) => {\r\n\t\t// Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing\r\n\t\t// workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.\r\n\t\tFSBL.Clients.WorkspaceClient.rename({\r\n\t\t\toldName: oldName,\r\n\t\t\tnewName: newName,\r\n\t\t\tremoveOldWorkspace: true,\r\n\t\t\toverwriteExisting: true,\r\n\t\t});\r\n\t},\r\n\r\n\tshowPreferences: () => {\r\n\t\tFSBL.Clients.LauncherClient.showWindow(\r\n\t\t\t{\r\n\t\t\t\tcomponentType: \"UserPreferences\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tmonitor: \"mine\",\r\n\t\t\t\tleft: \"center\",\r\n\t\t\t\ttop: \"center\",\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t/**\r\n\t * Ask the user for a name, make sure it doesn't already exist, then save.\r\n\t */\r\n\tsaveWorkspaceAs: () => {\r\n\t\tfunction saveIt(workspaceName: string, callback: StandardErrorCallback) {\r\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\r\n\t\t\t\t{\r\n\t\t\t\t\tname: workspaceName,\r\n\t\t\t\t\tforce: true,\r\n\t\t\t\t},\r\n\t\t\t\t(err: StandardError, response: any) => {\r\n\t\t\t\t\tcallback(err, response);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tLogger.system.log(\"SaveWorkspaceAs clicked.\");\r\n\r\n\t\tasync.waterfall(\r\n\t\t\t[\r\n\t\t\t\tActions.autoSave,\r\n\t\t\t\tActions.spawnSaveAsDialog,\r\n\t\t\t\tActions.validateWorkspaceInput,\r\n\t\t\t\tActions.checkIfWorkspaceAlreadyExists,\r\n\t\t\t\tActions.askAboutOverwrite,\r\n\t\t\t\tsaveIt,\r\n\t\t\t],\r\n\t\t\tActions.onAsyncComplete\r\n\t\t);\r\n\t},\r\n\r\n\t/**\r\n\t * Asks the user if they'd like to save their data, then loads the requested workspace.\r\n\t */\r\n\tswitchToWorkspace: async function ({ name }: { name: string }) {\r\n\t\t// if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);\r\n\t\t// note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)\r\n\t\tconst prompting = Actions.getIsPromptingUser();\r\n\t\tLogger.system.log(\"workspaceManagementMenuStore: switchToWorkspace\", prompting ? \"prompting\" : \"not-prompting\");\r\n\t\tif (prompting) return;\r\n\r\n\t\tActions.setIsSwitchingWorkspaces(true);\r\n\t\tActions.blurWindow();\r\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\r\n\r\n\t\t/**\r\n\t\t * Actually perform the switch. Happens after we ask the user what they want.\r\n\t\t *\r\n\t\t */\r\n\t\tconst switchWorkspace = (callback = () => {}) => {\r\n\t\t\tFSBL.Clients.WorkspaceClient.switchTo(\r\n\t\t\t\t{\r\n\t\t\t\t\tname: name,\r\n\t\t\t\t},\r\n\t\t\t\t() => {\r\n\t\t\t\t\tActions.setIsSwitchingWorkspaces(false);\r\n\t\t\t\t\tcallback();\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Make sure the user is sure\r\n\t\t */\r\n\t\tconst askAboutReload = (callback: () => void) => {\r\n\t\t\tActions.spawnDialog(\r\n\t\t\t\t\"yesNo\",\r\n\t\t\t\t{\r\n\t\t\t\t\tmonitor: \"primary\",\r\n\t\t\t\t\ttitle: \"Save your workspace?\",\r\n\t\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\r\n\t\t\t\t\taffirmativeResponseLabel: \"Save\",\r\n\t\t\t\t\tnegativeResponseLabel: \"Don't Save\",\r\n\t\t\t\t},\r\n\t\t\t\tcallback\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * If the workspace is dirty, we need to do more than if it's clean.\r\n\t\t * We don't want users to lose unsaved work.\r\n\t\t */\r\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\r\n\t\t\tlet tasks: Function[] = [];\r\n\r\n\t\t\tActions.setIsPromptingUser(true);\r\n\t\t\tlet firstMethod: Function = Actions.autoSave,\r\n\t\t\t\tsecondMethod = null;\r\n\r\n\t\t\tif (PROMPT_ON_SAVE === true) {\r\n\t\t\t\t// We want to ask the user to save. But if they're trying to reload the workspace,\r\n\t\t\t\t// the message needs to be different. The first if block just switches that method.\r\n\t\t\t\tfirstMethod = Actions.askIfUserWantsToSave;\r\n\t\t\t\tif (name === FSBL.Clients.WorkspaceClient.activeWorkspace?.name) {\r\n\t\t\t\t\tfirstMethod = askAboutReload;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If we are not autosaving, we need to process the dialog input.\r\n\t\t\t\tsecondMethod = Actions.handleSaveDialogResponse;\r\n\t\t\t}\r\n\r\n\t\t\t// Build the task list.\r\n\t\t\ttasks = [firstMethod];\r\n\r\n\t\t\tif (secondMethod) {\r\n\t\t\t\ttasks.push(secondMethod);\r\n\t\t\t}\r\n\r\n\t\t\t// Switch is the last thing we do.\r\n\t\t\ttasks.push(switchWorkspace);\r\n\r\n\t\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\r\n\t\t} else {\r\n\t\t\tswitchWorkspace();\r\n\t\t}\r\n\t},\r\n\r\n\t/*********************************************************************************************\r\n\t *\r\n\t *\t\t\t\t\t\t\t\tWorkspace Management Helpers\r\n\t *\r\n\t *********************************************************************************************/\r\n\r\n\t/**\r\n\t * General handler for `async.series` and `async.waterfall`\r\n\t */\r\n\tonAsyncComplete(err?: Error | null) {\r\n\t\tLogger.system.debug(\"workspaceManagementMenuStore: onAsyncComplete\");\r\n\t\tWorkspaceManagementStore.setValue({\r\n\t\t\tfield: \"newWorkspaceDialogIsActive\",\r\n\t\t\tvalue: false,\r\n\t\t});\r\n\t\tconst errMessage = err?.message;\r\n\t\tif (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {\r\n\t\t\t// handle error.\r\n\t\t\tLogger.system.error(err);\r\n\t\t}\r\n\r\n\t\t// Unlock the UI.\r\n\t\tActions.setIsSwitchingWorkspaces(false);\r\n\t\tActions.setIsPromptingUser(false);\r\n\t},\r\n\r\n\t/**\r\n\t * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.\r\n\t *\r\n\t * @param {string} type \"yesNo\" or \"singleInput\"\r\n\t * @param {object} data Optional params for the dialog call.\r\n\t * @param {function} responseCallback invoked when the user interacts with the dialog.\r\n\t */\r\n\tspawnDialog(type: \"yesNo\" | \"singleInput\", data: any, responseCallback: StandardErrorCallback) {\r\n\t\tLogger.system.debug(\"spawnDialog\", type, data);\r\n\t\tif (type === \"singleInput\") {\r\n\t\t\tdata.showCancelButton = true;\r\n\t\t}\r\n\t\tFSBL.Clients.DialogManager.open(type, data, responseCallback);\r\n\t},\r\n\r\n\tspawnSaveAsDialog: (cb: StandardCallback) => {\r\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\r\n\t\t\tLogger.system.log(\"SpawnSaveAsDialog onUserInput\", response);\r\n\t\t\tlet callbackError: Error | null = null;\r\n\t\t\tif (typeof err === \"string\") {\r\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\r\n\t\t\t\tcallbackError = new Error(err);\r\n\t\t\t}\r\n\t\t\tif (cb) {\r\n\t\t\t\tcb(callbackError || err, response);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst dialogParams = {\r\n\t\t\ttitle: \"Enter a name for your new workspace.\",\r\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\r\n\t\t\taffirmativeResponseLabel: \"Confirm\",\r\n\t\t\tshowCancelButton: false,\r\n\t\t\tshowNegativeButton: false,\r\n\t\t};\r\n\r\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\r\n\t},\r\n\r\n\t/**\r\n\t * Spawns an input field asking what the user would like to name their new workspace.\r\n\t */\r\n\tspawnWorkspaceInputField: (cb: StandardCallback) => {\r\n\t\t// Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.\r\n\t\tLogger.system.log(\"SpawnWorkspaceInput - start\");\r\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\r\n\t\t\tLogger.system.log(\"SpawnWorkspaceInput onUserInput\", response);\r\n\t\t\tlet callbackError: Error | null = null;\r\n\t\t\tif (typeof err === \"string\") {\r\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\r\n\t\t\t\tcallbackError = new Error(err);\r\n\t\t\t}\r\n\t\t\tif (cb) {\r\n\t\t\t\tcb(callbackError || err, response);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst dialogParams = {\r\n\t\t\ttitle: \"Enter a name for your new workspace.\",\r\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\r\n\t\t\taffirmativeResponseLabel: \"Confirm\",\r\n\t\t\tshowCancelButton: false,\r\n\t\t\tshowNegativeButton: false,\r\n\t\t};\r\n\r\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\r\n\t},\r\n\r\n\t/**\r\n\t * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.\r\n\t */\r\n\taskIfUserWantsToSave: async function (callback: StandardCallback) {\r\n\t\tconst activeWorkspace: WorkspaceType = WorkspaceManagementStore.getValue(\"activeWorkspace\");\r\n\r\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\r\n\t\t\tLogger.system.log(\"NewWorkspace.spawnDialog start.\");\r\n\t\t\tconst dialogParams = {\r\n\t\t\t\tmonitor: \"primary\",\r\n\t\t\t\ttitle: \"Save your workspace?\",\r\n\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\r\n\t\t\t\taffirmativeResponseLabel: \"Save\",\r\n\t\t\t\tnegativeResponseLabel: \"Don't Save\",\r\n\t\t\t};\r\n\t\t\tconst waitForUserInput = () =>\r\n\t\t\t\tnew Promise((resolve) => {\r\n\t\t\t\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\r\n\t\t\t\t\t\tLogger.system.log(\"Spawn Dialog callback.\");\r\n\t\t\t\t\t\tif (callback) callback(null, response);\r\n\t\t\t\t\t\tresolve(response);\r\n\t\t\t\t\t};\r\n\t\t\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\r\n\t\t\t\t});\r\n\t\t\treturn await waitForUserInput();\r\n\t\t} else {\r\n\t\t\t// In this case the workspace is not dirty, so we don't need to save.\r\n\t\t\tif (callback) callback(null, { choice: \"negative\" });\r\n\t\t\treturn { choice: \"negative\" };\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Handles the response from the dialog asking if the user wants to save their workspace.\r\n\t *\r\n\t * @param {any} response\r\n\t * @param {any} callback\r\n\t */\r\n\thandleSaveDialogResponse(response: UserInputResponseType, callback: StandardErrorCallback) {\r\n\t\tif (response.choice === \"affirmative\") {\r\n\t\t\t// User wants to save, so call the client API.\r\n\t\t\tActions.saveWorkspace(callback);\r\n\t\t} else if (response.choice === \"negative\") {\r\n\t\t\t// Doesn't want to save.\r\n\t\t\tcallback(null);\r\n\t\t} else {\r\n\t\t\t// choice === cancel\r\n\t\t\tcallback(new Error(SAVE_DIALOG_CANCEL_ERROR));\r\n\t\t}\r\n\t},\r\n\t/**\r\n\t * Makes sure the user has input a valid workspace name.\r\n\t */\r\n\tvalidateWorkspaceInput(response: UserInputResponseType, callback: StandardErrorCallback) {\r\n\t\tLogger.system.log(\"spawnWorkspaceInput\", response);\r\n\t\t// If user wants to proceed but gave an invalid name, tell them that they messed up, then die.\r\n\t\tif (response.choice !== \"cancel\" && (!response.value || response.value === \"\")) {\r\n\t\t\tlet dialogParams = {\r\n\t\t\t\ttitle: \"Invalid Workspace Name\",\r\n\t\t\t\tquestion: \"Workspace names must contain letters or numbers. Please try again.\",\r\n\t\t\t\taffirmativeResponseLabel: \"OK\",\r\n\t\t\t\tshowNegativeButton: false,\r\n\t\t\t\tshowCancelButton: false,\r\n\t\t\t};\r\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, () => {});\r\n\t\t\treturn callback(new Error(\"Invalid workspace name.\"));\r\n\t\t} else if (response.choice === \"cancel\") {\r\n\t\t\treturn callback(new Error(SAVE_DIALOG_CANCEL_ERROR));\r\n\t\t}\r\n\t\tcallback(null, response);\r\n\t},\r\n\r\n\taskAboutOverwrite(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\r\n\t\tconst { workspaceExists, workspaceName } = params;\r\n\t\tconst dialogParams = {\r\n\t\t\ttitle: \"Overwrite Workspace?\",\r\n\t\t\tquestion: `This will overwrite the saved data for \"${workspaceName}\". Would you like to proceed?`,\r\n\t\t\taffirmativeResponseLabel: \"Overwrite\",\r\n\t\t\tshowNegativeButton: false,\r\n\t\t};\r\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\r\n\t\t\tif (response.choice === \"affirmative\") {\r\n\t\t\t\tcallback(null, workspaceName);\r\n\t\t\t} else {\r\n\t\t\t\tcallback(new Error(NEGATIVE));\r\n\t\t\t}\r\n\t\t};\r\n\t\tif (workspaceExists) {\r\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\r\n\t\t} else {\r\n\t\t\tcallback(null, workspaceName);\r\n\t\t}\r\n\t},\r\n\taskIfUserWantsNewWorkspace(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\r\n\t\tlet { workspaceExists, workspaceName, template } = params;\r\n\r\n\t\tlet dialogParams = {\r\n\t\t\ttitle: \"New workspace\",\r\n\t\t\tquestion: `The workspace \"${workspaceName}\" already exists. A new workspace with a modified name will be created.`,\r\n\t\t\taffirmativeResponseLabel: \"OK\",\r\n\t\t\tshowNegativeButton: false,\r\n\t\t};\r\n\r\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\r\n\t\t\tif (response.choice === \"affirmative\") {\r\n\t\t\t\tcallback(null, { workspaceName, template });\r\n\t\t\t} else {\r\n\t\t\t\tcallback(new Error(NEGATIVE));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (workspaceExists) {\r\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\r\n\t\t} else {\r\n\t\t\tcallback(null, { workspaceName, template });\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.\r\n\t */\r\n\tcheckIfWorkspaceAlreadyExists(response: any, callback: StandardErrorCallback) {\r\n\t\tconst workspaceName = response.value;\r\n\t\tconst camelCaseWorkspaceName = Util.camelCase(workspaceName);\r\n\t\t// Do any of the workspaces have the same name that the user is trying to input.\r\n\t\tconst workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some(\r\n\t\t\t(workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName\r\n\t\t);\r\n\t\tcallback(null, {\r\n\t\t\tworkspaceExists,\r\n\t\t\tworkspaceName,\r\n\t\t\ttemplate: response.template,\r\n\t\t});\r\n\t},\r\n\t/*********************************************************************************************\r\n\t *\r\n\t *\t\t\t\t\t\t\t\tMisc functionality\r\n\t *\r\n\t *********************************************************************************************/\r\n\t/**\r\n\t * Un-focuses from the menu.\r\n\t */\r\n\tblurWindow: function () {\r\n\t\tfinsembleWindow.blur();\r\n\t},\r\n};\r\n\r\nfunction createLocalStore(done: () => void) {\r\n\tStoreClient.createStore(\r\n\t\t{ store: \"Finsemble-WorkspaceMenu-Local-Store\", values: defaultData },\r\n\t\t(err: StandardError, store: StoreModel) => {\r\n\t\t\tWorkspaceManagementStore = store;\r\n\t\t\tdone();\r\n\t\t}\r\n\t);\r\n}\r\n\r\nfunction createGlobalStore(done: () => void) {\r\n\tStoreClient.createStore(\r\n\t\t{\r\n\t\t\tstore: \"Finsemble-WorkspaceMenu-Global-Store\",\r\n\t\t\tglobal: true,\r\n\t\t\tvalues: { owner: finsembleWindow.name },\r\n\t\t},\r\n\t\t(err: StandardError, store: StoreModel) => {\r\n\t\t\tWorkspaceManagementGlobalStore = store;\r\n\t\t\tdone();\r\n\t\t}\r\n\t);\r\n}\r\n\r\nfunction getPreferences(done: () => void) {\r\n\tFSBL.Clients.ConfigClient.getValue(\r\n\t\t{\r\n\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\r\n\t\t},\r\n\t\t(err: StandardError, data?: boolean | null) => {\r\n\t\t\tlet prompt = data;\r\n\t\t\t// default to false.\r\n\t\t\tPROMPT_ON_SAVE = prompt === null || prompt === undefined ? PROMPT_ON_SAVE : prompt;\r\n\t\t\tdone();\r\n\t\t}\r\n\t);\r\n}\r\n\r\n/**\r\n * Initializes the store for the Workspace Management Menu.\r\n */\r\nfunction initialize(cb: any) {\r\n\tStoreClient = FSBL.Clients.DistributedStoreClient;\r\n\t// eslint-disable-next-line prefer-destructuring\r\n\tLogger = FSBL.Clients.Logger;\r\n\tasync.parallel([createGlobalStore, createLocalStore, getPreferences], () => {\r\n\t\tActions.initialize();\r\n\t\tcb(WorkspaceManagementStore);\r\n\t});\r\n}\r\n\r\nlet getStore = () => WorkspaceManagementStore;\r\n\r\n/**\r\n * This is a quick little initialization manager that Terry hacked up.\r\n * Ultimately everything in this file should be rewritten in hooks/redux pattern.\r\n */\r\nclass StoreManager {\r\n\tinitialized: boolean;\r\n\r\n\tinitializing: boolean;\r\n\r\n\tcallbacks: Function[];\r\n\r\n\tstore: StoreModel | null;\r\n\r\n\tconstructor() {\r\n\t\tthis.initialized = false;\r\n\t\tthis.initializing = false;\r\n\t\tthis.callbacks = [];\r\n\t\tthis.store = null;\r\n\t}\r\n\r\n\tinitialize() {\r\n\t\tif (this.initializing) return;\r\n\t\tthis.initializing = true;\r\n\t\tinitialize((store: StoreModel) => {\r\n\t\t\tthis.initialized = true;\r\n\t\t\tthis.store = store;\r\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\r\n\t\t});\r\n\t}\r\n\r\n\taddInitializedListener(cb: (store: StoreModel) => void) {\r\n\t\tif (this.initialized && this.store !== null) return cb(this.store);\r\n\t\tthis.callbacks.push(cb);\r\n\t}\r\n\r\n\tremoveInitializedListener(cb: Function) {\r\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\r\n\t}\r\n}\r\nconst storeManager = new StoreManager();\r\n\r\nexport {\r\n\tstoreManager,\r\n\tWorkspaceManagementGlobalStore as GlobalStore,\r\n\tinitialize,\r\n\tWorkspaceManagementStore as Store,\r\n\tActions,\r\n\tgetStore,\r\n};\r\n"]}
1
+ {"version":3,"file":"workspaceManagementMenuStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,E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AAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EACN,YAAY,EACZ,8BAA8B,IAAI,WAAW,EAC7C,UAAU,EACV,wBAAwB,IAAI,KAAK,EACjC,OAAO,EACP,QAAQ,GACR,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * The workspace management menu may be the most complicated component that we have (other than the toolbar). It isn't because workspace management is particularly difficult, it's because there is a lot of user question and answer going on. We don't want to overwrite data without explicit consent, and so the calls get involved. To simplify the code, we are using the `async` library. If you are unfamiliar with this library, see this link: https://caolan.github.io/async/docs.html\n */\nimport async from \"async\";\nimport { Util } from \"@finsemble/finsemble-core\";\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\nimport { StandardCallback, StandardError } from \"@finsemble/finsemble-core/types/types\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-core/src/common/workspace\";\nimport { types } from \"@finsemble/finsemble-core\";\n\ntype StandardErrorCallback = types.StandardErrorCallback;\n\ntype UserInputResponseType = {\n\tchoice: string;\n\tvalue?: string;\n};\ntype SaveWorkspaceWaterfallParams = {\n\tworkspaceExists: boolean;\n\tworkspaceName: string;\n\ttemplate: any;\n};\n\n// When a user cancels the save workspace dialog, we throw an error, which short-circuits the async call.\nconst SAVE_DIALOG_CANCEL_ERROR = \"Cancel\";\nconst NEGATIVE = \"Negative\";\nlet PROMPT_ON_SAVE = false;\nlet WorkspaceManagementStore: StoreModel;\nlet StoreClient: any;\nlet Logger: any;\nlet WorkspaceManagementGlobalStore: StoreModel;\n\n// Initial data for the store.\nconst defaultData = {\n\tactiveWorkspace: {},\n\tmenuWidth: 285,\n\tWorkspaceList: [],\n\tnewWorkspaceDialogIsActive: false,\n\t/**\n\t * State around whether the workspace is currently in the process of switching.\n\t *\n\t * For simplicity, we're storing this in the local store for now, but this precludes\n\t * other components from signaling that the workspace is changing. A consequence,\n\t * for example, is that if you switch workspaces uses a pin on the toolbar instead\n\t * of the workspace management menu, the spinner doesn't show up.\n\t */\n\tisSwitchingWorkspaces: false,\n\tisPromptingUser: false,\n};\n\nconst Actions = {\n\tautoSave: (callback: StandardCallback) => {\n\t\tconst activeName = FSBL.Clients.WorkspaceClient.activeWorkspace?.name;\n\t\tif (!PROMPT_ON_SAVE) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: activeName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError) => {\n\t\t\t\t\tcallback(err);\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tcallback(null);\n\t\t}\n\t},\n\tinitialize: () => {\n\t\t// Gets the workspace list and sets the value in the store.\n\t\tFSBL.Clients.WorkspaceClient.getWorkspaces((err: StandardError, workspaces: WorkspaceType[]) => {\n\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getWorkspaces\", workspaces);\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\tvalue: workspaces,\n\t\t\t});\n\t\t});\n\n\t\t// Get the activeWorkspace and set the value. I could have iterated through the workspaces above and found the active one, but this seems simpler.\n\t\tFSBL.Clients.WorkspaceClient.getActiveWorkspace(\n\t\t\t(err: StandardError, activeWorkspace: { data: WorkspaceType } | undefined) => {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init getActiveWorkspace\", activeWorkspace);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: activeWorkspace,\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t/**\n\t\t * We listen here for any workspace updates, and pass them to the store.\n\t\t * **NOTE**: You may notice that the signature of this callback is different from the previous ones. In this case,\n\t\t * we receive a `response`, instead of `workspaces` or `activeWorkspace`. This is because this callback is for\n\t\t * a `RouterClient` message. The functions above are callbacks to `WorkspaceClient` API calls.\n\t\t */\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.update\", (err, response) => {\n\t\t\tif (response.data && response.data.activeWorkspace) {\n\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore init update\", response.data);\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"activeWorkspace\",\n\t\t\t\t\tvalue: response.data.activeWorkspace,\n\t\t\t\t});\n\t\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\t\tfield: \"WorkspaceList\",\n\t\t\t\t\tvalue: response.data.workspacesConfig,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tWorkspaceManagementGlobalStore.getValue({ field: \"owner\" }, (err: StandardError, data?: string) => {\n\t\t\tif (data !== finsembleWindow.name) return;\n\t\t\tWorkspaceManagementGlobalStore.Dispatcher.register((action) => {\n\t\t\t\tswitch (action.actionType) {\n\t\t\t\t\tcase \"switchToWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore switchToWorkspace\", action.data);\n\t\t\t\t\t\tActions.switchToWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reorderWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore reorderWorkspace\", action.data);\n\t\t\t\t\t\tActions.reorderWorkspaceList(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"removeWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore removeWorkspace\", action.data);\n\t\t\t\t\t\tActions.removeWorkspace(\n\t\t\t\t\t\t\taction.data as {\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\thideModalOnClose: boolean;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"renameWorkspace\":\n\t\t\t\t\t\tLogger.system.debug(\"WorkspaceManagementStore renameWorkspace\", action.data);\n\t\t\t\t\t\tActions.renameWorkspace(action.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Nothing to do here\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tGETTERS/SETTERS\n\t *\n\t *********************************************************************************************/\n\tgetActiveWorkspace: () => WorkspaceManagementStore.getValue(\"activeWorkspace\") as WorkspaceType,\n\n\t// Get the name of the workspace that is currently being edited\n\tgetWorkspaceBeingEdited: () => WorkspaceManagementStore.getValue(\"workspaceBeingEdited\") as string,\n\n\tgetWorkspaceList: () => WorkspaceManagementStore.getValue(\"WorkspaceList\") as WorkspaceType[],\n\n\tgetIsSwitchingWorkspaces: () => WorkspaceManagementStore.getValue(\"isSwitchingWorkspaces\") as boolean,\n\n\tsetIsSwitchingWorkspaces: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isSwitchingWorkspaces\",\n\t\t\tvalue: val,\n\t\t}),\n\n\tgetIsPromptingUser: () => WorkspaceManagementStore.getValue(\"isPromptingUser\") as boolean,\n\n\tsetIsPromptingUser: (val: boolean) =>\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"isPromptingUser\",\n\t\t\tvalue: val,\n\t\t}),\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMain Workspace Actions\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * Handles the complete workflow for creating a new workspace.\n\t * We make sure the user doesn't lose any unsaved work, ask them to name it, make sure that workspace doesn't already exist, then actually save the new workspace. After that, we fire off a notification to let them know that everything was a great success.\n\t */\n\tnewWorkspace: function () {\n\t\tlet newWorkspaceName: string;\n\t\tLogger.system.log(\"New workspace - start.\");\n\t\tconst newWorkspaceDialogIsActive = WorkspaceManagementStore.getValue(\"newWorkspaceDialogIsActive\");\n\n\t\ttype createItParams = {\n\t\t\tworkspaceName: string;\n\t\t};\n\t\t// Creates the new workspace.\n\t\tconst createIt = (params: createItParams, cb?: StandardCallback) => {\n\t\t\tLogger.system.log(\"createIt\", params);\n\t\t\tconst { workspaceName } = params;\n\t\t\tFSBL.Clients.WorkspaceClient.createNewWorkspace(workspaceName, {}, (err, response) => {\n\t\t\t\tLogger.system.log(\"createIt createNewWorkspace response\", workspaceName, response);\n\t\t\t\tnewWorkspaceName = response.workspaceName;\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(null, newWorkspaceName);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (!newWorkspaceDialogIsActive) {\n\t\t\tWorkspaceManagementStore.setValue({\n\t\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\t\tvalue: true,\n\t\t\t});\n\t\t}\n\n\t\tActions.blurWindow();\n\t\tlet tasks: Function[] = [\n\t\t\tActions.autoSave,\n\t\t\tActions.spawnWorkspaceInputField,\n\t\t\tActions.validateWorkspaceInput,\n\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\tActions.askIfUserWantsNewWorkspace,\n\t\t\tcreateIt,\n\t\t];\n\t\tif (PROMPT_ON_SAVE) {\n\t\t\ttasks = ([Actions.askIfUserWantsToSave, Actions.handleSaveDialogResponse] as Function[]).concat(tasks);\n\t\t}\n\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t},\n\n\t/**\n\t * Handles the workflow for removing a workspace.\n\t * As long as you are not deleting the workspace that is active, it will pop up a confirm dialog,\n\t * and if the user says \"yes\", it will delete the workspace.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tremoveWorkspace: (data: { name: string; hideModalOnClose?: boolean }, cb = (val: any) => {}) => {\n\t\tconst workspaceName = data.name;\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Delete this workspace?\",\n\t\t\tquestion: `Are you sure you want to delete the workspace \"${workspaceName}\"?`,\n\t\t\tshowNegativeButton: false,\n\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\thideModalOnClose: data.hideModalOnClose,\n\t\t};\n\n\t\t/**\n\t\t * Invoked when the user interacts with the dialog.\n\t\t */\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcb(true);\n\t\t\t\tFSBL.Clients.WorkspaceClient.remove({\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcb(false);\n\t\t\t}\n\t\t}\n\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t},\n\t/**\n\t * The `activeWorkspace` is simply a copy of something we brought out of storage. This function copies the `activeWorkspace` to back to storage.\n\t */\n\tsaveWorkspace: (cb?: StandardErrorCallback) => {\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t{\n\t\t\t\tforce: true,\n\t\t\t\tname: activeWorkspace.name,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tcb?.(null);\n\t\t\t}\n\t\t);\n\t},\n\treorderWorkspaceList: ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tlet workspaces: WorkspaceType[] = WorkspaceManagementStore.getValue<WorkspaceType[]>({\n\t\t\tfield: \"WorkspaceList\",\n\t\t});\n\t\tconst workspaceToMove = workspaces[oldIndex];\n\t\tworkspaces.splice(oldIndex, 1);\n\t\tworkspaces.splice(newIndex, 0, workspaceToMove);\n\t\tconst workspacesWithExpectedStructure = workspaces.map((WSName) => {\n\t\t\treturn {\n\t\t\t\tname: WSName,\n\t\t\t};\n\t\t});\n\t\tFSBL.Clients.WorkspaceClient.setWorkspaces(\n\t\t\t{\n\t\t\t\tworkspaces: workspacesWithExpectedStructure,\n\t\t\t},\n\t\t\t() => {}\n\t\t);\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"WorkspaceList\",\n\t\t\tvalue: workspaces,\n\t\t});\n\t},\n\trenameWorkspace: ({ oldName, newName }: { oldName: string; newName: string }) => {\n\t\t// Note: This does no checking of the workspace before renaming. If you call this function, and `newName` is an existing\n\t\t// workspace name, the existing workspace will get stomped. Currently, the UI prevents renaming to existing names.\n\t\tFSBL.Clients.WorkspaceClient.rename({\n\t\t\toldName: oldName,\n\t\t\tnewName: newName,\n\t\t\tremoveOldWorkspace: true,\n\t\t\toverwriteExisting: true,\n\t\t});\n\t},\n\n\tshowPreferences: () => {\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Ask the user for a name, make sure it doesn't already exist, then save.\n\t */\n\tsaveWorkspaceAs: () => {\n\t\tfunction saveIt(workspaceName: string, callback: StandardErrorCallback) {\n\t\t\tFSBL.Clients.WorkspaceClient.saveAs(\n\t\t\t\t{\n\t\t\t\t\tname: workspaceName,\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t(err: StandardError, response: any) => {\n\t\t\t\t\tcallback(err, response);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tLogger.system.log(\"SaveWorkspaceAs clicked.\");\n\n\t\tasync.waterfall(\n\t\t\t[\n\t\t\t\tActions.autoSave,\n\t\t\t\tActions.spawnSaveAsDialog,\n\t\t\t\tActions.validateWorkspaceInput,\n\t\t\t\tActions.checkIfWorkspaceAlreadyExists,\n\t\t\t\tActions.askAboutOverwrite,\n\t\t\t\tsaveIt,\n\t\t\t],\n\t\t\tActions.onAsyncComplete\n\t\t);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their data, then loads the requested workspace.\n\t */\n\tswitchToWorkspace: async function ({ name }: { name: string }) {\n\t\t// if a workspace prompt is outstanding for a previous switch, immediately return to lock out user from doing another switch (until responding to prompt);\n\t\t// note this prompting flag is cleared in Actions.onAsyncComplete when the previous switch completes (after user responds to the prompt)\n\t\tconst prompting = Actions.getIsPromptingUser();\n\t\tLogger.system.log(\"workspaceManagementMenuStore: switchToWorkspace\", prompting ? \"prompting\" : \"not-prompting\");\n\t\tif (prompting) return;\n\n\t\tActions.setIsSwitchingWorkspaces(true);\n\t\tActions.blurWindow();\n\t\tconst activeWorkspace = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\t/**\n\t\t * Actually perform the switch. Happens after we ask the user what they want.\n\t\t *\n\t\t */\n\t\tconst switchWorkspace = (callback = () => {}) => {\n\t\t\tFSBL.Clients.WorkspaceClient.switchTo(\n\t\t\t\t{\n\t\t\t\t\tname: name,\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tActions.setIsSwitchingWorkspaces(false);\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * Make sure the user is sure\n\t\t */\n\t\tconst askAboutReload = (callback: () => void) => {\n\t\t\tActions.spawnDialog(\n\t\t\t\t\"yesNo\",\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"primary\",\n\t\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t\t},\n\t\t\t\tcallback\n\t\t\t);\n\t\t};\n\n\t\t/**\n\t\t * If the workspace is dirty, we need to do more than if it's clean.\n\t\t * We don't want users to lose unsaved work.\n\t\t */\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tlet tasks: Function[] = [];\n\n\t\t\tActions.setIsPromptingUser(true);\n\t\t\tlet firstMethod: Function = Actions.autoSave,\n\t\t\t\tsecondMethod = null;\n\n\t\t\tif (PROMPT_ON_SAVE === true) {\n\t\t\t\t// We want to ask the user to save. But if they're trying to reload the workspace,\n\t\t\t\t// the message needs to be different. The first if block just switches that method.\n\t\t\t\tfirstMethod = Actions.askIfUserWantsToSave;\n\t\t\t\tif (name === FSBL.Clients.WorkspaceClient.activeWorkspace?.name) {\n\t\t\t\t\tfirstMethod = askAboutReload;\n\t\t\t\t}\n\n\t\t\t\t// If we are not autosaving, we need to process the dialog input.\n\t\t\t\tsecondMethod = Actions.handleSaveDialogResponse;\n\t\t\t}\n\n\t\t\t// Build the task list.\n\t\t\ttasks = [firstMethod];\n\n\t\t\tif (secondMethod) {\n\t\t\t\ttasks.push(secondMethod);\n\t\t\t}\n\n\t\t\t// Switch is the last thing we do.\n\t\t\ttasks.push(switchWorkspace);\n\n\t\t\tasync.waterfall(tasks, Actions.onAsyncComplete);\n\t\t} else {\n\t\t\tswitchWorkspace();\n\t\t}\n\t},\n\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tWorkspace Management Helpers\n\t *\n\t *********************************************************************************************/\n\n\t/**\n\t * General handler for `async.series` and `async.waterfall`\n\t */\n\tonAsyncComplete(err?: Error | null) {\n\t\tLogger.system.debug(\"workspaceManagementMenuStore: onAsyncComplete\");\n\t\tWorkspaceManagementStore.setValue({\n\t\t\tfield: \"newWorkspaceDialogIsActive\",\n\t\t\tvalue: false,\n\t\t});\n\t\tconst errMessage = err?.message;\n\t\tif (errMessage && errMessage !== NEGATIVE && errMessage !== SAVE_DIALOG_CANCEL_ERROR) {\n\t\t\t// handle error.\n\t\t\tLogger.system.error(err);\n\t\t}\n\n\t\t// Unlock the UI.\n\t\tActions.setIsSwitchingWorkspaces(false);\n\t\tActions.setIsPromptingUser(false);\n\t},\n\n\t/**\n\t * Helper for spawning dialogs. Keeps the internals of other functions squeaky clean.\n\t *\n\t * @param {string} type \"yesNo\" or \"singleInput\"\n\t * @param {object} data Optional params for the dialog call.\n\t * @param {function} responseCallback invoked when the user interacts with the dialog.\n\t */\n\tspawnDialog(type: \"yesNo\" | \"singleInput\", data: any, responseCallback: StandardErrorCallback) {\n\t\tLogger.system.debug(\"spawnDialog\", type, data);\n\t\tif (type === \"singleInput\") {\n\t\t\tdata.showCancelButton = true;\n\t\t}\n\t\tFSBL.Clients.DialogManager.open(type, data, responseCallback);\n\t},\n\n\tspawnSaveAsDialog: (cb: StandardCallback) => {\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnSaveAsDialog onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Spawns an input field asking what the user would like to name their new workspace.\n\t */\n\tspawnWorkspaceInputField: (cb: StandardCallback) => {\n\t\t// Spawns the dialog with the input field and accepts a callback to be invoked after the user acts.\n\t\tLogger.system.log(\"SpawnWorkspaceInput - start\");\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tLogger.system.log(\"SpawnWorkspaceInput onUserInput\", response);\n\t\t\tlet callbackError: Error | null = null;\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\t// Error objects cause async to invoke the final callback in async.waterfall.\n\t\t\t\tcallbackError = new Error(err);\n\t\t\t}\n\t\t\tif (cb) {\n\t\t\t\tcb(callbackError || err, response);\n\t\t\t}\n\t\t};\n\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Enter a name for your new workspace.\",\n\t\t\tinputLabel: \"Enter a name for your new workspace.\",\n\t\t\taffirmativeResponseLabel: \"Confirm\",\n\t\t\tshowCancelButton: false,\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tActions.spawnDialog(\"singleInput\", dialogParams, onUserInput);\n\t},\n\n\t/**\n\t * Asks the user if they'd like to save their workspace if it's different from what's in storage. If the workspace is clean, we just invoke the callback.\n\t */\n\taskIfUserWantsToSave: async function (callback: StandardCallback) {\n\t\tconst activeWorkspace: WorkspaceType = WorkspaceManagementStore.getValue(\"activeWorkspace\");\n\n\t\tif (await FSBL.Clients.WorkspaceClient.isWorkspaceDirty()) {\n\t\t\tLogger.system.log(\"NewWorkspace.spawnDialog start.\");\n\t\t\tconst dialogParams = {\n\t\t\t\tmonitor: \"primary\",\n\t\t\t\ttitle: \"Save your workspace?\",\n\t\t\t\tquestion: `\\\"${activeWorkspace.name}\\\" has unsaved changes. Would you like to save?`,\n\t\t\t\taffirmativeResponseLabel: \"Save\",\n\t\t\t\tnegativeResponseLabel: \"Don't Save\",\n\t\t\t};\n\t\t\tconst waitForUserInput = () =>\n\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\t\t\t\tLogger.system.log(\"Spawn Dialog callback.\");\n\t\t\t\t\t\tif (callback) callback(null, response);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t};\n\t\t\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t\t\t});\n\t\t\treturn await waitForUserInput();\n\t\t} else {\n\t\t\t// In this case the workspace is not dirty, so we don't need to save.\n\t\t\tif (callback) callback(null, { choice: \"negative\" });\n\t\t\treturn { choice: \"negative\" };\n\t\t}\n\t},\n\n\t/**\n\t * Handles the response from the dialog asking if the user wants to save their workspace.\n\t *\n\t * @param {any} response\n\t * @param {any} callback\n\t */\n\thandleSaveDialogResponse(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tif (response.choice === \"affirmative\") {\n\t\t\t// User wants to save, so call the client API.\n\t\t\tActions.saveWorkspace(callback);\n\t\t} else if (response.choice === \"negative\") {\n\t\t\t// Doesn't want to save.\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\t// choice === cancel\n\t\t\tcallback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t},\n\t/**\n\t * Makes sure the user has input a valid workspace name.\n\t */\n\tvalidateWorkspaceInput(response: UserInputResponseType, callback: StandardErrorCallback) {\n\t\tLogger.system.log(\"spawnWorkspaceInput\", response);\n\t\t// If user wants to proceed but gave an invalid name, tell them that they messed up, then die.\n\t\tif (response.choice !== \"cancel\" && (!response.value || response.value === \"\")) {\n\t\t\tlet dialogParams = {\n\t\t\t\ttitle: \"Invalid Workspace Name\",\n\t\t\t\tquestion: \"Workspace names must contain letters or numbers. Please try again.\",\n\t\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t\tshowCancelButton: false,\n\t\t\t};\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, () => {});\n\t\t\treturn callback(new Error(\"Invalid workspace name.\"));\n\t\t} else if (response.choice === \"cancel\") {\n\t\t\treturn callback(new Error(SAVE_DIALOG_CANCEL_ERROR));\n\t\t}\n\t\tcallback(null, response);\n\t},\n\n\taskAboutOverwrite(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tconst { workspaceExists, workspaceName } = params;\n\t\tconst dialogParams = {\n\t\t\ttitle: \"Overwrite Workspace?\",\n\t\t\tquestion: `This will overwrite the saved data for \"${workspaceName}\". Would you like to proceed?`,\n\t\t\taffirmativeResponseLabel: \"Overwrite\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\t\tconst onUserInput = (err: StandardError, response: UserInputResponseType) => {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, workspaceName);\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t};\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, workspaceName);\n\t\t}\n\t},\n\taskIfUserWantsNewWorkspace(params: SaveWorkspaceWaterfallParams, callback: StandardErrorCallback) {\n\t\tlet { workspaceExists, workspaceName, template } = params;\n\n\t\tlet dialogParams = {\n\t\t\ttitle: \"New workspace\",\n\t\t\tquestion: `The workspace \"${workspaceName}\" already exists. A new workspace with a modified name will be created.`,\n\t\t\taffirmativeResponseLabel: \"OK\",\n\t\t\tshowNegativeButton: false,\n\t\t};\n\n\t\tfunction onUserInput(err: StandardError, response: UserInputResponseType) {\n\t\t\tif (response.choice === \"affirmative\") {\n\t\t\t\tcallback(null, { workspaceName, template });\n\t\t\t} else {\n\t\t\t\tcallback(new Error(NEGATIVE));\n\t\t\t}\n\t\t}\n\t\tif (workspaceExists) {\n\t\t\tActions.spawnDialog(\"yesNo\", dialogParams, onUserInput);\n\t\t} else {\n\t\t\tcallback(null, { workspaceName, template });\n\t\t}\n\t},\n\n\t/**\n\t * Checks if the workspace exists. If it does, it asks the user if they're comfortable overwriting that data.\n\t */\n\tcheckIfWorkspaceAlreadyExists(response: any, callback: StandardErrorCallback) {\n\t\tconst workspaceName = response.value;\n\t\tconst camelCaseWorkspaceName = Util.camelCase(workspaceName);\n\t\t// Do any of the workspaces have the same name that the user is trying to input.\n\t\tconst workspaceExists = FSBL.Clients.WorkspaceClient.workspaces.some(\n\t\t\t(workspace) => Util.camelCase(workspace) === camelCaseWorkspaceName\n\t\t);\n\t\tcallback(null, {\n\t\t\tworkspaceExists,\n\t\t\tworkspaceName,\n\t\t\ttemplate: response.template,\n\t\t});\n\t},\n\t/*********************************************************************************************\n\t *\n\t *\t\t\t\t\t\t\t\tMisc functionality\n\t *\n\t *********************************************************************************************/\n\t/**\n\t * Un-focuses from the menu.\n\t */\n\tblurWindow: function () {\n\t\tfinsembleWindow.blur();\n\t},\n};\n\nfunction createLocalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{ store: \"Finsemble-WorkspaceMenu-Local-Store\", values: defaultData },\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction createGlobalStore(done: () => void) {\n\tStoreClient.createStore(\n\t\t{\n\t\t\tstore: \"Finsemble-WorkspaceMenu-Global-Store\",\n\t\t\tglobal: true,\n\t\t\tvalues: { owner: finsembleWindow.name },\n\t\t},\n\t\t(err: StandardError, store: StoreModel) => {\n\t\t\tWorkspaceManagementGlobalStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getPreferences(done: () => void) {\n\tFSBL.Clients.ConfigClient.getValue(\n\t\t{\n\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\n\t\t},\n\t\t(err: StandardError, data?: boolean | null) => {\n\t\t\tlet prompt = data;\n\t\t\t// default to false.\n\t\t\tPROMPT_ON_SAVE = prompt === null || prompt === undefined ? PROMPT_ON_SAVE : prompt;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\n/**\n * Initializes the store for the Workspace Management Menu.\n */\nfunction initialize(cb: any) {\n\tStoreClient = FSBL.Clients.DistributedStoreClient;\n\t// eslint-disable-next-line prefer-destructuring\n\tLogger = FSBL.Clients.Logger;\n\tasync.parallel([createGlobalStore, createLocalStore, getPreferences], () => {\n\t\tActions.initialize();\n\t\tcb(WorkspaceManagementStore);\n\t});\n}\n\nlet getStore = () => WorkspaceManagementStore;\n\n/**\n * This is a quick little initialization manager that Terry hacked up.\n * Ultimately everything in this file should be rewritten in hooks/redux pattern.\n */\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store !== null) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport {\n\tstoreManager,\n\tWorkspaceManagementGlobalStore as GlobalStore,\n\tinitialize,\n\tWorkspaceManagementStore as Store,\n\tActions,\n\tgetStore,\n};\n"]}