@finsemble/finsemble-ui 6.3.2 → 6.5.0-beta.2

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 (448) hide show
  1. package/package.json +31 -42
  2. package/react/actions/smartDesktopDesignerActions.d.ts +6 -4
  3. package/react/actions/smartDesktopDesignerActions.js +2 -1
  4. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  5. package/react/assets/css/userPreferences.css +0 -30
  6. package/react/assets/css/windowTitleBar.css +6 -5
  7. package/react/assets/icons/always-on-top.svg +20 -0
  8. package/react/assets/icons/caret.svg +7 -0
  9. package/react/assets/icons/close.svg +11 -0
  10. package/react/assets/icons/code-block.svg +15 -0
  11. package/react/assets/icons/documentation.svg +20 -0
  12. package/react/assets/icons/linker.svg +18 -0
  13. package/react/assets/icons/maximize.svg +16 -0
  14. package/react/assets/icons/minimize.svg +15 -0
  15. package/react/assets/icons/toolbar.svg +12 -0
  16. package/react/assets/img/finsemble-display.png +0 -0
  17. package/react/componentTemplateGenerator.js +1 -1
  18. package/react/componentTemplateGenerator.js.map +1 -1
  19. package/react/components/FinsembleProvider.js.map +1 -1
  20. package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
  21. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  22. package/react/components/appCatalog/stores/appStore.d.ts +2 -2
  23. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  24. package/react/components/common/Accordion.d.ts +11 -0
  25. package/react/components/common/Accordion.js +20 -0
  26. package/react/components/common/Accordion.js.map +1 -0
  27. package/react/components/common/Checkbox.d.ts +1 -0
  28. package/react/components/common/Checkbox.js +4 -2
  29. package/react/components/common/Checkbox.js.map +1 -1
  30. package/react/components/common/DropZone.js +3 -1
  31. package/react/components/common/DropZone.js.map +1 -1
  32. package/react/components/common/FileInput.d.ts +2 -1
  33. package/react/components/common/FileInput.js +9 -4
  34. package/react/components/common/FileInput.js.map +1 -1
  35. package/react/components/common/FinsembleIcon.d.ts +1 -1
  36. package/react/components/common/FinsembleIcon.js +18 -0
  37. package/react/components/common/FinsembleIcon.js.map +1 -1
  38. package/react/components/common/FinsembleSelect.js +1 -1
  39. package/react/components/common/FinsembleSelect.js.map +1 -1
  40. package/react/components/common/Header.js +1 -1
  41. package/react/components/common/Header.js.map +1 -1
  42. package/react/components/common/InputTable.d.ts +11 -0
  43. package/react/components/common/InputTable.js +50 -0
  44. package/react/components/common/InputTable.js.map +1 -0
  45. package/react/components/common/Tooltip.js +3 -1
  46. package/react/components/common/Tooltip.js.map +1 -1
  47. package/react/components/common/css/accordion.css +99 -0
  48. package/react/components/common/css/application-edit-page.css +209 -2
  49. package/react/components/common/css/application-list.css +6 -0
  50. package/react/components/common/css/button.css +9 -7
  51. package/react/components/common/css/checkbox.css +30 -0
  52. package/react/components/common/css/file-input.css +16 -0
  53. package/react/components/common/css/header.css +1 -14
  54. package/react/components/common/css/preload-edit-page.css +37 -0
  55. package/react/components/common/css/styles.css +0 -1
  56. package/react/components/common/css/tab.css +1 -1
  57. package/react/components/common/stories/Accordion.stories.d.ts +14 -0
  58. package/react/components/common/stories/Accordion.stories.js +42 -0
  59. package/react/components/common/stories/Accordion.stories.js.map +1 -0
  60. package/react/components/common/stories/DropdownButton.stories.d.ts +11 -0
  61. package/react/components/common/stories/DropdownButton.stories.js +12 -0
  62. package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
  63. package/react/components/common/stories/FileInput.stories.d.ts +2 -1
  64. package/react/components/common/stories/FileInput.stories.js +6 -0
  65. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  66. package/react/components/common/stories/FinsembleIcon.stories.js +1 -0
  67. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  68. package/react/components/common/stories/InputTable.stories.d.ts +12 -0
  69. package/react/components/common/stories/InputTable.stories.js +35 -0
  70. package/react/components/common/stories/InputTable.stories.js.map +1 -0
  71. package/react/components/{smartDesktopDesigner/tests/ApplicationEdit.spec.d.ts → common/tests/Accordion.spec.d.ts} +0 -0
  72. package/react/components/common/tests/Accordion.spec.js +53 -0
  73. package/react/components/common/tests/Accordion.spec.js.map +1 -0
  74. package/react/components/common/tests/Checkbox.spec.js +5 -3
  75. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  76. package/react/components/common/tests/FileInput.spec.js +20 -5
  77. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  78. package/react/components/common/tests/Header.spec.js +6 -2
  79. package/react/components/common/tests/Header.spec.js.map +1 -1
  80. package/react/components/{smartDesktopDesigner/tests/ApplicationList.spec.d.ts → common/tests/InputTable.spec.d.ts} +0 -0
  81. package/react/components/common/tests/InputTable.spec.js +166 -0
  82. package/react/components/common/tests/InputTable.spec.js.map +1 -0
  83. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  84. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  85. package/react/components/fdc3Resolver/ResolverDialog.js +1 -1
  86. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  87. package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -1
  88. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  89. package/react/components/fdc3Resolver/ResolverDialog.stories.js +13 -0
  90. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  91. package/react/components/legacyControls/FinsembleDialogButton.js +1 -1
  92. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  93. package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
  94. package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
  95. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  96. package/react/components/linker/remoteRedux.d.ts +1 -1
  97. package/react/components/linker/remoteRedux.js.map +1 -1
  98. package/react/components/menu/Menu.d.ts +1 -0
  99. package/react/components/menu/Menu.js.map +1 -1
  100. package/react/components/menu/MenuAutoResizer.d.ts +2 -1
  101. package/react/components/menu/MenuAutoResizer.js +4 -3
  102. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  103. package/react/components/menu/MenuPortal.js +118 -92
  104. package/react/components/menu/MenuPortal.js.map +1 -1
  105. package/react/components/menu/MenuShell.d.ts +1 -0
  106. package/react/components/menu/MenuShell.js +3 -2
  107. package/react/components/menu/MenuShell.js.map +1 -1
  108. package/react/components/menu/menuContext.d.ts +1 -0
  109. package/react/components/menu/menuContext.js.map +1 -1
  110. package/react/components/menu/menuHelpers.d.ts +1 -1
  111. package/react/components/menu/menuHelpers.js +2 -2
  112. package/react/components/menu/menuHelpers.js.map +1 -1
  113. package/react/components/notifications/components/drawer/DrawerControls.js +30 -6
  114. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  115. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +2 -0
  116. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  117. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +20 -27
  118. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  119. package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
  120. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  121. package/react/components/notifications/components/shared/IconButton.js +5 -1
  122. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  123. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
  124. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  125. package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
  126. package/react/components/notifications/components/shared/OverflowMenu.js +5 -1
  127. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  128. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
  129. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  130. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
  131. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  132. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
  133. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  134. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
  135. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  136. package/react/components/notifications/components/views/CardView.js.map +1 -1
  137. package/react/components/notifications/components/views/ListView.d.ts +1 -1
  138. package/react/components/notifications/components/views/ListView.js.map +1 -1
  139. package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
  140. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  141. package/react/components/notifications/types.d.ts +1 -1
  142. package/react/components/notifications/types.js.map +1 -1
  143. package/react/components/notifications/utils.d.ts +1 -1
  144. package/react/components/notifications/utils.js.map +1 -1
  145. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  146. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  147. package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
  148. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  149. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
  150. package/react/components/processMonitor/stores/ProcessMonitorStore.js +49 -49
  151. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  152. package/react/components/search/SearchResult.js +4 -3
  153. package/react/components/search/SearchResult.js.map +1 -1
  154. package/react/components/shared/DefaultDropdownButton.js +1 -1
  155. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  156. package/react/components/smartDesktopDesigner/AddApp.d.ts +14 -0
  157. package/react/components/smartDesktopDesigner/AddApp.js +60 -0
  158. package/react/components/smartDesktopDesigner/AddApp.js.map +1 -0
  159. package/react/components/smartDesktopDesigner/AppEditAccess.js +16 -32
  160. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  161. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +6 -19
  162. package/react/components/smartDesktopDesigner/AppEditPage.js +552 -59
  163. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  164. package/react/components/smartDesktopDesigner/Appearance.css +8 -67
  165. package/react/components/smartDesktopDesigner/Appearance.js +1 -1
  166. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  167. package/react/components/smartDesktopDesigner/Application.d.ts +11 -3
  168. package/react/components/smartDesktopDesigner/Application.js +155 -104
  169. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  170. package/react/components/smartDesktopDesigner/Applications.d.ts +2 -3
  171. package/react/components/smartDesktopDesigner/Applications.js +67 -107
  172. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  173. package/react/components/smartDesktopDesigner/Authentication.js +2 -9
  174. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  175. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js +8 -1
  176. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  177. package/react/components/smartDesktopDesigner/ContentHeader.d.ts +5 -0
  178. package/react/components/smartDesktopDesigner/ContentHeader.js +10 -0
  179. package/react/components/smartDesktopDesigner/ContentHeader.js.map +1 -0
  180. package/react/components/smartDesktopDesigner/CurrentView.js +2 -1
  181. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  182. package/react/components/smartDesktopDesigner/EditPreload.d.ts +14 -0
  183. package/react/components/smartDesktopDesigner/EditPreload.js +169 -0
  184. package/react/components/smartDesktopDesigner/EditPreload.js.map +1 -0
  185. package/react/components/smartDesktopDesigner/Export.d.ts +1 -0
  186. package/react/components/smartDesktopDesigner/Export.js +40 -9
  187. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  188. package/react/components/smartDesktopDesigner/ExportCloud.d.ts +3 -1
  189. package/react/components/smartDesktopDesigner/ExportCloud.js +4 -6
  190. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  191. package/react/components/smartDesktopDesigner/ExportZip.d.ts +3 -1
  192. package/react/components/smartDesktopDesigner/ExportZip.js +8 -3
  193. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  194. package/react/components/smartDesktopDesigner/GettingStarted.d.ts +1 -0
  195. package/react/components/smartDesktopDesigner/GettingStarted.js +11 -25
  196. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  197. package/react/components/smartDesktopDesigner/ItemList.d.ts +17 -0
  198. package/react/components/smartDesktopDesigner/ItemList.js +58 -0
  199. package/react/components/smartDesktopDesigner/ItemList.js.map +1 -0
  200. package/react/components/smartDesktopDesigner/Navigation.d.ts +2 -2
  201. package/react/components/smartDesktopDesigner/Navigation.js +17 -15
  202. package/react/components/smartDesktopDesigner/Navigation.js.map +1 -1
  203. package/react/components/smartDesktopDesigner/OptionalSettingsView.d.ts +11 -0
  204. package/react/components/smartDesktopDesigner/OptionalSettingsView.js +71 -0
  205. package/react/components/smartDesktopDesigner/OptionalSettingsView.js.map +1 -0
  206. package/react/components/smartDesktopDesigner/Preloads.d.ts +8 -0
  207. package/react/components/smartDesktopDesigner/Preloads.js +26 -0
  208. package/react/components/smartDesktopDesigner/Preloads.js.map +1 -0
  209. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  210. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +3 -3
  211. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +11 -17
  212. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  213. package/react/components/smartDesktopDesigner/ThemePage.css +0 -1
  214. package/react/components/smartDesktopDesigner/ThemePage.js +0 -7
  215. package/react/components/smartDesktopDesigner/ThemePage.js.map +1 -1
  216. package/react/components/smartDesktopDesigner/Themes.js +0 -2
  217. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  218. package/react/components/smartDesktopDesigner/Toolbar.d.ts +15 -0
  219. package/react/components/smartDesktopDesigner/Toolbar.js +123 -0
  220. package/react/components/smartDesktopDesigner/Toolbar.js.map +1 -0
  221. package/react/components/smartDesktopDesigner/View.js +1 -1
  222. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  223. package/react/components/smartDesktopDesigner/common/fsbl_functions.d.ts +1 -1
  224. package/react/components/smartDesktopDesigner/common/fsbl_functions.js +2 -2
  225. package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +1 -1
  226. package/react/components/smartDesktopDesigner/common/views.d.ts +2 -36
  227. package/react/components/smartDesktopDesigner/common/views.js +168 -111
  228. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  229. package/react/components/smartDesktopDesigner/css/appearance.css +20 -9
  230. package/react/components/smartDesktopDesigner/css/applications.css +40 -0
  231. package/react/components/smartDesktopDesigner/css/authentication.css +5 -11
  232. package/react/components/smartDesktopDesigner/css/export.css +32 -19
  233. package/react/components/smartDesktopDesigner/css/getting-started.css +22 -0
  234. package/react/components/smartDesktopDesigner/css/nav.css +38 -11
  235. package/react/components/smartDesktopDesigner/css/project-header.css +19 -16
  236. package/react/components/smartDesktopDesigner/css/styles.css +2 -3
  237. package/react/components/smartDesktopDesigner/css/views.css +11 -4
  238. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +3 -1
  239. package/react/components/smartDesktopDesigner/fixtures/apps.js +63 -6
  240. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  241. package/react/components/smartDesktopDesigner/fixtures/exportProps.js +3 -0
  242. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  243. package/react/components/smartDesktopDesigner/fixtures/preloads.d.ts +22 -0
  244. package/react/components/smartDesktopDesigner/fixtures/preloads.js +40 -0
  245. package/react/components/smartDesktopDesigner/fixtures/preloads.js.map +1 -0
  246. package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +1 -1
  247. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  248. package/react/components/smartDesktopDesigner/fixtures/views.d.ts +2 -2
  249. package/react/components/smartDesktopDesigner/fixtures/views.js +67 -26
  250. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  251. package/react/components/smartDesktopDesigner/sdd_helpers.d.ts +1 -1
  252. package/react/components/smartDesktopDesigner/sdd_helpers.js +4 -3
  253. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  254. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +3 -1
  255. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +13 -33
  256. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  257. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.d.ts +10 -0
  258. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js +13 -0
  259. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js.map +1 -0
  260. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.d.ts +11 -0
  261. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js +35 -0
  262. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js.map +1 -0
  263. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.d.ts +1 -1
  264. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js +1 -1
  265. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  266. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.d.ts +1 -1
  267. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js +1 -1
  268. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  269. package/react/components/smartDesktopDesigner/stories/ItemList.stories.d.ts +16 -0
  270. package/react/components/smartDesktopDesigner/stories/{ApplicationList.stories.js → ItemList.stories.js} +30 -23
  271. package/react/components/smartDesktopDesigner/stories/ItemList.stories.js.map +1 -0
  272. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.d.ts +11 -0
  273. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js +28 -0
  274. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js.map +1 -0
  275. package/react/components/smartDesktopDesigner/stories/Preloads.stories.d.ts +11 -0
  276. package/react/components/smartDesktopDesigner/stories/Preloads.stories.js +31 -0
  277. package/react/components/smartDesktopDesigner/stories/Preloads.stories.js.map +1 -0
  278. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js +7 -1
  279. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  280. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.d.ts +14 -0
  281. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js +38 -0
  282. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js.map +1 -0
  283. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1100 -308
  284. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  285. package/react/components/smartDesktopDesigner/tests/{ApplicationSetup.spec.d.ts → Application.spec.d.ts} +0 -0
  286. package/react/components/smartDesktopDesigner/tests/Application.spec.js +1496 -0
  287. package/react/components/smartDesktopDesigner/tests/Application.spec.js.map +1 -0
  288. package/react/components/smartDesktopDesigner/tests/Applications.spec.d.ts +1 -1
  289. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +62 -561
  290. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  291. package/react/components/smartDesktopDesigner/tests/{ProjectHeader.spec.d.ts → ContentHeader.spec.d.ts} +0 -0
  292. package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js +31 -0
  293. package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js.map +1 -0
  294. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.d.ts +1 -0
  295. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js +61 -0
  296. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js.map +1 -0
  297. package/react/components/smartDesktopDesigner/tests/Export.spec.js +129 -0
  298. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  299. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js +7 -0
  300. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  301. package/react/components/smartDesktopDesigner/tests/ItemList.spec.d.ts +1 -0
  302. package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.js → ItemList.spec.js} +8 -8
  303. package/react/components/smartDesktopDesigner/tests/ItemList.spec.js.map +1 -0
  304. package/react/components/smartDesktopDesigner/tests/Preloads.spec.d.ts +1 -0
  305. package/react/components/smartDesktopDesigner/tests/Preloads.spec.js +47 -0
  306. package/react/components/smartDesktopDesigner/tests/Preloads.spec.js.map +1 -0
  307. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js +3 -14
  308. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  309. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +7 -30
  310. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  311. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.d.ts +1 -0
  312. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js +203 -0
  313. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js.map +1 -0
  314. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.d.ts +1 -0
  315. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js +18 -0
  316. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js.map +1 -0
  317. package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
  318. package/react/components/toolbar/DragHandle.spec.js +31 -0
  319. package/react/components/toolbar/DragHandle.spec.js.map +1 -0
  320. package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
  321. package/react/components/toolbar/DragHandle.stories.js +39 -0
  322. package/react/components/toolbar/DragHandle.stories.js.map +1 -0
  323. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
  324. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  325. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
  326. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  327. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  328. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
  329. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +47 -45
  330. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  331. package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
  332. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  333. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
  334. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  335. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  336. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  337. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +1 -0
  338. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  339. package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
  340. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  341. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +3 -2
  342. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +17 -34
  343. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  344. package/react/components/toolbar/dashbar/Dashbar.js +12 -13
  345. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  346. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
  347. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  348. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
  349. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  350. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
  351. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  352. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
  353. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
  354. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  355. package/react/components/userPreferences/components/content/Workspaces.d.ts +1 -1
  356. package/react/components/userPreferences/components/content/Workspaces.js +1 -1
  357. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  358. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  359. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  360. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +1 -1
  361. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  362. package/react/components/userPreferences/tests/ScheduledRestart.spec.js +1 -1
  363. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  364. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +4 -2
  365. package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -52
  366. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  367. package/react/components/windowTitleBar/components/center/Tab.d.ts +0 -1
  368. package/react/components/windowTitleBar/components/center/Tab.js +2 -2
  369. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  370. package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -3
  371. package/react/components/windowTitleBar/components/center/TabList.js +19 -79
  372. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  373. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  374. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  375. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +7 -0
  376. package/react/components/windowTitleBar/components/right/MaximizeButton.js +11 -1
  377. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  378. package/react/components/windowTitleBar/components/windowTitle.d.ts +9 -5
  379. package/react/components/windowTitleBar/components/windowTitle.js +154 -42
  380. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  381. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
  382. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +214 -214
  383. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  384. package/react/enzymeSetup.js +1 -1
  385. package/react/enzymeSetup.js.map +1 -1
  386. package/react/hooks/useDashbar.d.ts +8 -0
  387. package/react/hooks/useDashbar.js +104 -0
  388. package/react/hooks/useDashbar.js.map +1 -0
  389. package/react/hooks/useFavoritesShell.js.map +1 -1
  390. package/react/hooks/useNotifications.d.ts +1 -1
  391. package/react/hooks/useNotifications.js.map +1 -1
  392. package/react/hooks/useToolbar.d.ts +0 -6
  393. package/react/hooks/useToolbar.js +0 -101
  394. package/react/hooks/useToolbar.js.map +1 -1
  395. package/react/reducers/rootReducer.d.ts +11 -7
  396. package/react/reducers/smartDesktopDesignerReducer.js +8 -3
  397. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  398. package/react/store.d.ts +22 -14
  399. package/react/types/fdc3.d.ts +7 -35
  400. package/react/types/fdc3.js.map +1 -1
  401. package/react/types/searchTypes.d.ts +1 -8
  402. package/react/types/searchTypes.js.map +1 -1
  403. package/react/types/smartDesktopDesignerTypes.d.ts +52 -6
  404. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  405. package/react/types/windowTitleBar.d.ts +4 -2
  406. package/react/types/windowTitleBar.js.map +1 -1
  407. package/react/components/common/FontSizeSelector.d.ts +0 -7
  408. package/react/components/common/FontSizeSelector.js +0 -42
  409. package/react/components/common/FontSizeSelector.js.map +0 -1
  410. package/react/components/common/stories/FontSizeSelector.stories.d.ts +0 -12
  411. package/react/components/common/stories/FontSizeSelector.stories.js +0 -24
  412. package/react/components/common/stories/FontSizeSelector.stories.js.map +0 -1
  413. package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +0 -25
  414. package/react/components/smartDesktopDesigner/ApplicationEdit.js +0 -103
  415. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +0 -1
  416. package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -15
  417. package/react/components/smartDesktopDesigner/ApplicationList.js +0 -56
  418. package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
  419. package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +0 -23
  420. package/react/components/smartDesktopDesigner/ApplicationSetup.js +0 -73
  421. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +0 -1
  422. package/react/components/smartDesktopDesigner/ProjectHeader.d.ts +0 -14
  423. package/react/components/smartDesktopDesigner/ProjectHeader.js +0 -70
  424. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +0 -1
  425. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.d.ts +0 -4
  426. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +0 -45
  427. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +0 -1
  428. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.d.ts +0 -3
  429. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +0 -29
  430. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +0 -1
  431. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.d.ts +0 -12
  432. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js +0 -21
  433. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +0 -1
  434. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -15
  435. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
  436. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.d.ts +0 -12
  437. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js +0 -28
  438. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +0 -1
  439. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.d.ts +0 -10
  440. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js +0 -19
  441. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +0 -1
  442. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js +0 -66
  443. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +0 -1
  444. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
  445. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js +0 -41
  446. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +0 -1
  447. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js +0 -27
  448. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"windowTitleBarStore.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/stores/windowTitleBarStore.ts"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAKxE,MAAM,uBAAuB,GAAG,CAAC,eAAgC,EAAE,EAAE;IACpE,MAAM,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC;IAC5C,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC;AACpD,CAAC,CAAC;AAQF,MAAM,gBAAgB,GAAG,CAAC,MAAoB,EAAE,EAAoB,EAAE,EAAE;IACvE,IAAI,CAAC,eAAe,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE;QACnD,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE;YAChC,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;YAChC,eAAe,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE;gBA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,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,CAAC,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,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,mBAAmB,IAAI,KAAK,EAAE,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport windowTitleBarStoreDefaults from \"./windowTitleBarStoreDefaults\";\nimport { StandardCallback } from \"@finsemble/finsemble-core/types/types\";\nimport { FinsembleWindow, WindowIdentifier } from \"@finsemble/finsemble-core\";\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\n\nconst getWindowNameForDocking = (finsembleWindow: FinsembleWindow) => {\n\tconst parent = finsembleWindow.parentWindow;\n\treturn parent ? parent.name : finsembleWindow.name;\n};\n\ntype ParentParams = {\n\twindowIdentifiers: WindowIdentifier[];\n\tvisibleWindowIdentifier: WindowIdentifier;\n\tcreate: boolean;\n};\n\nconst getStackedWindow = (params: ParentParams, cb: StandardCallback) => {\n\tif (!finsembleWindow.parentWindow && params.create) {\n\t\tconst onParentSet = (evt: any) => {\n\t\t\tconst { parentName } = evt.data;\n\t\t\tfinsembleWindow.setParent({ windowName: parentName }, (err2, windowWrapper) => {\n\t\t\t\tcb?.(err2, windowWrapper);\n\t\t\t});\n\t\t\tfinsembleWindow.removeListener(\"parent-set\", onParentSet);\n\t\t};\n\t\tfinsembleWindow.addListener(\"parent-set\", onParentSet);\n\t\tFSBL.Clients.LauncherClient.spawn(\n\t\t\t\"StackedWindow\",\n\t\t\t{\n\t\t\t\twindowType: \"StackedWindow\",\n\t\t\t\tdata: { windowIdentifiers: params.windowIdentifiers },\n\t\t\t\toptions: { newStack: true },\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (!err) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcb?.(err, null);\n\t\t\t}\n\t\t);\n\t} else {\n\t\tfinsembleWindow.getParent(cb);\n\t}\n};\n\nlet windowTitleBarStore: StoreModel;\n\ntype ConstantsType = {\n\tPARENT_WRAPPER_UPDATES: string;\n\tCHILD_WINDOW_FIELD: string;\n\tVISIBLE_WINDOW_FIELD: string;\n\tTAB_SCROLL_POSITION_CHANGED: string;\n};\n\ntype ActionsType = {\n\tparentWrapperStore: any;\n\tparentSubscriptions: any[];\n\tparentWrapper: FinsembleWindow | null;\n\n\tinitialize: () => void;\n\tgetMyDockingGroups: (groupData: any) => any[];\n\tonTabListScrollPositionChanged: StandardCallback;\n\tsetTabListScrollPosition: (translateX: number) => void;\n\tremoteStateUpdate: (command: string, state: any) => void;\n\tclickMinimize: () => void;\n\tclickClose: () => void;\n\ttoggleGroup: () => void;\n\tclickMaximize: () => void;\n\tgetTabs: () => WindowIdentifier[];\n\t_setTabs: (tabs: WindowIdentifier[] | null) => any;\n\taddTabLocally: (windowIdentifier: WindowIdentifier, i: number) => void;\n\tremoveTabsLocally: () => void;\n\tremoveTabLocally: (windowIdentifier: WindowIdentifier) => void;\n\treorderTabLocally: (tab: WindowIdentifier, newIndex: number) => undefined | any;\n\taddTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tremoveTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tcloseTab: (windowIdentifier: WindowIdentifier) => void;\n\treorderTab: (tab: WindowIdentifier, newIndex: number) => any;\n\tfindTab: (tab: WindowIdentifier) => { tab: WindowIdentifier; currentIndex: number };\n\tsetActiveTab: (windowIdentifier: WindowIdentifier) => Promise<any>;\n\tonTabListChanged: StandardCallback;\n\tstopListeningOnParentWrapper: (cb: Function) => void;\n\tlistenOnParentWrapper: () => void;\n\tsetupStore: (cb?: Function) => void;\n\tgetInitialTabList: (cb: StandardCallback) => void;\n\tcreateParentWrapper: (params: ParentParams, cb?: Function) => void;\n};\n\n// these are constants that are set inside of setupStore. so they're declared as vars and not constants.\nlet constants: ConstantsType;\nconst Actions: ActionsType = {\n\tparentWrapperStore: null,\n\tinitialize: function () {\n\t\t// This ensures that our config is correct, even if the developer missed some entries\n\t\tlet { options } = FSBL.Clients.WindowClient;\n\t\tlet windowTitleBarConfig = options.customData.foreign.components[\"Window Manager\"];\n\t\tlet { FSBLHeader } = windowTitleBarConfig;\n\t\tlet self = this;\n\n\t\t// Display name is first up for display. If it doesn't exist, we look for a default title (or one that's already set on init). If no title, we display the window's name (e.g., '5434-Welcome Component-2321').\n\t\tconst displayName = options.customData?.component?.displayName;\n\n\t\t/**\n\t\t * The windowTitleBar (header) is dumb. It just reflects the state of the component window. The headerCommandChannel allows the WindowClient to take control of the state of the header. All of the details of listening to window events are handled inside the WindowClient\n\t\t */\n\t\tFSBL.Clients.WindowClient.headerCommandChannel((command, state) => {\n\t\t\tthis.remoteStateUpdate(command, state);\n\t\t});\n\n\t\t/**\n\t\t * \"FSBLHeader\" can be true, false or an object. If false then we'll never even be here. If true, then maximize, minimize and close buttons will display. If an object, then the developer can override whether buttons are shown with \"hideMaximize\", \"hideMinimize\" and \"hideClose\"\n\t\t */\n\t\tif (FSBLHeader) {\n\t\t\tconst max = !!FSBLHeader.hideMaximize;\n\n\t\t\twindowTitleBarStore.setValues([\n\t\t\t\t{ field: \"Maximize.hide\", value: max },\n\t\t\t\t{ field: \"Minimize.hide\", value: !!FSBLHeader.hideMinimize },\n\t\t\t\t{ field: \"Close.hide\", value: !!FSBLHeader.hideClose },\n\t\t\t\t{ field: \"AlwaysOnTop.show\", value: !!FSBLHeader.alwaysOnTop },\n\t\t\t]);\n\n\t\t\t// By default, we hack the window's scroll bar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"hackScrollbar\",\n\t\t\t\tvalue: windowTitleBarConfig.hackScrollbar !== false,\n\t\t\t});\n\n\t\t\tconst title = FSBL.Clients.WindowClient.title || windowTitleBarConfig.title || displayName;\n\n\t\t\tif (title) {\n\t\t\t\tdocument.title = title;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Handles whether to show the linker button.\n\t\t */\n\t\tif (windowTitleBarConfig.showLinker) {\n\t\t\t// Get state (channel membership) from the linkerClient. Then set the value in the header so that the title bar accurately reflects the state.\n\t\t\tconst cb: StandardCallback = (err, response) => {\n\t\t\t\tif (response.channels) {\n\t\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\t\tfield: \"Linker.channels\",\n\t\t\t\t\t\tvalue: response.channels,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\t\t\tvalue: true,\n\t\t\t\t});\n\t\t\t};\n\t\t\tcb(null, FSBL.Clients.LinkerClient.getState());\n\t\t\t/* [Terry] no longer necessary?\n\t\t\tFSBL.Clients.LinkerClient.getLinkedChannels({\n\t\t\t\twindowName: options.name,\n\t\t\t\tuuid: options.uuid,\n\t\t\t\tcomponentType: options.customData.component.type\n\t\t\t}, cb);\n\t\t\t*/\n\t\t\tFSBL.Clients.LinkerClient.onStateChange(cb);\n\t\t}\n\n\t\t/**\n\t\t * Listen for updates from the dragAndDropClient.\n\t\t */\n\t\tFSBL.Clients.RouterClient.subscribe(\n\t\t\t`${FSBL.Clients.WindowClient.options.name}Finsemble.Sharer`,\n\t\t\t(err, response) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn console.error(err);\n\t\t\t\t}\n\t\t\t\twindowTitleBarStore.setValues([\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\t\t\tvalue: response.data.emitterEnabled,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Sharer.receiverEnabled\",\n\t\t\t\t\t\tvalue: response.data.receiverEnabled,\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t}\n\t\t);\n\n\t\t/**\n\t\t * When a group update is publish, we sift through the data to see if this window is snapped or grouped with other windows. Then we publish that info, and the GroupingButton renders the correct icon.\n\t\t * @param {*} err\n\t\t * @param {*} response\n\t\t */\n\t\tconst onDockingGroupUpdate: StandardCallback = function (err, response) {\n\t\t\tif (err || !response.data || !response.data.groupData) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tFSBL.Clients.Logger.system.debug(\"On docking group update\", response.data.groupData);\n\t\t\tlet groupNames = Object.keys(response.data.groupData);\n\t\t\tlet movableGroups = groupNames\n\t\t\t\t.filter((groupName) => response.data.groupData[groupName].isMovable)\n\t\t\t\t.map((groupName) => response.data.groupData[groupName]);\n\t\t\t// This is all movable and snapped groups. It's used later to figure out the icon to display.\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\tvalue: response.data.groupData,\n\t\t\t});\n\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Main.allMovableDockingGroups\",\n\t\t\t\tvalue: movableGroups,\n\t\t\t});\n\t\t\tlet myGroups = self.getMyDockingGroups(response.data.groupData);\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Main.dockingGroups\",\n\t\t\t\tvalue: myGroups,\n\t\t\t});\n\t\t\t/**\n\t\t\t * Goes through groups and sees if this window is grouped, snapped, or freely hanging out there.\n\t\t\t */\n\t\t\tlet isSnapped = false;\n\t\t\tlet isInMovableGroup = false;\n\t\t\tlet isTopRight = false;\n\t\t\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\t\t\tfor (let i = 0; i < myGroups.length; i++) {\n\t\t\t\tlet myGroup = myGroups[i];\n\t\t\t\tif (myGroup.isMovable) {\n\t\t\t\t\tisInMovableGroup = true;\n\t\t\t\t\tif (windowName == myGroup.topRightWindow) {\n\t\t\t\t\t\tisTopRight = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tisSnapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet icon: string | false = false;\n\n\t\t\tif (isSnapped) {\n\t\t\t\ticon = \"joiner\";\n\t\t\t}\n\t\t\tif (isInMovableGroup) {\n\t\t\t\ticon = \"ejector\";\n\t\t\t}\n\n\t\t\twindowTitleBarStore.setValues([\n\t\t\t\t{ field: \"isSnapped\", value: isSnapped },\n\t\t\t\t{ field: \"isGrouped\", value: isInMovableGroup },\n\t\t\t\t{ field: \"isTopRight\", value: isTopRight },\n\t\t\t\t{ field: \"Main.dockingIcon\", value: icon },\n\t\t\t]);\n\t\t};\n\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.groupUpdate\", onDockingGroupUpdate);\n\n\t\t// default title.\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t\tvalue: FSBL.Clients.WindowClient.getWindowTitle(),\n\t\t});\n\n\t\tconst getValuesCallback: StandardCallback = (err, values) => {\n\t\t\tconst finsembleConfig = values.finsemble;\n\n\t\t\t// Check FEA config for DOM based movement configuration\n\t\t\tconst { useDOMBasedMovement } = values[\"finsemble-electron-adapter\"];\n\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Main.useDOMBasedMovement\",\n\t\t\t\tvalue: typeof useDOMBasedMovement === \"undefined\" ? true : useDOMBasedMovement,\n\t\t\t});\n\n\t\t\tlet globalWindowManagerConfig = finsembleConfig[\"Window Manager\"] || {\n\t\t\t\talwaysOnTopIcon: false,\n\t\t\t\tshowTabs: false,\n\t\t\t}; // Override defaults if finsemble.Window Manager exists.\n\n\t\t\t// Look to see if docking is enabled. Cascade through backward compatibility with old \"betaFeatures\" and then a default if no config is found at all.\n\n\t\t\tif (!finsembleConfig.servicesConfig) finsembleConfig.servicesConfig = {};\n\t\t\tlet dockingConfig = finsembleConfig.servicesConfig.docking || finsembleConfig.docking;\n\t\t\tif (!dockingConfig && finsembleConfig.betaFeatures) dockingConfig = finsembleConfig.betaFeatures.docking;\n\t\t\tif (!dockingConfig) dockingConfig = { enabled: true };\n\t\t\tif (!dockingConfig.tabbing) dockingConfig.tabbing = {};\n\n\t\t\twindowTitleBarStore.setValues([{ field: \"Main.dockingEnabled\", value: dockingConfig.enabled }]);\n\n\t\t\t// Whether the alwaysOnTop pin shows or not depends first on the global setting (finsemble[\"Window Manager\"].alwaysOnTop) and then\n\t\t\t// on the specific setting for this component (foreign.components[\"Widow Manager\"].alwaysOnTop)\n\t\t\tlet { alwaysOnTopIcon } = globalWindowManagerConfig;\n\t\t\tif (windowTitleBarConfig.alwaysOnTopIcon === false || windowTitleBarConfig.alwaysOnTopIcon === true)\n\t\t\t\t({ alwaysOnTopIcon } = windowTitleBarConfig);\n\n\t\t\twindowTitleBarStore.setValues([{ field: \"AlwaysOnTop.show\", value: alwaysOnTopIcon }]);\n\n\t\t\t// If tabbing is turned off, ignore global/local 'windowManager' config about whether to allow tabbing.\n\t\t\tif (dockingConfig.tabbing.enabled === false) {\n\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\tfield: \"showTabs\",\n\t\t\t\t\tvalue: dockingConfig.tabbing.enabled,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// If tabbing is enabled system-wide, look to the global config for its value. Then look to the local component's config.\n\n\t\t\t\t// This is the global window manager config.\n\t\t\t\tif (typeof windowTitleBarConfig.showTabs !== \"boolean\") {\n\t\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\t\tfield: \"showTabs\",\n\t\t\t\t\t\tvalue: globalWindowManagerConfig.showTabs,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// This is the component's config.\n\t\t\t\tif (windowTitleBarConfig.showTabs || windowTitleBarConfig.showTabs === false) {\n\t\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\t\tfield: \"showTabs\",\n\t\t\t\t\t\tvalue: windowTitleBarConfig.showTabs,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Once the above has been checked the individual component config is checked for customData.foreign.services[windowService || dockingService][!ignoreTilingAndTabbingRequests || allowTabbing]\n\t\t\t\tlet showTabs = true;\n\t\t\t\tconst getOptionsCallback: StandardCallback = (_, opts) => {\n\t\t\t\t\tif (opts.customData && opts.customData.foreign && opts.customData.foreign.services) {\n\t\t\t\t\t\tif (opts.customData.foreign.services.windowService) {\n\t\t\t\t\t\t\tif (opts.customData.foreign.services.windowService.allowTabbing !== undefined) {\n\t\t\t\t\t\t\t\tshowTabs = opts.customData.foreign.services.windowService.allowTabbing;\n\t\t\t\t\t\t\t} else if (opts.customData.foreign.services.windowService.ignoreTilingAndTabbingRequests != undefined) {\n\t\t\t\t\t\t\t\tshowTabs = !opts.customData.foreign.services.windowService.ignoreTilingAndTabbingRequests;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (opts.customData.foreign.services.dockingService) {\n\t\t\t\t\t\t\tif (opts.customData.foreign.services.dockingService.allowTabbing !== undefined) {\n\t\t\t\t\t\t\t\tshowTabs = opts.customData.foreign.services.dockingService.allowTabbing;\n\t\t\t\t\t\t\t} else if (opts.customData.foreign.services.dockingService.ignoreTilingAndTabbingRequests != undefined) {\n\t\t\t\t\t\t\t\tshowTabs = !opts.customData.foreign.services.dockingService.ignoreTilingAndTabbingRequests;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\t\tfield: \"showTabs\",\n\t\t\t\t\t\tvalue: showTabs,\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tfinsembleWindow.getOptions(getOptionsCallback);\n\t\t\t}\n\t\t};\n\t\tFSBL.Clients.ConfigClient.getValues(\n\t\t\t[{ field: \"finsemble\" }, { field: \"finsemble-electron-adapter\" }],\n\t\t\tgetValuesCallback\n\t\t);\n\n\t\tActions.getInitialTabList((err, values) => {\n\t\t\tconst onParentSet = () => {\n\t\t\t\tActions.parentWrapper = null;\n\t\t\t\tActions.getInitialTabList(() => {\n\t\t\t\t\tFSBL.Clients.Logger.system.debug(\"docking group update after initial tab list\");\n\t\t\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\t\t\tconst onParentCleared = () => {\n\t\t\t\tActions.parentWrapper = null;\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"ClearParent, setting tabs to null\");\n\t\t\t\tActions.stopListeningOnParentWrapper(() => {\n\t\t\t\t\tActions.parentWrapperStore = null;\n\t\t\t\t\tActions._setTabs(null);\n\t\t\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tfinsembleWindow?.addListener(\"setParent\", onParentSet);\n\t\t\tfinsembleWindow?.addListener(\"clearParent\", onParentCleared);\n\t\t\tif (err) {\n\t\t\t\treturn FSBL.Clients.Logger.system.error(\"Error in getInitialTabList.\", err);\n\t\t\t}\n\n\t\t\tif (values) Actions._setTabs(values);\n\t\t});\n\t},\n\t/**\n\t * Helper function to sift through all of the data coming from the windowService. Outputs an array of groups that the window belongs to.\n\t */\n\tgetMyDockingGroups: function (groupData) {\n\t\tlet myGroups = [];\n\t\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\t\tif (finsembleWindow?.parentWindow) {\n\t\t\twindowName = finsembleWindow?.parentWindow.name;\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"Getting docking groups for \", windowName, groupData);\n\t\tif (groupData) {\n\t\t\tfor (let groupName in groupData) {\n\t\t\t\tgroupData[groupName].groupName = groupName;\n\t\t\t\tif (groupData[groupName].windowNames.includes(windowName)) {\n\t\t\t\t\tmyGroups.push(groupData[groupName]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn myGroups;\n\t},\n\tonTabListScrollPositionChanged: function (err, response) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"tabListTranslateX\",\n\t\t\tvalue: response.data.translateX,\n\t\t});\n\t},\n\tsetTabListScrollPosition: function (translateX) {\n\t\tFSBL.Clients.RouterClient.transmit(constants.TAB_SCROLL_POSITION_CHANGED, {\n\t\t\ttranslateX,\n\t\t});\n\t},\n\t/**\n\t * Handles messages coming from the windowClient.\n\t */\n\tremoteStateUpdate: function (command, state) {\n\t\tconst key = Object.keys(state)[0];\n\t\tconst field = `${command}.${key}`;\n\t\twindowTitleBarStore.setValue({ field: field, value: state[key] });\n\t},\n\t/**\n\t * Minimizes the window.\n\t */\n\tclickMinimize: function () {\n\t\tfinsembleWindow.minimize(() => {});\n\t},\n\t/**\n\t * Closes the window, allows for cleanup. Removes the window from workspace; this function is only invoked when the user clicks the close button.\n\t */\n\tclickClose: function () {\n\t\tFSBL.Clients.WindowClient.close({\n\t\t\tcloseWindow: true,\n\t\t\tremoveFromWorkspace: true, // this will cause the entire stack to close. Using this instead of a new parameter to ensure backwards compatibility\n\t\t\tuserInitiated: true,\n\t\t});\n\t},\n\t/**\n\t * Toggles group membership. If two windows are snapped, and this button is clicked, they become part of the same group that can be moved around together.\n\t */\n\ttoggleGroup: function () {\n\t\tconst groups = windowTitleBarStore.getValue({ field: \"Main.dockingGroups\" });\n\t\tconst isInMovableGroup = groups.some((group: any) => group.isMovable);\n\t\tif (isInMovableGroup) {\n\t\t\tfinsembleWindow.ejectFromGroup();\n\t\t} else {\n\t\t\tfinsembleWindow.formGroup();\n\t\t}\n\t},\n\t/**\n\t * Maximizes the window.\n\t */\n\tclickMaximize: function () {\n\t\tif (finsembleWindow.windowState !== finsembleWindow.WINDOWSTATE.MAXIMIZED)\n\t\t\treturn finsembleWindow.maximize(() => {\n\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\t\tvalue: true,\n\t\t\t\t});\n\t\t\t});\n\n\t\treturn finsembleWindow.restore(() => {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\tvalue: false,\n\t\t\t});\n\t\t});\n\t},\n\n\tgetTabs() {\n\t\treturn windowTitleBarStore.getValue({ field: \"tabs\" }) as WindowIdentifier[];\n\t},\n\t_setTabs(tabs) {\n\t\tFSBL.Clients.Logger.system.debug(\"Set tabs\", tabs);\n\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\treturn windowTitleBarStore.setValue({\n\t\t\tfield: \"tabs\",\n\t\t\tvalue: tabs || [activeIdentifier],\n\t\t});\n\t},\n\taddTabLocally: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\tif (typeof i === \"undefined\") {\n\t\t\ti = tabs.length + 1;\n\t\t}\n\t\ttabs.splice(i, 0, windowIdentifier);\n\t\tActions._setTabs(tabs);\n\t},\n\tremoveTabsLocally: function () {\n\t\tActions._setTabs(null);\n\t},\n\tremoveTabLocally: function (windowIdentifier) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet i = tabs.findIndex((el) => el.windowName === windowIdentifier.windowName && el.uuid === windowIdentifier.uuid);\n\t\ttabs.splice(i, 1);\n\t\tActions._setTabs(tabs);\n\t},\n\treorderTabLocally: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === newIndex) return;\n\t\tif (currentIndex === -1) {\n\t\t\treturn Actions.addTabLocally(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\n\t\tActions._setTabs(tabs);\n\t},\n\taddTab: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\ttabs.push(windowIdentifier);\n\t\t// quick UI update\n\t\tActions._setTabs(tabs);\n\t\tlet callback = () => {\n\t\t\tActions.parentWrapper?.setVisibleWindow({ windowIdentifier });\n\t\t};\n\n\t\tif (!Actions.parentWrapper) {\n\t\t\treturn Actions.createParentWrapper({\n\t\t\t\twindowIdentifiers: finsembleWindow.identifier\n\t\t\t\t\t? [finsembleWindow.identifier, windowIdentifier]\n\t\t\t\t\t: [windowIdentifier],\n\t\t\t\tvisibleWindowIdentifier: windowIdentifier,\n\t\t\t\tcreate: true,\n\t\t\t});\n\t\t}\n\t\treturn Actions.parentWrapper.addWindow({ windowIdentifier, position: i }, callback);\n\t},\n\tremoveTab: function (windowIdentifier, i) {\n\t\treturn Actions.parentWrapper?.removeWindow({\n\t\t\twindowIdentifier,\n\t\t\tposition: i,\n\t\t});\n\t},\n\tcloseTab: function (windowIdentifier) {\n\t\tconst close: StandardCallback = (err, wrap) => {\n\t\t\twrap.close({ removeFromWorkspace: true });\n\t\t};\n\t\tFSBL.FinsembleWindow.getInstance(windowIdentifier, close);\n\t},\n\treorderTab: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === -1 || !Actions.parentWrapper) {\n\t\t\treturn Actions.addTab(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\t\t// Local change, quickly updates the dom.\n\t\tActions._setTabs(tabs);\n\t\tActions.parentWrapper.reorder({ windowIdentifiers: tabs });\n\t},\n\tfindTab: function (tab) {\n\t\tlet tabs = this.getTabs();\n\t\tlet currentIndex = tabs.findIndex((el) => tab.windowName === el.windowName && tab.uuid === el.uuid);\n\t\treturn { tab, currentIndex };\n\t},\n\tsetActiveTab: function (windowIdentifier) {\n\t\tFSBL.Clients.Logger.system.debug(\"setActiveTab.visibleWindow\");\n\t\treturn finsembleWindow.parentWindow.setVisibleWindow({ windowIdentifier });\n\t},\n\tparentWrapper: null,\n\tonTabListChanged: function (err, response) {\n\t\tFSBL.Clients.Logger.system.debug(\"OnTabListChanged\", response.data);\n\t\tif (response.data && response.data.hasOwnProperty(constants.CHILD_WINDOW_FIELD)) {\n\t\t\tActions._setTabs(response.data[constants.CHILD_WINDOW_FIELD]);\n\t\t}\n\t},\n\tparentSubscriptions: [],\n\tstopListeningOnParentWrapper: function (cb) {\n\t\tActions.parentSubscriptions.forEach((sub) => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(sub);\n\t\t});\n\t\tActions.parentSubscriptions = []; // remove the subscribeId\n\t\t// Syncs scroll state across all tabs in a stack.\n\t\tFSBL.Clients.RouterClient.removeListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tcb();\n\t},\n\tlistenOnParentWrapper: function () {\n\t\tlet TABLIST_SUBSCRIPTION = FSBL.Clients.RouterClient.subscribe(\n\t\t\tconstants.PARENT_WRAPPER_UPDATES,\n\t\t\tActions.onTabListChanged\n\t\t);\n\t\tFSBL.Clients.RouterClient.addListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tActions.parentSubscriptions.push(TABLIST_SUBSCRIPTION);\n\t},\n\tsetupStore: function (cb = Function.prototype) {\n\t\tconstants = {\n\t\t\tPARENT_WRAPPER_UPDATES: `Finsemble.StackedWindow.${Actions.parentWrapper?.identifier?.windowName}`,\n\t\t\tCHILD_WINDOW_FIELD: \"childWindowIdentifiers\",\n\t\t\tVISIBLE_WINDOW_FIELD: \"visibleWindowIdentifier\",\n\t\t\tTAB_SCROLL_POSITION_CHANGED: `${Actions.parentWrapper?.name}.tabListTabListScrollPositionChanged`,\n\t\t};\n\t\tActions.listenOnParentWrapper();\n\t\tcb();\n\t},\n\tgetInitialTabList: function (cb) {\n\t\tfinsembleWindow.getParent((err, parentWrapper) => {\n\t\t\tActions.parentWrapper = parentWrapper;\n\t\t\tif (Actions.parentWrapper) {\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"GetInitialTabList, parent exists\");\n\t\t\t\tActions.setupStore(cb);\n\t\t\t} else {\n\t\t\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\t\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\t\t\tlet tabs = [activeIdentifier];\n\t\t\t\tcb(null, tabs);\n\t\t\t}\n\t\t});\n\t},\n\tcreateParentWrapper(params: ParentParams, cb = Function.prototype) {\n\t\t(window as any).Actions = Actions;\n\t\tif (Actions.parentWrapper) {\n\t\t\tcb();\n\t\t} else {\n\t\t\tconst getStackedWindowCallback: StandardCallback = (err, wrap) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tActions.parentWrapper = null;\n\t\t\t\t\tActions._setTabs(null);\n\t\t\t\t} else {\n\t\t\t\t\tActions.parentWrapper = wrap;\n\t\t\t\t\tActions.setupStore(cb);\n\t\t\t\t}\n\t\t\t};\n\t\t\tgetStackedWindow(params, getStackedWindowCallback);\n\t\t}\n\t},\n};\n\n/**\n * Initializes the store for the windowTitleBar.\n *\n * @param {any} cb\n */\nfunction initialize(cb: Function) {\n\tFSBL.Clients.DistributedStoreClient.createStore(\n\t\t{ store: \"windowTitleBarStore\", values: windowTitleBarStoreDefaults },\n\t\t(err, store) => {\n\t\t\tif (!err && store) {\n\t\t\t\twindowTitleBarStore = store;\n\t\t\t}\n\t\t\tActions.initialize();\n\t\t\treturn cb(store, Actions);\n\t\t}\n\t);\n}\n\nlet getStore = () => windowTitleBarStore;\n\nclass StoreManager {\n\tinitialized = false;\n\n\tinitializing = false;\n\n\tstore: StoreModel | null = null;\n\n\tcallbacks: Function[] = [];\n\n\tconstructor() {}\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: Function) {\n\t\tif (this.initialized) 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 { storeManager };\nexport { initialize };\nexport { windowTitleBarStore as Store };\nexport { Actions };\nexport { getStore };\n"]}
1
+ {"version":3,"file":"windowTitleBarStore.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/stores/windowTitleBarStore.ts"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAKxE,MAAM,uBAAuB,GAAG,CAAC,eAAgC,EAAE,EAAE;IACpE,MAAM,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC;IAC5C,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC;AACpD,CAAC,CAAC;AAQF,MAAM,gBAAgB,GAAG,CAAC,MAAoB,EAAE,EAAoB,EAAE,EAAE;IACvE,IAAI,CAAC,eAAe,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE;QACnD,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE;YAChC,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;YAChC,eAAe,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,EAA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AC,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,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,mBAAmB,IAAI,KAAK,EAAE,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport windowTitleBarStoreDefaults from \"./windowTitleBarStoreDefaults\";\nimport { StandardCallback } from \"@finsemble/finsemble-api/types/types\";\nimport { FinsembleWindow, WindowIdentifier } from \"@finsemble/finsemble-api\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\n\nconst getWindowNameForDocking = (finsembleWindow: FinsembleWindow) => {\n\tconst parent = finsembleWindow.parentWindow;\n\treturn parent ? parent.name : finsembleWindow.name;\n};\n\ntype ParentParams = {\n\twindowIdentifiers: WindowIdentifier[];\n\tvisibleWindowIdentifier: WindowIdentifier;\n\tcreate: boolean;\n};\n\nconst getStackedWindow = (params: ParentParams, cb: StandardCallback) => {\n\tif (!finsembleWindow.parentWindow && params.create) {\n\t\tconst onParentSet = (evt: any) => {\n\t\t\tconst { parentName } = evt.data;\n\t\t\tfinsembleWindow.setParent({ windowName: parentName }, (err2, windowWrapper) => {\n\t\t\t\tcb?.(err2, windowWrapper);\n\t\t\t});\n\t\t\tfinsembleWindow.removeListener(\"parent-set\", onParentSet);\n\t\t};\n\t\tfinsembleWindow.addListener(\"parent-set\", onParentSet);\n\t\tFSBL.Clients.LauncherClient.spawn(\n\t\t\t\"StackedWindow\",\n\t\t\t{\n\t\t\t\twindowType: \"StackedWindow\",\n\t\t\t\tdata: { windowIdentifiers: params.windowIdentifiers },\n\t\t\t\toptions: { newStack: true },\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (!err) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcb?.(err, null);\n\t\t\t}\n\t\t);\n\t} else {\n\t\tfinsembleWindow.getParent(cb);\n\t}\n};\n\nlet windowTitleBarStore: StoreModel;\n\ntype ConstantsType = {\n\tPARENT_WRAPPER_UPDATES: string;\n\tCHILD_WINDOW_FIELD: string;\n\tVISIBLE_WINDOW_FIELD: string;\n\tTAB_SCROLL_POSITION_CHANGED: string;\n};\n\ntype ActionsType = {\n\tparentWrapperStore: any;\n\tparentSubscriptions: any[];\n\tparentWrapper: FinsembleWindow | null;\n\n\tinitialize: () => void;\n\tgetMyDockingGroups: (groupData: any) => any[];\n\tonTabListScrollPositionChanged: StandardCallback;\n\tsetTabListScrollPosition: (translateX: number) => void;\n\tremoteStateUpdate: (command: string, state: any) => void;\n\tclickMinimize: () => void;\n\tclickClose: () => void;\n\ttoggleGroup: () => void;\n\tclickMaximize: () => void;\n\tgetTabs: () => WindowIdentifier[];\n\t_setTabs: (tabs: WindowIdentifier[] | null) => any;\n\taddTabLocally: (windowIdentifier: WindowIdentifier, i: number) => void;\n\tremoveTabsLocally: () => void;\n\tremoveTabLocally: (windowIdentifier: WindowIdentifier) => void;\n\treorderTabLocally: (tab: WindowIdentifier, newIndex: number) => undefined | any;\n\taddTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tremoveTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tcloseTab: (windowIdentifier: WindowIdentifier) => void;\n\treorderTab: (tab: WindowIdentifier, newIndex: number) => any;\n\tfindTab: (tab: WindowIdentifier) => { tab: WindowIdentifier; currentIndex: number };\n\tsetActiveTab: (windowIdentifier: WindowIdentifier) => Promise<any>;\n\tonTabListChanged: StandardCallback;\n\tstopListeningOnParentWrapper: (cb: Function) => void;\n\tlistenOnParentWrapper: () => void;\n\tsetupStore: (cb?: Function) => void;\n\tgetInitialTabList: (cb: StandardCallback) => void;\n\tcreateParentWrapper: (params: ParentParams, cb?: Function) => void;\n};\n\n/**\n * When a group update is publish, we sift through the data to see if this window is snapped or grouped with other windows. Then we publish that info, and the GroupingButton renders the correct icon.\n * @param {*} err\n * @param {*} response\n */\nconst onDockingGroupUpdate: StandardCallback = (err, response) => {\n\tif (err || !response.data || !response.data.groupData) {\n\t\treturn;\n\t}\n\tFSBL.Clients.Logger.system.debug(\"On docking group update\", response.data.groupData);\n\tlet groupNames = Object.keys(response.data.groupData);\n\tlet movableGroups = groupNames\n\t\t.filter((groupName) => response.data.groupData[groupName].isMovable)\n\t\t.map((groupName) => response.data.groupData[groupName]);\n\t// This is all movable and snapped groups. It's used later to figure out the icon to display.\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.allDockingGroups\",\n\t\tvalue: response.data.groupData,\n\t});\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.allMovableDockingGroups\",\n\t\tvalue: movableGroups,\n\t});\n\tlet myGroups = Actions.getMyDockingGroups(response.data.groupData);\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.dockingGroups\",\n\t\tvalue: myGroups,\n\t});\n\t/**\n\t * Goes through groups and sees if this window is grouped, snapped, or freely hanging out there.\n\t */\n\tlet isSnapped = false;\n\tlet isInMovableGroup = false;\n\tlet isTopRight = false;\n\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\tfor (let i = 0; i < myGroups.length; i++) {\n\t\tlet myGroup = myGroups[i];\n\t\tif (myGroup.isMovable) {\n\t\t\tisInMovableGroup = true;\n\t\t\tif (windowName == myGroup.topRightWindow) {\n\t\t\t\tisTopRight = true;\n\t\t\t}\n\t\t} else {\n\t\t\tisSnapped = true;\n\t\t}\n\t}\n\tlet icon: string | false = false;\n\n\tif (isSnapped) {\n\t\ticon = \"joiner\";\n\t}\n\tif (isInMovableGroup) {\n\t\ticon = \"ejector\";\n\t}\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"isSnapped\", value: isSnapped },\n\t\t{ field: \"isGrouped\", value: isInMovableGroup },\n\t\t{ field: \"isTopRight\", value: isTopRight },\n\t\t{ field: \"Main.dockingIcon\", value: icon },\n\t]);\n};\n\n/**\n * Listen for updates from the dragAndDropClient.\n */\nconst listenForDNDUpdates = () => {\n\tFSBL.Clients.RouterClient.subscribe(`${FSBL.Clients.WindowClient.options.name}Finsemble.Sharer`, (err, response) => {\n\t\tif (err) {\n\t\t\treturn console.error(err);\n\t\t}\n\t\twindowTitleBarStore.setValues([\n\t\t\t{\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\tvalue: response.data.emitterEnabled,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: \"Sharer.receiverEnabled\",\n\t\t\t\tvalue: response.data.receiverEnabled,\n\t\t\t},\n\t\t]);\n\t});\n};\n\n/**\n * Handles whether to show the linker button.\n */\nconst showLinkerButton = () => {\n\t// Get state (channel membership) from the linkerClient. Then set the value in the header so that the title bar accurately reflects the state.\n\tconst cb: StandardCallback = (err, response) => {\n\t\tif (response.channels) {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Linker.channels\",\n\t\t\t\tvalue: response.channels,\n\t\t\t});\n\t\t}\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\tvalue: true,\n\t\t});\n\t};\n\tcb(null, FSBL.Clients.LinkerClient.getState());\n\tFSBL.Clients.LinkerClient.onStateChange(cb);\n};\n\nconst processInitialTabList = (err: any, values: any) => {\n\tconst onParentSet = () => {\n\t\tActions.parentWrapper = null;\n\t\tActions.getInitialTabList(() => {\n\t\t\tFSBL.Clients.Logger.system.debug(\"docking group update after initial tab list\");\n\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\tdata: {\n\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t};\n\tconst onParentCleared = () => {\n\t\tActions.parentWrapper = null;\n\t\tFSBL.Clients.Logger.system.debug(\"ClearParent, setting tabs to null\");\n\t\tActions.stopListeningOnParentWrapper(() => {\n\t\t\tActions.parentWrapperStore = null;\n\t\t\tActions._setTabs(null);\n\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\tdata: {\n\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t};\n\n\tfinsembleWindow?.addListener(\"setParent\", onParentSet);\n\tfinsembleWindow?.addListener(\"clearParent\", onParentCleared);\n\tif (err) {\n\t\treturn FSBL.Clients.Logger.system.error(\"Error in getInitialTabList.\", err);\n\t}\n\n\tif (values) Actions._setTabs(values);\n};\n\n/**\n * \"FSBLHeader\" can be true, false or an object. If false then we'll never even be here. If true, then maximize, minimize and close buttons will display. If an object, then the developer can override whether buttons are shown with \"hideMaximize\", \"hideMinimize\" and \"hideClose\"\n */\nconst processFSBLHeader = (FSBLHeader: any, windowTitleBarConfig: any, options: any) => {\n\t// Display name is first up for display. If it doesn't exist, we look for a default title (or one that's already set on init). If no title, we display the window's name (e.g., '5434-Welcome Component-2321').\n\tconst displayName = options.customData?.component?.displayName;\n\n\tconst max = !!FSBLHeader.hideMaximize;\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"Maximize.hide\", value: max },\n\t\t{ field: \"Minimize.hide\", value: !!FSBLHeader.hideMinimize },\n\t\t{ field: \"Close.hide\", value: !!FSBLHeader.hideClose },\n\t\t{ field: \"AlwaysOnTop.show\", value: !!FSBLHeader.alwaysOnTop },\n\t]);\n\n\t// By default, we hack the window's scroll bar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\twindowTitleBarStore.setValue({\n\t\tfield: \"hackScrollbar\",\n\t\tvalue: windowTitleBarConfig.hackScrollbar !== false,\n\t});\n\n\tconst title = FSBL.Clients.WindowClient.title || windowTitleBarConfig.title || displayName;\n\n\tif (title) {\n\t\tdocument.title = title;\n\t}\n};\n\n// Once the above has been checked the individual component config is checked for customData.foreign.services[windowService || dockingService][!ignoreTilingAndTabbingRequests || allowTabbing]\nconst getOptionsCallback: StandardCallback = (err, opts: Record<string, any>) => {\n\tconst windowAllowTabbing = opts.customData?.foreign?.services?.windowService?.allowTabbing;\n\tconst windowIgnoreTabbing = opts.customData?.foreign?.services?.windowService?.ignoreTilingAndTabbingRequests;\n\tconst dockingAllowTabbing = opts.customData?.foreign?.services?.dockingService?.allowTabbing;\n\tconst dockingIgnoreTabbing = opts.customData?.foreign.services?.dockingService?.ignoreTilingAndTabbingRequests;\n\tconst dontShowTabs =\n\t\twindowAllowTabbing === false ||\n\t\twindowIgnoreTabbing === true ||\n\t\tdockingAllowTabbing === false ||\n\t\tdockingIgnoreTabbing === true;\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"showTabs\",\n\t\tvalue: !dontShowTabs,\n\t});\n};\n\nconst processFEAAndFinsembleConfig = (values: Record<string, any>, windowTitleBarConfig: Record<string, any>) => {\n\tconst finsembleConfig = values.finsemble;\n\n\t// Check FEA config for DOM based movement configuration\n\tconst { useDOMBasedMovement } = values[\"finsemble-electron-adapter\"];\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.useDOMBasedMovement\",\n\t\tvalue: typeof useDOMBasedMovement === \"undefined\" ? true : useDOMBasedMovement,\n\t});\n\n\t// Override defaults if finsemble.Window Manager exists.\n\tconst globalWindowManagerConfig = finsembleConfig[\"Window Manager\"] || {\n\t\talwaysOnTopIcon: false,\n\t\tshowTabs: false,\n\t};\n\n\t// Look to see if docking is enabled. Cascade through backward compatibility with old \"betaFeatures\" and then a default if no config is found at all.\n\n\tfinsembleConfig.servicesConfig = finsembleConfig.servicesConfig ?? {};\n\n\tconst defaultDockingConfig = {\n\t\tenabled: true,\n\t};\n\tlet dockingConfig =\n\t\tfinsembleConfig.servicesConfig.docking ??\n\t\tfinsembleConfig.docking ??\n\t\tfinsembleConfig.betaFeatures?.docking ??\n\t\tdefaultDockingConfig;\n\tdockingConfig.tabbing = dockingConfig.tabbing ?? {};\n\n\twindowTitleBarStore.setValues([{ field: \"Main.dockingEnabled\", value: dockingConfig.enabled }]);\n\n\t// Whether the alwaysOnTop pin is displayed depends this component's config (foreign.components[\"Widow Manager\"].alwaysOnTop)\n\t// and then on the global setting (finsemble[\"Window Manager\"].alwaysOnTop)\n\tconst alwaysOnTopIcon = windowTitleBarConfig.alwaysOnTopIcon ?? globalWindowManagerConfig.alwaysOnTopIcon ?? false;\n\n\twindowTitleBarStore.setValues([{ field: \"AlwaysOnTop.show\", value: alwaysOnTopIcon }]);\n\n\t// If tabbing is turned off, ignore global/local 'windowManager' config about whether to allow tabbing.\n\tif (dockingConfig.tabbing.enabled === false) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"showTabs\",\n\t\t\tvalue: dockingConfig.tabbing.enabled,\n\t\t});\n\t} else {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"allowTabEditing\",\n\t\t\tvalue: dockingConfig.tabbing.allowEditing !== undefined ? dockingConfig.tabbing.allowEditing : true,\n\t\t});\n\t\t// If tabbing is enabled system-wide, look to the global config for its value. Then look to the local component's config.\n\n\t\t// This is the global window manager config.\n\t\tif (typeof windowTitleBarConfig.showTabs !== \"boolean\") {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"showTabs\",\n\t\t\t\tvalue: globalWindowManagerConfig.showTabs,\n\t\t\t});\n\t\t}\n\t\t// This is the component's config.\n\t\tif (windowTitleBarConfig.showTabs || windowTitleBarConfig.showTabs === false) {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"showTabs\",\n\t\t\t\tvalue: windowTitleBarConfig.showTabs,\n\t\t\t});\n\t\t}\n\n\t\tfinsembleWindow.getOptions(getOptionsCallback);\n\t}\n};\n\n// these are constants that are set inside of setupStore. so they're declared as vars and not constants.\nlet constants: ConstantsType;\nconst Actions: ActionsType = {\n\tparentWrapperStore: null,\n\tinitialize: () => {\n\t\t// This ensures that our config is correct, even if the developer missed some entries\n\t\tconst { options } = FSBL.Clients.WindowClient;\n\t\tconst windowTitleBarConfig = options.customData.foreign.components[\"Window Manager\"];\n\t\tconst { FSBLHeader } = windowTitleBarConfig;\n\n\t\tif (FSBLHeader) processFSBLHeader(FSBLHeader, windowTitleBarConfig, options);\n\n\t\tif (windowTitleBarConfig.showLinker) showLinkerButton();\n\n\t\tlistenForDNDUpdates();\n\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.groupUpdate\", onDockingGroupUpdate);\n\n\t\t// default title.\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t\tvalue: FSBL.Clients.WindowClient.getWindowTitle(),\n\t\t});\n\n\t\tFSBL.Clients.ConfigClient.getValues(\n\t\t\t[{ field: \"finsemble\" }, { field: \"finsemble-electron-adapter\" }],\n\t\t\t(err, config) => {\n\t\t\t\tif (config) processFEAAndFinsembleConfig(config, windowTitleBarConfig);\n\t\t\t}\n\t\t);\n\n\t\tActions.getInitialTabList(processInitialTabList);\n\n\t\t/**\n\t\t * This store does not listen on window events (such as \"maximized\" or \"minimized\") - that is the\n\t\t * WindowClient's job. The headerCommandChannel allows the WindowClient to affect the display state\n\t\t * of the windowTitleBar - such as changing the maximize icon when a \"maximized\" event is received.\n\t\t */\n\t\tFSBL.Clients.WindowClient.headerCommandChannel((command, state) => {\n\t\t\tActions.remoteStateUpdate(command, state);\n\t\t});\n\t},\n\t/**\n\t * Helper function to sift through all of the data coming from the windowService. Outputs an array of groups that the window belongs to.\n\t */\n\tgetMyDockingGroups: function (groupData) {\n\t\tlet myGroups = [];\n\t\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\t\tif (finsembleWindow?.parentWindow) {\n\t\t\twindowName = finsembleWindow?.parentWindow.name;\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"Getting docking groups for \", windowName, groupData);\n\t\tif (groupData) {\n\t\t\tfor (let groupName in groupData) {\n\t\t\t\tgroupData[groupName].groupName = groupName;\n\t\t\t\tif (groupData[groupName].windowNames.includes(windowName)) {\n\t\t\t\t\tmyGroups.push(groupData[groupName]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn myGroups;\n\t},\n\tonTabListScrollPositionChanged: function (err, response) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"tabListTranslateX\",\n\t\t\tvalue: response.data.translateX,\n\t\t});\n\t},\n\tsetTabListScrollPosition: function (translateX) {\n\t\tFSBL.Clients.RouterClient.transmit(constants.TAB_SCROLL_POSITION_CHANGED, {\n\t\t\ttranslateX,\n\t\t});\n\t},\n\t/**\n\t * Handles messages coming from the windowClient.\n\t */\n\tremoteStateUpdate: function (command, state) {\n\t\tconst key = Object.keys(state)[0];\n\t\tconst field = `${command}.${key}`;\n\t\twindowTitleBarStore.setValue({ field: field, value: state[key] });\n\t},\n\t/**\n\t * Minimizes the window.\n\t */\n\tclickMinimize: function () {\n\t\tfinsembleWindow.minimize(() => {});\n\t},\n\t/**\n\t * Closes the window, allows for cleanup. Removes the window from workspace; this function is only invoked when the user clicks the close button.\n\t */\n\tclickClose: function () {\n\t\tFSBL.Clients.WindowClient.close({\n\t\t\tcloseWindow: true,\n\t\t\tremoveFromWorkspace: true, // this will cause the entire stack to close. Using this instead of a new parameter to ensure backwards compatibility\n\t\t\tuserInitiated: true,\n\t\t});\n\t},\n\t/**\n\t * Toggles group membership. If two windows are snapped, and this button is clicked, they become part of the same group that can be moved around together.\n\t */\n\ttoggleGroup: function () {\n\t\tconst groups = windowTitleBarStore.getValue({ field: \"Main.dockingGroups\" });\n\t\tconst isInMovableGroup = groups.some((group: any) => group.isMovable);\n\t\tif (isInMovableGroup) {\n\t\t\tfinsembleWindow.ejectFromGroup();\n\t\t} else {\n\t\t\tfinsembleWindow.formGroup();\n\t\t}\n\t},\n\t/**\n\t * Maximizes the window.\n\t */\n\tclickMaximize: function () {\n\t\tif (finsembleWindow.windowOptions.windowState !== finsembleWindow.WINDOWSTATE.MAXIMIZED)\n\t\t\treturn finsembleWindow.maximize(() => {\n\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\t\tvalue: true,\n\t\t\t\t});\n\t\t\t});\n\n\t\treturn finsembleWindow.restore(() => {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\tvalue: false,\n\t\t\t});\n\t\t});\n\t},\n\n\tgetTabs() {\n\t\treturn windowTitleBarStore.getValue({ field: \"tabs\" }) as WindowIdentifier[];\n\t},\n\t_setTabs(tabs) {\n\t\tFSBL.Clients.Logger.system.debug(\"Set tabs\", tabs);\n\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\treturn windowTitleBarStore.setValue({\n\t\t\tfield: \"tabs\",\n\t\t\tvalue: tabs || [activeIdentifier],\n\t\t});\n\t},\n\taddTabLocally: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\tif (typeof i === \"undefined\") {\n\t\t\ti = tabs.length + 1;\n\t\t}\n\t\ttabs.splice(i, 0, windowIdentifier);\n\t\tActions._setTabs(tabs);\n\t},\n\tremoveTabsLocally: function () {\n\t\tActions._setTabs(null);\n\t},\n\tremoveTabLocally: function (windowIdentifier) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet i = tabs.findIndex((el) => el.windowName === windowIdentifier.windowName && el.uuid === windowIdentifier.uuid);\n\t\ttabs.splice(i, 1);\n\t\tActions._setTabs(tabs);\n\t},\n\treorderTabLocally: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === newIndex) return;\n\t\tif (currentIndex === -1) {\n\t\t\treturn Actions.addTabLocally(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\n\t\tActions._setTabs(tabs);\n\t},\n\taddTab: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\ttabs.push(windowIdentifier);\n\t\t// quick UI update\n\t\tActions._setTabs(tabs);\n\t\tlet callback = () => {\n\t\t\tActions.parentWrapper?.setVisibleWindow({ windowIdentifier });\n\t\t};\n\n\t\tif (!Actions.parentWrapper) {\n\t\t\treturn Actions.createParentWrapper({\n\t\t\t\twindowIdentifiers: finsembleWindow.identifier\n\t\t\t\t\t? [finsembleWindow.identifier, windowIdentifier]\n\t\t\t\t\t: [windowIdentifier],\n\t\t\t\tvisibleWindowIdentifier: windowIdentifier,\n\t\t\t\tcreate: true,\n\t\t\t});\n\t\t}\n\t\treturn Actions.parentWrapper.addWindow({ windowIdentifier, position: i }, callback);\n\t},\n\tremoveTab: function (windowIdentifier, i) {\n\t\treturn Actions.parentWrapper?.removeWindow({\n\t\t\twindowIdentifier,\n\t\t\tposition: i,\n\t\t});\n\t},\n\tcloseTab: function (windowIdentifier) {\n\t\tconst close: StandardCallback = (err, wrap) => {\n\t\t\twrap.close({ removeFromWorkspace: true });\n\t\t};\n\t\tFSBL.FinsembleWindow.getInstance(windowIdentifier, close);\n\t},\n\treorderTab: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === -1 || !Actions.parentWrapper) {\n\t\t\treturn Actions.addTab(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\t\t// Local change, quickly updates the dom.\n\t\tActions._setTabs(tabs);\n\t\tActions.parentWrapper.reorder({ windowIdentifiers: tabs });\n\t},\n\tfindTab: function (tab) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet currentIndex = tabs.findIndex((el) => tab.windowName === el.windowName && tab.uuid === el.uuid);\n\t\treturn { tab, currentIndex };\n\t},\n\tsetActiveTab: function (windowIdentifier) {\n\t\tFSBL.Clients.Logger.system.debug(\"setActiveTab.visibleWindow\");\n\t\treturn finsembleWindow.parentWindow.setVisibleWindow({ windowIdentifier });\n\t},\n\tparentWrapper: null,\n\tonTabListChanged: function (err, response) {\n\t\tFSBL.Clients.Logger.system.debug(\"OnTabListChanged\", response.data);\n\t\tif (response.data && response.data.hasOwnProperty(constants.CHILD_WINDOW_FIELD)) {\n\t\t\tActions._setTabs(response.data[constants.CHILD_WINDOW_FIELD]);\n\t\t}\n\t},\n\tparentSubscriptions: [],\n\tstopListeningOnParentWrapper: function (cb) {\n\t\tActions.parentSubscriptions.forEach((sub) => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(sub);\n\t\t});\n\t\tActions.parentSubscriptions = []; // remove the subscribeId\n\t\t// Syncs scroll state across all tabs in a stack.\n\t\tFSBL.Clients.RouterClient.removeListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tcb();\n\t},\n\tlistenOnParentWrapper: function () {\n\t\tlet TABLIST_SUBSCRIPTION = FSBL.Clients.RouterClient.subscribe(\n\t\t\tconstants.PARENT_WRAPPER_UPDATES,\n\t\t\tActions.onTabListChanged\n\t\t);\n\t\tFSBL.Clients.RouterClient.addListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tActions.parentSubscriptions.push(TABLIST_SUBSCRIPTION);\n\t},\n\tsetupStore: function (cb = Function.prototype) {\n\t\tconstants = {\n\t\t\tPARENT_WRAPPER_UPDATES: `Finsemble.StackedWindow.${Actions.parentWrapper?.identifier?.windowName}`,\n\t\t\tCHILD_WINDOW_FIELD: \"childWindowIdentifiers\",\n\t\t\tVISIBLE_WINDOW_FIELD: \"visibleWindowIdentifier\",\n\t\t\tTAB_SCROLL_POSITION_CHANGED: `${Actions.parentWrapper?.name}.tabListTabListScrollPositionChanged`,\n\t\t};\n\t\tActions.listenOnParentWrapper();\n\t\tcb();\n\t},\n\tgetInitialTabList: function (cb) {\n\t\tfinsembleWindow.getParent((err, parentWrapper) => {\n\t\t\tActions.parentWrapper = parentWrapper;\n\t\t\tif (Actions.parentWrapper) {\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"GetInitialTabList, parent exists\");\n\t\t\t\tActions.setupStore(cb);\n\t\t\t} else {\n\t\t\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\t\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\t\t\tlet tabs = [activeIdentifier];\n\t\t\t\tcb(null, tabs);\n\t\t\t}\n\t\t});\n\t},\n\tcreateParentWrapper(params: ParentParams, cb = Function.prototype) {\n\t\t(window as any).Actions = Actions;\n\t\tif (Actions.parentWrapper) {\n\t\t\tcb();\n\t\t} else {\n\t\t\tconst getStackedWindowCallback: StandardCallback = (err, wrap) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tActions.parentWrapper = null;\n\t\t\t\t\tActions._setTabs(null);\n\t\t\t\t} else {\n\t\t\t\t\tActions.parentWrapper = wrap;\n\t\t\t\t\tActions.setupStore(cb);\n\t\t\t\t}\n\t\t\t};\n\t\t\tgetStackedWindow(params, getStackedWindowCallback);\n\t\t}\n\t},\n};\n\n/**\n * Initializes the store for the windowTitleBar.\n *\n * @param {any} cb\n */\nfunction initialize(cb: Function) {\n\tFSBL.Clients.DistributedStoreClient.createStore(\n\t\t{ store: \"windowTitleBarStore\", values: windowTitleBarStoreDefaults },\n\t\t(err, store) => {\n\t\t\tif (!err && store) {\n\t\t\t\twindowTitleBarStore = store;\n\t\t\t}\n\t\t\tActions.initialize();\n\t\t\treturn cb(store, Actions);\n\t\t}\n\t);\n}\n\nlet getStore = () => windowTitleBarStore;\n\nclass StoreManager {\n\tinitialized = false;\n\n\tinitializing = false;\n\n\tstore: StoreModel | null = null;\n\n\tcallbacks: Function[] = [];\n\n\tconstructor() {}\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: Function) {\n\t\tif (this.initialized) 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 { storeManager };\nexport { initialize };\nexport { windowTitleBarStore as Store };\nexport { Actions };\nexport { getStore };\n"]}
@@ -1,7 +1,7 @@
1
1
  import Adapter from "@wojtekmaj/enzyme-adapter-react-17";
2
2
  import { configure } from "enzyme";
3
3
  import jsdom from "jsdom";
4
- require("babel-register")();
4
+ require("@babel/register")();
5
5
  function copyProps(src, target) {
6
6
  const props = Object.getOwnPropertyNames(src)
7
7
  .filter((prop) => typeof target[prop] === "undefined")
@@ -1 +1 @@
1
- {"version":3,"file":"enzymeSetup.js","sourceRoot":"","sources":["../src/enzymeSetup.js"],"names":[],"mappings":"AAMA,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;AAE5B,SAAS,SAAS,CAAC,GAAG,EAAE,MAAM;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC;SAC3C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC;SACrD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,mBAAmB;IAC3B,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,2CAA2C,EAAE,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACjG,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAEvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,MAAM,CAAC,SAAS,GAAG;QAClB,SAAS,EAAE,SAAS;KACpB,CAAC;IACF,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,mBAAmB,EAAE,CAAC;AAEtB,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC","sourcesContent":["// This is a helper/setup script that should be `--require`d when calling mocha to run enzyme tests\n// that require more real-world browser DOM objects to be exposed, like `.document` and `.window`.\n// This is needed to use methods like `.mount()` within enzyme.\n// It uses jsdom to set up a fake web browser in JavaScript.\n\n//import Adapter from \"enzyme-adapter-react-16\";\nimport Adapter from \"@wojtekmaj/enzyme-adapter-react-17\";\nimport { configure } from \"enzyme\";\nimport jsdom from \"jsdom\";\n\nrequire(\"babel-register\")();\n\nfunction copyProps(src, target) {\n\tconst props = Object.getOwnPropertyNames(src)\n\t\t.filter((prop) => typeof target[prop] === \"undefined\")\n\t\t.map((prop) => Object.getOwnPropertyDescriptor(src, prop));\n\tObject.defineProperties(target, props);\n}\n\nfunction setUpDomEnvironment() {\n\tconst { JSDOM } = jsdom;\n\tconst dom = new JSDOM(\"<!doctype html><html><body></body></html>\", { url: \"http://localhost/\" });\n\tconst { window } = dom;\n\n\tglobal.window = window;\n\tglobal.document = window.document;\n\tglobal.navigator = {\n\t\tuserAgent: \"node.js\",\n\t};\n\tglobal.File = window.File;\n\tcopyProps(window, global);\n}\n\nsetUpDomEnvironment();\n\nconfigure({ adapter: new Adapter() });\n"]}
1
+ {"version":3,"file":"enzymeSetup.js","sourceRoot":"","sources":["../src/enzymeSetup.js"],"names":[],"mappings":"AAMA,OAAO,OAAO,MAAM,oCAAoC,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;AAE7B,SAAS,SAAS,CAAC,GAAG,EAAE,MAAM;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC;SAC3C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC;SACrD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,mBAAmB;IAC3B,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,2CAA2C,EAAE,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACjG,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAEvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,MAAM,CAAC,SAAS,GAAG;QAClB,SAAS,EAAE,SAAS;KACpB,CAAC;IACF,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED,mBAAmB,EAAE,CAAC;AAEtB,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC","sourcesContent":["// This is a helper/setup script that should be `--require`d when calling mocha to run enzyme tests\n// that require more real-world browser DOM objects to be exposed, like `.document` and `.window`.\n// This is needed to use methods like `.mount()` within enzyme.\n// It uses jsdom to set up a fake web browser in JavaScript.\n\n//import Adapter from \"enzyme-adapter-react-16\";\nimport Adapter from \"@wojtekmaj/enzyme-adapter-react-17\";\nimport { configure } from \"enzyme\";\nimport jsdom from \"jsdom\";\n\nrequire(\"@babel/register\")();\n\nfunction copyProps(src, target) {\n\tconst props = Object.getOwnPropertyNames(src)\n\t\t.filter((prop) => typeof target[prop] === \"undefined\")\n\t\t.map((prop) => Object.getOwnPropertyDescriptor(src, prop));\n\tObject.defineProperties(target, props);\n}\n\nfunction setUpDomEnvironment() {\n\tconst { JSDOM } = jsdom;\n\tconst dom = new JSDOM(\"<!doctype html><html><body></body></html>\", { url: \"http://localhost/\" });\n\tconst { window } = dom;\n\n\tglobal.window = window;\n\tglobal.document = window.document;\n\tglobal.navigator = {\n\t\tuserAgent: \"node.js\",\n\t};\n\tglobal.File = window.File;\n\tcopyProps(window, global);\n}\n\nsetUpDomEnvironment();\n\nconfigure({ adapter: new Adapter() });\n"]}
@@ -0,0 +1,8 @@
1
+ import { DashbarItem } from "../types/dashbarTypes";
2
+ export declare const useDashbar: () => {
3
+ dashbarItems: DashbarItem[];
4
+ reorderDashbarItems: ({ oldIndex, newIndex }: {
5
+ oldIndex: number;
6
+ newIndex: number;
7
+ }) => void;
8
+ };
@@ -0,0 +1,104 @@
1
+ import { useDeepEffect } from "./useDeepEffect";
2
+ import { useSelector } from "../store";
3
+ import { ToolbarActions } from "../actions/toolbarActions";
4
+ import { useDispatch } from "react-redux";
5
+ let storageIsInitialized = false;
6
+ let DashbarStore;
7
+ const setDashbarItem = (itemName, availableDashbarItems, newDashbarItems) => {
8
+ if (availableDashbarItems.hasOwnProperty(itemName)) {
9
+ const newItem = availableDashbarItems[itemName];
10
+ newItem.id = itemName;
11
+ newDashbarItems.push(newItem);
12
+ }
13
+ };
14
+ const initializeDistributedStore = async () => {
15
+ const storeParams = {
16
+ store: "Finsemble-Dashbar-Store",
17
+ global: true,
18
+ persist: true,
19
+ };
20
+ const { err, data: store } = await FSBL.Clients.DistributedStoreClient.createStore(storeParams);
21
+ if (err || !store) {
22
+ const error = `Error initializing dashbar: unable to retrieve stored items, falling back to config: ${err}`;
23
+ FSBL.Clients.Logger.system.error(error);
24
+ return;
25
+ }
26
+ DashbarStore = store;
27
+ };
28
+ const initializeDashbarItems = async () => {
29
+ var _a;
30
+ let dashbarItemList;
31
+ if (DashbarStore && Object.keys(DashbarStore.values).length > 0) {
32
+ dashbarItemList = DashbarStore.values.dashbaritems;
33
+ }
34
+ if (!dashbarItemList) {
35
+ const spawnData = FSBL.Clients.WindowClient.getSpawnData();
36
+ if (Array.isArray((_a = spawnData === null || spawnData === void 0 ? void 0 : spawnData.dashbar) === null || _a === void 0 ? void 0 : _a.items)) {
37
+ dashbarItemList = spawnData.dashbar.items;
38
+ }
39
+ }
40
+ if (!dashbarItemList)
41
+ dashbarItemList = [];
42
+ const newDashbarItems = [];
43
+ if (dashbarItemList.length > 0) {
44
+ const { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({
45
+ field: "finsemble.availableDashbarItems",
46
+ });
47
+ dashbarItemList.forEach((itemName) => setDashbarItem(itemName, availableDashbarItems, newDashbarItems));
48
+ }
49
+ if (!DashbarStore.values.dashbaritems) {
50
+ DashbarStore.setValue({
51
+ field: "dashbaritems",
52
+ value: dashbarItemList,
53
+ });
54
+ return null;
55
+ }
56
+ else {
57
+ return newDashbarItems;
58
+ }
59
+ };
60
+ export const useDashbar = () => {
61
+ const dispatch = useDispatch();
62
+ const setDashbarItems = async (err, data) => {
63
+ if (!err && data) {
64
+ const { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({
65
+ field: "finsemble.availableDashbarItems",
66
+ });
67
+ const newDashbarItems = [];
68
+ data.value.forEach((item) => setDashbarItem(item, availableDashbarItems, newDashbarItems));
69
+ dispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));
70
+ }
71
+ };
72
+ useDeepEffect(async () => {
73
+ if (!storageIsInitialized) {
74
+ storageIsInitialized = true;
75
+ await initializeDistributedStore();
76
+ const newDashbarItems = await initializeDashbarItems();
77
+ if (newDashbarItems)
78
+ dispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));
79
+ DashbarStore.addListener({ field: "dashbaritems" }, setDashbarItems);
80
+ }
81
+ return function cleanup() {
82
+ DashbarStore.removeListener({ field: "dashbaritems" }, setDashbarItems);
83
+ };
84
+ }, [dispatch]);
85
+ const { dashbarItems } = useSelector((state) => state.toolbar);
86
+ const reorderDashbarItems = ({ oldIndex, newIndex }) => {
87
+ const dashbarItemsNewOrder = [...dashbarItems];
88
+ const dashbarItemToMove = dashbarItemsNewOrder[oldIndex];
89
+ dashbarItemsNewOrder.splice(oldIndex, 1);
90
+ dashbarItemsNewOrder.splice(newIndex, 0, dashbarItemToMove);
91
+ const newOrderList = dashbarItemsNewOrder.map((dashbarItem) => dashbarItem.id);
92
+ DashbarStore.setValue({
93
+ field: "dashbaritems",
94
+ value: newOrderList,
95
+ }, () => {
96
+ dispatch(ToolbarActions.REORDER_DASHBAR_ITEMS({ oldIndex, newIndex }));
97
+ });
98
+ };
99
+ return {
100
+ dashbarItems,
101
+ reorderDashbarItems,
102
+ };
103
+ };
104
+ //# sourceMappingURL=useDashbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDashbar.js","sourceRoot":"","sources":["../../src/hooks/useDashbar.ts"],"names":[],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;QAC/C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACzD,oBAAoB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACzC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAE5D,MAAM,YAAY,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAE/E,YAAY,CAAC,QAAQ,CACpB;YACC,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,YAAY;SACnB,EACD,GAAG,EAAE;YACJ,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACxE,CAAC,CACD,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACN,YAAY;QACZ,mBAAmB;KACnB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDeepEffect } from \"./useDeepEffect\";\nimport { useSelector } from \"../store\";\nimport { ToolbarActions } from \"../actions/toolbarActions\";\nimport { useDispatch } from \"react-redux\";\nimport { DashbarItem } from \"../types/dashbarTypes\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StoreModel = types.StoreModel;\ntype StandardError = types.StandardError;\n\nlet storageIsInitialized: boolean = false;\n\ntype DashbarStoreValueType = {\n\tdashbaritems: DashbarItem[];\n};\n\nlet DashbarStore: StoreModel;\n\nconst setDashbarItem = (\n\titemName: string,\n\tavailableDashbarItems: Record<string, DashbarItem>,\n\tnewDashbarItems: DashbarItem[]\n) => {\n\tif (availableDashbarItems.hasOwnProperty(itemName)) {\n\t\tconst newItem = availableDashbarItems[itemName];\n\t\tnewItem.id = itemName;\n\t\tnewDashbarItems.push(newItem);\n\t}\n};\n\nconst initializeDistributedStore = async (): Promise<void> => {\n\tconst storeParams = {\n\t\tstore: \"Finsemble-Dashbar-Store\",\n\t\tglobal: true,\n\t\tpersist: true,\n\t};\n\tconst { err, data: store } = await FSBL.Clients.DistributedStoreClient.createStore(storeParams);\n\tif (err || !store) {\n\t\tconst error = `Error initializing dashbar: unable to retrieve stored items, falling back to config: ${err}`;\n\t\tFSBL.Clients.Logger.system.error(error);\n\t\treturn;\n\t}\n\n\tDashbarStore = store;\n};\n\n/**\n * Fetches an initial list of dashbar items from the persistent distributed store,\n * and if that doesn't exist, from spawnData\n */\nconst initializeDashbarItems = async (): Promise<DashbarItem[] | null> => {\n\tlet dashbarItemList;\n\tif (DashbarStore && Object.keys(DashbarStore.values).length > 0) {\n\t\tdashbarItemList = (DashbarStore.values as DashbarStoreValueType).dashbaritems;\n\t}\n\n\tif (!dashbarItemList) {\n\t\tconst spawnData = FSBL.Clients.WindowClient.getSpawnData();\n\t\tif (Array.isArray(spawnData?.dashbar?.items)) {\n\t\t\tdashbarItemList = spawnData.dashbar.items;\n\t\t}\n\t}\n\n\tif (!dashbarItemList) dashbarItemList = [];\n\n\tconst newDashbarItems: DashbarItem[] = [];\n\tif (dashbarItemList.length > 0) {\n\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\n\t\t\tfield: \"finsemble.availableDashbarItems\",\n\t\t});\n\n\t\tdashbarItemList.forEach((itemName: string) => setDashbarItem(itemName, availableDashbarItems, newDashbarItems));\n\t}\n\n\tif (!DashbarStore.values.dashbaritems) {\n\t\tDashbarStore.setValue({\n\t\t\tfield: \"dashbaritems\",\n\t\t\tvalue: dashbarItemList,\n\t\t});\n\t\treturn null;\n\t} else {\n\t\treturn newDashbarItems;\n\t}\n};\n\nexport const useDashbar = () => {\n\tconst dispatch = useDispatch();\n\n\tconst setDashbarItems = async (err: StandardError, data: any) => {\n\t\tif (!err && data) {\n\t\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\n\t\t\t\tfield: \"finsemble.availableDashbarItems\",\n\t\t\t});\n\t\t\tconst newDashbarItems: DashbarItem[] = [];\n\t\t\t// Add the widget name as an id to help identify\n\t\t\t// keys -> widgets when reordering items\n\t\t\tdata.value.forEach((item: string) => setDashbarItem(item, availableDashbarItems, newDashbarItems));\n\n\t\t\tdispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\n\t\t}\n\t};\n\n\t/**\n\t * This effect initializes the dashbar items in the redux store. The store must only be initialized once. We use the module level variable\n\t * `storageIsInitialized` as a simple flag to prevent initialization from occuring more than once.\n\t */\n\tuseDeepEffect(async () => {\n\t\tif (!storageIsInitialized) {\n\t\t\tstorageIsInitialized = true;\n\t\t\tawait initializeDistributedStore();\n\t\t\tconst newDashbarItems = await initializeDashbarItems();\n\t\t\tif (newDashbarItems) dispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\n\t\t\tDashbarStore.addListener({ field: \"dashbaritems\" }, setDashbarItems);\n\t\t}\n\t\treturn function cleanup() {\n\t\t\tDashbarStore.removeListener({ field: \"dashbaritems\" }, setDashbarItems);\n\t\t};\n\t}, [dispatch]);\n\n\tconst { dashbarItems } = useSelector((state) => state.toolbar);\n\n\tconst reorderDashbarItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tconst dashbarItemsNewOrder = [...dashbarItems];\n\t\tconst dashbarItemToMove = dashbarItemsNewOrder[oldIndex];\n\t\tdashbarItemsNewOrder.splice(oldIndex, 1);\n\t\tdashbarItemsNewOrder.splice(newIndex, 0, dashbarItemToMove);\n\n\t\tconst newOrderList = dashbarItemsNewOrder.map((dashbarItem) => dashbarItem.id);\n\n\t\tDashbarStore.setValue(\n\t\t\t{\n\t\t\t\tfield: \"dashbaritems\",\n\t\t\t\tvalue: newOrderList,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tdispatch(ToolbarActions.REORDER_DASHBAR_ITEMS({ oldIndex, newIndex }));\n\t\t\t}\n\t\t);\n\t};\n\n\treturn {\n\t\tdashbarItems,\n\t\treorderDashbarItems,\n\t};\n};\n"]}
@@ -1 +1 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AiB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;IAOF,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,oBAAoB;YAAE,OAAO;QACjC,oBAAoB,GAAG,IAAI,CAAC;QAE5B,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,qBAAqB,EAAE,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAChG,IAAI,GAAG,EAAE;gBACR,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CACtC,qEAAqE,GAAG,EAAE,CAC1E,CAAC;aACF;YACD,QAAQ,CAAC,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAGf,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC;YAC/B,KAAK,EAAE,WAAW;YAClB,GAAG,EAAE,qBAAqB;YAC1B,KAAK,EAAE,SAAS;SAChB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO;QACN,SAAS;QACT,cAAc;QACd,eAAe;QACf,iBAAiB;KACjB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch } from \"../store\";\nimport { Favorite } from \"../types/favoriteTypes\";\nimport { FavoriteActions } from \"../actions/favoriteActions\";\nimport { useFavorites } from \"./useFavorites\";\nimport { useEffect } from \"react\";\nimport { types } from \"@finsemble/finsemble-core\";\n\ntype StandardError = types.StandardError;\n\nlet storageIsInitialized: boolean = false;\n\n/**\n * The useFavoritesShell() hook is used by FavoritesShell to interact with the redux store\n * and storage.\n */\nexport const useFavoritesShell = () => {\n\tconst dispatch = useDispatch();\n\tconst { favorites, removeFavorite } = useFavorites();\n\n\t// Ideally in the future the following function will be decoupled from implementation, allowing Favorites to generically dispatch actions.\n\t/**\n\t * Given a favorite item, trigger the associated action on that item.\n\t * I.e. If it's a finsemble component, a new window of that component is launched. If it's a workspace, the workspace would be switched to.\n\t * @param id The favorite item's id\n\t * @param category The to be triggered favorite item's category\n\t */\n\tconst triggerFavorite = async (id: Favorite[\"id\"], category: Favorite[\"category\"]) => {\n\t\tif (category === \"Application\") {\n\t\t\tFSBL.Clients.LauncherClient.spawn(id, {\n\t\t\t\taddToWorkspace: true,\n\t\t\t\tmonitor: \"mine\",\n\t\t\t});\n\t\t} else if (category === \"Workspace\") {\n\t\t\tFSBL.Clients.DistributedStoreClient.getStore(\n\t\t\t\t{ store: \"Finsemble-WorkspaceMenu-Global-Store\", global: true },\n\t\t\t\t(err: StandardError, store?: any) => {\n\t\t\t\t\tstore.Dispatcher.dispatch({\n\t\t\t\t\t\tactionType: \"switchToWorkspace\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tname: id,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\t/**\n\t * We need to persist the right order in whent he user reorders favorites in the toolbar. This ensures\n\t * that favorites will appear in the right order on future Toolbar launches.\n\t * @param favElements The ordered collection of favorite elements\n\t */\n\tconst setFavoritesOrder = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tdispatch(FavoriteActions.REORDER_FAVORITES({ oldIndex, newIndex }));\n\t};\n\n\t/**\n\t * This effect initializes the favorites redux store. The store must only be initialized once, even though useFavorites may be\n\t * referenced by many different React components. We use the module level variable `storageIsInitialized` as a simple flag to\n\t * prevent initialization from occuring more than once.\n\t */\n\tuseEffect(() => {\n\t\tif (storageIsInitialized) return;\n\t\tstorageIsInitialized = true;\n\t\t// Copy the persisted favorites from Storage to the redux store\n\t\tFSBL.Clients.StorageClient.get({ topic: \"favorites\", key: \"allCurrentFavorites\" }, (err, data) => {\n\t\t\tif (err) {\n\t\t\t\treturn FSBL.Clients.Logger.system.error(\n\t\t\t\t\t`Favorite Hook -> Failed to retrieve favorites from StorageClient: ${err}`\n\t\t\t\t);\n\t\t\t}\n\t\t\tdispatch(FavoriteActions.INITIALIZE_FAVORITES(data));\n\t\t});\n\t}, [dispatch]);\n\n\t// When the list of favorite items change, we want to persist that data to the store.\n\tuseEffect(() => {\n\t\tFSBL.Clients.StorageClient.save({\n\t\t\ttopic: \"favorites\",\n\t\t\tkey: \"allCurrentFavorites\",\n\t\t\tvalue: favorites,\n\t\t});\n\t}, [favorites]);\n\n\treturn {\n\t\tfavorites,\n\t\tremoveFavorite,\n\t\ttriggerFavorite,\n\t\tsetFavoritesOrder,\n\t};\n};\n"]}
1
+ {"version":3,"file":"useFavoritesShell.js","sourceRoot":"","sources":["../../src/hooks/useFavoritesShell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,IAAI,oBAAoB,GAAY,KAAK,CAAC;AAM1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACrC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IASrD,MAAM,eAAe,GAAG,KAAK,EAAE,EAAkB,EAAE,QAA8B,EAAE,EAAE;QACpF,IAAI,QAAQ,KAAK,aAAa,EAAE;YAC/B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE;gBACrC,cAAc,EAAE,IAAI;gBACpB,OAAO,EAAE,MAAM;aACf,CAAC,CAAC;SACH;aAAM,IAAI,Q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AK,EAAE,SAAS;SAChB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO;QACN,SAAS;QACT,cAAc;QACd,eAAe;QACf,iBAAiB;KACjB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch } from \"../store\";\nimport { Favorite } from \"../types/favoriteTypes\";\nimport { FavoriteActions } from \"../actions/favoriteActions\";\nimport { useFavorites } from \"./useFavorites\";\nimport { useEffect } from \"react\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StandardError = types.StandardError;\n\nlet storageIsInitialized: boolean = false;\n\n/**\n * The useFavoritesShell() hook is used by FavoritesShell to interact with the redux store\n * and storage.\n */\nexport const useFavoritesShell = () => {\n\tconst dispatch = useDispatch();\n\tconst { favorites, removeFavorite } = useFavorites();\n\n\t// Ideally in the future the following function will be decoupled from implementation, allowing Favorites to generically dispatch actions.\n\t/**\n\t * Given a favorite item, trigger the associated action on that item.\n\t * I.e. If it's a finsemble component, a new window of that component is launched. If it's a workspace, the workspace would be switched to.\n\t * @param id The favorite item's id\n\t * @param category The to be triggered favorite item's category\n\t */\n\tconst triggerFavorite = async (id: Favorite[\"id\"], category: Favorite[\"category\"]) => {\n\t\tif (category === \"Application\") {\n\t\t\tFSBL.Clients.LauncherClient.spawn(id, {\n\t\t\t\taddToWorkspace: true,\n\t\t\t\tmonitor: \"mine\",\n\t\t\t});\n\t\t} else if (category === \"Workspace\") {\n\t\t\tFSBL.Clients.DistributedStoreClient.getStore(\n\t\t\t\t{ store: \"Finsemble-WorkspaceMenu-Global-Store\", global: true },\n\t\t\t\t(err: StandardError, store?: any) => {\n\t\t\t\t\tstore.Dispatcher.dispatch({\n\t\t\t\t\t\tactionType: \"switchToWorkspace\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tname: id,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\t/**\n\t * We need to persist the right order in whent he user reorders favorites in the toolbar. This ensures\n\t * that favorites will appear in the right order on future Toolbar launches.\n\t * @param favElements The ordered collection of favorite elements\n\t */\n\tconst setFavoritesOrder = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tdispatch(FavoriteActions.REORDER_FAVORITES({ oldIndex, newIndex }));\n\t};\n\n\t/**\n\t * This effect initializes the favorites redux store. The store must only be initialized once, even though useFavorites may be\n\t * referenced by many different React components. We use the module level variable `storageIsInitialized` as a simple flag to\n\t * prevent initialization from occuring more than once.\n\t */\n\tuseEffect(() => {\n\t\tif (storageIsInitialized) return;\n\t\tstorageIsInitialized = true;\n\t\t// Copy the persisted favorites from Storage to the redux store\n\t\tFSBL.Clients.StorageClient.get({ topic: \"favorites\", key: \"allCurrentFavorites\" }, (err, data) => {\n\t\t\tif (err) {\n\t\t\t\treturn FSBL.Clients.Logger.system.error(\n\t\t\t\t\t`Favorite Hook -> Failed to retrieve favorites from StorageClient: ${err}`\n\t\t\t\t);\n\t\t\t}\n\t\t\tdispatch(FavoriteActions.INITIALIZE_FAVORITES(data));\n\t\t});\n\t}, [dispatch]);\n\n\t// When the list of favorite items change, we want to persist that data to the store.\n\tuseEffect(() => {\n\t\tFSBL.Clients.StorageClient.save({\n\t\t\ttopic: \"favorites\",\n\t\t\tkey: \"allCurrentFavorites\",\n\t\t\tvalue: favorites,\n\t\t});\n\t}, [favorites]);\n\n\treturn {\n\t\tfavorites,\n\t\tremoveFavorite,\n\t\ttriggerFavorite,\n\t\tsetFavoritesOrder,\n\t};\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { NotificationsConfig } from "../components/notifications/types";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type NotificationServiceState = services.notification.types.NotificationServiceState;
4
4
  declare type IFilter = services.notification.types.IFilter;
5
5
  declare type IMuteFilter = services.notification.types.IMuteFilter;
@@ -1 +1 @@
1
- {"version":3,"file":"useNotifications.js","sour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C;iBAC9B;YACF,CAAC,CAAC;YAEF,OAAO,kBAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;SAClE;QAAC,OAAO,KAAK,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACrB;IACF,CAAC;IAKD,SAAS,kBAAkB,CAAC,QAAiB;QAC5C,IAAI,QAAQ,EAAE;YACb,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7D,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAC9C,WAAW,CAAC,SAAS,GAAG,GAAG,WAAW,CAAC,SAAS,SAAS,CAAC;aAC1D;SACD;IACF,CAAC;IAGD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE;YAEX,CAAC,KAAK,IAAI,EAAE;gBACX,MAAM,eAAe,GAAG,CAAC,MAAM,SAAS,CAAQ,CAAC;gBACjD,IAAI,eAAe,EAAE;oBACpB,MAAM,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;iBACzD;YACF,CAAC,CAAC,EAAE,CAAC;QACN,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACN,mBAAmB;QACnB,eAAe;QACf,oBAAoB;QACpB,sBAAsB;QACtB,wBAAwB;QACxB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB;QAClB,kBAAkB;KAClB,CAAC;AACH,CAAC","sourcesContent":["import { useEffect, useReducer } from \"react\";\nimport { WindowConfig, NotificationsConfig } from \"../components/notifications/types\";\nimport { usePubSub } from \"./usePubSub\";\nimport { NOTIFICATIONS_PUBSUB_TOPIC } from \"../components/notifications/constants\";\nimport { services } from \"@finsemble/finsemble-core\";\ntype NotificationServiceState = services.notification.types.NotificationServiceState;\n\ntype IFilter = services.notification.types.IFilter;\ntype IMuteFilter = services.notification.types.IMuteFilter;\ntype INotification = services.notification.types.INotification;\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\n\nconst { WindowClient, NotificationClient } = FSBL.Clients;\n\nconst initialState: any = { notifications: [] };\n\n/*\nAction Types\n*/\nconst CREATE_MULTIPLE = \"CREATE_MULTIPLE\";\nconst UPDATE = \"UPDATE\";\nconst REMOVE = \"REMOVE\";\n\n/*\n\tReducer\n\t*/\nfunction reducer(state: { notifications: INotification[] }, action: { type: string; payload: any }) {\n\tswitch (action.type) {\n\t\tcase CREATE_MULTIPLE:\n\t\t\treturn {\n\t\t\t\tnotifications: [...state.notifications, ...action.payload],\n\t\t\t};\n\t\tcase UPDATE: {\n\t\t\t// check to see if the notification exists if so update the values\n\t\t\tconst notificationExistsInArray = state.notifications.find(\n\t\t\t\t(notification: INotification) => notification.id === action.payload.id\n\t\t\t);\n\n\t\t\t//if the notification exists then do nothing and return the current state else add the the new notification to the state\n\t\t\tconst notifications = notificationExistsInArray\n\t\t\t\t? state.notifications.map((notification: INotification) =>\n\t\t\t\t\t\tnotification.id === action.payload.id ? action.payload : notification\n\t\t\t\t )\n\t\t\t\t: [action.payload, ...state.notifications];\n\n\t\t\treturn { notifications };\n\t\t}\n\t\tcase REMOVE:\n\t\t\treturn {\n\t\t\t\tnotifications: state.notifications.filter((notification) => notification.id !== action.payload.id),\n\t\t\t};\n\t\tdefault:\n\t\t\tthrow new Error();\n\t}\n}\n\ntype NotificationUIStatePublish = (state: NotificationServiceState) => void;\n\n/**\n * Thin wrapper around usePubSub to give us typesafety for the notification service's UI state.\n * Automatically appends this client's windowName which is used by the notification service to\n * display the notification center on an appropriate monitor.\n */\nexport const useNotificationUI = (): [state: NotificationServiceState, setState: NotificationUIStatePublish] => {\n\tconst [state, setState] = usePubSub(NOTIFICATIONS_PUBSUB_TOPIC);\n\n\tconst setStateAndAddWindowName = (newState: NotificationServiceState) => {\n\t\tsetState({\n\t\t\t...newState,\n\t\t\tmostRecentWindowName: finsembleWindow.name,\n\t\t});\n\t};\n\treturn [state as NotificationServiceState, setStateAndAddWindowName];\n};\n\nconst getActiveDescriptorsByType = (componentType: string): Promise<any[]> =>\n\tnew Promise(async (resolve, reject) => {\n\t\tFSBL.Clients.LauncherClient.getActiveDescriptors((err: any, data: any) => {\n\t\t\tconst activeDescriptors: any[] = [];\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\tfor (const key in data) {\n\t\t\t\t\tif (data.hasOwnProperty(key) && data[key]?.componentType === componentType) {\n\t\t\t\t\t\tactiveDescriptors.push(data[key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve(activeDescriptors);\n\t\t});\n\t});\n\nlet toolbarWindowName: string;\n\nexport const moveToToolbarMonitor = async () => {\n\tconst getToolbarMonitorData = async () =>\n\t\tnew Promise(async (resolve, reject) => {\n\t\t\tif (!toolbarWindowName) {\n\t\t\t\tconst activeDescriptors = await getActiveDescriptorsByType(\"Toolbar\");\n\t\t\t\ttoolbarWindowName = activeDescriptors[0]?.name;\n\t\t\t}\n\t\t\tconst { err, data } = (await FSBL.Clients.LauncherClient.getMonitorInfo({\n\t\t\t\twindowIdentifier: { windowName: toolbarWindowName },\n\t\t\t})) as any;\n\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Could not get Monitor info\", err);\n\t\t\t\treject(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(data);\n\t\t});\n\n\tconst data = (await getToolbarMonitorData()) as any;\n\tconst { data: bounds } = await finsembleWindow.getBounds();\n\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\n\n\tfinsembleWindow.setBounds(\n\t\t{\n\t\t\tbounds: {\n\t\t\t\ttop: data[\"availableRect\"][\"top\"],\n\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\n\t\t\t\theight: data[\"availableRect\"][\"height\"],\n\t\t\t\twidth: width,\n\t\t\t},\n\t\t},\n\t\t(err: any) => {\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Could not update position\", err);\n\t\t\t}\n\t\t}\n\t);\n};\n\nexport const getOS = () => {\n\tif (navigator.platform.indexOf(\"Win\") != -1) {\n\t\treturn \"Windows\";\n\t} else if (navigator.platform.indexOf(\"Linux\") != -1) {\n\t\treturn \"Linux\";\n\t} else if (navigator.platform.indexOf(\"Mac\") != -1) {\n\t\treturn \"Mac\";\n\t}\n};\n\n/**\n * Example for setting up button clicks\n *\n * @param notification\n * @param action\n */\nexport const doAction = (notification: INotification, action: any) => {\n\ttry {\n\t\tNotificationClient.performAction([notification], action).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t\t// 1) alert user notification has been sent (action may not have completed)\n\t\t});\n\t} catch (e) {\n\t\t// NOTE: The request to perform the action has failed\n\t\tconsole.error(\"could not create a notification client\", e);\n\t\tFSBL.Clients.Logger.system.error(\"could not create a notification client\", e);\n\t}\n};\n\n/**\n * Example for setting up button clicks\n *\n * @param filter\n */\nexport const mute = async (filter: IMuteFilter) => {\n\ttry {\n\t\tawait NotificationClient.mute(filter);\n\t} catch (e) {\n\t\t// NOTE: The request to perform the action has failed\n\t\tconsole.error(\"Could not save mute preferences\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not save mute preferences\", e);\n\t}\n};\n\n/**\n * Example for setting up button clicks\n *\n * @param filter\n */\nexport const unmute = async (filter: IMuteFilter) => {\n\ttry {\n\t\tawait NotificationClient.unmute(filter);\n\t} catch (e) {\n\t\t// NOTE: The request to perform the action has failed\n\t\tconsole.error(\"Could not save mute preferences\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not save mute preferences\", e);\n\t}\n};\n\n/**\n * Snooze a notification\n *\n * @param {INotification[]} notifications\n */\nexport const snoozeNotifications = async (notifications: INotification[]) => {\n\tconst preferences: any = await FSBL.Clients.NotificationClient.getPreferences();\n\tconst snoozeAction = new FSBL.Clients.NotificationClient.Action();\n\tsnoozeAction.type = FSBL.Clients.NotificationClient.ActionTypes.SNOOZE;\n\tif (preferences && preferences.defaultSnoozePeriodSeconds) {\n\t\tsnoozeAction.milliseconds = preferences.defaultSnoozePeriodSeconds * 1000;\n\t}\n\tsnoozeAction.buttonText = \"Snooze\";\n\n\tfor (let i = 0; i < notifications.length; i++) {\n\t\tdoAction(notifications[i], snoozeAction);\n\t}\n};\n\n/**\n * Marks a notification as read\n *\n * @param {INotification[]} notifications\n */\nexport const markNotificationsUnread = (notifications: INotification[]) => {\n\ttry {\n\t\tNotificationClient.markUnread(notifications).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t});\n\t} catch (e) {\n\t\tconsole.error(\"Error marking messages as unread\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as unread\", e);\n\t}\n};\n\n/**\n * Marks a notification as read\n *\n * @param {INotification[]} notifications\n */\nexport const markNotificationsRead = (notifications: INotification[]) => {\n\ttry {\n\t\tNotificationClient.markRead(notifications).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t});\n\t} catch (e) {\n\t\tconsole.error(\"Error marking messages as read\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as read\", e);\n\t}\n};\n\n/**\n * Dismisses a notification\n *\n * @param {INotification[]} notifications\n */\nexport const dismissNotification = (notifications: INotification[]) => {\n\ttry {\n\t\tNotificationClient.deleteNotifications(notifications).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t});\n\t} catch (e) {\n\t\tconsole.error(\"Error marking messages as read\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as read\", e);\n\t}\n};\n\nexport const initializeCenterToggle = () => {\n\tconst [uiState, setUIState] = useNotificationUI();\n\n\tconst toggleCenter = () => {\n\t\tsetUIState({\n\t\t\t...uiState,\n\t\t\tshowCenter: !uiState.showCenter,\n\t\t});\n\t};\n\n\treturn {\n\t\ttoggleCenter,\n\t};\n};\n\n/**\n * Get Notification's config from\n */\nexport const getNotificationConfig = (): NotificationsConfig => {\n\tconst config: WindowConfig = WindowClient.options.customData;\n\n\treturn Object.assign(config?.window?.data?.notifications || {}, {\n\t\tisTransparent: config?.window?.options?.transparent || false,\n\t});\n};\n\nexport const getFetchHistoryParams = (config: any, params: any) => {\n\tconst notificationsHistory = config?.notificationsHistory || params?.config?.notificationsHistory;\n\n\t// Backwards compatibility - `since` replaced with `options` object\n\tlet options = notificationsHistory.since ? notificationsHistory.since : null;\n\n\t// Use options object if it's been set in the component config\n\tif (!options) {\n\t\toptions = notificationsHistory?.options;\n\t}\n\n\t// If no options object set and notificationsHistory is true set in config, use the params\n\tif (!options && typeof notificationsHistory === \"boolean\" && notificationsHistory) {\n\t\toptions = params?.config?.notificationsHistory.options;\n\t}\n\n\tconst filter = notificationsHistory.filter ? notificationsHistory.filter : null;\n\n\treturn [options, filter];\n};\n\nexport default function useNotifications(params: any = {}) {\n\tconst [state, dispatch] = useReducer(reducer, initialState);\n\n\t/*\n\t\tAction Creators\n\t*/\n\tconst removeNotification = (notification: INotification) => {\n\t\tdispatch({ type: REMOVE, payload: notification });\n\t};\n\n\tconst addNotification = (notification: INotification) => {\n\t\tdispatch({ type: UPDATE, payload: notification });\n\t};\n\n\tconst addMultipleNotifications = (notifications: INotification[]) => {\n\t\tdispatch({ type: CREATE_MULTIPLE, payload: notifications });\n\t};\n\n\t/**\n\t * Group Notifications by Type\n\t * @param notifications\n\t */\n\tconst groupNotificationsByType = (notifications: INotification[]) => {\n\t\tconst groupBy = (arr: INotification[]) =>\n\t\t\tarr\n\t\t\t\t.map((notification: INotification): string => notification.type ?? \"unknown\")\n\t\t\t\t.reduce((acc: { [x: string]: any }, notificationType: string, index: number) => {\n\t\t\t\t\tacc[notificationType] = [...(acc[notificationType] || []), arr[index]];\n\t\t\t\t\treturn acc;\n\t\t\t\t}, {});\n\n\t\treturn groupBy(notifications);\n\t};\n\n\t/**\n\t * \t * get the past notifications\n\t * WARNING - The default will get all notifications all the way back from 1969!!!\n\t * @param since\n\t * @param filter\n\t */\n\tconst getNotificationHistory = (\n\t\tsince: INotificationHistoryOptions = { sentAfter: \"1969-12-31T23:59:59.999Z\" },\n\t\tfilter: null | IFilter = null\n\t): Promise<INotification[]> => NotificationClient.fetchHistory(since, filter as IFilter);\n\n\tconst notificationIsActive = (notification: INotification, applyMuteFilterOverride?: boolean | undefined) => {\n\t\tlet applyMuteFilters = applyMuteFilterOverride;\n\n\t\tif (typeof applyMuteFilterOverride === \"undefined\") {\n\t\t\tconst config = getNotificationConfig();\n\t\t\tapplyMuteFilters = config?.applyMuteFilters ? config.applyMuteFilters : false;\n\t\t}\n\n\t\treturn (\n\t\t\t!notification.isSnoozed &&\n\t\t\t!notification.isRead &&\n\t\t\t!notification.isDeleted &&\n\t\t\t(applyMuteFilters ? !notification.isMuted : true)\n\t\t);\n\t};\n\n\tconst activeNotifications = (notifications: INotification[], applyMuteFilterOverride?: boolean | undefined) =>\n\t\tnotifications.filter((notification) => notificationIsActive(notification, applyMuteFilterOverride));\n\n\t/**\n\t * Main init function to start the subscription\n\t */\n\tasync function init() {\n\t\ttry {\n\t\t\tconst subscription = new NotificationClient.Subscription();\n\n\t\t\tconst notificationConfig: NotificationsConfig = getNotificationConfig();\n\n\t\t\tconst filter: IFilter = new NotificationClient.Filter();\n\n\t\t\t// make filters from the config\n\t\t\tif (notificationConfig) {\n\t\t\t\tnotificationConfig.filter &&\n\t\t\t\t\tnotificationConfig.filter.include &&\n\t\t\t\t\tfilter.include.push(...notificationConfig.filter.include);\n\n\t\t\t\tnotificationConfig.filter &&\n\t\t\t\t\tnotificationConfig.filter.exclude &&\n\t\t\t\t\tfilter.exclude.push(...notificationConfig.filter.exclude);\n\t\t\t}\n\n\t\t\tsubscription.filter = filter;\n\n\t\t\tconst notificationsHistory = notificationConfig?.notificationsHistory || params?.config?.notificationsHistory;\n\n\t\t\tif (notificationsHistory) {\n\t\t\t\tconst [options, historyFilter] = getFetchHistoryParams(notificationConfig, params);\n\n\t\t\t\tconst pastNotifications = await getNotificationHistory(options, historyFilter);\n\t\t\t\taddMultipleNotifications(pastNotifications);\n\t\t\t}\n\t\t\tconst onNotification = function (notification: INotification) {\n\t\t\t\t// This function will be called when a notification arrives\n\t\t\t\tif (notification.isDeleted) {\n\t\t\t\t\tremoveNotification(notification);\n\t\t\t\t} else {\n\t\t\t\t\taddNotification(notification);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn NotificationClient.subscribe(subscription, onNotification);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Set opaque class to html element\n\t */\n\tfunction setOpaqueClassName(isOpaque: boolean) {\n\t\tif (isOpaque) {\n\t\t\tconst htmlElement = document.getElementsByTagName(\"html\")[0];\n\t\t\tif (!htmlElement.className.includes(\"opaque\")) {\n\t\t\t\thtmlElement.className = `${htmlElement.className} opaque`;\n\t\t\t}\n\t\t}\n\t}\n\n\t// start receiving Notifications and putting them in state\n\tuseEffect(() => {\n\t\tconst subscribe = init();\n\t\treturn () => {\n\t\t\t// Unsubscribe using the subscription ID\n\t\t\t(async () => {\n\t\t\t\tconst subscribeObject = (await subscribe) as any;\n\t\t\t\tif (subscribeObject) {\n\t\t\t\t\tawait NotificationClient.unsubscribe(subscribeObject.id);\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tactiveNotifications,\n\t\taddNotification,\n\t\tnotificationIsActive,\n\t\tgetNotificationHistory,\n\t\tgroupNotificationsByType,\n\t\tnotifications: state.notifications,\n\t\tremoveNotification,\n\t\tsetOpaqueClassName,\n\t};\n}\n"]}
1
+ {"version":3,"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YAAY,CAAC,CAAC;iBAC9B;YACF,CAAC,CAAC;YAEF,OAAO,kBAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;SAClE;QAAC,OAAO,KAAK,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACrB;IACF,CAAC;IAKD,SAAS,kBAAkB,CAAC,QAAiB;QAC5C,IAAI,QAAQ,EAAE;YACb,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7D,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAC9C,WAAW,CAAC,SAAS,GAAG,GAAG,WAAW,CAAC,SAAS,SAAS,CAAC;aAC1D;SACD;IACF,CAAC;IAGD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE;YAEX,CAAC,KAAK,IAAI,EAAE;gBACX,MAAM,eAAe,GAAG,CAAC,MAAM,SAAS,CAAQ,CAAC;gBACjD,IAAI,eAAe,EAAE;oBACpB,MAAM,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;iBACzD;YACF,CAAC,CAAC,EAAE,CAAC;QACN,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACN,mBAAmB;QACnB,eAAe;QACf,oBAAoB;QACpB,sBAAsB;QACtB,wBAAwB;QACxB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB;QAClB,kBAAkB;KAClB,CAAC;AACH,CAAC","sourcesContent":["import { useEffect, useReducer } from \"react\";\nimport { WindowConfig, NotificationsConfig } from \"../components/notifications/types\";\nimport { usePubSub } from \"./usePubSub\";\nimport { NOTIFICATIONS_PUBSUB_TOPIC } from \"../components/notifications/constants\";\nimport { services } from \"@finsemble/finsemble-api\";\ntype NotificationServiceState = services.notification.types.NotificationServiceState;\n\ntype IFilter = services.notification.types.IFilter;\ntype IMuteFilter = services.notification.types.IMuteFilter;\ntype INotification = services.notification.types.INotification;\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\n\nconst { WindowClient, NotificationClient } = FSBL.Clients;\n\nconst initialState: any = { notifications: [] };\n\n/*\nAction Types\n*/\nconst CREATE_MULTIPLE = \"CREATE_MULTIPLE\";\nconst UPDATE = \"UPDATE\";\nconst REMOVE = \"REMOVE\";\n\n/*\n\tReducer\n\t*/\nfunction reducer(state: { notifications: INotification[] }, action: { type: string; payload: any }) {\n\tswitch (action.type) {\n\t\tcase CREATE_MULTIPLE:\n\t\t\treturn {\n\t\t\t\tnotifications: [...state.notifications, ...action.payload],\n\t\t\t};\n\t\tcase UPDATE: {\n\t\t\t// check to see if the notification exists if so update the values\n\t\t\tconst notificationExistsInArray = state.notifications.find(\n\t\t\t\t(notification: INotification) => notification.id === action.payload.id\n\t\t\t);\n\n\t\t\t//if the notification exists then do nothing and return the current state else add the the new notification to the state\n\t\t\tconst notifications = notificationExistsInArray\n\t\t\t\t? state.notifications.map((notification: INotification) =>\n\t\t\t\t\t\tnotification.id === action.payload.id ? action.payload : notification\n\t\t\t\t )\n\t\t\t\t: [action.payload, ...state.notifications];\n\n\t\t\treturn { notifications };\n\t\t}\n\t\tcase REMOVE:\n\t\t\treturn {\n\t\t\t\tnotifications: state.notifications.filter((notification) => notification.id !== action.payload.id),\n\t\t\t};\n\t\tdefault:\n\t\t\tthrow new Error();\n\t}\n}\n\ntype NotificationUIStatePublish = (state: NotificationServiceState) => void;\n\n/**\n * Thin wrapper around usePubSub to give us typesafety for the notification service's UI state.\n * Automatically appends this client's windowName which is used by the notification service to\n * display the notification center on an appropriate monitor.\n */\nexport const useNotificationUI = (): [state: NotificationServiceState, setState: NotificationUIStatePublish] => {\n\tconst [state, setState] = usePubSub(NOTIFICATIONS_PUBSUB_TOPIC);\n\n\tconst setStateAndAddWindowName = (newState: NotificationServiceState) => {\n\t\tsetState({\n\t\t\t...newState,\n\t\t\tmostRecentWindowName: finsembleWindow.name,\n\t\t});\n\t};\n\treturn [state as NotificationServiceState, setStateAndAddWindowName];\n};\n\nconst getActiveDescriptorsByType = (componentType: string): Promise<any[]> =>\n\tnew Promise(async (resolve, reject) => {\n\t\tFSBL.Clients.LauncherClient.getActiveDescriptors((err: any, data: any) => {\n\t\t\tconst activeDescriptors: any[] = [];\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\tfor (const key in data) {\n\t\t\t\t\tif (data.hasOwnProperty(key) && data[key]?.componentType === componentType) {\n\t\t\t\t\t\tactiveDescriptors.push(data[key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve(activeDescriptors);\n\t\t});\n\t});\n\nlet toolbarWindowName: string;\n\nexport const moveToToolbarMonitor = async () => {\n\tconst getToolbarMonitorData = async () =>\n\t\tnew Promise(async (resolve, reject) => {\n\t\t\tif (!toolbarWindowName) {\n\t\t\t\tconst activeDescriptors = await getActiveDescriptorsByType(\"Toolbar\");\n\t\t\t\ttoolbarWindowName = activeDescriptors[0]?.name;\n\t\t\t}\n\t\t\tconst { err, data } = (await FSBL.Clients.LauncherClient.getMonitorInfo({\n\t\t\t\twindowIdentifier: { windowName: toolbarWindowName },\n\t\t\t})) as any;\n\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Could not get Monitor info\", err);\n\t\t\t\treject(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(data);\n\t\t});\n\n\tconst data = (await getToolbarMonitorData()) as any;\n\tconst { data: bounds } = await finsembleWindow.getBounds();\n\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\n\n\tfinsembleWindow.setBounds(\n\t\t{\n\t\t\tbounds: {\n\t\t\t\ttop: data[\"availableRect\"][\"top\"],\n\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\n\t\t\t\theight: data[\"availableRect\"][\"height\"],\n\t\t\t\twidth: width,\n\t\t\t},\n\t\t},\n\t\t(err: any) => {\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Could not update position\", err);\n\t\t\t}\n\t\t}\n\t);\n};\n\nexport const getOS = () => {\n\tif (navigator.platform.indexOf(\"Win\") != -1) {\n\t\treturn \"Windows\";\n\t} else if (navigator.platform.indexOf(\"Linux\") != -1) {\n\t\treturn \"Linux\";\n\t} else if (navigator.platform.indexOf(\"Mac\") != -1) {\n\t\treturn \"Mac\";\n\t}\n};\n\n/**\n * Example for setting up button clicks\n *\n * @param notification\n * @param action\n */\nexport const doAction = (notification: INotification, action: any) => {\n\ttry {\n\t\tNotificationClient.performAction([notification], action).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t\t// 1) alert user notification has been sent (action may not have completed)\n\t\t});\n\t} catch (e) {\n\t\t// NOTE: The request to perform the action has failed\n\t\tconsole.error(\"could not create a notification client\", e);\n\t\tFSBL.Clients.Logger.system.error(\"could not create a notification client\", e);\n\t}\n};\n\n/**\n * Example for setting up button clicks\n *\n * @param filter\n */\nexport const mute = async (filter: IMuteFilter) => {\n\ttry {\n\t\tawait NotificationClient.mute(filter);\n\t} catch (e) {\n\t\t// NOTE: The request to perform the action has failed\n\t\tconsole.error(\"Could not save mute preferences\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not save mute preferences\", e);\n\t}\n};\n\n/**\n * Example for setting up button clicks\n *\n * @param filter\n */\nexport const unmute = async (filter: IMuteFilter) => {\n\ttry {\n\t\tawait NotificationClient.unmute(filter);\n\t} catch (e) {\n\t\t// NOTE: The request to perform the action has failed\n\t\tconsole.error(\"Could not save mute preferences\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not save mute preferences\", e);\n\t}\n};\n\n/**\n * Snooze a notification\n *\n * @param {INotification[]} notifications\n */\nexport const snoozeNotifications = async (notifications: INotification[]) => {\n\tconst preferences: any = await FSBL.Clients.NotificationClient.getPreferences();\n\tconst snoozeAction = new FSBL.Clients.NotificationClient.Action();\n\tsnoozeAction.type = FSBL.Clients.NotificationClient.ActionTypes.SNOOZE;\n\tif (preferences && preferences.defaultSnoozePeriodSeconds) {\n\t\tsnoozeAction.milliseconds = preferences.defaultSnoozePeriodSeconds * 1000;\n\t}\n\tsnoozeAction.buttonText = \"Snooze\";\n\n\tfor (let i = 0; i < notifications.length; i++) {\n\t\tdoAction(notifications[i], snoozeAction);\n\t}\n};\n\n/**\n * Marks a notification as read\n *\n * @param {INotification[]} notifications\n */\nexport const markNotificationsUnread = (notifications: INotification[]) => {\n\ttry {\n\t\tNotificationClient.markUnread(notifications).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t});\n\t} catch (e) {\n\t\tconsole.error(\"Error marking messages as unread\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as unread\", e);\n\t}\n};\n\n/**\n * Marks a notification as read\n *\n * @param {INotification[]} notifications\n */\nexport const markNotificationsRead = (notifications: INotification[]) => {\n\ttry {\n\t\tNotificationClient.markRead(notifications).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t});\n\t} catch (e) {\n\t\tconsole.error(\"Error marking messages as read\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as read\", e);\n\t}\n};\n\n/**\n * Dismisses a notification\n *\n * @param {INotification[]} notifications\n */\nexport const dismissNotification = (notifications: INotification[]) => {\n\ttry {\n\t\tNotificationClient.deleteNotifications(notifications).then(() => {\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\n\t\t\t// The action itself has not necessarily been perform successfully\n\t\t});\n\t} catch (e) {\n\t\tconsole.error(\"Error marking messages as read\", e);\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as read\", e);\n\t}\n};\n\nexport const initializeCenterToggle = () => {\n\tconst [uiState, setUIState] = useNotificationUI();\n\n\tconst toggleCenter = () => {\n\t\tsetUIState({\n\t\t\t...uiState,\n\t\t\tshowCenter: !uiState.showCenter,\n\t\t});\n\t};\n\n\treturn {\n\t\ttoggleCenter,\n\t};\n};\n\n/**\n * Get Notification's config from\n */\nexport const getNotificationConfig = (): NotificationsConfig => {\n\tconst config: WindowConfig = WindowClient.options.customData;\n\n\treturn Object.assign(config?.window?.data?.notifications || {}, {\n\t\tisTransparent: config?.window?.options?.transparent || false,\n\t});\n};\n\nexport const getFetchHistoryParams = (config: any, params: any) => {\n\tconst notificationsHistory = config?.notificationsHistory || params?.config?.notificationsHistory;\n\n\t// Backwards compatibility - `since` replaced with `options` object\n\tlet options = notificationsHistory.since ? notificationsHistory.since : null;\n\n\t// Use options object if it's been set in the component config\n\tif (!options) {\n\t\toptions = notificationsHistory?.options;\n\t}\n\n\t// If no options object set and notificationsHistory is true set in config, use the params\n\tif (!options && typeof notificationsHistory === \"boolean\" && notificationsHistory) {\n\t\toptions = params?.config?.notificationsHistory.options;\n\t}\n\n\tconst filter = notificationsHistory.filter ? notificationsHistory.filter : null;\n\n\treturn [options, filter];\n};\n\nexport default function useNotifications(params: any = {}) {\n\tconst [state, dispatch] = useReducer(reducer, initialState);\n\n\t/*\n\t\tAction Creators\n\t*/\n\tconst removeNotification = (notification: INotification) => {\n\t\tdispatch({ type: REMOVE, payload: notification });\n\t};\n\n\tconst addNotification = (notification: INotification) => {\n\t\tdispatch({ type: UPDATE, payload: notification });\n\t};\n\n\tconst addMultipleNotifications = (notifications: INotification[]) => {\n\t\tdispatch({ type: CREATE_MULTIPLE, payload: notifications });\n\t};\n\n\t/**\n\t * Group Notifications by Type\n\t * @param notifications\n\t */\n\tconst groupNotificationsByType = (notifications: INotification[]) => {\n\t\tconst groupBy = (arr: INotification[]) =>\n\t\t\tarr\n\t\t\t\t.map((notification: INotification): string => notification.type ?? \"unknown\")\n\t\t\t\t.reduce((acc: { [x: string]: any }, notificationType: string, index: number) => {\n\t\t\t\t\tacc[notificationType] = [...(acc[notificationType] || []), arr[index]];\n\t\t\t\t\treturn acc;\n\t\t\t\t}, {});\n\n\t\treturn groupBy(notifications);\n\t};\n\n\t/**\n\t * \t * get the past notifications\n\t * WARNING - The default will get all notifications all the way back from 1969!!!\n\t * @param since\n\t * @param filter\n\t */\n\tconst getNotificationHistory = (\n\t\tsince: INotificationHistoryOptions = { sentAfter: \"1969-12-31T23:59:59.999Z\" },\n\t\tfilter: null | IFilter = null\n\t): Promise<INotification[]> => NotificationClient.fetchHistory(since, filter as IFilter);\n\n\tconst notificationIsActive = (notification: INotification, applyMuteFilterOverride?: boolean | undefined) => {\n\t\tlet applyMuteFilters = applyMuteFilterOverride;\n\n\t\tif (typeof applyMuteFilterOverride === \"undefined\") {\n\t\t\tconst config = getNotificationConfig();\n\t\t\tapplyMuteFilters = config?.applyMuteFilters ? config.applyMuteFilters : false;\n\t\t}\n\n\t\treturn (\n\t\t\t!notification.isSnoozed &&\n\t\t\t!notification.isRead &&\n\t\t\t!notification.isDeleted &&\n\t\t\t(applyMuteFilters ? !notification.isMuted : true)\n\t\t);\n\t};\n\n\tconst activeNotifications = (notifications: INotification[], applyMuteFilterOverride?: boolean | undefined) =>\n\t\tnotifications.filter((notification) => notificationIsActive(notification, applyMuteFilterOverride));\n\n\t/**\n\t * Main init function to start the subscription\n\t */\n\tasync function init() {\n\t\ttry {\n\t\t\tconst subscription = new NotificationClient.Subscription();\n\n\t\t\tconst notificationConfig: NotificationsConfig = getNotificationConfig();\n\n\t\t\tconst filter: IFilter = new NotificationClient.Filter();\n\n\t\t\t// make filters from the config\n\t\t\tif (notificationConfig) {\n\t\t\t\tnotificationConfig.filter &&\n\t\t\t\t\tnotificationConfig.filter.include &&\n\t\t\t\t\tfilter.include.push(...notificationConfig.filter.include);\n\n\t\t\t\tnotificationConfig.filter &&\n\t\t\t\t\tnotificationConfig.filter.exclude &&\n\t\t\t\t\tfilter.exclude.push(...notificationConfig.filter.exclude);\n\t\t\t}\n\n\t\t\tsubscription.filter = filter;\n\n\t\t\tconst notificationsHistory = notificationConfig?.notificationsHistory || params?.config?.notificationsHistory;\n\n\t\t\tif (notificationsHistory) {\n\t\t\t\tconst [options, historyFilter] = getFetchHistoryParams(notificationConfig, params);\n\n\t\t\t\tconst pastNotifications = await getNotificationHistory(options, historyFilter);\n\t\t\t\taddMultipleNotifications(pastNotifications);\n\t\t\t}\n\t\t\tconst onNotification = function (notification: INotification) {\n\t\t\t\t// This function will be called when a notification arrives\n\t\t\t\tif (notification.isDeleted) {\n\t\t\t\t\tremoveNotification(notification);\n\t\t\t\t} else {\n\t\t\t\t\taddNotification(notification);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn NotificationClient.subscribe(subscription, onNotification);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Set opaque class to html element\n\t */\n\tfunction setOpaqueClassName(isOpaque: boolean) {\n\t\tif (isOpaque) {\n\t\t\tconst htmlElement = document.getElementsByTagName(\"html\")[0];\n\t\t\tif (!htmlElement.className.includes(\"opaque\")) {\n\t\t\t\thtmlElement.className = `${htmlElement.className} opaque`;\n\t\t\t}\n\t\t}\n\t}\n\n\t// start receiving Notifications and putting them in state\n\tuseEffect(() => {\n\t\tconst subscribe = init();\n\t\treturn () => {\n\t\t\t// Unsubscribe using the subscription ID\n\t\t\t(async () => {\n\t\t\t\tconst subscribeObject = (await subscribe) as any;\n\t\t\t\tif (subscribeObject) {\n\t\t\t\t\tawait NotificationClient.unsubscribe(subscribeObject.id);\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tactiveNotifications,\n\t\taddNotification,\n\t\tnotificationIsActive,\n\t\tgetNotificationHistory,\n\t\tgroupNotificationsByType,\n\t\tnotifications: state.notifications,\n\t\tremoveNotification,\n\t\tsetOpaqueClassName,\n\t};\n}\n"]}
@@ -1,6 +1,4 @@
1
- import { DashbarItem } from "../types/dashbarTypes";
2
1
  export declare const useToolbar: () => {
3
- dashbarItems: DashbarItem[];
4
2
  removeSystemClosePrevention: () => void;
5
3
  preventSystemClose: () => void;
6
4
  minimizeAllWindows: () => void;
@@ -8,9 +6,5 @@ export declare const useToolbar: () => {
8
6
  toggleAutoArrange: () => void;
9
7
  showToolbar: () => void;
10
8
  hideToolbar: () => void;
11
- reorderDashbarItems: ({ oldIndex, newIndex }: {
12
- oldIndex: number;
13
- newIndex: number;
14
- }) => void;
15
9
  launchPreferences: (tabName: string) => void;
16
10
  };