@finsemble/finsemble-ui 6.3.0 → 6.4.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 (745) hide show
  1. package/README.md +28 -28
  2. package/package.json +21 -33
  3. package/react/actions/favoriteActions.js.map +1 -1
  4. package/react/actions/linkerActions.js.map +1 -1
  5. package/react/actions/menuActions.js.map +1 -1
  6. package/react/actions/rootActions.js.map +1 -1
  7. package/react/actions/searchActions.js.map +1 -1
  8. package/react/actions/smartDesktopDesignerActions.d.ts +1 -3
  9. package/react/actions/smartDesktopDesignerActions.js +0 -1
  10. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  11. package/react/actions/toolbarActions.js.map +1 -1
  12. package/react/actions/workspaceActions.js.map +1 -1
  13. package/react/assets/css/advancedAppLauncher.css +636 -636
  14. package/react/assets/css/appCatalog.css +1069 -1069
  15. package/react/assets/css/authentication.css +78 -78
  16. package/react/assets/css/button.css +220 -220
  17. package/react/assets/css/core/formElements.css +23 -23
  18. package/react/assets/css/core/icons.css +69 -69
  19. package/react/assets/css/core/notifications.css +75 -75
  20. package/react/assets/css/core/windowFrame.css +36 -36
  21. package/react/assets/css/dashbar.css +78 -78
  22. package/react/assets/css/defaultTheme.css +356 -356
  23. package/react/assets/css/dialogs.css +158 -158
  24. package/react/assets/css/favorites.css +101 -101
  25. package/react/assets/css/finsemble.css +38 -38
  26. package/react/assets/css/focus.css +4 -4
  27. package/react/assets/css/font-finance.css +385 -385
  28. package/react/assets/css/fonts/Open_Sans/LICENSE.txt +202 -202
  29. package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +118 -118
  30. package/react/assets/css/fonts/font-finance.svg +124 -124
  31. package/react/assets/css/fonts/icons-reference.html +1174 -1174
  32. package/react/assets/css/linkerWindow.css +124 -124
  33. package/react/assets/css/menus.css +195 -195
  34. package/react/assets/css/notificationsCenter.css +597 -597
  35. package/react/assets/css/processMonitor.css +213 -213
  36. package/react/assets/css/search.css +128 -128
  37. package/react/assets/css/shared/animations.css +99 -99
  38. package/react/assets/css/tags.css +136 -136
  39. package/react/assets/css/toolbar.css +413 -413
  40. package/react/assets/css/userPreferences.css +538 -568
  41. package/react/assets/css/windowTitleBar.css +653 -652
  42. package/react/assets/icons/always-on-top.svg +20 -0
  43. package/react/assets/icons/caret.svg +7 -0
  44. package/react/assets/icons/check-square.svg +5 -5
  45. package/react/assets/icons/check.svg +3 -3
  46. package/react/assets/icons/chevron-left.svg +3 -3
  47. package/react/assets/icons/chevron-right.svg +3 -3
  48. package/react/assets/icons/close.svg +11 -0
  49. package/react/assets/icons/copy.svg +10 -10
  50. package/react/assets/icons/documentation.svg +20 -0
  51. package/react/assets/icons/exclamation-circle.svg +4 -4
  52. package/react/assets/icons/external-link.svg +12 -12
  53. package/react/assets/icons/flag.svg +10 -10
  54. package/react/assets/icons/folder.svg +3 -3
  55. package/react/assets/icons/font.svg +3 -3
  56. package/react/assets/icons/globe.svg +3 -3
  57. package/react/assets/icons/hdd.svg +9 -9
  58. package/react/assets/icons/key.svg +10 -10
  59. package/react/assets/icons/life-ring.svg +3 -3
  60. package/react/assets/icons/linker.svg +18 -0
  61. package/react/assets/icons/lock.svg +5 -5
  62. package/react/assets/icons/magic.svg +15 -15
  63. package/react/assets/icons/maximize.svg +16 -0
  64. package/react/assets/icons/minimize.svg +15 -0
  65. package/react/assets/icons/moon.svg +10 -10
  66. package/react/assets/icons/paint-roller.svg +3 -3
  67. package/react/assets/icons/pencil.svg +10 -10
  68. package/react/assets/icons/plus.svg +3 -3
  69. package/react/assets/icons/question-circle.svg +5 -5
  70. package/react/assets/icons/search.svg +3 -3
  71. package/react/assets/icons/sun.svg +9 -9
  72. package/react/assets/icons/times.svg +3 -3
  73. package/react/assets/icons/toggle-off.svg +6 -6
  74. package/react/assets/icons/toggle-on.svg +6 -6
  75. package/react/assets/icons/toolbar.svg +12 -0
  76. package/react/assets/icons/tools.svg +3 -3
  77. package/react/assets/icons/trash.svg +12 -12
  78. package/react/assets/icons/upload.svg +10 -10
  79. package/react/assets/icons/window.svg +3 -3
  80. package/react/assets/img/finsemble-display.png +0 -0
  81. package/react/componentTemplateGenerator.js +85 -85
  82. package/react/componentTemplateGenerator.js.map +1 -1
  83. package/react/components/FinsembleProvider.js.map +1 -1
  84. package/react/components/appCatalog/AppCatalog.js.map +1 -1
  85. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  86. package/react/components/appCatalog/components/AppCard.js.map +1 -1
  87. package/react/components/appCatalog/components/AppList.js.map +1 -1
  88. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  89. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  90. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  91. package/react/components/appCatalog/components/Hero.js.map +1 -1
  92. package/react/components/appCatalog/components/Home.js.map +1 -1
  93. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  94. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  95. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  96. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  97. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  98. package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
  99. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  100. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
  101. package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
  102. package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
  103. package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
  104. package/react/components/appCatalog/components/Tag.js.map +1 -1
  105. package/react/components/appCatalog/components/Toast.js.map +1 -1
  106. package/react/components/appCatalog/components/helpers.js.map +1 -1
  107. package/react/components/appCatalog/index.js.map +1 -1
  108. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  109. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  110. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  111. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  112. package/react/components/common/Accordion.d.ts +11 -0
  113. package/react/components/common/Accordion.js +20 -0
  114. package/react/components/common/Accordion.js.map +1 -0
  115. package/react/components/common/Button.js.map +1 -1
  116. package/react/components/common/ButtonIcon.js.map +1 -1
  117. package/react/components/common/ButtonRow.js.map +1 -1
  118. package/react/components/common/ButtonTile.js.map +1 -1
  119. package/react/components/common/Checkbox.d.ts +1 -0
  120. package/react/components/common/Checkbox.js +3 -1
  121. package/react/components/common/Checkbox.js.map +1 -1
  122. package/react/components/common/ColorPicker.js.map +1 -1
  123. package/react/components/common/DropZone.js.map +1 -1
  124. package/react/components/common/DropdownButton.js.map +1 -1
  125. package/react/components/common/FileInput.d.ts +2 -1
  126. package/react/components/common/FileInput.js +9 -4
  127. package/react/components/common/FileInput.js.map +1 -1
  128. package/react/components/common/FinsembleIcon.d.ts +1 -1
  129. package/react/components/common/FinsembleIcon.js +16 -0
  130. package/react/components/common/FinsembleIcon.js.map +1 -1
  131. package/react/components/common/FinsembleSelect.js.map +1 -1
  132. package/react/components/common/FinsembleToggle.js.map +1 -1
  133. package/react/components/common/Header.js +1 -1
  134. package/react/components/common/Header.js.map +1 -1
  135. package/react/components/common/ImagePreview.js.map +1 -1
  136. package/react/components/common/InputTable.d.ts +11 -0
  137. package/react/components/common/InputTable.js +50 -0
  138. package/react/components/common/InputTable.js.map +1 -0
  139. package/react/components/common/LoadingSpinner.js.map +1 -1
  140. package/react/components/common/Tab.js.map +1 -1
  141. package/react/components/common/Tooltip.js.map +1 -1
  142. package/react/components/common/css/accordion.css +99 -0
  143. package/react/components/common/css/application-edit-page.css +324 -117
  144. package/react/components/common/css/application-list.css +49 -47
  145. package/react/components/common/css/button.css +166 -164
  146. package/react/components/common/css/checkbox.css +30 -0
  147. package/react/components/common/css/color-picker.css +52 -52
  148. package/react/components/common/css/drop-zone.css +17 -17
  149. package/react/components/common/css/file-input.css +65 -49
  150. package/react/components/common/css/header.css +30 -43
  151. package/react/components/common/css/icon.css +13 -13
  152. package/react/components/common/css/image-preview.css +57 -57
  153. package/react/components/common/css/loading-spinner.css +39 -39
  154. package/react/components/common/css/selector.css +51 -51
  155. package/react/components/common/css/styles.css +127 -128
  156. package/react/components/common/css/tab.css +56 -56
  157. package/react/components/common/css/toggle.css +32 -32
  158. package/react/components/common/css/tooltip.css +78 -78
  159. package/react/components/common/file_helpers.js.map +1 -1
  160. package/react/components/common/fixtures/FinsembleIcon.css +4 -4
  161. package/react/components/common/helpers.js.map +1 -1
  162. package/react/components/common/stories/Accordion.stories.d.ts +14 -0
  163. package/react/components/common/stories/Accordion.stories.js +42 -0
  164. package/react/components/common/stories/Accordion.stories.js.map +1 -0
  165. package/react/components/common/stories/Button.stories.js.map +1 -1
  166. package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
  167. package/react/components/common/stories/ButtonRow.stories.js.map +1 -1
  168. package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
  169. package/react/components/common/stories/Checkbox.stories.js.map +1 -1
  170. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  171. package/react/components/common/stories/DropZone.stories.js.map +1 -1
  172. package/react/components/common/stories/DropdownButton.stories.d.ts +11 -0
  173. package/react/components/common/stories/DropdownButton.stories.js +12 -0
  174. package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
  175. package/react/components/common/stories/FileInput.stories.d.ts +2 -1
  176. package/react/components/common/stories/FileInput.stories.js +6 -0
  177. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  178. package/react/components/common/stories/FinsembleIcon.stories.js +1 -0
  179. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  180. package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
  181. package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
  182. package/react/components/common/stories/Header.stories.js.map +1 -1
  183. package/react/components/common/stories/ImagePreview.stories.js.map +1 -1
  184. package/react/components/common/stories/InputTable.stories.d.ts +12 -0
  185. package/react/components/common/stories/InputTable.stories.js +35 -0
  186. package/react/components/common/stories/InputTable.stories.js.map +1 -0
  187. package/react/components/common/stories/LoadingSpinner.stories.js.map +1 -1
  188. package/react/components/common/stories/Tab.stories.js.map +1 -1
  189. package/react/components/common/stories/Tooltip.stories.js.map +1 -1
  190. package/react/components/{smartDesktopDesigner/tests/ApplicationEdit.spec.d.ts → common/tests/Accordion.spec.d.ts} +0 -0
  191. package/react/components/common/tests/Accordion.spec.js +53 -0
  192. package/react/components/common/tests/Accordion.spec.js.map +1 -0
  193. package/react/components/common/tests/ButtonRow.spec.js.map +1 -1
  194. package/react/components/common/tests/Checkbox.spec.js +5 -3
  195. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  196. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  197. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  198. package/react/components/common/tests/FileInput.spec.js +20 -5
  199. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  200. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  201. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  202. package/react/components/common/tests/Header.spec.js +6 -2
  203. package/react/components/common/tests/Header.spec.js.map +1 -1
  204. package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
  205. package/react/components/{smartDesktopDesigner/tests/ApplicationSetup.spec.d.ts → common/tests/InputTable.spec.d.ts} +0 -0
  206. package/react/components/common/tests/InputTable.spec.js +166 -0
  207. package/react/components/common/tests/InputTable.spec.js.map +1 -0
  208. package/react/components/common/tests/Tab.spec.js.map +1 -1
  209. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  210. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  211. package/react/components/favorites/FavoritesShell.js.map +1 -1
  212. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  213. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  214. package/react/components/favorites/index.js.map +1 -1
  215. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  216. package/react/components/fdc3Resolver/ResolverDialog.css +126 -126
  217. package/react/components/fdc3Resolver/ResolverDialog.js +1 -1
  218. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  219. package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -1
  220. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  221. package/react/components/fdc3Resolver/ResolverDialog.stories.js +13 -0
  222. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  223. package/react/components/icon/Icon.js.map +1 -1
  224. package/react/components/icon/index.js.map +1 -1
  225. package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
  226. package/react/components/legacyControls/FinsembleDialogButton.js +1 -1
  227. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  228. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  229. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  230. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  231. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  232. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  233. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  234. package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
  235. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
  236. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
  237. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
  238. package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
  239. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  240. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +1 -1
  241. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  242. package/react/components/linker/LinkerMenu.js.map +1 -1
  243. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  244. package/react/components/linker/index.js.map +1 -1
  245. package/react/components/linker/remoteRedux.js.map +1 -1
  246. package/react/components/menu/Menu.d.ts +1 -0
  247. package/react/components/menu/Menu.js.map +1 -1
  248. package/react/components/menu/MenuAutoResizer.d.ts +2 -1
  249. package/react/components/menu/MenuAutoResizer.js +4 -3
  250. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  251. package/react/components/menu/MenuContent.js.map +1 -1
  252. package/react/components/menu/MenuHotKey.js.map +1 -1
  253. package/react/components/menu/MenuItem.js.map +1 -1
  254. package/react/components/menu/MenuPortal.js +99 -92
  255. package/react/components/menu/MenuPortal.js.map +1 -1
  256. package/react/components/menu/MenuShell.d.ts +1 -0
  257. package/react/components/menu/MenuShell.js +3 -2
  258. package/react/components/menu/MenuShell.js.map +1 -1
  259. package/react/components/menu/MenuToggle.js.map +1 -1
  260. package/react/components/menu/index.js.map +1 -1
  261. package/react/components/menu/keyboardNavigation.js.map +1 -1
  262. package/react/components/menu/menuContext.d.ts +1 -0
  263. package/react/components/menu/menuContext.js.map +1 -1
  264. package/react/components/menu/menuHelpers.d.ts +1 -1
  265. package/react/components/menu/menuHelpers.js +2 -2
  266. package/react/components/menu/menuHelpers.js.map +1 -1
  267. package/react/components/notifications/components/NoNotifications.js.map +1 -1
  268. package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
  269. package/react/components/notifications/components/drawer/DrawerControls.js +30 -6
  270. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  271. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  272. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +2 -0
  273. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  274. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +20 -27
  275. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  276. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  277. package/react/components/notifications/components/shared/IconButton.js +5 -1
  278. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  279. package/react/components/notifications/components/shared/NotificationCardShell.js +1 -1
  280. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  281. package/react/components/notifications/components/shared/OverflowMenu.js +5 -1
  282. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  283. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  284. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyContentLogo.js.map +1 -1
  285. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  286. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  287. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderLogo.js.map +1 -1
  288. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  289. package/react/components/notifications/components/views/CardView.js.map +1 -1
  290. package/react/components/notifications/components/views/ListView.js +1 -1
  291. package/react/components/notifications/components/views/ListView.js.map +1 -1
  292. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  293. package/react/components/notifications/constants.js.map +1 -1
  294. package/react/components/notifications/icons/Card.js.map +1 -1
  295. package/react/components/notifications/icons/Chevron.js.map +1 -1
  296. package/react/components/notifications/icons/CloseIcon.js.map +1 -1
  297. package/react/components/notifications/icons/EnvelopeClose.js.map +1 -1
  298. package/react/components/notifications/icons/EnvelopeOpen.js.map +1 -1
  299. package/react/components/notifications/icons/SnoozeIcon.js.map +1 -1
  300. package/react/components/notifications/index.js.map +1 -1
  301. package/react/components/notifications/notificationsContext.js.map +1 -1
  302. package/react/components/notifications/types.js.map +1 -1
  303. package/react/components/notifications/utils.js.map +1 -1
  304. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  305. package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -1
  306. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  307. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  308. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  309. package/react/components/processMonitor/constants.js.map +1 -1
  310. package/react/components/processMonitor/helpers.js.map +1 -1
  311. package/react/components/processMonitor/helpers.spec.js.map +1 -1
  312. package/react/components/processMonitor/index.js.map +1 -1
  313. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +1 -0
  314. package/react/components/processMonitor/stores/ProcessMonitorStore.js +51 -50
  315. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  316. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  317. package/react/components/quickComponentForm/index.js.map +1 -1
  318. package/react/components/quickComponentForm/quickComponent.css +3 -3
  319. package/react/components/search/Highlight.js.map +1 -1
  320. package/react/components/search/Highlight.spec.js.map +1 -1
  321. package/react/components/search/Highlight.stories.js.map +1 -1
  322. package/react/components/search/Search.js.map +1 -1
  323. package/react/components/search/SearchBestMatch.js.map +1 -1
  324. package/react/components/search/SearchInput.js.map +1 -1
  325. package/react/components/search/SearchProviderResults.js.map +1 -1
  326. package/react/components/search/SearchResult.js.map +1 -1
  327. package/react/components/search/SearchResults.js.map +1 -1
  328. package/react/components/search/index.js.map +1 -1
  329. package/react/components/shared/Animate.js.map +1 -1
  330. package/react/components/shared/BellIcon.js.map +1 -1
  331. package/react/components/shared/BellIconCrossed.js.map +1 -1
  332. package/react/components/shared/Button.js.map +1 -1
  333. package/react/components/shared/ConditionalWrapper.js.map +1 -1
  334. package/react/components/shared/DefaultDropdownButton.js +1 -1
  335. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  336. package/react/components/shared/NavigationButton.js.map +1 -1
  337. package/react/components/shared/Tag.js.map +1 -1
  338. package/react/components/shared/TagsMenu.js.map +1 -1
  339. package/react/components/shared/addProtocolToValidURL.js.map +1 -1
  340. package/react/components/shared/linkerUtil.js.map +1 -1
  341. package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
  342. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
  343. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
  344. package/react/components/shared/validateURL.js.map +1 -1
  345. package/react/components/shared/validateURL.spec.js.map +1 -1
  346. package/react/components/singleInputDialog/SingleInputDialog.css +3 -3
  347. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  348. package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
  349. package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
  350. package/react/components/singleInputDialog/index.js.map +1 -1
  351. package/react/components/smartDesktopDesigner/AddApp.d.ts +14 -0
  352. package/react/components/smartDesktopDesigner/AddApp.js +60 -0
  353. package/react/components/smartDesktopDesigner/AddApp.js.map +1 -0
  354. package/react/components/smartDesktopDesigner/AppEditAccess.js +16 -32
  355. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  356. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +5 -19
  357. package/react/components/smartDesktopDesigner/AppEditPage.js +548 -59
  358. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  359. package/react/components/smartDesktopDesigner/Appearance.css +27 -94
  360. package/react/components/smartDesktopDesigner/Appearance.helpers.js.map +1 -1
  361. package/react/components/smartDesktopDesigner/Appearance.js +1 -1
  362. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  363. package/react/components/smartDesktopDesigner/Application.d.ts +1 -0
  364. package/react/components/smartDesktopDesigner/Application.js +151 -93
  365. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  366. package/react/components/smartDesktopDesigner/ApplicationList.d.ts +2 -1
  367. package/react/components/smartDesktopDesigner/ApplicationList.js +7 -3
  368. package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
  369. package/react/components/smartDesktopDesigner/Applications.d.ts +0 -3
  370. package/react/components/smartDesktopDesigner/Applications.js +52 -102
  371. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  372. package/react/components/smartDesktopDesigner/AssetsPage.css +26 -26
  373. package/react/components/smartDesktopDesigner/AssetsPage.js.map +1 -1
  374. package/react/components/smartDesktopDesigner/Authentication.js +2 -9
  375. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  376. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js +8 -1
  377. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  378. package/react/components/smartDesktopDesigner/Content.js.map +1 -1
  379. package/react/components/smartDesktopDesigner/ContentHeader.d.ts +5 -0
  380. package/react/components/smartDesktopDesigner/ContentHeader.js +10 -0
  381. package/react/components/smartDesktopDesigner/ContentHeader.js.map +1 -0
  382. package/react/components/smartDesktopDesigner/CurrentView.js +2 -1
  383. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  384. package/react/components/smartDesktopDesigner/Export.d.ts +1 -0
  385. package/react/components/smartDesktopDesigner/Export.js +40 -9
  386. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  387. package/react/components/smartDesktopDesigner/ExportCloud.d.ts +3 -1
  388. package/react/components/smartDesktopDesigner/ExportCloud.js +4 -6
  389. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  390. package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
  391. package/react/components/smartDesktopDesigner/ExportZip.d.ts +3 -1
  392. package/react/components/smartDesktopDesigner/ExportZip.js +8 -3
  393. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  394. package/react/components/smartDesktopDesigner/GettingStarted.d.ts +1 -0
  395. package/react/components/smartDesktopDesigner/GettingStarted.js +11 -25
  396. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  397. package/react/components/smartDesktopDesigner/Navigation.d.ts +2 -2
  398. package/react/components/smartDesktopDesigner/Navigation.js +17 -15
  399. package/react/components/smartDesktopDesigner/Navigation.js.map +1 -1
  400. package/react/components/smartDesktopDesigner/ProjectErrors.js.map +1 -1
  401. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  402. package/react/components/smartDesktopDesigner/PublishProgress.js.map +1 -1
  403. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +3 -3
  404. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +11 -17
  405. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  406. package/react/components/smartDesktopDesigner/ThemePage.css +109 -110
  407. package/react/components/smartDesktopDesigner/ThemePage.js +0 -7
  408. package/react/components/smartDesktopDesigner/ThemePage.js.map +1 -1
  409. package/react/components/smartDesktopDesigner/Themes.js +0 -2
  410. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  411. package/react/components/smartDesktopDesigner/Toolbar.d.ts +15 -0
  412. package/react/components/smartDesktopDesigner/Toolbar.js +123 -0
  413. package/react/components/smartDesktopDesigner/Toolbar.js.map +1 -0
  414. package/react/components/smartDesktopDesigner/View.js +1 -1
  415. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  416. package/react/components/smartDesktopDesigner/common/fsbl_functions.d.ts +1 -1
  417. package/react/components/smartDesktopDesigner/common/fsbl_functions.js +2 -2
  418. package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +1 -1
  419. package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
  420. package/react/components/smartDesktopDesigner/common/views.d.ts +2 -36
  421. package/react/components/smartDesktopDesigner/common/views.js +150 -111
  422. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  423. package/react/components/smartDesktopDesigner/css/appearance.css +18 -10
  424. package/react/components/smartDesktopDesigner/css/applications.css +167 -127
  425. package/react/components/smartDesktopDesigner/css/authentication.css +119 -125
  426. package/react/components/smartDesktopDesigner/css/buttons.css +12 -12
  427. package/react/components/smartDesktopDesigner/css/export.css +176 -163
  428. package/react/components/smartDesktopDesigner/css/getting-started.css +28 -6
  429. package/react/components/smartDesktopDesigner/css/nav.css +120 -93
  430. package/react/components/smartDesktopDesigner/css/project-errors.css +15 -15
  431. package/react/components/smartDesktopDesigner/css/project-header.css +124 -121
  432. package/react/components/smartDesktopDesigner/css/styles.css +178 -179
  433. package/react/components/smartDesktopDesigner/css/views.css +23 -16
  434. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +2 -0
  435. package/react/components/smartDesktopDesigner/fixtures/apps.js +41 -6
  436. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  437. package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +1 -1
  438. package/react/components/smartDesktopDesigner/fixtures/configTemplate.js.map +1 -1
  439. package/react/components/smartDesktopDesigner/fixtures/exportProps.js +3 -0
  440. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  441. package/react/components/smartDesktopDesigner/fixtures/projectErrorsProps.js.map +1 -1
  442. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  443. package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +1 -1
  444. package/react/components/smartDesktopDesigner/fixtures/views.d.ts +2 -2
  445. package/react/components/smartDesktopDesigner/fixtures/views.js +58 -26
  446. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  447. package/react/components/smartDesktopDesigner/sdd_helpers.d.ts +1 -1
  448. package/react/components/smartDesktopDesigner/sdd_helpers.js +4 -3
  449. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  450. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +3 -1
  451. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +12 -33
  452. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  453. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
  454. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +2 -1
  455. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js +8 -1
  456. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
  457. package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
  458. package/react/components/smartDesktopDesigner/stories/AssetsPage.stories.js.map +1 -1
  459. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
  460. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.d.ts +10 -0
  461. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js +13 -0
  462. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js.map +1 -0
  463. package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
  464. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.d.ts +1 -1
  465. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js +1 -1
  466. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  467. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.d.ts +1 -1
  468. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js +1 -1
  469. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  470. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
  471. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
  472. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
  473. package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
  474. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
  475. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js +7 -1
  476. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  477. package/react/components/smartDesktopDesigner/stories/ThemePage.stories.js.map +1 -1
  478. package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
  479. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.d.ts +14 -0
  480. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js +38 -0
  481. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js.map +1 -0
  482. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +73 -122
  483. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  484. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
  485. package/react/components/smartDesktopDesigner/tests/Applications.spec.d.ts +1 -1
  486. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +61 -560
  487. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  488. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
  489. package/react/components/smartDesktopDesigner/tests/{ProjectHeader.spec.d.ts → ContentHeader.spec.d.ts} +0 -0
  490. package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js +31 -0
  491. package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js.map +1 -0
  492. package/react/components/smartDesktopDesigner/tests/Export.spec.js +129 -0
  493. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  494. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js +7 -0
  495. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  496. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
  497. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js +3 -14
  498. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  499. package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
  500. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
  501. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +2 -31
  502. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  503. package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
  504. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.d.ts +1 -0
  505. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js +203 -0
  506. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js.map +1 -0
  507. package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
  508. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.d.ts +1 -0
  509. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js +18 -0
  510. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js.map +1 -0
  511. package/react/components/smartDesktopDesigner/themeDefinitions.js.map +1 -1
  512. package/react/components/system/System.js.map +1 -1
  513. package/react/components/system/System.spec.js.map +1 -1
  514. package/react/components/system/System.stories.js.map +1 -1
  515. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  516. package/react/components/system/index.js.map +1 -1
  517. package/react/components/toolbar/AutoArrange.js.map +1 -1
  518. package/react/components/toolbar/DragHandle.js.map +1 -1
  519. package/react/components/toolbar/MinimizeAll.js.map +1 -1
  520. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  521. package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
  522. package/react/components/toolbar/NotificationControl.js.map +1 -1
  523. package/react/components/toolbar/RevealAll.js.map +1 -1
  524. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  525. package/react/components/toolbar/RevealAll.stories.js.map +1 -1
  526. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  527. package/react/components/toolbar/ToolbarSection.js.map +1 -1
  528. package/react/components/toolbar/ToolbarShell.js.map +1 -1
  529. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  530. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
  531. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  532. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  533. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  534. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  535. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
  536. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  537. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  538. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +47 -45
  539. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  540. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  541. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
  542. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  543. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
  544. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  545. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  546. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
  547. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  548. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  549. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  550. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  551. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  552. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  553. package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
  554. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +1 -0
  555. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  556. package/react/components/toolbar/appLauncher/appLauncher.css +30 -30
  557. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  558. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +1 -0
  559. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +17 -34
  560. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  561. package/react/components/toolbar/dashbar/Dashbar.js +3 -1
  562. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  563. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  564. package/react/components/toolbar/index.js.map +1 -1
  565. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +1 -1
  566. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  567. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
  568. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  569. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  570. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
  571. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  572. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +1 -1
  573. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  574. package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +90 -90
  575. package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
  576. package/react/components/userPreferences/UserPreferenceTypes.js.map +1 -1
  577. package/react/components/userPreferences/UserPreferences.js.map +1 -1
  578. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  579. package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -1
  580. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  581. package/react/components/userPreferences/components/LeftNav.js.map +1 -1
  582. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  583. package/react/components/userPreferences/components/content/DashbarEditorItem.js.map +1 -1
  584. package/react/components/userPreferences/components/content/General.js.map +1 -1
  585. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  586. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  587. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  588. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  589. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  590. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  591. package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
  592. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
  593. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -1
  594. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  595. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -1
  596. package/react/components/userPreferences/index.js.map +1 -1
  597. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  598. package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
  599. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -1
  600. package/react/components/userPreferences/stories/General.stories.js.map +1 -1
  601. package/react/components/userPreferences/stories/Notifications.stories.js.map +1 -1
  602. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -1
  603. package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -1
  604. package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -1
  605. package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -1
  606. package/react/components/userPreferences/stories/WorkspaceComponents.stories.js.map +1 -1
  607. package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -1
  608. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -1
  609. package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -1
  610. package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -1
  611. package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -1
  612. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -1
  613. package/react/components/userPreferences/tests/General.spec.js.map +1 -1
  614. package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
  615. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -1
  616. package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -1
  617. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  618. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -1
  619. package/react/components/userPreferences/tests/ScheduledRestart.spec.js +1 -1
  620. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  621. package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -1
  622. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -1
  623. package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -1
  624. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -1
  625. package/react/components/utils.js.map +1 -1
  626. package/react/components/windowTitleBar/WindowTitleBarShell.js +8 -1
  627. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  628. package/react/components/windowTitleBar/components/center/Tab.d.ts +0 -1
  629. package/react/components/windowTitleBar/components/center/Tab.js +2 -2
  630. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  631. package/react/components/windowTitleBar/components/center/TabList.d.ts +0 -1
  632. package/react/components/windowTitleBar/components/center/TabList.js +16 -79
  633. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  634. package/react/components/windowTitleBar/components/center/TabRegion.js.map +1 -1
  635. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  636. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
  637. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  638. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
  639. package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
  640. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
  641. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  642. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  643. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +7 -0
  644. package/react/components/windowTitleBar/components/right/MaximizeButton.js +11 -1
  645. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  646. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  647. package/react/components/windowTitleBar/components/windowTitle.d.ts +5 -4
  648. package/react/components/windowTitleBar/components/windowTitle.js +102 -39
  649. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  650. package/react/components/windowTitleBar/index.js.map +1 -1
  651. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +5 -1
  652. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  653. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
  654. package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
  655. package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
  656. package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
  657. package/react/components/yesNoDialog/YesNoDialog.css +3 -3
  658. package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
  659. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  660. package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
  661. package/react/components/yesNoDialog/index.js.map +1 -1
  662. package/react/components/yesNoDialog/timer.js.map +1 -1
  663. package/react/enzymeSetup.js +1 -1
  664. package/react/enzymeSetup.js.map +1 -1
  665. package/react/hooks/index.js.map +1 -1
  666. package/react/hooks/useAuth.js.map +1 -1
  667. package/react/hooks/useDashbar.d.ts +8 -0
  668. package/react/hooks/useDashbar.js +104 -0
  669. package/react/hooks/useDashbar.js.map +1 -0
  670. package/react/hooks/useDeepEffect.js.map +1 -1
  671. package/react/hooks/useFavorites.js.map +1 -1
  672. package/react/hooks/useFavoritesShell.js.map +1 -1
  673. package/react/hooks/useHotkey.js.map +1 -1
  674. package/react/hooks/useLinker.js.map +1 -1
  675. package/react/hooks/useMenu.js.map +1 -1
  676. package/react/hooks/useNotifications.js.map +1 -1
  677. package/react/hooks/useOutsideClickDetector.js.map +1 -1
  678. package/react/hooks/usePubSub.js.map +1 -1
  679. package/react/hooks/useSearch.js.map +1 -1
  680. package/react/hooks/useToolbar.d.ts +0 -6
  681. package/react/hooks/useToolbar.js +0 -101
  682. package/react/hooks/useToolbar.js.map +1 -1
  683. package/react/hooks/useWorkspace.js.map +1 -1
  684. package/react/reducers/favoriteReducer.js.map +1 -1
  685. package/react/reducers/linkerReducer.js.map +1 -1
  686. package/react/reducers/menuReducer.js.map +1 -1
  687. package/react/reducers/rootReducer.d.ts +0 -4
  688. package/react/reducers/rootReducer.js.map +1 -1
  689. package/react/reducers/searchReducer.js.map +1 -1
  690. package/react/reducers/smartDesktopDesignerReducer.js +0 -3
  691. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  692. package/react/reducers/toolbarReducer.js.map +1 -1
  693. package/react/reducers/workspaceReducer.js.map +1 -1
  694. package/react/store.d.ts +0 -8
  695. package/react/store.js.map +1 -1
  696. package/react/types/advancedAppLauncherTypes.js.map +1 -1
  697. package/react/types/dashbarTypes.js.map +1 -1
  698. package/react/types/favoriteTypes.js.map +1 -1
  699. package/react/types/fdc3.d.ts +7 -35
  700. package/react/types/fdc3.js.map +1 -1
  701. package/react/types/hotkeyTypes.js.map +1 -1
  702. package/react/types/iconTypes.js.map +1 -1
  703. package/react/types/linkerTypes.js.map +1 -1
  704. package/react/types/searchTypes.js.map +1 -1
  705. package/react/types/smartDesktopDesignerTypes.d.ts +45 -5
  706. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  707. package/react/types/windowTitleBar.d.ts +3 -2
  708. package/react/types/windowTitleBar.js.map +1 -1
  709. package/react/types/workspaceTypes.js.map +1 -1
  710. package/react/components/common/FontSizeSelector.d.ts +0 -7
  711. package/react/components/common/FontSizeSelector.js +0 -42
  712. package/react/components/common/FontSizeSelector.js.map +0 -1
  713. package/react/components/common/stories/FontSizeSelector.stories.d.ts +0 -12
  714. package/react/components/common/stories/FontSizeSelector.stories.js +0 -24
  715. package/react/components/common/stories/FontSizeSelector.stories.js.map +0 -1
  716. package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +0 -25
  717. package/react/components/smartDesktopDesigner/ApplicationEdit.js +0 -103
  718. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +0 -1
  719. package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +0 -23
  720. package/react/components/smartDesktopDesigner/ApplicationSetup.js +0 -73
  721. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +0 -1
  722. package/react/components/smartDesktopDesigner/ProjectHeader.d.ts +0 -14
  723. package/react/components/smartDesktopDesigner/ProjectHeader.js +0 -70
  724. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +0 -1
  725. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.d.ts +0 -4
  726. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +0 -45
  727. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +0 -1
  728. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.d.ts +0 -3
  729. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +0 -29
  730. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +0 -1
  731. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.d.ts +0 -12
  732. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js +0 -21
  733. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +0 -1
  734. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.d.ts +0 -12
  735. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js +0 -28
  736. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +0 -1
  737. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.d.ts +0 -10
  738. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js +0 -19
  739. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +0 -1
  740. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js +0 -66
  741. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +0 -1
  742. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js +0 -41
  743. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +0 -1
  744. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js +0 -27
  745. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Timer.stories.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/Timer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAiB,MAAM,SAAS,CAAC;AAExC,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACd,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,QAAQ,GAAkB,CAAC,IAAY,EAAE,EAAE,CAAC,oBAAC,KAAK,oBAAK,IAAI,EAAI,CAAC;AAEtE,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACZ,aAAa,EAAE,IAAI;IACnB,yBAAyB,EAAE,MAAM,CAAC,SAAS,CAAC;CAC5C,CAAC","sourcesContent":["import React from \"react\";\r\nimport Timer, { IProps } from \"./timer\";\r\nimport { Story } from \"@storybook/react/types-6-0\";\r\nimport \"../../assets/css/dialogs.css\";\r\nimport { action } from \"@storybook/addon-actions\";\r\n\r\nexport default {\r\n\ttitle: \"YesNoDialog/Timer\",\r\n\tcomponent: Timer,\r\n};\r\n\r\nconst Template: Story<IProps> = (args: IProps) => <Timer {...args} />;\r\n\r\nexport const Basic = Template.bind({});\r\nBasic.args = {\r\n\ttimerDuration: 1000,\r\n\tontimerDurationExpiration: action(\"Expired\"),\r\n};\r\n"]}
1
+ {"version":3,"file":"Timer.stories.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/Timer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAiB,MAAM,SAAS,CAAC;AAExC,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACd,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,QAAQ,GAAkB,CAAC,IAAY,EAAE,EAAE,CAAC,oBAAC,KAAK,oBAAK,IAAI,EAAI,CAAC;AAEtE,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACZ,aAAa,EAAE,IAAI;IACnB,yBAAyB,EAAE,MAAM,CAAC,SAAS,CAAC;CAC5C,CAAC","sourcesContent":["import React from \"react\";\nimport Timer, { IProps } from \"./timer\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport \"../../assets/css/dialogs.css\";\nimport { action } from \"@storybook/addon-actions\";\n\nexport default {\n\ttitle: \"YesNoDialog/Timer\",\n\tcomponent: Timer,\n};\n\nconst Template: Story<IProps> = (args: IProps) => <Timer {...args} />;\n\nexport const Basic = Template.bind({});\nBasic.args = {\n\ttimerDuration: 1000,\n\tontimerDurationExpiration: action(\"Expired\"),\n};\n"]}
@@ -1,3 +1,3 @@
1
- body {
2
- margin: 0px;
3
- }
1
+ body {
2
+ margin: 0px;
3
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"YesNoDialog.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,mBA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G,GAAG,EAAE,CAAC,oBAAC,eAAe,OAAG,CAAC","sourcesContent":["/*!\r\n * Copyright 2017 by ChartIQ, Inc.\r\n * All rights reserved.\r\n */\r\nimport React from \"react\";\r\nimport \"./YesNoDialog.css\";\r\nimport \"../../assets/css/dialogs.css\";\r\nimport { FinsembleDialog } from \"../legacyControls/FinsembleDialog\";\r\nimport { FinsembleDialogQuestion } from \"../legacyControls/FinsembleDialogQuestion\";\r\nimport { FinsembleDialogButton } from \"../legacyControls/FinsembleDialogButton\";\r\nimport Timer from \"./timer\";\r\nconst DEFAULT_TITLE = \"\";\r\nconst DEFAULT_COMPONENT_STATE = {\r\n\ttitle: DEFAULT_TITLE,\r\n\tquestion: \"No question.\",\r\n\tnegativeResponseLabel: \"No\",\r\n\taffirmativeResponseLabel: \"Yes\",\r\n\tcancelResponseLabel: \"Cancel\",\r\n\tshowNegativeButton: true,\r\n\tshowAffirmativeButton: true,\r\n\tshowCancelButton: true,\r\n};\r\n\r\ninterface IProps {}\r\ninterface IState {\r\n\ttitle: string;\r\n\tquestion: string;\r\n\tnegativeResponseLabel: string;\r\n\taffirmativeResponseLabel: string;\r\n\tcancelResponseLabel: string;\r\n\tshowNegativeButton: boolean;\r\n\tshowAffirmativeButton: boolean;\r\n\tshowCancelButton: boolean;\r\n\thideModalOnClose?: boolean;\r\n\tshowTimer?: boolean;\r\n\ttimerDuration?: number | null;\r\n}\r\n\r\n/**\r\n * This is our standard dialog that presents the user with 1 - 3 choices. It can be used to allow the user to confirm, reject, or cancel an action. All of these options can be included, and all can be excluded.\r\n *\r\n * @class YesNoDialog\r\n * @extends {React.Component}\r\n */\r\nclass YesNoDialogBase extends React.Component<IProps, IState> {\r\n\tconstructor(props = {}) {\r\n\t\tsuper(props);\r\n\t\tthis.bindCorrectContext();\r\n\t\tthis.state = DEFAULT_COMPONENT_STATE;\r\n\t\tdocument.body.addEventListener(\"keydown\", this.handleKeydownOnBody);\r\n\t}\r\n\r\n\t/**\r\n\t * Handles escape and enter.\r\n\t *\r\n\t * @param {any} e\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\thandleKeydownOnBody(e: any) {\r\n\t\tif (e.code === \"Enter\" && e.shiftKey === false) {\r\n\t\t\tthis.sendResponse(\"affirmative\");\r\n\t\t}\r\n\r\n\t\tif (e.code === \"Escape\") {\r\n\t\t\tthis.sendResponse(\"cancel\");\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Necessary to ensure that `this` is correct when our methods are invoked.\r\n\t *\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tbindCorrectContext() {\r\n\t\tthis.handleKeydownOnBody = this.handleKeydownOnBody.bind(this);\r\n\t\tthis.onShowRequested = this.onShowRequested.bind(this);\r\n\t\tthis.sendAffirmativeResponse = this.sendAffirmativeResponse.bind(this);\r\n\t\tthis.sendCancelResponse = this.sendCancelResponse.bind(this);\r\n\t\tthis.sendNegativeResponse = this.sendNegativeResponse.bind(this);\r\n\t\tthis.sendExpiredResponse = this.sendExpiredResponse.bind(this);\r\n\t\tthis.sendResponse = this.sendResponse.bind(this);\r\n\t}\r\n\r\n\t/**\r\n\t * When the opener requests that the dialog show itself, it also passes in initialization data. This function grabs that data, calls setState, and then fits the window to the contents of the DOM. Then we call `showDialog`, which will display the dialog on the proper monitor.\r\n\t *\r\n\t * @param {any} err\r\n\t * @param {any} response\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tonShowRequested(err: any, response: any) {\r\n\t\tlet { data } = response;\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\ttitle: typeof data.title === \"undefined\" ? DEFAULT_TITLE : data.title,\r\n\t\t\t\thideModalOnClose: typeof data.hideModalOnClose === \"undefined\" ? true : data.hideModalOnClose,\r\n\t\t\t\tquestion: data.question,\r\n\t\t\t\tnegativeResponseLabel: data.negativeResponseLabel || \"No\",\r\n\t\t\t\taffirmativeResponseLabel: data.affirmativeResponseLabel || \"Yes\",\r\n\t\t\t\tcancelResponseLabel: data.cancelResponseLabel || \"Cancel\",\r\n\t\t\t\tshowNegativeButton: typeof data.showNegativeButton === \"undefined\" ? true : data.showNegativeButton,\r\n\t\t\t\tshowAffirmativeButton: typeof data.showAffirmativeButton === \"undefined\" ? true : data.showAffirmativeButton,\r\n\t\t\t\tshowCancelButton: typeof data.showCancelButton === \"undefined\" ? true : data.showCancelButton,\r\n\t\t\t\tshowTimer: typeof data.showTimer === \"undefined\" ? false : data.showTimer,\r\n\t\t\t\ttimerDuration: typeof data.timerDuration === \"undefined\" ? null : data.timerDuration,\r\n\t\t\t},\r\n\t\t\tthis.fitAndShow\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Fits the contents of the DOM to the window, then calls `showDialog`, which positions the dialog on the proper monitor and toggles the visibility of the window.\r\n\t *\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tfitAndShow() {\r\n\t\tFSBL.Clients.WindowClient.fitToDOM(null, () => {\r\n\t\t\tFSBL.Clients.DialogManager.showDialog();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sends user input to the opener.\r\n\t *\r\n\t * @param {any} response\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tsendResponse(response: any) {\r\n\t\tconsole.log(\"Response: \", response);\r\n\t\tFSBL.Clients.DialogManager.respondToOpener({\r\n\t\t\tchoice: response,\r\n\t\t\thideModalOnClose: this.state.hideModalOnClose,\r\n\t\t});\r\n\t\t// This will detach the timer component from the dom. Next time the component comes up, it'll have a fresh timer.\r\n\t\tthis.setState({\r\n\t\t\tshowTimer: false,\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sends an affirmative response to the opener.\r\n\t *\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tsendAffirmativeResponse() {\r\n\t\tthis.sendResponse(\"affirmative\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sends a negative response to the opener.\r\n\t *\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tsendNegativeResponse() {\r\n\t\tthis.sendResponse(\"negative\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sends a cancel response to the opener.\r\n\t *\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tsendCancelResponse() {\r\n\t\tthis.sendResponse(\"cancel\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sends an expired response to the opener.\r\n\t *\r\n\t * @memberof YesNoDialog\r\n\t */\r\n\tsendExpiredResponse() {\r\n\t\tthis.sendResponse(\"expired\");\r\n\t}\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t<FinsembleDialog\r\n\t\t\t\tuserInputTimeout={10000}\r\n\t\t\t\tbehaviorOnResponse=\"hide\"\r\n\t\t\t\tonShowRequested={this.onShowRequested}\r\n\t\t\t\tisModal={true}\r\n\t\t\t>\r\n\t\t\t\t<div className=\"dialog-title\">{this.state.title}</div>\r\n\t\t\t\t<FinsembleDialogQuestion>\r\n\t\t\t\t\t{this.state.question}\r\n\t\t\t\t\t{this.state.showTimer && typeof this.state.timerDuration === \"number\" && (\r\n\t\t\t\t\t\t<Timer ontimerDurationExpiration={this.sendExpiredResponse} timerDuration={this.state.timerDuration} />\r\n\t\t\t\t\t)}\r\n\t\t\t\t</FinsembleDialogQuestion>\r\n\t\t\t\t<div className=\"button-wrapper\">\r\n\t\t\t\t\t<FinsembleDialogButton\r\n\t\t\t\t\t\tshow={this.state.showNegativeButton}\r\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\r\n\t\t\t\t\t\tonClick={this.sendNegativeResponse}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{this.state.negativeResponseLabel}\r\n\t\t\t\t\t</FinsembleDialogButton>\r\n\r\n\t\t\t\t\t<FinsembleDialogButton\r\n\t\t\t\t\t\tshow={this.state.showCancelButton}\r\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\r\n\t\t\t\t\t\tonClick={this.sendCancelResponse}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{this.state.cancelResponseLabel}\r\n\t\t\t\t\t</FinsembleDialogButton>\r\n\r\n\t\t\t\t\t<FinsembleDialogButton\r\n\t\t\t\t\t\tshow={this.state.showAffirmativeButton}\r\n\t\t\t\t\t\tclassName=\"fsbl-button-affirmative\"\r\n\t\t\t\t\t\tonClick={this.sendAffirmativeResponse}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{this.state.affirmativeResponseLabel}\r\n\t\t\t\t\t</FinsembleDialogButton>\r\n\t\t\t\t</div>\r\n\t\t\t</FinsembleDialog>\r\n\t\t);\r\n\t}\r\n}\r\n\r\n/**\r\n * This dialog window provides a binary choice to the user, and reports back the response to the opener.\r\n */\r\nexport const YesNoDialog = () => <YesNoDialogBase />;\r\n"]}
1
+ {"version":3,"file":"YesNoDialog.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,uBAAuB,GAAG;IAC/B,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE,cAAc;IACxB,qBAAqB,EAAE,IAAI;IAC3B,wBAAwB,EAAE,KAAK;IAC/B,mBAAmB,EAAE,QAAQ;IAC7B,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;CACtB,CAAC;AAuBF,MAAM,eAAgB,SAAQ,KAAK,CAAC,SAAyB;IAC5D,YAAY,KAAK,GAAG,EAAE;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,kBAAkB,EAAE,CAAC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,kBAAkB,EACnC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,IAAI,CAAC,oBAAoB,IAEjC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CACV;gBAExB,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACjC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,IAAI,CAAC,kBAAkB,IAE/B,IAAI,CAAC,KAAK,CAAC,mBAAmB,CACR;gBAExB,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACtC,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,IAAI,CAAC,uBAAuB,IAEpC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CACb,CACnB,CACW,CAClB,CAAC;IACH,CAAC;CACD;AAKD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,oBAAC,eAAe,OAAG,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React from \"react\";\nimport \"./YesNoDialog.css\";\nimport \"../../assets/css/dialogs.css\";\nimport { FinsembleDialog } from \"../legacyControls/FinsembleDialog\";\nimport { FinsembleDialogQuestion } from \"../legacyControls/FinsembleDialogQuestion\";\nimport { FinsembleDialogButton } from \"../legacyControls/FinsembleDialogButton\";\nimport Timer from \"./timer\";\nconst DEFAULT_TITLE = \"\";\nconst DEFAULT_COMPONENT_STATE = {\n\ttitle: DEFAULT_TITLE,\n\tquestion: \"No question.\",\n\tnegativeResponseLabel: \"No\",\n\taffirmativeResponseLabel: \"Yes\",\n\tcancelResponseLabel: \"Cancel\",\n\tshowNegativeButton: true,\n\tshowAffirmativeButton: true,\n\tshowCancelButton: true,\n};\n\ninterface IProps {}\ninterface IState {\n\ttitle: string;\n\tquestion: string;\n\tnegativeResponseLabel: string;\n\taffirmativeResponseLabel: string;\n\tcancelResponseLabel: string;\n\tshowNegativeButton: boolean;\n\tshowAffirmativeButton: boolean;\n\tshowCancelButton: boolean;\n\thideModalOnClose?: boolean;\n\tshowTimer?: boolean;\n\ttimerDuration?: number | null;\n}\n\n/**\n * This is our standard dialog that presents the user with 1 - 3 choices. It can be used to allow the user to confirm, reject, or cancel an action. All of these options can be included, and all can be excluded.\n *\n * @class YesNoDialog\n * @extends {React.Component}\n */\nclass YesNoDialogBase extends React.Component<IProps, IState> {\n\tconstructor(props = {}) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t\tthis.state = DEFAULT_COMPONENT_STATE;\n\t\tdocument.body.addEventListener(\"keydown\", this.handleKeydownOnBody);\n\t}\n\n\t/**\n\t * Handles escape and enter.\n\t *\n\t * @param {any} e\n\t * @memberof YesNoDialog\n\t */\n\thandleKeydownOnBody(e: any) {\n\t\tif (e.code === \"Enter\" && e.shiftKey === false) {\n\t\t\tthis.sendResponse(\"affirmative\");\n\t\t}\n\n\t\tif (e.code === \"Escape\") {\n\t\t\tthis.sendResponse(\"cancel\");\n\t\t}\n\t}\n\n\t/**\n\t * Necessary to ensure that `this` is correct when our methods are invoked.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tbindCorrectContext() {\n\t\tthis.handleKeydownOnBody = this.handleKeydownOnBody.bind(this);\n\t\tthis.onShowRequested = this.onShowRequested.bind(this);\n\t\tthis.sendAffirmativeResponse = this.sendAffirmativeResponse.bind(this);\n\t\tthis.sendCancelResponse = this.sendCancelResponse.bind(this);\n\t\tthis.sendNegativeResponse = this.sendNegativeResponse.bind(this);\n\t\tthis.sendExpiredResponse = this.sendExpiredResponse.bind(this);\n\t\tthis.sendResponse = this.sendResponse.bind(this);\n\t}\n\n\t/**\n\t * When the opener requests that the dialog show itself, it also passes in initialization data. This function grabs that data, calls setState, and then fits the window to the contents of the DOM. Then we call `showDialog`, which will display the dialog on the proper monitor.\n\t *\n\t * @param {any} err\n\t * @param {any} response\n\t * @memberof YesNoDialog\n\t */\n\tonShowRequested(err: any, response: any) {\n\t\tlet { data } = response;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\ttitle: typeof data.title === \"undefined\" ? DEFAULT_TITLE : data.title,\n\t\t\t\thideModalOnClose: typeof data.hideModalOnClose === \"undefined\" ? true : data.hideModalOnClose,\n\t\t\t\tquestion: data.question,\n\t\t\t\tnegativeResponseLabel: data.negativeResponseLabel || \"No\",\n\t\t\t\taffirmativeResponseLabel: data.affirmativeResponseLabel || \"Yes\",\n\t\t\t\tcancelResponseLabel: data.cancelResponseLabel || \"Cancel\",\n\t\t\t\tshowNegativeButton: typeof data.showNegativeButton === \"undefined\" ? true : data.showNegativeButton,\n\t\t\t\tshowAffirmativeButton: typeof data.showAffirmativeButton === \"undefined\" ? true : data.showAffirmativeButton,\n\t\t\t\tshowCancelButton: typeof data.showCancelButton === \"undefined\" ? true : data.showCancelButton,\n\t\t\t\tshowTimer: typeof data.showTimer === \"undefined\" ? false : data.showTimer,\n\t\t\t\ttimerDuration: typeof data.timerDuration === \"undefined\" ? null : data.timerDuration,\n\t\t\t},\n\t\t\tthis.fitAndShow\n\t\t);\n\t}\n\n\t/**\n\t * Fits the contents of the DOM to the window, then calls `showDialog`, which positions the dialog on the proper monitor and toggles the visibility of the window.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tfitAndShow() {\n\t\tFSBL.Clients.WindowClient.fitToDOM(null, () => {\n\t\t\tFSBL.Clients.DialogManager.showDialog();\n\t\t});\n\t}\n\n\t/**\n\t * Sends user input to the opener.\n\t *\n\t * @param {any} response\n\t * @memberof YesNoDialog\n\t */\n\tsendResponse(response: any) {\n\t\tconsole.log(\"Response: \", response);\n\t\tFSBL.Clients.DialogManager.respondToOpener({\n\t\t\tchoice: response,\n\t\t\thideModalOnClose: this.state.hideModalOnClose,\n\t\t});\n\t\t// This will detach the timer component from the dom. Next time the component comes up, it'll have a fresh timer.\n\t\tthis.setState({\n\t\t\tshowTimer: false,\n\t\t});\n\t}\n\n\t/**\n\t * Sends an affirmative response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendAffirmativeResponse() {\n\t\tthis.sendResponse(\"affirmative\");\n\t}\n\n\t/**\n\t * Sends a negative response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendNegativeResponse() {\n\t\tthis.sendResponse(\"negative\");\n\t}\n\n\t/**\n\t * Sends a cancel response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendCancelResponse() {\n\t\tthis.sendResponse(\"cancel\");\n\t}\n\n\t/**\n\t * Sends an expired response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendExpiredResponse() {\n\t\tthis.sendResponse(\"expired\");\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<FinsembleDialog\n\t\t\t\tuserInputTimeout={10000}\n\t\t\t\tbehaviorOnResponse=\"hide\"\n\t\t\t\tonShowRequested={this.onShowRequested}\n\t\t\t\tisModal={true}\n\t\t\t>\n\t\t\t\t<div className=\"dialog-title\">{this.state.title}</div>\n\t\t\t\t<FinsembleDialogQuestion>\n\t\t\t\t\t{this.state.question}\n\t\t\t\t\t{this.state.showTimer && typeof this.state.timerDuration === \"number\" && (\n\t\t\t\t\t\t<Timer ontimerDurationExpiration={this.sendExpiredResponse} timerDuration={this.state.timerDuration} />\n\t\t\t\t\t)}\n\t\t\t\t</FinsembleDialogQuestion>\n\t\t\t\t<div className=\"button-wrapper\">\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showNegativeButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\n\t\t\t\t\t\tonClick={this.sendNegativeResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.negativeResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showCancelButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\n\t\t\t\t\t\tonClick={this.sendCancelResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.cancelResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showAffirmativeButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-affirmative\"\n\t\t\t\t\t\tonClick={this.sendAffirmativeResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.affirmativeResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t</div>\n\t\t\t</FinsembleDialog>\n\t\t);\n\t}\n}\n\n/**\n * This dialog window provides a binary choice to the user, and reports back the response to the opener.\n */\nexport const YesNoDialog = () => <YesNoDialogBase />;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"YesNoDialog.spec.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAElF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,KAAK,OAAG,CAAC,CAAC;QAEjC,MAAM,CAAC,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACzD,CAAC,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C,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAKpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport sinon from \"sinon\";\r\nimport { Basic, Empty, WithTimer, NoText, NoButtons, CustomButtonLabels } from \"./YesNoDialog.stories\";\r\nimport { accessibilityAssessor } from \"../smartDesktopDesigner/tests/a11y_helper\";\r\n\r\ndescribe(\"<YesNoDialog/>\", () => {\r\n\tit(\"should pass accessibility scans\", async () => {\r\n\t\tconst wrapper = mount(<Basic />);\r\n\r\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\r\n\t});\r\n\tit(\"should display Yes, No, and Cancel by default\", async () => {\r\n\t\tconst wrapper = mount(<Empty />);\r\n\r\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\r\n\t\texpect(dialog_text).to.contain(\"Yes\");\r\n\t\texpect(dialog_text).to.contain(\"No\");\r\n\t\texpect(dialog_text).to.contain(\"Cancel\");\r\n\t});\r\n\tit(\"should display Yes and Cancel, but not No\", async () => {\r\n\t\tconst wrapper = mount(<Basic {...(Basic.args as any)} />);\r\n\r\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\r\n\t\texpect(dialog_text).to.contain(\"Yes\");\r\n\t\texpect(dialog_text).to.not.contain(\"No\");\r\n\t\texpect(dialog_text).to.contain(\"Cancel\");\r\n\t});\r\n\tit(\"should show 'Time remaining' until the clock ticks away\", () => {\r\n\t\tconst clock = sinon.useFakeTimers();\r\n\t\tconst wrapper = mount(<WithTimer {...(WithTimer.args as any)} />);\r\n\r\n\t\texpect(wrapper.find(\".dialog\").text(), \"Before countdown\").to.contain(\"Time remaining:\");\r\n\t\tclock.tick(1000);\r\n\t\tclock.tick(1000);\r\n\t\tclock.tick(1000);\r\n\t\texpect(wrapper.find(\".dialog\").text(), \"After countdown\").to.not.contain(\"Time remaining:\");\r\n\t\tclock.restore();\r\n\t});\r\n\tit(\"should display empty text if no title is provided\", () => {\r\n\t\tconst wrapper = mount(<NoText {...(NoText.args as any)} />);\r\n\t\tconst titleText = wrapper.find(\".dialog-title\").text();\r\n\t\texpect(titleText).to.be.empty;\r\n\t});\r\n\tit(\"should not display any buttons if none are approved\", () => {\r\n\t\tconst wrapper = mount(<NoButtons {...(NoButtons.args as any)} />);\r\n\t\texpect(wrapper.find(\"button\").length).to.equal(0);\r\n\t});\r\n\tit(\"should display custom button labels when provided\", () => {\r\n\t\tconst wrapper = mount(<CustomButtonLabels {...(CustomButtonLabels.args as any)} />);\r\n\r\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\r\n\t\texpect(dialog_text).to.contain(\"Tak\");\r\n\t\texpect(dialog_text).to.contain(\"Nie\");\r\n\t\texpect(dialog_text).to.contain(\"Anuluj\");\r\n\t\texpect(dialog_text).to.not.contain(\"Yes\");\r\n\t\texpect(dialog_text).to.not.contain(\"No\");\r\n\t\texpect(dialog_text).to.not.contain(\"Cancel\");\r\n\t});\r\n\tit.skip(\"should handle keyboard interactions\", () => {\r\n\t\t// const wrapper = mount(<Basic {...(Basic.args as any)} />);\r\n\t\t// Keyboard interactions are wired up to document.body.addEventListener, and Enzyme doesn't let us mock that\r\n\t\t// This is a possibility, but it would require simulant and maybe also jsdom:\r\n\t\t// https://github.com/enzymejs/enzyme/issues/426\r\n\t});\r\n});\r\n"]}
1
+ {"version":3,"file":"YesNoDialog.spec.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAElF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,KAAK,OAAG,CAAC,CAAC;QAEjC,MAAM,CAAC,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,KAAK,OAAG,CAAC,CAAC;QAEjC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC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ACtC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;IAKpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport sinon from \"sinon\";\nimport { Basic, Empty, WithTimer, NoText, NoButtons, CustomButtonLabels } from \"./YesNoDialog.stories\";\nimport { accessibilityAssessor } from \"../smartDesktopDesigner/tests/a11y_helper\";\n\ndescribe(\"<YesNoDialog/>\", () => {\n\tit(\"should pass accessibility scans\", async () => {\n\t\tconst wrapper = mount(<Basic />);\n\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n\tit(\"should display Yes, No, and Cancel by default\", async () => {\n\t\tconst wrapper = mount(<Empty />);\n\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\n\t\texpect(dialog_text).to.contain(\"Yes\");\n\t\texpect(dialog_text).to.contain(\"No\");\n\t\texpect(dialog_text).to.contain(\"Cancel\");\n\t});\n\tit(\"should display Yes and Cancel, but not No\", async () => {\n\t\tconst wrapper = mount(<Basic {...(Basic.args as any)} />);\n\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\n\t\texpect(dialog_text).to.contain(\"Yes\");\n\t\texpect(dialog_text).to.not.contain(\"No\");\n\t\texpect(dialog_text).to.contain(\"Cancel\");\n\t});\n\tit(\"should show 'Time remaining' until the clock ticks away\", () => {\n\t\tconst clock = sinon.useFakeTimers();\n\t\tconst wrapper = mount(<WithTimer {...(WithTimer.args as any)} />);\n\n\t\texpect(wrapper.find(\".dialog\").text(), \"Before countdown\").to.contain(\"Time remaining:\");\n\t\tclock.tick(1000);\n\t\tclock.tick(1000);\n\t\tclock.tick(1000);\n\t\texpect(wrapper.find(\".dialog\").text(), \"After countdown\").to.not.contain(\"Time remaining:\");\n\t\tclock.restore();\n\t});\n\tit(\"should display empty text if no title is provided\", () => {\n\t\tconst wrapper = mount(<NoText {...(NoText.args as any)} />);\n\t\tconst titleText = wrapper.find(\".dialog-title\").text();\n\t\texpect(titleText).to.be.empty;\n\t});\n\tit(\"should not display any buttons if none are approved\", () => {\n\t\tconst wrapper = mount(<NoButtons {...(NoButtons.args as any)} />);\n\t\texpect(wrapper.find(\"button\").length).to.equal(0);\n\t});\n\tit(\"should display custom button labels when provided\", () => {\n\t\tconst wrapper = mount(<CustomButtonLabels {...(CustomButtonLabels.args as any)} />);\n\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\n\t\texpect(dialog_text).to.contain(\"Tak\");\n\t\texpect(dialog_text).to.contain(\"Nie\");\n\t\texpect(dialog_text).to.contain(\"Anuluj\");\n\t\texpect(dialog_text).to.not.contain(\"Yes\");\n\t\texpect(dialog_text).to.not.contain(\"No\");\n\t\texpect(dialog_text).to.not.contain(\"Cancel\");\n\t});\n\tit.skip(\"should handle keyboard interactions\", () => {\n\t\t// const wrapper = mount(<Basic {...(Basic.args as any)} />);\n\t\t// Keyboard interactions are wired up to document.body.addEventListener, and Enzyme doesn't let us mock that\n\t\t// This is a possibility, but it would require simulant and maybe also jsdom:\n\t\t// https://github.com/enzymejs/enzyme/issues/426\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"YesNoDialog.stories.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.stories.tsx"],"names":[],"m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AEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IAChB,KAAK,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,qBAAqB;QAC/B,kBAAkB,EAAE,KAAK;QACzB,qBAAqB,EAAE,IAAI;QAC3B,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;KACnB;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IAChB,KAAK,EAAE;QACN,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,oCAAoC;QAC9C,kBAAkB,EAAE,KAAK;QACzB,qBAAqB,EAAE,KAAK;QAC5B,gBAAgB,EAAE,KAAK;KACvB;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpD,kBAAkB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,qBAAqB;QAC/B,kBAAkB,EAAE,IAAI;QACxB,qBAAqB,EAAE,IAAI;QAC3B,gBAAgB,EAAE,IAAI;QACtB,wBAAwB,EAAE,KAAK;QAC/B,qBAAqB,EAAE,KAAK;QAC5B,mBAAmB,EAAE,QAAQ;QAC7B,SAAS,EAAE,KAAK;KAChB;CACD,CAAC","sourcesContent":["import React from \"react\";\r\nimport { YesNoDialog } from \"./YesNoDialog\";\r\nimport { initFSBL } from \"../common/helpers\";\r\nimport { Story } from \"@storybook/react/types-6-0\";\r\nimport \"../../assets/css/dialogs.css\";\r\n\r\nexport default {\r\n\ttitle: \"YesNoDialog/YesNoDialog\",\r\n\tcomponent: YesNoDialog,\r\n};\r\n\r\nconst Template: Story<{}> = (args: any) => {\r\n\tinitFSBL(window);\r\n\r\n\tif (args._data) {\r\n\t\tFSBL.Clients.DialogManager.registerDialogCallback = (cb: Function) => {\r\n\t\t\tcb(\"\", { data: args._data });\r\n\t\t};\r\n\t}\r\n\r\n\treturn <YesNoDialog {...args} />;\r\n};\r\n\r\nexport const Empty = Template.bind({});\r\n\r\nexport const Basic = Template.bind({});\r\nBasic.args = {\r\n\t_data: {\r\n\t\ttitle: \"Example titles\",\r\n\t\tquestion: \"Is this a question?\",\r\n\t\tshowNegativeButton: false,\r\n\t\tshowAffirmativeButton: true,\r\n\t\tshowCancelButton: true,\r\n\t\tshowTimer: false,\r\n\t},\r\n};\r\n\r\nexport const NoText = Template.bind({});\r\nNoText.args = {\r\n\t_data: {\r\n\t\tshowNegativeButton: false,\r\n\t\tshowAffirmativeButton: true,\r\n\t\tshowCancelButton: true,\r\n\t},\r\n};\r\n\r\nexport const WithTimer = Template.bind({});\r\nWithTimer.args = {\r\n\t_data: {\r\n\t\ttitle: \"Example titles\",\r\n\t\tquestion: \"Is this a question?\",\r\n\t\tshowNegativeButton: false,\r\n\t\tshowAffirmativeButton: true,\r\n\t\tshowCancelButton: true,\r\n\t\tshowTimer: true,\r\n\t\ttimerDuration: 3000,\r\n\t},\r\n};\r\n\r\nexport const NoButtons = Template.bind({});\r\nNoButtons.args = {\r\n\t_data: {\r\n\t\ttitle: \"No buttons\",\r\n\t\tquestion: \"What are you going to do about it?\",\r\n\t\tshowNegativeButton: false,\r\n\t\tshowAffirmativeButton: false,\r\n\t\tshowCancelButton: false,\r\n\t},\r\n};\r\n\r\nexport const CustomButtonLabels = Template.bind({});\r\nCustomButtonLabels.args = {\r\n\t_data: {\r\n\t\ttitle: \"Example titles\",\r\n\t\tquestion: \"Is this a question?\",\r\n\t\tshowNegativeButton: true,\r\n\t\tshowAffirmativeButton: true,\r\n\t\tshowCancelButton: true,\r\n\t\taffirmativeResponseLabel: \"Tak\",\r\n\t\tnegativeResponseLabel: \"Nie\",\r\n\t\tcancelResponseLabel: \"Anuluj\",\r\n\t\tshowTimer: false,\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"YesNoDialog.stories.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,8BAA8B,CAAC;AAEtC,eAAe;IACd,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,WAAW;CACtB,CAAC;AAEF,MAAM,QAAQ,GAAc,CAAC,IAAS,EAAE,EAAE;IACzC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,IAAI,IAAI,CAAC,KAAK,EAAE;QACf,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,sBAAsB,GAAG,CAAC,EAAY,EAAE,EAAE;YACpE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC;KACF;IAED,OAAO,oBAAC,WAAW,oBAAK,IAAI,EAAI,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvC,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACZ,KAAK,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,qBAAqB;QAC/B,kBAAkB,EAAE,KAAK;QACzB,qBAAqB,EAAE,IAAI;QAC3B,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,KAAK;KAChB;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,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L } from \"../common/helpers\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport \"../../assets/css/dialogs.css\";\n\nexport default {\n\ttitle: \"YesNoDialog/YesNoDialog\",\n\tcomponent: YesNoDialog,\n};\n\nconst Template: Story<{}> = (args: any) => {\n\tinitFSBL(window);\n\n\tif (args._data) {\n\t\tFSBL.Clients.DialogManager.registerDialogCallback = (cb: Function) => {\n\t\t\tcb(\"\", { data: args._data });\n\t\t};\n\t}\n\n\treturn <YesNoDialog {...args} />;\n};\n\nexport const Empty = Template.bind({});\n\nexport const Basic = Template.bind({});\nBasic.args = {\n\t_data: {\n\t\ttitle: \"Example titles\",\n\t\tquestion: \"Is this a question?\",\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t\tshowTimer: false,\n\t},\n};\n\nexport const NoText = Template.bind({});\nNoText.args = {\n\t_data: {\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t},\n};\n\nexport const WithTimer = Template.bind({});\nWithTimer.args = {\n\t_data: {\n\t\ttitle: \"Example titles\",\n\t\tquestion: \"Is this a question?\",\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t\tshowTimer: true,\n\t\ttimerDuration: 3000,\n\t},\n};\n\nexport const NoButtons = Template.bind({});\nNoButtons.args = {\n\t_data: {\n\t\ttitle: \"No buttons\",\n\t\tquestion: \"What are you going to do about it?\",\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: false,\n\t\tshowCancelButton: false,\n\t},\n};\n\nexport const CustomButtonLabels = Template.bind({});\nCustomButtonLabels.args = {\n\t_data: {\n\t\ttitle: \"Example titles\",\n\t\tquestion: \"Is this a question?\",\n\t\tshowNegativeButton: true,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t\taffirmativeResponseLabel: \"Tak\",\n\t\tnegativeResponseLabel: \"Nie\",\n\t\tcancelResponseLabel: \"Anuluj\",\n\t\tshowTimer: false,\n\t},\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { YesNoDialog } from \"./YesNoDialog\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { YesNoDialog } from \"./YesNoDialog\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/timer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAyB;IAGjE,YAAY,KAAU;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,aAAa,EAAE,KAAK,CAAC,aAAa;SAClC,CAAC;IACH,CAAC;IAGD,iBAAiB;QAChB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;YAC9C,IAAI,OAAO,IAAI,CAAC,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC;gBACvC,IAAI,IAAI,CAAC,QAAQ;oBAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAChD;iBAAM;gBACN,IAAI,CAAC,QAAQ,CAAC;oBACb,aAAa,EAAE,OAAO;iBACtB,CAAC,CAAC;aACH;QACF,CAAC,EAAE,IAAI,CAAC,CAAC;IACV,CAAC;IAGD,MAAM;QACL,OAAO;;YAAsB,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAO,CAAC;IACrE,CAAC;CACD","sourcesContent":["import React from \"react\";\r\n\r\nexport interface IProps {\r\n\ttimerDuration: number;\r\n\tontimerDurationExpiration: () => void;\r\n}\r\ninterface IState {\r\n\ttimerDuration: number;\r\n}\r\n\r\nexport default class Timer extends React.Component<IProps, IState> {\r\n\tinterval?: NodeJS.Timeout;\r\n\r\n\tconstructor(props: any) {\r\n\t\tsuper(props);\r\n\t\tthis.state = {\r\n\t\t\ttimerDuration: props.timerDuration,\r\n\t\t};\r\n\t}\r\n\r\n\t//Every second, subtract a second.\r\n\tcomponentDidMount() {\r\n\t\tthis.interval = setInterval(() => {\r\n\t\t\tlet newTime = this.state.timerDuration - 1000;\r\n\t\t\tif (newTime <= 0) {\r\n\t\t\t\tthis.props.ontimerDurationExpiration();\r\n\t\t\t\tif (this.interval) clearInterval(this.interval);\r\n\t\t\t} else {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\ttimerDuration: newTime,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}, 1000);\r\n\t}\r\n\r\n\t//Countdown clock.\r\n\trender() {\r\n\t\treturn <div>Time remaining: {this.state.timerDuration / 1000}</div>;\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/timer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAyB;IAGjE,YAAY,KAAU;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,aAAa,EAAE,KAAK,CAAC,aAAa;SAClC,CAAC;IACH,CAAC;IAGD,iBAAiB;QAChB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;YAC9C,IAAI,OAAO,IAAI,CAAC,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC;gBACvC,IAAI,IAAI,CAAC,QAAQ;oBAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAChD;iBAAM;gBACN,IAAI,CAAC,QAAQ,CAAC;oBACb,aAAa,EAAE,OAAO;iBACtB,CAAC,CAAC;aACH;QACF,CAAC,EAAE,IAAI,CAAC,CAAC;IACV,CAAC;IAGD,MAAM;QACL,OAAO;;YAAsB,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAO,CAAC;IACrE,CAAC;CACD","sourcesContent":["import React from \"react\";\n\nexport interface IProps {\n\ttimerDuration: number;\n\tontimerDurationExpiration: () => void;\n}\ninterface IState {\n\ttimerDuration: number;\n}\n\nexport default class Timer extends React.Component<IProps, IState> {\n\tinterval?: NodeJS.Timeout;\n\n\tconstructor(props: any) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\ttimerDuration: props.timerDuration,\n\t\t};\n\t}\n\n\t//Every second, subtract a second.\n\tcomponentDidMount() {\n\t\tthis.interval = setInterval(() => {\n\t\t\tlet newTime = this.state.timerDuration - 1000;\n\t\t\tif (newTime <= 0) {\n\t\t\t\tthis.props.ontimerDurationExpiration();\n\t\t\t\tif (this.interval) clearInterval(this.interval);\n\t\t\t} else {\n\t\t\t\tthis.setState({\n\t\t\t\t\ttimerDuration: newTime,\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000);\n\t}\n\n\t//Countdown clock.\n\trender() {\n\t\treturn <div>Time remaining: {this.state.timerDuration / 1000}</div>;\n\t}\n}\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\r\n// that require more real-world browser DOM objects to be exposed, like `.document` and `.window`.\r\n// This is needed to use methods like `.mount()` within enzyme.\r\n// It uses jsdom to set up a fake web browser in JavaScript.\r\n\r\n//import Adapter from \"enzyme-adapter-react-16\";\r\nimport Adapter from \"@wojtekmaj/enzyme-adapter-react-17\";\r\nimport { configure } from \"enzyme\";\r\nimport jsdom from \"jsdom\";\r\n\r\nrequire(\"babel-register\")();\r\n\r\nfunction copyProps(src, target) {\r\n\tconst props = Object.getOwnPropertyNames(src)\r\n\t\t.filter((prop) => typeof target[prop] === \"undefined\")\r\n\t\t.map((prop) => Object.getOwnPropertyDescriptor(src, prop));\r\n\tObject.defineProperties(target, props);\r\n}\r\n\r\nfunction setUpDomEnvironment() {\r\n\tconst { JSDOM } = jsdom;\r\n\tconst dom = new JSDOM(\"<!doctype html><html><body></body></html>\", { url: \"http://localhost/\" });\r\n\tconst { window } = dom;\r\n\r\n\tglobal.window = window;\r\n\tglobal.document = window.document;\r\n\tglobal.navigator = {\r\n\t\tuserAgent: \"node.js\",\r\n\t};\r\n\tglobal.File = window.File;\r\n\tcopyProps(window, global);\r\n}\r\n\r\nsetUpDomEnvironment();\r\n\r\nconfigure({ adapter: new Adapter() });\r\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { useAuth, useAuthSimulator } from \"./useAuth\";\r\nexport { useHotkey } from \"./useHotkey\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { useAuth, useAuthSimulator } from \"./useAuth\";\nexport { useHotkey } from \"./useHotkey\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../src/hooks/useAuth.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC3B,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,WAAiB,EAAE,EAAE;QAChE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO;QACN,oBAAoB;QACpB,eAAe;KACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,MAAM,YAAY,GAAG,KAAK,EAAE,QAAgB,EAAE,QAAgB,EAAgD,EAAE;QAC/G,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACxG,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACxG,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;IAEF,OAAO;QACN,YAAY;KACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["export const useAuth = () => {\r\n\tconst publishAuthorization = (user: string, credentials?: any) => {\r\n\t\tFSBL.System.Window.getCurrent().hide();\r\n\t\tFSBL.Clients.AuthenticationClient.publishAuthorization(user, credentials);\r\n\t};\r\n\r\n\tconst quitApplication = () => {\r\n\t\tFSBL.System.exit();\r\n\t};\r\n\r\n\treturn {\r\n\t\tpublishAuthorization,\r\n\t\tquitApplication,\r\n\t};\r\n};\r\n\r\nexport const useAuthSimulator = () => {\r\n\tconst sendToServer = async (username: string, password: string): Promise<{ result?: string; error?: string }> => {\r\n\t\tif (!username || !username.length) return await Promise.resolve({ error: \"Missing or empty username\" });\r\n\t\tif (!password || !password.length) return await Promise.resolve({ error: \"Missing or empty password\" });\r\n\t\treturn await Promise.resolve({ result: \"ok\" });\r\n\t};\r\n\r\n\treturn {\r\n\t\tsendToServer,\r\n\t};\r\n};\r\n"]}
1
+ {"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../src/hooks/useAuth.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC3B,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,WAAiB,EAAE,EAAE;QAChE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO;QACN,oBAAoB;QACpB,eAAe;KACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,MAAM,YAAY,GAAG,KAAK,EAAE,QAAgB,EAAE,QAAgB,EAAgD,EAAE;QAC/G,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACxG,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACxG,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;IAEF,OAAO;QACN,YAAY;KACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["export const useAuth = () => {\n\tconst publishAuthorization = (user: string, credentials?: any) => {\n\t\tFSBL.System.Window.getCurrent().hide();\n\t\tFSBL.Clients.AuthenticationClient.publishAuthorization(user, credentials);\n\t};\n\n\tconst quitApplication = () => {\n\t\tFSBL.System.exit();\n\t};\n\n\treturn {\n\t\tpublishAuthorization,\n\t\tquitApplication,\n\t};\n};\n\nexport const useAuthSimulator = () => {\n\tconst sendToServer = async (username: string, password: string): Promise<{ result?: string; error?: string }> => {\n\t\tif (!username || !username.length) return await Promise.resolve({ error: \"Missing or empty username\" });\n\t\tif (!password || !password.length) return await Promise.resolve({ error: \"Missing or empty password\" });\n\t\treturn await Promise.resolve({ result: \"ok\" });\n\t};\n\n\treturn {\n\t\tsendToServer,\n\t};\n};\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":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO1C,IAAI,oBAAoB,GAAY,KAAK,CAAC;AAM1C,IAAI,YAAwB,CAAC;AAE7B,MAAM,cAAc,GAAG,CACtB,QAAgB,EAChB,qBAAkD,EAClD,eAA8B,EAC7B,EAAE;IACH,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACnD,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,CAAC,EAAE,GAAG,QAAQ,CAAC;QACtB,eAAe,CAAC,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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-core\";\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 @@
1
- {"version":3,"file":"useDeepEffect.js","sourceRoot":"","sources":["../../src/hooks/useDeepEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,SAAS,qBAAqB,CAAC,KAAU;IACxC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QACjC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,OAAO,CAAC;AACpB,CAAC;AAMD,MAAM,UAAU,aAAa,CAAC,QAAa,EAAE,YAAwB;IACpE,SAAS,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { useEffect, useRef } from \"react\";\r\nimport isEqual from \"lodash/isEqual\";\r\n\r\nfunction useDeepCompareMemoize(value: any) {\r\n\tconst ref = useRef();\r\n\r\n\tif (!isEqual(value, ref.current)) {\r\n\t\tref.current = value;\r\n\t}\r\n\r\n\treturn ref.current;\r\n}\r\n\r\n/**\r\n * Use this just like useEffect() except that this will compare objects and arrays using lodash's isEqual() method.\r\n * Always pass an array of dependencies as the second parameter!!!\r\n */\r\nexport function useDeepEffect(callback: any, dependencies: Array<any>) {\r\n\tuseEffect(callback, useDeepCompareMemoize(dependencies));\r\n}\r\n\r\n/*\r\n// Previous implementation that had bugs. Keep around for a bit until we shake out the new version.\r\nexport function useDeepEffect(effectFunc : Function, deps : Array<any>) {\r\n\tconst isFirst = useRef(true);\r\n\tconst prevDeps = useRef(deps);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst isSame = prevDeps.current.every((obj: any, index: any) => isEqual(obj, deps[index]));\r\n\t\tif (isFirst.current || !isSame) {\r\n\t\t\teffectFunc();\r\n\t\t}\r\n\r\n\t\tisFirst.current = false;\r\n\t\tprevDeps.current = deps;\r\n\t}, deps);\r\n}\r\n*/\r\n"]}
1
+ {"version":3,"file":"useDeepEffect.js","sourceRoot":"","sources":["../../src/hooks/useDeepEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,SAAS,qBAAqB,CAAC,KAAU;IACxC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QACjC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,OAAO,CAAC;AACpB,CAAC;AAMD,MAAM,UAAU,aAAa,CAAC,QAAa,EAAE,YAAwB;IACpE,SAAS,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { useEffect, useRef } from \"react\";\nimport isEqual from \"lodash/isEqual\";\n\nfunction useDeepCompareMemoize(value: any) {\n\tconst ref = useRef();\n\n\tif (!isEqual(value, ref.current)) {\n\t\tref.current = value;\n\t}\n\n\treturn ref.current;\n}\n\n/**\n * Use this just like useEffect() except that this will compare objects and arrays using lodash's isEqual() method.\n * Always pass an array of dependencies as the second parameter!!!\n */\nexport function useDeepEffect(callback: any, dependencies: Array<any>) {\n\tuseEffect(callback, useDeepCompareMemoize(dependencies));\n}\n\n/*\n// Previous implementation that had bugs. Keep around for a bit until we shake out the new version.\nexport function useDeepEffect(effectFunc : Function, deps : Array<any>) {\n\tconst isFirst = useRef(true);\n\tconst prevDeps = useRef(deps);\n\n\tuseEffect(() => {\n\t\tconst isSame = prevDeps.current.every((obj: any, index: any) => isEqual(obj, deps[index]));\n\t\tif (isFirst.current || !isSame) {\n\t\t\teffectFunc();\n\t\t}\n\n\t\tisFirst.current = false;\n\t\tprevDeps.current = deps;\n\t}, deps);\n}\n*/\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useFavorites.js","sourceRoot":"","sources":["../../src/hooks/useFavorites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA2B7D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAkB,EAAE;IAC/C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEpD,MAAM,WAAW,GAAG,CAAC,QAAkB,EAAE,EAAE;QAC1C,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,EAAkB,EAAE,EAAE;QAC7C,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,EAAkB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEtE,OAAO;QACN,SAAS;QACT,WAAW;QACX,cAAc;QACd,WAAW;KACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\r\nimport { Favorite } from \"../types/favoriteTypes\";\r\nimport { FavoriteActions } from \"../actions/favoriteActions\";\r\n\r\ntype FavoritesHook = {\r\n\t/**\r\n\t * The current favorites list from the store.\r\n\t */\r\n\tfavorites: Favorite[];\r\n\r\n\t/**\r\n\t * Adds a favorite to the favorites store.\r\n\t */\r\n\taddFavorite: (favorite: Favorite) => void;\r\n\r\n\t/**\r\n\t * Removes the favorite for the given id from the favorites store.\r\n\t */\r\n\tremoveFavorite: (id: Favorite[\"id\"]) => void;\r\n\r\n\t/**\r\n\t * Returns true if the current id has been favorited.\r\n\t */\r\n\tisFavorited: (id: Favorite[\"id\"]) => boolean;\r\n};\r\n\r\n/**\r\n * The useFavorites() hook is used by FavoriteMaker to interact with the redux store.\r\n */\r\nexport const useFavorites = (): FavoritesHook => {\r\n\tconst dispatch = useDispatch();\r\n\tconst { favorites } = useSelector((state) => state.favorite);\r\n\tconst favoritesIds = favorites.map((fav) => fav.id);\r\n\r\n\tconst addFavorite = (favorite: Favorite) => {\r\n\t\tdispatch(FavoriteActions.ADD_FAVORITE(favorite));\r\n\t};\r\n\r\n\tconst removeFavorite = (id: Favorite[\"id\"]) => {\r\n\t\tdispatch(FavoriteActions.REMOVE_FAVORITE(id));\r\n\t};\r\n\r\n\tconst isFavorited = (id: Favorite[\"id\"]) => favoritesIds.includes(id);\r\n\r\n\treturn {\r\n\t\tfavorites,\r\n\t\taddFavorite,\r\n\t\tremoveFavorite,\r\n\t\tisFavorited,\r\n\t};\r\n};\r\n"]}
1
+ {"version":3,"file":"useFavorites.js","sourceRoot":"","sources":["../../src/hooks/useFavorites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA2B7D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAkB,EAAE;IAC/C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEpD,MAAM,WAAW,GAAG,CAAC,QAAkB,EAAE,EAAE;QAC1C,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,EAAkB,EAAE,EAAE;QAC7C,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,EAAkB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEtE,OAAO;QACN,SAAS;QACT,WAAW;QACX,cAAc;QACd,WAAW;KACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\nimport { Favorite } from \"../types/favoriteTypes\";\nimport { FavoriteActions } from \"../actions/favoriteActions\";\n\ntype FavoritesHook = {\n\t/**\n\t * The current favorites list from the store.\n\t */\n\tfavorites: Favorite[];\n\n\t/**\n\t * Adds a favorite to the favorites store.\n\t */\n\taddFavorite: (favorite: Favorite) => void;\n\n\t/**\n\t * Removes the favorite for the given id from the favorites store.\n\t */\n\tremoveFavorite: (id: Favorite[\"id\"]) => void;\n\n\t/**\n\t * Returns true if the current id has been favorited.\n\t */\n\tisFavorited: (id: Favorite[\"id\"]) => boolean;\n};\n\n/**\n * The useFavorites() hook is used by FavoriteMaker to interact with the redux store.\n */\nexport const useFavorites = (): FavoritesHook => {\n\tconst dispatch = useDispatch();\n\tconst { favorites } = useSelector((state) => state.favorite);\n\tconst favoritesIds = favorites.map((fav) => fav.id);\n\n\tconst addFavorite = (favorite: Favorite) => {\n\t\tdispatch(FavoriteActions.ADD_FAVORITE(favorite));\n\t};\n\n\tconst removeFavorite = (id: Favorite[\"id\"]) => {\n\t\tdispatch(FavoriteActions.REMOVE_FAVORITE(id));\n\t};\n\n\tconst isFavorited = (id: Favorite[\"id\"]) => favoritesIds.includes(id);\n\n\treturn {\n\t\tfavorites,\n\t\taddFavorite,\n\t\tremoveFavorite,\n\t\tisFavorited,\n\t};\n};\n"]}
@@ -1 +1 @@
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,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,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\";\r\nimport { Favorite } from \"../types/favoriteTypes\";\r\nimport { FavoriteActions } from \"../actions/favoriteActions\";\r\nimport { useFavorites } from \"./useFavorites\";\r\nimport { useEffect } from \"react\";\r\nimport { types } from \"@finsemble/finsemble-core\";\r\n\r\ntype StandardError = types.StandardError;\r\n\r\nlet storageIsInitialized: boolean = false;\r\n\r\n/**\r\n * The useFavoritesShell() hook is used by FavoritesShell to interact with the redux store\r\n * and storage.\r\n */\r\nexport const useFavoritesShell = () => {\r\n\tconst dispatch = useDispatch();\r\n\tconst { favorites, removeFavorite } = useFavorites();\r\n\r\n\t// Ideally in the future the following function will be decoupled from implementation, allowing Favorites to generically dispatch actions.\r\n\t/**\r\n\t * Given a favorite item, trigger the associated action on that item.\r\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.\r\n\t * @param id The favorite item's id\r\n\t * @param category The to be triggered favorite item's category\r\n\t */\r\n\tconst triggerFavorite = async (id: Favorite[\"id\"], category: Favorite[\"category\"]) => {\r\n\t\tif (category === \"Application\") {\r\n\t\t\tFSBL.Clients.LauncherClient.spawn(id, {\r\n\t\t\t\taddToWorkspace: true,\r\n\t\t\t\tmonitor: \"mine\",\r\n\t\t\t});\r\n\t\t} else if (category === \"Workspace\") {\r\n\t\t\tFSBL.Clients.DistributedStoreClient.getStore(\r\n\t\t\t\t{ store: \"Finsemble-WorkspaceMenu-Global-Store\", global: true },\r\n\t\t\t\t(err: StandardError, store?: any) => {\r\n\t\t\t\t\tstore.Dispatcher.dispatch({\r\n\t\t\t\t\t\tactionType: \"switchToWorkspace\",\r\n\t\t\t\t\t\tdata: {\r\n\t\t\t\t\t\t\tname: id,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * We need to persist the right order in whent he user reorders favorites in the toolbar. This ensures\r\n\t * that favorites will appear in the right order on future Toolbar launches.\r\n\t * @param favElements The ordered collection of favorite elements\r\n\t */\r\n\tconst setFavoritesOrder = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\r\n\t\tdispatch(FavoriteActions.REORDER_FAVORITES({ oldIndex, newIndex }));\r\n\t};\r\n\r\n\t/**\r\n\t * This effect initializes the favorites redux store. The store must only be initialized once, even though useFavorites may be\r\n\t * referenced by many different React components. We use the module level variable `storageIsInitialized` as a simple flag to\r\n\t * prevent initialization from occuring more than once.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tif (storageIsInitialized) return;\r\n\t\tstorageIsInitialized = true;\r\n\t\t// Copy the persisted favorites from Storage to the redux store\r\n\t\tFSBL.Clients.StorageClient.get({ topic: \"favorites\", key: \"allCurrentFavorites\" }, (err, data) => {\r\n\t\t\tif (err) {\r\n\t\t\t\treturn FSBL.Clients.Logger.system.error(\r\n\t\t\t\t\t`Favorite Hook -> Failed to retrieve favorites from StorageClient: ${err}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tdispatch(FavoriteActions.INITIALIZE_FAVORITES(data));\r\n\t\t});\r\n\t}, [dispatch]);\r\n\r\n\t// When the list of favorite items change, we want to persist that data to the store.\r\n\tuseEffect(() => {\r\n\t\tFSBL.Clients.StorageClient.save({\r\n\t\t\ttopic: \"favorites\",\r\n\t\t\tkey: \"allCurrentFavorites\",\r\n\t\t\tvalue: favorites,\r\n\t\t});\r\n\t}, [favorites]);\r\n\r\n\treturn {\r\n\t\tfavorites,\r\n\t\tremoveFavorite,\r\n\t\ttriggerFavorite,\r\n\t\tsetFavoritesOrder,\r\n\t};\r\n};\r\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,QAAQ,KAAK,WAAW,EAAE;YACpC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAC3C,EAAE,KAAK,EAAE,sCAAsC,EAAE,MAAM,EAAE,IAAI,EAAE,EAC/D,CAAC,GAAkB,EAAE,KAAW,EAAE,EAAE;gBACnC,KAAK,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\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 +1 @@
1
- {"version":3,"file":"useHotkey.js","sourceRoot":"","sources":["../../src/hooks/useHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAShD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,cAAoD,EAAE,MAAgB,EAAE,EAAE;IAKnG,aAAa,CAAC,GAAG,EAAE;QAClB,IAAI,iBAAiB,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC;QACrD,IAAI,CAAC,iBAAiB;YAAE,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAClG,cAAc,IAAI,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QACzG,OAAO,SAAS,OAAO;YACtB,cAAc,IAAI,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC7G,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import { useDeepEffect } from \"./useDeepEffect\";\r\nimport { HotkeyCombination } from \"../types/hotkeyTypes\";\r\n\r\n/**\r\n * This hook can be used to register a global hotkey. It makes use of Finsemble's HotkeyClient API.\r\n *\r\n * @param keyCombination [Array<string>] - A hotkey Combination. If null or undefined then no operation will occur.\r\n * @param action Function - The function to call when the hotkey combination is pressed.\r\n */\r\nexport const useHotkey = (keyCombination: HotkeyCombination | undefined | null, action: Function) => {\r\n\t// We use a deep effect comparison because we expect arrays to be passed in.\r\n\t// React's useEffect() hook only performs shallow comparisons. We use the literal [\"escape\"] which would trigger an effect with every render.\r\n\t// useDeepEffect() is a custom hook that will compare the *contents* of the arrays. This way, two literal instances will still be perceived by React as identical.\r\n\r\n\tuseDeepEffect(() => {\r\n\t\tlet actionIsAFunction = typeof action === \"function\";\r\n\t\tif (!actionIsAFunction) console.error(\"useHotkey() invalid parameters: action is not a function\");\r\n\t\tkeyCombination && actionIsAFunction && FSBL.Clients.HotkeyClient.addGlobalHotkey(keyCombination, action);\r\n\t\treturn function cleanup() {\r\n\t\t\tkeyCombination && actionIsAFunction && FSBL.Clients.HotkeyClient.removeGlobalHotkey(keyCombination, action);\r\n\t\t};\r\n\t}, [keyCombination, action]);\r\n};\r\n"]}
1
+ {"version":3,"file":"useHotkey.js","sourceRoot":"","sources":["../../src/hooks/useHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAShD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,cAAoD,EAAE,MAAgB,EAAE,EAAE;IAKnG,aAAa,CAAC,GAAG,EAAE;QAClB,IAAI,iBAAiB,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC;QACrD,IAAI,CAAC,iBAAiB;YAAE,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAClG,cAAc,IAAI,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QACzG,OAAO,SAAS,OAAO;YACtB,cAAc,IAAI,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC7G,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import { useDeepEffect } from \"./useDeepEffect\";\nimport { HotkeyCombination } from \"../types/hotkeyTypes\";\n\n/**\n * This hook can be used to register a global hotkey. It makes use of Finsemble's HotkeyClient API.\n *\n * @param keyCombination [Array<string>] - A hotkey Combination. If null or undefined then no operation will occur.\n * @param action Function - The function to call when the hotkey combination is pressed.\n */\nexport const useHotkey = (keyCombination: HotkeyCombination | undefined | null, action: Function) => {\n\t// We use a deep effect comparison because we expect arrays to be passed in.\n\t// React's useEffect() hook only performs shallow comparisons. We use the literal [\"escape\"] which would trigger an effect with every render.\n\t// useDeepEffect() is a custom hook that will compare the *contents* of the arrays. This way, two literal instances will still be perceived by React as identical.\n\n\tuseDeepEffect(() => {\n\t\tlet actionIsAFunction = typeof action === \"function\";\n\t\tif (!actionIsAFunction) console.error(\"useHotkey() invalid parameters: action is not a function\");\n\t\tkeyCombination && actionIsAFunction && FSBL.Clients.HotkeyClient.addGlobalHotkey(keyCombination, action);\n\t\treturn function cleanup() {\n\t\t\tkeyCombination && actionIsAFunction && FSBL.Clients.HotkeyClient.removeGlobalHotkey(keyCombination, action);\n\t\t};\n\t}, [ke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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,CAAC,CAAC,MAAM,CAAC;QAGnG,MAAM,UAAU,GAAG,CAAC,aAAa,CAAC;QAClC,MAAM,YAAY,GAAG,aAAa,CAAC;QACnC,MAAM,+BAA+B,GAAG,sBAAsB,GAAG,+BAA+B,CAAC;QAIjG,IAAI,YAAY,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;SACtG;aAAM,IAAI,UAAU,IAAI,+BAA+B,EAAE;YACzD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACjG;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAC/B,iCAAiC,+BAA+B,8HAA8H,+BAA+B,2CAA2C,CACxQ,CAAC;SACF;QACD,UAAU,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\r\nimport { useEffect } from \"react\";\r\nimport { LinkerActions } from \"../actions/linkerActions\";\r\nimport { Channel, MAXIMUM_ALLOWED_ACTIVE_CHANNELS } from \"../types/linkerTypes\";\r\n\r\ndeclare const finsembleWindow: any;\r\n\r\n// Encapsulate the linker initialization and Redux dispatch functions inside the hook\r\nexport const useLinker = () => {\r\n\tconst dispatch = useDispatch();\r\n\tconst linkerState = useSelector((state) => state.linker);\r\n\r\n\tconst hideWindow = () => {\r\n\t\t// Must blur or you end up having to click twice to show the window.\r\n\t\t// If you just hide, the first time the user clicks\r\n\t\t// on the linker button, the blur will trigger, which will hide the window.\r\n\t\tfinsembleWindow.blur();\r\n\t\tfinsembleWindow.hide();\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tconst setInitialChannels = () => {\r\n\t\t\tconst channels: Channel[] = FSBL.Clients.LinkerClient.getAllChannels();\r\n\t\t\tdispatch(LinkerActions.SET_CHANNELS({ channels }));\r\n\t\t};\r\n\r\n\t\tconst focusWindow = () => {\r\n\t\t\tfinsembleWindow.focus();\r\n\t\t};\r\n\r\n\t\tconst initAccessibleLinkerMode = () => {\r\n\t\t\tconst accessibilityCallback = (err: any, value: any) => {\r\n\t\t\t\tif (err) {\r\n\t\t\t\t\tFSBL.Clients.Logger.system.error(`Failed to get accessibleLinker value: ${err}`);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tLinkerActions.SET_ACCESSIBILITY({\r\n\t\t\t\t\t\tisAccessibleLinker: Boolean(value),\r\n\t\t\t\t\t})\r\n\t\t\t\t);\r\n\t\t\t};\r\n\t\t\tFSBL.Clients.ConfigClient.getValue(\"finsemble.accessibleLinker\", accessibilityCallback);\r\n\t\t};\r\n\r\n\t\t/** If user switches the linker channel for different components, this function would be invoked. It will dispatch another\r\n\t\t * action to update the linker's state according to the linker setup on the switched component.\r\n\t\t *\r\n\t\t * @param err error from FSBL\r\n\t\t * @param msg msg from FSBL\r\n\t\t */\r\n\t\tconst onActiveChannelsChanged = (err: any, msg: any) => {\r\n\t\t\tconst componentLinkerState = FSBL.Clients.LinkerClient.getState(msg.data.windowIdentifier);\r\n\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Failed to update the linker state.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tdispatch(\r\n\t\t\t\tLinkerActions.UPDATE_ACTIVE_CHANNELS({\r\n\t\t\t\t\tchannelNames: componentLinkerState.channels,\r\n\t\t\t\t\twindowIdentifier: msg.data.windowIdentifier,\r\n\t\t\t\t})\r\n\t\t\t);\r\n\r\n\t\t\tmsg.sendQueryResponse(null, null);\r\n\t\t};\r\n\r\n\t\tFSBL.Clients.Logger.system.log(\"Linker component is mounted. Initializing.\");\r\n\t\tfinsembleWindow.addEventListener(\"blurred\", hideWindow);\r\n\t\tfinsembleWindow.addEventListener(\"shown\", focusWindow);\r\n\t\tsetInitialChannels();\r\n\t\tinitAccessibleLinkerMode();\r\n\t\tFSBL.Clients.RouterClient.addResponder(\"Finsemble.LinkerWindow.SetActiveChannels\", onActiveChannelsChanged);\r\n\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.Logger.system.log(\"Linker component is unmounted. Cleaning up the event listeners.\");\r\n\t\t\tfinsembleWindow.removeEventListener(\"blurred\", hideWindow);\r\n\t\t\tfinsembleWindow.removeEventListener(\"shown\", focusWindow);\r\n\t\t\tFSBL.Clients.RouterClient.removeResponder(\"Finsemble.LinkerWindow.SetActiveChannels\");\r\n\t\t};\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tFSBL.Clients.WindowClient.fitToDOM();\r\n\t}, [linkerState]);\r\n\r\n\tconst toggleChannel = (channelId: number) => {\r\n\t\tconst channel = linkerState.channels[channelId];\r\n\t\tif (!channel) {\r\n\t\t\tFSBL.Clients.Logger.system.error(\"Targeted channel to toggle is not found.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst channelName = channel.name;\r\n\t\tconst channelActive = channel.active;\r\n\t\tconst { windowIdentifier } = linkerState;\r\n\r\n\t\tconst updateActivationTo = (isActive: boolean) => (err: any) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Error in linkerHook, linkCallback\", err);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tdispatch(\r\n\t\t\t\tLinkerActions.UPDATE_CHANNEL_STATUS({\r\n\t\t\t\t\tchannelId,\r\n\t\t\t\t\tactive: isActive,\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\tconst numberOfActiveChannels = Object.values(linkerState.channels).filter((c) => c?.active).length;\r\n\r\n\t\t// We're activating if the channel is currently inactive\r\n\t\tconst activating = !channelActive;\r\n\t\tconst deactivating = channelActive;\r\n\t\tconst allowedToActivateAnotherChannel = numberOfActiveChannels < MAXIMUM_ALLOWED_ACTIVE_CHANNELS;\r\n\t\t// if we're toggling a channel to be inactive OR\r\n\t\t// we're trying to toggle one to be active AND we have not hit our maximum,\r\n\t\t// let the call go through. Otherwise log an error.\r\n\t\tif (deactivating) {\r\n\t\t\tFSBL.Clients.LinkerClient.unlinkFromChannel(channelName, windowIdentifier, updateActivationTo(false));\r\n\t\t} else if (activating && allowedToActivateAnotherChannel) {\r\n\t\t\tFSBL.Clients.LinkerClient.linkToChannel(channelName, windowIdentifier, updateActivationTo(true));\r\n\t\t} else {\r\n\t\t\tFSBL.Clients.Logger.system.error(\r\n\t\t\t\t`Attempted to toggle more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} channels. This could result in an unacceptable UX. Please contact finsemble support if you would like to render more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} linker channels in the window title bar.`\r\n\t\t\t);\r\n\t\t}\r\n\t\thideWindow();\r\n\t};\r\n\r\n\treturn { state: linkerState, toggleChannel };\r\n};\r\n"]}
1
+ {"version":3,"file":"useLinker.js","sourceRoot":"","sources":["../../src/hooks/useLinker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAW,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAKhF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC7B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,WAAW,GAAG,WAAW,CAAC,CA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,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACjG;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAC/B,iCAAiC,+BAA+B,8HAA8H,+BAA+B,2CAA2C,CACxQ,CAAC;SACF;QACD,UAAU,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\nimport { useEffect } from \"react\";\nimport { LinkerActions } from \"../actions/linkerActions\";\nimport { Channel, MAXIMUM_ALLOWED_ACTIVE_CHANNELS } from \"../types/linkerTypes\";\n\ndeclare const finsembleWindow: any;\n\n// Encapsulate the linker initialization and Redux dispatch functions inside the hook\nexport const useLinker = () => {\n\tconst dispatch = useDispatch();\n\tconst linkerState = useSelector((state) => state.linker);\n\n\tconst hideWindow = () => {\n\t\t// Must blur or you end up having to click twice to show the window.\n\t\t// If you just hide, the first time the user clicks\n\t\t// on the linker button, the blur will trigger, which will hide the window.\n\t\tfinsembleWindow.blur();\n\t\tfinsembleWindow.hide();\n\t};\n\n\tuseEffect(() => {\n\t\tconst setInitialChannels = () => {\n\t\t\tconst channels: Channel[] = FSBL.Clients.LinkerClient.getAllChannels();\n\t\t\tdispatch(LinkerActions.SET_CHANNELS({ channels }));\n\t\t};\n\n\t\tconst focusWindow = () => {\n\t\t\tfinsembleWindow.focus();\n\t\t};\n\n\t\tconst initAccessibleLinkerMode = () => {\n\t\t\tconst accessibilityCallback = (err: any, value: any) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(`Failed to get accessibleLinker value: ${err}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdispatch(\n\t\t\t\t\tLinkerActions.SET_ACCESSIBILITY({\n\t\t\t\t\t\tisAccessibleLinker: Boolean(value),\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t};\n\t\t\tFSBL.Clients.ConfigClient.getValue(\"finsemble.accessibleLinker\", accessibilityCallback);\n\t\t};\n\n\t\t/** If user switches the linker channel for different components, this function would be invoked. It will dispatch another\n\t\t * action to update the linker's state according to the linker setup on the switched component.\n\t\t *\n\t\t * @param err error from FSBL\n\t\t * @param msg msg from FSBL\n\t\t */\n\t\tconst onActiveChannelsChanged = (err: any, msg: any) => {\n\t\t\tconst componentLinkerState = FSBL.Clients.LinkerClient.getState(msg.data.windowIdentifier);\n\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Failed to update the linker state.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatch(\n\t\t\t\tLinkerActions.UPDATE_ACTIVE_CHANNELS({\n\t\t\t\t\tchannelNames: componentLinkerState.channels,\n\t\t\t\t\twindowIdentifier: msg.data.windowIdentifier,\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tmsg.sendQueryResponse(null, null);\n\t\t};\n\n\t\tFSBL.Clients.Logger.system.log(\"Linker component is mounted. Initializing.\");\n\t\tfinsembleWindow.addEventListener(\"blurred\", hideWindow);\n\t\tfinsembleWindow.addEventListener(\"shown\", focusWindow);\n\t\tsetInitialChannels();\n\t\tinitAccessibleLinkerMode();\n\t\tFSBL.Clients.RouterClient.addResponder(\"Finsemble.LinkerWindow.SetActiveChannels\", onActiveChannelsChanged);\n\n\t\treturn () => {\n\t\t\tFSBL.Clients.Logger.system.log(\"Linker component is unmounted. Cleaning up the event listeners.\");\n\t\t\tfinsembleWindow.removeEventListener(\"blurred\", hideWindow);\n\t\t\tfinsembleWindow.removeEventListener(\"shown\", focusWindow);\n\t\t\tFSBL.Clients.RouterClient.removeResponder(\"Finsemble.LinkerWindow.SetActiveChannels\");\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tFSBL.Clients.WindowClient.fitToDOM();\n\t}, [linkerState]);\n\n\tconst toggleChannel = (channelId: number) => {\n\t\tconst channel = linkerState.channels[channelId];\n\t\tif (!channel) {\n\t\t\tFSBL.Clients.Logger.system.error(\"Targeted channel to toggle is not found.\");\n\t\t\treturn;\n\t\t}\n\t\tconst channelName = channel.name;\n\t\tconst channelActive = channel.active;\n\t\tconst { windowIdentifier } = linkerState;\n\n\t\tconst updateActivationTo = (isActive: boolean) => (err: any) => {\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Error in linkerHook, linkCallback\", err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatch(\n\t\t\t\tLinkerActions.UPDATE_CHANNEL_STATUS({\n\t\t\t\t\tchannelId,\n\t\t\t\t\tactive: isActive,\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\n\t\tconst numberOfActiveChannels = Object.values(linkerState.channels).filter((c) => c?.active).length;\n\n\t\t// We're activating if the channel is currently inactive\n\t\tconst activating = !channelActive;\n\t\tconst deactivating = channelActive;\n\t\tconst allowedToActivateAnotherChannel = numberOfActiveChannels < MAXIMUM_ALLOWED_ACTIVE_CHANNELS;\n\t\t// if we're toggling a channel to be inactive OR\n\t\t// we're trying to toggle one to be active AND we have not hit our maximum,\n\t\t// let the call go through. Otherwise log an error.\n\t\tif (deactivating) {\n\t\t\tFSBL.Clients.LinkerClient.unlinkFromChannel(channelName, windowIdentifier, updateActivationTo(false));\n\t\t} else if (activating && allowedToActivateAnotherChannel) {\n\t\t\tFSBL.Clients.LinkerClient.linkToChannel(channelName, windowIdentifier, updateActivationTo(true));\n\t\t} else {\n\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t`Attempted to toggle more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} channels. This could result in an unacceptable UX. Please contact finsemble support if you would like to render more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} linker channels in the window title bar.`\n\t\t\t);\n\t\t}\n\t\thideWindow();\n\t};\n\n\tre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CAAC,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK;YAAE,OAAO;QAGxB,MAAM,cAAc,GAAG,GAAG,EAAE;YAC3B,QAAQ,CAAC,WAAW,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC;QAEF,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAG5C,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE3B,MAAM,YAAY,GAAG,GAAY,EAAE,CAAC,UAAU,KAAK,UAAU,CAAC;IAE9D,OAAO;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,YAAY;KACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\r\nimport { MenuActions } from \"../actions/menuActions\";\r\nimport { useCallback, useContext } from \"react\";\r\nimport { MenuContext } from \"../components/menu/menuContext\";\r\n\r\ntype MenuHook = {\r\n\t/**\r\n\t * The Id of the menu that is currently open\r\n\t *\r\n\t * @type {string | null}\r\n\t */\r\n\topenMenuId: string | null;\r\n\t/**\r\n\t * Dispatches a TOGGLE_MENU action, which should cause the menu to close if it is open, or to open if it is closed.\r\n\t */\r\n\ttoggleMenu: () => void;\r\n\t/**\r\n\t * Dispatches a CLOSE_MENU action, which should cause the menu to close if it is open.\r\n\t */\r\n\tcloseMenu: () => void;\r\n\t/**\r\n\t * Dispatches a CLOSE_MENU action after a timeout (DURATION in ms). See description in useMenu comments.\r\n\t */\r\n\tblurMenu: () => void;\r\n\t/**\r\n\t * Dispatches a OPEN_MENU action, which should cause the menu to open if it is closed.\r\n\t */\r\n\topenMenu: () => void;\r\n\t/**\r\n\t * Returns true if the id of the menu matches the currently active menu\r\n\t * @return boolean - Returns true if the menu is active\r\n\t */\r\n\tisMenuActive: () => boolean;\r\n};\r\n\r\n/**\r\n * A hook for working with menus. It gets its implicit menu \"id\" from React context.\r\n * It dispatches actions to the reducer to modify menu state across MenuShell instances.\r\n *\r\n * See menuReducer.ts for \"toggle/blur\" race condition algorithm\r\n *\r\n * Setting window.FSBL.debug=true will override menu close on blur, to make it easier to debug windows\r\n */\r\nexport const useMenu = (): MenuHook => {\r\n\tconst DURATION: number = 120;\r\n\tconst dispatch = useDispatch();\r\n\tconst { openMenuId } = useSelector((state) => state.menu);\r\n\tconst { thisMenuId } = useContext(MenuContext);\r\n\r\n\tconst toggleMenu = useCallback(() => {\r\n\t\tdispatch(MenuActions.TOGGLE_MENU(thisMenuId));\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst openMenu = useCallback(() => {\r\n\t\t// without this call, the toolbar will stay hidden behind other content, and the menus will not be visible\r\n\t\tFSBL.Clients.WindowClient.bringToFront();\r\n\t\tdispatch(MenuActions.OPEN_MENU(thisMenuId));\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst closeMenu = useCallback(() => {\r\n\t\tdispatch(MenuActions.CLOSE_MENU(thisMenuId));\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst blurMenu = useCallback(() => {\r\n\t\tif (FSBL?.debug) return; // If we're debugging then don't blur menus\r\n\r\n\t\t// This is a purposeful closure. There is no need to update it with new state.\r\n\t\tconst closeIfPending = () => {\r\n\t\t\tdispatch(MenuActions.CLOSE_MENU_IF_PENDING(thisMenuId));\r\n\t\t};\r\n\r\n\t\tdispatch(MenuActions.BLUR_MENU(thisMenuId));\r\n\r\n\t\t// See menuReducer.ts for how this timeout is used. Removing the timeout will cause a race condition.\r\n\t\tsetTimeout(closeIfPending, DURATION);\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst isMenuActive = (): boolean => openMenuId === thisMenuId;\r\n\r\n\treturn {\r\n\t\top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CAAC,UAAU,CAAC,CAAC,CAAC;IAC9C,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE3B,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK;YAAE,OAAO;QAGxB,MAAM,cAAc,GAAG,GAAG,EAAE;YAC3B,QAAQ,CAAC,WAAW,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC;QAEF,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAG5C,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE3B,MAAM,YAAY,GAAG,GAAY,EAAE,CAAC,UAAU,KAAK,UAAU,CAAC;IAE9D,OAAO;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,YAAY;KACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\nimport { MenuActions } from \"../actions/menuActions\";\nimport { useCallback, useContext } from \"react\";\nimport { MenuContext } from \"../components/menu/menuContext\";\n\ntype MenuHook = {\n\t/**\n\t * The Id of the menu that is currently open\n\t *\n\t * @type {string | null}\n\t */\n\topenMenuId: string | null;\n\t/**\n\t * Dispatches a TOGGLE_MENU action, which should cause the menu to close if it is open, or to open if it is closed.\n\t */\n\ttoggleMenu: () => void;\n\t/**\n\t * Dispatches a CLOSE_MENU action, which should cause the menu to close if it is open.\n\t */\n\tcloseMenu: () => void;\n\t/**\n\t * Dispatches a CLOSE_MENU action after a timeout (DURATION in ms). See description in useMenu comments.\n\t */\n\tblurMenu: () => void;\n\t/**\n\t * Dispatches a OPEN_MENU action, which should cause the menu to open if it is closed.\n\t */\n\topenMenu: () => void;\n\t/**\n\t * Returns true if the id of the menu matches the currently active menu\n\t * @return boolean - Returns true if the menu is active\n\t */\n\tisMenuActive: () => boolean;\n};\n\n/**\n * A hook for working with menus. It gets its implicit menu \"id\" from React context.\n * It dispatches actions to the reducer to modify menu state across MenuShell instances.\n *\n * See menuReducer.ts for \"toggle/blur\" race condition algorithm\n *\n * Setting window.FSBL.debug=true will override menu close on blur, to make it easier to debug windows\n */\nexport const useMenu = (): MenuHook => {\n\tconst DURATION: number = 120;\n\tconst dispatch = useDispatch();\n\tconst { openMenuId } = useSelector((state) => state.menu);\n\tconst { thisMenuId } = useContext(MenuContext);\n\n\tconst toggleMenu = useCallback(() => {\n\t\tdispatch(MenuActions.TOGGLE_MENU(thisMenuId));\n\t}, [dispatch, thisMenuId]);\n\n\tconst openMenu = useCallback(() => {\n\t\t// without this call, the toolbar will stay hidden behind other content, and the menus will not be visible\n\t\tFSBL.Clients.WindowClient.bringToFront();\n\t\tdispatch(MenuActions.OPEN_MENU(thisMenuId));\n\t}, [dispatch, thisMenuId]);\n\n\tconst closeMenu = useCallback(() => {\n\t\tdispatch(MenuActions.CLOSE_MENU(thisMenuId));\n\t}, [dispatch, thisMenuId]);\n\n\tconst blurMenu = useCallback(() => {\n\t\tif (FSBL?.debug) return; // If we're debugging then don't blur menus\n\n\t\t// This is a purposeful closure. There is no need to update it with new state.\n\t\tconst closeIfPending = () => {\n\t\t\tdispatch(MenuActions.CLOSE_MENU_IF_PENDING(thisMenuId));\n\t\t};\n\n\t\tdispatch(MenuActions.BLUR_MENU(thisMenuId));\n\n\t\t// See menuReducer.ts for how this timeout is used. Removing the timeout will cause a race condition.\n\t\tsetTimeout(closeIfPending, DURATION);\n\t}, [dispatch, thisMenuId]);\n\n\tconst isMenuActive = (): boolean => openMenuId === thisMenuId;\n\n\treturn {\n\t\topenMenuId,\n\t\ttoggleMenu,\n\t\tcloseMenu,\n\t\topenMenu,\n\t\tblurMenu,\n\t\tisMenuActive,\n\t};\n};\n"]}