@finsemble/finsemble-ui 8.3.0 → 8.4.0-beta.1

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 (526) hide show
  1. package/FEA.d.ts +54 -24
  2. package/FEA.d.ts.map +1 -1
  3. package/FEA.js.map +1 -1
  4. package/clients/Interop/FinsembleDesktopAgent.js +2 -2
  5. package/clients/Interop/FinsembleDesktopAgent.js.map +1 -1
  6. package/clients/Startup/FSBLDesktop.d.ts +2 -8
  7. package/clients/Startup/FSBLDesktop.d.ts.map +1 -1
  8. package/clients/Startup/FSBLDesktop.js +2 -4
  9. package/clients/Startup/FSBLDesktop.js.map +1 -1
  10. package/clients/Startup/unhandledErrors.d.ts.map +1 -1
  11. package/clients/Startup/unhandledErrors.js +6 -4
  12. package/clients/Startup/unhandledErrors.js.map +1 -1
  13. package/clients/Startup/windowStartup.d.ts.map +1 -1
  14. package/clients/Startup/windowStartup.js +77 -116
  15. package/clients/Startup/windowStartup.js.map +1 -1
  16. package/clients/StoreModel.d.ts +8 -8
  17. package/clients/StoreModel.js +8 -8
  18. package/clients/appsClient.d.ts +90 -0
  19. package/clients/appsClient.d.ts.map +1 -0
  20. package/clients/appsClient.js +51 -0
  21. package/clients/appsClient.js.map +1 -0
  22. package/clients/authenticationClient.d.ts +29 -27
  23. package/clients/authenticationClient.d.ts.map +1 -1
  24. package/clients/authenticationClient.js +11 -15
  25. package/clients/authenticationClient.js.map +1 -1
  26. package/clients/configClient.d.ts +134 -70
  27. package/clients/configClient.d.ts.map +1 -1
  28. package/clients/configClient.js +129 -112
  29. package/clients/configClient.js.map +1 -1
  30. package/clients/controller/DialogManagerClientController.d.ts +78 -0
  31. package/clients/controller/DialogManagerClientController.d.ts.map +1 -0
  32. package/clients/controller/DialogManagerClientController.js +213 -0
  33. package/clients/controller/DialogManagerClientController.js.map +1 -0
  34. package/clients/dialogManagerClient.d.ts +1 -75
  35. package/clients/dialogManagerClient.d.ts.map +1 -1
  36. package/clients/dialogManagerClient.js +1 -208
  37. package/clients/dialogManagerClient.js.map +1 -1
  38. package/clients/distributedStoreClient.d.ts +1 -0
  39. package/clients/distributedStoreClient.d.ts.map +1 -1
  40. package/clients/distributedStoreClient.js +1 -0
  41. package/clients/distributedStoreClient.js.map +1 -1
  42. package/clients/hotkeyClient.d.ts +18 -9
  43. package/clients/hotkeyClient.d.ts.map +1 -1
  44. package/clients/hotkeyClient.js +30 -14
  45. package/clients/hotkeyClient.js.map +1 -1
  46. package/clients/index.d.ts +2 -0
  47. package/clients/index.d.ts.map +1 -1
  48. package/clients/index.js +2 -0
  49. package/clients/index.js.map +1 -1
  50. package/clients/launcherClient.d.ts +157 -47
  51. package/clients/launcherClient.d.ts.map +1 -1
  52. package/clients/launcherClient.js +201 -22
  53. package/clients/launcherClient.js.map +1 -1
  54. package/clients/logger.d.ts.map +1 -1
  55. package/clients/logger.js +43 -41
  56. package/clients/logger.js.map +1 -1
  57. package/clients/notificationClient.d.ts +2 -2
  58. package/clients/notificationClient.d.ts.map +1 -1
  59. package/clients/notificationClient.js +2 -2
  60. package/clients/notificationClient.js.map +1 -1
  61. package/clients/routerClient.d.ts +25 -21
  62. package/clients/routerClient.d.ts.map +1 -1
  63. package/clients/routerClient.js +24 -20
  64. package/clients/routerClient.js.map +1 -1
  65. package/clients/searchClient.d.ts +2 -2
  66. package/clients/searchClient.js +2 -2
  67. package/clients/storageClient.d.ts +8 -5
  68. package/clients/storageClient.d.ts.map +1 -1
  69. package/clients/storageClient.js +7 -5
  70. package/clients/storageClient.js.map +1 -1
  71. package/clients/windowClient.d.ts +160 -79
  72. package/clients/windowClient.d.ts.map +1 -1
  73. package/clients/windowClient.js +244 -138
  74. package/clients/windowClient.js.map +1 -1
  75. package/clients/workspaceClient.d.ts +19 -14
  76. package/clients/workspaceClient.d.ts.map +1 -1
  77. package/clients/workspaceClient.js +15 -9
  78. package/clients/workspaceClient.js.map +1 -1
  79. package/common/Desktop.d.ts +9 -50
  80. package/common/Desktop.d.ts.map +1 -1
  81. package/common/Desktop.js +11 -64
  82. package/common/Desktop.js.map +1 -1
  83. package/common/FinsembleWindow.d.ts +4 -107
  84. package/common/FinsembleWindow.d.ts.map +1 -1
  85. package/common/FinsembleWindow.js +21 -342
  86. package/common/FinsembleWindow.js.map +1 -1
  87. package/common/Monitors.d.ts +30 -18
  88. package/common/Monitors.d.ts.map +1 -1
  89. package/common/Monitors.js +45 -80
  90. package/common/Monitors.js.map +1 -1
  91. package/common/Singleton.d.ts +7 -1
  92. package/common/Singleton.d.ts.map +1 -1
  93. package/common/Singleton.js +24 -11
  94. package/common/Singleton.js.map +1 -1
  95. package/common/constants.d.ts +3 -9
  96. package/common/constants.d.ts.map +1 -1
  97. package/common/constants.js +3 -14
  98. package/common/constants.js.map +1 -1
  99. package/common/events/FinsembleEvent.d.ts +1 -1
  100. package/common/events/FinsembleEvent.d.ts.map +1 -1
  101. package/common/redux/getRemoteStore.d.ts +53 -0
  102. package/common/redux/getRemoteStore.d.ts.map +1 -0
  103. package/common/redux/getRemoteStore.js +50 -0
  104. package/common/redux/getRemoteStore.js.map +1 -0
  105. package/common/redux/remoteReduxEnhancer.d.ts +7 -7
  106. package/common/redux/remoteReduxEnhancer.d.ts.map +1 -1
  107. package/common/redux/remoteReduxEnhancer.js +35 -20
  108. package/common/redux/remoteReduxEnhancer.js.map +1 -1
  109. package/common/redux/types.d.ts +14 -1
  110. package/common/redux/types.d.ts.map +1 -1
  111. package/common/systemManagerClient.d.ts +11 -5
  112. package/common/systemManagerClient.d.ts.map +1 -1
  113. package/common/systemManagerClient.js +25 -8
  114. package/common/systemManagerClient.js.map +1 -1
  115. package/common/util.d.ts +1 -7
  116. package/common/util.d.ts.map +1 -1
  117. package/common/util.js +1 -14
  118. package/common/util.js.map +1 -1
  119. package/deprecated/deprecatedFunctions.d.ts +1 -1
  120. package/deprecated/deprecatedFunctions.d.ts.map +1 -1
  121. package/deprecated/deprecatedFunctions.js +1 -2
  122. package/deprecated/deprecatedFunctions.js.map +1 -1
  123. package/deprecated/dragAndDropClient.d.ts +3 -3
  124. package/deprecated/dragAndDropClient.d.ts.map +1 -1
  125. package/deprecated/dragAndDropClient.js.map +1 -1
  126. package/deprecated/linkerClient.d.ts +1 -1
  127. package/deprecated/linkerClient.d.ts.map +1 -1
  128. package/main.d.ts +289 -190
  129. package/main.d.ts.map +1 -1
  130. package/main.js +3 -1
  131. package/main.js.map +1 -1
  132. package/package.json +3 -3
  133. package/platform/services/Interop/types.d.ts +2 -1
  134. package/platform/services/Interop/types.d.ts.map +1 -1
  135. package/platform/services/router/types.d.ts +5 -6
  136. package/platform/services/router/types.d.ts.map +1 -1
  137. package/platform/services/systemManager/_constants.d.ts +1 -0
  138. package/platform/services/systemManager/_constants.d.ts.map +1 -1
  139. package/platform/services/systemManager/_constants.js +1 -0
  140. package/platform/services/systemManager/_constants.js.map +1 -1
  141. package/platform/services/window/modules/actions.d.ts +59 -0
  142. package/platform/services/window/modules/actions.d.ts.map +1 -0
  143. package/platform/services/window/modules/actions.js +57 -0
  144. package/platform/services/window/modules/actions.js.map +1 -0
  145. package/platform/services/window/types.d.ts +257 -50
  146. package/platform/services/window/types.d.ts.map +1 -1
  147. package/platform/services/workspace/types.d.ts +4 -3
  148. package/platform/services/workspace/types.d.ts.map +1 -1
  149. package/react/assets/css/core/icons.css +0 -5
  150. package/react/assets/css/processMonitor.css +9 -4
  151. package/react/assets/css/windowTitleBar.css +98 -285
  152. package/react/assets/icons/chevron-down.svg +1 -0
  153. package/react/assets/icons/chevron-up.svg +1 -0
  154. package/react/components/common/ButtonRow.d.ts.map +1 -1
  155. package/react/components/common/ButtonRow.js +4 -9
  156. package/react/components/common/ButtonRow.js.map +1 -1
  157. package/react/components/common/ContextMenu.d.ts.map +1 -1
  158. package/react/components/common/ContextMenu.js +2 -10
  159. package/react/components/common/ContextMenu.js.map +1 -1
  160. package/react/components/common/DropdownButton.d.ts.map +1 -1
  161. package/react/components/common/DropdownButton.js +11 -24
  162. package/react/components/common/DropdownButton.js.map +1 -1
  163. package/react/components/common/FinsembleIcon.d.ts +1 -1
  164. package/react/components/common/FinsembleIcon.d.ts.map +1 -1
  165. package/react/components/common/FinsembleIcon.js +6 -4
  166. package/react/components/common/FinsembleIcon.js.map +1 -1
  167. package/react/components/common/css/accordion.css +9 -21
  168. package/react/components/common/css/application-edit-page.css +0 -4
  169. package/react/components/common/css/selector.css +3 -1
  170. package/react/components/downloadManager/DownloadManager.d.ts +1 -1
  171. package/react/components/downloadManager/DownloadManager.d.ts.map +1 -1
  172. package/react/components/downloadManager/DownloadManager.js +2 -4
  173. package/react/components/downloadManager/DownloadManager.js.map +1 -1
  174. package/react/components/fdc3Resolver/ResolverContainer.d.ts +6 -0
  175. package/react/components/fdc3Resolver/ResolverContainer.d.ts.map +1 -1
  176. package/react/components/fdc3Resolver/ResolverContainer.js +37 -89
  177. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  178. package/react/components/fdc3Resolver/ResolverDialog.d.ts +10 -1
  179. package/react/components/fdc3Resolver/ResolverDialog.d.ts.map +1 -1
  180. package/react/components/fdc3Resolver/ResolverDialog.js +78 -66
  181. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  182. package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +1 -1
  183. package/react/components/legacyControls/FinsembleDialogTextInput.d.ts.map +1 -1
  184. package/react/components/linker/remoteRedux.d.ts +2 -9
  185. package/react/components/linker/remoteRedux.d.ts.map +1 -1
  186. package/react/components/linker/remoteRedux.js +2 -22
  187. package/react/components/linker/remoteRedux.js.map +1 -1
  188. package/react/components/notifications/css/notification-center.css +2 -0
  189. package/react/components/processMonitor/ProcessMonitor.d.ts.map +1 -1
  190. package/react/components/processMonitor/ProcessMonitor.js +14 -36
  191. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  192. package/react/components/processMonitor/ProcessMonitorTypes.d.ts +0 -4
  193. package/react/components/processMonitor/ProcessMonitorTypes.d.ts.map +1 -1
  194. package/react/components/processMonitor/ProcessMonitorTypes.js +1 -5
  195. package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -1
  196. package/react/components/processMonitor/components/ChildWindow.d.ts +2 -3
  197. package/react/components/processMonitor/components/ChildWindow.d.ts.map +1 -1
  198. package/react/components/processMonitor/components/ChildWindow.js +5 -9
  199. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  200. package/react/components/processMonitor/components/ListHeader.d.ts +1 -5
  201. package/react/components/processMonitor/components/ListHeader.d.ts.map +1 -1
  202. package/react/components/processMonitor/components/ListHeader.js +3 -2
  203. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  204. package/react/components/processMonitor/components/Process.d.ts +10 -0
  205. package/react/components/processMonitor/components/Process.d.ts.map +1 -0
  206. package/react/components/processMonitor/components/Process.js +11 -0
  207. package/react/components/processMonitor/components/Process.js.map +1 -0
  208. package/react/components/processMonitor/components/ProcessStatistics.d.ts +5 -4
  209. package/react/components/processMonitor/components/ProcessStatistics.d.ts.map +1 -1
  210. package/react/components/processMonitor/components/ProcessStatistics.js +10 -7
  211. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  212. package/react/components/processMonitor/constants.d.ts +1 -2
  213. package/react/components/processMonitor/constants.d.ts.map +1 -1
  214. package/react/components/processMonitor/constants.js +2 -8
  215. package/react/components/processMonitor/constants.js.map +1 -1
  216. package/react/components/processMonitor/helpers.d.ts +0 -1
  217. package/react/components/processMonitor/helpers.d.ts.map +1 -1
  218. package/react/components/processMonitor/helpers.js +2 -9
  219. package/react/components/processMonitor/helpers.js.map +1 -1
  220. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +0 -4
  221. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts.map +1 -1
  222. package/react/components/processMonitor/stores/ProcessMonitorStore.js +0 -29
  223. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  224. package/react/components/search/SearchInput.d.ts +1 -2
  225. package/react/components/search/SearchInput.d.ts.map +1 -1
  226. package/react/components/search/SearchInput.js +11 -13
  227. package/react/components/search/SearchInput.js.map +1 -1
  228. package/react/components/shared/openQuitConfirmationDialog.d.ts.map +1 -1
  229. package/react/components/shared/openQuitConfirmationDialog.js +31 -4
  230. package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
  231. package/react/components/singleInputDialog/SingleInputDialog.d.ts.map +1 -1
  232. package/react/components/singleInputDialog/SingleInputDialog.js +81 -100
  233. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  234. package/react/components/toolbar/ToolbarShell.d.ts +1 -0
  235. package/react/components/toolbar/ToolbarShell.d.ts.map +1 -1
  236. package/react/components/toolbar/ToolbarShell.js +3 -2
  237. package/react/components/toolbar/ToolbarShell.js.map +1 -1
  238. package/react/components/utils.d.ts +50 -0
  239. package/react/components/utils.d.ts.map +1 -0
  240. package/react/components/utils.js +60 -0
  241. package/react/components/utils.js.map +1 -0
  242. package/react/components/windowTitleBar/AlwaysOnTopButton.d.ts +9 -0
  243. package/react/components/windowTitleBar/AlwaysOnTopButton.d.ts.map +1 -0
  244. package/react/components/windowTitleBar/AlwaysOnTopButton.js +29 -0
  245. package/react/components/windowTitleBar/AlwaysOnTopButton.js.map +1 -0
  246. package/react/components/windowTitleBar/{components/right/CloseButton.d.ts → CloseButton.d.ts} +0 -0
  247. package/react/components/windowTitleBar/CloseButton.d.ts.map +1 -0
  248. package/react/components/windowTitleBar/CloseButton.js +22 -0
  249. package/react/components/windowTitleBar/CloseButton.js.map +1 -0
  250. package/react/components/windowTitleBar/GroupingButton.d.ts +3 -0
  251. package/react/components/windowTitleBar/GroupingButton.d.ts.map +1 -0
  252. package/react/components/windowTitleBar/GroupingButton.js +25 -0
  253. package/react/components/windowTitleBar/GroupingButton.js.map +1 -0
  254. package/react/components/windowTitleBar/{components/left/LinkerButton.d.ts → LinkerButton.d.ts} +0 -0
  255. package/react/components/windowTitleBar/LinkerButton.d.ts.map +1 -0
  256. package/react/components/windowTitleBar/{components/left/LinkerButton.js → LinkerButton.js} +4 -4
  257. package/react/components/windowTitleBar/LinkerButton.js.map +1 -0
  258. package/react/components/windowTitleBar/LinkerButtonDeprecated.d.ts +11 -0
  259. package/react/components/windowTitleBar/LinkerButtonDeprecated.d.ts.map +1 -0
  260. package/react/components/windowTitleBar/LinkerButtonDeprecated.js +63 -0
  261. package/react/components/windowTitleBar/LinkerButtonDeprecated.js.map +1 -0
  262. package/react/components/windowTitleBar/{components/left/LinkerGroups.d.ts → LinkerGroups.d.ts} +0 -0
  263. package/react/components/windowTitleBar/LinkerGroups.d.ts.map +1 -0
  264. package/react/components/windowTitleBar/{components/left/LinkerGroups.js → LinkerGroups.js} +2 -3
  265. package/react/components/windowTitleBar/LinkerGroups.js.map +1 -0
  266. package/react/components/windowTitleBar/LinkerGroupsDeprecated.d.ts +7 -0
  267. package/react/components/windowTitleBar/LinkerGroupsDeprecated.d.ts.map +1 -0
  268. package/react/components/windowTitleBar/LinkerGroupsDeprecated.js +35 -0
  269. package/react/components/windowTitleBar/LinkerGroupsDeprecated.js.map +1 -0
  270. package/react/components/windowTitleBar/MaximizeButton.d.ts +3 -0
  271. package/react/components/windowTitleBar/MaximizeButton.d.ts.map +1 -0
  272. package/react/components/windowTitleBar/MaximizeButton.js +18 -0
  273. package/react/components/windowTitleBar/MaximizeButton.js.map +1 -0
  274. package/react/components/windowTitleBar/MinimizeButton.d.ts +3 -0
  275. package/react/components/windowTitleBar/MinimizeButton.d.ts.map +1 -0
  276. package/react/components/windowTitleBar/MinimizeButton.js +21 -0
  277. package/react/components/windowTitleBar/MinimizeButton.js.map +1 -0
  278. package/react/components/windowTitleBar/ShareButton.d.ts +3 -0
  279. package/react/components/windowTitleBar/ShareButton.d.ts.map +1 -0
  280. package/react/components/windowTitleBar/ShareButton.js +24 -0
  281. package/react/components/windowTitleBar/ShareButton.js.map +1 -0
  282. package/react/components/windowTitleBar/TabRegion.d.ts +7 -0
  283. package/react/components/windowTitleBar/TabRegion.d.ts.map +1 -0
  284. package/react/components/windowTitleBar/TabRegion.js +453 -0
  285. package/react/components/windowTitleBar/TabRegion.js.map +1 -0
  286. package/react/components/windowTitleBar/TabTitle.d.ts +8 -0
  287. package/react/components/windowTitleBar/TabTitle.d.ts.map +1 -0
  288. package/react/components/windowTitleBar/TabTitle.js +17 -0
  289. package/react/components/windowTitleBar/TabTitle.js.map +1 -0
  290. package/react/components/windowTitleBar/TitleEdit.d.ts +10 -0
  291. package/react/components/windowTitleBar/TitleEdit.d.ts.map +1 -0
  292. package/react/components/windowTitleBar/TitleEdit.js +30 -0
  293. package/react/components/windowTitleBar/TitleEdit.js.map +1 -0
  294. package/react/components/windowTitleBar/WindowTitleBarContext.d.ts +12 -0
  295. package/react/components/windowTitleBar/WindowTitleBarContext.d.ts.map +1 -0
  296. package/react/components/windowTitleBar/WindowTitleBarContext.js +3 -0
  297. package/react/components/windowTitleBar/WindowTitleBarContext.js.map +1 -0
  298. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +14 -272
  299. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts.map +1 -1
  300. package/react/components/windowTitleBar/WindowTitleBarShell.js +41 -929
  301. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  302. package/react/components/windowTitleBar/index.d.ts +9 -8
  303. package/react/components/windowTitleBar/index.d.ts.map +1 -1
  304. package/react/components/windowTitleBar/index.js +9 -8
  305. package/react/components/windowTitleBar/index.js.map +1 -1
  306. package/react/components/windowTitleBar/useKeyboardNavigation.d.ts +7 -0
  307. package/react/components/windowTitleBar/useKeyboardNavigation.d.ts.map +1 -0
  308. package/react/components/windowTitleBar/useKeyboardNavigation.js +57 -0
  309. package/react/components/windowTitleBar/useKeyboardNavigation.js.map +1 -0
  310. package/react/components/windowTitleBar/useMaximize.d.ts +5 -0
  311. package/react/components/windowTitleBar/useMaximize.d.ts.map +1 -0
  312. package/react/components/windowTitleBar/useMaximize.js +23 -0
  313. package/react/components/windowTitleBar/useMaximize.js.map +1 -0
  314. package/react/components/yesNoDialog/timer.js +2 -1
  315. package/react/components/yesNoDialog/timer.js.map +1 -1
  316. package/react/hooks/useDashbar.d.ts.map +1 -1
  317. package/react/hooks/useDashbar.js.map +1 -1
  318. package/react/hooks/useDragRegion.d.ts +27 -0
  319. package/react/hooks/useDragRegion.d.ts.map +1 -0
  320. package/react/hooks/useDragRegion.js +74 -0
  321. package/react/hooks/useDragRegion.js.map +1 -0
  322. package/react/hooks/useInjectedTitleBar.d.ts +3 -0
  323. package/react/hooks/useInjectedTitleBar.d.ts.map +1 -0
  324. package/react/hooks/useInjectedTitleBar.js +365 -0
  325. package/react/hooks/useInjectedTitleBar.js.map +1 -0
  326. package/react/hooks/useNotifications.d.ts +1 -1
  327. package/react/hooks/useToolbar.d.ts +1 -0
  328. package/react/hooks/useToolbar.d.ts.map +1 -1
  329. package/react/hooks/useToolbar.js +13 -3
  330. package/react/hooks/useToolbar.js.map +1 -1
  331. package/typedoc-types.d.ts +9 -0
  332. package/typedoc-types.d.ts.map +1 -0
  333. package/typedoc-types.js +6 -0
  334. package/typedoc-types.js.map +1 -0
  335. package/types.d.ts +5 -11
  336. package/types.d.ts.map +1 -1
  337. package/types.js +2 -0
  338. package/types.js.map +1 -1
  339. package/common/events/PrivateEventManager.d.ts +0 -95
  340. package/common/events/PrivateEventManager.d.ts.map +0 -1
  341. package/common/events/PrivateEventManager.js +0 -295
  342. package/common/events/PrivateEventManager.js.map +0 -1
  343. package/common/events/PrivateFinsembleEvent.d.ts +0 -30
  344. package/common/events/PrivateFinsembleEvent.d.ts.map +0 -1
  345. package/common/events/PrivateFinsembleEvent.js +0 -65
  346. package/common/events/PrivateFinsembleEvent.js.map +0 -1
  347. package/common/redux/createReducer.d.ts +0 -128
  348. package/common/redux/createReducer.d.ts.map +0 -1
  349. package/common/redux/createReducer.js +0 -298
  350. package/common/redux/createReducer.js.map +0 -1
  351. package/common/redux/index.d.ts +0 -3
  352. package/common/redux/index.d.ts.map +0 -1
  353. package/common/redux/index.js +0 -3
  354. package/common/redux/index.js.map +0 -1
  355. package/platform/services/window/Common/Pools/ObjectPool.d.ts +0 -11
  356. package/platform/services/window/Common/Pools/ObjectPool.d.ts.map +0 -1
  357. package/platform/services/window/Common/Pools/ObjectPool.js +0 -43
  358. package/platform/services/window/Common/Pools/ObjectPool.js.map +0 -1
  359. package/platform/services/window/Common/Pools/PoolSingletons.d.ts +0 -10
  360. package/platform/services/window/Common/Pools/PoolSingletons.d.ts.map +0 -1
  361. package/platform/services/window/Common/Pools/PoolSingletons.js +0 -10
  362. package/platform/services/window/Common/Pools/PoolSingletons.js.map +0 -1
  363. package/platform/services/window/Common/Pools/WindowPool.d.ts +0 -7
  364. package/platform/services/window/Common/Pools/WindowPool.d.ts.map +0 -1
  365. package/platform/services/window/Common/Pools/WindowPool.js +0 -16
  366. package/platform/services/window/Common/Pools/WindowPool.js.map +0 -1
  367. package/platform/services/window/Docking/boxMath.d.ts +0 -144
  368. package/platform/services/window/Docking/boxMath.d.ts.map +0 -1
  369. package/platform/services/window/Docking/boxMath.js +0 -511
  370. package/platform/services/window/Docking/boxMath.js.map +0 -1
  371. package/platform/services/window/Docking/constants.d.ts +0 -29
  372. package/platform/services/window/Docking/constants.d.ts.map +0 -1
  373. package/platform/services/window/Docking/constants.js +0 -29
  374. package/platform/services/window/Docking/constants.js.map +0 -1
  375. package/platform/services/window/Docking/dockableBox.d.ts +0 -117
  376. package/platform/services/window/Docking/dockableBox.d.ts.map +0 -1
  377. package/platform/services/window/Docking/dockableBox.js +0 -525
  378. package/platform/services/window/Docking/dockableBox.js.map +0 -1
  379. package/platform/services/window/Docking/dockableGroup.d.ts +0 -252
  380. package/platform/services/window/Docking/dockableGroup.d.ts.map +0 -1
  381. package/platform/services/window/Docking/dockableGroup.js +0 -1054
  382. package/platform/services/window/Docking/dockableGroup.js.map +0 -1
  383. package/platform/services/window/Docking/dockableMonitor.d.ts +0 -99
  384. package/platform/services/window/Docking/dockableMonitor.d.ts.map +0 -1
  385. package/platform/services/window/Docking/dockableMonitor.js +0 -427
  386. package/platform/services/window/Docking/dockableMonitor.js.map +0 -1
  387. package/platform/services/window/Docking/dockableWindow.d.ts +0 -272
  388. package/platform/services/window/Docking/dockableWindow.d.ts.map +0 -1
  389. package/platform/services/window/Docking/dockableWindow.js +0 -1239
  390. package/platform/services/window/Docking/dockableWindow.js.map +0 -1
  391. package/platform/services/window/Docking/dockingCalculator.d.ts +0 -741
  392. package/platform/services/window/Docking/dockingCalculator.d.ts.map +0 -1
  393. package/platform/services/window/Docking/dockingCalculator.js +0 -3438
  394. package/platform/services/window/Docking/dockingCalculator.js.map +0 -1
  395. package/platform/services/window/Docking/dockingMain.d.ts +0 -349
  396. package/platform/services/window/Docking/dockingMain.d.ts.map +0 -1
  397. package/platform/services/window/Docking/dockingMain.js +0 -2541
  398. package/platform/services/window/Docking/dockingMain.js.map +0 -1
  399. package/platform/services/window/Docking/maskBoundsCalculator.d.ts +0 -28
  400. package/platform/services/window/Docking/maskBoundsCalculator.d.ts.map +0 -1
  401. package/platform/services/window/Docking/maskBoundsCalculator.js +0 -67
  402. package/platform/services/window/Docking/maskBoundsCalculator.js.map +0 -1
  403. package/platform/services/window/Docking/monitorUpdateHandler.d.ts +0 -32
  404. package/platform/services/window/Docking/monitorUpdateHandler.d.ts.map +0 -1
  405. package/platform/services/window/Docking/monitorUpdateHandler.js +0 -117
  406. package/platform/services/window/Docking/monitorUpdateHandler.js.map +0 -1
  407. package/platform/services/window/Docking/types.d.ts +0 -334
  408. package/platform/services/window/Docking/types.d.ts.map +0 -1
  409. package/platform/services/window/Docking/types.js +0 -12
  410. package/platform/services/window/Docking/types.js.map +0 -1
  411. package/platform/services/window/MultiWindowFeatures/autoArrange.d.ts +0 -90
  412. package/platform/services/window/MultiWindowFeatures/autoArrange.d.ts.map +0 -1
  413. package/platform/services/window/MultiWindowFeatures/autoArrange.js +0 -510
  414. package/platform/services/window/MultiWindowFeatures/autoArrange.js.map +0 -1
  415. package/platform/services/window/StackedWindowManager/stackedWindowManager.d.ts +0 -411
  416. package/platform/services/window/StackedWindowManager/stackedWindowManager.d.ts.map +0 -1
  417. package/platform/services/window/StackedWindowManager/stackedWindowManager.js +0 -1641
  418. package/platform/services/window/StackedWindowManager/stackedWindowManager.js.map +0 -1
  419. package/platform/services/window/WindowAbstractions/BaseWindow.d.ts +0 -469
  420. package/platform/services/window/WindowAbstractions/BaseWindow.d.ts.map +0 -1
  421. package/platform/services/window/WindowAbstractions/BaseWindow.js +0 -1347
  422. package/platform/services/window/WindowAbstractions/BaseWindow.js.map +0 -1
  423. package/platform/services/window/WindowAbstractions/FinsembleWindowInternal.d.ts +0 -9
  424. package/platform/services/window/WindowAbstractions/FinsembleWindowInternal.d.ts.map +0 -1
  425. package/platform/services/window/WindowAbstractions/FinsembleWindowInternal.js +0 -23
  426. package/platform/services/window/WindowAbstractions/FinsembleWindowInternal.js.map +0 -1
  427. package/platform/services/window/WindowAbstractions/WebWindowWrapper.d.ts +0 -227
  428. package/platform/services/window/WindowAbstractions/WebWindowWrapper.d.ts.map +0 -1
  429. package/platform/services/window/WindowAbstractions/WebWindowWrapper.js +0 -1168
  430. package/platform/services/window/WindowAbstractions/WebWindowWrapper.js.map +0 -1
  431. package/platform/services/window/WindowAbstractions/externalWindowWrapper.d.ts +0 -121
  432. package/platform/services/window/WindowAbstractions/externalWindowWrapper.d.ts.map +0 -1
  433. package/platform/services/window/WindowAbstractions/externalWindowWrapper.js +0 -591
  434. package/platform/services/window/WindowAbstractions/externalWindowWrapper.js.map +0 -1
  435. package/platform/services/window/WindowAbstractions/stackedWindowWrapper.d.ts +0 -194
  436. package/platform/services/window/WindowAbstractions/stackedWindowWrapper.d.ts.map +0 -1
  437. package/platform/services/window/WindowAbstractions/stackedWindowWrapper.js +0 -680
  438. package/platform/services/window/WindowAbstractions/stackedWindowWrapper.js.map +0 -1
  439. package/platform/services/window/windowGroup.d.ts +0 -86
  440. package/platform/services/window/windowGroup.d.ts.map +0 -1
  441. package/platform/services/window/windowGroup.js +0 -323
  442. package/platform/services/window/windowGroup.js.map +0 -1
  443. package/platform/services/workspace/windowStorageManager.d.ts +0 -180
  444. package/platform/services/workspace/windowStorageManager.d.ts.map +0 -1
  445. package/platform/services/workspace/windowStorageManager.js +0 -195
  446. package/platform/services/workspace/windowStorageManager.js.map +0 -1
  447. package/react/assets/icons/question-circle.svg +0 -6
  448. package/react/components/legacyControls/FinsembleHoverDetector.d.ts +0 -23
  449. package/react/components/legacyControls/FinsembleHoverDetector.d.ts.map +0 -1
  450. package/react/components/legacyControls/FinsembleHoverDetector.js +0 -57
  451. package/react/components/legacyControls/FinsembleHoverDetector.js.map +0 -1
  452. package/react/components/sdd/Appearance.helpers.d.ts +0 -2
  453. package/react/components/sdd/Appearance.helpers.d.ts.map +0 -1
  454. package/react/components/sdd/Appearance.helpers.js +0 -2
  455. package/react/components/sdd/Appearance.helpers.js.map +0 -1
  456. package/react/components/shared/linkerUtil.d.ts +0 -4
  457. package/react/components/shared/linkerUtil.d.ts.map +0 -1
  458. package/react/components/shared/linkerUtil.js +0 -10
  459. package/react/components/shared/linkerUtil.js.map +0 -1
  460. package/react/components/windowTitleBar/components/center/Tab.d.ts +0 -31
  461. package/react/components/windowTitleBar/components/center/Tab.d.ts.map +0 -1
  462. package/react/components/windowTitleBar/components/center/Tab.js +0 -58
  463. package/react/components/windowTitleBar/components/center/Tab.js.map +0 -1
  464. package/react/components/windowTitleBar/components/center/TabList.d.ts +0 -138
  465. package/react/components/windowTitleBar/components/center/TabList.d.ts.map +0 -1
  466. package/react/components/windowTitleBar/components/center/TabList.js +0 -614
  467. package/react/components/windowTitleBar/components/center/TabList.js.map +0 -1
  468. package/react/components/windowTitleBar/components/center/TabRegion.d.ts +0 -3
  469. package/react/components/windowTitleBar/components/center/TabRegion.d.ts.map +0 -1
  470. package/react/components/windowTitleBar/components/center/TabRegion.js +0 -13
  471. package/react/components/windowTitleBar/components/center/TabRegion.js.map +0 -1
  472. package/react/components/windowTitleBar/components/left/LinkerButton.d.ts.map +0 -1
  473. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +0 -1
  474. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +0 -85
  475. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts.map +0 -1
  476. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js +0 -172
  477. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +0 -1
  478. package/react/components/windowTitleBar/components/left/LinkerGroups.d.ts.map +0 -1
  479. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +0 -1
  480. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts +0 -50
  481. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts.map +0 -1
  482. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js +0 -120
  483. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +0 -1
  484. package/react/components/windowTitleBar/components/left/ShareButton.d.ts +0 -42
  485. package/react/components/windowTitleBar/components/left/ShareButton.d.ts.map +0 -1
  486. package/react/components/windowTitleBar/components/left/ShareButton.js +0 -82
  487. package/react/components/windowTitleBar/components/left/ShareButton.js.map +0 -1
  488. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.d.ts +0 -3
  489. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.d.ts.map +0 -1
  490. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js +0 -15
  491. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +0 -1
  492. package/react/components/windowTitleBar/components/right/CloseButton.d.ts.map +0 -1
  493. package/react/components/windowTitleBar/components/right/CloseButton.js +0 -16
  494. package/react/components/windowTitleBar/components/right/CloseButton.js.map +0 -1
  495. package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +0 -50
  496. package/react/components/windowTitleBar/components/right/GroupingButton.d.ts.map +0 -1
  497. package/react/components/windowTitleBar/components/right/GroupingButton.js +0 -82
  498. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +0 -1
  499. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +0 -59
  500. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts.map +0 -1
  501. package/react/components/windowTitleBar/components/right/MaximizeButton.js +0 -96
  502. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +0 -1
  503. package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +0 -26
  504. package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts.map +0 -1
  505. package/react/components/windowTitleBar/components/right/MinimizeButton.js +0 -32
  506. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +0 -1
  507. package/react/components/windowTitleBar/components/windowTitle.d.ts +0 -67
  508. package/react/components/windowTitleBar/components/windowTitle.d.ts.map +0 -1
  509. package/react/components/windowTitleBar/components/windowTitle.js +0 -382
  510. package/react/components/windowTitleBar/components/windowTitle.js.map +0 -1
  511. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +0 -69
  512. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts.map +0 -1
  513. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +0 -610
  514. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +0 -1
  515. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.d.ts +0 -44
  516. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.d.ts.map +0 -1
  517. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js +0 -43
  518. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +0 -1
  519. package/react/components/windowTitleBar/windowTitleBarContext.d.ts +0 -23
  520. package/react/components/windowTitleBar/windowTitleBarContext.d.ts.map +0 -1
  521. package/react/components/windowTitleBar/windowTitleBarContext.js +0 -22
  522. package/react/components/windowTitleBar/windowTitleBarContext.js.map +0 -1
  523. package/react/types/windowTitleBar.d.ts +0 -49
  524. package/react/types/windowTitleBar.d.ts.map +0 -1
  525. package/react/types/windowTitleBar.js +0 -2
  526. package/react/types/windowTitleBar.js.map +0 -1
@@ -1,1054 +0,0 @@
1
- import { WindowGroup } from "../windowGroup";
2
- import DockableBox from "./dockableBox";
3
- import { fastClone } from "../../../../common/util";
4
- import { CORNERS, EDGES, OPPOSITE_EDGE_MAP } from "./constants";
5
- import BoxMath from "./boxMath";
6
- import Logger from "../../../../clients/logger";
7
- import { InitializedBoxCoordinates, } from "./types";
8
- import debounce from "lodash/debounce";
9
- const debounceTime = 300;
10
- export class DockableGroup extends WindowGroup {
11
- /**
12
- *
13
- * @param {*} config Config for the group. See WindowGroup for more.
14
- * @param {*} dependencies Dependency object that provides a Logger.
15
- */
16
- constructor(config) {
17
- super(config);
18
- this.setBuffer = DockableBox.prototype.setBuffer;
19
- this.getEdges = DockableBox.prototype.getEdges;
20
- this.getCornerObject = DockableBox.prototype.getCornerObject;
21
- this.sharesAnEdgeWith = DockableBox.prototype.sharesAnEdgeWith;
22
- this.getSharedEdges = DockableBox.prototype.getSharedEdges;
23
- this.willReform = false;
24
- this.ungroupedAlwaysOnTopState = {};
25
- this.windowBoundingBox = {
26
- min: {
27
- x: 0,
28
- y: 0,
29
- },
30
- max: {
31
- x: 0,
32
- y: 0,
33
- },
34
- };
35
- // Number of time's we've tried to fill a particular time. It's limited to 20 attempts to prevent infinite loops. Logs are emitted if we get into that state. Better to throw a warning than an infinite loop.
36
- this.fillAttempts = 0;
37
- this.dockableBox = new DockableBox();
38
- this.deferredWindowMoves = [];
39
- this.windows = [];
40
- this.isAlwaysOnTop = false;
41
- this.left = 0;
42
- this.right = 0;
43
- this.bottom = 0;
44
- this.top = 0;
45
- this.width = 0;
46
- this.height = 0;
47
- this.MINIMUM_WINDOW_WIDTH = 0;
48
- this.MINIMUM_WINDOW_HEIGHT = 0;
49
- this.vertices = {};
50
- this.setMinimums(config);
51
- this.name = config.name;
52
- this.isMovable = typeof config.isMovable !== "undefined" ? config.isMovable : false;
53
- /** A mapping from window names to their previous alwaysOnTop state.
54
- * Allows us to set window back to the way they were when they leave
55
- * the group.
56
- */
57
- this.ungroupedAlwaysOnTopState = config.ungroupedAlwaysOnTopState || {};
58
- //this.inheritDockableBox();
59
- this.removeWindow = this.removeWindow.bind(this);
60
- this.handleAlwaysOnTopChange = this.handleAlwaysOnTopChange.bind(this);
61
- // Will wait 300 ms after every request before moving the group. This gives time for events to arrive from the other windows in the group
62
- // The function will only be called after this amount of time has passed with no requests.
63
- // Since the OS doesn't care if a group stays together, we need to move the group after the OS is finished moving all windows
64
- this.performDeferredSystemMove = debounce(this.performDeferredSystemMove.bind(this), debounceTime);
65
- }
66
- pointIsOnBoundingBox(point, includeCorners = true) {
67
- return this.dockableBox.pointIsOnBoundingBox.call(this, point, includeCorners);
68
- }
69
- /**
70
- * Fired when the alwaysOnTop of a window in the group changes.
71
- * Sets all windows in the group to the new value.
72
- */
73
- handleAlwaysOnTopChange({ data: { alwaysOnTop } }) {
74
- for (const groupWin of Object.values(this.windows)) {
75
- const currentAlwaysOnTop = groupWin.isAlwaysOnTop();
76
- if (currentAlwaysOnTop != alwaysOnTop)
77
- groupWin.alwaysOnTop(alwaysOnTop);
78
- }
79
- }
80
- /**
81
- * Returns the JSON representation of the group (stored on the workspace).
82
- */
83
- getJSON() {
84
- const windowNames = this.getWindowNames();
85
- const topRightWindow = windowNames.length ? this.getMoveAnchor("BottomLeft").name : null;
86
- return {
87
- windowNames,
88
- isMovable: this.isMovable,
89
- isAlwaysOnTop: this.isAlwaysOnTop,
90
- topRightWindow: topRightWindow !== null && topRightWindow !== void 0 ? topRightWindow : "undefined",
91
- isARectangle: this.isARectangle(),
92
- ungroupedAlwaysOnTopState: this.ungroupedAlwaysOnTopState,
93
- };
94
- }
95
- /**
96
- * Responds to system events when the OS has moved a group. Every time a window in this group triggers this function a shared array will
97
- * be updated with that window and it's bounds. After each update, request the group move.
98
- * If this function is triggered again within a certain time, the group move will continue to be delayed until enough time passes without
99
- * any windows events. Ideally the group will only move when all windows in the group with changes have responded to events.
100
- * @param {*} windowObject - Contains the window name and it's updated bounds
101
- * @param {*} calculator - an instance of docking calculator
102
- */
103
- deferSystemMove(windowObject, calculator) {
104
- this.deferredWindowMoves.push(windowObject);
105
- this.performDeferredSystemMove(calculator, this.deferredWindowMoves);
106
- }
107
- /**
108
- * Requests the group move. Uses an array of windows in the group and their bounds to choose which window's bounds to use for the group move.
109
- * Intended to move a group after the monitor configuration has changed as the OS may not keep the group intact when it is moved.
110
- *
111
- * @param {*} calculator
112
- * @param {*} deferredWindowMoves array of windowobjects to be used for the move.
113
- */
114
- performDeferredSystemMove(calculator, deferredWindowMoves) {
115
- Logger.system.verbose("dockableGroup.performDeferredSystemMove: Windows in group with bounds updates", deferredWindowMoves);
116
- let bounds;
117
- const anchors = [
118
- this.getMoveAnchor("BottomRight"),
119
- this.getMoveAnchor("BottomLeft"),
120
- this.getMoveAnchor("TopRight"),
121
- this.getMoveAnchor("TopLeft"),
122
- ];
123
- // Choose one window to be the move anchor. To make sure the group stays intact the updated bounds of only one window
124
- // is used when moving the group, the rest of the group will be moved to relative to this "move anchor".
125
- // That window needs to be in one of the corner positions of the group.
126
- for (let i = 0; i < anchors.length; i++) {
127
- // Always pick the maximized window as the move anchor if possible to keep it from restoring.
128
- let windowObject = deferredWindowMoves.find((win) => win.isMaximized === true && win.name === anchors[i].name);
129
- if (!windowObject) {
130
- windowObject = deferredWindowMoves.find((win) => win.name === anchors[i].name);
131
- }
132
- if (windowObject) {
133
- ({ bounds } = windowObject);
134
- bounds.anchor = anchors[i];
135
- bounds.systemMoved = true;
136
- break;
137
- }
138
- }
139
- // Reset the shared array of window moves for this group.
140
- // This function will either be passed this object or another locally constructed object.
141
- // Either way we want to empty this array so window bounds are only for the current event.
142
- this.deferredWindowMoves = [];
143
- if (!bounds) {
144
- Logger.system.debug("dockableGroup.performDeferredSystemMove: no window was found that matched a move anchor, returning without moving a group");
145
- return;
146
- }
147
- // When a group straddles a monitor the OS will move the overlapping windows fully onto one monitor.
148
- // This causes the group to break because we don't allow grouping on monitor edge.
149
- // In some cases, the move anchor will be unchanged, even though other windows in the group have moved.
150
- // This just means the old bounds of the move anchor are still valid.
151
- // By shifting the bounds by one pixel, we insure that the move request is processed, and the group will
152
- // be fully attached.
153
- Object.keys(bounds).forEach((key) => {
154
- if (["right", "left", "top", "bottom"].includes(key))
155
- bounds[key]++;
156
- });
157
- this.moveTo(bounds);
158
- calculator.eliminateGaps();
159
- }
160
- /*inheritDockableBox() {
161
- const self = this;
162
- const dockableBoxMethods = Object.getOwnPropertyNames(Object.getPrototypeOf(this.dockableBox)).filter((p) => {
163
- if (p != "constructor") {
164
- return typeof self.dockableBox[p] === "function";
165
- }
166
- return false;
167
- });
168
- for (let i = 0; i < dockableBoxMethods.length; i++) {
169
- const methodName = dockableBoxMethods[i];
170
- if (!this[methodName]) {
171
- this[methodName] = function () {
172
- return self.dockableBox[methodName].call(self, ...arguments);
173
- };
174
- }
175
- }
176
- }*/
177
- addWindow(win) {
178
- if (Object.keys(this.windows).length === 0) {
179
- this.windowBoundingBox = fastClone(win.windowBoundingBox);
180
- }
181
- if (this.isMovable) {
182
- win.win._updateOptions({ taskbarIconGroup: this.name });
183
- }
184
- super.addWindows(win);
185
- this.updateBounds();
186
- if (this.isMovable)
187
- this.bringToFront({ restoreWindows: false });
188
- // alwaysOnTop setup
189
- if (this.isMovable) {
190
- win.win.addEventListener("alwaysOnTop", this.handleAlwaysOnTopChange);
191
- const winIsAlwaysOnTop = win.isAlwaysOnTop();
192
- // Keep a record of the windows prev alwaysOnTop state
193
- // In the case of reloading a workspace, the names will already be there,
194
- // and we don't want to clobber the old state.
195
- if (!(win.name in this.ungroupedAlwaysOnTopState)) {
196
- this.ungroupedAlwaysOnTopState[win.name] = winIsAlwaysOnTop;
197
- }
198
- // If, after adding this window, any of the windows in the group are alwaysOnTop
199
- // then all of the windows need to be alwaysOnTop.
200
- const anyWindowsAlwaysOnTop = Object.values(this.windows).some((groupWin) => groupWin.isAlwaysOnTop());
201
- if (anyWindowsAlwaysOnTop) {
202
- if (winIsAlwaysOnTop) {
203
- // If this window is already on top, we still need to check the other windows.
204
- this.handleAlwaysOnTopChange({ data: { alwaysOnTop: true } });
205
- }
206
- else {
207
- // Otherwise, we need to set this window to always on top.
208
- win.alwaysOnTop(true);
209
- }
210
- }
211
- }
212
- }
213
- updateBounds() {
214
- const groupBounds = this.calculateOuterBounds();
215
- if (!groupBounds) {
216
- return;
217
- }
218
- this.windowBoundingBox = groupBounds;
219
- this.setBuffer();
220
- this.setBounds({
221
- left: groupBounds.min.x,
222
- top: groupBounds.min.y,
223
- right: groupBounds.max.x,
224
- bottom: groupBounds.max.y,
225
- });
226
- }
227
- saveIndividualWindowStates() {
228
- const windowList = this.getWindows();
229
- for (const windowName in windowList) {
230
- const win = this.getDockableWindow(windowName);
231
- if (win)
232
- win.win.saveCompleteWindowState();
233
- }
234
- }
235
- startMove() {
236
- const windowList = this.getWindows();
237
- for (const windowName in windowList) {
238
- const win = this.getDockableWindow(windowName);
239
- if (win)
240
- win.win.startMove();
241
- }
242
- }
243
- stopMove() {
244
- const windowList = this.getWindows();
245
- for (const windowName in windowList) {
246
- const win = this.getDockableWindow(windowName);
247
- win === null || win === void 0 ? void 0 : win.win.stopMove();
248
- }
249
- }
250
- getWindowsOnEdges() {
251
- const windowsOnSegment = {};
252
- const windowList = this.getWindows();
253
- for (const windowName in windowList) {
254
- const win = this.getDockableWindow(windowName);
255
- if (win) {
256
- for (let i = 0; i < EDGES.length; i++) {
257
- const edge = EDGES[i];
258
- if (win[edge] === this[edge]) {
259
- windowsOnSegment[win.name] = win;
260
- }
261
- }
262
- }
263
- }
264
- return windowsOnSegment;
265
- }
266
- isARectangle() {
267
- this.updateBounds();
268
- const windows = this.getWindows();
269
- const groupArea = this.width * this.height;
270
- let windowArea = 0;
271
- for (const windowName in windows) {
272
- const win = this.getDockableWindow(windowName);
273
- if (win)
274
- windowArea = windowArea + win.width * win.height;
275
- }
276
- return groupArea === windowArea;
277
- }
278
- /**
279
- * When you move a group of windows left to right, the anchor algorithm finds the left-most window, and then sorts all of the windows on how close they are to that window. This function just finds the appropriate anchor for that move.
280
- * @param {*} movingDirection
281
- */
282
- getMoveAnchor(movingDirection) {
283
- const DIMENSIONAL_MAP = {
284
- LeftTop: {
285
- primaryDimension: "bottom",
286
- secondaryDimension: "right",
287
- },
288
- LeftBottom: {
289
- primaryDimension: "top",
290
- secondaryDimension: "right",
291
- },
292
- TopLeft: {
293
- primaryDimension: "right",
294
- secondaryDimension: "bottom",
295
- },
296
- BottomLeft: {
297
- primaryDimension: "right",
298
- secondaryDimension: "top",
299
- },
300
- RightTop: {
301
- primaryDimension: "bottom",
302
- secondaryDimension: "left",
303
- },
304
- RightBottom: {
305
- primaryDimension: "top",
306
- secondaryDimension: "left",
307
- },
308
- TopRight: {
309
- primaryDimension: "left",
310
- secondaryDimension: "bottom",
311
- },
312
- BottomRight: {
313
- primaryDimension: "left",
314
- secondaryDimension: "top",
315
- },
316
- Right: {
317
- primaryDimension: "left",
318
- secondaryDimension: "top",
319
- },
320
- Left: {
321
- primaryDimension: "right",
322
- secondaryDimension: "top",
323
- },
324
- Top: {
325
- primaryDimension: "top",
326
- secondaryDimension: "left",
327
- },
328
- Bottom: {
329
- primaryDimension: "bottom",
330
- secondaryDimension: "left",
331
- },
332
- };
333
- // Had this happen but not reliably. Possible that it fires when the window isn't moving at all and the direction isn't set. Stopgap.
334
- if (!DIMENSIONAL_MAP[movingDirection]) {
335
- console.error(`"${movingDirection}" is not a valid argument. Valid options are ${Object.keys(DIMENSIONAL_MAP).join(", ")}.`);
336
- // return "NotMoving";
337
- }
338
- const { primaryDimension, secondaryDimension } = DIMENSIONAL_MAP[movingDirection];
339
- const windowArray = this.getWindowArray();
340
- // Sorts on the primary dimension; if they're tied, it sorts on the secondary dimension.
341
- return windowArray.sort((a, b) => {
342
- let aDim = a[primaryDimension];
343
- let bDim = b[primaryDimension];
344
- let comparingDimension = primaryDimension;
345
- if (aDim === bDim) {
346
- aDim = a[secondaryDimension];
347
- bDim = b[secondaryDimension];
348
- comparingDimension = secondaryDimension;
349
- }
350
- if (comparingDimension === "top" || comparingDimension === "left") {
351
- // Will order the array in ascending order.
352
- // In our virtual screen, the top-left is the 0,0 point (though it could be (-2000, 2000), or whatever).
353
- // The higher the top or left, the further to the right the window is. The higher the top number, the closer to the bottom of the screen the window is.
354
- return aDim - bDim;
355
- }
356
- // sort the array in descending order.
357
- // The higher the right value, the closer the window is to the right of the screen. The higher the bottom number, the closer it is to the toolbar/top of the monitor.
358
- return bDim - aDim;
359
- })[0];
360
- }
361
- /**
362
- * Used for resize. Grabs the windows on the opposite side of the resize handle.
363
- * @function {function name}
364
- * @param {type} handle {description}
365
- * @return {type} {description}
366
- */
367
- getAnchors(handle) {
368
- const edges = {
369
- top: "bottom",
370
- right: "left",
371
- bottom: "top",
372
- left: "right",
373
- };
374
- const edgeArray = handle.split(/(?=[A-Z])/).map((s) => s.toLowerCase());
375
- const anchorNames = [];
376
- const self = this;
377
- for (const windowName in this.windows) {
378
- if (anchorNames.includes(windowName)) {
379
- continue;
380
- }
381
- const win = this.windows[windowName];
382
- let isAnchor = true;
383
- edgeArray.forEach((requestedEdge) => {
384
- const edge = edges[requestedEdge];
385
- if (win[edge] !== self[edge]) {
386
- isAnchor = false;
387
- }
388
- });
389
- if (isAnchor) {
390
- anchorNames.push(windowName);
391
- }
392
- }
393
- return anchorNames;
394
- }
395
- /**
396
- * @function {function name}
397
- * @return {type} {description}
398
- */
399
- calculateOuterBounds() {
400
- let groupBounds = null;
401
- for (const windowName in this.windows) {
402
- const win = this.windows[windowName];
403
- // sometimes we get into a state where right and bottom are not set so groups break rectangularity.
404
- if (!win.right)
405
- win.right = win.left + win.width;
406
- if (!win.bottom)
407
- win.bottom = win.top + win.height;
408
- if (!groupBounds) {
409
- groupBounds = {
410
- min: {
411
- x: win.left,
412
- y: win.top,
413
- },
414
- max: {
415
- x: win.right,
416
- y: win.bottom,
417
- },
418
- };
419
- continue;
420
- }
421
- // Did some testing and this is much faster than ternary operators.
422
- if (win.left < groupBounds.min.x) {
423
- groupBounds.min.x = win.left;
424
- }
425
- if (win.top < groupBounds.min.y) {
426
- groupBounds.min.y = win.top;
427
- }
428
- if (win.bottom > groupBounds.max.y) {
429
- groupBounds.max.y = win.bottom;
430
- }
431
- if (win.right > groupBounds.max.x) {
432
- groupBounds.max.x = win.right;
433
- }
434
- }
435
- return groupBounds;
436
- }
437
- /**
438
- * @function {function name}
439
- * @param {type} name {description}
440
- * @return {type} {description}
441
- */
442
- removeWindow(name, updateAOT = true) {
443
- const win = this.getDockableWindow(name);
444
- if (win && this.isMovable) {
445
- win.win._updateOptions({
446
- taskbarIconGroup: win.win.uuid,
447
- });
448
- // Clean up alwaysOnTop state
449
- // remove the listener
450
- // Set the window's alwaysOnTop back to its previous state.
451
- win.win.removeEventListener("alwaysOnTop", this.handleAlwaysOnTopChange);
452
- if (updateAOT) {
453
- win.alwaysOnTop(this.ungroupedAlwaysOnTopState[win.name]);
454
- }
455
- // On workspace reload, the window will be removed then added back.
456
- // We want the ungroupedAlwaysOnTopState to stick around in that case,
457
- // so we don't delete it from the object on remove. Window names are unique
458
- // so there's no risk of collision.
459
- }
460
- super.removeWindows(name);
461
- this.updateBounds();
462
- }
463
- /**
464
- * @function {function name}
465
- * @param {type} bounds {description}
466
- * @return {type} {description}
467
- */
468
- getDelta(bounds) {
469
- return {
470
- left: bounds.left - this.left,
471
- right: bounds.right - this.right,
472
- height: (bounds.height || 0) - this.height,
473
- width: (bounds.width || 0) - this.width,
474
- };
475
- }
476
- /**
477
- * @function {function name}
478
- * @param {type} bounds {description}
479
- * @return {type} {description}
480
- */
481
- setBounds(bounds) {
482
- this.left = bounds.left;
483
- this.right = bounds.right;
484
- this.bottom = bounds.bottom || 0;
485
- this.top = bounds.top || 0;
486
- this.width = bounds.right - bounds.left;
487
- this.height = this.bottom - this.top;
488
- this.vertices = this.getCornerObject(bounds);
489
- }
490
- getBounds() {
491
- return {
492
- left: this.left,
493
- right: this.right,
494
- bottom: this.bottom,
495
- top: this.top,
496
- width: this.width,
497
- height: this.height,
498
- vertices: this.vertices,
499
- };
500
- }
501
- /**
502
- *
503
- * @param {bounds} newBounds Bounds to scale the group to
504
- * @param {string} anchor
505
- * @param {DockingCalculator} calculator
506
- * @param {function} cb
507
- */
508
- scale(newBounds, anchor, calculator) {
509
- // If you go bananas and try to make the group have negative height or width, many problems arise. Check to make sure the bounds aren't negative or too tiny.
510
- newBounds = calculator.checkShortCircuits(newBounds, this);
511
- const windowList = this.getWindowArray().map((win) => {
512
- return Object.assign(Object.assign({}, win.getBounds()), { name: win.name, limits: Object.assign({
513
- minWidth: this.MINIMUM_WINDOW_WIDTH,
514
- minHeight: this.MINIMUM_WINDOW_HEIGHT,
515
- maxWidth: Infinity,
516
- maxHeight: Infinity,
517
- }, win.limits) });
518
- });
519
- const scaleDescriptor = DockableGroup.getScaleDescriptor(this.getBounds(), newBounds);
520
- // /eventually Fix this. Right now it'll just go to the top left.
521
- const corners = JSON.parse(JSON.stringify(this.vertices));
522
- for (const corner in corners) {
523
- corners[corner.toLowerCase()] = corners[corner];
524
- }
525
- let anchorPoint = { top: 0, left: 0, right: 0, bottom: 0 };
526
- // The "Anchor" Is where the group is offset by. It's a point. Top/left is a misnomer. After scaling, each window will be shifted by deltaX and deltaY, where the delta is the distance between that window's top left and the anchor's point.
527
- if (EDGES.includes(anchor)) {
528
- anchorPoint.top = newBounds.top || 0;
529
- anchorPoint.left = newBounds.left;
530
- switch (anchor) {
531
- case "left":
532
- // When resizing from the left, we want to make sure the right edge of the group doesn't move.
533
- anchorPoint.left = newBounds.right;
534
- break;
535
- case "top":
536
- // When resizing from the top, we want to make sure the bottom edge of the group doesn't move.
537
- anchorPoint.top = newBounds.bottom || 0;
538
- break;
539
- default:
540
- break;
541
- }
542
- }
543
- else if (CORNERS.includes(anchor)) {
544
- // Get the opposite corner; that's the anchor.
545
- // e.g., when resizing from the top right, the bottom left shouldn't move at all.
546
- const corner = corners[OPPOSITE_EDGE_MAP[anchor]];
547
- anchorPoint = {
548
- top: corner.y,
549
- left: corner.x,
550
- right: 0,
551
- bottom: 0,
552
- };
553
- }
554
- // Pass in the list of windows and how we much we want to scale it. This returns a list of mutated window bounds objects.
555
- const scaledWindowList = DockableGroup.getScaledWindowList({
556
- windowList,
557
- scaleDescriptor,
558
- anchor: anchorPoint,
559
- });
560
- // Actually move the windows.
561
- scaledWindowList.forEach((scaledBounds) => {
562
- calculator.moveWindow(scaledBounds);
563
- });
564
- const windowBounds = {};
565
- this.getWindowArray().forEach((win) => (windowBounds[win.name] = win.getBounds()));
566
- /**
567
- * 8/13/19 JC: Added true to the end to set 'triggerByAutoArrange', this will tell the calculator to move the group and to save the bounds
568
- */
569
- calculator.cleanupSharedEdges(this, windowBounds, true);
570
- this.updateBounds();
571
- }
572
- /**
573
- * Sets the minimum height and width for windows. This is used when scaling windows. It prevents us from creating very tiny windows when scaling an entire group.
574
- * @param {object} cfg
575
- * @param {number} cfg.MINIMUM_HEIGHT Minimum height a window can scale to.
576
- * @param {number} cfg.MINIMUM_WIDTH Minimum width a window can scale to.
577
- */
578
- setMinimums(cfg) {
579
- if (cfg) {
580
- this.MINIMUM_WINDOW_HEIGHT = cfg.MINIMUM_HEIGHT;
581
- this.MINIMUM_WINDOW_WIDTH = cfg.MINIMUM_WIDTH;
582
- }
583
- }
584
- /**
585
- * Returns an array of windows that have an edge on a given line segment.
586
- * @param {object} segment
587
- * @param {object} segment.min minimum point for the line segment.
588
- * @param {number} segment.min.x X coordinate for the minimum point for the line segment.
589
- * @param {number} segment.min.y y coordinate for the minimum point for the line segment.
590
- * @param {object} segment.min maximum point for the line segment.
591
- * @param {number} segment.max.x X coordinate for the maximum point for the line segment.
592
- * @param {number} segment.max.y y coordinate for the maximum point for the line segment.
593
- * @returns {array} windowsOnSegment Array of dockable windows that have an edge on the line segment.
594
- */
595
- getWindowBoxesOnSegment(segment) {
596
- const windowsOnSegment = [];
597
- const winPool = this.getWindowNames();
598
- const points = [segment.min, segment.max];
599
- for (let i = 0; i < winPool.length; i++) {
600
- const win = this.getDockableWindow(winPool[i]);
601
- if (win) {
602
- for (let p = 0, len = points.length; p < len; p++) {
603
- const point = points[p];
604
- if (win.pointIsOnBoundingBox(point)) {
605
- const snapObj = {
606
- name: win.name,
607
- edge: win.getEdgeByPoint(point),
608
- segment: win.getEdges("obj")[win.getEdgeByPoint(point)],
609
- win,
610
- };
611
- windowsOnSegment.push(snapObj);
612
- break;
613
- }
614
- }
615
- }
616
- }
617
- return windowsOnSegment;
618
- }
619
- /**
620
- * Not sure why this function doesn't use the one above. Similar functionality, but you can pass in a string instead of a line segment.
621
- * @param {dockableWindow} win
622
- * @param {string} edge E.g., 'left', 'right', etc.
623
- * @return {array}
624
- */
625
- getWindowsOnEdge(win, edge, includeCorners) {
626
- if (includeCorners === undefined) {
627
- includeCorners = false;
628
- }
629
- const windowsOnEdge = [];
630
- if (!edge) {
631
- return [];
632
- }
633
- const oppEdge = OPPOSITE_EDGE_MAP[edge];
634
- const windowSegment = win.getEdges("obj", includeCorners)[edge];
635
- for (const windowName in this.windows) {
636
- const possibleSnapper = this.windows[windowName];
637
- if (possibleSnapper.name === win.name) {
638
- continue;
639
- }
640
- const segment = possibleSnapper.getEdges("obj", includeCorners)[oppEdge];
641
- let shouldPush = false;
642
- let points = [
643
- {
644
- name: possibleSnapper.name,
645
- val: segment.min,
646
- },
647
- {
648
- name: possibleSnapper.name,
649
- val: segment.max,
650
- },
651
- {
652
- name: win.name,
653
- val: windowSegment.min,
654
- },
655
- {
656
- name: win.name,
657
- val: windowSegment.max,
658
- },
659
- ];
660
- if (["top", "bottom"].includes(edge)) {
661
- if (segment.min.y !== windowSegment.min.y) {
662
- continue;
663
- }
664
- points = points.sort((a, b) => b.val.x - a.val.x);
665
- }
666
- if (["left", "right"].includes(edge)) {
667
- if (segment.min.x !== windowSegment.min.x) {
668
- continue;
669
- }
670
- points = points.sort((a, b) => b.val.y - a.val.y);
671
- }
672
- if (points[0].name !== points[1].name) {
673
- shouldPush = true;
674
- }
675
- if (shouldPush) {
676
- const snapObj = {
677
- name: possibleSnapper.name,
678
- edge: oppEdge,
679
- win: possibleSnapper,
680
- };
681
- windowsOnEdge.push(snapObj);
682
- }
683
- }
684
- return windowsOnEdge;
685
- }
686
- scaleRemainingWindows(win, myHole) {
687
- const bounds = InitializedBoxCoordinates;
688
- // calculates the bounds of the group prior to the hole being created.
689
- bounds.left = Math.min(myHole.left, this.left);
690
- bounds.right = Math.max(myHole.right, this.right);
691
- bounds.top = Math.min(myHole.top, this.top);
692
- bounds.bottom = Math.max(myHole.bottom, this.bottom);
693
- bounds.height = bounds.bottom - bounds.top;
694
- bounds.width = bounds.right - bounds.left;
695
- let edge = null;
696
- // These are opposite. When the window leaves the group, the bounds are updated. So here, we compare the edge of the window that left to the group. If it was on the left side of the group - the right side of that window will be butted up against the left side of the group after it leaves.
697
- if (myHole.width === this.width) {
698
- if (myHole.top === this.bottom)
699
- edge = "bottom";
700
- if (myHole.bottom === this.top)
701
- edge = "top";
702
- }
703
- if (myHole.height === this.height) {
704
- if (myHole.left === this.right)
705
- edge = "right";
706
- if (myHole.right === this.left)
707
- edge = "left";
708
- }
709
- if (!edge) {
710
- Logger.system.error("No edge found in DockableGroup.fillHole()");
711
- return;
712
- }
713
- this.scale(bounds, edge, win.calculator);
714
- }
715
- /**
716
- * Given a hole, this function recursively fills the hole, expanding 1 window at a time - until the hole is filled.
717
- * @param {object} hole
718
- * @param {*} cb
719
- */
720
- async fillHole(hole) {
721
- this.fillAttempts++;
722
- const myHole = new DockableBox(hole);
723
- // First, we need to see which windows in this group border our hole.
724
- // Get the edges in array format, don't include corners in the calculations.
725
- const edges = myHole.getEdges("arr", false);
726
- let edgesOfEdges = edges.map((edge) => this.getWindowBoxesOnSegment(edge));
727
- // flatten the array.
728
- let candidates = edgesOfEdges
729
- .flatMap((boxes) => boxes)
730
- .map((box) => {
731
- return Object.assign(Object.assign({}, box), { impactedWindows: 0 });
732
- });
733
- // If we have no windows bordering the hole, there's nothing we can do.
734
- if (!candidates.length)
735
- return;
736
- // We need some of the methods on the docking calculator. This isn't an ideal way to do things. Would be nice if there was some kind of bridge that could allow move requests without needing the calculator.
737
- const win = this.getDockableWindow(candidates[0].name);
738
- if (!win)
739
- return;
740
- // Bounding box is needed for `sharesAnEdgeWith`.
741
- myHole.windowBoundingBox = BoxMath.getWindowBoundingBox(myHole);
742
- // If the hole takes up the whole width or whole height of the group, we should scale the remaining windows to fill the hole.
743
- if ((myHole.width === this.width || myHole.height === this.height) && this.sharesAnEdgeWith(myHole)) {
744
- this.scaleRemainingWindows(win, myHole);
745
- return;
746
- }
747
- // Once we know that we aren't going to have to scale all of the windows, we get here.
748
- // The goal is to do the least amount of damage possible. So if there are 4 windows that border the hole, we will choose the one that will cascade into the fewest windows. If they all impact no other windows, we just choose the first.
749
- const potentialImpact = [];
750
- for (let i = 0; i < candidates.length; i++) {
751
- let candidate = candidates[i];
752
- const win2 = this.getDockableWindow(candidate.name);
753
- const { edge } = candidate;
754
- // These are the windows that would be affected if we resized the candidate window.
755
- if (win2 && typeof edge === "string") {
756
- const impactedWindows = this.getWindowsOnEdge(win2, edge, false);
757
- candidate.impactedWindows = impactedWindows.length;
758
- candidate.win = win2;
759
- potentialImpact.push(candidate);
760
- }
761
- }
762
- // Goes through and gets the window whose resize would trigger a resize on the fewest windows possible.
763
- let leastImpactfulChange = potentialImpact.reduce((p, v) => (p.impactedWindows < v.impactedWindows ? p : v));
764
- if (!leastImpactfulChange.win)
765
- return;
766
- // Which edge we're resizing.
767
- let impactedEdge = leastImpactfulChange.edge;
768
- // Clone so we don't impact the original windows. Calculate the bounds for our window. We'll use this window if none of the other candidates are better matches.
769
- const oldBounds = leastImpactfulChange.win.getBounds();
770
- let newBounds = Object.assign(Object.assign({}, oldBounds), { [impactedEdge]: myHole[impactedEdge], height: oldBounds.bottom - oldBounds.top, width: oldBounds.right - oldBounds.left, changeType: 1, resizeHandle: impactedEdge, forceResizeHandle: true });
771
- // We'll use this later.
772
- const holeArea = (hole.width || 0) * (hole.height || 0);
773
- let leastImpactfulArea = newBounds.width * newBounds.height;
774
- for (let i = 0; i < candidates.length; i++) {
775
- const candidate = candidates[i];
776
- const proposedImpactedEdge = candidate.edge;
777
- const candidateBounds = candidate.win.getBounds();
778
- const proposedBounds = Object.assign(Object.assign({}, candidateBounds), { [proposedImpactedEdge]: myHole[proposedImpactedEdge], height: candidateBounds.bottom - candidateBounds.top, width: candidateBounds.right - candidateBounds.left });
779
- const candidateArea = proposedBounds.height * proposedBounds.width;
780
- // If the candidateArea is less than the holeArea, larger than the currently chosen window, and resizing it would cause no more damage than the currently chosen window, it becomes the window to resize.
781
- const smallerThanHole = candidateArea - holeArea > 0;
782
- const largerThanCurrentWindow = candidateArea > leastImpactfulArea;
783
- const fewerImpactedWindows = candidate.impactedWindows <= leastImpactfulChange.impactedWindows;
784
- if (smallerThanHole && largerThanCurrentWindow && fewerImpactedWindows) {
785
- leastImpactfulChange = candidate;
786
- leastImpactfulArea = candidateArea;
787
- impactedEdge = proposedImpactedEdge;
788
- newBounds = Object.assign(Object.assign(Object.assign({}, newBounds), proposedBounds), { resizeHandle: impactedEdge });
789
- }
790
- }
791
- // Once we have the window that will cause the least amount of damage, we create a moveRequest to pass to docking. This will be a resize, and it will cascade onto other affected windows.
792
- newBounds.name = leastImpactfulChange.win.name;
793
- await win.calculator.requestMove(newBounds);
794
- this.updateBounds();
795
- // Done
796
- if (this.isARectangle()) {
797
- win.calculator.onMouseUp();
798
- this.fillAttempts = 0;
799
- return;
800
- }
801
- // Too many attempts
802
- if (this.fillAttempts === 20) {
803
- const windowBounds = JSON.stringify(this.getWindowArray().map((win2) => win2.getBounds()));
804
- Logger.system.warn("forceObjectsToLogger", "FillHoles failed after 20 attempts. Use first string for test case. Second string is hole", windowBounds, JSON.stringify(myHole.getBounds()));
805
- this.fillAttempts = 0;
806
- return;
807
- }
808
- // If we only partially filled the hole, calculate the remaining hole, and call recursively.
809
- const leftovers = BoxMath.clipRect(myHole, new DockableBox(newBounds), impactedEdge);
810
- await this.fillHole(leftovers);
811
- }
812
- moveTo(bounds, cb = Function.prototype) {
813
- // System moves should already have an anchor window defined. For other moves set choose the top-left window.
814
- if (!bounds.anchor || !bounds.anchor.calculator) {
815
- Logger.system.verbose("dockableGroup.moveTo: No bounds anchor predefined, defaulting to bottomRight move anchor");
816
- bounds.anchor = this.getMoveAnchor("BottomRight");
817
- }
818
- // The group move needs to be handled differently if the move was initiated by the system or auto-arrange.. If a user moved the group neither of these values will be set.
819
- const params = {
820
- systemMoved: bounds.systemMoved,
821
- triggeredByAutoArrange: bounds.triggeredByAutoArrange,
822
- };
823
- const { calculator } = bounds.anchor;
824
- bounds.name = bounds.anchor.name;
825
- bounds.changeType = 0;
826
- calculator.requestMove(bounds, () => {
827
- this.updateBounds();
828
- calculator.onMouseUp(params);
829
- cb();
830
- });
831
- }
832
- /**
833
- * In certain configurations, whether a group is a rectangle is _NOT_ the deciding factor in scaling it. Instead, that decision is made based on whether the user is dragging a corner or an edge. If it's a corner, it must not be on another window's edge. If those conditions are met, we scale the group. This function returns the list of x,y points that will trigger this behavior.
834
- */
835
- getCornersThatCauseScaling() {
836
- const { corners, edges } = this.getCornersAndEdgesOfAllWindows();
837
- const uniqueCorners = corners.filter((value, index, self) => {
838
- const firstOccurence = self.findIndex((val) => val.x === value.x && val.y === value.y);
839
- return firstOccurence === index;
840
- });
841
- return uniqueCorners.filter((corner) => {
842
- const otherEdges = edges.filter((edge) => edge.window !== corner.window);
843
- return !otherEdges.some((edge) => BoxMath.isPointOnSegment(corner, edge));
844
- });
845
- }
846
- /**
847
- * @typedef cornerLabel
848
- * @param {"topLeft"|"topRight"|"bottomLeft"|"bottomRight"} Label for the corner.
849
- */
850
- /**
851
- * @typedef cornerObject
852
- * @param {string?} window Name of the window the corner belongs to
853
- * @param {number} x X coordinate of the corner
854
- * @param {number} y Y coordinate of the corner
855
- * @param {cornerLabel} label for the corner.
856
- */
857
- /**
858
- * @typedef edgeObject
859
- * @param {string?} window Name of the window the edge belongs to
860
- * @param {object} min Minimum point for line segment
861
- * @param {number} min.x X coordinate of the minimum point for the edge's line segment.
862
- * @param {number} min.y Y coordinate of the minimum point for the edge's line segment.
863
- * @param {object} max maximum point for line segment
864
- * @param {number} max.x X coordinate of the maximum point for the edge's line segment
865
- * @param {number} max.y Y coordinate of the maximum point for the edge's line segment
866
- */
867
- /**
868
- * @typedef {object} cornersAndEdges
869
- * @param {Array<cornerObject>} corners
870
- * @param {Array<edgeObject>} edges
871
- */
872
- /**
873
- * Helper function that will return all corners and all edges for each window in the group.
874
- * @returns {cornersAndEdges} cornersAndEdges Corners and edges.
875
-
876
- */
877
- getCornersAndEdgesOfAllWindows() {
878
- let corners = this.getWindowArray().map((win) => {
879
- let crn = win.getVertices(win.getBounds());
880
- crn = crn.map((c) => {
881
- c.window = win.name;
882
- return c;
883
- });
884
- return crn;
885
- });
886
- corners = corners.reduce((acc, val) => acc.concat(val));
887
- let edges = this.getWindowArray().map((win) => {
888
- let edg = win.getEdges("arr", true);
889
- edg = edg.map((e) => {
890
- e.window = win.name;
891
- return e;
892
- });
893
- return edg;
894
- });
895
- edges = edges.reduce((acc, val) => acc.concat(val));
896
- return { corners, edges };
897
- }
898
- /**
899
- * Returns the scale of bounds 1 relative to bounds 2.
900
- * If bounds1 is 1, and bounds2 is 2, the scale will come out as 2.
901
- * If bounds1 is 10 and bounds2 is 5, the scale will come out as 0.5. This is done for both x and y
902
- * @param {bounds} bounds1
903
- * @param {bounds} bounds2
904
- */
905
- static getScaleDescriptor(bounds1, bounds2) {
906
- const xScale = bounds1.width && bounds2.width ? bounds2.width / bounds1.width : 0;
907
- const yScale = bounds1.height && bounds2.height ? bounds2.height / bounds1.height : 0;
908
- return {
909
- x: xScale,
910
- y: yScale,
911
- };
912
- }
913
- /**
914
- * Essentially moves the window's top-left to the x/y coordinates passed in.
915
- * @param {object} params
916
- * @param {num} params.x x coordinate of a cartesian coordinate pair.
917
- * @param {num} params.y y coordinate of a cartesian coordinate pair.
918
- * @param {bounds} params.bounds bounds object that is being offset
919
- */
920
- static getCoordinatesByOffset(params) {
921
- const { x, y, bounds } = params;
922
- const offsetX = bounds.left - x;
923
- const offsetY = (bounds.top || 0) - y;
924
- const newBounds = {
925
- top: (bounds.top || 0) - offsetY,
926
- left: bounds.left - offsetX,
927
- height: 0,
928
- width: 0,
929
- right: 0,
930
- bottom: 0,
931
- };
932
- newBounds.height = bounds.height || 0;
933
- newBounds.width = bounds.width || 0;
934
- newBounds.right = newBounds.left + (bounds.width || 0);
935
- newBounds.bottom = newBounds.top + (bounds.height || 0);
936
- return newBounds;
937
- }
938
- /**
939
- * Given bounds and a scaleDescriptor, returns a scaled bounds object.
940
- * @param {*} params
941
- * @param {object} params.bounds Bounds.
942
- * @param {object} params.scaleDescriptor Tells us how much to scale in the X and Y directions.
943
- * @param {num} params.scaleDescriptor.x 0-Infinity; how much to scale the window in the x direction
944
- * @param {num} params.scaleDescriptor.y 0-Infinity; how much to scale the window in the y direction
945
- * @returns {object} bounds
946
- */
947
- static scaleWindow(params) {
948
- const { bounds, scaleDescriptor } = params;
949
- // "move" the window to 0,0 -- makes scaling calculations correct.
950
- const scaledBounds = {
951
- left: Math.round(bounds.left * scaleDescriptor.x),
952
- top: Math.round((bounds.top || 0) * scaleDescriptor.y),
953
- height: Math.round((bounds.height || 0) * scaleDescriptor.y),
954
- width: Math.round((bounds.width || 0) * scaleDescriptor.x),
955
- };
956
- scaledBounds.right = scaledBounds.left + scaledBounds.width;
957
- scaledBounds.bottom = scaledBounds.top + scaledBounds.height;
958
- return scaledBounds;
959
- }
960
- /**
961
- * Called after performing scale operations on the group. Depending on where the user scaled the group from, we re-anchor the group so that the move makes sense. Internally, resizes are calculated as if the group was at 0,0. After we do those calculations, we need to re-anchor the group so that the move makes intuitive sense.
962
- * @param {object} params
963
- * @param {array} params.windowList Array of bounds objects. Or windows. Haven't decided.ANGLE_instanced_arrays
964
- * @param {object} params.offset object describing by how much the top and left of a window's bounds should be offset.
965
- * @param {num} params.offset.left how much to offset the left edge of each window in the group.
966
- * @param {num} params.offset.top how much to offset the left edge of each window in the group.
967
- */
968
- static offsetGroup(params) {
969
- const { windowList, offset } = params;
970
- return windowList.map((bounds) => {
971
- bounds.left = bounds.left - offset.left;
972
- bounds.top = (bounds.top || 0) - (offset.top || 0);
973
- bounds.right = bounds.left + (bounds.width || 0);
974
- bounds.bottom = bounds.top + (bounds.height || 0);
975
- return bounds;
976
- });
977
- }
978
- /**
979
- * The workhorse of scaling operations. Given a list of windows, how we want to scale them, where to put them after scaling, and a minimum height and width, it will do everything.
980
- * 1. Moves the group to 0,0.
981
- * 2. Calculates the size of each window in the array.
982
- * 3. Actually scales each window.
983
- * 4. Makes sure no windows got too narrow or too short (check minimum height/width).
984
- * 5. Fixes any windows that were too small/too narrow.
985
- * 6. Re-anchors the group so that the move "feels" right. See DockableGroup.'offsetGroup' for a better explanation of what "feels right" means.
986
- * @param {params} params
987
- * @param {Array<bounds>} params.windowList
988
- * @param {scaleDescriptor} params.scaleDescriptor how much to scale in the x and y dimensions.
989
- * @param {num} param.scaleDescriptor.x How much to scale in the x direction
990
- * @param {num} param.scaleDescriptor.y How much to scale in the y direction
991
- * @param {object} param.anchor top/left coordinates of the 'anchor' for the list of windows. After scaling the windows, we need to make sure every window is reset to this anchor. If one resizes from the bottom right of a group, the top left of the group shouldn't change. If you resize from the top left, the bottom right shouldn't move after scaling.
992
- */
993
- static getScaledWindowList(params) {
994
- let { windowList, scaleDescriptor, anchor } = params;
995
- // /MOVE IT TO 0,0
996
- windowList = this.offsetGroup({
997
- windowList,
998
- offset: {
999
- left: anchor.left,
1000
- top: anchor.top,
1001
- right: 0,
1002
- },
1003
- });
1004
- // Check if the window exceeds it's limits, recalc scale factor and find the most strict
1005
- let newScaleX = scaleDescriptor.x;
1006
- let newScaleY = scaleDescriptor.y;
1007
- windowList.map((bounds) => {
1008
- const scaledBounds = this.scaleWindow({
1009
- bounds,
1010
- scaleDescriptor,
1011
- });
1012
- if (scaledBounds.width < bounds.limits.minWidth) {
1013
- newScaleX = Math.max(newScaleX, bounds.limits.minWidth / bounds.width);
1014
- }
1015
- else if (scaledBounds.width > bounds.limits.maxWidth) {
1016
- newScaleX = Math.min(newScaleX, bounds.limits.maxWidth / bounds.width);
1017
- }
1018
- if (scaledBounds.height < bounds.limits.minHeight) {
1019
- newScaleY = Math.max(newScaleY, bounds.limits.minHeight / bounds.height);
1020
- }
1021
- else if (scaledBounds.height > bounds.limits.maxHeight) {
1022
- newScaleY = Math.min(newScaleY, bounds.limits.maxHeight / bounds.height);
1023
- }
1024
- });
1025
- // If the scale factor was changed then update scaleDescriptor
1026
- if (newScaleX != scaleDescriptor.x || newScaleY != scaleDescriptor.y) {
1027
- scaleDescriptor.x = newScaleX;
1028
- scaleDescriptor.y = newScaleY;
1029
- }
1030
- // Do final scaling of the windows
1031
- windowList = windowList.map((bounds) => {
1032
- const scaledBounds = this.scaleWindow({
1033
- bounds,
1034
- scaleDescriptor,
1035
- });
1036
- scaledBounds.name = bounds.name;
1037
- scaledBounds.limits = bounds.limits;
1038
- return scaledBounds;
1039
- });
1040
- // MOVE IT BACK TO WHERE THE ANCHOR IS
1041
- windowList = this.offsetGroup({
1042
- windowList,
1043
- offset: {
1044
- left: -anchor.left,
1045
- top: -anchor.top,
1046
- right: 0,
1047
- },
1048
- });
1049
- return windowList;
1050
- }
1051
- }
1052
- // DockableGroup.prototype = DockableBox;
1053
- export default DockableGroup;
1054
- //# sourceMappingURL=dockableGroup.js.map