@finsemble/finsemble-ui 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (788) hide show
  1. package/package.json +13 -11
  2. package/react/actions/favoriteActions.d.ts +1 -0
  3. package/react/actions/favoriteActions.js +1 -0
  4. package/react/actions/favoriteActions.js.map +1 -1
  5. package/react/actions/menuActions.d.ts +1 -0
  6. package/react/actions/menuActions.js +1 -0
  7. package/react/actions/menuActions.js.map +1 -1
  8. package/react/actions/rootActions.d.ts +1 -0
  9. package/react/actions/rootActions.js +1 -0
  10. package/react/actions/rootActions.js.map +1 -1
  11. package/react/actions/searchActions.d.ts +1 -0
  12. package/react/actions/searchActions.js +1 -0
  13. package/react/actions/searchActions.js.map +1 -1
  14. package/react/actions/toolbarActions.d.ts +34 -0
  15. package/react/actions/toolbarActions.js +17 -0
  16. package/react/actions/toolbarActions.js.map +1 -1
  17. package/react/actions/workspaceActions.d.ts +1 -0
  18. package/react/actions/workspaceActions.js +1 -0
  19. package/react/actions/workspaceActions.js.map +1 -1
  20. package/react/assets/css/advancedAppLauncher.css +22 -19
  21. package/react/assets/css/appCatalog.css +67 -72
  22. package/react/assets/css/authentication.css +4 -3
  23. package/react/assets/css/button.css +3 -10
  24. package/react/assets/css/core/formElements.css +1 -1
  25. package/react/assets/css/core/icons.css +3 -2
  26. package/react/assets/css/core/notifications.css +2 -2
  27. package/react/assets/css/core/windowFrame.css +9 -9
  28. package/react/assets/css/dashbar.css +1 -1
  29. package/react/assets/css/defaultTheme.css +9 -53
  30. package/react/assets/css/dialogs.css +13 -11
  31. package/react/assets/css/favorites.css +3 -1
  32. package/react/assets/css/finsemble.css +3 -2
  33. package/react/assets/css/font-finance.css +233 -120
  34. package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +10 -10
  35. package/react/assets/css/linkerWindow.css +2 -2
  36. package/react/assets/css/menus.css +10 -10
  37. package/react/assets/css/notificationsCenter.css +16 -31
  38. package/react/assets/css/processMonitor.css +7 -4
  39. package/react/assets/css/search.css +1 -1
  40. package/react/assets/css/shared/animations.css +10 -4
  41. package/react/assets/css/shared/common.css +2 -2
  42. package/react/assets/css/tags.css +10 -10
  43. package/react/assets/css/toolbar.css +22 -19
  44. package/react/assets/css/userPreferences.css +12 -14
  45. package/react/assets/css/windowTitleBar.css +75 -36
  46. package/react/componentTemplateGenerator.js +3 -2
  47. package/react/componentTemplateGenerator.js.map +1 -1
  48. package/react/components/FinsembleProvider.d.ts +7 -0
  49. package/react/components/FinsembleProvider.js +2 -0
  50. package/react/components/FinsembleProvider.js.map +1 -1
  51. package/react/components/appCatalog/AppCatalog.d.ts +4 -0
  52. package/react/components/appCatalog/AppCatalog.js +4 -0
  53. package/react/components/appCatalog/AppCatalog.js.map +1 -1
  54. package/react/components/appCatalog/AppCatalogComponent.d.ts +58 -0
  55. package/react/components/appCatalog/AppCatalogComponent.js +70 -1
  56. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  57. package/react/components/appCatalog/components/AppCard.d.ts +35 -0
  58. package/react/components/appCatalog/components/AppCard.js +42 -0
  59. package/react/components/appCatalog/components/AppCard.js.map +1 -1
  60. package/react/components/appCatalog/components/AppResults.d.ts +10 -0
  61. package/react/components/appCatalog/components/AppResults.js +24 -0
  62. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  63. package/react/components/appCatalog/components/Carousel.d.ts +26 -0
  64. package/react/components/appCatalog/components/Carousel.js +34 -0
  65. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  66. package/react/components/appCatalog/components/EmptyResults.d.ts +4 -0
  67. package/react/components/appCatalog/components/EmptyResults.js +8 -0
  68. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  69. package/react/components/appCatalog/components/Hero.d.ts +15 -0
  70. package/react/components/appCatalog/components/Hero.js +15 -0
  71. package/react/components/appCatalog/components/Hero.js.map +1 -1
  72. package/react/components/appCatalog/components/Home.d.ts +6 -4
  73. package/react/components/appCatalog/components/Home.js +10 -0
  74. package/react/components/appCatalog/components/Home.js.map +1 -1
  75. package/react/components/appCatalog/components/SearchBar.d.ts +31 -0
  76. package/react/components/appCatalog/components/SearchBar.js +33 -0
  77. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  78. package/react/components/appCatalog/components/Showcase/AppDescription.d.ts +5 -0
  79. package/react/components/appCatalog/components/Showcase/AppDescription.js +9 -0
  80. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  81. package/react/components/appCatalog/components/Showcase/AppDevNotes.d.ts +7 -0
  82. package/react/components/appCatalog/components/Showcase/AppDevNotes.js +15 -0
  83. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  84. package/react/components/appCatalog/components/Showcase/AppShowcase.d.ts +17 -0
  85. package/react/components/appCatalog/components/Showcase/AppShowcase.js +25 -0
  86. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  87. package/react/components/appCatalog/components/Showcase/Header.d.ts +7 -0
  88. package/react/components/appCatalog/components/Showcase/Header.js +12 -0
  89. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  90. package/react/components/appCatalog/components/Showcase/ImageCarousel.d.ts +7 -0
  91. package/react/components/appCatalog/components/Showcase/ImageCarousel.js +11 -0
  92. package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
  93. package/react/components/appCatalog/components/Showcase/Modal.d.ts +10 -0
  94. package/react/components/appCatalog/components/Showcase/Modal.js +10 -0
  95. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  96. package/react/components/appCatalog/components/Showcase/ReleaseNotes.d.ts +5 -0
  97. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js +9 -0
  98. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
  99. package/react/components/appCatalog/components/Showcase/SupportNotes.d.ts +6 -0
  100. package/react/components/appCatalog/components/Showcase/SupportNotes.js +11 -0
  101. package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
  102. package/react/components/appCatalog/components/Showcase/VersionNotes.d.ts +5 -0
  103. package/react/components/appCatalog/components/Showcase/VersionNotes.js +9 -0
  104. package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
  105. package/react/components/appCatalog/components/Tag.d.ts +6 -0
  106. package/react/components/appCatalog/components/Tag.js +10 -0
  107. package/react/components/appCatalog/components/Tag.js.map +1 -1
  108. package/react/components/appCatalog/components/Toast.d.ts +5 -0
  109. package/react/components/appCatalog/components/Toast.js +9 -0
  110. package/react/components/appCatalog/components/Toast.js.map +1 -1
  111. package/react/components/appCatalog/components/helpers.js +1 -0
  112. package/react/components/appCatalog/components/helpers.js.map +1 -1
  113. package/react/components/appCatalog/modules/AppDirectory.d.ts +5 -0
  114. package/react/components/appCatalog/modules/AppDirectory.js +5 -0
  115. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  116. package/react/components/appCatalog/modules/FDC3.d.ts +37 -0
  117. package/react/components/appCatalog/modules/FDC3.js +40 -0
  118. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  119. package/react/components/appCatalog/stores/appStore.js +1 -0
  120. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  121. package/react/components/appCatalog/stores/storeActions.d.ts +91 -0
  122. package/react/components/appCatalog/stores/storeActions.js +116 -1
  123. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  124. package/react/components/common/Checkbox.d.ts +1 -0
  125. package/react/components/common/Checkbox.js +2 -2
  126. package/react/components/common/Checkbox.js.map +1 -1
  127. package/react/components/common/ColorPicker.d.ts +5 -0
  128. package/react/components/common/ColorPicker.js +40 -0
  129. package/react/components/common/ColorPicker.js.map +1 -1
  130. package/react/components/common/DropZone.d.ts +11 -0
  131. package/react/components/common/DropZone.js +21 -1
  132. package/react/components/common/DropZone.js.map +1 -1
  133. package/react/components/common/DropdownButton.d.ts +4 -0
  134. package/react/components/common/DropdownButton.js +4 -0
  135. package/react/components/common/DropdownButton.js.map +1 -1
  136. package/react/components/common/ErrorBoundary.d.ts +18 -0
  137. package/react/components/common/ErrorBoundary.js +21 -0
  138. package/react/components/common/ErrorBoundary.js.map +1 -1
  139. package/react/components/common/FileInput.d.ts +8 -1
  140. package/react/components/common/FileInput.js +19 -4
  141. package/react/components/common/FileInput.js.map +1 -1
  142. package/react/components/common/FinsembleIcon.d.ts +10 -0
  143. package/react/components/common/FinsembleIcon.js +51 -2
  144. package/react/components/common/FinsembleIcon.js.map +1 -1
  145. package/react/components/common/FinsembleSelect.js +5 -1
  146. package/react/components/common/FinsembleSelect.js.map +1 -1
  147. package/react/components/common/FinsembleToggleButtonBar.js +1 -1
  148. package/react/components/common/FinsembleToggleButtonBar.js.map +1 -1
  149. package/react/components/common/InputTable.d.ts +7 -0
  150. package/react/components/common/InputTable.js +7 -0
  151. package/react/components/common/InputTable.js.map +1 -1
  152. package/react/components/common/Tab.js +3 -0
  153. package/react/components/common/Tab.js.map +1 -1
  154. package/react/components/common/TimeSelect.js +24 -0
  155. package/react/components/common/TimeSelect.js.map +1 -1
  156. package/react/components/common/Tooltip.js +2 -0
  157. package/react/components/common/Tooltip.js.map +1 -1
  158. package/react/components/common/css/accordion.css +9 -6
  159. package/react/components/common/css/application-edit-page.css +39 -44
  160. package/react/components/common/css/button.css +10 -5
  161. package/react/components/common/css/color-picker.css +3 -3
  162. package/react/components/common/css/drop-zone.css +2 -6
  163. package/react/components/common/css/file-input.css +5 -5
  164. package/react/components/common/css/header.css +3 -2
  165. package/react/components/common/css/icon.css +1 -1
  166. package/react/components/common/css/loading-spinner.css +7 -12
  167. package/react/components/common/css/selector.css +4 -4
  168. package/react/components/common/css/styles.css +22 -16
  169. package/react/components/common/css/tab.css +8 -8
  170. package/react/components/common/css/time-select.css +1 -0
  171. package/react/components/common/css/toggle.css +4 -4
  172. package/react/components/common/css/tooltip.css +2 -3
  173. package/react/components/common/file_helpers.js +2 -0
  174. package/react/components/common/file_helpers.js.map +1 -1
  175. package/react/components/common/helpers.js +1 -0
  176. package/react/components/common/helpers.js.map +1 -1
  177. package/react/components/common/stories/ColorPicker.stories.js +3 -0
  178. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  179. package/react/components/common/stories/FileInput.stories.d.ts +3 -1
  180. package/react/components/common/stories/FileInput.stories.js +12 -0
  181. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  182. package/react/components/common/tests/Accordion.spec.js +6 -0
  183. package/react/components/common/tests/Accordion.spec.js.map +1 -1
  184. package/react/components/common/tests/Checkbox.spec.js +1 -0
  185. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  186. package/react/components/common/tests/ColorPicker.spec.js +6 -0
  187. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  188. package/react/components/common/tests/DropZone.spec.js +1 -0
  189. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  190. package/react/components/common/tests/FileInput.spec.js +22 -0
  191. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  192. package/react/components/common/tests/FinsembleSelect.spec.js +1 -0
  193. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  194. package/react/components/common/tests/FinsembleToggle.spec.js +1 -0
  195. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  196. package/react/components/common/tests/FinsembleToggleButtonBar.spec.js +1 -0
  197. package/react/components/common/tests/FinsembleToggleButtonBar.spec.js.map +1 -1
  198. package/react/components/common/tests/TimeSelect.spec.js +4 -0
  199. package/react/components/common/tests/TimeSelect.spec.js.map +1 -1
  200. package/react/components/common/tests/Tooltip.spec.js +16 -0
  201. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  202. package/react/components/favorites/FavoriteMaker.d.ts +8 -0
  203. package/react/components/favorites/FavoriteMaker.js +9 -0
  204. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  205. package/react/components/favorites/FavoritesShell.d.ts +4 -0
  206. package/react/components/favorites/FavoritesShell.js +13 -1
  207. package/react/components/favorites/FavoritesShell.js.map +1 -1
  208. package/react/components/favorites/FavoritesShell.spec.js +3 -0
  209. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  210. package/react/components/fdc3Resolver/ResolverContainer.js +8 -0
  211. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  212. package/react/components/fdc3Resolver/ResolverDialog.css +16 -3
  213. package/react/components/fdc3Resolver/ResolverDialog.js +7 -2
  214. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  215. package/react/components/fdc3Resolver/ResolverDialog.spec.js +3 -2
  216. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  217. package/react/components/fdc3Resolver/ResolverDialog.stories.js +2 -0
  218. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  219. package/react/components/icon/Icon.d.ts +13 -0
  220. package/react/components/icon/Icon.js +34 -0
  221. package/react/components/icon/Icon.js.map +1 -1
  222. package/react/components/legacyControls/FinsembleDialog.d.ts +4 -0
  223. package/react/components/legacyControls/FinsembleDialog.js +15 -0
  224. package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
  225. package/react/components/legacyControls/FinsembleDialogButton.d.ts +3 -0
  226. package/react/components/legacyControls/FinsembleDialogButton.js +6 -1
  227. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  228. package/react/components/legacyControls/FinsembleDialogQuestion.d.ts +7 -0
  229. package/react/components/legacyControls/FinsembleDialogQuestion.js +7 -0
  230. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  231. package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +3 -0
  232. package/react/components/legacyControls/FinsembleDialogTextInput.js +14 -0
  233. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  234. package/react/components/legacyControls/FinsembleDnDContext.d.ts +19 -0
  235. package/react/components/legacyControls/FinsembleDnDContext.js +126 -1
  236. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  237. package/react/components/legacyControls/FinsembleDraggable.d.ts +3 -0
  238. package/react/components/legacyControls/FinsembleDraggable.js +3 -0
  239. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  240. package/react/components/legacyControls/FinsembleHoverDetector.d.ts +15 -0
  241. package/react/components/legacyControls/FinsembleHoverDetector.js +26 -1
  242. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  243. package/react/components/legacyControls/FinsembleMenuSection.d.ts +4 -0
  244. package/react/components/legacyControls/FinsembleMenuSection.js +38 -0
  245. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  246. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js +1 -0
  247. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  248. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +1 -0
  249. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  250. package/react/components/linker/LinkerMenu.d.ts +3 -0
  251. package/react/components/linker/LinkerMenu.js +21 -0
  252. package/react/components/linker/LinkerMenu.js.map +1 -1
  253. package/react/components/linker/LinkerMenuDeprecated.d.ts +3 -0
  254. package/react/components/linker/LinkerMenuDeprecated.js +9 -0
  255. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  256. package/react/components/menu/Menu.d.ts +15 -0
  257. package/react/components/menu/Menu.js +15 -0
  258. package/react/components/menu/Menu.js.map +1 -1
  259. package/react/components/menu/MenuAutoResizer.d.ts +7 -0
  260. package/react/components/menu/MenuAutoResizer.js +27 -0
  261. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  262. package/react/components/menu/MenuContent.d.ts +4 -0
  263. package/react/components/menu/MenuContent.js +4 -0
  264. package/react/components/menu/MenuContent.js.map +1 -1
  265. package/react/components/menu/MenuHotKey.d.ts +14 -0
  266. package/react/components/menu/MenuHotKey.js +15 -0
  267. package/react/components/menu/MenuHotKey.js.map +1 -1
  268. package/react/components/menu/MenuItem.d.ts +8 -0
  269. package/react/components/menu/MenuItem.js +13 -2
  270. package/react/components/menu/MenuItem.js.map +1 -1
  271. package/react/components/menu/MenuPortal.js +112 -2
  272. package/react/components/menu/MenuPortal.js.map +1 -1
  273. package/react/components/menu/MenuShell.d.ts +16 -0
  274. package/react/components/menu/MenuShell.js +26 -0
  275. package/react/components/menu/MenuShell.js.map +1 -1
  276. package/react/components/menu/MenuToggle.d.ts +3 -0
  277. package/react/components/menu/MenuToggle.js +3 -0
  278. package/react/components/menu/MenuToggle.js.map +1 -1
  279. package/react/components/menu/keyboardNavigation.d.ts +12 -0
  280. package/react/components/menu/keyboardNavigation.js +55 -0
  281. package/react/components/menu/keyboardNavigation.js.map +1 -1
  282. package/react/components/menu/menuContext.d.ts +6 -0
  283. package/react/components/menu/menuContext.js +6 -0
  284. package/react/components/menu/menuContext.js.map +1 -1
  285. package/react/components/menu/menuHelpers.d.ts +22 -0
  286. package/react/components/menu/menuHelpers.js +58 -1
  287. package/react/components/menu/menuHelpers.js.map +1 -1
  288. package/react/components/notifications/components/drawer/DrawerControls.js +8 -0
  289. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  290. package/react/components/notifications/components/drawer/DrawerHeader.js +5 -0
  291. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  292. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +18 -0
  293. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  294. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +3 -0
  295. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  296. package/react/components/notifications/components/shared/CheckButton.js +1 -1
  297. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  298. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +9 -0
  299. package/react/components/notifications/components/shared/NotificationCardShell.js +13 -6
  300. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  301. package/react/components/notifications/components/shared/OverflowMenu.d.ts +4 -0
  302. package/react/components/notifications/components/shared/OverflowMenu.js +16 -2
  303. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  304. package/react/components/notifications/components/views/CardView.js +3 -0
  305. package/react/components/notifications/components/views/CardView.js.map +1 -1
  306. package/react/components/notifications/components/views/ListView.js +8 -0
  307. package/react/components/notifications/components/views/ListView.js.map +1 -1
  308. package/react/components/notifications/notificationsContext.d.ts +4 -0
  309. package/react/components/notifications/notificationsContext.js +4 -0
  310. package/react/components/notifications/notificationsContext.js.map +1 -1
  311. package/react/components/notifications/types.d.ts +3 -0
  312. package/react/components/notifications/utils.d.ts +4 -0
  313. package/react/components/notifications/utils.js +4 -0
  314. package/react/components/notifications/utils.js.map +1 -1
  315. package/react/components/processMonitor/ProcessMonitor.d.ts +3 -0
  316. package/react/components/processMonitor/ProcessMonitor.js +17 -2
  317. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  318. package/react/components/processMonitor/components/ChildWindow.d.ts +3 -0
  319. package/react/components/processMonitor/components/ChildWindow.js +5 -0
  320. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  321. package/react/components/processMonitor/components/ListHeader.d.ts +5 -0
  322. package/react/components/processMonitor/components/ListHeader.js +7 -0
  323. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  324. package/react/components/processMonitor/components/ProcessStatistics.js +12 -1
  325. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  326. package/react/components/processMonitor/constants.js +6 -0
  327. package/react/components/processMonitor/constants.js.map +1 -1
  328. package/react/components/processMonitor/helpers.d.ts +13 -0
  329. package/react/components/processMonitor/helpers.js +23 -3
  330. package/react/components/processMonitor/helpers.js.map +1 -1
  331. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +39 -0
  332. package/react/components/processMonitor/stores/ProcessMonitorStore.js +50 -0
  333. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  334. package/react/components/quickComponentForm/QuickComponentForm.d.ts +3 -0
  335. package/react/components/quickComponentForm/QuickComponentForm.js +20 -0
  336. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  337. package/react/components/quickComponentForm/quickComponent.css +1 -1
  338. package/react/components/sdd/AddApp.d.ts +4 -2
  339. package/react/components/sdd/AddApp.js +57 -49
  340. package/react/components/sdd/AddApp.js.map +1 -1
  341. package/react/components/sdd/AppEditAccess.js +8 -0
  342. package/react/components/sdd/AppEditAccess.js.map +1 -1
  343. package/react/components/sdd/AppEditPage.d.ts +2 -1
  344. package/react/components/sdd/AppEditPage.js +148 -361
  345. package/react/components/sdd/AppEditPage.js.map +1 -1
  346. package/react/components/sdd/Appearance.css +1 -1
  347. package/react/components/sdd/Appearance.js +3 -0
  348. package/react/components/sdd/Appearance.js.map +1 -1
  349. package/react/components/sdd/Application.js +39 -7
  350. package/react/components/sdd/Application.js.map +1 -1
  351. package/react/components/sdd/Applications.js +89 -13
  352. package/react/components/sdd/Applications.js.map +1 -1
  353. package/react/components/sdd/AssetsPage.css +3 -3
  354. package/react/components/sdd/EditPreload.js +10 -0
  355. package/react/components/sdd/EditPreload.js.map +1 -1
  356. package/react/components/sdd/ExportCloud.js +4 -0
  357. package/react/components/sdd/ExportCloud.js.map +1 -1
  358. package/react/components/sdd/Publish.js +2 -0
  359. package/react/components/sdd/Publish.js.map +1 -1
  360. package/react/components/sdd/PublishProgress.js +11 -1
  361. package/react/components/sdd/PublishProgress.js.map +1 -1
  362. package/react/components/sdd/SmartDesktopDesigner.js +17 -0
  363. package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
  364. package/react/components/sdd/ThemePage.css +6 -23
  365. package/react/components/sdd/ThemePage.js +1 -1
  366. package/react/components/sdd/ThemePage.js.map +1 -1
  367. package/react/components/sdd/Themes.js +2 -0
  368. package/react/components/sdd/Themes.js.map +1 -1
  369. package/react/components/sdd/Toolbar.js +7 -0
  370. package/react/components/sdd/Toolbar.js.map +1 -1
  371. package/react/components/sdd/appEditPage/Behavior.d.ts +34 -0
  372. package/react/components/sdd/appEditPage/Behavior.js +134 -0
  373. package/react/components/sdd/appEditPage/Behavior.js.map +1 -0
  374. package/react/components/sdd/appEditPage/Component.d.ts +22 -0
  375. package/react/components/sdd/appEditPage/Component.js +76 -0
  376. package/react/components/sdd/appEditPage/Component.js.map +1 -0
  377. package/react/components/sdd/appEditPage/DebugToolkit.d.ts +9 -0
  378. package/react/components/sdd/appEditPage/DebugToolkit.js +20 -0
  379. package/react/components/sdd/appEditPage/DebugToolkit.js.map +1 -0
  380. package/react/components/sdd/appEditPage/Interop.d.ts +10 -0
  381. package/react/components/sdd/appEditPage/Interop.js +40 -0
  382. package/react/components/sdd/appEditPage/Interop.js.map +1 -0
  383. package/react/components/sdd/appEditPage/Position.d.ts +18 -0
  384. package/react/components/sdd/appEditPage/Position.js +72 -0
  385. package/react/components/sdd/appEditPage/Position.js.map +1 -0
  386. package/react/components/sdd/appEditPage/Preloads.d.ts +9 -0
  387. package/react/components/sdd/appEditPage/Preloads.js +16 -0
  388. package/react/components/sdd/appEditPage/Preloads.js.map +1 -0
  389. package/react/components/sdd/appEditPage/SelectConnect.d.ts +15 -0
  390. package/react/components/sdd/appEditPage/SelectConnect.js +28 -0
  391. package/react/components/sdd/appEditPage/SelectConnect.js.map +1 -0
  392. package/react/components/sdd/appEditPage/Workspace.d.ts +12 -0
  393. package/react/components/sdd/appEditPage/Workspace.js +30 -0
  394. package/react/components/sdd/appEditPage/Workspace.js.map +1 -0
  395. package/react/components/sdd/common/getCSSVars.js +7 -2
  396. package/react/components/sdd/common/getCSSVars.js.map +1 -1
  397. package/react/components/sdd/common/setPreloadDefaults.js +4 -0
  398. package/react/components/sdd/common/setPreloadDefaults.js.map +1 -1
  399. package/react/components/sdd/css/addApp.css +18 -5
  400. package/react/components/sdd/css/appearance.css +6 -0
  401. package/react/components/sdd/css/applications.css +27 -14
  402. package/react/components/sdd/css/authentication.css +7 -6
  403. package/react/components/sdd/css/buttons.css +1 -1
  404. package/react/components/sdd/css/export.css +5 -3
  405. package/react/components/sdd/css/getting-started.css +2 -2
  406. package/react/components/sdd/css/nav.css +8 -11
  407. package/react/components/sdd/css/project-header.css +5 -7
  408. package/react/components/sdd/css/styles.css +29 -23
  409. package/react/components/sdd/css/views.css +4 -3
  410. package/react/components/sdd/fixtures/apps.js +12 -0
  411. package/react/components/sdd/fixtures/apps.js.map +1 -1
  412. package/react/components/sdd/fixtures/configTemplate.js +1 -0
  413. package/react/components/sdd/fixtures/configTemplate.js.map +1 -1
  414. package/react/components/sdd/fixtures/publishProgress.js +40 -0
  415. package/react/components/sdd/fixtures/publishProgress.js.map +1 -1
  416. package/react/components/sdd/sdd_helpers.d.ts +6 -0
  417. package/react/components/sdd/sdd_helpers.js +6 -0
  418. package/react/components/sdd/sdd_helpers.js.map +1 -1
  419. package/react/components/sdd/smartDesktopClient.d.ts +303 -0
  420. package/react/components/sdd/smartDesktopClient.js +334 -1
  421. package/react/components/sdd/smartDesktopClient.js.map +1 -1
  422. package/react/components/sdd/smartDesktopClient.spec.js +5 -2
  423. package/react/components/sdd/smartDesktopClient.spec.js.map +1 -1
  424. package/react/components/sdd/stories/AddApp.stories.d.ts +2 -1
  425. package/react/components/sdd/stories/AddApp.stories.js +8 -0
  426. package/react/components/sdd/stories/AddApp.stories.js.map +1 -1
  427. package/react/components/sdd/stories/AppEditPage.stories.d.ts +3 -1
  428. package/react/components/sdd/stories/AppEditPage.stories.js +3 -0
  429. package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -1
  430. package/react/components/sdd/stories/Appearance.stories.js +1 -0
  431. package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
  432. package/react/components/sdd/tests/AddApp.spec.js +40 -3
  433. package/react/components/sdd/tests/AddApp.spec.js.map +1 -1
  434. package/react/components/sdd/tests/AppEditPage.spec.js +16 -0
  435. package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
  436. package/react/components/sdd/tests/Application.spec.js +33 -438
  437. package/react/components/sdd/tests/Application.spec.js.map +1 -1
  438. package/react/components/sdd/tests/Applications.spec.d.ts +1 -1
  439. package/react/components/sdd/tests/Applications.spec.js +29 -5
  440. package/react/components/sdd/tests/Applications.spec.js.map +1 -1
  441. package/react/components/sdd/tests/Authentication.spec.js +7 -0
  442. package/react/components/sdd/tests/Authentication.spec.js.map +1 -1
  443. package/react/components/sdd/tests/ContentHeader.spec.js +2 -0
  444. package/react/components/sdd/tests/ContentHeader.spec.js.map +1 -1
  445. package/react/components/sdd/tests/EditPreload.spec.js +13 -0
  446. package/react/components/sdd/tests/EditPreload.spec.js.map +1 -1
  447. package/react/components/sdd/tests/Export.spec.js +2 -1
  448. package/react/components/sdd/tests/Export.spec.js.map +1 -1
  449. package/react/components/sdd/tests/ItemList.spec.js +4 -0
  450. package/react/components/sdd/tests/ItemList.spec.js.map +1 -1
  451. package/react/components/sdd/tests/OptionalSettingsView.spec.js +29 -0
  452. package/react/components/sdd/tests/OptionalSettingsView.spec.js.map +1 -1
  453. package/react/components/sdd/tests/ProjectErrors.spec.js +2 -0
  454. package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -1
  455. package/react/components/sdd/tests/Themes.spec.js +1 -1
  456. package/react/components/sdd/tests/Themes.spec.js.map +1 -1
  457. package/react/components/sdd/tests/Toolbar.spec.js +53 -0
  458. package/react/components/sdd/tests/Toolbar.spec.js.map +1 -1
  459. package/react/components/sdd/tests/a11y_helper.js +8 -0
  460. package/react/components/sdd/tests/a11y_helper.js.map +1 -1
  461. package/react/components/search/Highlight.d.ts +6 -0
  462. package/react/components/search/Highlight.js +19 -0
  463. package/react/components/search/Highlight.js.map +1 -1
  464. package/react/components/search/SearchBestMatch.d.ts +4 -0
  465. package/react/components/search/SearchBestMatch.js +11 -0
  466. package/react/components/search/SearchBestMatch.js.map +1 -1
  467. package/react/components/search/SearchInput.d.ts +5 -0
  468. package/react/components/search/SearchInput.js +6 -0
  469. package/react/components/search/SearchInput.js.map +1 -1
  470. package/react/components/search/SearchProviderResults.js +2 -0
  471. package/react/components/search/SearchProviderResults.js.map +1 -1
  472. package/react/components/search/SearchResult.js +6 -0
  473. package/react/components/search/SearchResult.js.map +1 -1
  474. package/react/components/search/SearchResult.spec.js +7 -0
  475. package/react/components/search/SearchResult.spec.js.map +1 -1
  476. package/react/components/search/SearchResult.stories.js +4 -0
  477. package/react/components/search/SearchResult.stories.js.map +1 -1
  478. package/react/components/search/SearchResults.js +5 -1
  479. package/react/components/search/SearchResults.js.map +1 -1
  480. package/react/components/search/SearchResults.spec.js +7 -0
  481. package/react/components/search/SearchResults.spec.js.map +1 -1
  482. package/react/components/shared/Animate.d.ts +5 -0
  483. package/react/components/shared/Animate.js +12 -1
  484. package/react/components/shared/Animate.js.map +1 -1
  485. package/react/components/shared/DefaultDropdownButton.js +9 -0
  486. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  487. package/react/components/shared/Tag.d.ts +0 -4
  488. package/react/components/shared/Tag.js +4 -0
  489. package/react/components/shared/Tag.js.map +1 -1
  490. package/react/components/shared/TagsMenu.d.ts +6 -0
  491. package/react/components/shared/TagsMenu.js +7 -0
  492. package/react/components/shared/TagsMenu.js.map +1 -1
  493. package/react/components/shared/addProtocolToValidURL.d.ts +6 -0
  494. package/react/components/shared/addProtocolToValidURL.js +6 -0
  495. package/react/components/shared/addProtocolToValidURL.js.map +1 -1
  496. package/react/components/shared/openQuitConfirmationDialog.d.ts +1 -1
  497. package/react/components/shared/openQuitConfirmationDialog.js +4 -4
  498. package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
  499. package/react/components/shared/tests/addProtocolToValidURL.spec.js +1 -0
  500. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
  501. package/react/components/shared/validateURL.d.ts +18 -0
  502. package/react/components/shared/validateURL.js +24 -5
  503. package/react/components/shared/validateURL.js.map +1 -1
  504. package/react/components/singleInputDialog/SingleInputDialog.css +1 -1
  505. package/react/components/singleInputDialog/SingleInputDialog.d.ts +3 -0
  506. package/react/components/singleInputDialog/SingleInputDialog.js +44 -0
  507. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  508. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +6 -0
  509. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  510. package/react/components/system/System.d.ts +22 -0
  511. package/react/components/system/System.js +23 -1
  512. package/react/components/system/System.js.map +1 -1
  513. package/react/components/system/System.stories.js +1 -0
  514. package/react/components/system/System.stories.js.map +1 -1
  515. package/react/components/system/SystemTrayComponentShell.d.ts +6 -0
  516. package/react/components/system/SystemTrayComponentShell.js +9 -0
  517. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  518. package/react/components/toolbar/AutoArrange.d.ts +5 -0
  519. package/react/components/toolbar/AutoArrange.js +8 -1
  520. package/react/components/toolbar/AutoArrange.js.map +1 -1
  521. package/react/components/toolbar/AutoArrange.spec.js +1 -0
  522. package/react/components/toolbar/AutoArrange.spec.js.map +1 -1
  523. package/react/components/toolbar/AutoArrange.stories.js +1 -0
  524. package/react/components/toolbar/AutoArrange.stories.js.map +1 -1
  525. package/react/components/toolbar/DragHandle.d.ts +4 -0
  526. package/react/components/toolbar/DragHandle.js +11 -0
  527. package/react/components/toolbar/DragHandle.js.map +1 -1
  528. package/react/components/toolbar/DragHandle.spec.js +1 -0
  529. package/react/components/toolbar/DragHandle.spec.js.map +1 -1
  530. package/react/components/toolbar/DragHandle.stories.js +1 -0
  531. package/react/components/toolbar/DragHandle.stories.js.map +1 -1
  532. package/react/components/toolbar/MinimizeAll.d.ts +4 -0
  533. package/react/components/toolbar/MinimizeAll.js +7 -1
  534. package/react/components/toolbar/MinimizeAll.js.map +1 -1
  535. package/react/components/toolbar/MinimizeAll.spec.js +1 -0
  536. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  537. package/react/components/toolbar/MinimizeAll.stories.js +1 -0
  538. package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
  539. package/react/components/toolbar/NotificationControl.d.ts +5 -0
  540. package/react/components/toolbar/NotificationControl.js +8 -1
  541. package/react/components/toolbar/NotificationControl.js.map +1 -1
  542. package/react/components/toolbar/RevealAll.d.ts +4 -0
  543. package/react/components/toolbar/RevealAll.js +7 -1
  544. package/react/components/toolbar/RevealAll.js.map +1 -1
  545. package/react/components/toolbar/RevealAll.spec.js +1 -0
  546. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  547. package/react/components/toolbar/RevealAll.stories.js +1 -0
  548. package/react/components/toolbar/RevealAll.stories.js.map +1 -1
  549. package/react/components/toolbar/SddButton.d.ts +4 -0
  550. package/react/components/toolbar/SddButton.js +4 -0
  551. package/react/components/toolbar/SddButton.js.map +1 -1
  552. package/react/components/toolbar/ToolbarIcon.d.ts +4 -0
  553. package/react/components/toolbar/ToolbarIcon.js +4 -0
  554. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  555. package/react/components/toolbar/ToolbarSection.d.ts +7 -0
  556. package/react/components/toolbar/ToolbarSection.js +19 -1
  557. package/react/components/toolbar/ToolbarSection.js.map +1 -1
  558. package/react/components/toolbar/ToolbarShell.d.ts +5 -0
  559. package/react/components/toolbar/ToolbarShell.js +7 -0
  560. package/react/components/toolbar/ToolbarShell.js.map +1 -1
  561. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +16 -0
  562. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js +20 -0
  563. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  564. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.d.ts +52 -0
  565. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js +58 -0
  566. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  567. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.d.ts +5 -0
  568. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js +5 -0
  569. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  570. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.d.ts +27 -0
  571. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js +49 -0
  572. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  573. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +13 -0
  574. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js +14 -0
  575. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  576. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +5 -0
  577. package/react/components/toolbar/advancedAppLauncher/components/Content.js +19 -0
  578. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  579. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.d.ts +4 -0
  580. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js +4 -0
  581. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  582. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +16 -0
  583. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +39 -0
  584. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  585. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.d.ts +4 -0
  586. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js +9 -0
  587. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  588. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js +3 -0
  589. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  590. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.d.ts +6 -0
  591. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js +7 -0
  592. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  593. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.d.ts +5 -0
  594. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js +5 -0
  595. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
  596. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.d.ts +5 -0
  597. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js +5 -0
  598. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  599. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.d.ts +37 -0
  600. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js +40 -0
  601. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  602. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.d.ts +3 -0
  603. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +82 -0
  604. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  605. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.d.ts +10 -0
  606. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js +11 -0
  607. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  608. package/react/components/toolbar/appLauncher/AppLauncherMenu.d.ts +18 -0
  609. package/react/components/toolbar/appLauncher/AppLauncherMenu.js +20 -0
  610. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  611. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +9 -0
  612. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js +12 -0
  613. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  614. package/react/components/toolbar/appLauncher/appLauncher.css +1 -1
  615. package/react/components/toolbar/appLauncher/components/componentList.d.ts +3 -0
  616. package/react/components/toolbar/appLauncher/components/componentList.js +17 -3
  617. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  618. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +6 -0
  619. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +26 -0
  620. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  621. package/react/components/toolbar/dashbar/Dashbar.js +70 -3
  622. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  623. package/react/components/toolbar/dashbar/DashbarItem.js +5 -0
  624. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  625. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +7 -0
  626. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js +7 -0
  627. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  628. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +16 -0
  629. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +20 -0
  630. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  631. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.d.ts +26 -0
  632. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js +29 -0
  633. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  634. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +5 -0
  635. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js +6 -0
  636. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  637. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +76 -0
  638. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +140 -1
  639. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  640. package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +8 -18
  641. package/react/components/userPreferences/NotificationsPreferencesContext.d.ts +4 -0
  642. package/react/components/userPreferences/NotificationsPreferencesContext.js +4 -0
  643. package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
  644. package/react/components/userPreferences/UserPreferenceTypes.d.ts +3 -0
  645. package/react/components/userPreferences/UserPreferences.d.ts +8 -0
  646. package/react/components/userPreferences/UserPreferences.js +8 -0
  647. package/react/components/userPreferences/UserPreferences.js.map +1 -1
  648. package/react/components/userPreferences/UserPreferencesBase.js +4 -0
  649. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  650. package/react/components/userPreferences/components/ContentSection.d.ts +5 -0
  651. package/react/components/userPreferences/components/LeftNav.d.ts +4 -0
  652. package/react/components/userPreferences/components/content/DashbarEditor.js +3 -0
  653. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  654. package/react/components/userPreferences/components/content/Notifications.js +3 -0
  655. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  656. package/react/components/userPreferences/components/content/Workspaces.d.ts +12 -0
  657. package/react/components/userPreferences/components/content/Workspaces.js +36 -3
  658. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  659. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +3 -0
  660. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  661. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +3 -0
  662. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  663. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +3 -0
  664. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  665. package/react/components/userPreferences/components/general/ScheduledClose.js +11 -0
  666. package/react/components/userPreferences/components/general/ScheduledClose.js.map +1 -1
  667. package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +1 -1
  668. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +20 -10
  669. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  670. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +17 -0
  671. package/react/components/userPreferences/stores/UserPreferencesStore.js +27 -0
  672. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  673. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +1 -0
  674. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  675. package/react/components/userPreferences/tests/Workspace.spec.js +20 -0
  676. package/react/components/userPreferences/tests/Workspace.spec.js.map +1 -1
  677. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +111 -0
  678. package/react/components/windowTitleBar/WindowTitleBarShell.js +218 -47
  679. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  680. package/react/components/windowTitleBar/components/center/Tab.d.ts +3 -0
  681. package/react/components/windowTitleBar/components/center/Tab.js +3 -0
  682. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  683. package/react/components/windowTitleBar/components/center/TabList.d.ts +90 -0
  684. package/react/components/windowTitleBar/components/center/TabList.js +170 -4
  685. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  686. package/react/components/windowTitleBar/components/left/LinkerButton.d.ts +9 -1
  687. package/react/components/windowTitleBar/components/left/LinkerButton.js +25 -9
  688. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  689. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +47 -0
  690. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js +76 -1
  691. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
  692. package/react/components/windowTitleBar/components/left/LinkerGroups.d.ts +4 -0
  693. package/react/components/windowTitleBar/components/left/LinkerGroups.js +5 -0
  694. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  695. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts +18 -0
  696. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js +49 -0
  697. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
  698. package/react/components/windowTitleBar/components/left/ShareButton.d.ts +17 -0
  699. package/react/components/windowTitleBar/components/left/ShareButton.js +39 -0
  700. package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
  701. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js +4 -0
  702. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
  703. package/react/components/windowTitleBar/components/right/CloseButton.d.ts +27 -0
  704. package/react/components/windowTitleBar/components/right/CloseButton.js +27 -0
  705. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  706. package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +37 -0
  707. package/react/components/windowTitleBar/components/right/GroupingButton.js +40 -0
  708. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  709. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +46 -0
  710. package/react/components/windowTitleBar/components/right/MaximizeButton.js +54 -0
  711. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  712. package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +26 -0
  713. package/react/components/windowTitleBar/components/right/MinimizeButton.js +26 -0
  714. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  715. package/react/components/windowTitleBar/components/windowTitle.d.ts +40 -0
  716. package/react/components/windowTitleBar/components/windowTitle.js +172 -10
  717. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  718. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +5 -0
  719. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +72 -1
  720. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  721. package/react/components/yesNoDialog/YesNoDialog.css +1 -1
  722. package/react/components/yesNoDialog/YesNoDialog.d.ts +3 -0
  723. package/react/components/yesNoDialog/YesNoDialog.js +63 -0
  724. package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
  725. package/react/components/yesNoDialog/YesNoDialog.spec.js +4 -0
  726. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  727. package/react/components/yesNoDialog/timer.js +2 -0
  728. package/react/components/yesNoDialog/timer.js.map +1 -1
  729. package/react/enzymeSetup.js +5 -0
  730. package/react/enzymeSetup.js.map +1 -1
  731. package/react/hooks/useDashbar.js +10 -0
  732. package/react/hooks/useDashbar.js.map +1 -1
  733. package/react/hooks/useDeepEffect.d.ts +4 -0
  734. package/react/hooks/useDeepEffect.js +21 -0
  735. package/react/hooks/useDeepEffect.js.map +1 -1
  736. package/react/hooks/useFavorites.d.ts +15 -0
  737. package/react/hooks/useFavorites.js +3 -0
  738. package/react/hooks/useFavorites.js.map +1 -1
  739. package/react/hooks/useFavoritesShell.d.ts +4 -0
  740. package/react/hooks/useFavoritesShell.js +23 -0
  741. package/react/hooks/useFavoritesShell.js.map +1 -1
  742. package/react/hooks/useHotkey.d.ts +6 -0
  743. package/react/hooks/useHotkey.js +9 -0
  744. package/react/hooks/useHotkey.js.map +1 -1
  745. package/react/hooks/useLinker.js +14 -0
  746. package/react/hooks/useLinker.js.map +1 -1
  747. package/react/hooks/useMenu.d.ts +29 -0
  748. package/react/hooks/useMenu.js +12 -1
  749. package/react/hooks/useMenu.js.map +1 -1
  750. package/react/hooks/useNotifications.d.ts +44 -0
  751. package/react/hooks/useNotifications.js +100 -4
  752. package/react/hooks/useNotifications.js.map +1 -1
  753. package/react/hooks/useOutsideClickDetector.d.ts +3 -0
  754. package/react/hooks/useOutsideClickDetector.js +3 -0
  755. package/react/hooks/useOutsideClickDetector.js.map +1 -1
  756. package/react/hooks/usePubSub.d.ts +17 -0
  757. package/react/hooks/usePubSub.js +18 -0
  758. package/react/hooks/usePubSub.js.map +1 -1
  759. package/react/hooks/useSearch.d.ts +5 -0
  760. package/react/hooks/useSearch.js +30 -0
  761. package/react/hooks/useSearch.js.map +1 -1
  762. package/react/hooks/useToolbar.js +52 -0
  763. package/react/hooks/useToolbar.js.map +1 -1
  764. package/react/reducers/favoriteReducer.d.ts +3 -0
  765. package/react/reducers/linkerReducer.d.ts +3 -0
  766. package/react/reducers/linkerReducer.js +4 -0
  767. package/react/reducers/linkerReducer.js.map +1 -1
  768. package/react/reducers/menuReducer.d.ts +28 -0
  769. package/react/reducers/menuReducer.js +34 -0
  770. package/react/reducers/menuReducer.js.map +1 -1
  771. package/react/reducers/rootReducer.js +3 -0
  772. package/react/reducers/rootReducer.js.map +1 -1
  773. package/react/reducers/searchReducer.d.ts +7 -0
  774. package/react/reducers/searchReducer.js +6 -0
  775. package/react/reducers/searchReducer.js.map +1 -1
  776. package/react/reducers/workspaceReducer.js +1 -0
  777. package/react/reducers/workspaceReducer.js.map +1 -1
  778. package/react/store.d.ts +4 -0
  779. package/react/store.js +11 -0
  780. package/react/store.js.map +1 -1
  781. package/react/tsconfig.tsbuildinfo +1 -1
  782. package/react/types/fdc3.d.ts +2 -0
  783. package/react/types/linkerTypes.d.ts +13 -0
  784. package/react/types/linkerTypes.js +1 -0
  785. package/react/types/linkerTypes.js.map +1 -1
  786. package/react/types/smartDesktopDesignerTypes.d.ts +5 -0
  787. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  788. package/react/types/workspaceTypes.d.ts +8 -0
@@ -16,12 +16,21 @@ const VALIDATION_DEFAULTS = {
16
16
  };
17
17
  const INVALID_NAME_MSG = "Name cannot be empty or be a duplicate of an existing component.";
18
18
  let INVALID_URL_MSG = "URL must be valid (e.g., http://www.google.com). Only http and https protocols are supported.";
19
+ /**
20
+ * A component that has a form to accept new app properties
21
+ * like name, url and tags, validates user input then saves it
22
+ * to persistent store. Showing or hiding this component is up to
23
+ * parent component.
24
+ * @example <AddNewAppForm onDone={this.someHandlerFunction}></AddNewAppForm>
25
+ */
19
26
  export default class AddNewAppForm extends React.Component {
20
27
  constructor(props) {
21
28
  super(props);
22
29
  this.state = {
30
+ // if you do not do this, FORM_DEFAULTS gets mutated by setState later on.
23
31
  form: Object.assign({}, FORM_DEFAULTS),
24
32
  validation: Object.assign({}, VALIDATION_DEFAULTS),
33
+ // changed to true after the user submits (if they submit bad information). This gives updated information on keypress.
25
34
  validateOnInputChange: false,
26
35
  };
27
36
  this.onSubmit = this.onSubmit.bind(this);
@@ -34,6 +43,10 @@ export default class AddNewAppForm extends React.Component {
34
43
  this.addNewApp = this.addNewApp.bind(this);
35
44
  this.addNewAppCallback = this.addNewAppCallback.bind(this);
36
45
  }
46
+ /**
47
+ * Calls the storeActions.addApp() method
48
+ * to save the new app in store.
49
+ */
37
50
  onSubmit() {
38
51
  this.fixURL();
39
52
  this.fixName();
@@ -65,6 +78,7 @@ export default class AddNewAppForm extends React.Component {
65
78
  this.addNewApp(formData, this.addNewAppCallback);
66
79
  }
67
80
  addNewAppCallback(error) {
81
+ // Notify parent if no errors
68
82
  if (error) {
69
83
  FSBL.Clients.Logger.system.error(error);
70
84
  this.setState({
@@ -100,20 +114,35 @@ export default class AddNewAppForm extends React.Component {
100
114
  }, cb);
101
115
  }
102
116
  }
117
+ /**
118
+ * Clears all form inputs
119
+ */
103
120
  onClear() {
121
+ //document.getElementById("new-app").reset();
104
122
  this.setState({
105
123
  form: Object.assign({}, FORM_DEFAULTS),
106
124
  });
107
125
  }
126
+ /**
127
+ * Just cancel and do not add the app
128
+ */
108
129
  onCancel() {
109
130
  this.done();
110
131
  }
132
+ /**
133
+ * Calls the passed onDone property to let the parent component
134
+ * know that we finished processing user's request (submit/cancel)
135
+ */
111
136
  done() {
112
137
  if (this.props.onDone && typeof this.props.onDone === "function") {
113
138
  this.props.onDone();
114
139
  }
115
140
  this.onClear();
116
141
  }
142
+ /**
143
+ * When the url changes, validate it (after submit), or set state.
144
+ * @param {keyboardEvent} e
145
+ */
117
146
  onURLChanged(e) {
118
147
  let { form, validation } = this.state;
119
148
  if (!form) {
@@ -127,6 +156,10 @@ export default class AddNewAppForm extends React.Component {
127
156
  form,
128
157
  });
129
158
  }
159
+ /**
160
+ * When the name changes, validate it (after submit), or set state.
161
+ * @param {keyboardEvent} e
162
+ */
130
163
  onAppNameChanged(e) {
131
164
  let { form, validation } = this.state;
132
165
  if (!form) {
@@ -140,6 +173,13 @@ export default class AddNewAppForm extends React.Component {
140
173
  form,
141
174
  });
142
175
  }
176
+ /**
177
+ * Attempt to make a URL object, if successful the provided URL is valid.
178
+ * If the URL constructor determines the provided string to be invalid it throws a TypeError.
179
+ *
180
+ * @param {string} url
181
+ * @return boolean
182
+ */
143
183
  validateURL(url) {
144
184
  if (!url) {
145
185
  return false;
@@ -163,12 +203,19 @@ export default class AddNewAppForm extends React.Component {
163
203
  }
164
204
  return isValidURL(url);
165
205
  }
206
+ /**
207
+ * When the url changes, validate it (after submit), or set state.
208
+ * @param {string} name
209
+ */
166
210
  validateName(name) {
167
211
  if (typeof name !== "string") {
168
212
  return false;
169
213
  }
170
214
  return name !== "" || /^[0-9a-zA-Z_.-\s]+$/.test(name);
171
215
  }
216
+ /**
217
+ * Allows user to skip the protocol. Puts one in there if they don't have it.
218
+ */
172
219
  fixURL() {
173
220
  let { form } = this.state;
174
221
  if (!form) {
@@ -179,6 +226,9 @@ export default class AddNewAppForm extends React.Component {
179
226
  }
180
227
  this.setState({ form });
181
228
  }
229
+ /**
230
+ * Removes empty spaces from beginning and end of line
231
+ */
182
232
  fixName() {
183
233
  var _a;
184
234
  let { form } = this.state;
@@ -188,6 +238,12 @@ export default class AddNewAppForm extends React.Component {
188
238
  form.name = (_a = form.name) === null || _a === void 0 ? void 0 : _a.trim();
189
239
  this.setState({ form });
190
240
  }
241
+ /**
242
+ * Hotkey handler
243
+ * Escape clears the form and hides it.
244
+ * Enter submits.
245
+ * @param {} e
246
+ */
191
247
  onKeyDown(e) {
192
248
  if (e.detail.key === "Escape") {
193
249
  this.onClear();
@@ -197,9 +253,11 @@ export default class AddNewAppForm extends React.Component {
197
253
  this.onSubmit();
198
254
  }
199
255
  }
256
+ // Listen for esc/enter
200
257
  componentDidMount() {
201
258
  document.addEventListener("portal:keydown", this.onKeyDown);
202
259
  }
260
+ // remove listen for esc/enter
203
261
  componentWillUnmount() {
204
262
  document.removeEventListener("portal:keydown", this.onKeyDown);
205
263
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AddNewAppForm.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AddNewAppForm.tsx"],"names":[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,MAAM,EAClB,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAC1B;gBACD,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,IAAI,6BAAK,SAAS,EAAC,aAAa,IAAE,gBAAgB,CAAO;gBACrF,oBAAC,wBAAwB,IACxB,UAAU,EAAC,KAAK,EAChB,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,WAAW,EAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,GACzB;gBACD,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,6BAAK,SAAS,EAAC,aAAa,IAAE,eAAe,CAAO;gBACnF,6BAAK,SAAS,EAAC,gBAAgB;oBAC9B,oBAAC,qBAAqB,IAAC,SAAS,EAAC,qBAAqB,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,YAEpD;oBACxB,oBAAC,qBAAqB,IAAC,SAAS,EAAC,qBAAqB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,aAErD;oBACxB,oBAAC,qBAAqB,IAAC,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,cAEzD,CACnB,CACA,CACF,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport storeActions from \"../stores/StoreActions\";\nimport { FinsembleDialogTextInput } from \"../../../legacyControls/FinsembleDialogTextInput\";\nimport { FinsembleDialogButton } from \"../../../legacyControls/FinsembleDialogButton\";\nimport \"../../../../assets/css/dialogs.css\";\nimport { isValidURL } from \"../../../shared/validateURL\";\nimport { addProtocolToValidURL } from \"../../../shared/addProtocolToValidURL\";\n\nconst FORM_DEFAULTS = {\n\tname: \"\",\n\ttags: \"\",\n\turl: \"\",\n};\nconst VALIDATION_DEFAULTS = {\n\tname: true,\n\turl: true,\n};\n\nconst INVALID_NAME_MSG = \"Name cannot be empty or be a duplicate of an existing component.\";\nlet INVALID_URL_MSG = \"URL must be valid (e.g., http://www.google.com). Only http and https protocols are supported.\";\n\ninterface IState {\n\tform: {\n\t\tname?: string;\n\t\turl?: string;\n\t\ttags?: string;\n\t};\n\tvalidation: {\n\t\tname: boolean;\n\t\turl: boolean;\n\t};\n\tvalidateOnInputChange: boolean;\n}\ninterface IProps {\n\tonDone: () => void;\n\tcustomURLValidation: ((url: string) => [boolean, string]) | null;\n\tcustomAddComponent: ((formData: any, callback: (error: any | null) => void) => void) | null;\n\tbeforeAddComponent: ((formData: any) => object) | null;\n}\n/**\n * A component that has a form to accept new app properties\n * like name, url and tags, validates user input then saves it\n * to persistent store. Showing or hiding this component is up to\n * parent component.\n * @example <AddNewAppForm onDone={this.someHandlerFunction}></AddNewAppForm>\n */\nexport default class AddNewAppForm extends React.Component<IProps, IState> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\t// if you do not do this, FORM_DEFAULTS gets mutated by setState later on.\n\t\t\tform: Object.assign({}, FORM_DEFAULTS),\n\t\t\tvalidation: Object.assign({}, VALIDATION_DEFAULTS),\n\t\t\t// changed to true after the user submits (if they submit bad information). This gives updated information on keypress.\n\t\t\tvalidateOnInputChange: false,\n\t\t};\n\n\t\tthis.onSubmit = this.onSubmit.bind(this);\n\t\tthis.onClear = this.onClear.bind(this);\n\t\tthis.onCancel = this.onCancel.bind(this);\n\t\tthis.done = this.done.bind(this);\n\t\tthis.onURLChanged = this.onURLChanged.bind(this);\n\t\tthis.onAppNameChanged = this.onAppNameChanged.bind(this);\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.addNewApp = this.addNewApp.bind(this);\n\t\tthis.addNewAppCallback = this.addNewAppCallback.bind(this);\n\t}\n\n\t/**\n\t * Calls the storeActions.addApp() method\n\t * to save the new app in store.\n\t */\n\tonSubmit() {\n\t\tthis.fixURL();\n\t\tthis.fixName();\n\t\tlet validName = this.validateName(this.state.form.name);\n\t\tlet validURL = this.validateURL(this.state.form.url);\n\t\tif (!validName || !validURL) {\n\t\t\tthis.setState({\n\t\t\t\tvalidation: {\n\t\t\t\t\turl: validURL,\n\t\t\t\t\tname: validName,\n\t\t\t\t},\n\t\t\t\tvalidateOnInputChange: true,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tthis.setState({\n\t\t\tvalidation: Object.assign({}, VALIDATION_DEFAULTS),\n\t\t\tvalidateOnInputChange: false,\n\t\t});\n\n\t\tlet formData = this.state.form;\n\t\tif (this.props.beforeAddComponent) {\n\t\t\tif (typeof this.props.beforeAddComponent !== \"function\") {\n\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\"beforeAddComponent provided to Advanced App Launcher does not appear to be a function, skipping\"\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tformData = this.props.beforeAddComponent(formData);\n\t\t\t}\n\t\t}\n\n\t\tthis.addNewApp(formData, this.addNewAppCallback);\n\t}\n\n\taddNewAppCallback(error: any) {\n\t\t// Notify parent if no errors\n\t\tif (error) {\n\t\t\tFSBL.Clients.Logger.system.error(error);\n\t\t\tthis.setState({\n\t\t\t\tvalidation: {\n\t\t\t\t\tname: false,\n\t\t\t\t\turl: true,\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tthis.done();\n\t\t}\n\t}\n\n\taddNewApp(form: IState[\"form\"], cb: (err?: any) => void) {\n\t\tif (this.props.customAddComponent) {\n\t\t\tif (typeof this.props.customAddComponent === \"function\") {\n\t\t\t\tthis.props.customAddComponent(form, cb);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\"Custom Add Component parameter provided to Advanced App Launcher does not appear to be a function, falling back to default add\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst { name, url, tags } = form;\n\t\tif (name && url) {\n\t\t\tstoreActions.addApp(\n\t\t\t\t{\n\t\t\t\t\tname,\n\t\t\t\t\turl,\n\t\t\t\t\ttags: tags ? tags.split(\",\") : [],\n\t\t\t\t\tappID: name,\n\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\tcanDelete: true,\n\t\t\t\t},\n\t\t\t\tcb\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Clears all form inputs\n\t */\n\tonClear() {\n\t\t//document.getElementById(\"new-app\").reset();\n\t\tthis.setState({\n\t\t\tform: Object.assign({}, FORM_DEFAULTS),\n\t\t});\n\t}\n\n\t/**\n\t * Just cancel and do not add the app\n\t */\n\tonCancel() {\n\t\tthis.done();\n\t}\n\n\t/**\n\t * Calls the passed onDone property to let the parent component\n\t * know that we finished processing user's request (submit/cancel)\n\t */\n\tdone() {\n\t\tif (this.props.onDone && typeof this.props.onDone === \"function\") {\n\t\t\tthis.props.onDone();\n\t\t}\n\t\tthis.onClear();\n\t}\n\n\t/**\n\t * When the url changes, validate it (after submit), or set state.\n\t * @param {keyboardEvent} e\n\t */\n\tonURLChanged(e: React.ChangeEvent<HTMLInputElement>) {\n\t\tlet { form, validation } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tform.url = e.target.value;\n\t\tif (this.state.validateOnInputChange) {\n\t\t\tvalidation.url = this.validateURL(form.url);\n\t\t}\n\t\tthis.setState({\n\t\t\tform,\n\t\t});\n\t}\n\n\t/**\n\t * When the name changes, validate it (after submit), or set state.\n\t * @param {keyboardEvent} e\n\t */\n\tonAppNameChanged(e: React.ChangeEvent<HTMLInputElement>) {\n\t\tlet { form, validation } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tform.name = e.target.value;\n\t\tif (this.state.validateOnInputChange) {\n\t\t\tvalidation.name = this.validateName(form.name);\n\t\t}\n\t\tthis.setState({\n\t\t\tform,\n\t\t});\n\t}\n\n\t/**\n\t * Attempt to make a URL object, if successful the provided URL is valid.\n\t * If the URL constructor determines the provided string to be invalid it throws a TypeError.\n\t *\n\t * @param {string} url\n\t * @return boolean\n\t */\n\tvalidateURL(url?: string) {\n\t\tif (!url) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.props.customURLValidation) {\n\t\t\tif (typeof this.props.customURLValidation === \"function\") {\n\t\t\t\tconst [result, message] = this.props.customURLValidation(url);\n\t\t\t\tif (typeof result !== \"boolean\") {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\t\"Custom URL Validation routine does not return a boolean, falling back to default validation\"\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tif (message) {\n\t\t\t\t\t\tINVALID_URL_MSG = message;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\"Custom url validation provided to Advanced App Launcher does not appear to be a function, falling back to default validation\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn isValidURL(url);\n\t}\n\n\t/**\n\t * When the url changes, validate it (after submit), or set state.\n\t * @param {string} name\n\t */\n\tvalidateName(name?: string) {\n\t\tif (typeof name !== \"string\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn name !== \"\" || /^[0-9a-zA-Z_.-\\s]+$/.test(name);\n\t}\n\n\t/**\n\t * Allows user to skip the protocol. Puts one in there if they don't have it.\n\t */\n\tfixURL() {\n\t\tlet { form } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tif (typeof form.url === \"string\") {\n\t\t\tform.url = addProtocolToValidURL(form?.url);\n\t\t}\n\t\tthis.setState({ form });\n\t}\n\n\t/**\n\t * Removes empty spaces from beginning and end of line\n\t */\n\tfixName() {\n\t\tlet { form } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tform.name = form.name?.trim();\n\t\tthis.setState({ form });\n\t}\n\n\t/**\n\t * Hotkey handler\n\t * Escape clears the form and hides it.\n\t * Enter submits.\n\t * @param {} e\n\t */\n\tonKeyDown(e: any) {\n\t\tif (e.detail.key === \"Escape\") {\n\t\t\tthis.onClear();\n\t\t\tthis.done();\n\t\t}\n\t\tif (e.detail.key === \"Enter\") {\n\t\t\tthis.onSubmit();\n\t\t}\n\t}\n\n\t// Listen for esc/enter\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"portal:keydown\", this.onKeyDown);\n\t}\n\n\t// remove listen for esc/enter\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"portal:keydown\", this.onKeyDown);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div className=\"add-app-form controls-wrapper\">\n\t\t\t\t<form id=\"new-app\">\n\t\t\t\t\t<FinsembleDialogTextInput\n\t\t\t\t\t\tinputLabel=\"Name\"\n\t\t\t\t\t\tonInputChange={this.onAppNameChanged}\n\t\t\t\t\t\tplaceholder=\"Name\"\n\t\t\t\t\t\tautoFocus={true}\n\t\t\t\t\t\tvalue={this.state.form.name}\n\t\t\t\t\t/>\n\t\t\t\t\t{!this.state.validation.name && <div className=\"input-error\">{INVALID_NAME_MSG}</div>}\n\t\t\t\t\t<FinsembleDialogTextInput\n\t\t\t\t\t\tinputLabel=\"URL\"\n\t\t\t\t\t\tonInputChange={this.onURLChanged}\n\t\t\t\t\t\tplaceholder=\"URL\"\n\t\t\t\t\t\tvalue={this.state.form.url}\n\t\t\t\t\t/>\n\t\t\t\t\t{!this.state.validation.url && <div className=\"input-error\">{INVALID_URL_MSG}</div>}\n\t\t\t\t\t<div className=\"button-wrapper\">\n\t\t\t\t\t\t<FinsembleDialogButton className=\"fsbl-button-neutral\" onClick={this.onClear}>\n\t\t\t\t\t\t\tClear\n\t\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t\t\t<FinsembleDialogButton className=\"fsbl-button-neutral\" onClick={this.onCancel}>\n\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t\t\t<FinsembleDialogButton className=\"fsbl-button-affirmative\" onClick={this.onSubmit}>\n\t\t\t\t\t\t\tConfirm\n\t\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"AddNewAppForm.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AddNewAppForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,MAAM,aAAa,GAAG;IACrB,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,GAAG,EAAE,EAAE;CACP,CAAC;AACF,MAAM,mBAAmB,GAAG;IAC3B,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,IAAI;CACT,CAAC;AAEF,MAAM,gBAAgB,GAAG,kEAAkE,CAAC;AAC5F,IAAI,eAAe,GAAG,+FAA+F,CAAC;AAoBtH;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAyB;IACzE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,0EAA0E;YAC1E,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC;YACtC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,mBAAmB,CAAC;YAClD,uHAAuH;YACvH,qBAAqB,EAAE,KAAK;SAC5B,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IA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CACnB,CACA,CACF,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport storeActions from \"../stores/StoreActions\";\nimport { FinsembleDialogTextInput } from \"../../../legacyControls/FinsembleDialogTextInput\";\nimport { FinsembleDialogButton } from \"../../../legacyControls/FinsembleDialogButton\";\nimport \"../../../../assets/css/dialogs.css\";\nimport { isValidURL } from \"../../../shared/validateURL\";\nimport { addProtocolToValidURL } from \"../../../shared/addProtocolToValidURL\";\n\nconst FORM_DEFAULTS = {\n\tname: \"\",\n\ttags: \"\",\n\turl: \"\",\n};\nconst VALIDATION_DEFAULTS = {\n\tname: true,\n\turl: true,\n};\n\nconst INVALID_NAME_MSG = \"Name cannot be empty or be a duplicate of an existing component.\";\nlet INVALID_URL_MSG = \"URL must be valid (e.g., http://www.google.com). Only http and https protocols are supported.\";\n\ninterface IState {\n\tform: {\n\t\tname?: string;\n\t\turl?: string;\n\t\ttags?: string;\n\t};\n\tvalidation: {\n\t\tname: boolean;\n\t\turl: boolean;\n\t};\n\tvalidateOnInputChange: boolean;\n}\ninterface IProps {\n\tonDone: () => void;\n\tcustomURLValidation: ((url: string) => [boolean, string]) | null;\n\tcustomAddComponent: ((formData: any, callback: (error: any | null) => void) => void) | null;\n\tbeforeAddComponent: ((formData: any) => object) | null;\n}\n/**\n * A component that has a form to accept new app properties\n * like name, url and tags, validates user input then saves it\n * to persistent store. Showing or hiding this component is up to\n * parent component.\n * @example <AddNewAppForm onDone={this.someHandlerFunction}></AddNewAppForm>\n */\nexport default class AddNewAppForm extends React.Component<IProps, IState> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\t// if you do not do this, FORM_DEFAULTS gets mutated by setState later on.\n\t\t\tform: Object.assign({}, FORM_DEFAULTS),\n\t\t\tvalidation: Object.assign({}, VALIDATION_DEFAULTS),\n\t\t\t// changed to true after the user submits (if they submit bad information). This gives updated information on keypress.\n\t\t\tvalidateOnInputChange: false,\n\t\t};\n\n\t\tthis.onSubmit = this.onSubmit.bind(this);\n\t\tthis.onClear = this.onClear.bind(this);\n\t\tthis.onCancel = this.onCancel.bind(this);\n\t\tthis.done = this.done.bind(this);\n\t\tthis.onURLChanged = this.onURLChanged.bind(this);\n\t\tthis.onAppNameChanged = this.onAppNameChanged.bind(this);\n\t\tthis.onKeyDown = this.onKeyDown.bind(this);\n\t\tthis.addNewApp = this.addNewApp.bind(this);\n\t\tthis.addNewAppCallback = this.addNewAppCallback.bind(this);\n\t}\n\n\t/**\n\t * Calls the storeActions.addApp() method\n\t * to save the new app in store.\n\t */\n\tonSubmit() {\n\t\tthis.fixURL();\n\t\tthis.fixName();\n\t\tlet validName = this.validateName(this.state.form.name);\n\t\tlet validURL = this.validateURL(this.state.form.url);\n\t\tif (!validName || !validURL) {\n\t\t\tthis.setState({\n\t\t\t\tvalidation: {\n\t\t\t\t\turl: validURL,\n\t\t\t\t\tname: validName,\n\t\t\t\t},\n\t\t\t\tvalidateOnInputChange: true,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tthis.setState({\n\t\t\tvalidation: Object.assign({}, VALIDATION_DEFAULTS),\n\t\t\tvalidateOnInputChange: false,\n\t\t});\n\n\t\tlet formData = this.state.form;\n\t\tif (this.props.beforeAddComponent) {\n\t\t\tif (typeof this.props.beforeAddComponent !== \"function\") {\n\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\"beforeAddComponent provided to Advanced App Launcher does not appear to be a function, skipping\"\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tformData = this.props.beforeAddComponent(formData);\n\t\t\t}\n\t\t}\n\n\t\tthis.addNewApp(formData, this.addNewAppCallback);\n\t}\n\n\taddNewAppCallback(error: any) {\n\t\t// Notify parent if no errors\n\t\tif (error) {\n\t\t\tFSBL.Clients.Logger.system.error(error);\n\t\t\tthis.setState({\n\t\t\t\tvalidation: {\n\t\t\t\t\tname: false,\n\t\t\t\t\turl: true,\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tthis.done();\n\t\t}\n\t}\n\n\taddNewApp(form: IState[\"form\"], cb: (err?: any) => void) {\n\t\tif (this.props.customAddComponent) {\n\t\t\tif (typeof this.props.customAddComponent === \"function\") {\n\t\t\t\tthis.props.customAddComponent(form, cb);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\"Custom Add Component parameter provided to Advanced App Launcher does not appear to be a function, falling back to default add\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst { name, url, tags } = form;\n\t\tif (name && url) {\n\t\t\tstoreActions.addApp(\n\t\t\t\t{\n\t\t\t\t\tname,\n\t\t\t\t\turl,\n\t\t\t\t\ttags: tags ? tags.split(\",\") : [],\n\t\t\t\t\tappID: name,\n\t\t\t\t\ttype: \"unknown\",\n\t\t\t\t\tcanDelete: true,\n\t\t\t\t},\n\t\t\t\tcb\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Clears all form inputs\n\t */\n\tonClear() {\n\t\t//document.getElementById(\"new-app\").reset();\n\t\tthis.setState({\n\t\t\tform: Object.assign({}, FORM_DEFAULTS),\n\t\t});\n\t}\n\n\t/**\n\t * Just cancel and do not add the app\n\t */\n\tonCancel() {\n\t\tthis.done();\n\t}\n\n\t/**\n\t * Calls the passed onDone property to let the parent component\n\t * know that we finished processing user's request (submit/cancel)\n\t */\n\tdone() {\n\t\tif (this.props.onDone && typeof this.props.onDone === \"function\") {\n\t\t\tthis.props.onDone();\n\t\t}\n\t\tthis.onClear();\n\t}\n\n\t/**\n\t * When the url changes, validate it (after submit), or set state.\n\t * @param {keyboardEvent} e\n\t */\n\tonURLChanged(e: React.ChangeEvent<HTMLInputElement>) {\n\t\tlet { form, validation } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tform.url = e.target.value;\n\t\tif (this.state.validateOnInputChange) {\n\t\t\tvalidation.url = this.validateURL(form.url);\n\t\t}\n\t\tthis.setState({\n\t\t\tform,\n\t\t});\n\t}\n\n\t/**\n\t * When the name changes, validate it (after submit), or set state.\n\t * @param {keyboardEvent} e\n\t */\n\tonAppNameChanged(e: React.ChangeEvent<HTMLInputElement>) {\n\t\tlet { form, validation } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tform.name = e.target.value;\n\t\tif (this.state.validateOnInputChange) {\n\t\t\tvalidation.name = this.validateName(form.name);\n\t\t}\n\t\tthis.setState({\n\t\t\tform,\n\t\t});\n\t}\n\n\t/**\n\t * Attempt to make a URL object, if successful the provided URL is valid.\n\t * If the URL constructor determines the provided string to be invalid it throws a TypeError.\n\t *\n\t * @param {string} url\n\t * @return boolean\n\t */\n\tvalidateURL(url?: string) {\n\t\tif (!url) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.props.customURLValidation) {\n\t\t\tif (typeof this.props.customURLValidation === \"function\") {\n\t\t\t\tconst [result, message] = this.props.customURLValidation(url);\n\t\t\t\tif (typeof result !== \"boolean\") {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\t\"Custom URL Validation routine does not return a boolean, falling back to default validation\"\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tif (message) {\n\t\t\t\t\t\tINVALID_URL_MSG = message;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t\t\"Custom url validation provided to Advanced App Launcher does not appear to be a function, falling back to default validation\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn isValidURL(url);\n\t}\n\n\t/**\n\t * When the url changes, validate it (after submit), or set state.\n\t * @param {string} name\n\t */\n\tvalidateName(name?: string) {\n\t\tif (typeof name !== \"string\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn name !== \"\" || /^[0-9a-zA-Z_.-\\s]+$/.test(name);\n\t}\n\n\t/**\n\t * Allows user to skip the protocol. Puts one in there if they don't have it.\n\t */\n\tfixURL() {\n\t\tlet { form } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tif (typeof form.url === \"string\") {\n\t\t\tform.url = addProtocolToValidURL(form?.url);\n\t\t}\n\t\tthis.setState({ form });\n\t}\n\n\t/**\n\t * Removes empty spaces from beginning and end of line\n\t */\n\tfixName() {\n\t\tlet { form } = this.state;\n\t\tif (!form) {\n\t\t\tform = {};\n\t\t}\n\t\tform.name = form.name?.trim();\n\t\tthis.setState({ form });\n\t}\n\n\t/**\n\t * Hotkey handler\n\t * Escape clears the form and hides it.\n\t * Enter submits.\n\t * @param {} e\n\t */\n\tonKeyDown(e: any) {\n\t\tif (e.detail.key === \"Escape\") {\n\t\t\tthis.onClear();\n\t\t\tthis.done();\n\t\t}\n\t\tif (e.detail.key === \"Enter\") {\n\t\t\tthis.onSubmit();\n\t\t}\n\t}\n\n\t// Listen for esc/enter\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"portal:keydown\", this.onKeyDown);\n\t}\n\n\t// remove listen for esc/enter\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"portal:keydown\", this.onKeyDown);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div className=\"add-app-form controls-wrapper\">\n\t\t\t\t<form id=\"new-app\">\n\t\t\t\t\t<FinsembleDialogTextInput\n\t\t\t\t\t\tinputLabel=\"Name\"\n\t\t\t\t\t\tonInputChange={this.onAppNameChanged}\n\t\t\t\t\t\tplaceholder=\"Name\"\n\t\t\t\t\t\tautoFocus={true}\n\t\t\t\t\t\tvalue={this.state.form.name}\n\t\t\t\t\t/>\n\t\t\t\t\t{!this.state.validation.name && <div className=\"input-error\">{INVALID_NAME_MSG}</div>}\n\t\t\t\t\t<FinsembleDialogTextInput\n\t\t\t\t\t\tinputLabel=\"URL\"\n\t\t\t\t\t\tonInputChange={this.onURLChanged}\n\t\t\t\t\t\tplaceholder=\"URL\"\n\t\t\t\t\t\tvalue={this.state.form.url}\n\t\t\t\t\t/>\n\t\t\t\t\t{!this.state.validation.url && <div className=\"input-error\">{INVALID_URL_MSG}</div>}\n\t\t\t\t\t<div className=\"button-wrapper\">\n\t\t\t\t\t\t<FinsembleDialogButton className=\"fsbl-button-neutral\" onClick={this.onClear}>\n\t\t\t\t\t\t\tClear\n\t\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t\t\t<FinsembleDialogButton className=\"fsbl-button-neutral\" onClick={this.onCancel}>\n\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t\t\t<FinsembleDialogButton className=\"fsbl-button-affirmative\" onClick={this.onSubmit}>\n\t\t\t\t\t\t\tConfirm\n\t\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
@@ -1,4 +1,9 @@
1
1
  import React from "react";
2
+ /**
3
+ * A basic component that calls storeActions.addNewFolder()
4
+ * to create a new folder in store. This component could be upgraded
5
+ * to support inline naming of the new folder
6
+ */
2
7
  export default class AddNewFolder extends React.Component {
3
8
  addNewFolder(): void;
4
9
  render(): JSX.Element;
@@ -1,5 +1,10 @@
1
1
  import React from "react";
2
2
  import storeActions from "../stores/StoreActions";
3
+ /**
4
+ * A basic component that calls storeActions.addNewFolder()
5
+ * to create a new folder in store. This component could be upgraded
6
+ * to support inline naming of the new folder
7
+ */
3
8
  export default class AddNewFolder extends React.Component {
4
9
  addNewFolder() {
5
10
  storeActions.addNewFolder();
@@ -1 +1 @@
1
- {"version":3,"file":"AddNewFolder.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AddNewFolder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAOlD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAS;IACxD,YAAY;QACX,YAAY,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM;QACL,OAAO,CACN,6BAAK,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAC,+BAA+B,iBAEpE,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport storeActions from \"../stores/StoreActions\";\n\n/**\n * A basic component that calls storeActions.addNewFolder()\n * to create a new folder in store. This component could be upgraded\n * to support inline naming of the new folder\n */\nexport default class AddNewFolder extends React.Component {\n\taddNewFolder() {\n\t\tstoreActions.addNewFolder();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div onClick={this.addNewFolder} className=\"ff-plus-2 complex-menu-action\">\n\t\t\t\tNew Folder\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"AddNewFolder.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AddNewFolder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAS;IACxD,YAAY;QACX,YAAY,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM;QACL,OAAO,CACN,6BAAK,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAC,+BAA+B,iBAEpE,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport storeActions from \"../stores/StoreActions\";\n\n/**\n * A basic component that calls storeActions.addNewFolder()\n * to create a new folder in store. This component could be upgraded\n * to support inline naming of the new folder\n */\nexport default class AddNewFolder extends React.Component {\n\taddNewFolder() {\n\t\tstoreActions.addNewFolder();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div onClick={this.addNewFolder} className=\"ff-plus-2 complex-menu-action\">\n\t\t\t\tNew Folder\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
@@ -11,17 +11,44 @@ interface IProps {
11
11
  interface IState {
12
12
  isVisible: boolean;
13
13
  }
14
+ /**
15
+ * Displays a list of actions like 'View info', 'Add to favorite'
16
+ * etc on each app in the list
17
+ */
14
18
  export default class AppActionsMenu extends React.Component<IProps, IState> {
15
19
  menuRef: HTMLDivElement | null;
16
20
  constructor(props: IProps);
17
21
  componentDidMount(): void;
18
22
  componentWillUnmount(): void;
19
23
  toggleMenu(e?: React.MouseEvent<HTMLElement>): void;
24
+ /**
25
+ * Opens app catalog and switches to the page when you see all
26
+ * the details about the app
27
+ */
20
28
  onViewInfo(): void;
29
+ /**
30
+ * Calls the storeActions.removeAppFromFolder to remove
31
+ * an app from the currently selected folder
32
+ */
21
33
  onRemove(): void;
22
34
  setMenuRef(node: HTMLDivElement): void;
35
+ /**
36
+ * This event handler is responsible for closing action menu pop ups when the user clicks outside of the pop up (what we might think of as a blur event).
37
+ * The event is triggered by a document level click handler (via portals). When we receive the event, we determine whether the user was clicking inside
38
+ * or outside of our action menu. If inside the menu then we do nothing (the click event will be captured and handled by react) but if the event occurred
39
+ * outside of the action menu then we set its state to invisible.
40
+ *
41
+ * To determine whether we've clicked inside of the action menu we traverse the parent elements looking for a clue (a parent element that contains the class "actions-menu").
42
+ *
43
+ * Note: this event will fire multiple times for every click - once for each action menu on the page.
44
+ * @param {Event} e
45
+ */
23
46
  handleClickOutside(e: any): void;
24
47
  handleWindowBlurred(): void;
48
+ /**
49
+ * Calls storeActions.deleteApp() to delete an app
50
+ * from all folders and from apps list
51
+ */
25
52
  deleteApp(): void;
26
53
  renderList(): JSX.Element;
27
54
  render(): JSX.Element;
@@ -10,6 +10,10 @@ import { useFavorites } from "../../../../hooks/useFavorites";
10
10
  const ADVANCED_APP_LAUNCHER = "Advanced App Launcher";
11
11
  const FAVORITES = "Favorites";
12
12
  const FDC3 = "FDC3";
13
+ /**
14
+ * Handles deleting a component and removing it from favorites if necessary
15
+ * @param {*} props
16
+ */
13
17
  const DeleteApp = (props) => {
14
18
  const { isFavorited, removeFavorite } = useFavorites();
15
19
  const { name, id } = props;
@@ -21,17 +25,29 @@ const DeleteApp = (props) => {
21
25
  };
22
26
  return React.createElement("li", { onClick: removeFavoriteAndDelete }, "Delete App");
23
27
  };
28
+ /**
29
+ * This method checks an element and all of its parents to determine whether any of them
30
+ * contain a particular class name. We use this to determine whether the user is clicking
31
+ * inside or outside of the actions menu pop up.
32
+ * @param {HTMLElement} element
33
+ * @param {string} className
34
+ */
24
35
  const someParentHasClassName = (element, className) => {
25
36
  if (element.className && element.className.split(" ").indexOf(className) >= 0)
26
37
  return true;
27
38
  return element.parentNode && someParentHasClassName(element.parentNode, className);
28
39
  };
40
+ /**
41
+ * Displays a list of actions like 'View info', 'Add to favorite'
42
+ * etc on each app in the list
43
+ */
29
44
  export default class AppActionsMenu extends React.Component {
30
45
  constructor(props) {
31
46
  super(props);
32
47
  this.state = {
33
48
  isVisible: false,
34
49
  };
50
+ // Bind correct context
35
51
  this.onViewInfo = this.onViewInfo.bind(this);
36
52
  this.toggleMenu = this.toggleMenu.bind(this);
37
53
  this.onRemove = this.onRemove.bind(this);
@@ -43,6 +59,11 @@ export default class AppActionsMenu extends React.Component {
43
59
  }
44
60
  componentDidMount() {
45
61
  document.addEventListener("portal:click", this.handleClickOutside);
62
+ // Mody on 12/12/19
63
+ // window.blur seems to work much better than finsembleWindow's
64
+ // blurred event. The first, is only fired when you actually click
65
+ // away from the window, while finsembleWindow's blurred fires even
66
+ // when you click inside the window, causing possible race conditions.
46
67
  window.addEventListener("blur", this.handleWindowBlurred);
47
68
  }
48
69
  componentWillUnmount() {
@@ -58,6 +79,10 @@ export default class AppActionsMenu extends React.Component {
58
79
  isVisible: !this.state.isVisible,
59
80
  });
60
81
  }
82
+ /**
83
+ * Opens app catalog and switches to the page when you see all
84
+ * the details about the app
85
+ */
61
86
  onViewInfo() {
62
87
  this.toggleMenu();
63
88
  FSBL.Clients.LauncherClient.showWindow({
@@ -69,6 +94,9 @@ export default class AppActionsMenu extends React.Component {
69
94
  left: "center",
70
95
  top: "center",
71
96
  }, () => {
97
+ // Publish this event so that catalog knows
98
+ // what app we want to view
99
+ // NOTE: While not ideal, without a small delay (when having to launch the app catalog) the app catalog wont receive the message as it will still be initializing
72
100
  setTimeout(() => {
73
101
  FSBL.Clients.RouterClient.transmit("viewApp", {
74
102
  app: this.props.app,
@@ -76,6 +104,10 @@ export default class AppActionsMenu extends React.Component {
76
104
  }, 250);
77
105
  });
78
106
  }
107
+ /**
108
+ * Calls the storeActions.removeAppFromFolder to remove
109
+ * an app from the currently selected folder
110
+ */
79
111
  onRemove() {
80
112
  storeActions.removeAppFromFolder(this.props.folder.name, this.props.app);
81
113
  this.toggleMenu();
@@ -83,6 +115,17 @@ export default class AppActionsMenu extends React.Component {
83
115
  setMenuRef(node) {
84
116
  this.menuRef = node;
85
117
  }
118
+ /**
119
+ * This event handler is responsible for closing action menu pop ups when the user clicks outside of the pop up (what we might think of as a blur event).
120
+ * The event is triggered by a document level click handler (via portals). When we receive the event, we determine whether the user was clicking inside
121
+ * or outside of our action menu. If inside the menu then we do nothing (the click event will be captured and handled by react) but if the event occurred
122
+ * outside of the action menu then we set its state to invisible.
123
+ *
124
+ * To determine whether we've clicked inside of the action menu we traverse the parent elements looking for a clue (a parent element that contains the class "actions-menu").
125
+ *
126
+ * Note: this event will fire multiple times for every click - once for each action menu on the page.
127
+ * @param {Event} e
128
+ */
86
129
  handleClickOutside(e) {
87
130
  var _a;
88
131
  const eventTarget = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.target;
@@ -98,11 +141,17 @@ export default class AppActionsMenu extends React.Component {
98
141
  isVisible: false,
99
142
  });
100
143
  }
144
+ /**
145
+ * Calls storeActions.deleteApp() to delete an app
146
+ * from all folders and from apps list
147
+ */
101
148
  deleteApp() {
102
149
  storeActions.deleteApp(this.props.app.appID);
103
150
  }
104
151
  renderList() {
105
152
  var _a;
153
+ // The 'View info' action is only visible on apps
154
+ // that have the source property and with a value of FDC3
106
155
  const apps = storeActions.getAllApps();
107
156
  const app = apps[this.props.app.appID];
108
157
  const { folder } = this.props;
@@ -1 +1 @@
1
- {"version":3,"file":"AppActionsMenu.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AppActionsMenu.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,IAAI,GAAG,MAAM,CAAC;AAWpB,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IACvD,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,uBAAuB,GAAG,GAAG,EAAE;QACpC,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;YACtB,cAAc,CAAC,IAAI,CAAC,CAAC;SACrB;QACD,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC;IACF,OAAO,4BAAI,OAAO,EAAE,uBAAuB,iBAAiB,CAAC;AAC9D,CAAC,CAAC;AASF,MAAM,sBAAsB,GAAG,CAAC,OAAoB,EAAE,SAAiB,EAAO,EAAE;IAC/E,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3F,OAAO,OAAO,CAAC,UAAU,IAAI,sBA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,qBAAqB,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAClE,4BAAI,OAAO,EAAE,IAAI,CAAC,QAAQ;;oBAAe,MAAM,CAAC,IAAI,CAAM,CAC1D,CACG,CACA,CACN,CAAC;IACH,CAAC;IAED,MAAM;QACL,OAAO,CACN,6BAAK,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU;YACnF;gBACC,2BAAG,SAAS,EAAC,cAAc,EAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAI,CAClD;YACN,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CACrC,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2018 by ChartIQ, Inc.\n * All rights reserved.\n *\n */\n\nimport React from \"react\";\nimport storeActions from \"../stores/StoreActions\";\nimport { ToggleFavoriteDropdown } from \"./ToggleFavoriteDropdown\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\n\nconst ADVANCED_APP_LAUNCHER = \"Advanced App Launcher\";\nconst FAVORITES = \"Favorites\";\nconst FDC3 = \"FDC3\";\n\ninterface DeleteAppProps {\n\tname: string;\n\tid: any;\n}\n\n/**\n * Handles deleting a component and removing it from favorites if necessary\n * @param {*} props\n */\nconst DeleteApp = (props: DeleteAppProps) => {\n\tconst { isFavorited, removeFavorite } = useFavorites();\n\tconst { name, id } = props;\n\tconst removeFavoriteAndDelete = () => {\n\t\tif (isFavorited(name)) {\n\t\t\tremoveFavorite(name);\n\t\t}\n\t\tstoreActions.deleteApp(id);\n\t};\n\treturn <li onClick={removeFavoriteAndDelete}>Delete App</li>;\n};\n\n/**\n * This method checks an element and all of its parents to determine whether any of them\n * contain a particular class name. We use this to determine whether the user is clicking\n * inside or outside of the actions menu pop up.\n * @param {HTMLElement} element\n * @param {string} className\n */\nconst someParentHasClassName = (element: HTMLElement, className: string): any => {\n\tif (element.className && element.className.split(\" \").indexOf(className) >= 0) return true;\n\treturn element.parentNode && someParentHasClassName(element.parentNode as HTMLElement, className);\n};\n\ninterface IProps {\n\tapp: any;\n\tfolder: any;\n}\ninterface IState {\n\tisVisible: boolean;\n}\n\n/**\n * Displays a list of actions like 'View info', 'Add to favorite'\n * etc on each app in the list\n */\nexport default class AppActionsMenu extends React.Component<IProps, IState> {\n\tmenuRef: HTMLDivElement | null;\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tisVisible: false,\n\t\t};\n\t\t// Bind correct context\n\t\tthis.onViewInfo = this.onViewInfo.bind(this);\n\t\tthis.toggleMenu = this.toggleMenu.bind(this);\n\t\tthis.onRemove = this.onRemove.bind(this);\n\t\tthis.setMenuRef = this.setMenuRef.bind(this);\n\t\tthis.deleteApp = this.deleteApp.bind(this);\n\t\tthis.handleClickOutside = this.handleClickOutside.bind(this);\n\t\tthis.handleWindowBlurred = this.handleWindowBlurred.bind(this);\n\t\tthis.menuRef = null;\n\t}\n\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"portal:click\", this.handleClickOutside);\n\t\t// Mody on 12/12/19\n\t\t// window.blur seems to work much better than finsembleWindow's\n\t\t// blurred event. The first, is only fired when you actually click\n\t\t// away from the window, while finsembleWindow's blurred fires even\n\t\t// when you click inside the window, causing possible race conditions.\n\t\twindow.addEventListener(\"blur\", this.handleWindowBlurred);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"portal:click\", this.handleClickOutside);\n\t\twindow.removeEventListener(\"blur\", this.handleWindowBlurred);\n\t}\n\n\ttoggleMenu(e?: React.MouseEvent<HTMLElement>) {\n\t\tif (e) {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t}\n\t\tthis.setState({\n\t\t\tisVisible: !this.state.isVisible,\n\t\t});\n\t}\n\n\t/**\n\t * Opens app catalog and switches to the page when you see all\n\t * the details about the app\n\t */\n\tonViewInfo() {\n\t\tthis.toggleMenu();\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"App Catalog\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tstaggerPixels: 0,\n\t\t\t\tspawnIfNotFound: true,\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t},\n\t\t\t() => {\n\t\t\t\t// Publish this event so that catalog knows\n\t\t\t\t// what app we want to view\n\n\t\t\t\t// NOTE: While not ideal, without a small delay (when having to launch the app catalog) the app catalog wont receive the message as it will still be initializing\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"viewApp\", {\n\t\t\t\t\t\tapp: this.props.app,\n\t\t\t\t\t});\n\t\t\t\t}, 250);\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Calls the storeActions.removeAppFromFolder to remove\n\t * an app from the currently selected folder\n\t */\n\tonRemove() {\n\t\tstoreActions.removeAppFromFolder(this.props.folder.name, this.props.app);\n\t\tthis.toggleMenu();\n\t}\n\n\tsetMenuRef(node: HTMLDivElement) {\n\t\tthis.menuRef = node;\n\t}\n\n\t/**\n\t * This event handler is responsible for closing action menu pop ups when the user clicks outside of the pop up (what we might think of as a blur event).\n\t * The event is triggered by a document level click handler (via portals). When we receive the event, we determine whether the user was clicking inside\n\t * or outside of our action menu. If inside the menu then we do nothing (the click event will be captured and handled by react) but if the event occurred\n\t * outside of the action menu then we set its state to invisible.\n\t *\n\t * To determine whether we've clicked inside of the action menu we traverse the parent elements looking for a clue (a parent element that contains the class \"actions-menu\").\n\t *\n\t * Note: this event will fire multiple times for every click - once for each action menu on the page.\n\t * @param {Event} e\n\t */\n\thandleClickOutside(e: any) {\n\t\tconst eventTarget = e?.detail?.target;\n\t\tconst clickedInMyDropdown = someParentHasClassName(eventTarget, \"actions-menu\");\n\n\t\tif (this.state.isVisible && !clickedInMyDropdown) {\n\t\t\tthis.setState({\n\t\t\t\tisVisible: false,\n\t\t\t});\n\t\t}\n\t}\n\n\thandleWindowBlurred() {\n\t\tthis.setState({\n\t\t\tisVisible: false,\n\t\t});\n\t}\n\n\t/**\n\t * Calls storeActions.deleteApp() to delete an app\n\t * from all folders and from apps list\n\t */\n\tdeleteApp() {\n\t\tstoreActions.deleteApp(this.props.app.appID);\n\t}\n\n\trenderList() {\n\t\t// The 'View info' action is only visible on apps\n\t\t// that have the source property and with a value of FDC3\n\t\tconst apps = storeActions.getAllApps();\n\t\tconst app = apps[this.props.app.appID];\n\t\tconst { folder } = this.props;\n\t\treturn (\n\t\t\t<div className=\"actions-menu\" style={{ right: 0 }}>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ToggleFavoriteDropdown\n\t\t\t\t\t\t\tid={app.name}\n\t\t\t\t\t\t\tcategory=\"Application\"\n\t\t\t\t\t\t\tname={app.displayName ?? app.name}\n\t\t\t\t\t\t\ticon={app.icon}\n\t\t\t\t\t\t\tinstance={this}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t{app.source && app.source === FDC3 && <li onClick={this.onViewInfo}>View Info</li>}\n\t\t\t\t\t{!app.source && app.canDelete && <DeleteApp name={app.name} id={this.props.app.appID} />}\n\t\t\t\t\t{[ADVANCED_APP_LAUNCHER, FAVORITES].indexOf(folder.name) === -1 && (\n\t\t\t\t\t\t<li onClick={this.onRemove}>Remove from {folder.name}</li>\n\t\t\t\t\t)}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div ref={this.setMenuRef} className=\"actions-menu-wrapper\" onClick={this.toggleMenu}>\n\t\t\t\t<span>\n\t\t\t\t\t<i className=\"ff-dots-vert\" id={this.props.app.appID} />\n\t\t\t\t</span>\n\t\t\t\t{this.state.isVisible && this.renderList()}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"AppActionsMenu.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AppActionsMenu.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,IAAI,GAAG,MAAM,CAAC;AAOpB;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IACvD,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,uBAAuB,GAAG,GAAG,EAAE;QACpC,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;YACtB,cAAc,CAAC,IAAI,CAAC,CAAC;SACrB;QACD,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC;IACF,OAAO,4BAAI,OAAO,EAAE,uBAAuB,iBAAiB,CAAC;AAC9D,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,CAAC,OAAoB,EAAE,SAAiB,EAAO,EAAE;IAC/E,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3F,OAAO,OAAO,CAAC,UAAU,IAAI,sBAAsB,CAAC,OAAO,CAAC,UAAyB,EAAE,SAAS,CAAC,CA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,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,IAAI,oBAAC,SAAS,IAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAI;gBACvF,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAClE,4BAAI,OAAO,EAAE,IAAI,CAAC,QAAQ;;oBAAe,MAAM,CAAC,IAAI,CAAM,CAC1D,CACG,CACA,CACN,CAAC;IACH,CAAC;IAED,MAAM;QACL,OAAO,CACN,6BAAK,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU;YACnF;gBACC,2BAAG,SAAS,EAAC,cAAc,EAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAI,CAClD;YACN,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CACrC,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2018 by ChartIQ, Inc.\n * All rights reserved.\n *\n */\n\nimport React from \"react\";\nimport storeActions from \"../stores/StoreActions\";\nimport { ToggleFavoriteDropdown } from \"./ToggleFavoriteDropdown\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\n\nconst ADVANCED_APP_LAUNCHER = \"Advanced App Launcher\";\nconst FAVORITES = \"Favorites\";\nconst FDC3 = \"FDC3\";\n\ninterface DeleteAppProps {\n\tname: string;\n\tid: any;\n}\n\n/**\n * Handles deleting a component and removing it from favorites if necessary\n * @param {*} props\n */\nconst DeleteApp = (props: DeleteAppProps) => {\n\tconst { isFavorited, removeFavorite } = useFavorites();\n\tconst { name, id } = props;\n\tconst removeFavoriteAndDelete = () => {\n\t\tif (isFavorited(name)) {\n\t\t\tremoveFavorite(name);\n\t\t}\n\t\tstoreActions.deleteApp(id);\n\t};\n\treturn <li onClick={removeFavoriteAndDelete}>Delete App</li>;\n};\n\n/**\n * This method checks an element and all of its parents to determine whether any of them\n * contain a particular class name. We use this to determine whether the user is clicking\n * inside or outside of the actions menu pop up.\n * @param {HTMLElement} element\n * @param {string} className\n */\nconst someParentHasClassName = (element: HTMLElement, className: string): any => {\n\tif (element.className && element.className.split(\" \").indexOf(className) >= 0) return true;\n\treturn element.parentNode && someParentHasClassName(element.parentNode as HTMLElement, className);\n};\n\ninterface IProps {\n\tapp: any;\n\tfolder: any;\n}\ninterface IState {\n\tisVisible: boolean;\n}\n\n/**\n * Displays a list of actions like 'View info', 'Add to favorite'\n * etc on each app in the list\n */\nexport default class AppActionsMenu extends React.Component<IProps, IState> {\n\tmenuRef: HTMLDivElement | null;\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tisVisible: false,\n\t\t};\n\t\t// Bind correct context\n\t\tthis.onViewInfo = this.onViewInfo.bind(this);\n\t\tthis.toggleMenu = this.toggleMenu.bind(this);\n\t\tthis.onRemove = this.onRemove.bind(this);\n\t\tthis.setMenuRef = this.setMenuRef.bind(this);\n\t\tthis.deleteApp = this.deleteApp.bind(this);\n\t\tthis.handleClickOutside = this.handleClickOutside.bind(this);\n\t\tthis.handleWindowBlurred = this.handleWindowBlurred.bind(this);\n\t\tthis.menuRef = null;\n\t}\n\n\tcomponentDidMount() {\n\t\tdocument.addEventListener(\"portal:click\", this.handleClickOutside);\n\t\t// Mody on 12/12/19\n\t\t// window.blur seems to work much better than finsembleWindow's\n\t\t// blurred event. The first, is only fired when you actually click\n\t\t// away from the window, while finsembleWindow's blurred fires even\n\t\t// when you click inside the window, causing possible race conditions.\n\t\twindow.addEventListener(\"blur\", this.handleWindowBlurred);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tdocument.removeEventListener(\"portal:click\", this.handleClickOutside);\n\t\twindow.removeEventListener(\"blur\", this.handleWindowBlurred);\n\t}\n\n\ttoggleMenu(e?: React.MouseEvent<HTMLElement>) {\n\t\tif (e) {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t}\n\t\tthis.setState({\n\t\t\tisVisible: !this.state.isVisible,\n\t\t});\n\t}\n\n\t/**\n\t * Opens app catalog and switches to the page when you see all\n\t * the details about the app\n\t */\n\tonViewInfo() {\n\t\tthis.toggleMenu();\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"App Catalog\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tstaggerPixels: 0,\n\t\t\t\tspawnIfNotFound: true,\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t},\n\t\t\t() => {\n\t\t\t\t// Publish this event so that catalog knows\n\t\t\t\t// what app we want to view\n\n\t\t\t\t// NOTE: While not ideal, without a small delay (when having to launch the app catalog) the app catalog wont receive the message as it will still be initializing\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"viewApp\", {\n\t\t\t\t\t\tapp: this.props.app,\n\t\t\t\t\t});\n\t\t\t\t}, 250);\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Calls the storeActions.removeAppFromFolder to remove\n\t * an app from the currently selected folder\n\t */\n\tonRemove() {\n\t\tstoreActions.removeAppFromFolder(this.props.folder.name, this.props.app);\n\t\tthis.toggleMenu();\n\t}\n\n\tsetMenuRef(node: HTMLDivElement) {\n\t\tthis.menuRef = node;\n\t}\n\n\t/**\n\t * This event handler is responsible for closing action menu pop ups when the user clicks outside of the pop up (what we might think of as a blur event).\n\t * The event is triggered by a document level click handler (via portals). When we receive the event, we determine whether the user was clicking inside\n\t * or outside of our action menu. If inside the menu then we do nothing (the click event will be captured and handled by react) but if the event occurred\n\t * outside of the action menu then we set its state to invisible.\n\t *\n\t * To determine whether we've clicked inside of the action menu we traverse the parent elements looking for a clue (a parent element that contains the class \"actions-menu\").\n\t *\n\t * Note: this event will fire multiple times for every click - once for each action menu on the page.\n\t * @param {Event} e\n\t */\n\thandleClickOutside(e: any) {\n\t\tconst eventTarget = e?.detail?.target;\n\t\tconst clickedInMyDropdown = someParentHasClassName(eventTarget, \"actions-menu\");\n\n\t\tif (this.state.isVisible && !clickedInMyDropdown) {\n\t\t\tthis.setState({\n\t\t\t\tisVisible: false,\n\t\t\t});\n\t\t}\n\t}\n\n\thandleWindowBlurred() {\n\t\tthis.setState({\n\t\t\tisVisible: false,\n\t\t});\n\t}\n\n\t/**\n\t * Calls storeActions.deleteApp() to delete an app\n\t * from all folders and from apps list\n\t */\n\tdeleteApp() {\n\t\tstoreActions.deleteApp(this.props.app.appID);\n\t}\n\n\trenderList() {\n\t\t// The 'View info' action is only visible on apps\n\t\t// that have the source property and with a value of FDC3\n\t\tconst apps = storeActions.getAllApps();\n\t\tconst app = apps[this.props.app.appID];\n\t\tconst { folder } = this.props;\n\t\treturn (\n\t\t\t<div className=\"actions-menu\" style={{ right: 0 }}>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ToggleFavoriteDropdown\n\t\t\t\t\t\t\tid={app.name}\n\t\t\t\t\t\t\tcategory=\"Application\"\n\t\t\t\t\t\t\tname={app.displayName ?? app.name}\n\t\t\t\t\t\t\ticon={app.icon}\n\t\t\t\t\t\t\tinstance={this}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t{app.source && app.source === FDC3 && <li onClick={this.onViewInfo}>View Info</li>}\n\t\t\t\t\t{!app.source && app.canDelete && <DeleteApp name={app.name} id={this.props.app.appID} />}\n\t\t\t\t\t{[ADVANCED_APP_LAUNCHER, FAVORITES].indexOf(folder.name) === -1 && (\n\t\t\t\t\t\t<li onClick={this.onRemove}>Remove from {folder.name}</li>\n\t\t\t\t\t)}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div ref={this.setMenuRef} className=\"actions-menu-wrapper\" onClick={this.toggleMenu}>\n\t\t\t\t<span>\n\t\t\t\t\t<i className=\"ff-dots-vert\" id={this.props.app.appID} />\n\t\t\t\t</span>\n\t\t\t\t{this.state.isVisible && this.renderList()}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
@@ -12,9 +12,22 @@ interface IProps {
12
12
  }
13
13
  interface IState {
14
14
  }
15
+ /**
16
+ * Used to make sure that a user is not waiting for component
17
+ * to spawn after a double click, helps us prevent multiple
18
+ * spawns for the same app.
19
+ */
15
20
  export default class AppDefinition extends React.Component<IProps, IState> {
16
21
  constructor(props: IProps);
22
+ /**
23
+ * Native HTML5 drag and drop
24
+ **/
17
25
  onDragToFolder(event: React.DragEvent): void;
26
+ /**
27
+ * Spawns a component on click
28
+ * @param {object} e The Synthetic React event
29
+ *
30
+ */
18
31
  onItemClick(): void;
19
32
  render(): JSX.Element;
20
33
  }
@@ -4,21 +4,35 @@ import AppTagsList from "./AppTagsList";
4
4
  import { FavoriteMaker } from "../../../favorites/FavoriteMaker";
5
5
  import { getStore } from "../stores/LauncherStore";
6
6
  import storeActions from "../stores/StoreActions";
7
+ /**
8
+ * Used to make sure that a user is not waiting for component
9
+ * to spawn after a double click, helps us prevent multiple
10
+ * spawns for the same app.
11
+ */
7
12
  export default class AppDefinition extends React.Component {
8
13
  constructor(props) {
9
14
  super(props);
10
15
  this.onDragToFolder = this.onDragToFolder.bind(this);
11
16
  this.onItemClick = this.onItemClick.bind(this);
12
17
  }
18
+ /**
19
+ * Native HTML5 drag and drop
20
+ **/
13
21
  onDragToFolder(event) {
14
22
  event.dataTransfer.setData("app", JSON.stringify(this.props.app));
15
23
  }
24
+ /**
25
+ * Spawns a component on click
26
+ * @param {object} e The Synthetic React event
27
+ *
28
+ */
16
29
  onItemClick() {
17
30
  var _a;
18
31
  const name = this.props.app.title || this.props.app.name;
19
32
  FSBL.Clients.LauncherClient.spawn(name.trim(), {
20
33
  addToWorkspace: true,
21
34
  });
35
+ // Clear search text so it doesn't persist after app is opened
22
36
  if (storeActions.getSearchText()) {
23
37
  (_a = getStore()) === null || _a === void 0 ? void 0 : _a.setValue({
24
38
  field: "filterText",
@@ -1 +1 @@
1
- {"version":3,"file":"AppDefinition.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AppDefinition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAsBlD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAyB;IACzE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAKD,cAAc,CAAC,KAAsB;QACpC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,CAAC;IAOD,WAAW;;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;YAC9C,cAAc,EAAE,IAAI;SACpB,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,aAAa,EAAE,EAAE;YACjC,MAAA,QAAQ,EAAE,0CAAE,QAAQ,CAAC;gBACpB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;SACH;IACF,CAAC;IAED,MAAM;QACL,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC;QACpC,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC;QAChD,MAAM,IAAI,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,KAAI,EAAE,CAAC;QAC7B,OAAO,CACN,6BAAK,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAC,eAAe,EAAC,SAAS,EAAC,MAAM,EAAC,WAAW,EAAE,IAAI,CAAC,cAAc;YAC1G,8BAAM,SAAS,EAAC,gBAAgB;gBAC/B,oBAAC,aAAa,IAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAC,aAAa,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,GAAI;gBACtF,8BAAM,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,IAC3C,WAAW,CACN,CACD;YACN,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,oBAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI;YAC/C,oBAAC,cAAc,IAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAI,CAClD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport AppActionsMenu from \"./AppActionsMenu\";\nimport AppTagsList from \"./AppTagsList\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { getStore } from \"../stores/LauncherStore\";\nimport storeActions from \"../stores/StoreActions\";\nimport { FolderAppType, FolderType } from \"../../../../types/advancedAppLauncherTypes\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype IconDescriptor = services.window.types.IconDescriptor;\n\ntype App = FolderAppType & {\n\ttitle?: string;\n\ticon?: IconDescriptor;\n};\ninterface IProps {\n\tfolder: FolderType;\n\tapp: App;\n}\n\ninterface IState {}\n\n/**\n * Used to make sure that a user is not waiting for component\n * to spawn after a double click, helps us prevent multiple\n * spawns for the same app.\n */\nexport default class AppDefinition extends React.Component<IProps, IState> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.onDragToFolder = this.onDragToFolder.bind(this);\n\t\tthis.onItemClick = this.onItemClick.bind(this);\n\t}\n\n\t/**\n\t * Native HTML5 drag and drop\n\t **/\n\tonDragToFolder(event: React.DragEvent) {\n\t\tevent.dataTransfer.setData(\"app\", JSON.stringify(this.props.app));\n\t}\n\n\t/**\n\t * Spawns a component on click\n\t * @param {object} e The Synthetic React event\n\t *\n\t */\n\tonItemClick() {\n\t\tconst name = this.props.app.title || this.props.app.name;\n\t\tFSBL.Clients.LauncherClient.spawn(name.trim(), {\n\t\t\taddToWorkspace: true,\n\t\t});\n\t\t// Clear search text so it doesn't persist after app is opened\n\t\tif (storeActions.getSearchText()) {\n\t\t\tgetStore()?.setValue({\n\t\t\t\tfield: \"filterText\",\n\t\t\t\tvalue: null,\n\t\t\t});\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { app } = this.props;\n\t\tconst appId = app.title || app.name;\n\t\tconst displayName = app.displayName || app.name;\n\t\tconst tags = app?.tags || [];\n\t\treturn (\n\t\t\t<div onClick={this.onItemClick} className=\"app-item link\" draggable=\"true\" onDragStart={this.onDragToFolder}>\n\t\t\t\t<span className=\"app-item-title\">\n\t\t\t\t\t<FavoriteMaker id={appId} category=\"Application\" name={displayName} icon={app.icon} />\n\t\t\t\t\t<span className=\"app-name\" title={displayName}>\n\t\t\t\t\t\t{displayName}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t{tags.length > 0 && <AppTagsList tags={tags} />}\n\t\t\t\t<AppActionsMenu app={app} folder={this.props.folder} />\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"AppDefinition.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/components/AppDefinition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAiBlD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAyB;IACzE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;QAEI;IACJ,cAAc,CAAC,KAAsB;QACpC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,WAAW;;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;YAC9C,cAAc,EAAE,IAAI;SACpB,CAAC,CAAC;QACH,8DAA8D;QAC9D,IAAI,YAAY,CAAC,aAAa,EAAE,EAAE;YACjC,MAAA,QAAQ,EAAE,0CAAE,QAAQ,CAAC;gBACpB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;SACH;IACF,CAAC;IAED,MAAM;QACL,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC;QACpC,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC;QAChD,MAAM,IAAI,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,KAAI,EAAE,CAAC;QAC7B,OAAO,CACN,6BAAK,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,EAAC,eAAe,EAAC,SAAS,EAAC,MAAM,EAAC,WAAW,EAAE,IAAI,CAAC,cAAc;YAC1G,8BAAM,SAAS,EAAC,gBAAgB;gBAC/B,oBAAC,aAAa,IAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAC,aAAa,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,GAAI;gBACtF,8BAAM,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,IAC3C,WAAW,CACN,CACD;YACN,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,oBAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI;YAC/C,oBAAC,cAAc,IAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAI,CAClD,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["import React from \"react\";\nimport AppActionsMenu from \"./AppActionsMenu\";\nimport AppTagsList from \"./AppTagsList\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { getStore } from \"../stores/LauncherStore\";\nimport storeActions from \"../stores/StoreActions\";\nimport { FolderAppType, FolderType } from \"../../../../types/advancedAppLauncherTypes\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype IconDescriptor = services.window.types.IconDescriptor;\n\ntype App = FolderAppType & {\n\ttitle?: string;\n\ticon?: IconDescriptor;\n};\ninterface IProps {\n\tfolder: FolderType;\n\tapp: App;\n}\n\ninterface IState {}\n\n/**\n * Used to make sure that a user is not waiting for component\n * to spawn after a double click, helps us prevent multiple\n * spawns for the same app.\n */\nexport default class AppDefinition extends React.Component<IProps, IState> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.onDragToFolder = this.onDragToFolder.bind(this);\n\t\tthis.onItemClick = this.onItemClick.bind(this);\n\t}\n\n\t/**\n\t * Native HTML5 drag and drop\n\t **/\n\tonDragToFolder(event: React.DragEvent) {\n\t\tevent.dataTransfer.setData(\"app\", JSON.stringify(this.props.app));\n\t}\n\n\t/**\n\t * Spawns a component on click\n\t * @param {object} e The Synthetic React event\n\t *\n\t */\n\tonItemClick() {\n\t\tconst name = this.props.app.title || this.props.app.name;\n\t\tFSBL.Clients.LauncherClient.spawn(name.trim(), {\n\t\t\taddToWorkspace: true,\n\t\t});\n\t\t// Clear search text so it doesn't persist after app is opened\n\t\tif (storeActions.getSearchText()) {\n\t\t\tgetStore()?.setValue({\n\t\t\t\tfield: \"filterText\",\n\t\t\t\tvalue: null,\n\t\t\t});\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { app } = this.props;\n\t\tconst appId = app.title || app.name;\n\t\tconst displayName = app.displayName || app.name;\n\t\tconst tags = app?.tags || [];\n\t\treturn (\n\t\t\t<div onClick={this.onItemClick} className=\"app-item link\" draggable=\"true\" onDragStart={this.onDragToFolder}>\n\t\t\t\t<span className=\"app-item-title\">\n\t\t\t\t\t<FavoriteMaker id={appId} category=\"Application\" name={displayName} icon={app.icon} />\n\t\t\t\t\t<span className=\"app-name\" title={displayName}>\n\t\t\t\t\t\t{displayName}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t{tags.length > 0 && <AppTagsList tags={tags} />}\n\t\t\t\t<AppActionsMenu app={app} folder={this.props.folder} />\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
@@ -21,6 +21,11 @@ export default class Content extends React.Component<IProps, IState> {
21
21
  onSearch(error: StandardError, data: any): void;
22
22
  onSort(error: StandardError, data: any): void;
23
23
  onTagsUpdate(error: StandardError, data: any): void;
24
+ /**
25
+ * Mainly used to know when a user remove an app from a folder
26
+ * Because there is no way to subscribe to
27
+ * folders[index].appDefinitions updates.
28
+ */
24
29
  onAppListUpdate(): void;
25
30
  onAppLauncherUpdate(): void;
26
31
  updateAppDefinitions(err: StandardError, response: any): void;