@finsemble/finsemble-ui 6.6.1 → 7.0.0-beta.3

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 (262) hide show
  1. package/package.json +18 -32
  2. package/react/assets/css/button.css +1 -1
  3. package/react/assets/css/favorites.css +0 -47
  4. package/react/assets/css/finsemble.css +3 -0
  5. package/react/assets/css/linkerWindow.css +13 -1
  6. package/react/assets/css/menus.css +2 -2
  7. package/react/assets/css/notificationsCenter.css +32 -1
  8. package/react/assets/css/shared/common.css +40 -0
  9. package/react/assets/css/userPreferences.css +17 -12
  10. package/react/assets/css/windowTitleBar.css +7 -0
  11. package/react/assets/icons/server.svg +26 -0
  12. package/react/components/common/ButtonIcon.js +1 -1
  13. package/react/components/common/ButtonIcon.js.map +1 -1
  14. package/react/components/common/ButtonRow.js +2 -2
  15. package/react/components/common/ButtonRow.js.map +1 -1
  16. package/react/components/common/Checkbox.js +1 -1
  17. package/react/components/common/Checkbox.js.map +1 -1
  18. package/react/components/common/ColorPicker.js +16 -15
  19. package/react/components/common/ColorPicker.js.map +1 -1
  20. package/react/components/common/ErrorBoundary.d.ts +16 -0
  21. package/react/components/common/ErrorBoundary.js +22 -0
  22. package/react/components/common/ErrorBoundary.js.map +1 -0
  23. package/react/components/common/FinsembleIcon.d.ts +3 -2
  24. package/react/components/common/FinsembleIcon.js +10 -3
  25. package/react/components/common/FinsembleIcon.js.map +1 -1
  26. package/react/components/common/FinsembleLink.d.ts +6 -0
  27. package/react/components/common/FinsembleLink.js +12 -0
  28. package/react/components/common/FinsembleLink.js.map +1 -0
  29. package/react/components/common/FinsembleToggle.d.ts +1 -2
  30. package/react/components/common/FinsembleToggle.js +2 -6
  31. package/react/components/common/FinsembleToggle.js.map +1 -1
  32. package/react/components/common/FinsembleToggleButtonBar.d.ts +13 -0
  33. package/react/components/common/FinsembleToggleButtonBar.js +44 -0
  34. package/react/components/common/FinsembleToggleButtonBar.js.map +1 -0
  35. package/react/components/common/InputTable.d.ts +3 -3
  36. package/react/components/common/InputTable.js +13 -13
  37. package/react/components/common/InputTable.js.map +1 -1
  38. package/react/components/common/Tab.js +33 -5
  39. package/react/components/common/Tab.js.map +1 -1
  40. package/react/components/common/css/FinsembleToggle.css +22 -0
  41. package/react/components/common/css/application-edit-page.css +10 -2
  42. package/react/components/common/css/tab.css +8 -8
  43. package/react/components/common/css/time-select.css +1 -1
  44. package/react/components/common/css/toggle.css +2 -10
  45. package/react/components/common/helpers.js +6 -1
  46. package/react/components/common/helpers.js.map +1 -1
  47. package/react/components/common/stories/ColorPicker.stories.js +6 -11
  48. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  49. package/react/components/common/stories/FinsembleToggle.stories.d.ts +1 -2
  50. package/react/components/common/stories/FinsembleToggle.stories.js +0 -7
  51. package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
  52. package/react/components/common/stories/FinsembleToggleButtonBar.stories.d.ts +14 -0
  53. package/react/components/common/stories/FinsembleToggleButtonBar.stories.js +97 -0
  54. package/react/components/common/stories/FinsembleToggleButtonBar.stories.js.map +1 -0
  55. package/react/components/common/stories/InputTable.stories.d.ts +4 -3
  56. package/react/components/common/stories/InputTable.stories.js +18 -8
  57. package/react/components/common/stories/InputTable.stories.js.map +1 -1
  58. package/react/components/common/tests/ButtonRow.spec.js +5 -0
  59. package/react/components/common/tests/ButtonRow.spec.js.map +1 -1
  60. package/react/components/common/tests/FinsembleToggle.spec.js +1 -6
  61. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  62. package/react/components/common/tests/FinsembleToggleButtonBar.spec.d.ts +1 -0
  63. package/react/components/common/tests/FinsembleToggleButtonBar.spec.js +40 -0
  64. package/react/components/common/tests/FinsembleToggleButtonBar.spec.js.map +1 -0
  65. package/react/components/common/tests/InputTable.spec.js +3 -3
  66. package/react/components/common/tests/InputTable.spec.js.map +1 -1
  67. package/react/components/favorites/FavoriteMaker.js +1 -1
  68. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  69. package/react/components/fdc3Resolver/ResolverContainer.js +4 -7
  70. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  71. package/react/components/icon/Icon.d.ts +1 -1
  72. package/react/components/icon/Icon.js +8 -1
  73. package/react/components/icon/Icon.js.map +1 -1
  74. package/react/components/legacyControls/FinsembleDnDContext.js +7 -7
  75. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  76. package/react/components/linker/remoteRedux.js +1 -0
  77. package/react/components/linker/remoteRedux.js.map +1 -1
  78. package/react/components/menu/MenuItem.js +1 -1
  79. package/react/components/menu/MenuItem.js.map +1 -1
  80. package/react/components/menu/MenuPortal.js +12 -21
  81. package/react/components/menu/MenuPortal.js.map +1 -1
  82. package/react/components/menu/MenuToggle.js +1 -1
  83. package/react/components/menu/MenuToggle.js.map +1 -1
  84. package/react/components/menu/keyboardNavigation.d.ts +1 -22
  85. package/react/components/menu/keyboardNavigation.js +110 -160
  86. package/react/components/menu/keyboardNavigation.js.map +1 -1
  87. package/react/components/notifications/components/drawer/DrawerControls.js +39 -25
  88. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  89. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +19 -6
  90. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  91. package/react/components/notifications/components/shared/CheckButton.js +19 -8
  92. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  93. package/react/components/notifications/components/shared/NotificationCardShell.js +2 -1
  94. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  95. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js +2 -1
  96. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  97. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js +2 -1
  98. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  99. package/react/components/notifications/components/views/CardView.js +5 -3
  100. package/react/components/notifications/components/views/CardView.js.map +1 -1
  101. package/react/components/notifications/components/views/ListView.js +3 -1
  102. package/react/components/notifications/components/views/ListView.js.map +1 -1
  103. package/react/components/notifications/types.d.ts +3 -0
  104. package/react/components/notifications/types.js.map +1 -1
  105. package/react/components/processMonitor/ProcessMonitor.js +4 -1
  106. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  107. package/react/components/processMonitor/components/ProcessStatistics.js +1 -3
  108. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  109. package/react/components/processMonitor/helpers.js +4 -3
  110. package/react/components/processMonitor/helpers.js.map +1 -1
  111. package/react/components/processMonitor/helpers.spec.js +7 -3
  112. package/react/components/processMonitor/helpers.spec.js.map +1 -1
  113. package/react/components/sdd/AddApp.d.ts +4 -3
  114. package/react/components/sdd/AddApp.js +132 -30
  115. package/react/components/sdd/AddApp.js.map +1 -1
  116. package/react/components/sdd/AppEditAccess.d.ts +4 -3
  117. package/react/components/sdd/AppEditAccess.js.map +1 -1
  118. package/react/components/sdd/AppEditPage.d.ts +4 -3
  119. package/react/components/sdd/AppEditPage.js +141 -116
  120. package/react/components/sdd/AppEditPage.js.map +1 -1
  121. package/react/components/sdd/Appearance.d.ts +2 -1
  122. package/react/components/sdd/Appearance.js +15 -7
  123. package/react/components/sdd/Appearance.js.map +1 -1
  124. package/react/components/sdd/Application.d.ts +5 -4
  125. package/react/components/sdd/Application.js +61 -42
  126. package/react/components/sdd/Application.js.map +1 -1
  127. package/react/components/sdd/Applications.d.ts +12 -11
  128. package/react/components/sdd/Applications.js +23 -4
  129. package/react/components/sdd/Applications.js.map +1 -1
  130. package/react/components/sdd/Authentication.js +1 -6
  131. package/react/components/sdd/Authentication.js.map +1 -1
  132. package/react/components/sdd/AuthenticationProviderConfig.js +5 -3
  133. package/react/components/sdd/AuthenticationProviderConfig.js.map +1 -1
  134. package/react/components/sdd/EditPreload.d.ts +4 -3
  135. package/react/components/sdd/EditPreload.js +39 -22
  136. package/react/components/sdd/EditPreload.js.map +1 -1
  137. package/react/components/sdd/Export.d.ts +7 -6
  138. package/react/components/sdd/Export.js +3 -2
  139. package/react/components/sdd/Export.js.map +1 -1
  140. package/react/components/sdd/GettingStarted.js +3 -3
  141. package/react/components/sdd/GettingStarted.js.map +1 -1
  142. package/react/components/sdd/Navigation.js +28 -4
  143. package/react/components/sdd/Navigation.js.map +1 -1
  144. package/react/components/sdd/OptionalSettingsView.d.ts +6 -5
  145. package/react/components/sdd/OptionalSettingsView.js +2 -10
  146. package/react/components/sdd/OptionalSettingsView.js.map +1 -1
  147. package/react/components/sdd/ProjectErrors.js +1 -1
  148. package/react/components/sdd/ProjectErrors.js.map +1 -1
  149. package/react/components/sdd/Publish.js +2 -2
  150. package/react/components/sdd/Publish.js.map +1 -1
  151. package/react/components/sdd/SmartDesktopDesigner.d.ts +17 -16
  152. package/react/components/sdd/SmartDesktopDesigner.js +37 -34
  153. package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
  154. package/react/components/sdd/ThemePage.js +8 -5
  155. package/react/components/sdd/ThemePage.js.map +1 -1
  156. package/react/components/sdd/Themes.d.ts +2 -1
  157. package/react/components/sdd/Themes.js +2 -2
  158. package/react/components/sdd/Themes.js.map +1 -1
  159. package/react/components/sdd/Toolbar.d.ts +5 -4
  160. package/react/components/sdd/Toolbar.js +11 -9
  161. package/react/components/sdd/Toolbar.js.map +1 -1
  162. package/react/components/sdd/common/setPreloadDefaults.d.ts +1 -1
  163. package/react/components/sdd/common/setPreloadDefaults.js +5 -4
  164. package/react/components/sdd/common/setPreloadDefaults.js.map +1 -1
  165. package/react/components/sdd/common/views.js +7 -4
  166. package/react/components/sdd/common/views.js.map +1 -1
  167. package/react/components/sdd/css/addApp.css +52 -0
  168. package/react/components/sdd/css/applications.css +4 -24
  169. package/react/components/sdd/css/nav.css +3 -3
  170. package/react/components/sdd/fixtures/authenticationProps.js +15 -1
  171. package/react/components/sdd/fixtures/authenticationProps.js.map +1 -1
  172. package/react/components/sdd/fixtures/preloads.js +14 -12
  173. package/react/components/sdd/fixtures/preloads.js.map +1 -1
  174. package/react/components/sdd/smartDesktopClient.d.ts +163 -0
  175. package/react/components/sdd/smartDesktopClient.js +573 -0
  176. package/react/components/sdd/smartDesktopClient.js.map +1 -0
  177. package/react/components/sdd/smartDesktopClient.spec.d.ts +1 -0
  178. package/react/components/sdd/smartDesktopClient.spec.js +61 -0
  179. package/react/components/sdd/smartDesktopClient.spec.js.map +1 -0
  180. package/react/components/sdd/stories/AddApp.stories.d.ts +10 -0
  181. package/react/components/sdd/stories/AddApp.stories.js +18 -0
  182. package/react/components/sdd/stories/AddApp.stories.js.map +1 -0
  183. package/react/components/sdd/stories/AppEditPage.stories.d.ts +2 -0
  184. package/react/components/sdd/stories/AppEditPage.stories.js +2 -0
  185. package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -1
  186. package/react/components/sdd/stories/Appearance.stories.d.ts +1 -1
  187. package/react/components/sdd/stories/Appearance.stories.js +1 -0
  188. package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
  189. package/react/components/sdd/stories/Authentication.stories.js +2 -16
  190. package/react/components/sdd/stories/Authentication.stories.js.map +1 -1
  191. package/react/components/sdd/stories/OptionalSettingsView.stories.js +1 -1
  192. package/react/components/sdd/stories/OptionalSettingsView.stories.js.map +1 -1
  193. package/react/components/sdd/stories/SmartDesktopDesigner.stories.d.ts +1 -1
  194. package/react/components/sdd/stories/SmartDesktopDesigner.stories.js +3 -0
  195. package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -1
  196. package/react/components/sdd/stories/Themes.stories.d.ts +1 -1
  197. package/react/components/sdd/stories/Themes.stories.js +1 -0
  198. package/react/components/sdd/stories/Themes.stories.js.map +1 -1
  199. package/react/components/sdd/tests/AddApp.spec.d.ts +1 -0
  200. package/react/components/sdd/tests/AddApp.spec.js +96 -0
  201. package/react/components/sdd/tests/AddApp.spec.js.map +1 -0
  202. package/react/components/sdd/tests/AppEditPage.spec.js +92 -23
  203. package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
  204. package/react/components/sdd/tests/Application.spec.js +411 -24
  205. package/react/components/sdd/tests/Application.spec.js.map +1 -1
  206. package/react/components/sdd/tests/Applications.spec.js +1 -45
  207. package/react/components/sdd/tests/Applications.spec.js.map +1 -1
  208. package/react/components/sdd/tests/Authentication.spec.js +1 -1
  209. package/react/components/sdd/tests/Authentication.spec.js.map +1 -1
  210. package/react/components/sdd/tests/EditPreload.spec.js +50 -7
  211. package/react/components/sdd/tests/EditPreload.spec.js.map +1 -1
  212. package/react/components/sdd/tests/Navigation.spec.js +2 -2
  213. package/react/components/sdd/tests/Navigation.spec.js.map +1 -1
  214. package/react/components/sdd/tests/OptionalSettingsView.spec.js +235 -0
  215. package/react/components/sdd/tests/OptionalSettingsView.spec.js.map +1 -1
  216. package/react/components/sdd/tests/ProjectErrors.spec.js +1 -1
  217. package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -1
  218. package/react/components/sdd/tests/SmartDesktopDesigner.spec.js +2 -2
  219. package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -1
  220. package/react/components/search/Search.js +1 -1
  221. package/react/components/search/Search.js.map +1 -1
  222. package/react/components/shared/DefaultDropdownButton.js +12 -1
  223. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  224. package/react/components/shared/tests/DefaultDropdownButton.spec.js +12 -0
  225. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
  226. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +1 -16
  227. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +0 -4
  228. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  229. package/react/components/toolbar/DragHandle.stories.js.map +1 -1
  230. package/react/components/toolbar/ToolbarIcon.js +2 -2
  231. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  232. package/react/components/toolbar/ToolbarSection.d.ts +1 -9
  233. package/react/components/toolbar/ToolbarSection.js +3 -7
  234. package/react/components/toolbar/ToolbarSection.js.map +1 -1
  235. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +1 -1
  236. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  237. package/react/components/toolbar/dashbar/Dashbar.js +21 -12
  238. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  239. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +1 -1
  240. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  241. package/react/components/userPreferences/components/ContentSection.js +1 -1
  242. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  243. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +4 -3
  244. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  245. package/react/components/userPreferences/components/general/ScheduledClose.js +12 -3
  246. package/react/components/userPreferences/components/general/ScheduledClose.js.map +1 -1
  247. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +1 -1
  248. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
  249. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +17 -2
  250. package/react/components/windowTitleBar/WindowTitleBarShell.js +160 -6
  251. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  252. package/react/components/windowTitleBar/components/left/LinkerButton.js +7 -1
  253. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  254. package/react/components/windowTitleBar/components/windowTitle.js +10 -2
  255. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  256. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +11 -1
  257. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  258. package/react/reducers/rootReducer.d.ts +2 -2
  259. package/react/store.d.ts +4 -4
  260. package/react/tsconfig.tsbuildinfo +1 -0
  261. package/react/types/smartDesktopDesignerTypes.d.ts +3 -0
  262. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { WindowTitleBarContext } from "./windowTitleBarContext";
3
- import { storeManager, Actions } from "./stores/windowTitleBarStore";
4
- import "../../assets/css/finsemble.css";
3
+ import { storeManager, Actions, getStore } from "./stores/windowTitleBarStore";
5
4
  import "../../assets/css/windowTitleBar.css";
6
5
  import { clone } from "./../sdd/Appearance.helpers";
6
+ import { Logger } from "@finsemble/finsemble-api";
7
7
  export class WindowTitleBarShell extends React.Component {
8
8
  constructor(props) {
9
9
  super(props);
@@ -32,6 +32,8 @@ export class WindowTitleBarShell extends React.Component {
32
32
  windowTitle: "",
33
33
  useDOMBasedMovement: true,
34
34
  dragHandleName: "fsbl-drag-handle",
35
+ bumpElements: {},
36
+ adjustContentHeights: true,
35
37
  };
36
38
  finsembleWindow.isAlwaysOnTop({}, (err, alwaysOnTop) => {
37
39
  this.setState(Object.assign(Object.assign({}, this.state), { alwaysOnTop }));
@@ -62,8 +64,8 @@ export class WindowTitleBarShell extends React.Component {
62
64
  this.alwaysOnTopListener = this.alwaysOnTopListener.bind(this);
63
65
  this.onInitialized = this.onInitialized.bind(this);
64
66
  }
65
- onInitialized(store) {
66
- this.store = store;
67
+ onInitialized() {
68
+ this.store = getStore();
67
69
  this.store.addListeners([
68
70
  { field: "Main.windowTitle", listener: this.onTitleChange },
69
71
  { field: "Main.showDockingTooltip", listener: this.onShowDockingToolTip },
@@ -87,7 +89,7 @@ export class WindowTitleBarShell extends React.Component {
87
89
  });
88
90
  }
89
91
  onStoreChange() {
90
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
92
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
91
93
  let activeIdentifier = finsembleWindow.identifier;
92
94
  activeIdentifier.title = (_a = this.store) === null || _a === void 0 ? void 0 : _a.getValue({
93
95
  field: "Main.windowTitle",
@@ -109,6 +111,8 @@ export class WindowTitleBarShell extends React.Component {
109
111
  }),
110
112
  showTabs: (_k = this.store) === null || _k === void 0 ? void 0 : _k.getValue({ field: "showTabs" }),
111
113
  hackScrollbar: (_l = this.store) === null || _l === void 0 ? void 0 : _l.getValue({ field: "hackScrollbar" }),
114
+ bumpElements: (_m = this.store) === null || _m === void 0 ? void 0 : _m.getValue({ field: "bumpElements" }),
115
+ adjustContentHeights: (_o = this.store) === null || _o === void 0 ? void 0 : _o.getValue({ field: "adjustContentHeights" }),
112
116
  tabs: [activeIdentifier],
113
117
  });
114
118
  }
@@ -119,7 +123,8 @@ export class WindowTitleBarShell extends React.Component {
119
123
  }
120
124
  });
121
125
  let header = document.getElementsByClassName("fsbl-header")[0];
122
- document.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue("height");
126
+ if (header)
127
+ document.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue("height");
123
128
  this.resizeDragHandle();
124
129
  this.hackScrollbar();
125
130
  storeManager.addInitializedListener(this.onInitialized);
@@ -127,6 +132,8 @@ export class WindowTitleBarShell extends React.Component {
127
132
  }
128
133
  componentDidUpdate() {
129
134
  this.resizeDragHandle();
135
+ this.hackScrollbar();
136
+ this.maybeAdjustWindow();
130
137
  }
131
138
  componentWillUnmount() {
132
139
  var _a;
@@ -359,6 +366,153 @@ export class WindowTitleBarShell extends React.Component {
359
366
  bodyElement.style.overflowY = "auto";
360
367
  }
361
368
  }
369
+ async maybeAdjustWindow() {
370
+ const beginAdjustment = () => {
371
+ const header = document.getElementsByClassName("fsbl-header")[0];
372
+ if (header) {
373
+ if (this.state.adjustContentHeights) {
374
+ const headerHeight = window.getComputedStyle(header, null).getPropertyValue("height");
375
+ this.adjustTopLevelHeight(Number(headerHeight.split("px")[0]));
376
+ }
377
+ this.bumpElements(this.state.bumpElements);
378
+ }
379
+ else {
380
+ Logger.system.error("WindowTitleBarShell.maybeAdjustWindow:could not find the header.");
381
+ }
382
+ };
383
+ if (document.readyState === "complete")
384
+ beginAdjustment();
385
+ else {
386
+ document.addEventListener("readystatechange", () => {
387
+ if (document.readyState === "complete")
388
+ beginAdjustment();
389
+ });
390
+ }
391
+ }
392
+ bumpElements(config) {
393
+ if ((config === null || config === void 0 ? void 0 : config.bumpBy) && (config === null || config === void 0 ? void 0 : config.bumpBy) !== "0px") {
394
+ if (config.fixed)
395
+ this.bumpFixedElements(config);
396
+ if (config.absolute)
397
+ this.bumpAbsoluteElements(config);
398
+ }
399
+ }
400
+ adjust(elem, prev, headerHeight, maxHeight = "100vh") {
401
+ if (!elem.className.includes("bumped-element")) {
402
+ const absoluteUnit = ["px", "pt", "pc"];
403
+ const heightStyle = elem.style.height.split(/(p[a-z])/).filter(Boolean);
404
+ const clientHeight = elem.clientHeight ? elem.clientHeight : 0;
405
+ const offsetHeight = elem.offsetHeight ? elem.offsetHeight : 0;
406
+ const offset = offsetHeight - clientHeight;
407
+ const adjustPrev = prev + offset;
408
+ const heightUnit = heightStyle[heightStyle.length - 1];
409
+ if (heightStyle.length && !absoluteUnit.includes(heightUnit)) {
410
+ elem.style.height = `calc(${elem.style.height} - ${headerHeight}px)`;
411
+ elem.style.maxHeight = `calc(${maxHeight} - ${adjustPrev}px)`;
412
+ elem.classList.add("bumped-element");
413
+ }
414
+ else if (!heightStyle.length) {
415
+ elem.style.maxHeight = `calc(${maxHeight} - ${adjustPrev}px)`;
416
+ elem.classList.add("bumped-element");
417
+ }
418
+ }
419
+ }
420
+ adjustTopLevelHeight(headerHeight) {
421
+ const elems = document.body.querySelectorAll(":scope > *:not(#FSBLHeader, .fsbl-header)");
422
+ let prev = headerHeight;
423
+ elems.forEach((elem) => {
424
+ this.adjust(elem, prev, headerHeight);
425
+ if (elem.style.position !== "fixed" && elem.style.position !== "absolute")
426
+ prev = prev + elem.offsetHeight;
427
+ this.adjustContentHeight(elem, headerHeight);
428
+ });
429
+ }
430
+ adjustContentHeight(headerNode, headerHeight) {
431
+ const elem = headerNode;
432
+ const maxHeight = `100%`;
433
+ const { children } = elem;
434
+ const len = children.length;
435
+ let prev = 0;
436
+ for (let i = 0; i < len; i++) {
437
+ if (children[i].style.position !== "fixed" && children[i].style.position !== "absolute") {
438
+ this.adjust(children[i], prev, headerHeight, maxHeight);
439
+ prev = prev + children[i].offsetHeight;
440
+ }
441
+ }
442
+ }
443
+ calculateBumpValue(type, topStyle, bumpBy) {
444
+ let topVal;
445
+ const possibleZeros = ["0", "0px", 0];
446
+ if (type == "all") {
447
+ topVal = `calc(${topStyle} + ${bumpBy})`;
448
+ }
449
+ else if (type == "0Positioned" && possibleZeros.includes(topStyle)) {
450
+ topVal = bumpBy;
451
+ }
452
+ return topVal;
453
+ }
454
+ traverseHtml(element, acc = []) {
455
+ const elems = element.children;
456
+ const len = elems.length;
457
+ if (!len) {
458
+ acc.push(element);
459
+ }
460
+ else {
461
+ for (let i = 0; i < len; i++) {
462
+ const style = window.getComputedStyle(elems[i], null);
463
+ if (style.getPropertyValue("position") == "static") {
464
+ acc = this.traverseHtml(elems[i], acc);
465
+ }
466
+ else {
467
+ acc.push(elems[i]);
468
+ }
469
+ }
470
+ }
471
+ return acc;
472
+ }
473
+ bumpFixedElements(params) {
474
+ let { fixed, bumpBy } = params;
475
+ const getFixedElements = (nodes) => {
476
+ const fixedElems = [];
477
+ nodes.forEach((node) => {
478
+ const style = window.getComputedStyle(node, null);
479
+ if (style.getPropertyValue("position") == "fixed")
480
+ fixedElems.push(node);
481
+ const elems = node.querySelectorAll("*");
482
+ elems.forEach((elem) => {
483
+ const childStyle = window.getComputedStyle(elem, null);
484
+ if (childStyle.getPropertyValue("position") == "fixed")
485
+ fixedElems.push(elem);
486
+ });
487
+ });
488
+ return fixedElems;
489
+ };
490
+ const selector = "*:not(#FSBLHeader, .fsbl-header)";
491
+ const elems = getFixedElements(document.body.querySelectorAll(`${selector}`));
492
+ const len = elems.length;
493
+ for (let i = 0; i < len; i++) {
494
+ const style = window.getComputedStyle(elems[i], null);
495
+ const topStyle = style.getPropertyValue("top");
496
+ if (!elems[i].className.includes("bumped-element")) {
497
+ elems[i].style.top = this.calculateBumpValue(fixed, topStyle, bumpBy);
498
+ elems[i].classList.add("bumped-element");
499
+ }
500
+ }
501
+ }
502
+ bumpAbsoluteElements(params) {
503
+ let { absolute, bumpBy } = params;
504
+ const selector = "*:not(#FSBLHeader, .fsbl-header)";
505
+ const elems = this.traverseHtml({ children: document.body.querySelectorAll(`:scope > ${selector}`) });
506
+ const len = elems.length;
507
+ for (let i = 0; i < len; i++) {
508
+ const style = window.getComputedStyle(elems[i], null);
509
+ const topStyle = style.getPropertyValue("top");
510
+ if (style.getPropertyValue("position") == "absolute" && !elems[i].className.includes("bumped-element")) {
511
+ elems[i].style.top = this.calculateBumpValue(absolute, topStyle, bumpBy);
512
+ elems[i].classList.add("bumped-element");
513
+ }
514
+ }
515
+ }
362
516
  render() {
363
517
  let showDockingIcon = !this.state.dockingEnabled ? false : this.state.dockingIcon;
364
518
  let isGrouped = this.state.dockingIcon == "ejector";
@@ -1 +1 @@
1
- {"version":3,"file":"WindowTitleBarShell.js","sourceRoot":"","sources":["../../../src/components/windowTitleBar/WindowTitleBarShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,gCAAgC,CAAC;AACxC,OAAO,qCAAqC,CAAC;AAI7C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AA6BpD,MAAM,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAA6D;IAG3G,YAAY,KAA+B;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QAEvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG;YACZ,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAmB;YAC3E,uBAAuB,EAA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,QAAQ,CAAkC,CACtG,CACI,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport * as React from \"react\";\nimport { WindowTitleBarContext } from \"./windowTitleBarContext\";\nimport { storeManager, Actions } from \"./stores/windowTitleBarStore\";\nimport \"../../assets/css/finsemble.css\";\nimport \"../../assets/css/windowTitleBar.css\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { TabProperties } from \"../../types/windowTitleBar\";\nimport { clone } from \"./../sdd/Appearance.helpers\";\n\ninterface WindowTitleBarShellProps {}\n\ninterface WindowTitleBarShellState {\n\ttabs: TabProperties[];\n\tactiveTab: TabProperties;\n\twindowTitle: string;\n\tinitialized: boolean;\n\talwaysOnTop: boolean;\n\tshowTabs: boolean;\n\tminButton: boolean;\n\tmaxButton: boolean;\n\tcloseButton: boolean;\n\tshowShareButton: boolean;\n\tshowLinkerButton: boolean;\n\tisTopRight: boolean;\n\tdockingEnabled: boolean;\n\talwaysOnTopButton: boolean;\n\tallowDragOnCenterRegion: boolean;\n\tdockingIcon: string;\n\thackScrollbar: boolean;\n\tshowDockingTooltip: boolean;\n\tshowTabRegion: boolean;\n\ttabBarBoundingBox: any;\n\tuseDOMBasedMovement: boolean;\n\tdragHandleName: string;\n}\n\nexport class WindowTitleBarShell extends React.Component<WindowTitleBarShellProps, WindowTitleBarShellState> {\n\tstore?: StoreModel;\n\n\tconstructor(props: WindowTitleBarShellProps) {\n\t\tsuper(props);\n\t\tthis.store = undefined;\n\n\t\tthis.bindCorrectContext();\n\t\tthis.state = {\n\t\t\tactiveTab: FSBL.Clients.WindowClient.getWindowIdentifier() as TabProperties,\n\t\t\tallowDragOnCenterRegion: true,\n\t\t\talwaysOnTop: false,\n\t\t\talwaysOnTopButton: false,\n\t\t\tcloseButton: false,\n\t\t\tdockingEnabled: false,\n\t\t\tdockingIcon: \"\",\n\t\t\thackScrollbar: false,\n\t\t\tinitialized: false,\n\t\t\tisTopRight: false,\n\t\t\tmaxButton: false,\n\t\t\tminButton: false,\n\t\t\tshowDockingTooltip: false,\n\t\t\tshowLinkerButton: false,\n\t\t\tshowShareButton: false,\n\t\t\tshowTabs: false,\n\t\t\tshowTabRegion: false,\n\t\t\ttabs: [],\n\t\t\ttabBarBoundingBox: {},\n\t\t\twindowTitle: \"\",\n\t\t\tuseDOMBasedMovement: true,\n\t\t\tdragHandleName: \"fsbl-drag-handle\",\n\t\t};\n\n\t\tfinsembleWindow.isAlwaysOnTop({}, (err, alwaysOnTop: boolean) => {\n\t\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t\t});\n\n\t\tfinsembleWindow.addEventListener(\"alwaysOnTop\", this.alwaysOnTopListener);\n\t}\n\n\talwaysOnTopListener({ data: { alwaysOnTop } }: any) {\n\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t}\n\n\t/**\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\n\t *\n\t * @memberof WindowTitleBar\n\t */\n\tbindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDockingEnabledChanged = this.onDockingEnabledChanged.bind(this);\n\t\tthis.onAlwaysOnTopChanged = this.onAlwaysOnTopChanged.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t\tthis.isTopRight = this.isTopRight.bind(this);\n\t\tthis.allowDragOnCenterRegion = this.allowDragOnCenterRegion.bind(this);\n\t\tthis.disallowDragOnCenterRegion = this.disallowDragOnCenterRegion.bind(this);\n\t\tthis.setDOMBasedMovement = this.setDOMBasedMovement.bind(this);\n\t\tthis.onShareEmitterChanged = this.onShareEmitterChanged.bind(this);\n\t\tthis.onTabsChanged = this.onTabsChanged.bind(this);\n\t\tthis.onShowTabsChanged = this.onShowTabsChanged.bind(this);\n\t\tthis.onTilingStop = this.onTilingStop.bind(this);\n\t\tthis.onTilingStart = this.onTilingStart.bind(this);\n\t\tthis.resizeDragHandle = this.resizeDragHandle.bind(this);\n\t\tthis.onDoubleClick = this.onDoubleClick.bind(this);\n\t\tthis.alwaysOnTopListener = this.alwaysOnTopListener.bind(this);\n\t\tthis.onInitialized = this.onInitialized.bind(this);\n\t}\n\n\tonInitialized(store: StoreModel) {\n\t\tthis.store = store;\n\t\tthis.store.addListeners(\n\t\t\t[\n\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t{ field: \"Main.showDockingTooltip\", listener: this.onShowDockingToolTip },\n\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t{ field: \"Main.dockingEnabled\", listener: this.onDockingEnabledChanged },\n\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t{ field: \"Sharer.emitterEnabled\", listener: this.onShareEmitterChanged },\n\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"hackScrollbar\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"Main.useDOMBasedMovement\", listener: this.setDOMBasedMovement },\n\t\t\t],\n\t\t\t() => {}\n\t\t);\n\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.allowDragOnCenterRegion);\n\n\t\tthis.onStoreChange();\n\t\tthis.setState({\n\t\t\tinitialized: true,\n\t\t});\n\t}\n\n\tonStoreChange() {\n\t\tlet activeIdentifier = finsembleWindow.identifier as TabProperties;\n\t\tactiveIdentifier.title = this.store?.getValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t});\n\n\t\tthis.setState({\n\t\t\twindowTitle: this.store?.getValue({ field: \"Main.windowTitle\" }),\n\t\t\tminButton: !this.store?.getValue({ field: \"Minimize.hide\" }),\n\t\t\tmaxButton: !this.store?.getValue({ field: \"Maximize.hide\" }),\n\t\t\tcloseButton: !this.store?.getValue({ field: \"Close.hide\" }),\n\t\t\tshowLinkerButton: this.store?.getValue({\n\t\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\t}),\n\t\t\tshowShareButton: this.store?.getValue({\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t}),\n\t\t\tisTopRight: this.store?.getValue({ field: \"isTopRight\" }),\n\t\t\talwaysOnTopButton: this.store?.getValue({\n\t\t\t\tfield: \"AlwaysOnTop.show\",\n\t\t\t}),\n\t\t\tshowTabs: this.store?.getValue({ field: \"showTabs\" }),\n\t\t\thackScrollbar: this.store?.getValue({ field: \"hackScrollbar\" }),\n\t\t\ttabs: [activeIdentifier], // array of tabs for this window\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\t// Goal: If a user gets focus into the title bar (if they Alt+Tab or Cmd+Tab into the window),\n\t\t// we want to let get into the rest of the component using the keyboard alone. The UX for\n\t\t// this task will be to seemingly TAB from the title bar into the window, if possible.\n\t\t// Code: If the user presses the \"Tab\" key, move their focus to the browser view\n\t\twindow.addEventListener(\"keydown\", (e) => {\n\t\t\tif (e.key === \"Tab\") {\n\t\t\t\t// This magic moves focus to a browserView, if one exists\n\t\t\t\tfinsembleWindow.focus();\n\t\t\t}\n\t\t});\n\t\tlet header = document.getElementsByClassName(\"fsbl-header\")[0];\n\t\tdocument.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\t\tthis.resizeDragHandle();\n\t\tthis.hackScrollbar();\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.resizeDragHandle();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\n\t\tif (this.state.initialized) {\n\t\t\tthis.store?.removeListeners(\n\t\t\t\t[\n\t\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.showDockingTooltip\",\n\t\t\t\t\t\tlistener: this.onShowDockingToolTip,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.dockingEnabled\",\n\t\t\t\t\t\tlistener: this.onDockingEnabledChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\t\t\tlistener: this.onShareEmitterChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t],\n\t\t\t\t() => {},\n\t\t\t\t() => {}\n\t\t\t);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\t}\n\t}\n\n\tsetDOMBasedMovement(err: StandardError, response: any) {\n\t\tif (response && response.hasOwnProperty(\"value\")) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tuseDOMBasedMovement: response.value,\n\t\t\t\t\tdragHandleName: response.value ? \"fsbl-drag-handle\" : \"fsbl-drag-handle-native-movement\",\n\t\t\t\t},\n\t\t\t\tthis.resizeDragHandle\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * When we are not tiling/tabbing, we want to allow the user to drag the window around via any available space in the tab-region. This function allows that.\n\t */\n\tallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: true,\n\t\t});\n\t}\n\n\t/**\n\t * When we are tiling/tabbing, we do not want to allow any window to be dragged around and moved.\n\t */\n\tdisallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: false,\n\t\t});\n\t}\n\n\t/**\n\t * When tiling start, we want to find the dragHandler and hide it\n\t */\n\tonTilingStart() {\n\t\tlet dragHandle = document.querySelector(`.${this.state.dragHandleName}`);\n\t\tif (dragHandle) {\n\t\t\tdragHandle.classList.add(\"hidden\");\n\t\t}\n\t}\n\n\t/**\n\t * When tiling stops, we want to find the dragHandler and re-show it\n\t */\n\tonTilingStop() {\n\t\tlet dragHandle = document.querySelector(`.${this.state.dragHandleName}.hidden`);\n\t\tif (dragHandle) {\n\t\t\tdragHandle.classList.remove(\"hidden\");\n\t\t}\n\t}\n\n\t/**\n\t * Called whenever a tab is dropped on a non tab area.\n\t * It won't be called when dropped on a tab that handles handle the event.\n\t */\n\tonDropHandler() {\n\t\tFSBL.Clients.RouterClient.transmit(\"DockingService.cancelTilingOrTabbing\", {});\n\t}\n\n\t/**\n\t * Called when user double clicks on drag handle\n\t */\n\tonDoubleClick() {\n\t\t// Actions.clickMaximize checks the window state\n\t\t// and toggles between maximize and minimize.\n\t\tActions.clickMaximize();\n\t}\n\n\t_setOnMouseUpAndDownHandlers(element: HTMLDivElement) {\n\t\t// if do double click it will invoke MouseDown and MouseUp events which could break the window bounds. So wait a 100ms for moving or resizing the window.\n\t\tlet isMousePressed = false;\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\tisMousePressed = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (isMousePressed) {\n\t\t\t\t\tFSBL.Clients.WindowClient.startMovingWindow(event);\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t};\n\t\tconst handleMouseUp = () => {\n\t\t\tisMousePressed = false;\n\t\t\tFSBL.Clients.WindowClient.stopMovingWindow();\n\t\t};\n\n\t\telement.onmousedown = handleMouseDown;\n\t\telement.onmouseup = handleMouseUp;\n\t}\n\n\tmakeDragHandle(fsblHeader: Element, dragHandleCssClass: string): HTMLElement {\n\t\tlet dragHandle = document.createElement(\"div\");\n\t\tdragHandle.className = dragHandleCssClass;\n\t\tthis._setOnMouseUpAndDownHandlers(dragHandle);\n\n\t\tdragHandle.ondblclick = () => {\n\t\t\tthis.onDoubleClick();\n\t\t};\n\t\tfsblHeader.insertBefore(dragHandle, fsblHeader.firstChild);\n\t\twindow.addEventListener(\"resize\", () => {\n\t\t\tthis.resizeDragHandle();\n\t\t});\n\n\t\treturn dragHandle;\n\t}\n\n\tdragHandleBoundsForShowTabs(startingBounds: DOMRect): DOMRect {\n\t\t// If there is more than one tab, then the drag area is the padding-left of fsbl-header-right\n\t\t// See .fsbl-tabs-multiple in the css\n\t\tif (this.state.tabs.length > 1) {\n\t\t\tconst headerRight = document.querySelector(\".fsbl-header-right\");\n\t\t\tif (headerRight) {\n\t\t\t\tconst computedStyle = getComputedStyle(headerRight);\n\t\t\t\t// override the bounds.width with the paddingLeft amount\n\t\t\t\treturn {\n\t\t\t\t\t// The spread operator only uses own properties; simply\n\t\t\t\t\t// spreading \"headerRight.getBoundingClientRect()\" will result in an\n\t\t\t\t\t// empty object being spread. Clone the object to be sure all\n\t\t\t\t\t// values are spread\n\t\t\t\t\t...clone(headerRight.getBoundingClientRect()),\n\t\t\t\t\twidth: parseInt(computedStyle.paddingLeft, 10),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn startingBounds;\n\t\t\t}\n\t\t} else {\n\t\t\t// If tabs are not enabled, then the remained of fsbl-header-center beyond the tabs\n\t\t\t// is the draggable area. This assumes left aligned tabs.\n\t\t\tconst fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\tconst bounds = fsblHeaderCenter?.getBoundingClientRect() ?? startingBounds;\n\t\t\tconst tabRegionWrapperDiv = fsblHeaderCenter?.querySelector(\".tab-region-wrapper div.fsbl-header-title\");\n\t\t\tif (tabRegionWrapperDiv) {\n\t\t\t\tconst theTabBounds = tabRegionWrapperDiv.getBoundingClientRect();\n\t\t\t\t// Calculate the right portion\n\t\t\t\treturn {\n\t\t\t\t\t...bounds,\n\t\t\t\t\tleft: bounds.left + theTabBounds.width,\n\t\t\t\t\twidth: bounds.width - theTabBounds.width,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn bounds;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * The dragger is an absolutely positioned element that is superimposed on the actual area that we'd like to drag.\n\t * This is necessary due to a bug in Chromium. Effectively, we need the dragger to change its left position and width\n\t * to match the intended drag area. These dimensions can change whenever the header is re-rendered (for instance when\n\t * changing mode from tabbing to non-tabbing). Dimensions can also change when the window itself is resized (due to natural\n\t * css).\n\t *\n\t * Can remove all of the cq-drag and cq-no-drag because Chromium bug is fixed\n\t * Remove fsbl-drag-region, it is no longer needed\n\t * Hide the dragHandle during drop operations, so that it doesn't interfere\n\t */\n\tresizeDragHandle() {\n\t\ttry {\n\t\t\tconst fsblHeader = document.querySelector(\".fsbl-header\");\n\t\t\t// If there isn't an FSBLHeader then there doesn't need to be a drag handle.\n\t\t\tif (!fsblHeader) return;\n\n\t\t\tconst dragHandleCssClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle\"\n\t\t\t\t: \"fsbl-drag-handle-native-movement\";\n\n\t\t\tconst dragHandleToRemoveClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle-native-movement\"\n\t\t\t\t: \"fsbl-drag-handle\";\n\n\t\t\t// Create the dragger if it doesn't already exist\n\t\t\tlet dragHandle =\n\t\t\t\t(document.querySelector(`.${dragHandleCssClass}`) as HTMLElement) ??\n\t\t\t\tthis.makeDragHandle(fsblHeader, dragHandleCssClass);\n\n\t\t\t// When the titlebar starts up, useDOMBasedMovement will have a default value that is not the same as the config value\n\t\t\t// When the value from the config propagates down to the UI, we need to make sure the old drag handle is removed in place of the new\n\t\t\tconst dragHandleToRemove = document.querySelector(`.${dragHandleToRemoveClass}`) as HTMLElement;\n\t\t\tif (dragHandleToRemove) dragHandleToRemove.parentNode?.removeChild(dragHandleToRemove);\n\n\t\t\t// Set the height of the dragHandle to match the height of the window title bar\n\t\t\t// Do this every time through the render loop just in case a customer builds a\n\t\t\t// header bar with dynamic height!\n\t\t\tlet bounds = fsblHeader.getBoundingClientRect();\n\n\t\t\tdragHandle.style.height = `${bounds.height - 5}px`; // Subtract 5 pixels from height in order to make room for resize window cursor at top edge of window\n\t\t\tdragHandle.style.marginTop = `${-bounds.height + 5}px`; // Negative margin pulls the drag handle up over the fixed header\n\n\t\t\t// Start logic for determining where to place our dragHandle\n\t\t\tif (this.state.showTabs) {\n\t\t\t\tbounds = this.dragHandleBoundsForShowTabs(bounds);\n\t\t\t} else {\n\t\t\t\t// If tabs are not enabled, then the entire center is the drag area\n\t\t\t\tlet fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\t\tif (fsblHeaderCenter) bounds = fsblHeaderCenter.getBoundingClientRect();\n\t\t\t}\n\n\t\t\tif (bounds) {\n\t\t\t\tdragHandle.style.left = `${bounds.left}px`;\n\t\t\t\tdragHandle.style.width = `${bounds.width}px`;\n\t\t\t}\n\n\t\t\t// Add an event listener to hide the drag-handler when tiling is started\n\t\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.onTilingStart);\n\n\t\t\t// Add an event listener to show the drag-handler when tiling is stopped or cancelled\n\t\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.onTilingStop);\n\t\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.onTilingStop);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Whether the component's config allows for the linker.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tshowLinkerButton(err: StandardError, response: any) {\n\t\tthis.setState({ showLinkerButton: response.value });\n\t}\n\n\t/**\n\t * Whether the window is the top-right-most window in a group of windows. If so, it renders a minimize icon for the whole group.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tisTopRight(err: StandardError, response: any) {\n\t\tthis.setState({ isTopRight: response.value });\n\t}\n\n\t/**\n\t * @param {*} err\n\t * @param {*} response\n\t */\n\tonTitleChange(err: StandardError, response: any) {\n\t\tlet { tabs } = this.state;\n\t\tlet myIdentifier = FSBL.Clients.WindowClient.getWindowIdentifier();\n\n\t\ttabs = tabs.map((el) => {\n\t\t\tif (!el.windowName && el.name) el.windowName = el.name;\n\t\t\tif (!el.name && el.windowName) el.name = el.windowName;\n\t\t\treturn el;\n\t\t});\n\n\t\tconst myIndex = tabs.findIndex((el: TabProperties) => el.name === myIdentifier.windowName);\n\t\tif (myIndex === -1) return;\n\n\t\tlet myTab = tabs[myIndex] || {};\n\t\tmyTab.title = response.value;\n\t\ttabs.splice(myIndex, 1, myTab);\n\n\t\tthis.setState({\n\t\t\twindowTitle: response.value,\n\t\t\ttabs: tabs,\n\t\t});\n\t}\n\n\t/**\n\t * The next few methods are store change handlers that sync local state with the store's state.\n\t */\n\tonShowDockingToolTip(err: StandardError, response: any) {\n\t\tthis.setState({ showDockingTooltip: response.value });\n\t}\n\n\tonToggleDockingIcon(err: StandardError, response: any) {\n\t\tthis.setState({ dockingIcon: response.value });\n\t}\n\n\tonDockingEnabledChanged(err: StandardError, response: any) {\n\t\tthis.setState({ dockingEnabled: response.value });\n\t}\n\n\tonAlwaysOnTopChanged(err: StandardError, response: any) {\n\t\tthis.setState({ alwaysOnTopButton: response.value });\n\t}\n\n\tonStoreChanged(newState: WindowTitleBarShellState) {\n\t\tthis.setState(newState);\n\t}\n\n\tonShareEmitterChanged(err: StandardError, response: any) {\n\t\tthis.setState({ showShareButton: response.value });\n\t}\n\n\tonTabsChanged(err: StandardError, response: any) {\n\t\tthis.setState({\n\t\t\ttabs: response.value,\n\t\t});\n\t}\n\n\tonShowTabsChanged(err: StandardError, response: any) {\n\t\t// If we are not showing tabs, then it means that it is a non tabbed window\n\t\t// therefore we need to check whether we have a window title contained in\n\t\t// .div.fsbl-tab-editor so that we can edit it.\n\t\tif (!response.value) {\n\t\t\tlet tabEditor = document.querySelector(\"div.fsbl-tab-editor\") as HTMLDivElement;\n\t\t\tif (tabEditor) {\n\t\t\t\t// we set this z-index value to be slightly higher than the drag handle\n\t\t\t\t// to make the editor dragable AND double-clickcable\n\t\t\t\ttabEditor.style.zIndex = \"2147483647\";\n\t\t\t\t// We add the mousedown and mouseup functions to the tab editor\n\t\t\t\t// so that on a single mouse down it allows the user to drag the\n\t\t\t\t// window on both the .fsbl-drag-handle and the .fsbl-tab-editor\n\t\t\t\tthis._setOnMouseUpAndDownHandlers(tabEditor);\n\t\t\t}\n\t\t}\n\t\tthis.setState({\n\t\t\tshowTabs: response.value,\n\t\t});\n\t}\n\n\t// Hack the window's scrollbar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\t// This is turned on by default. Set \"Window Manager.hackScrollbar: false\" to turn it off\n\thackScrollbar() {\n\t\tif (this.state.hackScrollbar) {\n\t\t\tconst htmlElement = document.querySelector(\"html\");\n\t\t\tif (htmlElement) htmlElement.style.overflowY = \"hidden\";\n\t\t\tconst bodyElement = document.querySelector(\"body\");\n\t\t\tif (bodyElement) bodyElement.style.overflowY = \"auto\";\n\t\t}\n\t}\n\n\trender() {\n\t\tlet showDockingIcon = !this.state.dockingEnabled ? false : this.state.dockingIcon;\n\t\tlet isGrouped = this.state.dockingIcon == \"ejector\";\n\t\tlet showMinimizeIcon = (isGrouped && this.state.isTopRight) || !isGrouped; // If not in a group or if topright in a group\n\t\tlet tabRegionClasses = \"fsbl-tab-area\";\n\t\tlet headerClasses = \"fsbl-header\";\n\n\t\t// If we're showing tabs, we throw these classes on to modify styles.\n\t\tif (this.state.showTabs) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-enabled`;\n\t\t}\n\t\tif (this.state.tabs.length > 1) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-multiple`;\n\t\t}\n\t\tconst context = {\n\t\t\tshowLinkerButton: this.state.showLinkerButton,\n\t\t\tshowShareButton: this.state.showShareButton,\n\t\t\tshowTabRegion: this.state.showTabs,\n\t\t\tshowMinimizeButton: this.state.minButton && showMinimizeIcon,\n\t\t\tshowMaximizeButton: this.state.maxButton,\n\t\t\tonTabDropped: this.allowDragOnCenterRegion,\n\t\t\tshowDockingButton: showDockingIcon,\n\t\t\tshowCloseButton: this.state.closeButton,\n\t\t\tclassName: tabRegionClasses,\n\t\t\tthisWindowTitle: this.state.windowTitle,\n\t\t\tboundingBox: this.state.tabBarBoundingBox,\n\t\t\tlistenForDragOver: !this.state.allowDragOnCenterRegion,\n\t\t\ttabs: this.state.tabs,\n\t\t\tonTitleUpdated: this.resizeDragHandle,\n\t\t\tshowAlwaysOnTopButton: this.state.alwaysOnTopButton && showMinimizeIcon,\n\t\t\tshowTabs: this.state.showTabs,\n\t\t\talwaysOnTop: this.state.alwaysOnTop,\n\t\t\tuseDOMBasedMovement: this.state.useDOMBasedMovement,\n\t\t};\n\n\t\treturn (\n\t\t\t<div className={headerClasses} onDrop={this.onDropHandler.bind(this)}>\n\t\t\t\t{this.state.initialized && (\n\t\t\t\t\t<WindowTitleBarContext.Provider value={context}>{this.props.children}</WindowTitleBarContext.Provider>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"WindowTitleBarShell.js","sourceRoot":"","sources":["../../../src/components/windowTitleBar/WindowTitleBarShell.tsx"],"names":[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Ae;YAC3C,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;YAClC,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,gBAAgB;YAC5D,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;YACxC,YAAY,EAAE,IAAI,CAAC,uBAAuB;YAC1C,iBAAiB,EAAE,eAAe;YAClC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACvC,SAAS,EAAE,gBAAgB;YAC3B,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACvC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB;YACzC,iBAAiB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,uBAAuB;YACtD,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,cAAc,EAAE,IAAI,CAAC,gBAAgB;YACrC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,gBAAgB;YACvE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACnC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB;SACnD,CAAC;QAEF,OAAO,CACN,6BAAK,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAClE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAC1B,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAkC,CACtG,CACI,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport * as React from \"react\";\nimport { WindowTitleBarContext } from \"./windowTitleBarContext\";\nimport { storeManager, Actions, getStore } from \"./stores/windowTitleBarStore\";\nimport \"../../assets/css/windowTitleBar.css\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { TabProperties } from \"../../types/windowTitleBar\";\nimport { clone } from \"./../sdd/Appearance.helpers\";\nimport { Logger } from \"@finsemble/finsemble-api\";\n\ntype BumpElements = {\n\tbumpBy: string;\n\tfixed: string;\n\tabsolute: string;\n};\n\ninterface WindowTitleBarShellProps {}\n\ninterface WindowTitleBarShellState {\n\ttabs: TabProperties[];\n\tactiveTab: TabProperties;\n\twindowTitle: string;\n\tinitialized: boolean;\n\talwaysOnTop: boolean;\n\tshowTabs: boolean;\n\tminButton: boolean;\n\tmaxButton: boolean;\n\tcloseButton: boolean;\n\tshowShareButton: boolean;\n\tshowLinkerButton: boolean;\n\tisTopRight: boolean;\n\tdockingEnabled: boolean;\n\talwaysOnTopButton: boolean;\n\tallowDragOnCenterRegion: boolean;\n\tdockingIcon: string;\n\thackScrollbar: boolean;\n\tshowDockingTooltip: boolean;\n\tshowTabRegion: boolean;\n\ttabBarBoundingBox: any;\n\tuseDOMBasedMovement: boolean;\n\tdragHandleName: string;\n\tbumpElements: BumpElements;\n\tadjustContentHeights: boolean;\n}\n\nexport class WindowTitleBarShell extends React.Component<WindowTitleBarShellProps, WindowTitleBarShellState> {\n\tstore?: StoreModel;\n\n\tconstructor(props: WindowTitleBarShellProps) {\n\t\tsuper(props);\n\t\tthis.store = undefined;\n\n\t\tthis.bindCorrectContext();\n\t\tthis.state = {\n\t\t\tactiveTab: FSBL.Clients.WindowClient.getWindowIdentifier() as TabProperties,\n\t\t\tallowDragOnCenterRegion: true,\n\t\t\talwaysOnTop: false,\n\t\t\talwaysOnTopButton: false,\n\t\t\tcloseButton: false,\n\t\t\tdockingEnabled: false,\n\t\t\tdockingIcon: \"\",\n\t\t\thackScrollbar: false,\n\t\t\tinitialized: false,\n\t\t\tisTopRight: false,\n\t\t\tmaxButton: false,\n\t\t\tminButton: false,\n\t\t\tshowDockingTooltip: false,\n\t\t\tshowLinkerButton: false,\n\t\t\tshowShareButton: false,\n\t\t\tshowTabs: false,\n\t\t\tshowTabRegion: false,\n\t\t\ttabs: [],\n\t\t\ttabBarBoundingBox: {},\n\t\t\twindowTitle: \"\",\n\t\t\tuseDOMBasedMovement: true,\n\t\t\tdragHandleName: \"fsbl-drag-handle\",\n\t\t\tbumpElements: {} as BumpElements,\n\t\t\tadjustContentHeights: true,\n\t\t};\n\n\t\tfinsembleWindow.isAlwaysOnTop({}, (err, alwaysOnTop: boolean) => {\n\t\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t\t});\n\n\t\tfinsembleWindow.addEventListener(\"alwaysOnTop\", this.alwaysOnTopListener);\n\t}\n\n\talwaysOnTopListener({ data: { alwaysOnTop } }: any) {\n\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t}\n\n\t/**\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\n\t *\n\t * @memberof WindowTitleBar\n\t */\n\tbindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDockingEnabledChanged = this.onDockingEnabledChanged.bind(this);\n\t\tthis.onAlwaysOnTopChanged = this.onAlwaysOnTopChanged.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t\tthis.isTopRight = this.isTopRight.bind(this);\n\t\tthis.allowDragOnCenterRegion = this.allowDragOnCenterRegion.bind(this);\n\t\tthis.disallowDragOnCenterRegion = this.disallowDragOnCenterRegion.bind(this);\n\t\tthis.setDOMBasedMovement = this.setDOMBasedMovement.bind(this);\n\t\tthis.onShareEmitterChanged = this.onShareEmitterChanged.bind(this);\n\t\tthis.onTabsChanged = this.onTabsChanged.bind(this);\n\t\tthis.onShowTabsChanged = this.onShowTabsChanged.bind(this);\n\t\tthis.onTilingStop = this.onTilingStop.bind(this);\n\t\tthis.onTilingStart = this.onTilingStart.bind(this);\n\t\tthis.resizeDragHandle = this.resizeDragHandle.bind(this);\n\t\tthis.onDoubleClick = this.onDoubleClick.bind(this);\n\t\tthis.alwaysOnTopListener = this.alwaysOnTopListener.bind(this);\n\t\tthis.onInitialized = this.onInitialized.bind(this);\n\t}\n\n\tonInitialized() {\n\t\tthis.store = getStore();\n\t\tthis.store.addListeners(\n\t\t\t[\n\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t{ field: \"Main.showDockingTooltip\", listener: this.onShowDockingToolTip },\n\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t{ field: \"Main.dockingEnabled\", listener: this.onDockingEnabledChanged },\n\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t{ field: \"Sharer.emitterEnabled\", listener: this.onShareEmitterChanged },\n\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"hackScrollbar\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"Main.useDOMBasedMovement\", listener: this.setDOMBasedMovement },\n\t\t\t],\n\t\t\t() => {}\n\t\t);\n\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.allowDragOnCenterRegion);\n\n\t\tthis.onStoreChange();\n\t\tthis.setState({\n\t\t\tinitialized: true,\n\t\t});\n\t}\n\n\tonStoreChange() {\n\t\tlet activeIdentifier = finsembleWindow.identifier as TabProperties;\n\t\tactiveIdentifier.title = this.store?.getValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t});\n\n\t\tthis.setState({\n\t\t\twindowTitle: this.store?.getValue({ field: \"Main.windowTitle\" }),\n\t\t\tminButton: !this.store?.getValue({ field: \"Minimize.hide\" }),\n\t\t\tmaxButton: !this.store?.getValue({ field: \"Maximize.hide\" }),\n\t\t\tcloseButton: !this.store?.getValue({ field: \"Close.hide\" }),\n\t\t\tshowLinkerButton: this.store?.getValue({\n\t\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\t}),\n\t\t\tshowShareButton: this.store?.getValue({\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t}),\n\t\t\tisTopRight: this.store?.getValue({ field: \"isTopRight\" }),\n\t\t\talwaysOnTopButton: this.store?.getValue({\n\t\t\t\tfield: \"AlwaysOnTop.show\",\n\t\t\t}),\n\t\t\tshowTabs: this.store?.getValue({ field: \"showTabs\" }),\n\t\t\thackScrollbar: this.store?.getValue({ field: \"hackScrollbar\" }),\n\t\t\tbumpElements: this.store?.getValue({ field: \"bumpElements\" }),\n\t\t\tadjustContentHeights: this.store?.getValue({ field: \"adjustContentHeights\" }),\n\t\t\ttabs: [activeIdentifier], // array of tabs for this window\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\t// Goal: If a user gets focus into the title bar (if they Alt+Tab or Cmd+Tab into the window),\n\t\t// we want to let get into the rest of the component using the keyboard alone. The UX for\n\t\t// this task will be to seemingly TAB from the title bar into the window, if possible.\n\t\t// Code: If the user presses the \"Tab\" key, move their focus to the browser view\n\t\twindow.addEventListener(\"keydown\", (e) => {\n\t\t\tif (e.key === \"Tab\") {\n\t\t\t\t// This magic moves focus to a browserView, if one exists\n\t\t\t\tfinsembleWindow.focus();\n\t\t\t}\n\t\t});\n\t\tlet header = document.getElementsByClassName(\"fsbl-header\")[0];\n\n\t\t//Add a margin top to the body if there title bar is injected into the component.\n\t\tif (header) document.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\t\tthis.resizeDragHandle();\n\t\tthis.hackScrollbar();\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.resizeDragHandle();\n\t\tthis.hackScrollbar();\n\t\tthis.maybeAdjustWindow();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\n\t\tif (this.state.initialized) {\n\t\t\tthis.store?.removeListeners(\n\t\t\t\t[\n\t\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.showDockingTooltip\",\n\t\t\t\t\t\tlistener: this.onShowDockingToolTip,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.dockingEnabled\",\n\t\t\t\t\t\tlistener: this.onDockingEnabledChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\t\t\tlistener: this.onShareEmitterChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t],\n\t\t\t\t() => {},\n\t\t\t\t() => {}\n\t\t\t);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\t}\n\t}\n\n\tsetDOMBasedMovement(err: StandardError, response: any) {\n\t\tif (response && response.hasOwnProperty(\"value\")) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tuseDOMBasedMovement: response.value,\n\t\t\t\t\tdragHandleName: response.value ? \"fsbl-drag-handle\" : \"fsbl-drag-handle-native-movement\",\n\t\t\t\t},\n\t\t\t\tthis.resizeDragHandle\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * When we are not tiling/tabbing, we want to allow the user to drag the window around via any available space in the tab-region. This function allows that.\n\t */\n\tallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: true,\n\t\t});\n\t}\n\n\t/**\n\t * When we are tiling/tabbing, we do not want to allow any window to be dragged around and moved.\n\t */\n\tdisallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: false,\n\t\t});\n\t}\n\n\t/**\n\t * When tiling start, we want to find the dragHandler and hide it\n\t */\n\tonTilingStart() {\n\t\tlet dragHandle = document.querySelector(`.${this.state.dragHandleName}`);\n\t\tif (dragHandle) {\n\t\t\tdragHandle.classList.add(\"hidden\");\n\t\t}\n\t}\n\n\t/**\n\t * When tiling stops, we want to find the dragHandler and re-show it\n\t */\n\tonTilingStop() {\n\t\tlet dragHandle = document.querySelector(`.${this.state.dragHandleName}.hidden`);\n\t\tif (dragHandle) {\n\t\t\tdragHandle.classList.remove(\"hidden\");\n\t\t}\n\t}\n\n\t/**\n\t * Called whenever a tab is dropped on a non tab area.\n\t * It won't be called when dropped on a tab that handles handle the event.\n\t */\n\tonDropHandler() {\n\t\tFSBL.Clients.RouterClient.transmit(\"DockingService.cancelTilingOrTabbing\", {});\n\t}\n\n\t/**\n\t * Called when user double clicks on drag handle\n\t */\n\tonDoubleClick() {\n\t\t// Actions.clickMaximize checks the window state\n\t\t// and toggles between maximize and minimize.\n\t\tActions.clickMaximize();\n\t}\n\n\t_setOnMouseUpAndDownHandlers(element: HTMLDivElement) {\n\t\t// if do double click it will invoke MouseDown and MouseUp events which could break the window bounds. So wait a 100ms for moving or resizing the window.\n\t\tlet isMousePressed = false;\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\tisMousePressed = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (isMousePressed) {\n\t\t\t\t\tFSBL.Clients.WindowClient.startMovingWindow(event);\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t};\n\t\tconst handleMouseUp = () => {\n\t\t\tisMousePressed = false;\n\t\t\tFSBL.Clients.WindowClient.stopMovingWindow();\n\t\t};\n\n\t\telement.onmousedown = handleMouseDown;\n\t\telement.onmouseup = handleMouseUp;\n\t}\n\n\tmakeDragHandle(fsblHeader: Element, dragHandleCssClass: string): HTMLElement {\n\t\tlet dragHandle = document.createElement(\"div\");\n\t\tdragHandle.className = dragHandleCssClass;\n\t\tthis._setOnMouseUpAndDownHandlers(dragHandle);\n\n\t\tdragHandle.ondblclick = () => {\n\t\t\tthis.onDoubleClick();\n\t\t};\n\t\tfsblHeader.insertBefore(dragHandle, fsblHeader.firstChild);\n\t\twindow.addEventListener(\"resize\", () => {\n\t\t\tthis.resizeDragHandle();\n\t\t});\n\n\t\treturn dragHandle;\n\t}\n\n\tdragHandleBoundsForShowTabs(startingBounds: DOMRect): DOMRect {\n\t\t// If there is more than one tab, then the drag area is the padding-left of fsbl-header-right\n\t\t// See .fsbl-tabs-multiple in the css\n\t\tif (this.state.tabs.length > 1) {\n\t\t\tconst headerRight = document.querySelector(\".fsbl-header-right\");\n\t\t\tif (headerRight) {\n\t\t\t\tconst computedStyle = getComputedStyle(headerRight);\n\t\t\t\t// override the bounds.width with the paddingLeft amount\n\t\t\t\treturn {\n\t\t\t\t\t// The spread operator only uses own properties; simply\n\t\t\t\t\t// spreading \"headerRight.getBoundingClientRect()\" will result in an\n\t\t\t\t\t// empty object being spread. Clone the object to be sure all\n\t\t\t\t\t// values are spread\n\t\t\t\t\t...clone(headerRight.getBoundingClientRect()),\n\t\t\t\t\twidth: parseInt(computedStyle.paddingLeft, 10),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn startingBounds;\n\t\t\t}\n\t\t} else {\n\t\t\t// If tabs are not enabled, then the remained of fsbl-header-center beyond the tabs\n\t\t\t// is the draggable area. This assumes left aligned tabs.\n\t\t\tconst fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\tconst bounds = fsblHeaderCenter?.getBoundingClientRect() ?? startingBounds;\n\t\t\tconst tabRegionWrapperDiv = fsblHeaderCenter?.querySelector(\".tab-region-wrapper div.fsbl-header-title\");\n\t\t\tif (tabRegionWrapperDiv) {\n\t\t\t\tconst theTabBounds = tabRegionWrapperDiv.getBoundingClientRect();\n\t\t\t\t// Calculate the right portion\n\t\t\t\treturn {\n\t\t\t\t\t...bounds,\n\t\t\t\t\tleft: bounds.left + theTabBounds.width,\n\t\t\t\t\twidth: bounds.width - theTabBounds.width,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn bounds;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * The dragger is an absolutely positioned element that is superimposed on the actual area that we'd like to drag.\n\t * This is necessary due to a bug in Chromium. Effectively, we need the dragger to change its left position and width\n\t * to match the intended drag area. These dimensions can change whenever the header is re-rendered (for instance when\n\t * changing mode from tabbing to non-tabbing). Dimensions can also change when the window itself is resized (due to natural\n\t * css).\n\t *\n\t * Can remove all of the cq-drag and cq-no-drag because Chromium bug is fixed\n\t * Remove fsbl-drag-region, it is no longer needed\n\t * Hide the dragHandle during drop operations, so that it doesn't interfere\n\t */\n\tresizeDragHandle() {\n\t\ttry {\n\t\t\tconst fsblHeader = document.querySelector(\".fsbl-header\");\n\t\t\t// If there isn't an FSBLHeader then there doesn't need to be a drag handle.\n\t\t\tif (!fsblHeader) return;\n\n\t\t\tconst dragHandleCssClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle\"\n\t\t\t\t: \"fsbl-drag-handle-native-movement\";\n\n\t\t\tconst dragHandleToRemoveClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle-native-movement\"\n\t\t\t\t: \"fsbl-drag-handle\";\n\n\t\t\t// Create the dragger if it doesn't already exist\n\t\t\tlet dragHandle =\n\t\t\t\t(document.querySelector(`.${dragHandleCssClass}`) as HTMLElement) ??\n\t\t\t\tthis.makeDragHandle(fsblHeader, dragHandleCssClass);\n\n\t\t\t// When the titlebar starts up, useDOMBasedMovement will have a default value that is not the same as the config value\n\t\t\t// When the value from the config propagates down to the UI, we need to make sure the old drag handle is removed in place of the new\n\t\t\tconst dragHandleToRemove = document.querySelector(`.${dragHandleToRemoveClass}`) as HTMLElement;\n\t\t\tif (dragHandleToRemove) dragHandleToRemove.parentNode?.removeChild(dragHandleToRemove);\n\n\t\t\t// Set the height of the dragHandle to match the height of the window title bar\n\t\t\t// Do this every time through the render loop just in case a customer builds a\n\t\t\t// header bar with dynamic height!\n\t\t\tlet bounds = fsblHeader.getBoundingClientRect();\n\n\t\t\tdragHandle.style.height = `${bounds.height - 5}px`; // Subtract 5 pixels from height in order to make room for resize window cursor at top edge of window\n\t\t\tdragHandle.style.marginTop = `${-bounds.height + 5}px`; // Negative margin pulls the drag handle up over the fixed header\n\n\t\t\t// Start logic for determining where to place our dragHandle\n\t\t\tif (this.state.showTabs) {\n\t\t\t\tbounds = this.dragHandleBoundsForShowTabs(bounds);\n\t\t\t} else {\n\t\t\t\t// If tabs are not enabled, then the entire center is the drag area\n\t\t\t\tlet fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\t\tif (fsblHeaderCenter) bounds = fsblHeaderCenter.getBoundingClientRect();\n\t\t\t}\n\n\t\t\tif (bounds) {\n\t\t\t\tdragHandle.style.left = `${bounds.left}px`;\n\t\t\t\tdragHandle.style.width = `${bounds.width}px`;\n\t\t\t}\n\n\t\t\t// Add an event listener to hide the drag-handler when tiling is started\n\t\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.onTilingStart);\n\n\t\t\t// Add an event listener to show the drag-handler when tiling is stopped or cancelled\n\t\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.onTilingStop);\n\t\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.onTilingStop);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Whether the component's config allows for the linker.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tshowLinkerButton(err: StandardError, response: any) {\n\t\tthis.setState({ showLinkerButton: response.value });\n\t}\n\n\t/**\n\t * Whether the window is the top-right-most window in a group of windows. If so, it renders a minimize icon for the whole group.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tisTopRight(err: StandardError, response: any) {\n\t\tthis.setState({ isTopRight: response.value });\n\t}\n\n\t/**\n\t * @param {*} err\n\t * @param {*} response\n\t */\n\tonTitleChange(err: StandardError, response: any) {\n\t\tlet { tabs } = this.state;\n\t\tlet myIdentifier = FSBL.Clients.WindowClient.getWindowIdentifier();\n\n\t\ttabs = tabs.map((el) => {\n\t\t\tif (!el.windowName && el.name) el.windowName = el.name;\n\t\t\tif (!el.name && el.windowName) el.name = el.windowName;\n\t\t\treturn el;\n\t\t});\n\n\t\tconst myIndex = tabs.findIndex((el: TabProperties) => el.name === myIdentifier.windowName);\n\t\tif (myIndex === -1) return;\n\n\t\tlet myTab = tabs[myIndex] || {};\n\t\tmyTab.title = response.value;\n\t\ttabs.splice(myIndex, 1, myTab);\n\n\t\tthis.setState({\n\t\t\twindowTitle: response.value,\n\t\t\ttabs: tabs,\n\t\t});\n\t}\n\n\t/**\n\t * The next few methods are store change handlers that sync local state with the store's state.\n\t */\n\tonShowDockingToolTip(err: StandardError, response: any) {\n\t\tthis.setState({ showDockingTooltip: response.value });\n\t}\n\n\tonToggleDockingIcon(err: StandardError, response: any) {\n\t\tthis.setState({ dockingIcon: response.value });\n\t}\n\n\tonDockingEnabledChanged(err: StandardError, response: any) {\n\t\tthis.setState({ dockingEnabled: response.value });\n\t}\n\n\tonAlwaysOnTopChanged(err: StandardError, response: any) {\n\t\tthis.setState({ alwaysOnTopButton: response.value });\n\t}\n\n\tonStoreChanged(newState: WindowTitleBarShellState) {\n\t\tthis.setState(newState);\n\t}\n\n\tonShareEmitterChanged(err: StandardError, response: any) {\n\t\tthis.setState({ showShareButton: response.value });\n\t}\n\n\tonTabsChanged(err: StandardError, response: any) {\n\t\tthis.setState({\n\t\t\ttabs: response.value,\n\t\t});\n\t}\n\n\tonShowTabsChanged(err: StandardError, response: any) {\n\t\t// If we are not showing tabs, then it means that it is a non tabbed window\n\t\t// therefore we need to check whether we have a window title contained in\n\t\t// .div.fsbl-tab-editor so that we can edit it.\n\t\tif (!response.value) {\n\t\t\tlet tabEditor = document.querySelector(\"div.fsbl-tab-editor\") as HTMLDivElement;\n\t\t\tif (tabEditor) {\n\t\t\t\t// we set this z-index value to be slightly higher than the drag handle\n\t\t\t\t// to make the editor dragable AND double-clickcable\n\t\t\t\ttabEditor.style.zIndex = \"2147483647\";\n\t\t\t\t// We add the mousedown and mouseup functions to the tab editor\n\t\t\t\t// so that on a single mouse down it allows the user to drag the\n\t\t\t\t// window on both the .fsbl-drag-handle and the .fsbl-tab-editor\n\t\t\t\tthis._setOnMouseUpAndDownHandlers(tabEditor);\n\t\t\t}\n\t\t}\n\t\tthis.setState({\n\t\t\tshowTabs: response.value,\n\t\t});\n\t}\n\n\t// Hack the window's scrollbar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\t// This is turned on by default. Set \"Window Manager.hackScrollbar: false\" to turn it off\n\thackScrollbar() {\n\t\tif (this.state.hackScrollbar) {\n\t\t\tconst htmlElement = document.querySelector(\"html\");\n\t\t\tif (htmlElement) htmlElement.style.overflowY = \"hidden\";\n\t\t\tconst bodyElement = document.querySelector(\"body\");\n\t\t\tif (bodyElement) bodyElement.style.overflowY = \"auto\";\n\t\t}\n\t}\n\n\t/**\n\t * Once document is ready and header is injected into DOM, begin adjusting the height of elements and bump fixed/absolute elements\n\t */\n\tasync maybeAdjustWindow() {\n\t\tconst beginAdjustment = () => {\n\t\t\tconst header = document.getElementsByClassName(\"fsbl-header\")[0];\n\t\t\tif (header) {\n\t\t\t\tif (this.state.adjustContentHeights) {\n\t\t\t\t\tconst headerHeight = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\t\t\t\t\tthis.adjustTopLevelHeight(Number(headerHeight.split(\"px\")[0]));\n\t\t\t\t}\n\n\t\t\t\tthis.bumpElements(this.state.bumpElements);\n\t\t\t} else {\n\t\t\t\tLogger.system.error(\"WindowTitleBarShell.maybeAdjustWindow:could not find the header.\");\n\t\t\t}\n\t\t};\n\n\t\t// don't start pushing stuff down until page is ready. This is needed for preloaded titlebars because they can happen before the page is ready.\n\t\tif (document.readyState === \"complete\") beginAdjustment();\n\t\telse {\n\t\t\tdocument.addEventListener(\"readystatechange\", () => {\n\t\t\t\tif (document.readyState === \"complete\") beginAdjustment();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Calls functions to bump fixed and/or absolute elements if configured to do so.\n\t * @param {object} config bumpElements object\n\t */\n\tbumpElements(config: BumpElements) {\n\t\tif (config?.bumpBy && config?.bumpBy !== \"0px\") {\n\t\t\tif (config.fixed) this.bumpFixedElements(config);\n\t\t\tif (config.absolute) this.bumpAbsoluteElements(config);\n\t\t}\n\t}\n\n\t/**\n\t * Set the max height of each element to be the height of the parent container\n\t * subtracted by the height of the previous element. This forces the element to either obey its\n\t * predefined height or stay within the bounds of the max height.\n\t * @param {object} elem HTML element\n\t * @param {number} prev height of previous sibling\n\t * @param maxHeight\n\t */\n\tprivate adjust(elem: HTMLElement, prev: number, headerHeight: number, maxHeight: string = \"100vh\") {\n\t\tif (!elem.className.includes(\"bumped-element\")) {\n\t\t\t// used to check if the element has a specified absolute height e.g height: '100px' -> ['100', 'px'], instead of\n\t\t\t// a dynamic one such as 100% or 100vh\n\t\t\tconst absoluteUnit = [\"px\", \"pt\", \"pc\"];\n\t\t\t// filter(Boolean) filters out '' or else this would return '10px' => ['10', 'px', '']\n\t\t\tconst heightStyle = elem.style.height.split(/(p[a-z])/).filter(Boolean);\n\n\t\t\tconst clientHeight = elem.clientHeight ? elem.clientHeight : 0;\n\t\t\tconst offsetHeight = elem.offsetHeight ? elem.offsetHeight : 0;\n\t\t\tconst offset = offsetHeight - clientHeight;\n\t\t\tconst adjustPrev = prev + offset;\n\n\t\t\t// if the element has a dynamic height then add a maxHeight and reduce its height by the header height\n\t\t\tconst heightUnit = heightStyle[heightStyle.length - 1];\n\t\t\tif (heightStyle.length && !absoluteUnit.includes(heightUnit)) {\n\t\t\t\telem.style.height = `calc(${elem.style.height} - ${headerHeight}px)`;\n\t\t\t\telem.style.maxHeight = `calc(${maxHeight} - ${adjustPrev}px)`;\n\t\t\t\telem.classList.add(\"bumped-element\");\n\t\t\t} else if (!heightStyle.length) {\n\t\t\t\telem.style.maxHeight = `calc(${maxHeight} - ${adjustPrev}px)`;\n\t\t\t\telem.classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Adjusts the top level content view height to be its height subtracted by the headerHeight and its\n\t * maxHeight to be 100vh subtracted by the total height of the previous elements.\n\t * The height of the previous elements are added to this calculation if they are not fixed or absolute.\n\t * @param {number} headerHeight the height of the header\n\t */\n\tprivate adjustTopLevelHeight(headerHeight: number) {\n\t\tconst elems: any = document.body.querySelectorAll(\":scope > *:not(#FSBLHeader, .fsbl-header)\");\n\t\tlet prev = headerHeight;\n\n\t\telems.forEach((elem: any) => {\n\t\t\tthis.adjust(elem, prev, headerHeight);\n\t\t\t// Heights of fixed and absolute positioned elements are not added to the total heights of previous elements\n\t\t\t// since they are removed from the document flow and can be positioned anywhere in the page.\n\t\t\tif (elem.style.position !== \"fixed\" && elem.style.position !== \"absolute\") prev = prev + elem.offsetHeight;\n\n\t\t\tthis.adjustContentHeight(elem, headerHeight);\n\t\t});\n\t}\n\n\t/**\n\t * Adjusts the content view height to be maximum the parent container height subtracted by the total height elements above it.\n\t * The height of the previous elements are added to this calculation if they are not fixed or absolute.\n\t * @param {object} headerNode window titlebar\n\t * @param {number} headerHeight the height of the header\n\t */\n\tprivate adjustContentHeight(headerNode: any, headerHeight: number) {\n\t\tconst elem: any = headerNode;\n\t\tconst maxHeight = `100%`;\n\n\t\tconst { children } = elem;\n\t\tconst len = children.length;\n\t\tlet prev = 0;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\t// Fixed and absolute positioned elements are ignored since they are removed from the document flow.\n\t\t\tif (children[i].style.position !== \"fixed\" && children[i].style.position !== \"absolute\") {\n\t\t\t\tthis.adjust(children[i], prev, headerHeight, maxHeight);\n\t\t\t\tprev = prev + children[i].offsetHeight;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calculates value to bump element by. If 'all' return top style and header height, if '0Positioned' return header height\n\t * @param type Whether all elements are being bumped by the header height and their top style or just header height\n\t * @param topStyle Element top value\n\t * @param bumpBy Value to bump element by\n\t * @returns Top style for element\n\t */\n\tprivate calculateBumpValue(type: string, topStyle: string, bumpBy: string) {\n\t\tlet topVal;\n\t\tconst possibleZeros = [\"0\", \"0px\", 0];\n\t\tif (type == \"all\") {\n\t\t\ttopVal = `calc(${topStyle} + ${bumpBy})`;\n\t\t} else if (type == \"0Positioned\" && possibleZeros.includes(topStyle)) {\n\t\t\ttopVal = bumpBy;\n\t\t}\n\t\treturn topVal;\n\t}\n\n\t/**\n\t * Recursively traverse through the HTML document and return an array of the top level elements\n\t * and elements with static parents\n\t * @param {object} element The HTML element\n\t * @param {array} acc accumulator\n\t * @returns {array} array top level elements and elements with static parents\n\t *\n\t */\n\tprivate traverseHtml(element: any, acc: any[] = []) {\n\t\tconst elems: any = element.children;\n\t\tconst len = elems.length;\n\t\tif (!len) {\n\t\t\tacc.push(element);\n\t\t} else {\n\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\t\t\t\tif (style.getPropertyValue(\"position\") == \"static\") {\n\t\t\t\t\tacc = this.traverseHtml(elems[i], acc);\n\t\t\t\t} else {\n\t\t\t\t\tacc.push(elems[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t}\n\n\t/**\n\t * Bumps elements with fixed positioning down by the configured amount.\n\t * @private\n\t */\n\tprivate bumpFixedElements(params: any) {\n\t\tlet { fixed, bumpBy } = params;\n\n\t\tconst getFixedElements = (nodes: any) => {\n\t\t\tconst fixedElems: any[] = [];\n\t\t\tnodes.forEach((node: any) => {\n\t\t\t\tconst style = window.getComputedStyle(node, null);\n\t\t\t\tif (style.getPropertyValue(\"position\") == \"fixed\") fixedElems.push(node);\n\t\t\t\tconst elems = node.querySelectorAll(\"*\");\n\t\t\t\telems.forEach((elem: any) => {\n\t\t\t\t\tconst childStyle = window.getComputedStyle(elem, null);\n\t\t\t\t\tif (childStyle.getPropertyValue(\"position\") == \"fixed\") fixedElems.push(elem);\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn fixedElems;\n\t\t};\n\n\t\tconst selector = \"*:not(#FSBLHeader, .fsbl-header)\";\n\t\t// Get all fixed positioned elements\n\t\tconst elems: any = getFixedElements(document.body.querySelectorAll(`${selector}`));\n\t\tconst len = elems.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\n\t\t\tconst topStyle = style.getPropertyValue(\"top\");\n\t\t\tif (!elems[i].className.includes(\"bumped-element\")) {\n\t\t\t\telems[i].style.top = this.calculateBumpValue(fixed, topStyle, bumpBy);\n\t\t\t\telems[i].classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bumps absolute positioned elements with static parents down by the configured amount.\n\t * @private\n\t */\n\tprivate bumpAbsoluteElements(params: any) {\n\t\tlet { absolute, bumpBy } = params;\n\n\t\tconst selector = \"*:not(#FSBLHeader, .fsbl-header)\";\n\t\t// Get top level absolute positioned elements and elements who have static parents\n\t\tconst elems: any = this.traverseHtml({ children: document.body.querySelectorAll(`:scope > ${selector}`) });\n\t\tconst len = elems.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\n\t\t\tconst topStyle = style.getPropertyValue(\"top\");\n\n\t\t\t// Target absolute positioned elements\n\t\t\tif (style.getPropertyValue(\"position\") == \"absolute\" && !elems[i].className.includes(\"bumped-element\")) {\n\t\t\t\telems[i].style.top = this.calculateBumpValue(absolute, topStyle, bumpBy);\n\t\t\t\telems[i].classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tlet showDockingIcon = !this.state.dockingEnabled ? false : this.state.dockingIcon;\n\t\tlet isGrouped = this.state.dockingIcon == \"ejector\";\n\t\tlet showMinimizeIcon = (isGrouped && this.state.isTopRight) || !isGrouped; // If not in a group or if topright in a group\n\t\tlet tabRegionClasses = \"fsbl-tab-area\";\n\t\tlet headerClasses = \"fsbl-header\";\n\n\t\t// If we're showing tabs, we throw these classes on to modify styles.\n\t\tif (this.state.showTabs) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-enabled`;\n\t\t}\n\t\tif (this.state.tabs.length > 1) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-multiple`;\n\t\t}\n\t\tconst context = {\n\t\t\tshowLinkerButton: this.state.showLinkerButton,\n\t\t\tshowShareButton: this.state.showShareButton,\n\t\t\tshowTabRegion: this.state.showTabs,\n\t\t\tshowMinimizeButton: this.state.minButton && showMinimizeIcon,\n\t\t\tshowMaximizeButton: this.state.maxButton,\n\t\t\tonTabDropped: this.allowDragOnCenterRegion,\n\t\t\tshowDockingButton: showDockingIcon,\n\t\t\tshowCloseButton: this.state.closeButton,\n\t\t\tclassName: tabRegionClasses,\n\t\t\tthisWindowTitle: this.state.windowTitle,\n\t\t\tboundingBox: this.state.tabBarBoundingBox,\n\t\t\tlistenForDragOver: !this.state.allowDragOnCenterRegion,\n\t\t\ttabs: this.state.tabs,\n\t\t\tonTitleUpdated: this.resizeDragHandle,\n\t\t\tshowAlwaysOnTopButton: this.state.alwaysOnTopButton && showMinimizeIcon,\n\t\t\tshowTabs: this.state.showTabs,\n\t\t\talwaysOnTop: this.state.alwaysOnTop,\n\t\t\tuseDOMBasedMovement: this.state.useDOMBasedMovement,\n\t\t};\n\n\t\treturn (\n\t\t\t<div className={headerClasses} onDrop={this.onDropHandler.bind(this)}>\n\t\t\t\t{this.state.initialized && (\n\t\t\t\t\t<WindowTitleBarContext.Provider value={context}>{this.props.children}</WindowTitleBarContext.Provider>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
@@ -44,7 +44,13 @@ const LinkerButtonRedux = () => {
44
44
  }
45
45
  };
46
46
  const displayMe = state.clients[finsembleWindow.name] !== undefined;
47
- FSBL.Clients.HotkeyClient.addBrowserHotkey(["CommandOrControl", "l"], showLinkerWindow);
47
+ useEffect(() => {
48
+ window.addEventListener("keydown", (e) => {
49
+ if (e.key === "l" && (e.ctrlKey || e.metaKey)) {
50
+ showLinkerWindow();
51
+ }
52
+ });
53
+ }, []);
48
54
  return (React.createElement(React.Fragment, null, displayMe && (React.createElement("div", { ref: buttonRef, title: "Link Data", className: "linkerSection" },
49
55
  React.createElement("div", { className: "fsbl-icon fsbl-linker", onClick: showLinkerWindow },
50
56
  React.createElement(LinkerButtonIcon, null)),
@@ -1 +1 @@
1
- {"version":3,"file":"LinkerButton.js","sourceRoot":"","sources":["../../../../../src/components/windowTitleBar/components/left/LinkerButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,OA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f;QACN,oBAAC,YAAY,OAAG,CACX,CACN,CACC,CACH,CAAC;AACH,CAAC,CAAC;AAQF,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACd,CAAC,KAAK,IAAI,EAAE;YACX,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC;gBACzD,KAAK,EAAE,yCAAyC;aAChD,CAAC,CAAC;YACH,IAAI,IAAI,EAAE;gBACT,cAAc,CAAC,yBAAyB,CAAC,CAAC;aAC1C;iBAAM;gBACN,cAAc,CAAC,eAAe,CAAC,CAAC;aAChC;QACF,CAAC,CAAC,EAAE,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACN;QACE,WAAW,KAAK,eAAe,IAAI,CACnC,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;YACrB,oBAAC,iBAAiB,OAAG,CACX,CACX;QACA,WAAW,KAAK,yBAAyB,IAAI,oBAAC,sBAAsB,OAAG,CACtE,CACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAA4B,GAAG,EAAE,CAAC,oBAAC,WAAW,OAAG,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React, { useRef, useEffect } from \"react\";\nimport { LinkerGroups } from \"./LinkerGroups\";\nimport { useDispatch, useSelector, Provider } from \"react-redux\";\nimport { actions, LinkerStore, store } from \"../../../linker/remoteRedux\";\nimport { LinkerButton as LinkerButtonDeprecated } from \"./LinkerButtonDeprecated\";\nimport { services, ShowWindowParams } from \"@finsemble/finsemble-api\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\nconst LinkerButtonIcon = () => (\n\t<svg\n\t\twidth=\"15px\"\n\t\theight=\"15px\"\n\t\tviewBox=\"2 1 13 13\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\txmlnsXlink=\"http://www.w3.org/1999/xlink\"\n\t>\n\t\t<title>Linker</title>\n\t\t<defs>\n\t\t\t<path\n\t\t\t\tid=\"prefix__b\"\n\t\t\t\td=\"M17.925 15.425h-1v-2.5a2.5 2.5 0 0 0-5 0v2.5h-1v-2.5a3.5 3.5 0 1 1 7 0v2.5zm0 2v2.5a3.5 3.5 0 1 1-7 0v-2.5h1v2.5a2.5 2.5 0 0 0 5 0v-2.5h1zm-3.5-4a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0v-5a.5.5 0 0 1 .5-.5z\"\n\t\t\t/>\n\t\t\t<filter id=\"prefix__a\" x=\"-28.6%\" y=\"-7.1%\" width=\"157.1%\" height=\"128.6%\">\n\t\t\t\t<feOffset dy=\"1\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n\t\t\t\t<feGaussianBlur in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\" stdDeviation=\".5\" />\n\t\t\t\t<feColorMatrix in=\"shadowBlurOuter1\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\" />\n\t\t\t</filter>\n\t\t</defs>\n\t\t<g transform=\"rotate(45 22.289 4.682)\" fillRule=\"nonzero\" fill=\"none\">\n\t\t\t<use filter=\"url(#prefix__a)\" xlinkHref=\"#prefix__b\" />\n\t\t\t<use xlinkHref=\"#prefix__b\" />\n\t\t</g>\n\t</svg>\n);\n\nconst LinkerButtonRedux: React.FunctionComponent = () => {\n\tconst dispatch = useDispatch();\n\tconst state: LinkerStore = useSelector((currentState: any) => currentState);\n\tconst buttonRef = useRef(null);\n\n\tconst showLinkerWindow = () => {\n\t\t// These action creators can now be imported from finsemble-api\n\t\tdispatch(\n\t\t\tactions.setActiveWindow({\n\t\t\t\ttype: \"linker/setActiveWindow\",\n\t\t\t\tpayload: {\n\t\t\t\t\twindowName: finsembleWindow.name,\n\t\t\t\t},\n\t\t\t})\n\t\t);\n\n\t\t// The offset parent is needed so that the menu isn't shown relative to the icon.\n\t\t// The HTMLElement.offsetParent read-only property returns a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element.\n\t\t// Necessary to cast because refs are type \"Element\" (which could be an SVGElement...)\n\n\t\tconst linkerButton = buttonRef.current;\n\t\tif (linkerButton) {\n\t\t\tconst linkerButtonDiv = linkerButton as HTMLElement;\n\t\t\tconst linkerParent = (linkerButtonDiv.offsetParent ?? linkerButtonDiv.parentElement) as HTMLElement;\n\n\t\t\tconst params: ShowWindowParams = {\n\t\t\t\tposition: \"relative\",\n\t\t\t\tleft: linkerParent?.offsetLeft ?? 0,\n\t\t\t\ttop: linkerParent?.offsetHeight ?? 0,\n\t\t\t\tforceOntoMonitor: true,\n\t\t\t\tspawnIfNotFound: false,\n\t\t\t};\n\t\t\tconst wi = {\n\t\t\t\tcomponentType: \"linkerWindow\",\n\t\t\t};\n\t\t\tFSBL.Clients.LauncherClient.toggleWindowOnClick(linkerButtonDiv, wi, params);\n\t\t}\n\t};\n\n\t// If this window is in the list of linker clients then display this button\n\tconst displayMe = state.clients[finsembleWindow.name] !== undefined;\n\n\t// Add keyboard shortcut to launch the Linker Menu\n\t// Using `addBrowserHotkey` so that the linker menu is only launched when the user is focused on the titlebar\n\t// If we had used `addGlobalHotkey`, it would cause a lot of intermittent errors (linker menu would think it\n\t// was launched from the Notifications Center component for some reason, and would display incorrect channel\n\t// information, or float the linker menu in the wrong location. Lots of flakiness.)\n\tFSBL.Clients.HotkeyClient.addBrowserHotkey([\"CommandOrControl\", \"l\"], showLinkerWindow);\n\n\treturn (\n\t\t<>\n\t\t\t{displayMe && (\n\t\t\t\t<div ref={buttonRef} title=\"Link Data\" className=\"linkerSection\">\n\t\t\t\t\t<div className=\"fsbl-icon fsbl-linker\" onClick={showLinkerWindow}>\n\t\t\t\t\t\t<LinkerButtonIcon />\n\t\t\t\t\t</div>\n\t\t\t\t\t<LinkerGroups />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\n/**\n * Picks whether to display the current or deprecated LinkerElement.\n * If config `finsemble.servicesConfig.linker.enabled` is set to true then the deprecated version will be used.\n *\n * This code should be removed once the linkerClient is removed from Finsemble.\n */\nconst WhichLinker = () => {\n\tconst [whichLinker, setWhichLinker] = React.useState(\"\");\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst { data } = await FSBL.Clients.ConfigClient.getValue({\n\t\t\t\tfield: \"finsemble.servicesConfig.linker.enabled\",\n\t\t\t});\n\t\t\tif (data) {\n\t\t\t\tsetWhichLinker(\"LinkerElementDeprecated\");\n\t\t\t} else {\n\t\t\t\tsetWhichLinker(\"LinkerElement\");\n\t\t\t}\n\t\t})();\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t{whichLinker === \"LinkerElement\" && (\n\t\t\t\t<Provider store={store}>\n\t\t\t\t\t<LinkerButtonRedux />\n\t\t\t\t</Provider>\n\t\t\t)}\n\t\t\t{whichLinker === \"LinkerElementDeprecated\" && <LinkerButtonDeprecated />}\n\t\t</>\n\t);\n};\n\nexport const LinkerButton: React.FunctionComponent = () => <WhichLinker />;\n"]}
1
+ {"version":3,"file":"LinkerButton.js","sourceRoot":"","sources":["../../../../../src/components/windowTitleBar/components/left/LinkerButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,OAAO,EAAe,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAKlF,MAAM,gBAAgB,GAAG,GAAG,EAAE,CA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B;YAC/D,oBAAC,gBAAgB,OAAG,CACf;QACN,oBAAC,YAAY,OAAG,CACX,CACN,CACC,CACH,CAAC;AACH,CAAC,CAAC;AAQF,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzD,SAAS,CAAC,GAAG,EAAE;QACd,CAAC,KAAK,IAAI,EAAE;YACX,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC;gBACzD,KAAK,EAAE,yCAAyC;aAChD,CAAC,CAAC;YACH,IAAI,IAAI,EAAE;gBACT,cAAc,CAAC,yBAAyB,CAAC,CAAC;aAC1C;iBAAM;gBACN,cAAc,CAAC,eAAe,CAAC,CAAC;aAChC;QACF,CAAC,CAAC,EAAE,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACN;QACE,WAAW,KAAK,eAAe,IAAI,CACnC,oBAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;YACrB,oBAAC,iBAAiB,OAAG,CACX,CACX;QACA,WAAW,KAAK,yBAAyB,IAAI,oBAAC,sBAAsB,OAAG,CACtE,CACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAA4B,GAAG,EAAE,CAAC,oBAAC,WAAW,OAAG,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React, { useRef, useEffect } from \"react\";\nimport { LinkerGroups } from \"./LinkerGroups\";\nimport { useDispatch, useSelector, Provider } from \"react-redux\";\nimport { actions, LinkerStore, store } from \"../../../linker/remoteRedux\";\nimport { LinkerButton as LinkerButtonDeprecated } from \"./LinkerButtonDeprecated\";\nimport { services, ShowWindowParams } from \"@finsemble/finsemble-api\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\nconst LinkerButtonIcon = () => (\n\t<svg\n\t\twidth=\"15px\"\n\t\theight=\"15px\"\n\t\tviewBox=\"2 1 13 13\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\txmlnsXlink=\"http://www.w3.org/1999/xlink\"\n\t>\n\t\t<title>Linker</title>\n\t\t<defs>\n\t\t\t<path\n\t\t\t\tid=\"prefix__b\"\n\t\t\t\td=\"M17.925 15.425h-1v-2.5a2.5 2.5 0 0 0-5 0v2.5h-1v-2.5a3.5 3.5 0 1 1 7 0v2.5zm0 2v2.5a3.5 3.5 0 1 1-7 0v-2.5h1v2.5a2.5 2.5 0 0 0 5 0v-2.5h1zm-3.5-4a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0v-5a.5.5 0 0 1 .5-.5z\"\n\t\t\t/>\n\t\t\t<filter id=\"prefix__a\" x=\"-28.6%\" y=\"-7.1%\" width=\"157.1%\" height=\"128.6%\">\n\t\t\t\t<feOffset dy=\"1\" in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n\t\t\t\t<feGaussianBlur in=\"shadowOffsetOuter1\" result=\"shadowBlurOuter1\" stdDeviation=\".5\" />\n\t\t\t\t<feColorMatrix in=\"shadowBlurOuter1\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\" />\n\t\t\t</filter>\n\t\t</defs>\n\t\t<g transform=\"rotate(45 22.289 4.682)\" fillRule=\"nonzero\" fill=\"none\">\n\t\t\t<use filter=\"url(#prefix__a)\" xlinkHref=\"#prefix__b\" />\n\t\t\t<use xlinkHref=\"#prefix__b\" />\n\t\t</g>\n\t</svg>\n);\n\nconst LinkerButtonRedux: React.FunctionComponent = () => {\n\tconst dispatch = useDispatch();\n\tconst state: LinkerStore = useSelector((currentState: any) => currentState);\n\tconst buttonRef = useRef(null);\n\n\tconst showLinkerWindow = () => {\n\t\t// These action creators can now be imported from finsemble-api\n\t\tdispatch(\n\t\t\tactions.setActiveWindow({\n\t\t\t\ttype: \"linker/setActiveWindow\",\n\t\t\t\tpayload: {\n\t\t\t\t\twindowName: finsembleWindow.name,\n\t\t\t\t},\n\t\t\t})\n\t\t);\n\n\t\t// The offset parent is needed so that the menu isn't shown relative to the icon.\n\t\t// The HTMLElement.offsetParent read-only property returns a reference to the object which is the closest (nearest in the containment hierarchy) positioned containing element.\n\t\t// Necessary to cast because refs are type \"Element\" (which could be an SVGElement...)\n\n\t\tconst linkerButton = buttonRef.current;\n\t\tif (linkerButton) {\n\t\t\tconst linkerButtonDiv = linkerButton as HTMLElement;\n\t\t\tconst linkerParent = (linkerButtonDiv.offsetParent ?? linkerButtonDiv.parentElement) as HTMLElement;\n\n\t\t\tconst params: ShowWindowParams = {\n\t\t\t\tposition: \"relative\",\n\t\t\t\tleft: linkerParent?.offsetLeft ?? 0,\n\t\t\t\ttop: linkerParent?.offsetHeight ?? 0,\n\t\t\t\tforceOntoMonitor: true,\n\t\t\t\tspawnIfNotFound: false,\n\t\t\t};\n\t\t\tconst wi = {\n\t\t\t\tcomponentType: \"linkerWindow\",\n\t\t\t};\n\t\t\tFSBL.Clients.LauncherClient.toggleWindowOnClick(linkerButtonDiv, wi, params);\n\t\t}\n\t};\n\n\t// If this window is in the list of linker clients then display this button\n\tconst displayMe = state.clients[finsembleWindow.name] !== undefined;\n\n\tuseEffect(() => {\n\t\twindow.addEventListener(\"keydown\", (e) => {\n\t\t\tif (e.key === \"l\" && (e.ctrlKey || e.metaKey)) {\n\t\t\t\tshowLinkerWindow();\n\t\t\t}\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t{displayMe && (\n\t\t\t\t<div ref={buttonRef} title=\"Link Data\" className=\"linkerSection\">\n\t\t\t\t\t<div className=\"fsbl-icon fsbl-linker\" onClick={showLinkerWindow}>\n\t\t\t\t\t\t<LinkerButtonIcon />\n\t\t\t\t\t</div>\n\t\t\t\t\t<LinkerGroups />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\n/**\n * Picks whether to display the current or deprecated LinkerElement.\n * If config `finsemble.servicesConfig.linker.enabled` is set to true then the deprecated version will be used.\n *\n * This code should be removed once the linkerClient is removed from Finsemble.\n */\nconst WhichLinker = () => {\n\tconst [whichLinker, setWhichLinker] = React.useState(\"\");\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst { data } = await FSBL.Clients.ConfigClient.getValue({\n\t\t\t\tfield: \"finsemble.servicesConfig.linker.enabled\",\n\t\t\t});\n\t\t\tif (data) {\n\t\t\t\tsetWhichLinker(\"LinkerElementDeprecated\");\n\t\t\t} else {\n\t\t\t\tsetWhichLinker(\"LinkerElement\");\n\t\t\t}\n\t\t})();\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t{whichLinker === \"LinkerElement\" && (\n\t\t\t\t<Provider store={store}>\n\t\t\t\t\t<LinkerButtonRedux />\n\t\t\t\t</Provider>\n\t\t\t)}\n\t\t\t{whichLinker === \"LinkerElementDeprecated\" && <LinkerButtonDeprecated />}\n\t\t</>\n\t);\n};\n\nexport const LinkerButton: React.FunctionComponent = () => <WhichLinker />;\n"]}
@@ -83,7 +83,7 @@ export class Title extends Component {
83
83
  };
84
84
  this._mounted = false;
85
85
  this.state = {
86
- title: ((_a = props.windowIdentifier) === null || _a === void 0 ? void 0 : _a.windowName) || document.title,
86
+ title: document.title || ((_a = props.windowIdentifier) === null || _a === void 0 ? void 0 : _a.windowName),
87
87
  icon: null,
88
88
  windowName: (_b = props.windowIdentifier) === null || _b === void 0 ? void 0 : _b.windowName,
89
89
  };
@@ -123,8 +123,16 @@ export class Title extends Component {
123
123
  React.createElement("div", { className: "title-text" }, this.state.title))));
124
124
  }
125
125
  }
126
- _Title_instances = new WeakSet(), _Title_setWindowTitle = function _Title_setWindowTitle(title) {
126
+ _Title_instances = new WeakSet(), _Title_setWindowTitle = async function _Title_setWindowTitle(title) {
127
127
  document.title = title;
128
+ if (finsembleWindow.thisWindowName === this.props.windowIdentifier.windowName) {
129
+ const { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);
130
+ tabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error, persistedTitle) => {
131
+ if (persistedTitle) {
132
+ document.title = persistedTitle;
133
+ }
134
+ });
135
+ }
128
136
  }, _Title_setTabTitle = async function _Title_setTabTitle(title) {
129
137
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
130
138
  const { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);