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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/package.json +31 -42
  2. package/react/actions/smartDesktopDesignerActions.d.ts +6 -4
  3. package/react/actions/smartDesktopDesignerActions.js +2 -1
  4. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  5. package/react/assets/css/userPreferences.css +0 -30
  6. package/react/assets/css/windowTitleBar.css +6 -5
  7. package/react/assets/icons/always-on-top.svg +20 -0
  8. package/react/assets/icons/caret.svg +7 -0
  9. package/react/assets/icons/close.svg +11 -0
  10. package/react/assets/icons/code-block.svg +15 -0
  11. package/react/assets/icons/documentation.svg +20 -0
  12. package/react/assets/icons/linker.svg +18 -0
  13. package/react/assets/icons/maximize.svg +16 -0
  14. package/react/assets/icons/minimize.svg +15 -0
  15. package/react/assets/icons/toolbar.svg +12 -0
  16. package/react/assets/img/finsemble-display.png +0 -0
  17. package/react/componentTemplateGenerator.js +1 -1
  18. package/react/componentTemplateGenerator.js.map +1 -1
  19. package/react/components/FinsembleProvider.js.map +1 -1
  20. package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
  21. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  22. package/react/components/appCatalog/stores/appStore.d.ts +2 -2
  23. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  24. package/react/components/common/Accordion.d.ts +11 -0
  25. package/react/components/common/Accordion.js +20 -0
  26. package/react/components/common/Accordion.js.map +1 -0
  27. package/react/components/common/Checkbox.d.ts +1 -0
  28. package/react/components/common/Checkbox.js +4 -2
  29. package/react/components/common/Checkbox.js.map +1 -1
  30. package/react/components/common/DropZone.js +3 -1
  31. package/react/components/common/DropZone.js.map +1 -1
  32. package/react/components/common/FileInput.d.ts +2 -1
  33. package/react/components/common/FileInput.js +9 -4
  34. package/react/components/common/FileInput.js.map +1 -1
  35. package/react/components/common/FinsembleIcon.d.ts +1 -1
  36. package/react/components/common/FinsembleIcon.js +18 -0
  37. package/react/components/common/FinsembleIcon.js.map +1 -1
  38. package/react/components/common/FinsembleSelect.js +1 -1
  39. package/react/components/common/FinsembleSelect.js.map +1 -1
  40. package/react/components/common/Header.js +1 -1
  41. package/react/components/common/Header.js.map +1 -1
  42. package/react/components/common/InputTable.d.ts +11 -0
  43. package/react/components/common/InputTable.js +50 -0
  44. package/react/components/common/InputTable.js.map +1 -0
  45. package/react/components/common/Tooltip.js +3 -1
  46. package/react/components/common/Tooltip.js.map +1 -1
  47. package/react/components/common/css/accordion.css +99 -0
  48. package/react/components/common/css/application-edit-page.css +209 -2
  49. package/react/components/common/css/application-list.css +6 -0
  50. package/react/components/common/css/button.css +9 -7
  51. package/react/components/common/css/checkbox.css +30 -0
  52. package/react/components/common/css/file-input.css +16 -0
  53. package/react/components/common/css/header.css +1 -14
  54. package/react/components/common/css/preload-edit-page.css +37 -0
  55. package/react/components/common/css/styles.css +0 -1
  56. package/react/components/common/css/tab.css +1 -1
  57. package/react/components/common/stories/Accordion.stories.d.ts +14 -0
  58. package/react/components/common/stories/Accordion.stories.js +42 -0
  59. package/react/components/common/stories/Accordion.stories.js.map +1 -0
  60. package/react/components/common/stories/DropdownButton.stories.d.ts +11 -0
  61. package/react/components/common/stories/DropdownButton.stories.js +12 -0
  62. package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
  63. package/react/components/common/stories/FileInput.stories.d.ts +2 -1
  64. package/react/components/common/stories/FileInput.stories.js +6 -0
  65. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  66. package/react/components/common/stories/FinsembleIcon.stories.js +1 -0
  67. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  68. package/react/components/common/stories/InputTable.stories.d.ts +12 -0
  69. package/react/components/common/stories/InputTable.stories.js +35 -0
  70. package/react/components/common/stories/InputTable.stories.js.map +1 -0
  71. package/react/components/{smartDesktopDesigner/tests/ApplicationEdit.spec.d.ts → common/tests/Accordion.spec.d.ts} +0 -0
  72. package/react/components/common/tests/Accordion.spec.js +53 -0
  73. package/react/components/common/tests/Accordion.spec.js.map +1 -0
  74. package/react/components/common/tests/Checkbox.spec.js +5 -3
  75. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  76. package/react/components/common/tests/FileInput.spec.js +20 -5
  77. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  78. package/react/components/common/tests/Header.spec.js +6 -2
  79. package/react/components/common/tests/Header.spec.js.map +1 -1
  80. package/react/components/{smartDesktopDesigner/tests/ApplicationList.spec.d.ts → common/tests/InputTable.spec.d.ts} +0 -0
  81. package/react/components/common/tests/InputTable.spec.js +166 -0
  82. package/react/components/common/tests/InputTable.spec.js.map +1 -0
  83. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  84. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  85. package/react/components/fdc3Resolver/ResolverDialog.js +1 -1
  86. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  87. package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -1
  88. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  89. package/react/components/fdc3Resolver/ResolverDialog.stories.js +13 -0
  90. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  91. package/react/components/legacyControls/FinsembleDialogButton.js +1 -1
  92. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  93. package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
  94. package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
  95. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  96. package/react/components/linker/remoteRedux.d.ts +1 -1
  97. package/react/components/linker/remoteRedux.js.map +1 -1
  98. package/react/components/menu/Menu.d.ts +1 -0
  99. package/react/components/menu/Menu.js.map +1 -1
  100. package/react/components/menu/MenuAutoResizer.d.ts +2 -1
  101. package/react/components/menu/MenuAutoResizer.js +4 -3
  102. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  103. package/react/components/menu/MenuPortal.js +118 -92
  104. package/react/components/menu/MenuPortal.js.map +1 -1
  105. package/react/components/menu/MenuShell.d.ts +1 -0
  106. package/react/components/menu/MenuShell.js +3 -2
  107. package/react/components/menu/MenuShell.js.map +1 -1
  108. package/react/components/menu/menuContext.d.ts +1 -0
  109. package/react/components/menu/menuContext.js.map +1 -1
  110. package/react/components/menu/menuHelpers.d.ts +1 -1
  111. package/react/components/menu/menuHelpers.js +2 -2
  112. package/react/components/menu/menuHelpers.js.map +1 -1
  113. package/react/components/notifications/components/drawer/DrawerControls.js +30 -6
  114. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  115. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +2 -0
  116. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  117. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +20 -27
  118. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  119. package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
  120. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  121. package/react/components/notifications/components/shared/IconButton.js +5 -1
  122. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  123. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
  124. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  125. package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
  126. package/react/components/notifications/components/shared/OverflowMenu.js +5 -1
  127. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  128. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
  129. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  130. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
  131. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  132. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
  133. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  134. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
  135. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  136. package/react/components/notifications/components/views/CardView.js.map +1 -1
  137. package/react/components/notifications/components/views/ListView.d.ts +1 -1
  138. package/react/components/notifications/components/views/ListView.js.map +1 -1
  139. package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
  140. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  141. package/react/components/notifications/types.d.ts +1 -1
  142. package/react/components/notifications/types.js.map +1 -1
  143. package/react/components/notifications/utils.d.ts +1 -1
  144. package/react/components/notifications/utils.js.map +1 -1
  145. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  146. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  147. package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
  148. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  149. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
  150. package/react/components/processMonitor/stores/ProcessMonitorStore.js +49 -49
  151. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  152. package/react/components/search/SearchResult.js +4 -3
  153. package/react/components/search/SearchResult.js.map +1 -1
  154. package/react/components/shared/DefaultDropdownButton.js +1 -1
  155. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  156. package/react/components/smartDesktopDesigner/AddApp.d.ts +14 -0
  157. package/react/components/smartDesktopDesigner/AddApp.js +60 -0
  158. package/react/components/smartDesktopDesigner/AddApp.js.map +1 -0
  159. package/react/components/smartDesktopDesigner/AppEditAccess.js +16 -32
  160. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  161. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +6 -19
  162. package/react/components/smartDesktopDesigner/AppEditPage.js +552 -59
  163. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  164. package/react/components/smartDesktopDesigner/Appearance.css +8 -67
  165. package/react/components/smartDesktopDesigner/Appearance.js +1 -1
  166. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  167. package/react/components/smartDesktopDesigner/Application.d.ts +11 -3
  168. package/react/components/smartDesktopDesigner/Application.js +155 -104
  169. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  170. package/react/components/smartDesktopDesigner/Applications.d.ts +2 -3
  171. package/react/components/smartDesktopDesigner/Applications.js +67 -107
  172. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  173. package/react/components/smartDesktopDesigner/Authentication.js +2 -9
  174. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  175. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js +8 -1
  176. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  177. package/react/components/smartDesktopDesigner/ContentHeader.d.ts +5 -0
  178. package/react/components/smartDesktopDesigner/ContentHeader.js +10 -0
  179. package/react/components/smartDesktopDesigner/ContentHeader.js.map +1 -0
  180. package/react/components/smartDesktopDesigner/CurrentView.js +2 -1
  181. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  182. package/react/components/smartDesktopDesigner/EditPreload.d.ts +14 -0
  183. package/react/components/smartDesktopDesigner/EditPreload.js +169 -0
  184. package/react/components/smartDesktopDesigner/EditPreload.js.map +1 -0
  185. package/react/components/smartDesktopDesigner/Export.d.ts +1 -0
  186. package/react/components/smartDesktopDesigner/Export.js +40 -9
  187. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  188. package/react/components/smartDesktopDesigner/ExportCloud.d.ts +3 -1
  189. package/react/components/smartDesktopDesigner/ExportCloud.js +4 -6
  190. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  191. package/react/components/smartDesktopDesigner/ExportZip.d.ts +3 -1
  192. package/react/components/smartDesktopDesigner/ExportZip.js +8 -3
  193. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  194. package/react/components/smartDesktopDesigner/GettingStarted.d.ts +1 -0
  195. package/react/components/smartDesktopDesigner/GettingStarted.js +11 -25
  196. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  197. package/react/components/smartDesktopDesigner/ItemList.d.ts +17 -0
  198. package/react/components/smartDesktopDesigner/ItemList.js +58 -0
  199. package/react/components/smartDesktopDesigner/ItemList.js.map +1 -0
  200. package/react/components/smartDesktopDesigner/Navigation.d.ts +2 -2
  201. package/react/components/smartDesktopDesigner/Navigation.js +17 -15
  202. package/react/components/smartDesktopDesigner/Navigation.js.map +1 -1
  203. package/react/components/smartDesktopDesigner/OptionalSettingsView.d.ts +11 -0
  204. package/react/components/smartDesktopDesigner/OptionalSettingsView.js +71 -0
  205. package/react/components/smartDesktopDesigner/OptionalSettingsView.js.map +1 -0
  206. package/react/components/smartDesktopDesigner/Preloads.d.ts +8 -0
  207. package/react/components/smartDesktopDesigner/Preloads.js +26 -0
  208. package/react/components/smartDesktopDesigner/Preloads.js.map +1 -0
  209. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  210. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +3 -3
  211. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +11 -17
  212. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  213. package/react/components/smartDesktopDesigner/ThemePage.css +0 -1
  214. package/react/components/smartDesktopDesigner/ThemePage.js +0 -7
  215. package/react/components/smartDesktopDesigner/ThemePage.js.map +1 -1
  216. package/react/components/smartDesktopDesigner/Themes.js +0 -2
  217. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  218. package/react/components/smartDesktopDesigner/Toolbar.d.ts +15 -0
  219. package/react/components/smartDesktopDesigner/Toolbar.js +123 -0
  220. package/react/components/smartDesktopDesigner/Toolbar.js.map +1 -0
  221. package/react/components/smartDesktopDesigner/View.js +1 -1
  222. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  223. package/react/components/smartDesktopDesigner/common/fsbl_functions.d.ts +1 -1
  224. package/react/components/smartDesktopDesigner/common/fsbl_functions.js +2 -2
  225. package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +1 -1
  226. package/react/components/smartDesktopDesigner/common/views.d.ts +2 -36
  227. package/react/components/smartDesktopDesigner/common/views.js +168 -111
  228. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  229. package/react/components/smartDesktopDesigner/css/appearance.css +20 -9
  230. package/react/components/smartDesktopDesigner/css/applications.css +40 -0
  231. package/react/components/smartDesktopDesigner/css/authentication.css +5 -11
  232. package/react/components/smartDesktopDesigner/css/export.css +32 -19
  233. package/react/components/smartDesktopDesigner/css/getting-started.css +22 -0
  234. package/react/components/smartDesktopDesigner/css/nav.css +38 -11
  235. package/react/components/smartDesktopDesigner/css/project-header.css +19 -16
  236. package/react/components/smartDesktopDesigner/css/styles.css +2 -3
  237. package/react/components/smartDesktopDesigner/css/views.css +11 -4
  238. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +3 -1
  239. package/react/components/smartDesktopDesigner/fixtures/apps.js +63 -6
  240. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  241. package/react/components/smartDesktopDesigner/fixtures/exportProps.js +3 -0
  242. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  243. package/react/components/smartDesktopDesigner/fixtures/preloads.d.ts +22 -0
  244. package/react/components/smartDesktopDesigner/fixtures/preloads.js +40 -0
  245. package/react/components/smartDesktopDesigner/fixtures/preloads.js.map +1 -0
  246. package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +1 -1
  247. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  248. package/react/components/smartDesktopDesigner/fixtures/views.d.ts +2 -2
  249. package/react/components/smartDesktopDesigner/fixtures/views.js +67 -26
  250. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  251. package/react/components/smartDesktopDesigner/sdd_helpers.d.ts +1 -1
  252. package/react/components/smartDesktopDesigner/sdd_helpers.js +4 -3
  253. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  254. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +3 -1
  255. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +13 -33
  256. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  257. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.d.ts +10 -0
  258. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js +13 -0
  259. package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js.map +1 -0
  260. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.d.ts +11 -0
  261. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js +35 -0
  262. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js.map +1 -0
  263. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.d.ts +1 -1
  264. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js +1 -1
  265. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  266. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.d.ts +1 -1
  267. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js +1 -1
  268. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  269. package/react/components/smartDesktopDesigner/stories/ItemList.stories.d.ts +16 -0
  270. package/react/components/smartDesktopDesigner/stories/{ApplicationList.stories.js → ItemList.stories.js} +30 -23
  271. package/react/components/smartDesktopDesigner/stories/ItemList.stories.js.map +1 -0
  272. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.d.ts +11 -0
  273. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js +28 -0
  274. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js.map +1 -0
  275. package/react/components/smartDesktopDesigner/stories/Preloads.stories.d.ts +11 -0
  276. package/react/components/smartDesktopDesigner/stories/Preloads.stories.js +31 -0
  277. package/react/components/smartDesktopDesigner/stories/Preloads.stories.js.map +1 -0
  278. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js +7 -1
  279. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  280. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.d.ts +14 -0
  281. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js +38 -0
  282. package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js.map +1 -0
  283. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1100 -308
  284. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  285. package/react/components/smartDesktopDesigner/tests/{ApplicationSetup.spec.d.ts → Application.spec.d.ts} +0 -0
  286. package/react/components/smartDesktopDesigner/tests/Application.spec.js +1496 -0
  287. package/react/components/smartDesktopDesigner/tests/Application.spec.js.map +1 -0
  288. package/react/components/smartDesktopDesigner/tests/Applications.spec.d.ts +1 -1
  289. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +62 -561
  290. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  291. package/react/components/smartDesktopDesigner/tests/{ProjectHeader.spec.d.ts → ContentHeader.spec.d.ts} +0 -0
  292. package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js +31 -0
  293. package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js.map +1 -0
  294. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.d.ts +1 -0
  295. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js +61 -0
  296. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js.map +1 -0
  297. package/react/components/smartDesktopDesigner/tests/Export.spec.js +129 -0
  298. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  299. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js +7 -0
  300. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  301. package/react/components/smartDesktopDesigner/tests/ItemList.spec.d.ts +1 -0
  302. package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.js → ItemList.spec.js} +8 -8
  303. package/react/components/smartDesktopDesigner/tests/ItemList.spec.js.map +1 -0
  304. package/react/components/smartDesktopDesigner/tests/Preloads.spec.d.ts +1 -0
  305. package/react/components/smartDesktopDesigner/tests/Preloads.spec.js +47 -0
  306. package/react/components/smartDesktopDesigner/tests/Preloads.spec.js.map +1 -0
  307. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js +3 -14
  308. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  309. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +7 -30
  310. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  311. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.d.ts +1 -0
  312. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js +203 -0
  313. package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js.map +1 -0
  314. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.d.ts +1 -0
  315. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js +18 -0
  316. package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js.map +1 -0
  317. package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
  318. package/react/components/toolbar/DragHandle.spec.js +31 -0
  319. package/react/components/toolbar/DragHandle.spec.js.map +1 -0
  320. package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
  321. package/react/components/toolbar/DragHandle.stories.js +39 -0
  322. package/react/components/toolbar/DragHandle.stories.js.map +1 -0
  323. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
  324. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  325. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
  326. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  327. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  328. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
  329. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +47 -45
  330. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  331. package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
  332. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  333. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
  334. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  335. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  336. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  337. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +1 -0
  338. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  339. package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
  340. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  341. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +3 -2
  342. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +17 -34
  343. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  344. package/react/components/toolbar/dashbar/Dashbar.js +12 -13
  345. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  346. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
  347. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  348. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
  349. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  350. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
  351. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  352. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
  353. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
  354. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  355. package/react/components/userPreferences/components/content/Workspaces.d.ts +1 -1
  356. package/react/components/userPreferences/components/content/Workspaces.js +1 -1
  357. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  358. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  359. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  360. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +1 -1
  361. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  362. package/react/components/userPreferences/tests/ScheduledRestart.spec.js +1 -1
  363. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  364. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +4 -2
  365. package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -52
  366. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  367. package/react/components/windowTitleBar/components/center/Tab.d.ts +0 -1
  368. package/react/components/windowTitleBar/components/center/Tab.js +2 -2
  369. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  370. package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -3
  371. package/react/components/windowTitleBar/components/center/TabList.js +19 -79
  372. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  373. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  374. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  375. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +7 -0
  376. package/react/components/windowTitleBar/components/right/MaximizeButton.js +11 -1
  377. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  378. package/react/components/windowTitleBar/components/windowTitle.d.ts +9 -5
  379. package/react/components/windowTitleBar/components/windowTitle.js +154 -42
  380. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  381. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
  382. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +214 -214
  383. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  384. package/react/enzymeSetup.js +1 -1
  385. package/react/enzymeSetup.js.map +1 -1
  386. package/react/hooks/useDashbar.d.ts +8 -0
  387. package/react/hooks/useDashbar.js +104 -0
  388. package/react/hooks/useDashbar.js.map +1 -0
  389. package/react/hooks/useFavoritesShell.js.map +1 -1
  390. package/react/hooks/useNotifications.d.ts +1 -1
  391. package/react/hooks/useNotifications.js.map +1 -1
  392. package/react/hooks/useToolbar.d.ts +0 -6
  393. package/react/hooks/useToolbar.js +0 -101
  394. package/react/hooks/useToolbar.js.map +1 -1
  395. package/react/reducers/rootReducer.d.ts +11 -7
  396. package/react/reducers/smartDesktopDesignerReducer.js +8 -3
  397. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  398. package/react/store.d.ts +22 -14
  399. package/react/types/fdc3.d.ts +7 -35
  400. package/react/types/fdc3.js.map +1 -1
  401. package/react/types/searchTypes.d.ts +1 -8
  402. package/react/types/searchTypes.js.map +1 -1
  403. package/react/types/smartDesktopDesignerTypes.d.ts +52 -6
  404. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  405. package/react/types/windowTitleBar.d.ts +4 -2
  406. package/react/types/windowTitleBar.js.map +1 -1
  407. package/react/components/common/FontSizeSelector.d.ts +0 -7
  408. package/react/components/common/FontSizeSelector.js +0 -42
  409. package/react/components/common/FontSizeSelector.js.map +0 -1
  410. package/react/components/common/stories/FontSizeSelector.stories.d.ts +0 -12
  411. package/react/components/common/stories/FontSizeSelector.stories.js +0 -24
  412. package/react/components/common/stories/FontSizeSelector.stories.js.map +0 -1
  413. package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +0 -25
  414. package/react/components/smartDesktopDesigner/ApplicationEdit.js +0 -103
  415. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +0 -1
  416. package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -15
  417. package/react/components/smartDesktopDesigner/ApplicationList.js +0 -56
  418. package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
  419. package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +0 -23
  420. package/react/components/smartDesktopDesigner/ApplicationSetup.js +0 -73
  421. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +0 -1
  422. package/react/components/smartDesktopDesigner/ProjectHeader.d.ts +0 -14
  423. package/react/components/smartDesktopDesigner/ProjectHeader.js +0 -70
  424. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +0 -1
  425. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.d.ts +0 -4
  426. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +0 -45
  427. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +0 -1
  428. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.d.ts +0 -3
  429. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +0 -29
  430. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +0 -1
  431. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.d.ts +0 -12
  432. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js +0 -21
  433. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +0 -1
  434. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -15
  435. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
  436. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.d.ts +0 -12
  437. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js +0 -28
  438. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +0 -1
  439. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.d.ts +0 -10
  440. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js +0 -19
  441. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +0 -1
  442. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js +0 -66
  443. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +0 -1
  444. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
  445. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js +0 -41
  446. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +0 -1
  447. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js +0 -27
  448. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +0 -1
@@ -45,7 +45,7 @@ export const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList
45
45
  onSend({
46
46
  intent: (_b = (_a = resolutionList[intentNumber]) === null || _a === void 0 ? void 0 : _a.intent) === null || _b === void 0 ? void 0 : _b.name,
47
47
  selectedApp: {
48
- name: app.meta.name,
48
+ appId: app.appId,
49
49
  },
50
50
  });
51
51
  } })))),
@@ -1 +1 @@
1
- {"version":3,"file":"ResolverDialog.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAO5D,MAAM,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAa,EAAE,EAAE,CAAC,CAC/C,gCAAQ,SAAS,EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI;IACzD,8BAAM,SAA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AG,EAAE,KAAK,EACV,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,GAAG,EAAE;;wBACb,MAAM,CAAC;4BACN,MAAM,EAAE,MAAA,MAAA,cAAc,CAAC,YAAY,CAAC,0CAAE,MAAM,0CAAE,IAAI;4BAClD,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;4BACpC,UAAU,EAAE,GAAG,CAAC,UAAU;yBAC1B,CAAC,CAAC;oBACJ,CAAC,IAEA,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAClC,CACL,CAAC,CACE,CACA,CACJ,CACH,CAAC,CAAC,CAAC,CACH,yCAAK,CACL;QAED,6BAAK,SAAS,EAAC,kBAAkB;YAChC,oBAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,QAAQ,GAAI,CACtD,CACD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState } from \"react\";\nimport { Button } from \"../common/Button\";\nimport \"./ResolverDialog.css\";\nimport { ResolutionList } from \"../../types/fdc3\";\nimport { FinsembleSelect } from \"../common/FinsembleSelect\";\n\ntype TileProps = {\n\ttext: string;\n\tcallback: () => void;\n};\n\nconst Tile = ({ text, callback }: TileProps) => (\n\t<button className=\"appTile\" onClick={callback} title={text}>\n\t\t<span className=\"tileHeader\">{text}</span>\n\t</button>\n);\n\ntype openApp = {\n\tname: string;\n\tid: string;\n};\nexport type ReceivingAppType = {\n\tname: string;\n\topen: openApp[];\n};\nexport type ResolverProps = {\n\tintentRaiser: string;\n\tonSend: any;\n\tonCancel: any;\n\tresolutionList?: ResolutionList[];\n};\n\nexport const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList = [] }: ResolverProps) => {\n\tconst [intentNumber, setIntentNumber] = useState(0);\n\tconst intent = resolutionList[intentNumber]?.intent?.displayName || \"\";\n\tconst contextType = resolutionList[intentNumber]?.context?.type ?? \"data\";\n\tconst receivingApps = resolutionList[intentNumber]?.launchableApps || [];\n\tconst openApps = (resolutionList[intentNumber]?.openApps || []).map((app, key) => {\n\t\treturn {\n\t\t\t...app,\n\t\t\tindex: key,\n\t\t};\n\t});\n\n\treturn (\n\t\t<div className=\"resolverDialog\">\n\t\t\t{resolutionList.length > 1 ? (\n\t\t\t\t<>\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<span className=\"sourceText\">{intentRaiser}</span> wants to send{\" \"}\n\t\t\t\t\t\t<span className=\"intentText\">&quot;{contextType}&quot;</span> to another app.\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>How do you want to handle this?</p>\n\n\t\t\t\t\t<h2>Choose an action:</h2>\n\n\t\t\t\t\t<FinsembleSelect\n\t\t\t\t\t\tselected={[`${intentNumber}`]}\n\t\t\t\t\t\toptions={resolutionList.map((item) => item.intent?.displayName || \"\")}\n\t\t\t\t\t\tvalues={resolutionList.map((item, key) => `${key}`)}\n\t\t\t\t\t\tupdateCallback={(values: string[]) => {\n\t\t\t\t\t\t\tsetIntentNumber(+values[0]);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize={Math.min(resolutionList.length, 5)}\n\t\t\t\t\t\tlimit={1}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<span className=\"sourceText\">{intentRaiser}</span> wants to{\" \"}\n\t\t\t\t\t\t<span className=\"intentText\">&quot;{intent}&quot;</span>.\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>How do you want to handle this?</p>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<h2>Open a new app...</h2>\n\n\t\t\t<div className=\"appListGrid\">\n\t\t\t\t{receivingApps.map((app, key) => (\n\t\t\t\t\t<Tile\n\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\ttext={app.meta.name}\n\t\t\t\t\t\tcallback={() => {\n\t\t\t\t\t\t\tonSend({\n\t\t\t\t\t\t\t\tintent: resolutionList[intentNumber]?.intent?.name,\n\t\t\t\t\t\t\t\tselectedApp: {\n\t\t\t\t\t\t\t\t\tname: app.meta.name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{openApps.length ? (\n\t\t\t\t<>\n\t\t\t\t\t<h2>...or, send to a running app</h2>\n\n\t\t\t\t\t<div className=\"appSelector\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t{openApps.map((app, index) => (\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tonSend({\n\t\t\t\t\t\t\t\t\t\t\tintent: resolutionList[intentNumber]?.intent?.name,\n\t\t\t\t\t\t\t\t\t\t\tselectedApp: { name: app.meta.name },\n\t\t\t\t\t\t\t\t\t\t\twindowName: app.windowName,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{`${app.index + 1} - ${app.meta.name}`}\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<></>\n\t\t\t)}\n\n\t\t\t<div className=\"actionGroupRight\">\n\t\t\t\t<Button fashion=\"ghost\" text=\"Cancel\" onClick={onCancel} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"ResolverDialog.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,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AAE,IAAI;oBAClD,WAAW,EAAE;wBACZ,KAAK,EAAE,GAAG,CAAC,KAAK;qBAChB;iBACD,CAAC,CAAC;YACJ,CAAC,GACA,CACF,CAAC,CACG;QAEL,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAClB;YACC,+DAAqC;YAErC,6BAAK,SAAS,EAAC,aAAa;gBAC3B,gCACE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7B,4BACC,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,GAAG,EAAE;;wBACb,MAAM,CAAC;4BACN,MAAM,EAAE,MAAA,MAAA,cAAc,CAAC,YAAY,CAAC,0CAAE,MAAM,0CAAE,IAAI;4BAClD,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;4BACpC,UAAU,EAAE,GAAG,CAAC,UAAU;yBAC1B,CAAC,CAAC;oBACJ,CAAC,IAEA,GAAG,GAAG,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAClC,CACL,CAAC,CACE,CACA,CACJ,CACH,CAAC,CAAC,CAAC,CACH,yCAAK,CACL;QAED,6BAAK,SAAS,EAAC,kBAAkB;YAChC,oBAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,QAAQ,GAAI,CACtD,CACD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState } from \"react\";\nimport { Button } from \"../common/Button\";\nimport \"./ResolverDialog.css\";\nimport { ResolutionList } from \"../../types/fdc3\";\nimport { FinsembleSelect } from \"../common/FinsembleSelect\";\n\ntype TileProps = {\n\ttext: string;\n\tcallback: () => void;\n};\n\nconst Tile = ({ text, callback }: TileProps) => (\n\t<button className=\"appTile\" onClick={callback} title={text}>\n\t\t<span className=\"tileHeader\">{text}</span>\n\t</button>\n);\n\ntype openApp = {\n\tname: string;\n\tid: string;\n};\nexport type ReceivingAppType = {\n\tname: string;\n\topen: openApp[];\n};\nexport type ResolverProps = {\n\tintentRaiser: string;\n\tonSend: any;\n\tonCancel: any;\n\tresolutionList?: ResolutionList[];\n};\n\nexport const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList = [] }: ResolverProps) => {\n\tconst [intentNumber, setIntentNumber] = useState(0);\n\tconst intent = resolutionList[intentNumber]?.intent?.displayName || \"\";\n\tconst contextType = resolutionList[intentNumber]?.context?.type ?? \"data\";\n\tconst receivingApps = resolutionList[intentNumber]?.launchableApps || [];\n\tconst openApps = (resolutionList[intentNumber]?.openApps || []).map((app, key) => {\n\t\treturn {\n\t\t\t...app,\n\t\t\tindex: key,\n\t\t};\n\t});\n\n\treturn (\n\t\t<div className=\"resolverDialog\">\n\t\t\t{resolutionList.length > 1 ? (\n\t\t\t\t<>\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<span className=\"sourceText\">{intentRaiser}</span> wants to send{\" \"}\n\t\t\t\t\t\t<span className=\"intentText\">&quot;{contextType}&quot;</span> to another app.\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>How do you want to handle this?</p>\n\n\t\t\t\t\t<h2>Choose an action:</h2>\n\n\t\t\t\t\t<FinsembleSelect\n\t\t\t\t\t\tselected={[`${intentNumber}`]}\n\t\t\t\t\t\toptions={resolutionList.map((item) => item.intent?.displayName || \"\")}\n\t\t\t\t\t\tvalues={resolutionList.map((item, key) => `${key}`)}\n\t\t\t\t\t\tupdateCallback={(values: string[]) => {\n\t\t\t\t\t\t\tsetIntentNumber(+values[0]);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tsize={Math.min(resolutionList.length, 5)}\n\t\t\t\t\t\tlimit={1}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<span className=\"sourceText\">{intentRaiser}</span> wants to{\" \"}\n\t\t\t\t\t\t<span className=\"intentText\">&quot;{intent}&quot;</span>.\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p>How do you want to handle this?</p>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<h2>Open a new app...</h2>\n\n\t\t\t<div className=\"appListGrid\">\n\t\t\t\t{receivingApps.map((app, key) => (\n\t\t\t\t\t<Tile\n\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\ttext={app.meta.name}\n\t\t\t\t\t\tcallback={() => {\n\t\t\t\t\t\t\tonSend({\n\t\t\t\t\t\t\t\tintent: resolutionList[intentNumber]?.intent?.name,\n\t\t\t\t\t\t\t\tselectedApp: {\n\t\t\t\t\t\t\t\t\tappId: app.appId,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{openApps.length ? (\n\t\t\t\t<>\n\t\t\t\t\t<h2>...or, send to a running app</h2>\n\n\t\t\t\t\t<div className=\"appSelector\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t{openApps.map((app, index) => (\n\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tonSend({\n\t\t\t\t\t\t\t\t\t\t\tintent: resolutionList[intentNumber]?.intent?.name,\n\t\t\t\t\t\t\t\t\t\t\tselectedApp: { name: app.meta.name },\n\t\t\t\t\t\t\t\t\t\t\twindowName: app.windowName,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{`${app.index + 1} - ${app.meta.name}`}\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<></>\n\t\t\t)}\n\n\t\t\t<div className=\"actionGroupRight\">\n\t\t\t\t<Button fashion=\"ghost\" text=\"Cancel\" onClick={onCancel} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
@@ -30,7 +30,7 @@ describe("Resolver UI", () => {
30
30
  const { args } = buttonSpy.getCall(0);
31
31
  expect(buttonSpy.calledOnce, "The send callback was called").to.be.true;
32
32
  expect(args.length, "Only 1 window was provided").to.be.equal(1);
33
- expect(args[0].selectedApp.name, "Provides name = Chart").to.equal("Chart");
33
+ expect(args[0].selectedApp.appId, "Provides name = Chart").to.equal("Chart");
34
34
  });
35
35
  it("should include the selected items in the Send payload", () => {
36
36
  const buttonSpy = sinon.spy(Short.args, "onSend");
@@ -1 +1 @@
1
- {"version":3,"file":"ResolverDialog.spec.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAGlF,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACxD,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,C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CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACxE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,0DAA0D,CAAC,CAAC,EAAE,CAAC,KAAK,CAC9F,mBAAmB,CACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QAC1E,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAqB,EAAE,UAAU,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,KAAK,oBAAM,KAAK,CAAC,IAAsB,EAAI,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { afterEach, describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport sinon from \"sinon\";\nimport { ResolverProps } from \"./ResolverDialog\";\nimport { Short } from \"./ResolverDialog.stories\";\nimport { accessibilityAssessor } from \"../smartDesktopDesigner/tests/a11y_helper\";\n\n// Necessary to allow sinon to work with mocked actions (which are shown in the Actions panel in Storybook)\nimport addons, { mockChannel } from \"@storybook/addons\";\naddons.setChannel(mockChannel());\n\ndescribe(\"Resolver UI\", () => {\n\tafterEach(() => {\n\t\tsinon.restore();\n\t});\n\n\tit(\"should pass accessibility scans\", async () => {\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n\n\tit(\"should fill in data as expected\", () => {\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\texpect(wrapper.find(\".appTile\").length, \"Only show 2 tiles\").to.equal(2);\n\t\texpect(wrapper.find(\".appTile\").at(0).find(\".tileHeader\").text(), \"First tile says Chart\").to.equal(\"Chart\");\n\t\texpect(wrapper.find(\".appTile\").at(1).find(\".tileHeader\").text(), \"Second tile says Grid\").to.equal(\"Grid\");\n\t\texpect(wrapper.find(\".appSelector li\").length, \"App list should have 2 items\").to.equal(2);\n\t\texpect(wrapper.find(\".appSelector li\").at(0).text(), \"First app list item should say Chart #1\").to.equal(\n\t\t\t\"1 - Chart\"\n\t\t);\n\t});\n\n\tit(\"should include info in the Send payload - selecting new item\", () => {\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onSend\");\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\twrapper.find(\".appTile\").at(0).simulate(\"click\");\n\t\tconst { args }: { args: any[] } = buttonSpy.getCall(0);\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\n\t\texpect(args.length, \"Only 1 window was provided\").to.be.equal(1);\n\t\texpect(args[0].selectedApp.name, \"Provides name = Chart\").to.equal(\"Chart\");\n\t});\n\n\tit(\"should include the selected items in the Send payload\", () => {\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onSend\");\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\twrapper.find(\".appSelector li\").at(0).simulate(\"click\");\n\n\t\tconst { args }: { args: any[] } = buttonSpy.getCall(0);\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\n\t\texpect(args.length, \"Only 1 window was provided\").to.be.equal(1);\n\t\texpect(args[0].windowName, \"The name of the provided window was 'Chart-1-'Finsemble'\").to.equal(\n\t\t\t\"Chart-1-Finsemble\"\n\t\t);\n\t});\n\n\tit(\"should call the cancel function if the Cancel button is clicked\", () => {\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onCancel\");\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\t\twrapper.find(\".button-container-ghost button\").simulate(\"click\");\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\n\t});\n});\n"]}
1
+ {"version":3,"file":"ResolverDialog.spec.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAGlF,OAAO,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACxD,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC5B,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,KAAK,oBAAM,KAAK,CAAC,IAAsB,EAAI,CAAC,CAAC;QAEpE,MAAM,CAAC,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAA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AAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,0DAA0D,CAAC,CAAC,EAAE,CAAC,KAAK,CAC9F,mBAAmB,CACnB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QAC1E,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAqB,EAAE,UAAU,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,KAAK,oBAAM,KAAK,CAAC,IAAsB,EAAI,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { afterEach, describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport sinon from \"sinon\";\nimport { ResolverProps } from \"./ResolverDialog\";\nimport { Short } from \"./ResolverDialog.stories\";\nimport { accessibilityAssessor } from \"../smartDesktopDesigner/tests/a11y_helper\";\n\n// Necessary to allow sinon to work with mocked actions (which are shown in the Actions panel in Storybook)\nimport addons, { mockChannel } from \"@storybook/addons\";\naddons.setChannel(mockChannel());\n\ndescribe(\"Resolver UI\", () => {\n\tafterEach(() => {\n\t\tsinon.restore();\n\t});\n\n\tit(\"should pass accessibility scans\", async () => {\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n\n\tit(\"should fill in data as expected\", () => {\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\texpect(wrapper.find(\".appTile\").length, \"Only show 2 tiles\").to.equal(2);\n\t\texpect(wrapper.find(\".appTile\").at(0).find(\".tileHeader\").text(), \"First tile says Chart\").to.equal(\"Chart\");\n\t\texpect(wrapper.find(\".appTile\").at(1).find(\".tileHeader\").text(), \"Second tile says Grid\").to.equal(\"Grid\");\n\t\texpect(wrapper.find(\".appSelector li\").length, \"App list should have 2 items\").to.equal(2);\n\t\texpect(wrapper.find(\".appSelector li\").at(0).text(), \"First app list item should say Chart #1\").to.equal(\n\t\t\t\"1 - Chart\"\n\t\t);\n\t});\n\n\tit(\"should include info in the Send payload - selecting new item\", () => {\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onSend\");\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\twrapper.find(\".appTile\").at(0).simulate(\"click\");\n\t\tconst { args }: { args: any[] } = buttonSpy.getCall(0);\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\n\t\texpect(args.length, \"Only 1 window was provided\").to.be.equal(1);\n\t\texpect(args[0].selectedApp.appId, \"Provides name = Chart\").to.equal(\"Chart\");\n\t});\n\n\tit(\"should include the selected items in the Send payload\", () => {\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onSend\");\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\n\t\twrapper.find(\".appSelector li\").at(0).simulate(\"click\");\n\n\t\tconst { args }: { args: any[] } = buttonSpy.getCall(0);\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\n\t\texpect(args.length, \"Only 1 window was provided\").to.be.equal(1);\n\t\texpect(args[0].windowName, \"The name of the provided window was 'Chart-1-'Finsemble'\").to.equal(\n\t\t\t\"Chart-1-Finsemble\"\n\t\t);\n\t});\n\n\tit(\"should call the cancel function if the Cancel button is clicked\", () => {\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onCancel\");\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\n\t\twrapper.find(\".button-container-ghost button\").simulate(\"click\");\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\n\t});\n});\n"]}
@@ -21,12 +21,14 @@ Short.args = {
21
21
  appId: "Chart",
22
22
  name: "Chart",
23
23
  },
24
+ appId: "Chart",
24
25
  },
25
26
  {
26
27
  meta: {
27
28
  appId: "Grid",
28
29
  name: "Grid",
29
30
  },
31
+ appId: "Grid",
30
32
  },
31
33
  ],
32
34
  openApps: [
@@ -35,12 +37,14 @@ Short.args = {
35
37
  meta: {
36
38
  name: "Chart",
37
39
  },
40
+ appId: "Chart",
38
41
  },
39
42
  {
40
43
  windowName: "Grid-1-Finsemble",
41
44
  meta: {
42
45
  name: "Grid",
43
46
  },
47
+ appId: "Grid",
44
48
  },
45
49
  ],
46
50
  intent: {
@@ -63,24 +67,28 @@ LongNames.args = {
63
67
  appId: "abc",
64
68
  name: "jacuzzi",
65
69
  },
70
+ appId: "abc",
66
71
  },
67
72
  {
68
73
  meta: {
69
74
  appId: "def",
70
75
  name: "blizzard",
71
76
  },
77
+ appId: "def",
72
78
  },
73
79
  {
74
80
  meta: {
75
81
  appId: "ghi",
76
82
  name: "quizzical",
77
83
  },
84
+ appId: "ghi",
78
85
  },
79
86
  {
80
87
  meta: {
81
88
  appId: "jkl",
82
89
  name: "puzzlement",
83
90
  },
91
+ appId: "jkl",
84
92
  },
85
93
  ],
86
94
  openApps: [],
@@ -104,12 +112,14 @@ MultiIntent.args = {
104
112
  appId: "Grid",
105
113
  name: "Grid",
106
114
  },
115
+ appId: "Grid",
107
116
  },
108
117
  {
109
118
  meta: {
110
119
  appId: "Chart",
111
120
  name: "Chart",
112
121
  },
122
+ appId: "Chart",
113
123
  },
114
124
  ],
115
125
  openApps: [
@@ -118,6 +128,7 @@ MultiIntent.args = {
118
128
  meta: {
119
129
  name: "Grid",
120
130
  },
131
+ appId: "Grid",
121
132
  },
122
133
  ],
123
134
  intent: {
@@ -132,6 +143,7 @@ MultiIntent.args = {
132
143
  appId: "Chart",
133
144
  name: "Chart",
134
145
  },
146
+ appId: "Chart",
135
147
  },
136
148
  ],
137
149
  openApps: [],
@@ -147,6 +159,7 @@ MultiIntent.args = {
147
159
  appId: "Chart",
148
160
  name: "Chart",
149
161
  },
162
+ appId: "Chart",
150
163
  },
151
164
  ],
152
165
  openApps: [],
@@ -1 +1 @@
1
- {"version":3,"file":"ResolverDialog.stories.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAC;AACjE,OAAO,gCAAgC,CAAC;AACxC,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACd,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,cAAc;CACzB,CAAC;AAEF,MAAM,QAAQ,GAAyB,CAAC,IAAmB,EAAE,EAAE,CAAC,oBAAC,cAAc,oBAAK,IAAI,EAAI,CAAC;AAE7F,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACZ,YAAY,EAAE,8BAA8B;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE;QACf;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;iBACD;gBACD;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,MAAM;wBACb,IAAI,EAAE,MAAM;qBACZ;iBACD;aACD;YACD,QAAQ,EAAE;gBACT;oBACC,UAAU,EAAE,mBAAmB;oBAC/B,IAAI,EAAE;wBACL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AAI,EAAE;wBACL,KAAK,EAAE,MAAM;wBACb,IAAI,EAAE,MAAM;qBACZ;iBACD;gBACD;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;iBACD;aACD;YACD,QAAQ,EAAE;gBACT;oBACC,UAAU,EAAE,uBAAuB;oBACnC,IAAI,EAAE;wBACL,IAAI,EAAE,MAAM;qBACZ;iBACD;aACD;YACD,MAAM,EAAE;gBACP,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,WAAW;aACxB;SACD;QACD;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;iBACD;aACD;YACD,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE;gBACP,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,YAAY;aACzB;SACD;QACD;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;iBACD;aACD;YACD,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE;gBACP,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,kBAAkB;aAC/B;SACD;KACD;CACD,CAAC","sourcesContent":["import React from \"react\";\nimport { ResolverDialog, ResolverProps } from \"./ResolverDialog\";\nimport \"../../assets/css/finsemble.css\";\nimport \"../common/css/styles.css\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport { action } from \"@storybook/addon-actions\";\n\nexport default {\n\ttitle: \"FDC3/ResolverDialog\",\n\tcomponent: ResolverDialog,\n};\n\nconst Template: Story<ResolverProps> = (args: ResolverProps) => <ResolverDialog {...args} />;\n\nexport const Short = Template.bind({});\nShort.args = {\n\tintentRaiser: \"FDC3Tester-37-8788-Finsemble\",\n\tonSend: action(\"sent\"),\n\tonCancel: action(\"cancel\"),\n\tresolutionList: [\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [\n\t\t\t\t{\n\t\t\t\t\twindowName: \"Chart-1-Finsemble\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\twindowName: \"Grid-1-Finsemble\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChart\",\n\t\t\t\tdisplayName: \"View Chart\",\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport const LongNames = Template.bind({});\nLongNames.args = {\n\tintentRaiser: \"FDC3Tester-37-8788-Finsemble\",\n\tonSend: action(\"sent\"),\n\tonCancel: action(\"cancel\"),\n\tresolutionList: [\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"abc\",\n\t\t\t\t\t\tname: \"jacuzzi\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"def\",\n\t\t\t\t\t\tname: \"blizzard\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"ghi\",\n\t\t\t\t\t\tname: \"quizzical\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"jkl\",\n\t\t\t\t\t\tname: \"puzzlement\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChart\",\n\t\t\t\tdisplayName: \"View Chart\",\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport const MultiIntent = Template.bind({});\nMultiIntent.args = {\n\tintentRaiser: \"FDC3Tester-37-8788-Finsemble\",\n\tonSend: action(\"sent\"),\n\tonCancel: action(\"cancel\"),\n\tresolutionList: [\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [\n\t\t\t\t{\n\t\t\t\t\twindowName: \"Grid-7-9140-Finsemble\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewNews\",\n\t\t\t\tdisplayName: \"View news\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChart\",\n\t\t\t\tdisplayName: \"View chart\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChartStudy\",\n\t\t\t\tdisplayName: \"View chart study\",\n\t\t\t},\n\t\t},\n\t],\n};\n"]}
1
+ {"version":3,"file":"ResolverDialog.stories.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAC;AACjE,OAAO,gCAAgC,CAAC;AACxC,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACd,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,cAAc;CACzB,CAAC;AAEF,MAAM,QAAQ,GAAyB,CAAC,IAAmB,EAAE,EAAE,CAAC,oBAAC,cAAc,oBAAK,IAAI,EAAI,CAAC;AAE7F,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACZ,YAAY,EAAE,8BAA8B;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE;QACf;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;oBACD,KAAK,EAAE,OAAO;iBACd;gBACD;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,MAAM;wBACb,IAAI,EAAE,MAAM;qBACZ;oBACD,KAAK,EAAE,MAAM;iBACb;aACD;YACD,QAAQ,EAAE;gBACT;oBACC,UAAU,EAAE,mBAAmB;oBAC/B,IAAI,EAAE;wBACL,IAAI,EAAE,OAAO;qBACb;oBACD,KAAK,EAAE,OAAO;iBACd;gBACD;oBACC,UAAU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AM,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE;QACf;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,MAAM;wBACb,IAAI,EAAE,MAAM;qBACZ;oBACD,KAAK,EAAE,MAAM;iBACb;gBACD;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;oBACD,KAAK,EAAE,OAAO;iBACd;aACD;YACD,QAAQ,EAAE;gBACT;oBACC,UAAU,EAAE,uBAAuB;oBACnC,IAAI,EAAE;wBACL,IAAI,EAAE,MAAM;qBACZ;oBACD,KAAK,EAAE,MAAM;iBACb;aACD;YACD,MAAM,EAAE;gBACP,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,WAAW;aACxB;SACD;QACD;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;oBACD,KAAK,EAAE,OAAO;iBACd;aACD;YACD,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE;gBACP,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,YAAY;aACzB;SACD;QACD;YACC,cAAc,EAAE;gBACf;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE,OAAO;wBACd,IAAI,EAAE,OAAO;qBACb;oBACD,KAAK,EAAE,OAAO;iBACd;aACD;YACD,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE;gBACP,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,kBAAkB;aAC/B;SACD;KACD;CACD,CAAC","sourcesContent":["import React from \"react\";\nimport { ResolverDialog, ResolverProps } from \"./ResolverDialog\";\nimport \"../../assets/css/finsemble.css\";\nimport \"../common/css/styles.css\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport { action } from \"@storybook/addon-actions\";\n\nexport default {\n\ttitle: \"FDC3/ResolverDialog\",\n\tcomponent: ResolverDialog,\n};\n\nconst Template: Story<ResolverProps> = (args: ResolverProps) => <ResolverDialog {...args} />;\n\nexport const Short = Template.bind({});\nShort.args = {\n\tintentRaiser: \"FDC3Tester-37-8788-Finsemble\",\n\tonSend: action(\"sent\"),\n\tonCancel: action(\"cancel\"),\n\tresolutionList: [\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [\n\t\t\t\t{\n\t\t\t\t\twindowName: \"Chart-1-Finsemble\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\twindowName: \"Grid-1-Finsemble\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t},\n\t\t\t],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChart\",\n\t\t\t\tdisplayName: \"View Chart\",\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport const LongNames = Template.bind({});\nLongNames.args = {\n\tintentRaiser: \"FDC3Tester-37-8788-Finsemble\",\n\tonSend: action(\"sent\"),\n\tonCancel: action(\"cancel\"),\n\tresolutionList: [\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"abc\",\n\t\t\t\t\t\tname: \"jacuzzi\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"abc\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"def\",\n\t\t\t\t\t\tname: \"blizzard\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"def\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"ghi\",\n\t\t\t\t\t\tname: \"quizzical\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"ghi\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"jkl\",\n\t\t\t\t\t\tname: \"puzzlement\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"jkl\",\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChart\",\n\t\t\t\tdisplayName: \"View Chart\",\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport const MultiIntent = Template.bind({});\nMultiIntent.args = {\n\tintentRaiser: \"FDC3Tester-37-8788-Finsemble\",\n\tonSend: action(\"sent\"),\n\tonCancel: action(\"cancel\"),\n\tresolutionList: [\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [\n\t\t\t\t{\n\t\t\t\t\twindowName: \"Grid-7-9140-Finsemble\",\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tname: \"Grid\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Grid\",\n\t\t\t\t},\n\t\t\t],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewNews\",\n\t\t\t\tdisplayName: \"View news\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChart\",\n\t\t\t\tdisplayName: \"View chart\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tlaunchableApps: [\n\t\t\t\t{\n\t\t\t\t\tmeta: {\n\t\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t\t\tname: \"Chart\",\n\t\t\t\t\t},\n\t\t\t\t\tappId: \"Chart\",\n\t\t\t\t},\n\t\t\t],\n\t\t\topenApps: [],\n\t\t\tintent: {\n\t\t\t\tname: \"ViewChartStudy\",\n\t\t\t\tdisplayName: \"View chart study\",\n\t\t\t},\n\t\t},\n\t],\n};\n"]}
@@ -7,6 +7,6 @@ export const FinsembleDialogButton = (props) => {
7
7
  var _a, _b;
8
8
  const size = (_a = props.buttonSize) !== null && _a !== void 0 ? _a : "md";
9
9
  const classes = `fsbl-button fsbl-button-${size} ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`;
10
- return props.show !== false ? (React.createElement("div", Object.assign({}, props, { className: classes }), props.children)) : null;
10
+ return props.show !== false ? (React.createElement("div", { className: classes, onClick: props.onClick }, props.children)) : null;
11
11
  };
12
12
  //# sourceMappingURL=FinsembleDialogButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FinsembleDialogButton.js","sourceRoot":"","sources":["../../../src/components/legacyControls/FinsembleDialogButton.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,CAAC,MAAM,qBAAqB,GAAwD,CAAC,KAAU,EAAE,EAAE;;IAIxG,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,UAAU,mCAAI,IAAI,CAAC;IACtC,MAAM,OAAO,GAAG,2BAA2B,IAAI,IAAI,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,EAAE,CAAC;IAC3E,OAAO,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAC7B,6CAAS,KAAK,IAAE,SAAS,EAAE,OAAO,KAChC,KAAK,CAAC,QAAQ,CACV,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport * as React from \"react\";\n\nexport type FinsembleDialogButtonProps = {\n\tbuttonSize?: string;\n\tclassName?: string;\n\tshow?: boolean;\n\tonClick?: Function;\n};\n\n/**\n * Button that is rendered on a dialog.\n */\nexport const FinsembleDialogButton: React.FunctionComponent<FinsembleDialogButtonProps> = (props: any) => {\n\t// Default size is medium.\n\n\t// [Julianna Langston, 2021-04-19] I don't think this is being used, since the css class `fsbl-button-md` doesn't exist anywhere. Candidate for removal, along with associated prop.\n\tconst size = props.buttonSize ?? \"md\"; // `fsbl-button-md` css doesn't exist anywhere?\n\tconst classes = `fsbl-button fsbl-button-${size} ${props.className ?? \"\"}`;\n\treturn props.show !== false ? (\n\t\t<div {...props} className={classes}>\n\t\t\t{props.children}\n\t\t</div>\n\t) : null;\n};\n"]}
1
+ {"version":3,"file":"FinsembleDialogButton.js","sourceRoot":"","sources":["../../../src/components/legacyControls/FinsembleDialogButton.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,CAAC,MAAM,qBAAqB,GAAwD,CAAC,KAAU,EAAE,EAAE;;IAIxG,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,UAAU,mCAAI,IAAI,CAAC;IACtC,MAAM,OAAO,GAAG,2BAA2B,IAAI,IAAI,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,EAAE,CAAC;IAC3E,OAAO,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAC7B,6BAAK,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IAC7C,KAAK,CAAC,QAAQ,CACV,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport * as React from \"react\";\n\nexport type FinsembleDialogButtonProps = {\n\tbuttonSize?: string;\n\tclassName?: string;\n\tshow?: boolean;\n\tonClick?: Function;\n};\n\n/**\n * Button that is rendered on a dialog.\n */\nexport const FinsembleDialogButton: React.FunctionComponent<FinsembleDialogButtonProps> = (props: any) => {\n\t// Default size is medium.\n\n\t// [Julianna Langston, 2021-04-19] I don't think this is being used, since the css class `fsbl-button-md` doesn't exist anywhere. Candidate for removal, along with associated prop.\n\tconst size = props.buttonSize ?? \"md\"; // `fsbl-button-md` css doesn't exist anywhere?\n\tconst classes = `fsbl-button fsbl-button-${size} ${props.className ?? \"\"}`;\n\treturn props.show !== false ? (\n\t\t<div className={classes} onClick={props.onClick}>\n\t\t\t{props.children}\n\t\t</div>\n\t) : null;\n};\n"]}
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  export declare enum AllowableDnDAxis {
3
3
  x = "x",
4
4
  y = "y"
@@ -20,6 +20,7 @@ declare type FinsembleDnDContextProps = {
20
20
  axis?: AllowableDnDAxis;
21
21
  lockAxis?: AllowableDnDAxis;
22
22
  className?: string;
23
+ metadata?: Record<string, any> | undefined;
23
24
  };
24
25
  export declare const FinsembleDnDContext: React.FunctionComponent<FinsembleDnDContextProps>;
25
26
  export {};
@@ -1,5 +1,5 @@
1
+ import React from "react";
1
2
  import { SortableContainer } from "react-sortable-hoc";
2
- import * as React from "react";
3
3
  var ChevronDirection;
4
4
  (function (ChevronDirection) {
5
5
  ChevronDirection["left"] = "left";
@@ -71,7 +71,7 @@ const ScrollingChevron = (props) => {
71
71
  React.createElement("i", { className: classNames, onClick: scrollFunction })));
72
72
  };
73
73
  export const FinsembleDnDContext = (props) => {
74
- var _a, _b, _c, _d, _e, _f, _g, _h;
74
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
75
  const { allowHorizontalScroll } = props;
76
76
  const onDragEnd = (_a = props.onDragEnd) !== null && _a !== void 0 ? _a : defaultOnDragEnd;
77
77
  const onDragBegin = (_b = props.onDragStart) !== null && _b !== void 0 ? _b : defaultOnDragBegin;
@@ -98,6 +98,8 @@ export const FinsembleDnDContext = (props) => {
98
98
  const isOverflowPresent = containerMeasurements.clientWidth !== 0 &&
99
99
  Math.abs(containerMeasurements.clientWidth - containerMeasurements.scrollWidth) > 0;
100
100
  const showChevrons = allowHorizontalScroll && isOverflowPresent;
101
+ const dashbar = (_h = props.metadata) === null || _h === void 0 ? void 0 : _h.dashbar;
102
+ const widgetDividerWidth = (dashbar === null || dashbar === void 0 ? void 0 : dashbar.widgetDividerWidth) || 0;
101
103
  const leftChevronDisabled = !!(showChevrons && containerScrollLeft === 0);
102
104
  const rightChevronDisabled = !!(showChevrons &&
103
105
  containerMeasurements.scrollWidth - containerScrollLeft - containerMeasurements.offsetWidth === 0);
@@ -114,7 +116,7 @@ export const FinsembleDnDContext = (props) => {
114
116
  return;
115
117
  let visibleLeftItem = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.childNodes[leftItemIndex - 1];
116
118
  if (visibleLeftItem) {
117
- let calculatedFakeItemWidth = scrollHorizontally((_b = visibleLeftItem === null || visibleLeftItem === void 0 ? void 0 : visibleLeftItem.clientWidth) !== null && _b !== void 0 ? _b : chevronScrollDistance, scrollFunctionState, scrollFunctionStateSetters, 1);
119
+ let calculatedFakeItemWidth = scrollHorizontally((_b = (visibleLeftItem === null || visibleLeftItem === void 0 ? void 0 : visibleLeftItem.clientWidth) - widgetDividerWidth) !== null && _b !== void 0 ? _b : chevronScrollDistance, scrollFunctionState, scrollFunctionStateSetters, 1);
118
120
  setFakeItemWidth(calculatedFakeItemWidth);
119
121
  setLeftItemIndex(leftItemIndex - 1);
120
122
  }
@@ -125,7 +127,7 @@ export const FinsembleDnDContext = (props) => {
125
127
  return;
126
128
  let visibleLeftItem = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.childNodes[leftItemIndex];
127
129
  if (visibleLeftItem) {
128
- let calculatedFakeItemWidth = scrollHorizontally((_b = visibleLeftItem === null || visibleLeftItem === void 0 ? void 0 : visibleLeftItem.clientWidth) !== null && _b !== void 0 ? _b : chevronScrollDistance, scrollFunctionState, scrollFunctionStateSetters, -1);
130
+ let calculatedFakeItemWidth = scrollHorizontally((_b = (visibleLeftItem === null || visibleLeftItem === void 0 ? void 0 : visibleLeftItem.clientWidth) - widgetDividerWidth) !== null && _b !== void 0 ? _b : chevronScrollDistance, scrollFunctionState, scrollFunctionStateSetters, -1);
129
131
  setFakeItemWidth(calculatedFakeItemWidth);
130
132
  setLeftItemIndex(leftItemIndex + 1);
131
133
  }
@@ -133,7 +135,7 @@ export const FinsembleDnDContext = (props) => {
133
135
  const scrollme = (event) => {
134
136
  if (!event.nativeEvent.deltaY)
135
137
  return;
136
- scrollHorizontally(20, scrollFunctionState, scrollFunctionStateSetters, event.nativeEvent.deltaY);
138
+ event.nativeEvent.deltaY < 0 ? scrollToLeft() : scrollToRight();
137
139
  };
138
140
  const doDOMManipulation = () => {
139
141
  if (props.allowHorizontalScroll && containerRef.current)
@@ -160,7 +162,7 @@ export const FinsembleDnDContext = (props) => {
160
162
  }, [SortContainer]);
161
163
  return (React.createElement("div", { id: props.id },
162
164
  showChevrons && (React.createElement(ScrollingChevron, { isDisabled: leftChevronDisabled, chevronDirection: ChevronDirection.left, showToolTip: props.showScrollButtonsTooltip, title: props.leftButtonTooltip, scrollFunction: scrollToLeft })),
163
- React.createElement(SortContainer, { onSortEnd: onDragEnd, onSortStart: onDragBegin, onSortMove: onDragMove, onSortOver: onDragOver, distance: distance, axis: (_h = props.axis) !== null && _h !== void 0 ? _h : AllowableDnDAxis.y, lockAxis: props.lockAxis }, props.children),
165
+ React.createElement(SortContainer, { onSortEnd: onDragEnd, onSortStart: onDragBegin, onSortMove: onDragMove, onSortOver: onDragOver, distance: distance, axis: (_j = props.axis) !== null && _j !== void 0 ? _j : AllowableDnDAxis.y, lockAxis: props.lockAxis }, props.children),
164
166
  showChevrons && (React.createElement(ScrollingChevron, { isDisabled: rightChevronDisabled, chevronDirection: ChevronDirection.right, showToolTip: props.showScrollButtonsTooltip, title: props.rightButtonTooltip, scrollFunction: scrollToRight }))));
165
167
  };
166
168
  //# sourceMappingURL=FinsembleDnDContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FinsembleDnDContext.js","sourceRoot":"","sources":["../../../src/components/legacyControls/FinsembleDnDContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACpB,iCAAa,CAAA;IACb,mCAAe,CAAA;AAChB,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,2BAAO,CAAA;IACP,2BAAO,CAAA;AACR,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAUD,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,OAAO,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC9C,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,CAAC;AACzC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS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CAAC,QAAQ,IAEvB,KAAK,CAAC,QAAQ,CACA;QACf,YAAY,IAAI,CAChB,oBAAC,gBAAgB,IAChB,UAAU,EAAE,oBAAoB,EAChC,gBAAgB,EAAE,gBAAgB,CAAC,KAAK,EACxC,WAAW,EAAE,KAAK,CAAC,wBAAwB,EAC3C,KAAK,EAAE,KAAK,CAAC,kBAAkB,EAC/B,cAAc,EAAE,aAAa,GAC5B,CACF,CACI,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { SortableContainer } from \"react-sortable-hoc\";\nimport * as React from \"react\";\ntype ScrollFunctionState = {\n\tcontainerScrollLeft: number;\n\tcontainerMeasurements: ContainerMeasurements;\n};\n\ntype ScrollFunctionStateSetters = {\n\tsetScrollLeft: React.Dispatch<React.SetStateAction<number>>;\n};\n\nenum ChevronDirection {\n\tleft = \"left\",\n\tright = \"right\",\n}\n\nexport enum AllowableDnDAxis {\n\tx = \"x\",\n\ty = \"y\",\n}\n\ntype ScrollingChevronProps = {\n\tchevronDirection: ChevronDirection;\n\tisDisabled: boolean;\n\tshowToolTip?: boolean;\n\ttitle?: string;\n\tscrollFunction: React.MouseEventHandler;\n};\n\nconst SORT_CONTAINER_DRAG_DISTANCE = 10;\n\nconst defaultOnDragEnd = () => {\n\tconsole.warn(\"No onDragEnd passed to FinsembleDnDContext\");\n};\n\nconst defaultOnDragBegin = Function.prototype;\nconst defaultOnDrag = Function.prototype;\nconst defaultOnDragOver = Function.prototype;\nconst defaultOnLayoutUpdate = Function.prototype;\n\ntype ContainerMeasurements = {\n\tclientLeft: number;\n\tclientWidth: number;\n\tscrollLeft: number;\n\tscrollWidth: number;\n\toffsetLeft: number;\n\toffsetWidth: number;\n};\n\nconst DEFAULT_CONTAINER_MEASUREMENTS: ContainerMeasurements = {\n\tclientLeft: 0,\n\tclientWidth: 0,\n\tscrollLeft: 0,\n\tscrollWidth: 0,\n\toffsetLeft: 0,\n\toffsetWidth: 0,\n};\n\nconst DEFAULT_CHEVRON_SCROLL_DISTANCE = 60;\n/**\n * Listens for resize events on the DOM and changes whether we should render the scrolling chevrons.\n * @param overflowStateSetter\n */\nconst addResizeHandler = (overflowStateSetter: () => void) => () => {\n\twindow.addEventListener(\"resize\", overflowStateSetter);\n\treturn () => {\n\t\twindow.removeEventListener(\"resize\", overflowStateSetter);\n\t};\n};\n\n/**\n * Scrolls forward or back\n * @param containerRef\n * @param distance How far to move\n * @param state Current scroll state\n * @param stateSetters Scroll state setters\n * @param scrollDir Whether we're scrolling forward or backwards\n * @param deltaY The scroll amount that came from the `wheel` event.\n */\nconst scrollHorizontally = (\n\tdistance: number,\n\tstate: ScrollFunctionState,\n\tstateSetters: ScrollFunctionStateSetters,\n\tscrollDir?: number,\n\tdeltaY?: number\n) => {\n\tconst { setScrollLeft } = stateSetters;\n\tconst { containerScrollLeft, containerMeasurements } = state;\n\n\tif (containerMeasurements.scrollWidth === 0) return;\n\tlet scrollAmount = 0;\n\n\tlet delta = 0;\n\tif (deltaY) {\n\t\tdelta = Math.max(-1, Math.min(1, -deltaY));\n\t} else if (scrollDir) {\n\t\tdelta = Math.max(-1, Math.min(1, scrollDir));\n\t}\n\n\tlet fakeItemWidth = 0;\n\n\t// advance the scroll position 40 px forward or back, depending on the mouse wheel direction.\n\t// eslint-disable-next-line no-mixed-operators\n\tlet newScrollLeft = containerScrollLeft - delta * distance;\n\n\tif (scrollAmount >= distance) {\n\t\treturn fakeItemWidth;\n\t}\n\n\t// See the links inside of the main body of FinsembleDnDContext if offsetLeft/Width are unfamiliar to you\n\tconst rightEdgeOfScrollingViewport =\n\t\tcontainerMeasurements.offsetLeft + containerMeasurements.offsetWidth + newScrollLeft;\n\n\tconst rightMostEdgeOfScrollingArea = containerMeasurements.offsetLeft + containerMeasurements.scrollWidth;\n\n\t// if we've scrolled beyond the right-most edge of the area, calculate the fake item width\n\tif (rightEdgeOfScrollingViewport > rightMostEdgeOfScrollingArea) {\n\t\tfakeItemWidth = newScrollLeft - (containerMeasurements.scrollWidth - containerMeasurements.clientWidth);\n\t}\n\n\t// if we've scrolled past the left-most area, set the scrollLeft to the leftMost edge of the region.\n\tif (newScrollLeft < 0) newScrollLeft = 0;\n\n\tif (newScrollLeft !== containerScrollLeft) {\n\t\tsetScrollLeft(newScrollLeft);\n\t}\n\n\treturn fakeItemWidth;\n};\n\n/**\n * Simple component that renders the left and right chevrons.\n * @param props\n */\nconst ScrollingChevron = (props: ScrollingChevronProps) => {\n\tconst { isDisabled, chevronDirection, showToolTip, title, scrollFunction } = props;\n\n\tconst classNames = `scroll-button ff-chevron-${chevronDirection} ${isDisabled ? \"greyedOut\" : null}`;\n\tconst toolTip = showToolTip ? title : \"\";\n\treturn (\n\t\t<div className=\"chevron-container\" title={toolTip}>\n\t\t\t<i className={classNames} onClick={scrollFunction}></i>\n\t\t</div>\n\t);\n};\n\ntype FinsembleDnDContextProps = {\n\tid?: string;\n\tleftButtonTooltip?: string;\n\trightButtonTooltip?: string;\n\tallowHorizontalScroll?: boolean;\n\tshowScrollButtonsTooltip?: boolean;\n\tchevronScrollDistance?: number;\n\tonDragEnd?: Function;\n\tonDragStart?: Function;\n\tonDragMove?: Function;\n\tonDragOver?: Function;\n\tonLayoutUpdate?: Function;\n\ttransitionDuration?: number;\n\tdistance?: number;\n\taxis?: AllowableDnDAxis;\n\tlockAxis?: AllowableDnDAxis;\n\tclassName?: string;\n};\n\n/**\n * The FinsembleDnDContext allows for all of the Draggable and Droppable components to work.\n * It wraps its children and allows them to do draggy and droppy things.\n * It also allows for horizontal containers to provide scrolling functionality.\n * @param props\n * @param props.id ID for the container that wraps the sortable container\n * @param props.allowHorizontalScroll whether the DND context should allow for horizontal scrolling\n * @param props.showScrollButtonsTooltip\n * @param props.leftButtonTooltip Tooltip for left scroll button\n * @param props.rightButtonTooltip Tooltip for right scroll button\n * @param props.chevronScrollDistance how far clicking the chevrons should push the content forward or backwards\n * @param props.onDragEnd handler for sorting\n * @param props.onDragBegin handler for sorting\n * @param props.onDragOver\n * @param props.onLayoutUpdate handler for rendering. Invokes on useLayoutEffect\n * @param props.distance how far the user has to drag an element to trigger sorting behavior\n * @param props.axis whether to sort vertically or horizontally.\n * @param props.className optional styles to pass the the sortable container\n */\nexport const FinsembleDnDContext: React.FunctionComponent<FinsembleDnDContextProps> = (props) => {\n\tconst { allowHorizontalScroll } = props;\n\tconst onDragEnd = props.onDragEnd ?? defaultOnDragEnd;\n\tconst onDragBegin = props.onDragStart ?? defaultOnDragBegin;\n\tconst onDragMove = props.onDragMove ?? defaultOnDrag;\n\tconst onDragOver = props.onDragOver ?? defaultOnDragOver;\n\t// This is the numberr of pixels that a draggable element has to be dragged before the sorting kicks in.\n\tconst distance = props.distance ?? SORT_CONTAINER_DRAG_DISTANCE;\n\tconst onLayoutUpdate = props.onLayoutUpdate ?? defaultOnLayoutUpdate;\n\n\t// This is the stateful variable that holds the active 'scrollLeft' property for the DOM node\n\t// that's rendered inside of the sort container.\n\tconst [containerScrollLeft, setContainerScrollLeft] = React.useState(0);\n\t// read the comment in doForceUpdate to understand this.\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tconst [forceUpdate, setForceUpdate] = React.useState(0);\n\n\t// Index of current visible left item\n\tconst [leftItemIndex, setLeftItemIndex] = React.useState(0);\n\t// Width of fake right (last) item to align the position of the left item\n\tconst [fakeItemWidth, setFakeItemWidth] = React.useState(0);\n\tconst containerRef = React.useRef<HTMLDivElement>(null);\n\n\t// An object with all of the measurements that we'll need to set chevron visibility.\n\t// If you don't understand client vs offset vs scrollWidth/Left,\n\t// go check out this image https://i.stack.imgur.com/Cl1IA.png\n\t// Here's an interactive version too: https://jsfiddle.net/y8Y32/25/\n\tconst containerMeasurements = containerRef.current\n\t\t? {\n\t\t\t\tclientLeft: containerRef.current.clientLeft,\n\t\t\t\tclientWidth: containerRef.current.clientWidth,\n\t\t\t\toffsetLeft: containerRef.current.offsetLeft,\n\t\t\t\toffsetWidth: containerRef.current.offsetWidth,\n\t\t\t\t// not using the actual container's scrollLeft because it may not have been set yet.\n\t\t\t\t// this uses the scrollLeft we have set in state.\n\t\t\t\tscrollLeft: containerScrollLeft,\n\t\t\t\tscrollWidth: containerRef.current.scrollWidth,\n\t\t }\n\t\t: DEFAULT_CONTAINER_MEASUREMENTS;\n\tconst chevronScrollDistance = props.chevronScrollDistance ?? DEFAULT_CHEVRON_SCROLL_DISTANCE;\n\t// Whether the elements inside of the DND container have overflowed the clientWidth.\n\tconst isOverflowPresent =\n\t\t// Explicitly made this !== 0 instead of just checking whether clientWidth was truthy\n\t\t// so it was clear why this check was here. If it's not clear,\n\t\t// if the clientWidth of the containerRef is 0, we should not have any chevrons. Ever.\n\t\t// A client width of 0 indicates that the Ref's children haven't fully rendered.\n\t\tcontainerMeasurements.clientWidth !== 0 &&\n\t\t// On a monitor that's scaled at 100%, when clientWidth and scrollWidth are the same\n\t\t// there is no overflow present. When monitors are NOT scaled at 100%,\n\t\t// there's a chance that these two numbers are off.\n\t\tMath.abs(containerMeasurements.clientWidth - containerMeasurements.scrollWidth) > 0;\n\n\tconst showChevrons = allowHorizontalScroll && isOverflowPresent;\n\n\t// disabled === 'grayed out' and onClick won't fire. When you've scrolled all the way to the left,\n\t// the left chevron is disabled. If you've scrolled all the way to the right, the right chevron is disabled\n\tconst leftChevronDisabled = !!(showChevrons && containerScrollLeft === 0);\n\tconst rightChevronDisabled = !!(\n\t\tshowChevrons &&\n\t\t/**\n\t\t * This is a calculation that figures out where the right edge of the current viewport is.\n\t\t * It's a little tricky to imagine. So look at this diagram.\n\t\t \t+-------------------------------------------scrollWidth-------------------------------------------+\n\t\t\t\t\t\t\t\t |----------------------------------------------------|\n\t\t\t\t\t\t\t\t |\t\t\t\t\t\t\t\t\t\t\t\t\t |\n\t\t\t+-------------------------------------------------------------------------------------------------+\n\t\t\t|(0) |(200) |(200) |(300)\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | (A) |\n\t\t\t+-------------------------------------------------------------------------------------------------+\n\t\t\t\t\t\t\t\t | \t\t\t\t\t\t\t\t\t\t\t\t\t |\n\t\t\t\t\t\t\t\t +----------------------clientWidth-------------------+ \n\t\t\t\t\t\t\t\t ^ ^\n\t\t\t\t\t\t\t\t | |\n\t\t\t\t\t\t\t\t | |\n\t\t\t\t\t\t\t\t | |\n\t\t\t\t\t\t\t\t + +\n\t\t\t\t\t\t\t\t scrollLeft = 100 scrollRight = 200\n\n\t\t * The numbers in parens are the numbers for the 'scroll box'. We're trying to figure out where the point labeled (A) is located. \n\t\t * \n\t\t * Walking through the calculation, we take the scrollWidth and subtract the scrollLeft. This gives us the right edge of the scroll box.\n\t\t * offsetWidth is effectively the right edge of the element. If the right edge of the scroll box and the right edge of the element are the same number,\n\t\t * then we cannot scroll any further, and the chevron should be disabled.\n\t\t */\n\t\tcontainerMeasurements.scrollWidth - containerScrollLeft - containerMeasurements.offsetWidth === 0\n\t);\n\n\tconst scrollFunctionState = {\n\t\tcontainerScrollLeft,\n\t\tcontainerMeasurements,\n\t};\n\n\tconst scrollFunctionStateSetters = {\n\t\tsetScrollLeft: setContainerScrollLeft,\n\t};\n\n\t/**\n\t * Left Chevron's onClickHandler\n\t */\n\tconst scrollToLeft = () => {\n\t\tif (leftChevronDisabled) return;\n\t\tlet visibleLeftItem = containerRef.current?.childNodes[leftItemIndex - 1] as HTMLDivElement;\n\t\tif (visibleLeftItem) {\n\t\t\tlet calculatedFakeItemWidth = scrollHorizontally(\n\t\t\t\tvisibleLeftItem?.clientWidth ?? chevronScrollDistance,\n\t\t\t\tscrollFunctionState,\n\t\t\t\tscrollFunctionStateSetters,\n\t\t\t\t1\n\t\t\t);\n\t\t\tsetFakeItemWidth(calculatedFakeItemWidth as number);\n\t\t\tsetLeftItemIndex(leftItemIndex - 1);\n\t\t}\n\t};\n\n\t/**\n\t * Right Chevron's onClickHandler\n\t */\n\tconst scrollToRight = () => {\n\t\tif (rightChevronDisabled) return;\n\t\tlet visibleLeftItem = containerRef.current?.childNodes[leftItemIndex] as HTMLDivElement;\n\t\tif (visibleLeftItem) {\n\t\t\tlet calculatedFakeItemWidth = scrollHorizontally(\n\t\t\t\tvisibleLeftItem?.clientWidth ?? chevronScrollDistance,\n\t\t\t\tscrollFunctionState,\n\t\t\t\tscrollFunctionStateSetters,\n\t\t\t\t-1\n\t\t\t);\n\t\t\tsetFakeItemWidth(calculatedFakeItemWidth as number);\n\t\t\tsetLeftItemIndex(leftItemIndex + 1);\n\t\t}\n\t};\n\n\t/**\n\t * \"wheel\" handler. scrolls forward or backwards\n\t * @param event\n\t */\n\tconst scrollme = (event: React.WheelEvent<HTMLDivElement>) => {\n\t\tif (!event.nativeEvent.deltaY) return;\n\t\tscrollHorizontally(20, scrollFunctionState, scrollFunctionStateSetters, event.nativeEvent.deltaY);\n\t};\n\n\tconst doDOMManipulation = () => {\n\t\tif (props.allowHorizontalScroll && containerRef.current) containerRef.current.scrollLeft = containerScrollLeft;\n\t};\n\n\t// This function increments `forceUpdate`, which is a piece of state that's irrelevant to the\n\t// rendering of this component. After a resize, we need to re-measure the DOM so we can figure out if\n\t// the chevrons are necessary. Because no state changes on a resize. the component doesn't rerender.\n\t// This function will change state, which will cause a re-rendering, and the component will be re-measured.\n\tconst doForceUpdate = () => {\n\t\tsetForceUpdate((currentValueOfForceUpdate) => currentValueOfForceUpdate + 1);\n\t};\n\n\t// This function is needed for correct positioning after resizing the window.\n\tconst scrollToInitialState = () => {\n\t\tconst calculatedFakeItemWidth = scrollHorizontally(\n\t\t\tcontainerScrollLeft,\n\t\t\tscrollFunctionState,\n\t\t\tscrollFunctionStateSetters,\n\t\t\t1\n\t\t);\n\t\tsetFakeItemWidth(calculatedFakeItemWidth as number);\n\t\tsetLeftItemIndex(0);\n\t\tsetContainerScrollLeft(0);\n\t};\n\n\t// After every render, set the actual DOM element's scrollLeft to be whatever we calculated during the previous render.\n\tReact.useLayoutEffect(doDOMManipulation);\n\t// after the children change, we need to force an update so that we can re-measure the DOM after the render happens\n\t// without this, adding and removing elements from the DNDContext won't recalculate whether the chevrons should render\n\tReact.useEffect(doForceUpdate, [props.children]);\n\t// Whenever the window resizes, force an update so that the DOM is re-measured.\n\tReact.useEffect(addResizeHandler(doForceUpdate), []);\n\t// Whenever the window resizes, scroll widgets to the left.\n\tReact.useEffect(addResizeHandler(scrollToInitialState), []);\n\n\t/**\n\t * Actual container that provides drag and drop functionality\n\t */\n\tconst SortContainer = SortableContainer((sortableContainerProps: any) => (\n\t\t<div onWheel={scrollme} ref={containerRef} className={props.className}>\n\t\t\t{sortableContainerProps.children}\n\t\t\t{/* fake element for scrolling */}\n\t\t\t<div style={{ width: `${fakeItemWidth}px`, flexShrink: 0 }} />\n\t\t</div>\n\t));\n\n\t// After every render, call onLayoutUpdate function\n\tReact.useLayoutEffect(() => {\n\t\tonLayoutUpdate();\n\t}, [SortContainer]);\n\n\treturn (\n\t\t<div id={props.id}>\n\t\t\t{showChevrons && (\n\t\t\t\t<ScrollingChevron\n\t\t\t\t\tisDisabled={leftChevronDisabled}\n\t\t\t\t\tchevronDirection={ChevronDirection.left}\n\t\t\t\t\tshowToolTip={props.showScrollButtonsTooltip}\n\t\t\t\t\ttitle={props.leftButtonTooltip}\n\t\t\t\t\tscrollFunction={scrollToLeft}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<SortContainer\n\t\t\t\tonSortEnd={onDragEnd}\n\t\t\t\tonSortStart={onDragBegin}\n\t\t\t\tonSortMove={onDragMove}\n\t\t\t\tonSortOver={onDragOver}\n\t\t\t\tdistance={distance}\n\t\t\t\taxis={props.axis ?? AllowableDnDAxis.y}\n\t\t\t\tlockAxis={props.lockAxis}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</SortContainer>\n\t\t\t{showChevrons && (\n\t\t\t\t<ScrollingChevron\n\t\t\t\t\tisDisabled={rightChevronDisabled}\n\t\t\t\t\tchevronDirection={ChevronDirection.right}\n\t\t\t\t\tshowToolTip={props.showScrollButtonsTooltip}\n\t\t\t\t\ttitle={props.rightButtonTooltip}\n\t\t\t\t\tscrollFunction={scrollToRight}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"FinsembleDnDContext.js","sourceRoot":"","sources":["../../../src/components/legacyControls/FinsembleDnDContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAWvD,IAAK,gBAGJ;AAHD,WAAK,gBAAgB;IACpB,iCAAa,CAAA;IACb,mCAAe,CAAA;AAChB,CAAC,EAHI,gBAAgB,KAAhB,gBAAgB,QAGpB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,2BAAO,CAAA;IACP,2BAAO,CAAA;AACR,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAUD,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,OAAO,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC9C,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,CAAC;AACzC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC;AAC7C,MAAM,qBAAqB,GAAG,QAAQ,CAAC,SAAS,CAAC;AAWjD,MAAM,8BAA8B,GAA0B;IAC7D,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;CACd,CAAC;AAEF,MAAM,+BAA+B,GAAG,EAAE,CAAC;AAK3C,MAAM,gBAAgB,GAAG,CAAC,mBAA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AAE,oBAAoB,EAChC,gBAAgB,EAAE,gBAAgB,CAAC,KAAK,EACxC,WAAW,EAAE,KAAK,CAAC,wBAAwB,EAC3C,KAAK,EAAE,KAAK,CAAC,kBAAkB,EAC/B,cAAc,EAAE,aAAa,GAC5B,CACF,CACI,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { SortableContainer } from \"react-sortable-hoc\";\n\ntype ScrollFunctionState = {\n\tcontainerScrollLeft: number;\n\tcontainerMeasurements: ContainerMeasurements;\n};\n\ntype ScrollFunctionStateSetters = {\n\tsetScrollLeft: React.Dispatch<React.SetStateAction<number>>;\n};\n\nenum ChevronDirection {\n\tleft = \"left\",\n\tright = \"right\",\n}\n\nexport enum AllowableDnDAxis {\n\tx = \"x\",\n\ty = \"y\",\n}\n\ntype ScrollingChevronProps = {\n\tchevronDirection: ChevronDirection;\n\tisDisabled: boolean;\n\tshowToolTip?: boolean;\n\ttitle?: string;\n\tscrollFunction: React.MouseEventHandler;\n};\n\nconst SORT_CONTAINER_DRAG_DISTANCE = 10;\n\nconst defaultOnDragEnd = () => {\n\tconsole.warn(\"No onDragEnd passed to FinsembleDnDContext\");\n};\n\nconst defaultOnDragBegin = Function.prototype;\nconst defaultOnDrag = Function.prototype;\nconst defaultOnDragOver = Function.prototype;\nconst defaultOnLayoutUpdate = Function.prototype;\n\ntype ContainerMeasurements = {\n\tclientLeft: number;\n\tclientWidth: number;\n\tscrollLeft: number;\n\tscrollWidth: number;\n\toffsetLeft: number;\n\toffsetWidth: number;\n};\n\nconst DEFAULT_CONTAINER_MEASUREMENTS: ContainerMeasurements = {\n\tclientLeft: 0,\n\tclientWidth: 0,\n\tscrollLeft: 0,\n\tscrollWidth: 0,\n\toffsetLeft: 0,\n\toffsetWidth: 0,\n};\n\nconst DEFAULT_CHEVRON_SCROLL_DISTANCE = 60;\n/**\n * Listens for resize events on the DOM and changes whether we should render the scrolling chevrons.\n * @param overflowStateSetter\n */\nconst addResizeHandler = (overflowStateSetter: () => void) => () => {\n\twindow.addEventListener(\"resize\", overflowStateSetter);\n\treturn () => {\n\t\twindow.removeEventListener(\"resize\", overflowStateSetter);\n\t};\n};\n\n/**\n * Scrolls forward or back\n * @param containerRef\n * @param distance How far to move\n * @param state Current scroll state\n * @param stateSetters Scroll state setters\n * @param scrollDir Whether we're scrolling forward or backwards\n * @param deltaY The scroll amount that came from the `wheel` event.\n */\nconst scrollHorizontally = (\n\tdistance: number,\n\tstate: ScrollFunctionState,\n\tstateSetters: ScrollFunctionStateSetters,\n\tscrollDir?: number,\n\tdeltaY?: number\n) => {\n\tconst { setScrollLeft } = stateSetters;\n\tconst { containerScrollLeft, containerMeasurements } = state;\n\n\tif (containerMeasurements.scrollWidth === 0) return;\n\tlet scrollAmount = 0;\n\n\tlet delta = 0;\n\tif (deltaY) {\n\t\tdelta = Math.max(-1, Math.min(1, -deltaY));\n\t} else if (scrollDir) {\n\t\tdelta = Math.max(-1, Math.min(1, scrollDir));\n\t}\n\n\tlet fakeItemWidth = 0;\n\n\t// advance the scroll position 40 px forward or back, depending on the mouse wheel direction.\n\t// eslint-disable-next-line no-mixed-operators\n\tlet newScrollLeft = containerScrollLeft - delta * distance;\n\n\tif (scrollAmount >= distance) {\n\t\treturn fakeItemWidth;\n\t}\n\n\t// See the links inside of the main body of FinsembleDnDContext if offsetLeft/Width are unfamiliar to you\n\tconst rightEdgeOfScrollingViewport =\n\t\tcontainerMeasurements.offsetLeft + containerMeasurements.offsetWidth + newScrollLeft;\n\n\tconst rightMostEdgeOfScrollingArea = containerMeasurements.offsetLeft + containerMeasurements.scrollWidth;\n\n\t// if we've scrolled beyond the right-most edge of the area, calculate the fake item width\n\tif (rightEdgeOfScrollingViewport > rightMostEdgeOfScrollingArea) {\n\t\tfakeItemWidth = newScrollLeft - (containerMeasurements.scrollWidth - containerMeasurements.clientWidth);\n\t}\n\n\t// if we've scrolled past the left-most area, set the scrollLeft to the leftMost edge of the region.\n\tif (newScrollLeft < 0) newScrollLeft = 0;\n\n\tif (newScrollLeft !== containerScrollLeft) {\n\t\tsetScrollLeft(newScrollLeft);\n\t}\n\n\treturn fakeItemWidth;\n};\n\n/**\n * Simple component that renders the left and right chevrons.\n * @param props\n */\nconst ScrollingChevron = (props: ScrollingChevronProps) => {\n\tconst { isDisabled, chevronDirection, showToolTip, title, scrollFunction } = props;\n\n\tconst classNames = `scroll-button ff-chevron-${chevronDirection} ${isDisabled ? \"greyedOut\" : null}`;\n\tconst toolTip = showToolTip ? title : \"\";\n\treturn (\n\t\t<div className=\"chevron-container\" title={toolTip}>\n\t\t\t<i className={classNames} onClick={scrollFunction}></i>\n\t\t</div>\n\t);\n};\n\ntype FinsembleDnDContextProps = {\n\tid?: string;\n\tleftButtonTooltip?: string;\n\trightButtonTooltip?: string;\n\tallowHorizontalScroll?: boolean;\n\tshowScrollButtonsTooltip?: boolean;\n\tchevronScrollDistance?: number;\n\tonDragEnd?: Function;\n\tonDragStart?: Function;\n\tonDragMove?: Function;\n\tonDragOver?: Function;\n\tonLayoutUpdate?: Function;\n\ttransitionDuration?: number;\n\tdistance?: number;\n\taxis?: AllowableDnDAxis;\n\tlockAxis?: AllowableDnDAxis;\n\tclassName?: string;\n\tmetadata?: Record<string, any> | undefined;\n};\n\n/**\n * The FinsembleDnDContext allows for all of the Draggable and Droppable components to work.\n * It wraps its children and allows them to do draggy and droppy things.\n * It also allows for horizontal containers to provide scrolling functionality.\n * @param props\n * @param props.id ID for the container that wraps the sortable container\n * @param props.allowHorizontalScroll whether the DND context should allow for horizontal scrolling\n * @param props.showScrollButtonsTooltip\n * @param props.leftButtonTooltip Tooltip for left scroll button\n * @param props.rightButtonTooltip Tooltip for right scroll button\n * @param props.chevronScrollDistance how far clicking the chevrons should push the content forward or backwards\n * @param props.onDragEnd handler for sorting\n * @param props.onDragBegin handler for sorting\n * @param props.onDragOver\n * @param props.onLayoutUpdate handler for rendering. Invokes on useLayoutEffect\n * @param props.distance how far the user has to drag an element to trigger sorting behavior\n * @param props.axis whether to sort vertically or horizontally.\n * @param props.className optional styles to pass the the sortable container\n */\nexport const FinsembleDnDContext: React.FunctionComponent<FinsembleDnDContextProps> = (props) => {\n\tconst { allowHorizontalScroll } = props;\n\tconst onDragEnd = props.onDragEnd ?? defaultOnDragEnd;\n\tconst onDragBegin = props.onDragStart ?? defaultOnDragBegin;\n\tconst onDragMove = props.onDragMove ?? defaultOnDrag;\n\tconst onDragOver = props.onDragOver ?? defaultOnDragOver;\n\t// This is the numberr of pixels that a draggable element has to be dragged before the sorting kicks in.\n\tconst distance = props.distance ?? SORT_CONTAINER_DRAG_DISTANCE;\n\tconst onLayoutUpdate = props.onLayoutUpdate ?? defaultOnLayoutUpdate;\n\n\t// This is the stateful variable that holds the active 'scrollLeft' property for the DOM node\n\t// that's rendered inside of the sort container.\n\tconst [containerScrollLeft, setContainerScrollLeft] = React.useState(0);\n\t// read the comment in doForceUpdate to understand this.\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tconst [forceUpdate, setForceUpdate] = React.useState(0);\n\n\t// Index of current visible left item\n\tconst [leftItemIndex, setLeftItemIndex] = React.useState(0);\n\t// Width of fake right (last) item to align the position of the left item\n\tconst [fakeItemWidth, setFakeItemWidth] = React.useState(0);\n\tconst containerRef = React.useRef<HTMLDivElement>(null);\n\n\t// An object with all of the measurements that we'll need to set chevron visibility.\n\t// If you don't understand client vs offset vs scrollWidth/Left,\n\t// go check out this image https://i.stack.imgur.com/Cl1IA.png\n\t// Here's an interactive version too: https://jsfiddle.net/y8Y32/25/\n\tconst containerMeasurements = containerRef.current\n\t\t? {\n\t\t\t\tclientLeft: containerRef.current.clientLeft,\n\t\t\t\tclientWidth: containerRef.current.clientWidth,\n\t\t\t\toffsetLeft: containerRef.current.offsetLeft,\n\t\t\t\toffsetWidth: containerRef.current.offsetWidth,\n\t\t\t\t// not using the actual container's scrollLeft because it may not have been set yet.\n\t\t\t\t// this uses the scrollLeft we have set in state.\n\t\t\t\tscrollLeft: containerScrollLeft,\n\t\t\t\tscrollWidth: containerRef.current.scrollWidth,\n\t\t }\n\t\t: DEFAULT_CONTAINER_MEASUREMENTS;\n\tconst chevronScrollDistance = props.chevronScrollDistance ?? DEFAULT_CHEVRON_SCROLL_DISTANCE;\n\t// Whether the elements inside of the DND container have overflowed the clientWidth.\n\tconst isOverflowPresent =\n\t\t// Explicitly made this !== 0 instead of just checking whether clientWidth was truthy\n\t\t// so it was clear why this check was here. If it's not clear,\n\t\t// if the clientWidth of the containerRef is 0, we should not have any chevrons. Ever.\n\t\t// A client width of 0 indicates that the Ref's children haven't fully rendered.\n\t\tcontainerMeasurements.clientWidth !== 0 &&\n\t\t// On a monitor that's scaled at 100%, when clientWidth and scrollWidth are the same\n\t\t// there is no overflow present. When monitors are NOT scaled at 100%,\n\t\t// there's a chance that these two numbers are off.\n\t\tMath.abs(containerMeasurements.clientWidth - containerMeasurements.scrollWidth) > 0;\n\n\tconst showChevrons = allowHorizontalScroll && isOverflowPresent;\n\n\t// TP - [15/12/2021] - We need to have a way to understand whether this context is wihtin the dashbar use or not.\n\t// Feels odd have specific references here but I can't see a way of doing this differently without\n\t// major refactoring, which is something I don't want to do on something called *legacy* controls\n\tconst dashbar = props.metadata?.dashbar;\n\tconst widgetDividerWidth = dashbar?.widgetDividerWidth || 0;\n\n\t// disabled === 'grayed out' and onClick won't fire. When you've scrolled all the way to the left,\n\t// the left chevron is disabled. If you've scrolled all the way to the right, the right chevron is disabled\n\tconst leftChevronDisabled = !!(showChevrons && containerScrollLeft === 0);\n\tconst rightChevronDisabled = !!(\n\t\tshowChevrons &&\n\t\t/**\n\t\t * This is a calculation that figures out where the right edge of the current viewport is.\n\t\t * It's a little tricky to imagine. So look at this diagram.\n\t\t \t+-------------------------------------------scrollWidth-------------------------------------------+\n\t\t\t\t\t\t\t\t |----------------------------------------------------|\n\t\t\t\t\t\t\t\t |\t\t\t\t\t\t\t\t\t\t\t\t\t |\n\t\t\t+-------------------------------------------------------------------------------------------------+\n\t\t\t|(0) |(200) |(200) |(300)\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | |\n\t\t\t| | | (A) |\n\t\t\t+-------------------------------------------------------------------------------------------------+\n\t\t\t\t\t\t\t\t | \t\t\t\t\t\t\t\t\t\t\t\t\t |\n\t\t\t\t\t\t\t\t +----------------------clientWidth-------------------+ \n\t\t\t\t\t\t\t\t ^ ^\n\t\t\t\t\t\t\t\t | |\n\t\t\t\t\t\t\t\t | |\n\t\t\t\t\t\t\t\t | |\n\t\t\t\t\t\t\t\t + +\n\t\t\t\t\t\t\t\t scrollLeft = 100 scrollRight = 200\n\n\t\t * The numbers in parens are the numbers for the 'scroll box'. We're trying to figure out where the point labeled (A) is located. \n\t\t * \n\t\t * Walking through the calculation, we take the scrollWidth and subtract the scrollLeft. This gives us the right edge of the scroll box.\n\t\t * offsetWidth is effectively the right edge of the element. If the right edge of the scroll box and the right edge of the element are the same number,\n\t\t * then we cannot scroll any further, and the chevron should be disabled.\n\t\t */\n\t\tcontainerMeasurements.scrollWidth - containerScrollLeft - containerMeasurements.offsetWidth === 0\n\t);\n\n\tconst scrollFunctionState = {\n\t\tcontainerScrollLeft,\n\t\tcontainerMeasurements,\n\t};\n\n\tconst scrollFunctionStateSetters = {\n\t\tsetScrollLeft: setContainerScrollLeft,\n\t};\n\n\t/**\n\t * Left Chevron's onClickHandler\n\t */\n\tconst scrollToLeft = () => {\n\t\tif (leftChevronDisabled) return;\n\t\tlet visibleLeftItem = containerRef.current?.childNodes[leftItemIndex - 1] as HTMLDivElement;\n\t\tif (visibleLeftItem) {\n\t\t\tlet calculatedFakeItemWidth = scrollHorizontally(\n\t\t\t\tvisibleLeftItem?.clientWidth - widgetDividerWidth ?? chevronScrollDistance,\n\t\t\t\tscrollFunctionState,\n\t\t\t\tscrollFunctionStateSetters,\n\t\t\t\t1\n\t\t\t);\n\t\t\tsetFakeItemWidth(calculatedFakeItemWidth as number);\n\t\t\tsetLeftItemIndex(leftItemIndex - 1);\n\t\t}\n\t};\n\n\t/**\n\t * Right Chevron's onClickHandler\n\t */\n\tconst scrollToRight = () => {\n\t\tif (rightChevronDisabled) return;\n\t\tlet visibleLeftItem = containerRef.current?.childNodes[leftItemIndex] as HTMLDivElement;\n\t\tif (visibleLeftItem) {\n\t\t\tlet calculatedFakeItemWidth = scrollHorizontally(\n\t\t\t\tvisibleLeftItem?.clientWidth - widgetDividerWidth ?? chevronScrollDistance,\n\t\t\t\tscrollFunctionState,\n\t\t\t\tscrollFunctionStateSetters,\n\t\t\t\t-1\n\t\t\t);\n\t\t\tsetFakeItemWidth(calculatedFakeItemWidth as number);\n\t\t\tsetLeftItemIndex(leftItemIndex + 1);\n\t\t}\n\t};\n\n\t/**\n\t * \"wheel\" handler. scrolls forward or backwards\n\t * @param event\n\t */\n\tconst scrollme = (event: React.WheelEvent<HTMLDivElement>) => {\n\t\tif (!event.nativeEvent.deltaY) return;\n\t\tevent.nativeEvent.deltaY < 0 ? scrollToLeft() : scrollToRight();\n\t};\n\n\tconst doDOMManipulation = () => {\n\t\tif (props.allowHorizontalScroll && containerRef.current) containerRef.current.scrollLeft = containerScrollLeft;\n\t};\n\n\t// This function increments `forceUpdate`, which is a piece of state that's irrelevant to the\n\t// rendering of this component. After a resize, we need to re-measure the DOM so we can figure out if\n\t// the chevrons are necessary. Because no state changes on a resize. the component doesn't rerender.\n\t// This function will change state, which will cause a re-rendering, and the component will be re-measured.\n\tconst doForceUpdate = () => {\n\t\tsetForceUpdate((currentValueOfForceUpdate) => currentValueOfForceUpdate + 1);\n\t};\n\n\t// This function is needed for correct positioning after resizing the window.\n\tconst scrollToInitialState = () => {\n\t\tconst calculatedFakeItemWidth = scrollHorizontally(\n\t\t\tcontainerScrollLeft,\n\t\t\tscrollFunctionState,\n\t\t\tscrollFunctionStateSetters,\n\t\t\t1\n\t\t);\n\t\tsetFakeItemWidth(calculatedFakeItemWidth as number);\n\t\tsetLeftItemIndex(0);\n\t\tsetContainerScrollLeft(0);\n\t};\n\n\t// After every render, set the actual DOM element's scrollLeft to be whatever we calculated during the previous render.\n\tReact.useLayoutEffect(doDOMManipulation);\n\t// after the children change, we need to force an update so that we can re-measure the DOM after the render happens\n\t// without this, adding and removing elements from the DNDContext won't recalculate whether the chevrons should render\n\tReact.useEffect(doForceUpdate, [props.children]);\n\t// Whenever the window resizes, force an update so that the DOM is re-measured.\n\tReact.useEffect(addResizeHandler(doForceUpdate), []);\n\t// Whenever the window resizes, scroll widgets to the left.\n\tReact.useEffect(addResizeHandler(scrollToInitialState), []);\n\n\t/**\n\t * Actual container that provides drag and drop functionality\n\t */\n\tconst SortContainer = SortableContainer((sortableContainerProps: any) => (\n\t\t<div onWheel={scrollme} ref={containerRef} className={props.className}>\n\t\t\t{sortableContainerProps.children}\n\t\t\t{/* fake element for scrolling */}\n\t\t\t<div style={{ width: `${fakeItemWidth}px`, flexShrink: 0 }} />\n\t\t</div>\n\t));\n\n\t// After every render, call onLayoutUpdate function\n\tReact.useLayoutEffect(() => {\n\t\tonLayoutUpdate();\n\t}, [SortContainer]);\n\n\treturn (\n\t\t<div id={props.id}>\n\t\t\t{showChevrons && (\n\t\t\t\t<ScrollingChevron\n\t\t\t\t\tisDisabled={leftChevronDisabled}\n\t\t\t\t\tchevronDirection={ChevronDirection.left}\n\t\t\t\t\tshowToolTip={props.showScrollButtonsTooltip}\n\t\t\t\t\ttitle={props.leftButtonTooltip}\n\t\t\t\t\tscrollFunction={scrollToLeft}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<SortContainer\n\t\t\t\tonSortEnd={onDragEnd}\n\t\t\t\tonSortStart={onDragBegin}\n\t\t\t\tonSortMove={onDragMove}\n\t\t\t\tonSortOver={onDragOver}\n\t\t\t\tdistance={distance}\n\t\t\t\taxis={props.axis ?? AllowableDnDAxis.y}\n\t\t\t\tlockAxis={props.lockAxis}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</SortContainer>\n\t\t\t{showChevrons && (\n\t\t\t\t<ScrollingChevron\n\t\t\t\t\tisDisabled={rightChevronDisabled}\n\t\t\t\t\tchevronDirection={ChevronDirection.right}\n\t\t\t\t\tshowToolTip={props.showScrollButtonsTooltip}\n\t\t\t\t\ttitle={props.rightButtonTooltip}\n\t\t\t\t\tscrollFunction={scrollToRight}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { EnhancedStore } from "@reduxjs/toolkit";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  export declare type LinkerStore = services.Interop.types.LinkerStore;
4
4
  export declare type InteropLinkChannels = services.Interop.modules.linker.InteropLinkChannels;
5
5
  export declare type InteropUnlinkChannels = services.Interop.modules.linker.InteropUnlinkChannels;
@@ -1 +1 @@
1
- {"version":3,"file":"remoteRedux.js","sourceRoot":"","sources":["../../../src/components/linker/remoteRedux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAiB,MAAM,kBAAkB,CAAC;AAQ/E,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;AAE7B,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC;AAE3C,MAAM,UAAU,GAAgB;IAC/B,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAyC,cAAc,CAAC;IACzE,cAAc,EAAE,UAAU;IAC1B,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE;QACV,WAAW,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KAC1G;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,eAAe,EAAE,YAAY,CAA+B,wBAAwB,CAAC;IACrF,YAAY,EAAE,YAAY,CAAsB,qBAAqB,CAAC;IACtE,cAAc,EAAE,YAAY,CAAwB,uBAAuB,CAAC;CAC5E,CAAC","sourcesContent":["import { configureStore, createAction, EnhancedStore } from \"@reduxjs/toolkit\";\nimport { services } from \"@finsemble/finsemble-core\";\n\nexport type LinkerStore = services.Interop.types.LinkerStore;\nexport type InteropLinkChannels = services.Interop.modules.linker.InteropLinkChannels;\nexport type InteropUnlinkChannels = services.Interop.modules.linker.InteropUnlinkChannels;\nexport type InteropLinkerSetActiveWindow = services.Interop.modules.linker.InteropLinkerSetActiveWindow;\n\nconst { remoteRedux } = FSBL;\n\nconst dummyReducer = (state: any) => state;\n\nconst emptyStore: LinkerStore = {\n\tclients: {},\n\tallChannels: [],\n};\n\nexport const store: EnhancedStore<LinkerStore, any, any> = configureStore({\n\tpreloadedState: emptyStore,\n\treducer: dummyReducer,\n\tenhancers: [\n\t\tremoteRedux.remoteReduxClientEnhancer({ server: \"@@finsemble/remoteRedux/InteropStore\", slice: \"linker\" }),\n\t],\n});\n\nexport const actions = {\n\tsetActiveWindow: createAction<InteropLinkerSetActiveWindow>(\"linker/setActiveWindow\"),\n\tlinkChannels: createAction<InteropLinkChannels>(\"linker/linkChannels\"),\n\tunlinkChannels: createAction<InteropUnlinkChannels>(\"linker/unlinkChannels\"),\n};\n"]}
1
+ {"version":3,"file":"remoteRedux.js","sourceRoot":"","sources":["../../../src/components/linker/remoteRedux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAiB,MAAM,kBAAkB,CAAC;AAQ/E,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;AAE7B,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC;AAE3C,MAAM,UAAU,GAAgB;IAC/B,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAyC,cAAc,CAAC;IACzE,cAAc,EAAE,UAAU;IAC1B,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE;QACV,WAAW,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KAC1G;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,eAAe,EAAE,YAAY,CAA+B,wBAAwB,CAAC;IACrF,YAAY,EAAE,YAAY,CAAsB,qBAAqB,CAAC;IACtE,cAAc,EAAE,YAAY,CAAwB,uBAAuB,CAAC;CAC5E,CAAC","sourcesContent":["import { configureStore, createAction, EnhancedStore } from \"@reduxjs/toolkit\";\nimport { services } from \"@finsemble/finsemble-api\";\n\nexport type LinkerStore = services.Interop.types.LinkerStore;\nexport type InteropLinkChannels = services.Interop.modules.linker.InteropLinkChannels;\nexport type InteropUnlinkChannels = services.Interop.modules.linker.InteropUnlinkChannels;\nexport type InteropLinkerSetActiveWindow = services.Interop.modules.linker.InteropLinkerSetActiveWindow;\n\nconst { remoteRedux } = FSBL;\n\nconst dummyReducer = (state: any) => state;\n\nconst emptyStore: LinkerStore = {\n\tclients: {},\n\tallChannels: [],\n};\n\nexport const store: EnhancedStore<LinkerStore, any, any> = configureStore({\n\tpreloadedState: emptyStore,\n\treducer: dummyReducer,\n\tenhancers: [\n\t\tremoteRedux.remoteReduxClientEnhancer({ server: \"@@finsemble/remoteRedux/InteropStore\", slice: \"linker\" }),\n\t],\n});\n\nexport const actions = {\n\tsetActiveWindow: createAction<InteropLinkerSetActiveWindow>(\"linker/setActiveWindow\"),\n\tlinkChannels: createAction<InteropLinkChannels>(\"linker/linkChannels\"),\n\tunlinkChannels: createAction<InteropUnlinkChannels>(\"linker/unlinkChannels\"),\n};\n"]}
@@ -5,6 +5,7 @@ export declare type MenuProps = {
5
5
  height?: number;
6
6
  id?: string;
7
7
  maxHeight?: number;
8
+ minHeight?: number;
8
9
  openHotkey?: Array<string>;
9
10
  width?: number;
10
11
  title?: React.ReactNode | string;
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4B5C,MAAM,CAAC,MAAM,IAAI,GAAuC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACN,oBAAC,SAAS,oBAAK,KAAK;QACnB,oBAAC,UAAU,QAAE,KAAK,CAAc;QAChC,oBAAC,WAAW,QAAE,QAAQ,CAAe,CAC1B,CACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { MenuShell } from \"./MenuShell\";\nimport { MenuToggle } from \"./MenuToggle\";\nimport { MenuContent } from \"./MenuContent\";\n\nexport type MenuProps = {\n\tclassName?: string;\n\tcloseHotkey?: Array<string>;\n\theight?: number;\n\tid?: string;\n\tmaxHeight?: number;\n\topenHotkey?: Array<string>;\n\twidth?: number;\n\ttitle?: React.ReactNode | string;\n};\n\n/**\n * A convenience component that fully encapsulates a menu by constructing a <MenuShell> and its contents.\n * All of the props are passed to MenuShell.\n *\n * @param {string} [className] - Custom body class for the menu contents. These classes will be set on the <body> tag for the Menu's drop down window.\n * @param {array} [closeHotkey=[\"escape\"] ] - A hotkey combination to close the menu. Defaults to [\"escape\"].\n * @param {number} [height] - Custom height for the menu. If not set then the height will be automatically calculated based on the content height and available monitor space.\n * @param {string} [id] - Unique ID for the menu. Defaults to a random string.\n * @param {number} [maxHeight=Infinity] - Maximum height of the menu.\n * @param {array} [openHotkey] - A hotkey combination to open the menu.\n * @param {number} [width=180] - Custom width for the menu.\n * @param {title} [string] - Name that appears in the menu's <MenuToggle> button.\n *\n */\n\nexport const Menu: React.FunctionComponent<MenuProps> = (props) => {\n\tconst { children, title } = props;\n\n\treturn (\n\t\t<MenuShell {...props}>\n\t\t\t<MenuToggle>{title}</MenuToggle>\n\t\t\t<MenuContent>{children}</MenuContent>\n\t\t</MenuShell>\n\t);\n};\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA8B5C,MAAM,CAAC,MAAM,IAAI,GAAuC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACN,oBAAC,SAAS,oBAAK,KAAK;QACnB,oBAAC,UAAU,QAAE,KAAK,CAAc;QAChC,oBAAC,WAAW,QAAE,QAAQ,CAAe,CAC1B,CACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { MenuShell } from \"./MenuShell\";\nimport { MenuToggle } from \"./MenuToggle\";\nimport { MenuContent } from \"./MenuContent\";\n\nexport type MenuProps = {\n\tclassName?: string;\n\tcloseHotkey?: Array<string>;\n\theight?: number;\n\tid?: string;\n\tmaxHeight?: number;\n\tminHeight?: number;\n\topenHotkey?: Array<string>;\n\twidth?: number;\n\ttitle?: React.ReactNode | string;\n};\n\n/**\n * A convenience component that fully encapsulates a menu by constructing a <MenuShell> and its contents.\n * All of the props are passed to MenuShell.\n *\n * @param {string} [className] - Custom body class for the menu contents. These classes will be set on the <body> tag for the Menu's drop down window.\n * @param {array} [closeHotkey=[\"escape\"] ] - A hotkey combination to close the menu. Defaults to [\"escape\"].\n * @param {number} [height] - Custom height for the menu. If not set then the height will be automatically calculated based on the content height and available monitor space.\n * @param {string} [id] - Unique ID for the menu. Defaults to a random string.\n * @param {number} [maxHeight=Infinity] - Maximum height of the menu.\n * @param {number} [minHeight] - Minimum height of the menu\n * @param {array} [openHotkey] - A hotkey combination to open the menu.\n * @param {number} [width=180] - Custom width for the menu.\n * @param {title} [string] - Name that appears in the menu's <MenuToggle> button.\n *\n */\n\nexport const Menu: React.FunctionComponent<MenuProps> = (props) => {\n\tconst { children, title } = props;\n\n\treturn (\n\t\t<MenuShell {...props}>\n\t\t\t<MenuToggle>{title}</MenuToggle>\n\t\t\t<MenuContent>{children}</MenuContent>\n\t\t</MenuShell>\n\t);\n};\n"]}
@@ -4,7 +4,8 @@ export declare class MenuAutoResizer {
4
4
  private childWindow;
5
5
  private menuId;
6
6
  private observer;
7
- constructor(childWindow: Window, menuId: string, width: number, maxHeight?: number);
7
+ private minHeight;
8
+ constructor(childWindow: Window, menuId: string, width: number, maxHeight?: number, minHeight?: number);
8
9
  disconnect(): void;
9
10
  private updateWindowDimensions;
10
11
  }
@@ -1,8 +1,9 @@
1
1
  import { calculateDimensions } from "./menuHelpers";
2
2
  export class MenuAutoResizer {
3
- constructor(childWindow, menuId, width, maxHeight = Infinity) {
3
+ constructor(childWindow, menuId, width, maxHeight = Infinity, minHeight = 0) {
4
4
  this.width = width;
5
5
  this.maxHeight = maxHeight;
6
+ this.minHeight = minHeight;
6
7
  this.childWindow = childWindow;
7
8
  this.menuId = menuId;
8
9
  this.updateWindowDimensions = this.updateWindowDimensions.bind(this);
@@ -21,10 +22,10 @@ export class MenuAutoResizer {
21
22
  if (!document.querySelector(`#${this.menuId}-menu-toggle`)) {
22
23
  return;
23
24
  }
24
- const { left, top, height } = await calculateDimensions(this.childWindow, this.menuId, 0, this.maxHeight);
25
+ const { left, top, height } = await calculateDimensions(this.childWindow, this.menuId, 0, this.maxHeight, this.minHeight);
25
26
  const params = {
26
27
  monitor: "mine",
27
- position: "monitor",
28
+ position: "absolute",
28
29
  left: left,
29
30
  top: top,
30
31
  width: this.width,
@@ -1 +1 @@
1
- {"version":3,"file":"MenuAutoResizer.js","sourceRoot":"","sources":["../../../src/components/menu/MenuAutoResizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AASpD,MAAM,OAAO,eAAe;IAW3B,YAAY,WAAmB,EAAE,MAAc,EAAE,KAAa,EAAE,YAAoB,QAAQ;QAC3F,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAQrE,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAKlE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YAChD,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,KAAK;YACpB,OAAO,EAAE,IAAI;SACb,CAAC,CAAC;QAGH,UAAU,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;IAKO,KAAK,CAAC,sBAAsB;QAInC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,MAAM,cAAc,CAAC,EAAE;YAC3D,OAAO;SACP;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAE1G,MAAM,MAAM,GAAgB;YAC3B,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,GAAG;YACR,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,IAAI;YACnB,gBAAgB,EAAE,aAAa;SAC/B,CAAC;QAOF,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7F,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACD","sourcesContent":["import { calculateDimensions } from \"./menuHelpers\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\n/**\n * To make sure that MenuPortal.tsx remain small\n * I have isolated the auto resize logic in this class.\n */\nexport class MenuAutoResizer {\n\tprivate width: number;\n\n\tprivate maxHeight: number;\n\n\tprivate childWindow: Window;\n\n\tprivate menuId: string;\n\n\tprivate observer: MutationObserver;\n\n\tconstructor(childWindow: Window, menuId: string, width: number, maxHeight: number = Infinity) {\n\t\tthis.width = width;\n\t\tthis.maxHeight = maxHeight;\n\t\tthis.childWindow = childWindow;\n\t\tthis.menuId = menuId;\n\t\tthis.updateWindowDimensions = this.updateWindowDimensions.bind(this);\n\t\t/* The external window does not have a URL and so its origin\n\t\twill not match the toolbar's origin, in that case\n\t\twe won't have onload, DOMContentLoaded or any other events.\n\t\tThat makes it hard to know when the content are loaded, we cant\n\t\teven inject custom JS as it will be already late.\n\t\tThe only way to know about a DOM change was MutationObserver!\n\t\t*/\n\t\tthis.observer = new MutationObserver(this.updateWindowDimensions);\n\t\t/* Now we watch for any DOM changes in the childWindow\n\t\tKnowing the height of the window contents is crucial for\n\t\tmaking decision about its position (below/above the toolbar).\n\t\t*/\n\t\tthis.observer.observe(this.childWindow.document, {\n\t\t\tchildList: true,\n\t\t\tcharacterData: false,\n\t\t\tsubtree: true,\n\t\t});\n\n\t\t// Initialize the window to the correct height\n\t\tsetTimeout(this.updateWindowDimensions, 0);\n\t}\n\n\tdisconnect() {\n\t\tthis.observer.disconnect();\n\t}\n\n\t/**\n\t * Callback for MutationObserver\n\t */\n\tprivate async updateWindowDimensions() {\n\t\t// If the original menu button has been removed then bypass updating the window dimensions.\n\t\t// Probably the menu itself is in the process of being removed but the mutation observer has\n\t\t// not yet disconnected\n\t\tif (!document.querySelector(`#${this.menuId}-menu-toggle`)) {\n\t\t\treturn;\n\t\t}\n\t\tconst { left, top, height } = await calculateDimensions(this.childWindow, this.menuId, 0, this.maxHeight);\n\n\t\tconst params: SpawnParams = {\n\t\t\tmonitor: \"mine\",\n\t\t\tposition: \"monitor\",\n\t\t\tleft: left,\n\t\t\ttop: top,\n\t\t\twidth: this.width,\n\t\t\theight: height,\n\t\t\tsetBoundsOnly: true,\n\t\t\tforceOntoMonitor: \"monitorRect\",\n\t\t};\n\n\t\t/**\n\t\t * See comment in MenuPortal.tsx on why we use showWindow() here instead of childWindow.moveTo()\n\t\t */\n\t\t//this.childWindow.moveTo(left, top);\n\t\t//this.childWindow.resizeTo(this.width, height);\n\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: this.childWindow.window.name }, params);\n\t\tthis.childWindow.document.body.setAttribute(\"resizing\", \"false\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"MenuAutoResizer.js","sourceRoot":"","sources":["../../../src/components/menu/MenuAutoResizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AASpD,MAAM,OAAO,eAAe;IAa3B,YAAY,WAAmB,EAAE,MAAc,EAAE,KAAa,EAAE,YAAoB,QAAQ,EAAE,YAAo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AAI;YACnB,gBAAgB,EAAE,aAAa;SAC/B,CAAC;QAOF,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7F,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACD","sourcesContent":["import { calculateDimensions } from \"./menuHelpers\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\n/**\n * To make sure that MenuPortal.tsx remain small\n * I have isolated the auto resize logic in this class.\n */\nexport class MenuAutoResizer {\n\tprivate width: number;\n\n\tprivate maxHeight: number;\n\n\tprivate childWindow: Window;\n\n\tprivate menuId: string;\n\n\tprivate observer: MutationObserver;\n\n\tprivate minHeight: number;\n\n\tconstructor(childWindow: Window, menuId: string, width: number, maxHeight: number = Infinity, minHeight: number = 0) {\n\t\tthis.width = width;\n\t\tthis.maxHeight = maxHeight;\n\t\tthis.minHeight = minHeight;\n\t\tthis.childWindow = childWindow;\n\t\tthis.menuId = menuId;\n\t\tthis.updateWindowDimensions = this.updateWindowDimensions.bind(this);\n\t\t/* The external window does not have a URL and so its origin\n\t\twill not match the toolbar's origin, in that case\n\t\twe won't have onload, DOMContentLoaded or any other events.\n\t\tThat makes it hard to know when the content are loaded, we cant\n\t\teven inject custom JS as it will be already late.\n\t\tThe only way to know about a DOM change was MutationObserver!\n\t\t*/\n\t\tthis.observer = new MutationObserver(this.updateWindowDimensions);\n\t\t/* Now we watch for any DOM changes in the childWindow\n\t\tKnowing the height of the window contents is crucial for\n\t\tmaking decision about its position (below/above the toolbar).\n\t\t*/\n\t\tthis.observer.observe(this.childWindow.document, {\n\t\t\tchildList: true,\n\t\t\tcharacterData: false,\n\t\t\tsubtree: true,\n\t\t});\n\n\t\t// Initialize the window to the correct height\n\t\tsetTimeout(this.updateWindowDimensions, 0);\n\t}\n\n\tdisconnect() {\n\t\tthis.observer.disconnect();\n\t}\n\n\t/**\n\t * Callback for MutationObserver\n\t */\n\tprivate async updateWindowDimensions() {\n\t\t// If the original menu button has been removed then bypass updating the window dimensions.\n\t\t// Probably the menu itself is in the process of being removed but the mutation observer has\n\t\t// not yet disconnected\n\t\tif (!document.querySelector(`#${this.menuId}-menu-toggle`)) {\n\t\t\treturn;\n\t\t}\n\t\tconst { left, top, height } = await calculateDimensions(\n\t\t\tthis.childWindow,\n\t\t\tthis.menuId,\n\t\t\t0,\n\t\t\tthis.maxHeight,\n\t\t\tthis.minHeight\n\t\t);\n\n\t\tconst params: SpawnParams = {\n\t\t\tmonitor: \"mine\",\n\t\t\tposition: \"absolute\",\n\t\t\tleft: left,\n\t\t\ttop: top,\n\t\t\twidth: this.width,\n\t\t\theight: height,\n\t\t\tsetBoundsOnly: true,\n\t\t\tforceOntoMonitor: \"monitorRect\",\n\t\t};\n\n\t\t/**\n\t\t * See comment in MenuPortal.tsx on why we use showWindow() here instead of childWindow.moveTo()\n\t\t */\n\t\t//this.childWindow.moveTo(left, top);\n\t\t//this.childWindow.resizeTo(this.width, height);\n\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: this.childWindow.window.name }, params);\n\t\tthis.childWindow.document.body.setAttribute(\"resizing\", \"false\");\n\t}\n}\n"]}