@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
@@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jD,IAAI,CAAC,4BAA4B,EACjC,CAAC,GAAkB,EAAE,QAA6B,EAAE,EAAE;QACrD,IAAI,CAAC,CAAC,GAAG,EAAE;YAEV,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CACvB,yCAAyC,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,EACxH,GAAG,CACH,CAAC;YACF,OAAO;SACP;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CACxB,8BAA8B,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAC7G,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["import { WindowIdentifier, WindowDescriptor, services } from \"@finsemble/finsemble-api\";\nimport { ListenerFunction } from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport React, { Component } from \"react\";\nimport { EditTabProps } from \"../../../types/windowTitleBar\";\nimport { Icon } from \"../../icon/Icon\";\nimport { Store } from \"../stores/windowTitleBarStore\";\n\ntype IconDescriptor = services.window.types.IconDescriptor;\n\n/**\n * TAB TITLES: HOW DO THEY WORK?\n *\n * Each component, when stacked, will have several tab titles. For each component, there is a window. For each window, there are 2 tab titles per component.\n *\n * Whichever component is \"active\" will render all tabs - exactly one \"active\" tab and n-1 \"inactive\" tabs (where n is the number of components in the stack). When\n * the active component is changed (via a click, for example), then the visible window becomes the window associated with the active component.\n *\n * Tab titles may change at any time, and for a number of reasons. For example, the component may execute \"document.title='...some title'\". Or perhaps the tab title has\n * been edited by the user. In order to account for all title changes, the following flow is used:\n * *something* updates document.title\n * The WindowClient for the component will notice the title change and send a router message (via FinsembleWindow.setTitle) with a topic representitive of the windowName\n * BaseWindow listens to router changes on the same topic and updates a DistributedStore dedicated to tab names\n * The tab components all subscribe to the DistributedStore dedicated to tab names and will update the title accordingly\n *\n * This is a \"one-way\" operation; that is to say that some code will ultimately alter the DistributedStore and the tab title components will read the changes. While this generally\n * happens with a write to document.title, it can also happen when a user edits the tab title manually. In this case, the component state is altered with a field \"persistedTitle\"\n * whose value is the edited title. At render time, the tab title component will use any value in \"persistedTitle\" as the title, irregardless of any other value.\n *\n * NOTE: A tab may be edited only when it is the active component; ergo the call to \"setComponentState\" is safe.\n */\n\n/**\n * WINDOW TITLES: HOW DO THEY WORK?\n *\n * Each application window has a title which is displayed in the operating system taskbar and task switcher. This title comes from the\n * value of \"document.title\" in the window title bar component. It is important to understand that when tabs are stacked, the actual window\n * which holds the window title is the title of the window of the active component. It is therefore important to keep the window title and the\n * tab titles up to date and synchronized.\n */\n\ntype TitleProps = {\n\twindowIdentifier: WindowIdentifier;\n\tonUpdate?: Function;\n\ttitleWidth?: number;\n\tonClick?: () => void;\n};\n\ntype TitleState = {\n\ttitle: string | undefined;\n\ticon: any;\n\twindowName?: string;\n};\n\n// The store name for the distributed store which tracks tab titles\nconst WINDOW_TAB_TITLE_STORE = \"window-tab-title\";\n// The field name to watch for tab title edits\nconst FIELD_NAME_PERSISTED_TITLE = \"persistedTitle\";\n\n/**\n * Gets the store which tracks the tab title for a windowName. This is a distributed store shared by all components.\n *\n * @returns a Promise which resolves the StoreModel associated with window and tab names\n */\nconst getWindowTabNameStore = async () => {\n\tlet { data: store } = await FSBL.Clients.DistributedStoreClient.createGlobalStore({ store: WINDOW_TAB_TITLE_STORE });\n\treturn store;\n};\n\n/**\n * The wrapper component for tab renaming\n * @param {*} props\n */\nfunction EditTab(props: EditTabProps) {\n\tconst [editingTitle, setEditingTitle] = React.useState(false);\n\tconst [clickTimeout, setClickTimeout] = React.useState<NodeJS.Timeout | undefined>(undefined);\n\tconst inputEl = React.useRef<HTMLInputElement>(null);\n\n\tconst updateTabTitle = async (e: React.KeyboardEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement>) => {\n\t\t// When the tab title has changed via a user edit, simply update the DistributedStore\n\n\t\t// Get the title\n\t\tconst title = (e.target as HTMLInputElement).value;\n\n\t\t// Get the tab name store\n\t\tlet store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be persisted\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error persisting tab title via EditTab: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Persist the tab title\n\t\tstore.setValue({ field: props.windowIdentifier.windowName, value: title });\n\n\t\t// Get the window which coresponds to the tab being edited\n\t\tconst { wrap: win } = await FSBL.FinsembleWindow.getInstance(props.windowIdentifier);\n\n\t\t// Set the component state \"persistedTitle\" (which is the edited title)\n\t\tFSBL.Clients.Logger.debug(`Setting component state \"${FIELD_NAME_PERSISTED_TITLE}\" with value \"${title}\"`);\n\t\tawait win.setComponentState({ field: FIELD_NAME_PERSISTED_TITLE, value: title });\n\n\t\t// Stop editing in all cases\n\t\tsetEditingTitle(false);\n\t};\n\n\tconst beginEditing = async () => {\n\t\tawait setEditingTitle(true);\n\t\tinputEl?.current?.focus();\n\t\tif (inputEl?.current) {\n\t\t\tinputEl.current.value = props.title ?? \"\";\n\t\t}\n\t};\n\n\tconst clickHandler = () => {\n\t\tconst allowWindowTitleRenaming = Store.getValue(\"allowWindowTitleRenaming\");\n\n\t\tif (clickTimeout) {\n\t\t\t// double click\n\t\t\tif (allowWindowTitleRenaming) {\n\t\t\t\tbeginEditing();\n\t\t\t}\n\t\t} else if (!editingTitle) {\n\t\t\t// single click\n\t\t\tlet timeout = setTimeout(() => {\n\t\t\t\tclearTimeout(clickTimeout);\n\t\t\t\tsetClickTimeout(undefined);\n\t\t\t}, 500);\n\t\t\tsetClickTimeout(timeout);\n\t\t\tif (props.setActiveTab) props.setActiveTab();\n\t\t}\n\t};\n\n\tconst blurHandler = (e: React.FocusEvent<HTMLInputElement>) => {\n\t\tupdateTabTitle(e);\n\t};\n\n\tconst keyDownHandler = (e: React.KeyboardEvent<HTMLInputElement>) => {\n\t\te.key === \"Enter\" && updateTabTitle(e);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"fsbl-tab-editor\"\n\t\t\t// We can't use Click and Dblclick events together cause for one dblclick fires two click events which close title editor.\n\t\t\t// Workaround with setTimeout should resolve this behavior.\n\t\t\tonClick={clickHandler}\n\t\t>\n\t\t\t{editingTitle ? (\n\t\t\t\t<div className=\"fsbl-tab fsbl-active-tab\" style={{ width: props.tabWidth || \"auto\" }}>\n\t\t\t\t\t{/* workaround to disable tab dragging in the edit mode */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tdraggable={true}\n\t\t\t\t\t\tonDragStart={(e) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref={inputEl}\n\t\t\t\t\t\t\tonBlur={blurHandler}\n\t\t\t\t\t\t\tonKeyDown={keyDownHandler}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclassName=\"tab__input\"\n\t\t\t\t\t\t\tmaxLength={32}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tprops.children\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\n/*\n * Description how stacked window tabs work.\n *\n * The simplest case - when you have only 2 tabs. In that case you will actually have 2 windows and 4 tabs.\n * Lets call them as: window 1 - w1, window 2 - w2, tab 1 from window 1 - w1_t1, tab 2 from window 1 - w1_t2, for tabs from window 2 - w2_t1 and w2_t2.\n * When you switch tabs you activate w1 or w2 with active tab w1_t1 or w2_t2 correspondingly.\n * Tabs w1_t2 and w2_t1 are inactive. They needed only for rendering. I call them as remote tabs, cause their titles must be synchronized with active tabs titles.\n * Thus when you rename active tab (w1_t1), the corresponding remote tab (w2_t1) should be updated automatically.\n */\n\nexport class Title extends Component<TitleProps, TitleState> {\n\t// The listener for tab title change events via the DistributedStoreClient, kept as a reference so\n\t// that the listener can be deregistered when the component is unmounted\n\ttabTitleChangedStoreListener: ListenerFunction = (err: StandardError, response: { field: string; value: string }) => {\n\t\tif (!!err) {\n\t\t\t// This is not critical; in the worst case this tab title will be stale\n\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t`Listener error for store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\terr\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a message\n\t\tFSBL.Clients.Logger.debug(\n\t\t\t`Store \"${WINDOW_TAB_TITLE_STORE}\" notified of new title \"${response.value}\" for window \"${response.field}\"`\n\t\t);\n\n\t\t// Invoke updateTitle\n\t\tthis.updateTitle();\n\t};\n\n\t// Flag to determine if this instance is currently mounted; this is necessary because:\n\t// 1.) Title components are mounted and unmounted as an artifact of how the tab or tab list is rendered\n\t// 2.) Keeping tab titles synchronized is an asynchronous process\n\t// 3.) During the asynchronous process of tab title synchronization, a call to setState is made and\n\t// that raises a React warning since the component state cannot be changed while the component\n\t// is unmounted\n\t_mounted = false;\n\n\tconstructor(props: TitleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\ttitle: props.windowIdentifier?.windowName || document.title,\n\t\t\ticon: null,\n\t\t\t// The \"windowName\" is the name of the window which corresponds to the this instance of the\n\t\t\t// Title component, though the actual current window may belong to some other\n\t\t\t// component(ie this tab represents an inactive window)\n\t\t\twindowName: props.windowIdentifier?.windowName,\n\t\t};\n\n\t\t// Bind the \"updateTitle\" function (in order to use React component functions)\n\t\tthis.updateTitle = this.updateTitle.bind(this);\n\t}\n\n\t/**\n\t * Sets the title of the window.\n\t *\n\t * @param title the window title\n\t */\n\t#setWindowTitle(title: string) {\n\t\tdocument.title = title;\n\t}\n\n\t/**\n\t * Sets the title of the tab.\n\t *\n\t * @param title the title of the tab\n\t */\n\tasync #setTabTitle(title: string) {\n\t\t// The window represented by this tab title instance\n\t\tconst { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);\n\n\t\t// \"tabWindowOptions\" refers to the options from the window which hosts the component represented by this tab\n\t\tconst { data: tabWindowOptions } = await tabWindow.getOptions();\n\n\t\t// If there is no title then use some logic to derive a title\n\t\tif (!title) {\n\t\t\t// This code runs when there is no tab name in the store. This happens when a workspace is loaded and\n\t\t\t// the workspace has stacked windows. In this case, fallback to:\n\t\t\t// 1.) the displayName from the manifest (there are TWO places to look in the manifest!)\n\t\t\t// 2.) the title from the WindowClient (this is only correct for the hosting tab!)\n\t\t\t// 3.) the title from the window title bar (this is only correct for the hosting tab!)\n\t\t\t// 4.) the name of the window which is hosting the window associated with the tab\n\t\t\t// 5.) the empty string\n\t\t\t//\n\t\t\t// Note that in most cases this name is temporarty since most components will update their title with\n\t\t\t// a call to \"document.title='...some title!'\"\n\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t`No stored tab tile for \"${this.props.windowIdentifier.windowName}\"; falling back to code-based derivation`\n\t\t\t);\n\n\t\t\t// \"windowClientOptions\" refers to the options from the window which hosts\n\t\t\t// all the tabs (this will always be the currently active component / window)\n\t\t\tconst { options: windowClientOptions } = FSBL.Clients.WindowClient;\n\t\t\tconst windowTitleBarConfig = windowClientOptions?.customData?.foreign?.components[\"Window Manager\"];\n\n\t\t\t// Display name is the first candidate for the title\n\t\t\tconst displayName =\n\t\t\t\t// From the appd manifest\n\t\t\t\ttabWindowOptions?.customData?.appDConfig?.manifest?.component?.displayName ||\n\t\t\t\t// This seems like a default\n\t\t\t\ttabWindowOptions?.customData?.component?.displayName;\n\n\t\t\t// The title assignment\n\t\t\ttitle = displayName || FSBL.Clients.WindowClient.title || windowTitleBarConfig?.title || tabWindow.name || \"\";\n\t\t}\n\n\t\t// Get the titleBar icon from the WindowDescriptor for the TAB window (not the CURRENT window)\n\t\tconst icon: IconDescriptor = (tabWindowOptions as WindowDescriptor)?.icons?.titleBarIcon ?? {\n\t\t\timageType: \"initials\",\n\t\t\tname: title,\n\t\t};\n\n\t\t// Get the component state for THIS component (the tab title)\n\t\t// The field \"persistedTitle\" is set when a tab has been edited via EditTab\n\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t// When the component is being mounted/unmounted quickly, this code may be run during a time when\n\t\t\t// the component is not mounted. This check prevents React warnings in the dev console.\n\t\t\tif (!this._mounted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a \"persistedTitle\" then the title has been edited by a user\n\t\t\tif (persistedTitle) {\n\t\t\t\t// Set the title to the edited title\n\t\t\t\ttitle = persistedTitle;\n\t\t\t}\n\t\t\tFSBL.Clients.Logger.debug(`Setting tab title ${title} for window ${this.props.windowIdentifier.windowName}`);\n\n\t\t\t// Finally, set the state\n\t\t\tthis.setState({\n\t\t\t\ttitle,\n\t\t\t\ticon: {\n\t\t\t\t\t...icon,\n\t\t\t\t\t// Application causes the background to default to a circle rather than a square\n\t\t\t\t\tcategory: \"Application\",\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Updates the title for both the tab and the window.\n\t *\n\t * @returns a Promise which resolves nothing\n\t */\n\tasync updateTitle() {\n\t\t// Get the store (which holds the values for the tab titles)\n\t\tconst store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error setting the tab title: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// The FinsembleWindow which represents the current window\n\t\tconst { data: windowTitle } = await store.getGlobalValue(finsembleWindow.thisWindowName);\n\t\t// The FinsembleWindow instance which this Title component represents\n\t\tconst { data: tabTitle } = await store.getGlobalValue(this.props.windowIdentifier.windowName);\n\n\t\t// There is a subtle difference bewtween windowTitle and tabTitle. Since this code executes\n\t\t// when *any* tab has a name change, this code can execute when the active window represents\n\t\t// a tab other than the currently rendering tab (ie an inactive tab).\n\n\t\tthis.#setTabTitle(tabTitle);\n\t\tthis.#setWindowTitle(windowTitle);\n\t}\n\n\t/**\n\t * Adds the listener(s) required to set window and tab titles.\n\t */\n\tasync #addListeners() {\n\t\t// Subscribe to the DistributedStoreClient (these messages originate from BaseWindow, when the\n\t\t// DistributedStore has been updated).\n\t\t//\n\t\t// Each window will have n listeners, where n is the number of tabs held in the window.\n\n\t\t// Get the store and add a listener\n\t\tconst store = await getWindowTabNameStore();\n\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error adding a tab title listener: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Add a listener\n\t\tstore.addListener({ field: this.props.windowIdentifier.windowName }, this.tabTitleChangedStoreListener, () => {\n\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t`Added listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Removes listener(s) required to set window and tab titles.\n\t */\n\tasync #removeListeners() {\n\t\t// Unsubscribe from the window/tab store\n\t\tconst store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error removing a tab title listener: the store was not found\");\n\t\t\treturn;\n\t\t}\n\t\tstore.removeListener(\n\t\t\t{ field: this.props.windowIdentifier.windowName },\n\t\t\tthis.tabTitleChangedStoreListener,\n\t\t\t(err: StandardError, response: boolean | undefined) => {\n\t\t\t\tif (!!err) {\n\t\t\t\t\t// This is not critical; the listener could not be removed from the store - this may be a memory leak\n\t\t\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t\t\t`Could not remove listener from store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\t\terr\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t`Removed listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * React component lifecycle event, triggered once the component has been added to the DOM.\n\t */\n\tcomponentDidMount() {\n\t\t// Set the mounted flag to true (this component is currently mounted)\n\t\tthis._mounted = true;\n\n\t\t// Add listeners\n\t\tthis.#addListeners();\n\t}\n\n\t// Triggers a re-rendering of the drag handle in the title bar.\n\tcomponentDidUpdate() {\n\t\tif (typeof this.props.onUpdate === \"function\") {\n\t\t\tthis.props.onUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * React component lifecycle event, triggered before the component is removed from the DOM.\n\t */\n\tcomponentWillUnmount() {\n\t\t// Set the mounted flag to false (this component is not currently mounted)\n\t\tthis._mounted = false;\n\n\t\t// Remove listeners\n\t\tthis.#removeListeners();\n\t}\n\n\trender() {\n\t\tconst { titleWidth } = this.props;\n\t\tconst style = titleWidth ? { width: titleWidth } : {};\n\t\treturn (\n\t\t\t<EditTab\n\t\t\t\ttabWidth={titleWidth}\n\t\t\t\tsetActiveTab={this?.props?.onClick}\n\t\t\t\ttitle={this.state.title}\n\t\t\t\t// The windowIdentifier indicates which app/component this tab instance should represent\n\t\t\t\twindowIdentifier={this.props.windowIdentifier}\n\t\t\t>\n\t\t\t\t<div className=\"fsbl-tab-title\" style={style}>\n\t\t\t\t\t{this.state.icon && <Icon {...this.state.icon} />}\n\t\t\t\t\t<div className=\"title-text\">{this.state.title}</div>\n\t\t\t\t</div>\n\t\t\t</EditTab>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"windowTitle.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/components/windowTitle.tsx"],"names":[],"mappings":";;;;;;AAGA,OAAO,KAAK,EAAE,EAAE,SAAS,EA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AC;AACJ,CAAC,2BAKD,KAAK;IAEJ,MAAM,KAAK,GAAG,MAAM,qBAAqB,EAAE,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE;QAEX,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QACzF,OAAO;KACP;IACD,KAAK,CAAC,cAAc,CACnB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,EACjD,IAAI,CAAC,4BAA4B,EACjC,CAAC,GAAkB,EAAE,QAA6B,EAAE,EAAE;QACrD,IAAI,CAAC,CAAC,GAAG,EAAE;YAEV,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CACvB,yCAAyC,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,EACxH,GAAG,CACH,CAAC;YACF,OAAO;SACP;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CACxB,8BAA8B,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAC7G,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["import { WindowIdentifier, WindowDescriptor, services } from \"@finsemble/finsemble-api\";\nimport { ListenerFunction } from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport React, { Component } from \"react\";\nimport { EditTabProps } from \"../../../types/windowTitleBar\";\nimport { Icon } from \"../../icon/Icon\";\nimport { Store } from \"../stores/windowTitleBarStore\";\n\ntype IconDescriptor = services.window.types.IconDescriptor;\n\n/**\n * TAB TITLES: HOW DO THEY WORK?\n *\n * Each component, when stacked, will have several tab titles. For each component, there is a window. For each window, there are 2 tab titles per component.\n *\n * Whichever component is \"active\" will render all tabs - exactly one \"active\" tab and n-1 \"inactive\" tabs (where n is the number of components in the stack). When\n * the active component is changed (via a click, for example), then the visible window becomes the window associated with the active component.\n *\n * Tab titles may change at any time, and for a number of reasons. For example, the component may execute \"document.title='...some title'\". Or perhaps the tab title has\n * been edited by the user. In order to account for all title changes, the following flow is used:\n * *something* updates document.title\n * The WindowClient for the component will notice the title change and send a router message (via FinsembleWindow.setTitle) with a topic representitive of the windowName\n * BaseWindow listens to router changes on the same topic and updates a DistributedStore dedicated to tab names\n * The tab components all subscribe to the DistributedStore dedicated to tab names and will update the title accordingly\n *\n * This is a \"one-way\" operation; that is to say that some code will ultimately alter the DistributedStore and the tab title components will read the changes. While this generally\n * happens with a write to document.title, it can also happen when a user edits the tab title manually. In this case, the component state is altered with a field \"persistedTitle\"\n * whose value is the edited title. At render time, the tab title component will use any value in \"persistedTitle\" as the title, irregardless of any other value.\n *\n * NOTE: A tab may be edited only when it is the active component; ergo the call to \"setComponentState\" is safe.\n */\n\n/**\n * WINDOW TITLES: HOW DO THEY WORK?\n *\n * Each application window has a title which is displayed in the operating system taskbar and task switcher. This title comes from the\n * value of \"document.title\" in the window title bar component. It is important to understand that when tabs are stacked, the actual window\n * which holds the window title is the title of the window of the active component. It is therefore important to keep the window title and the\n * tab titles up to date and synchronized.\n */\n\ntype TitleProps = {\n\twindowIdentifier: WindowIdentifier;\n\tonUpdate?: Function;\n\ttitleWidth?: number;\n\tonClick?: () => void;\n};\n\ntype TitleState = {\n\ttitle: string | undefined;\n\ticon: any;\n\twindowName?: string;\n};\n\n// The store name for the distributed store which tracks tab titles\nconst WINDOW_TAB_TITLE_STORE = \"window-tab-title\";\n// The field name to watch for tab title edits\nconst FIELD_NAME_PERSISTED_TITLE = \"persistedTitle\";\n\n/**\n * Gets the store which tracks the tab title for a windowName. This is a distributed store shared by all components.\n *\n * @returns a Promise which resolves the StoreModel associated with window and tab names\n */\nconst getWindowTabNameStore = async () => {\n\tlet { data: store } = await FSBL.Clients.DistributedStoreClient.createGlobalStore({ store: WINDOW_TAB_TITLE_STORE });\n\treturn store;\n};\n\n/**\n * The wrapper component for tab renaming\n * @param {*} props\n */\nfunction EditTab(props: EditTabProps) {\n\tconst [editingTitle, setEditingTitle] = React.useState(false);\n\tconst [clickTimeout, setClickTimeout] = React.useState<NodeJS.Timeout | undefined>(undefined);\n\tconst inputEl = React.useRef<HTMLInputElement>(null);\n\n\tconst updateTabTitle = async (e: React.KeyboardEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement>) => {\n\t\t// When the tab title has changed via a user edit, simply update the DistributedStore\n\n\t\t// Get the title\n\t\tconst title = (e.target as HTMLInputElement).value;\n\n\t\t// Get the tab name store\n\t\tlet store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be persisted\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error persisting tab title via EditTab: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Persist the tab title\n\t\tstore.setValue({ field: props.windowIdentifier.windowName, value: title });\n\n\t\t// Get the window which coresponds to the tab being edited\n\t\tconst { wrap: win } = await FSBL.FinsembleWindow.getInstance(props.windowIdentifier);\n\n\t\t// Set the component state \"persistedTitle\" (which is the edited title)\n\t\tFSBL.Clients.Logger.debug(`Setting component state \"${FIELD_NAME_PERSISTED_TITLE}\" with value \"${title}\"`);\n\t\tawait win.setComponentState({ field: FIELD_NAME_PERSISTED_TITLE, value: title });\n\n\t\t// Stop editing in all cases\n\t\tsetEditingTitle(false);\n\t};\n\n\tconst beginEditing = async () => {\n\t\tawait setEditingTitle(true);\n\t\tinputEl?.current?.focus();\n\t\tif (inputEl?.current) {\n\t\t\tinputEl.current.value = props.title ?? \"\";\n\t\t}\n\t};\n\n\tconst clickHandler = () => {\n\t\tconst allowWindowTitleRenaming = Store.getValue(\"allowWindowTitleRenaming\");\n\n\t\tif (clickTimeout) {\n\t\t\t// double click\n\t\t\tif (allowWindowTitleRenaming) {\n\t\t\t\tbeginEditing();\n\t\t\t}\n\t\t} else if (!editingTitle) {\n\t\t\t// single click\n\t\t\tlet timeout = setTimeout(() => {\n\t\t\t\tclearTimeout(clickTimeout);\n\t\t\t\tsetClickTimeout(undefined);\n\t\t\t}, 500);\n\t\t\tsetClickTimeout(timeout);\n\t\t\tif (props.setActiveTab) props.setActiveTab();\n\t\t}\n\t};\n\n\tconst blurHandler = (e: React.FocusEvent<HTMLInputElement>) => {\n\t\tupdateTabTitle(e);\n\t};\n\n\tconst keyDownHandler = (e: React.KeyboardEvent<HTMLInputElement>) => {\n\t\te.key === \"Enter\" && updateTabTitle(e);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"fsbl-tab-editor\"\n\t\t\t// We can't use Click and Dblclick events together cause for one dblclick fires two click events which close title editor.\n\t\t\t// Workaround with setTimeout should resolve this behavior.\n\t\t\tonClick={clickHandler}\n\t\t>\n\t\t\t{editingTitle ? (\n\t\t\t\t<div className=\"fsbl-tab fsbl-active-tab\" style={{ width: props.tabWidth || \"auto\" }}>\n\t\t\t\t\t{/* workaround to disable tab dragging in the edit mode */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tdraggable={true}\n\t\t\t\t\t\tonDragStart={(e) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref={inputEl}\n\t\t\t\t\t\t\tonBlur={blurHandler}\n\t\t\t\t\t\t\tonKeyDown={keyDownHandler}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclassName=\"tab__input\"\n\t\t\t\t\t\t\tmaxLength={32}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tprops.children\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\n/*\n * Description how stacked window tabs work.\n *\n * The simplest case - when you have only 2 tabs. In that case you will actually have 2 windows and 4 tabs.\n * Lets call them as: window 1 - w1, window 2 - w2, tab 1 from window 1 - w1_t1, tab 2 from window 1 - w1_t2, for tabs from window 2 - w2_t1 and w2_t2.\n * When you switch tabs you activate w1 or w2 with active tab w1_t1 or w2_t2 correspondingly.\n * Tabs w1_t2 and w2_t1 are inactive. They needed only for rendering. I call them as remote tabs, cause their titles must be synchronized with active tabs titles.\n * Thus when you rename active tab (w1_t1), the corresponding remote tab (w2_t1) should be updated automatically.\n */\n\nexport class Title extends Component<TitleProps, TitleState> {\n\t// The listener for tab title change events via the DistributedStoreClient, kept as a reference so\n\t// that the listener can be deregistered when the component is unmounted\n\ttabTitleChangedStoreListener: ListenerFunction = (err: StandardError, response: { field: string; value: string }) => {\n\t\tif (!!err) {\n\t\t\t// This is not critical; in the worst case this tab title will be stale\n\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t`Listener error for store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\terr\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a message\n\t\tFSBL.Clients.Logger.debug(\n\t\t\t`Store \"${WINDOW_TAB_TITLE_STORE}\" notified of new title \"${response.value}\" for window \"${response.field}\"`\n\t\t);\n\n\t\t// Invoke updateTitle\n\t\tthis.updateTitle();\n\t};\n\n\t// Flag to determine if this instance is currently mounted; this is necessary because:\n\t// 1.) Title components are mounted and unmounted as an artifact of how the tab or tab list is rendered\n\t// 2.) Keeping tab titles synchronized is an asynchronous process\n\t// 3.) During the asynchronous process of tab title synchronization, a call to setState is made and\n\t// that raises a React warning since the component state cannot be changed while the component\n\t// is unmounted\n\t_mounted = false;\n\n\tconstructor(props: TitleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\t// Use document.title first to prevent a title flickering when dragging a tab of another window.\n\t\t\t// The reason for flickering is the component re-rendering multiple times. The initial place\n\t\t\t// where re-rendering start is the `disallowDragOnCenterRegion()` at the WindowTitleBarShell.\n\t\t\t// At that function, we change the state of the parent component which triggers re-rendering for the children tree.\n\t\t\ttitle: document.title || props.windowIdentifier?.windowName,\n\t\t\ticon: null,\n\t\t\t// The \"windowName\" is the name of the window which corresponds to the this instance of the\n\t\t\t// Title component, though the actual current window may belong to some other\n\t\t\t// component(ie this tab represents an inactive window)\n\t\t\twindowName: props.windowIdentifier?.windowName,\n\t\t};\n\n\t\t// Bind the \"updateTitle\" function (in order to use React component functions)\n\t\tthis.updateTitle = this.updateTitle.bind(this);\n\t}\n\n\t/**\n\t * Sets the title of the window.\n\t *\n\t * @param title the window title\n\t */\n\tasync #setWindowTitle(title: string) {\n\t\tdocument.title = title; // Set this first so it is less wrong than the default\n\n\t\tif (finsembleWindow.thisWindowName === this.props.windowIdentifier.windowName) {\n\t\t\tconst { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);\n\t\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t\tif (persistedTitle) {\n\t\t\t\t\t// Set the title to the edited title\n\t\t\t\t\tdocument.title = persistedTitle;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Sets the title of the tab.\n\t *\n\t * @param title the title of the tab\n\t */\n\tasync #setTabTitle(title: string) {\n\t\t// The window represented by this tab title instance\n\t\tconst { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);\n\n\t\t// \"tabWindowOptions\" refers to the options from the window which hosts the component represented by this tab\n\t\tconst { data: tabWindowOptions } = await tabWindow.getOptions();\n\n\t\t// If there is no title then use some logic to derive a title\n\t\tif (!title) {\n\t\t\t// This code runs when there is no tab name in the store. This happens when a workspace is loaded and\n\t\t\t// the workspace has stacked windows. In this case, fallback to:\n\t\t\t// 1.) the displayName from the manifest (there are TWO places to look in the manifest!)\n\t\t\t// 2.) the title from the WindowClient (this is only correct for the hosting tab!)\n\t\t\t// 3.) the title from the window title bar (this is only correct for the hosting tab!)\n\t\t\t// 4.) the name of the window which is hosting the window associated with the tab\n\t\t\t// 5.) the empty string\n\t\t\t//\n\t\t\t// Note that in most cases this name is temporarty since most components will update their title with\n\t\t\t// a call to \"document.title='...some title!'\"\n\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t`No stored tab tile for \"${this.props.windowIdentifier.windowName}\"; falling back to code-based derivation`\n\t\t\t);\n\n\t\t\t// \"windowClientOptions\" refers to the options from the window which hosts\n\t\t\t// all the tabs (this will always be the currently active component / window)\n\t\t\tconst { options: windowClientOptions } = FSBL.Clients.WindowClient;\n\t\t\tconst windowTitleBarConfig = windowClientOptions?.customData?.foreign?.components[\"Window Manager\"];\n\n\t\t\t// Display name is the first candidate for the title\n\t\t\tconst displayName =\n\t\t\t\t// From the appd manifest\n\t\t\t\ttabWindowOptions?.customData?.appDConfig?.manifest?.component?.displayName ||\n\t\t\t\t// This seems like a default\n\t\t\t\ttabWindowOptions?.customData?.component?.displayName;\n\n\t\t\t// The title assignment\n\t\t\ttitle = displayName || FSBL.Clients.WindowClient.title || windowTitleBarConfig?.title || tabWindow.name || \"\";\n\t\t}\n\n\t\t// Get the titleBar icon from the WindowDescriptor for the TAB window (not the CURRENT window)\n\t\tconst icon: IconDescriptor = (tabWindowOptions as WindowDescriptor)?.icons?.titleBarIcon ?? {\n\t\t\timageType: \"initials\",\n\t\t\tname: title,\n\t\t};\n\n\t\t// Get the component state for THIS component (the tab title)\n\t\t// The field \"persistedTitle\" is set when a tab has been edited via EditTab\n\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t// When the component is being mounted/unmounted quickly, this code may be run during a time when\n\t\t\t// the component is not mounted. This check prevents React warnings in the dev console.\n\t\t\tif (!this._mounted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a \"persistedTitle\" then the title has been edited by a user\n\t\t\tif (persistedTitle) {\n\t\t\t\t// Set the title to the edited title\n\t\t\t\ttitle = persistedTitle;\n\t\t\t}\n\t\t\tFSBL.Clients.Logger.debug(`Setting tab title ${title} for window ${this.props.windowIdentifier.windowName}`);\n\n\t\t\t// Finally, set the state\n\t\t\tthis.setState({\n\t\t\t\ttitle,\n\t\t\t\ticon: {\n\t\t\t\t\t...icon,\n\t\t\t\t\t// Application causes the background to default to a circle rather than a square\n\t\t\t\t\tcategory: \"Application\",\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Updates the title for both the tab and the window.\n\t *\n\t * @returns a Promise which resolves nothing\n\t */\n\tasync updateTitle() {\n\t\t// Get the store (which holds the values for the tab titles)\n\t\tconst store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error setting the tab title: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// The FinsembleWindow which represents the current window\n\t\tconst { data: windowTitle } = await store.getGlobalValue(finsembleWindow.thisWindowName);\n\t\t// The FinsembleWindow instance which this Title component represents\n\t\tconst { data: tabTitle } = await store.getGlobalValue(this.props.windowIdentifier.windowName);\n\n\t\t// There is a subtle difference bewtween windowTitle and tabTitle. Since this code executes\n\t\t// when *any* tab has a name change, this code can execute when the active window represents\n\t\t// a tab other than the currently rendering tab (ie an inactive tab).\n\n\t\tthis.#setTabTitle(tabTitle);\n\t\tthis.#setWindowTitle(windowTitle);\n\t}\n\n\t/**\n\t * Adds the listener(s) required to set window and tab titles.\n\t */\n\tasync #addListeners() {\n\t\t// Subscribe to the DistributedStoreClient (these messages originate from BaseWindow, when the\n\t\t// DistributedStore has been updated).\n\t\t//\n\t\t// Each window will have n listeners, where n is the number of tabs held in the window.\n\n\t\t// Get the store and add a listener\n\t\tconst store = await getWindowTabNameStore();\n\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error adding a tab title listener: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Add a listener\n\t\tstore.addListener({ field: this.props.windowIdentifier.windowName }, this.tabTitleChangedStoreListener, () => {\n\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t`Added listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Removes listener(s) required to set window and tab titles.\n\t */\n\tasync #removeListeners() {\n\t\t// Unsubscribe from the window/tab store\n\t\tconst store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error removing a tab title listener: the store was not found\");\n\t\t\treturn;\n\t\t}\n\t\tstore.removeListener(\n\t\t\t{ field: this.props.windowIdentifier.windowName },\n\t\t\tthis.tabTitleChangedStoreListener,\n\t\t\t(err: StandardError, response: boolean | undefined) => {\n\t\t\t\tif (!!err) {\n\t\t\t\t\t// This is not critical; the listener could not be removed from the store - this may be a memory leak\n\t\t\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t\t\t`Could not remove listener from store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\t\terr\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t`Removed listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * React component lifecycle event, triggered once the component has been added to the DOM.\n\t */\n\tcomponentDidMount() {\n\t\t// Set the mounted flag to true (this component is currently mounted)\n\t\tthis._mounted = true;\n\n\t\t// Add listeners\n\t\tthis.#addListeners();\n\t}\n\n\t// Triggers a re-rendering of the drag handle in the title bar.\n\tcomponentDidUpdate() {\n\t\tif (typeof this.props.onUpdate === \"function\") {\n\t\t\tthis.props.onUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * React component lifecycle event, triggered before the component is removed from the DOM.\n\t */\n\tcomponentWillUnmount() {\n\t\t// Set the mounted flag to false (this component is not currently mounted)\n\t\tthis._mounted = false;\n\n\t\t// Remove listeners\n\t\tthis.#removeListeners();\n\t}\n\n\trender() {\n\t\tconst { titleWidth } = this.props;\n\t\tconst style = titleWidth ? { width: titleWidth } : {};\n\t\treturn (\n\t\t\t<EditTab\n\t\t\t\ttabWidth={titleWidth}\n\t\t\t\tsetActiveTab={this?.props?.onClick}\n\t\t\t\ttitle={this.state.title}\n\t\t\t\t// The windowIdentifier indicates which app/component this tab instance should represent\n\t\t\t\twindowIdentifier={this.props.windowIdentifier}\n\t\t\t>\n\t\t\t\t<div className=\"fsbl-tab-title\" style={style}>\n\t\t\t\t\t{this.state.icon && <Icon {...this.state.icon} />}\n\t\t\t\t\t<div className=\"title-text\">{this.state.title}</div>\n\t\t\t\t</div>\n\t\t\t</EditTab>\n\t\t);\n\t}\n}\n"]}
@@ -163,8 +163,18 @@ const processFSBLHeader = (FSBLHeader, windowTitleBarConfig, options) => {
163
163
  ]);
164
164
  windowTitleBarStore.setValue({
165
165
  field: "hackScrollbar",
166
- value: windowTitleBarConfig.hackScrollbar !== false,
166
+ value: windowTitleBarConfig.FSBLHeader.hackScrollbar !== false,
167
167
  });
168
+ windowTitleBarStore.setValue({
169
+ field: "adjustContentHeights",
170
+ value: windowTitleBarConfig.FSBLHeader.adjustContentHeights !== false,
171
+ });
172
+ if (windowTitleBarConfig.FSBLHeader.bumpElements) {
173
+ windowTitleBarStore.setValue({
174
+ field: "bumpElements",
175
+ value: windowTitleBarConfig.FSBLHeader.bumpElements,
176
+ });
177
+ }
168
178
  const title = FSBL.Clients.WindowClient.title || windowTitleBarConfig.title || displayName;
169
179
  if (title) {
170
180
  document.title = title;
@@ -1 +1 @@
1
- {"version":3,"file":"windowTitleBarStore.js","sour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hB,UAAU;QACT,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,UAAU,CAAC,CAAC,KAAiB,EAAE,EAAE;YAChC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,EAAY;QAClC,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,mBAAmB,IAAI,KAAK,EAAE,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport windowTitleBarStoreDefaults from \"./windowTitleBarStoreDefaults\";\nimport { StandardCallback } from \"@finsemble/finsemble-api/types/types\";\nimport { FinsembleWindow, WindowIdentifier } from \"@finsemble/finsemble-api\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\n\nconst getWindowNameForDocking = (finsembleWindow: FinsembleWindow) => {\n\tconst parent = finsembleWindow.parentWindow;\n\treturn parent ? parent.name : finsembleWindow.name;\n};\n\ntype ParentParams = {\n\twindowIdentifiers: WindowIdentifier[];\n\tvisibleWindowIdentifier: WindowIdentifier;\n\tcreate: boolean;\n};\n\nconst getStackedWindow = (params: ParentParams, cb: StandardCallback) => {\n\tif (!finsembleWindow.parentWindow && params.create) {\n\t\tconst onParentSet = (evt: any) => {\n\t\t\tconst { parentName } = evt.data;\n\t\t\tfinsembleWindow.setParent({ windowName: parentName }, (err2, windowWrapper) => {\n\t\t\t\tcb?.(err2, windowWrapper);\n\t\t\t});\n\t\t\tfinsembleWindow.removeListener(\"parent-set\", onParentSet);\n\t\t};\n\t\tfinsembleWindow.addListener(\"parent-set\", onParentSet);\n\t\tFSBL.Clients.LauncherClient.spawn(\n\t\t\t\"StackedWindow\",\n\t\t\t{\n\t\t\t\twindowType: \"StackedWindow\",\n\t\t\t\tdata: { windowIdentifiers: params.windowIdentifiers },\n\t\t\t\toptions: { newStack: true },\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (!err) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcb?.(err, null);\n\t\t\t}\n\t\t);\n\t} else {\n\t\tfinsembleWindow.getParent(cb);\n\t}\n};\n\nlet windowTitleBarStore: StoreModel;\n\ntype ConstantsType = {\n\tPARENT_WRAPPER_UPDATES: string;\n\tCHILD_WINDOW_FIELD: string;\n\tVISIBLE_WINDOW_FIELD: string;\n\tTAB_SCROLL_POSITION_CHANGED: string;\n};\n\ntype ActionsType = {\n\tparentWrapperStore: any;\n\tparentSubscriptions: any[];\n\tparentWrapper: FinsembleWindow | null;\n\n\tinitialize: () => void;\n\tgetMyDockingGroups: (groupData: any) => any[];\n\tonTabListScrollPositionChanged: StandardCallback;\n\tsetTabListScrollPosition: (translateX: number) => void;\n\tremoteStateUpdate: (command: string, state: any) => void;\n\tclickMinimize: () => void;\n\tclickClose: () => void;\n\ttoggleGroup: () => void;\n\tclickMaximize: () => void;\n\tgetTabs: () => WindowIdentifier[];\n\t_setTabs: (tabs: WindowIdentifier[] | null) => any;\n\taddTabLocally: (windowIdentifier: WindowIdentifier, i: number) => void;\n\tremoveTabsLocally: () => void;\n\tremoveTabLocally: (windowIdentifier: WindowIdentifier) => void;\n\treorderTabLocally: (tab: WindowIdentifier, newIndex: number) => undefined | any;\n\taddTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tremoveTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tcloseTab: (windowIdentifier: WindowIdentifier) => void;\n\treorderTab: (tab: WindowIdentifier, newIndex: number) => any;\n\tfindTab: (tab: WindowIdentifier) => { tab: WindowIdentifier; currentIndex: number };\n\tsetActiveTab: (windowIdentifier: WindowIdentifier) => Promise<any>;\n\tonTabListChanged: StandardCallback;\n\tstopListeningOnParentWrapper: (cb: Function) => void;\n\tlistenOnParentWrapper: () => void;\n\tsetupStore: (cb?: Function) => void;\n\tgetInitialTabList: (cb: StandardCallback) => void;\n\tcreateParentWrapper: (params: ParentParams, cb?: Function) => void;\n};\n\n/**\n * When a group update is publish, we sift through the data to see if this window is snapped or grouped with other windows. Then we publish that info, and the GroupingButton renders the correct icon.\n * @param {*} err\n * @param {*} response\n */\nconst onDockingGroupUpdate: StandardCallback = (err, response) => {\n\tif (err || !response.data || !response.data.groupData) {\n\t\treturn;\n\t}\n\tFSBL.Clients.Logger.system.debug(\"On docking group update\", response.data.groupData);\n\tlet groupNames = Object.keys(response.data.groupData);\n\tlet movableGroups = groupNames\n\t\t.filter((groupName) => response.data.groupData[groupName].isMovable)\n\t\t.map((groupName) => response.data.groupData[groupName]);\n\t// This is all movable and snapped groups. It's used later to figure out the icon to display.\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.allDockingGroups\",\n\t\tvalue: response.data.groupData,\n\t});\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.allMovableDockingGroups\",\n\t\tvalue: movableGroups,\n\t});\n\tlet myGroups = Actions.getMyDockingGroups(response.data.groupData);\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.dockingGroups\",\n\t\tvalue: myGroups,\n\t});\n\t/**\n\t * Goes through groups and sees if this window is grouped, snapped, or freely hanging out there.\n\t */\n\tlet isSnapped = false;\n\tlet isInMovableGroup = false;\n\tlet isTopRight = false;\n\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\tfor (let i = 0; i < myGroups.length; i++) {\n\t\tlet myGroup = myGroups[i];\n\t\tif (myGroup.isMovable) {\n\t\t\tisInMovableGroup = true;\n\t\t\tif (windowName == myGroup.topRightWindow) {\n\t\t\t\tisTopRight = true;\n\t\t\t}\n\t\t} else {\n\t\t\tisSnapped = true;\n\t\t}\n\t}\n\tlet icon: string | false = false;\n\n\tif (isSnapped) {\n\t\ticon = \"joiner\";\n\t}\n\tif (isInMovableGroup) {\n\t\ticon = \"ejector\";\n\t}\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"isSnapped\", value: isSnapped },\n\t\t{ field: \"isGrouped\", value: isInMovableGroup },\n\t\t{ field: \"isTopRight\", value: isTopRight },\n\t\t{ field: \"Main.dockingIcon\", value: icon },\n\t]);\n};\n\n/**\n * Listen for updates from the dragAndDropClient.\n */\nconst listenForDNDUpdates = () => {\n\tFSBL.Clients.RouterClient.subscribe(`${FSBL.Clients.WindowClient.options.name}Finsemble.Sharer`, (err, response) => {\n\t\tif (err) {\n\t\t\treturn console.error(err);\n\t\t}\n\t\twindowTitleBarStore.setValues([\n\t\t\t{\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\tvalue: response.data.emitterEnabled,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: \"Sharer.receiverEnabled\",\n\t\t\t\tvalue: response.data.receiverEnabled,\n\t\t\t},\n\t\t]);\n\t});\n};\n\n/**\n * Handles whether to show the linker button.\n */\nconst showLinkerButton = () => {\n\t// Get state (channel membership) from the linkerClient. Then set the value in the header so that the title bar accurately reflects the state.\n\tconst cb: StandardCallback = (err, response) => {\n\t\tif (response.channels) {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Linker.channels\",\n\t\t\t\tvalue: response.channels,\n\t\t\t});\n\t\t}\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\tvalue: true,\n\t\t});\n\t};\n\tcb(null, FSBL.Clients.LinkerClient.getState());\n\tFSBL.Clients.LinkerClient.onStateChange(cb);\n};\n\nconst processInitialTabList = (err: any, values: any) => {\n\tconst onParentSet = () => {\n\t\tActions.parentWrapper = null;\n\t\tActions.getInitialTabList(() => {\n\t\t\tFSBL.Clients.Logger.system.debug(\"docking group update after initial tab list\");\n\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\tdata: {\n\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t};\n\tconst onParentCleared = () => {\n\t\tActions.parentWrapper = null;\n\t\tFSBL.Clients.Logger.system.debug(\"ClearParent, setting tabs to null\");\n\t\tActions.stopListeningOnParentWrapper(() => {\n\t\t\tActions.parentWrapperStore = null;\n\t\t\tActions._setTabs(null);\n\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\tdata: {\n\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t};\n\n\tfinsembleWindow?.addListener(\"setParent\", onParentSet);\n\tfinsembleWindow?.addListener(\"clearParent\", onParentCleared);\n\tif (err) {\n\t\treturn FSBL.Clients.Logger.system.error(\"Error in getInitialTabList.\", err);\n\t}\n\n\tif (values) Actions._setTabs(values);\n};\n\n/**\n * \"FSBLHeader\" can be true, false or an object. If false then we'll never even be here. If true, then maximize, minimize and close buttons will display. If an object, then the developer can override whether buttons are shown with \"hideMaximize\", \"hideMinimize\" and \"hideClose\"\n */\nconst processFSBLHeader = (FSBLHeader: any, windowTitleBarConfig: any, options: any) => {\n\t// Display name is first up for display. If it doesn't exist, we look for a default title (or one that's already set on init). If no title, we display the window's name (e.g., '5434-Welcome Component-2321').\n\tconst displayName = options.customData?.component?.displayName;\n\n\tconst max = !!FSBLHeader.hideMaximize;\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"Maximize.hide\", value: max },\n\t\t{ field: \"Minimize.hide\", value: !!FSBLHeader.hideMinimize },\n\t\t{ field: \"Close.hide\", value: !!FSBLHeader.hideClose },\n\t\t{ field: \"AlwaysOnTop.show\", value: !!FSBLHeader.alwaysOnTop },\n\t]);\n\n\t// By default, we hack the window's scroll bar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\twindowTitleBarStore.setValue({\n\t\tfield: \"hackScrollbar\",\n\t\tvalue: windowTitleBarConfig.hackScrollbar !== false,\n\t});\n\n\tconst title = FSBL.Clients.WindowClient.title || windowTitleBarConfig.title || displayName;\n\n\tif (title) {\n\t\tdocument.title = title;\n\t}\n};\n\n// Once the above has been checked the individual component config is checked for customData.foreign.services[windowService || dockingService][!ignoreTilingAndTabbingRequests || allowTabbing]\nconst getOptionsCallback: StandardCallback = (err, opts: Record<string, any>) => {\n\tconst windowAllowTabbing = opts.customData?.foreign?.services?.windowService?.allowTabbing;\n\tconst windowIgnoreTabbing = opts.customData?.foreign?.services?.windowService?.ignoreTilingAndTabbingRequests;\n\tconst dockingAllowTabbing = opts.customData?.foreign?.services?.dockingService?.allowTabbing;\n\tconst dockingIgnoreTabbing = opts.customData?.foreign.services?.dockingService?.ignoreTilingAndTabbingRequests;\n\tconst dontShowTabs =\n\t\twindowAllowTabbing === false ||\n\t\twindowIgnoreTabbing === true ||\n\t\tdockingAllowTabbing === false ||\n\t\tdockingIgnoreTabbing === true;\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"showTabs\",\n\t\tvalue: !dontShowTabs,\n\t});\n};\n\nconst processFEAAndFinsembleConfig = (values: Record<string, any>, windowTitleBarConfig: Record<string, any>) => {\n\tconst finsembleConfig = values.finsemble;\n\n\t// Check FEA config for DOM based movement configuration\n\tconst { useDOMBasedMovement } = values[\"finsemble-electron-adapter\"];\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.useDOMBasedMovement\",\n\t\tvalue: typeof useDOMBasedMovement === \"undefined\" ? true : useDOMBasedMovement,\n\t});\n\n\t// Override defaults if finsemble.Window Manager exists.\n\tconst globalWindowManagerConfig = finsembleConfig[\"Window Manager\"] || {\n\t\talwaysOnTopIcon: false,\n\t\tshowTabs: false,\n\t};\n\n\t// Look to see if docking is enabled. Cascade through backward compatibility with old \"betaFeatures\" and then a default if no config is found at all.\n\n\tfinsembleConfig.servicesConfig = finsembleConfig.servicesConfig ?? {};\n\n\tconst defaultDockingConfig = {\n\t\tenabled: true,\n\t};\n\tlet dockingConfig =\n\t\tfinsembleConfig.servicesConfig.docking ??\n\t\tfinsembleConfig.docking ??\n\t\tfinsembleConfig.betaFeatures?.docking ??\n\t\tdefaultDockingConfig;\n\tdockingConfig.tabbing = dockingConfig.tabbing ?? {};\n\n\t// Whether the alwaysOnTop pin is displayed depends this component's config (foreign.components[\"Widow Manager\"].alwaysOnTop)\n\t// and then on the global setting (finsemble[\"Window Manager\"].alwaysOnTop)\n\tconst alwaysOnTopIcon = windowTitleBarConfig.alwaysOnTopIcon ?? globalWindowManagerConfig.alwaysOnTopIcon ?? false;\n\n\tconst servicesConfigWindow = finsembleConfig.servicesConfig.window;\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"Main.dockingEnabled\", value: dockingConfig.enabled },\n\t\t{\n\t\t\tfield: \"allowWindowTitleRenaming\",\n\t\t\tvalue: servicesConfigWindow.allowWindowTitleRenaming ?? dockingConfig.tabbing.allowEditing ?? false,\n\t\t},\n\t\t{ field: \"AlwaysOnTop.show\", value: alwaysOnTopIcon },\n\t]);\n\n\t// If tabbing is turned off, ignore global/local 'windowManager' config about whether to allow tabbing.\n\tif (dockingConfig.tabbing.enabled === false) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"showTabs\",\n\t\t\tvalue: dockingConfig.tabbing.enabled,\n\t\t});\n\t} else {\n\t\t// If tabbing is enabled system-wide, look to the global config for its value. Then look to the local component's config.\n\n\t\t// This is the global window manager config.\n\t\tif (typeof windowTitleBarConfig.showTabs !== \"boolean\") {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"showTabs\",\n\t\t\t\tvalue: globalWindowManagerConfig.showTabs,\n\t\t\t});\n\t\t}\n\t\t// This is the component's config.\n\t\tif (windowTitleBarConfig.showTabs || windowTitleBarConfig.showTabs === false) {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"showTabs\",\n\t\t\t\tvalue: windowTitleBarConfig.showTabs,\n\t\t\t});\n\t\t}\n\n\t\tfinsembleWindow.getOptions(getOptionsCallback);\n\t}\n};\n\n// these are constants that are set inside of setupStore. so they're declared as vars and not constants.\nlet constants: ConstantsType;\nconst Actions: ActionsType = {\n\tparentWrapperStore: null,\n\tinitialize: () => {\n\t\t// This ensures that our config is correct, even if the developer missed some entries\n\t\tconst { options } = FSBL.Clients.WindowClient;\n\t\tconst windowTitleBarConfig = options.customData.foreign.components[\"Window Manager\"];\n\t\tconst { FSBLHeader } = windowTitleBarConfig;\n\n\t\tif (FSBLHeader) processFSBLHeader(FSBLHeader, windowTitleBarConfig, options);\n\n\t\tif (windowTitleBarConfig.showLinker) showLinkerButton();\n\n\t\tlistenForDNDUpdates();\n\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.groupUpdate\", onDockingGroupUpdate);\n\n\t\t// default title.\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t\tvalue: FSBL.Clients.WindowClient.getWindowTitle(),\n\t\t});\n\n\t\tFSBL.Clients.ConfigClient.getValues(\n\t\t\t[{ field: \"finsemble\" }, { field: \"finsemble-electron-adapter\" }],\n\t\t\t(err, config) => {\n\t\t\t\tif (config) processFEAAndFinsembleConfig(config, windowTitleBarConfig);\n\t\t\t}\n\t\t);\n\n\t\tActions.getInitialTabList(processInitialTabList);\n\n\t\t/**\n\t\t * This store does not listen on window events (such as \"maximized\" or \"minimized\") - that is the\n\t\t * WindowClient's job. The headerCommandChannel allows the WindowClient to affect the display state\n\t\t * of the windowTitleBar - such as changing the maximize icon when a \"maximized\" event is received.\n\t\t */\n\t\tFSBL.Clients.WindowClient.headerCommandChannel((command, state) => {\n\t\t\tActions.remoteStateUpdate(command, state);\n\t\t});\n\t},\n\t/**\n\t * Helper function to sift through all of the data coming from the windowService. Outputs an array of groups that the window belongs to.\n\t */\n\tgetMyDockingGroups: function (groupData) {\n\t\tlet myGroups = [];\n\t\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\t\tif (finsembleWindow?.parentWindow) {\n\t\t\twindowName = finsembleWindow?.parentWindow.name;\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"Getting docking groups for \", windowName, groupData);\n\t\tif (groupData) {\n\t\t\tfor (let groupName in groupData) {\n\t\t\t\tgroupData[groupName].groupName = groupName;\n\t\t\t\tif (groupData[groupName].windowNames.includes(windowName)) {\n\t\t\t\t\tmyGroups.push(groupData[groupName]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn myGroups;\n\t},\n\tonTabListScrollPositionChanged: function (err, response) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"tabListTranslateX\",\n\t\t\tvalue: response.data.translateX,\n\t\t});\n\t},\n\tsetTabListScrollPosition: function (translateX) {\n\t\tFSBL.Clients.RouterClient.transmit(constants.TAB_SCROLL_POSITION_CHANGED, {\n\t\t\ttranslateX,\n\t\t});\n\t},\n\t/**\n\t * Handles messages coming from the windowClient.\n\t */\n\tremoteStateUpdate: function (command, state) {\n\t\tconst key = Object.keys(state)[0];\n\t\tconst field = `${command}.${key}`;\n\t\twindowTitleBarStore.setValue({ field: field, value: state[key] });\n\t},\n\t/**\n\t * Minimizes the window.\n\t */\n\tclickMinimize: function () {\n\t\tfinsembleWindow.minimize(() => {});\n\t},\n\t/**\n\t * Closes the window, allows for cleanup. Removes the window from workspace; this function is only invoked when the user clicks the close button.\n\t */\n\tclickClose: function () {\n\t\tFSBL.Clients.WindowClient.close({\n\t\t\tcloseWindow: true,\n\t\t\tremoveFromWorkspace: true, // this will cause the entire stack to close. Using this instead of a new parameter to ensure backwards compatibility\n\t\t\tuserInitiated: true,\n\t\t});\n\t},\n\t/**\n\t * Toggles group membership. If two windows are snapped, and this button is clicked, they become part of the same group that can be moved around together.\n\t */\n\ttoggleGroup: function () {\n\t\tconst groups = windowTitleBarStore.getValue({ field: \"Main.dockingGroups\" });\n\t\tconst isInMovableGroup = groups.some((group: any) => group.isMovable);\n\t\tif (isInMovableGroup) {\n\t\t\tfinsembleWindow.ejectFromGroup();\n\t\t} else {\n\t\t\tfinsembleWindow.formGroup();\n\t\t}\n\t},\n\t/**\n\t * Maximizes the window.\n\t */\n\tclickMaximize: function () {\n\t\tif (finsembleWindow.windowOptions.windowState !== finsembleWindow.WINDOWSTATE.MAXIMIZED)\n\t\t\treturn finsembleWindow.maximize(() => {\n\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\t\tvalue: true,\n\t\t\t\t});\n\t\t\t});\n\n\t\treturn finsembleWindow.restore(() => {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\tvalue: false,\n\t\t\t});\n\t\t});\n\t},\n\n\tgetTabs() {\n\t\treturn windowTitleBarStore.getValue({ field: \"tabs\" }) as WindowIdentifier[];\n\t},\n\t_setTabs(tabs) {\n\t\tFSBL.Clients.Logger.system.debug(\"Set tabs\", tabs);\n\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\treturn windowTitleBarStore.setValue({\n\t\t\tfield: \"tabs\",\n\t\t\tvalue: tabs || [activeIdentifier],\n\t\t});\n\t},\n\taddTabLocally: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\tif (typeof i === \"undefined\") {\n\t\t\ti = tabs.length + 1;\n\t\t}\n\t\ttabs.splice(i, 0, windowIdentifier);\n\t\tActions._setTabs(tabs);\n\t},\n\tremoveTabsLocally: function () {\n\t\tActions._setTabs(null);\n\t},\n\tremoveTabLocally: function (windowIdentifier) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet i = tabs.findIndex((el) => el.windowName === windowIdentifier.windowName);\n\t\ttabs.splice(i, 1);\n\t\tActions._setTabs(tabs);\n\t},\n\treorderTabLocally: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === newIndex) return;\n\t\tif (currentIndex === -1) {\n\t\t\treturn Actions.addTabLocally(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\n\t\tActions._setTabs(tabs);\n\t},\n\taddTab: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\ttabs.push(windowIdentifier);\n\t\t// quick UI update\n\t\tActions._setTabs(tabs);\n\t\tlet callback = () => {\n\t\t\tActions.parentWrapper?.setVisibleWindow({ windowIdentifier });\n\t\t};\n\n\t\tif (!Actions.parentWrapper) {\n\t\t\treturn Actions.createParentWrapper({\n\t\t\t\twindowIdentifiers: finsembleWindow.identifier\n\t\t\t\t\t? [finsembleWindow.identifier, windowIdentifier]\n\t\t\t\t\t: [windowIdentifier],\n\t\t\t\tvisibleWindowIdentifier: windowIdentifier,\n\t\t\t\tcreate: true,\n\t\t\t});\n\t\t}\n\t\treturn Actions.parentWrapper.addWindow({ windowIdentifier, position: i }, callback);\n\t},\n\tremoveTab: function (windowIdentifier, i) {\n\t\treturn Actions.parentWrapper?.removeWindow({\n\t\t\twindowIdentifier,\n\t\t\tposition: i,\n\t\t});\n\t},\n\tcloseTab: function (windowIdentifier) {\n\t\tconst close: StandardCallback = (err, wrap) => {\n\t\t\twrap.close({ removeFromWorkspace: true });\n\t\t};\n\t\tFSBL.FinsembleWindow.getInstance(windowIdentifier, close);\n\t},\n\treorderTab: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === -1 || !Actions.parentWrapper) {\n\t\t\treturn Actions.addTab(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\t\t// Local change, quickly updates the dom.\n\t\tActions._setTabs(tabs);\n\t\tActions.parentWrapper.reorder({ windowIdentifiers: tabs });\n\t},\n\tfindTab: function (tab) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet currentIndex = tabs.findIndex((el) => tab.windowName === el.windowName);\n\t\treturn { tab, currentIndex };\n\t},\n\tsetActiveTab: function (windowIdentifier) {\n\t\tFSBL.Clients.Logger.system.debug(\"setActiveTab.visibleWindow\");\n\t\treturn finsembleWindow.parentWindow.setVisibleWindow({ windowIdentifier });\n\t},\n\tparentWrapper: null,\n\tonTabListChanged: function (err, response) {\n\t\tFSBL.Clients.Logger.system.debug(\"OnTabListChanged\", response.data);\n\t\tif (response.data && response.data.hasOwnProperty(constants.CHILD_WINDOW_FIELD)) {\n\t\t\tActions._setTabs(response.data[constants.CHILD_WINDOW_FIELD]);\n\t\t}\n\t},\n\tparentSubscriptions: [],\n\tstopListeningOnParentWrapper: function (cb) {\n\t\tActions.parentSubscriptions.forEach((sub) => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(sub);\n\t\t});\n\t\tActions.parentSubscriptions = []; // remove the subscribeId\n\t\t// Syncs scroll state across all tabs in a stack.\n\t\tFSBL.Clients.RouterClient.removeListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tcb();\n\t},\n\tlistenOnParentWrapper: function () {\n\t\tlet TABLIST_SUBSCRIPTION = FSBL.Clients.RouterClient.subscribe(\n\t\t\tconstants.PARENT_WRAPPER_UPDATES,\n\t\t\tActions.onTabListChanged\n\t\t);\n\t\tFSBL.Clients.RouterClient.addListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tActions.parentSubscriptions.push(TABLIST_SUBSCRIPTION);\n\t},\n\tsetupStore: function (cb = Function.prototype) {\n\t\tconstants = {\n\t\t\tPARENT_WRAPPER_UPDATES: `Finsemble.StackedWindow.${Actions.parentWrapper?.identifier?.windowName}`,\n\t\t\tCHILD_WINDOW_FIELD: \"childWindowIdentifiers\",\n\t\t\tVISIBLE_WINDOW_FIELD: \"visibleWindowIdentifier\",\n\t\t\tTAB_SCROLL_POSITION_CHANGED: `${Actions.parentWrapper?.name}.tabListTabListScrollPositionChanged`,\n\t\t};\n\t\tActions.listenOnParentWrapper();\n\t\tcb();\n\t},\n\tgetInitialTabList: function (cb) {\n\t\tfinsembleWindow.getParent((err, parentWrapper) => {\n\t\t\tActions.parentWrapper = parentWrapper;\n\t\t\tif (Actions.parentWrapper) {\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"GetInitialTabList, parent exists\");\n\t\t\t\tActions.setupStore(cb);\n\t\t\t} else {\n\t\t\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\t\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\t\t\tlet tabs = [activeIdentifier];\n\t\t\t\tcb(null, tabs);\n\t\t\t}\n\t\t});\n\t},\n\tcreateParentWrapper(params: ParentParams, cb = Function.prototype) {\n\t\t(window as any).Actions = Actions;\n\t\tif (Actions.parentWrapper) {\n\t\t\tcb();\n\t\t} else {\n\t\t\tconst getStackedWindowCallback: StandardCallback = (err, wrap) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tActions.parentWrapper = null;\n\t\t\t\t\tActions._setTabs(null);\n\t\t\t\t} else {\n\t\t\t\t\tActions.parentWrapper = wrap;\n\t\t\t\t\tActions.setupStore(cb);\n\t\t\t\t}\n\t\t\t};\n\t\t\tgetStackedWindow(params, getStackedWindowCallback);\n\t\t}\n\t},\n};\n\n/**\n * Initializes the store for the windowTitleBar.\n *\n * @param {any} cb\n */\nfunction initialize(cb: Function) {\n\tFSBL.Clients.DistributedStoreClient.createStore(\n\t\t{ store: \"windowTitleBarStore\", values: windowTitleBarStoreDefaults },\n\t\t(err, store) => {\n\t\t\tif (!err && store) {\n\t\t\t\twindowTitleBarStore = store;\n\t\t\t}\n\t\t\tActions.initialize();\n\t\t\treturn cb(store, Actions);\n\t\t}\n\t);\n}\n\nlet getStore = () => windowTitleBarStore;\n\nclass StoreManager {\n\tinitialized = false;\n\n\tinitializing = false;\n\n\tstore: StoreModel | null = null;\n\n\tcallbacks: Function[] = [];\n\n\tconstructor() {}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: Function) {\n\t\tif (this.initialized) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport { storeManager };\nexport { initialize };\nexport { windowTitleBarStore as Store };\nexport { Actions };\nexport { getStore };\n"]}
1
+ {"version":3,"file":"windowTitleBarStore.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/stores/windowTitleBarStore.ts"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAKxE,MAAM,uBAAuB,GAAG,CAAC,eAAgC,EAAE,EAAE;IACpE,MAAM,MAAM,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MAAM,YAAY;IASjB;QARA,gBAAW,GAAG,KAAK,CAAC;QAEpB,iBAAY,GAAG,KAAK,CAAC;QAErB,UAAK,GAAsB,IAAI,CAAC;QAEhC,cAAS,GAAe,EAAE,CAAC;IAEZ,CAAC;IAEhB,UAAU;QACT,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,UAAU,CAAC,CAAC,KAAiB,EAAE,EAAE;YAChC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,EAAY;QAClC,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO,EAAE,mBAAmB,IAAI,KAAK,EAAE,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport windowTitleBarStoreDefaults from \"./windowTitleBarStoreDefaults\";\nimport { StandardCallback } from \"@finsemble/finsemble-api/types/types\";\nimport { FinsembleWindow, WindowIdentifier } from \"@finsemble/finsemble-api\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\n\nconst getWindowNameForDocking = (finsembleWindow: FinsembleWindow) => {\n\tconst parent = finsembleWindow.parentWindow;\n\treturn parent ? parent.name : finsembleWindow.name;\n};\n\ntype ParentParams = {\n\twindowIdentifiers: WindowIdentifier[];\n\tvisibleWindowIdentifier: WindowIdentifier;\n\tcreate: boolean;\n};\n\nconst getStackedWindow = (params: ParentParams, cb: StandardCallback) => {\n\tif (!finsembleWindow.parentWindow && params.create) {\n\t\tconst onParentSet = (evt: any) => {\n\t\t\tconst { parentName } = evt.data;\n\t\t\tfinsembleWindow.setParent({ windowName: parentName }, (err2, windowWrapper) => {\n\t\t\t\tcb?.(err2, windowWrapper);\n\t\t\t});\n\t\t\tfinsembleWindow.removeListener(\"parent-set\", onParentSet);\n\t\t};\n\t\tfinsembleWindow.addListener(\"parent-set\", onParentSet);\n\t\tFSBL.Clients.LauncherClient.spawn(\n\t\t\t\"StackedWindow\",\n\t\t\t{\n\t\t\t\twindowType: \"StackedWindow\",\n\t\t\t\tdata: { windowIdentifiers: params.windowIdentifiers },\n\t\t\t\toptions: { newStack: true },\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (!err) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcb?.(err, null);\n\t\t\t}\n\t\t);\n\t} else {\n\t\tfinsembleWindow.getParent(cb);\n\t}\n};\n\nlet windowTitleBarStore: StoreModel;\n\ntype ConstantsType = {\n\tPARENT_WRAPPER_UPDATES: string;\n\tCHILD_WINDOW_FIELD: string;\n\tVISIBLE_WINDOW_FIELD: string;\n\tTAB_SCROLL_POSITION_CHANGED: string;\n};\n\ntype ActionsType = {\n\tparentWrapperStore: any;\n\tparentSubscriptions: any[];\n\tparentWrapper: FinsembleWindow | null;\n\n\tinitialize: () => void;\n\tgetMyDockingGroups: (groupData: any) => any[];\n\tonTabListScrollPositionChanged: StandardCallback;\n\tsetTabListScrollPosition: (translateX: number) => void;\n\tremoteStateUpdate: (command: string, state: any) => void;\n\tclickMinimize: () => void;\n\tclickClose: () => void;\n\ttoggleGroup: () => void;\n\tclickMaximize: () => void;\n\tgetTabs: () => WindowIdentifier[];\n\t_setTabs: (tabs: WindowIdentifier[] | null) => any;\n\taddTabLocally: (windowIdentifier: WindowIdentifier, i: number) => void;\n\tremoveTabsLocally: () => void;\n\tremoveTabLocally: (windowIdentifier: WindowIdentifier) => void;\n\treorderTabLocally: (tab: WindowIdentifier, newIndex: number) => undefined | any;\n\taddTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tremoveTab: (windowIdentifier: WindowIdentifier, i: number) => any;\n\tcloseTab: (windowIdentifier: WindowIdentifier) => void;\n\treorderTab: (tab: WindowIdentifier, newIndex: number) => any;\n\tfindTab: (tab: WindowIdentifier) => { tab: WindowIdentifier; currentIndex: number };\n\tsetActiveTab: (windowIdentifier: WindowIdentifier) => Promise<any>;\n\tonTabListChanged: StandardCallback;\n\tstopListeningOnParentWrapper: (cb: Function) => void;\n\tlistenOnParentWrapper: () => void;\n\tsetupStore: (cb?: Function) => void;\n\tgetInitialTabList: (cb: StandardCallback) => void;\n\tcreateParentWrapper: (params: ParentParams, cb?: Function) => void;\n};\n\n/**\n * When a group update is publish, we sift through the data to see if this window is snapped or grouped with other windows. Then we publish that info, and the GroupingButton renders the correct icon.\n * @param {*} err\n * @param {*} response\n */\nconst onDockingGroupUpdate: StandardCallback = (err, response) => {\n\tif (err || !response.data || !response.data.groupData) {\n\t\treturn;\n\t}\n\tFSBL.Clients.Logger.system.debug(\"On docking group update\", response.data.groupData);\n\tlet groupNames = Object.keys(response.data.groupData);\n\tlet movableGroups = groupNames\n\t\t.filter((groupName) => response.data.groupData[groupName].isMovable)\n\t\t.map((groupName) => response.data.groupData[groupName]);\n\t// This is all movable and snapped groups. It's used later to figure out the icon to display.\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.allDockingGroups\",\n\t\tvalue: response.data.groupData,\n\t});\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.allMovableDockingGroups\",\n\t\tvalue: movableGroups,\n\t});\n\tlet myGroups = Actions.getMyDockingGroups(response.data.groupData);\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.dockingGroups\",\n\t\tvalue: myGroups,\n\t});\n\t/**\n\t * Goes through groups and sees if this window is grouped, snapped, or freely hanging out there.\n\t */\n\tlet isSnapped = false;\n\tlet isInMovableGroup = false;\n\tlet isTopRight = false;\n\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\tfor (let i = 0; i < myGroups.length; i++) {\n\t\tlet myGroup = myGroups[i];\n\t\tif (myGroup.isMovable) {\n\t\t\tisInMovableGroup = true;\n\t\t\tif (windowName == myGroup.topRightWindow) {\n\t\t\t\tisTopRight = true;\n\t\t\t}\n\t\t} else {\n\t\t\tisSnapped = true;\n\t\t}\n\t}\n\tlet icon: string | false = false;\n\n\tif (isSnapped) {\n\t\ticon = \"joiner\";\n\t}\n\tif (isInMovableGroup) {\n\t\ticon = \"ejector\";\n\t}\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"isSnapped\", value: isSnapped },\n\t\t{ field: \"isGrouped\", value: isInMovableGroup },\n\t\t{ field: \"isTopRight\", value: isTopRight },\n\t\t{ field: \"Main.dockingIcon\", value: icon },\n\t]);\n};\n\n/**\n * Listen for updates from the dragAndDropClient.\n */\nconst listenForDNDUpdates = () => {\n\tFSBL.Clients.RouterClient.subscribe(`${FSBL.Clients.WindowClient.options.name}Finsemble.Sharer`, (err, response) => {\n\t\tif (err) {\n\t\t\treturn console.error(err);\n\t\t}\n\t\twindowTitleBarStore.setValues([\n\t\t\t{\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\tvalue: response.data.emitterEnabled,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfield: \"Sharer.receiverEnabled\",\n\t\t\t\tvalue: response.data.receiverEnabled,\n\t\t\t},\n\t\t]);\n\t});\n};\n\n/**\n * Handles whether to show the linker button.\n */\nconst showLinkerButton = () => {\n\t// Get state (channel membership) from the linkerClient. Then set the value in the header so that the title bar accurately reflects the state.\n\tconst cb: StandardCallback = (err, response) => {\n\t\tif (response.channels) {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Linker.channels\",\n\t\t\t\tvalue: response.channels,\n\t\t\t});\n\t\t}\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\tvalue: true,\n\t\t});\n\t};\n\tcb(null, FSBL.Clients.LinkerClient.getState());\n\tFSBL.Clients.LinkerClient.onStateChange(cb);\n};\n\nconst processInitialTabList = (err: any, values: any) => {\n\tconst onParentSet = () => {\n\t\tActions.parentWrapper = null;\n\t\tActions.getInitialTabList(() => {\n\t\t\tFSBL.Clients.Logger.system.debug(\"docking group update after initial tab list\");\n\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\tdata: {\n\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t};\n\tconst onParentCleared = () => {\n\t\tActions.parentWrapper = null;\n\t\tFSBL.Clients.Logger.system.debug(\"ClearParent, setting tabs to null\");\n\t\tActions.stopListeningOnParentWrapper(() => {\n\t\t\tActions.parentWrapperStore = null;\n\t\t\tActions._setTabs(null);\n\t\t\tonDockingGroupUpdate(null, {\n\t\t\t\tdata: {\n\t\t\t\t\tgroupData: windowTitleBarStore.getValue({\n\t\t\t\t\t\tfield: \"Main.allDockingGroups\",\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t};\n\n\tfinsembleWindow?.addListener(\"setParent\", onParentSet);\n\tfinsembleWindow?.addListener(\"clearParent\", onParentCleared);\n\tif (err) {\n\t\treturn FSBL.Clients.Logger.system.error(\"Error in getInitialTabList.\", err);\n\t}\n\n\tif (values) Actions._setTabs(values);\n};\n\n/**\n * \"FSBLHeader\" can be true, false or an object. If false then we'll never even be here. If true, then maximize, minimize and close buttons will display. If an object, then the developer can override whether buttons are shown with \"hideMaximize\", \"hideMinimize\" and \"hideClose\"\n */\nconst processFSBLHeader = (FSBLHeader: any, windowTitleBarConfig: any, options: any) => {\n\t// Display name is first up for display. If it doesn't exist, we look for a default title (or one that's already set on init). If no title, we display the window's name (e.g., '5434-Welcome Component-2321').\n\tconst displayName = options.customData?.component?.displayName;\n\n\tconst max = !!FSBLHeader.hideMaximize;\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"Maximize.hide\", value: max },\n\t\t{ field: \"Minimize.hide\", value: !!FSBLHeader.hideMinimize },\n\t\t{ field: \"Close.hide\", value: !!FSBLHeader.hideClose },\n\t\t{ field: \"AlwaysOnTop.show\", value: !!FSBLHeader.alwaysOnTop },\n\t]);\n\n\t// By default, we hack the window's scroll bar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\twindowTitleBarStore.setValue({\n\t\tfield: \"hackScrollbar\",\n\t\tvalue: windowTitleBarConfig.FSBLHeader.hackScrollbar !== false,\n\t});\n\twindowTitleBarStore.setValue({\n\t\tfield: \"adjustContentHeights\",\n\t\tvalue: windowTitleBarConfig.FSBLHeader.adjustContentHeights !== false,\n\t});\n\tif (windowTitleBarConfig.FSBLHeader.bumpElements) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"bumpElements\",\n\t\t\tvalue: windowTitleBarConfig.FSBLHeader.bumpElements,\n\t\t});\n\t}\n\tconst title = FSBL.Clients.WindowClient.title || windowTitleBarConfig.title || displayName;\n\n\tif (title) {\n\t\tdocument.title = title;\n\t}\n};\n\n// Once the above has been checked the individual component config is checked for customData.foreign.services[windowService || dockingService][!ignoreTilingAndTabbingRequests || allowTabbing]\nconst getOptionsCallback: StandardCallback = (err, opts: Record<string, any>) => {\n\tconst windowAllowTabbing = opts.customData?.foreign?.services?.windowService?.allowTabbing;\n\tconst windowIgnoreTabbing = opts.customData?.foreign?.services?.windowService?.ignoreTilingAndTabbingRequests;\n\tconst dockingAllowTabbing = opts.customData?.foreign?.services?.dockingService?.allowTabbing;\n\tconst dockingIgnoreTabbing = opts.customData?.foreign.services?.dockingService?.ignoreTilingAndTabbingRequests;\n\tconst dontShowTabs =\n\t\twindowAllowTabbing === false ||\n\t\twindowIgnoreTabbing === true ||\n\t\tdockingAllowTabbing === false ||\n\t\tdockingIgnoreTabbing === true;\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"showTabs\",\n\t\tvalue: !dontShowTabs,\n\t});\n};\n\nconst processFEAAndFinsembleConfig = (values: Record<string, any>, windowTitleBarConfig: Record<string, any>) => {\n\tconst finsembleConfig = values.finsemble;\n\n\t// Check FEA config for DOM based movement configuration\n\tconst { useDOMBasedMovement } = values[\"finsemble-electron-adapter\"];\n\n\twindowTitleBarStore.setValue({\n\t\tfield: \"Main.useDOMBasedMovement\",\n\t\tvalue: typeof useDOMBasedMovement === \"undefined\" ? true : useDOMBasedMovement,\n\t});\n\n\t// Override defaults if finsemble.Window Manager exists.\n\tconst globalWindowManagerConfig = finsembleConfig[\"Window Manager\"] || {\n\t\talwaysOnTopIcon: false,\n\t\tshowTabs: false,\n\t};\n\n\t// Look to see if docking is enabled. Cascade through backward compatibility with old \"betaFeatures\" and then a default if no config is found at all.\n\n\tfinsembleConfig.servicesConfig = finsembleConfig.servicesConfig ?? {};\n\n\tconst defaultDockingConfig = {\n\t\tenabled: true,\n\t};\n\tlet dockingConfig =\n\t\tfinsembleConfig.servicesConfig.docking ??\n\t\tfinsembleConfig.docking ??\n\t\tfinsembleConfig.betaFeatures?.docking ??\n\t\tdefaultDockingConfig;\n\tdockingConfig.tabbing = dockingConfig.tabbing ?? {};\n\n\t// Whether the alwaysOnTop pin is displayed depends this component's config (foreign.components[\"Widow Manager\"].alwaysOnTop)\n\t// and then on the global setting (finsemble[\"Window Manager\"].alwaysOnTop)\n\tconst alwaysOnTopIcon = windowTitleBarConfig.alwaysOnTopIcon ?? globalWindowManagerConfig.alwaysOnTopIcon ?? false;\n\n\tconst servicesConfigWindow = finsembleConfig.servicesConfig.window;\n\n\twindowTitleBarStore.setValues([\n\t\t{ field: \"Main.dockingEnabled\", value: dockingConfig.enabled },\n\t\t{\n\t\t\tfield: \"allowWindowTitleRenaming\",\n\t\t\tvalue: servicesConfigWindow.allowWindowTitleRenaming ?? dockingConfig.tabbing.allowEditing ?? false,\n\t\t},\n\t\t{ field: \"AlwaysOnTop.show\", value: alwaysOnTopIcon },\n\t]);\n\n\t// If tabbing is turned off, ignore global/local 'windowManager' config about whether to allow tabbing.\n\tif (dockingConfig.tabbing.enabled === false) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"showTabs\",\n\t\t\tvalue: dockingConfig.tabbing.enabled,\n\t\t});\n\t} else {\n\t\t// If tabbing is enabled system-wide, look to the global config for its value. Then look to the local component's config.\n\n\t\t// This is the global window manager config.\n\t\tif (typeof windowTitleBarConfig.showTabs !== \"boolean\") {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"showTabs\",\n\t\t\t\tvalue: globalWindowManagerConfig.showTabs,\n\t\t\t});\n\t\t}\n\t\t// This is the component's config.\n\t\tif (windowTitleBarConfig.showTabs || windowTitleBarConfig.showTabs === false) {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"showTabs\",\n\t\t\t\tvalue: windowTitleBarConfig.showTabs,\n\t\t\t});\n\t\t}\n\n\t\tfinsembleWindow.getOptions(getOptionsCallback);\n\t}\n};\n\n// these are constants that are set inside of setupStore. so they're declared as vars and not constants.\nlet constants: ConstantsType;\nconst Actions: ActionsType = {\n\tparentWrapperStore: null,\n\tinitialize: () => {\n\t\t// This ensures that our config is correct, even if the developer missed some entries\n\t\tconst { options } = FSBL.Clients.WindowClient;\n\t\tconst windowTitleBarConfig = options.customData.foreign.components[\"Window Manager\"];\n\t\tconst { FSBLHeader } = windowTitleBarConfig;\n\n\t\tif (FSBLHeader) processFSBLHeader(FSBLHeader, windowTitleBarConfig, options);\n\n\t\tif (windowTitleBarConfig.showLinker) showLinkerButton();\n\n\t\tlistenForDNDUpdates();\n\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.WorkspaceService.groupUpdate\", onDockingGroupUpdate);\n\n\t\t// default title.\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t\tvalue: FSBL.Clients.WindowClient.getWindowTitle(),\n\t\t});\n\n\t\tFSBL.Clients.ConfigClient.getValues(\n\t\t\t[{ field: \"finsemble\" }, { field: \"finsemble-electron-adapter\" }],\n\t\t\t(err, config) => {\n\t\t\t\tif (config) processFEAAndFinsembleConfig(config, windowTitleBarConfig);\n\t\t\t}\n\t\t);\n\n\t\tActions.getInitialTabList(processInitialTabList);\n\n\t\t/**\n\t\t * This store does not listen on window events (such as \"maximized\" or \"minimized\") - that is the\n\t\t * WindowClient's job. The headerCommandChannel allows the WindowClient to affect the display state\n\t\t * of the windowTitleBar - such as changing the maximize icon when a \"maximized\" event is received.\n\t\t */\n\t\tFSBL.Clients.WindowClient.headerCommandChannel((command, state) => {\n\t\t\tActions.remoteStateUpdate(command, state);\n\t\t});\n\t},\n\t/**\n\t * Helper function to sift through all of the data coming from the windowService. Outputs an array of groups that the window belongs to.\n\t */\n\tgetMyDockingGroups: function (groupData) {\n\t\tlet myGroups = [];\n\t\tlet windowName = getWindowNameForDocking(finsembleWindow);\n\t\tif (finsembleWindow?.parentWindow) {\n\t\t\twindowName = finsembleWindow?.parentWindow.name;\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"Getting docking groups for \", windowName, groupData);\n\t\tif (groupData) {\n\t\t\tfor (let groupName in groupData) {\n\t\t\t\tgroupData[groupName].groupName = groupName;\n\t\t\t\tif (groupData[groupName].windowNames.includes(windowName)) {\n\t\t\t\t\tmyGroups.push(groupData[groupName]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn myGroups;\n\t},\n\tonTabListScrollPositionChanged: function (err, response) {\n\t\twindowTitleBarStore.setValue({\n\t\t\tfield: \"tabListTranslateX\",\n\t\t\tvalue: response.data.translateX,\n\t\t});\n\t},\n\tsetTabListScrollPosition: function (translateX) {\n\t\tFSBL.Clients.RouterClient.transmit(constants.TAB_SCROLL_POSITION_CHANGED, {\n\t\t\ttranslateX,\n\t\t});\n\t},\n\t/**\n\t * Handles messages coming from the windowClient.\n\t */\n\tremoteStateUpdate: function (command, state) {\n\t\tconst key = Object.keys(state)[0];\n\t\tconst field = `${command}.${key}`;\n\t\twindowTitleBarStore.setValue({ field: field, value: state[key] });\n\t},\n\t/**\n\t * Minimizes the window.\n\t */\n\tclickMinimize: function () {\n\t\tfinsembleWindow.minimize(() => {});\n\t},\n\t/**\n\t * Closes the window, allows for cleanup. Removes the window from workspace; this function is only invoked when the user clicks the close button.\n\t */\n\tclickClose: function () {\n\t\tFSBL.Clients.WindowClient.close({\n\t\t\tcloseWindow: true,\n\t\t\tremoveFromWorkspace: true, // this will cause the entire stack to close. Using this instead of a new parameter to ensure backwards compatibility\n\t\t\tuserInitiated: true,\n\t\t});\n\t},\n\t/**\n\t * Toggles group membership. If two windows are snapped, and this button is clicked, they become part of the same group that can be moved around together.\n\t */\n\ttoggleGroup: function () {\n\t\tconst groups = windowTitleBarStore.getValue({ field: \"Main.dockingGroups\" });\n\t\tconst isInMovableGroup = groups.some((group: any) => group.isMovable);\n\t\tif (isInMovableGroup) {\n\t\t\tfinsembleWindow.ejectFromGroup();\n\t\t} else {\n\t\t\tfinsembleWindow.formGroup();\n\t\t}\n\t},\n\t/**\n\t * Maximizes the window.\n\t */\n\tclickMaximize: function () {\n\t\tif (finsembleWindow.windowOptions.windowState !== finsembleWindow.WINDOWSTATE.MAXIMIZED)\n\t\t\treturn finsembleWindow.maximize(() => {\n\t\t\t\twindowTitleBarStore.setValue({\n\t\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\t\tvalue: true,\n\t\t\t\t});\n\t\t\t});\n\n\t\treturn finsembleWindow.restore(() => {\n\t\t\twindowTitleBarStore.setValue({\n\t\t\t\tfield: \"Maximize.maximized\",\n\t\t\t\tvalue: false,\n\t\t\t});\n\t\t});\n\t},\n\n\tgetTabs() {\n\t\treturn windowTitleBarStore.getValue({ field: \"tabs\" }) as WindowIdentifier[];\n\t},\n\t_setTabs(tabs) {\n\t\tFSBL.Clients.Logger.system.debug(\"Set tabs\", tabs);\n\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\treturn windowTitleBarStore.setValue({\n\t\t\tfield: \"tabs\",\n\t\t\tvalue: tabs || [activeIdentifier],\n\t\t});\n\t},\n\taddTabLocally: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\tif (typeof i === \"undefined\") {\n\t\t\ti = tabs.length + 1;\n\t\t}\n\t\ttabs.splice(i, 0, windowIdentifier);\n\t\tActions._setTabs(tabs);\n\t},\n\tremoveTabsLocally: function () {\n\t\tActions._setTabs(null);\n\t},\n\tremoveTabLocally: function (windowIdentifier) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet i = tabs.findIndex((el) => el.windowName === windowIdentifier.windowName);\n\t\ttabs.splice(i, 1);\n\t\tActions._setTabs(tabs);\n\t},\n\treorderTabLocally: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === newIndex) return;\n\t\tif (currentIndex === -1) {\n\t\t\treturn Actions.addTabLocally(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\n\t\tActions._setTabs(tabs);\n\t},\n\taddTab: function (windowIdentifier, i) {\n\t\tlet tabs = Actions.getTabs();\n\t\ttabs.push(windowIdentifier);\n\t\t// quick UI update\n\t\tActions._setTabs(tabs);\n\t\tlet callback = () => {\n\t\t\tActions.parentWrapper?.setVisibleWindow({ windowIdentifier });\n\t\t};\n\n\t\tif (!Actions.parentWrapper) {\n\t\t\treturn Actions.createParentWrapper({\n\t\t\t\twindowIdentifiers: finsembleWindow.identifier\n\t\t\t\t\t? [finsembleWindow.identifier, windowIdentifier]\n\t\t\t\t\t: [windowIdentifier],\n\t\t\t\tvisibleWindowIdentifier: windowIdentifier,\n\t\t\t\tcreate: true,\n\t\t\t});\n\t\t}\n\t\treturn Actions.parentWrapper.addWindow({ windowIdentifier, position: i }, callback);\n\t},\n\tremoveTab: function (windowIdentifier, i) {\n\t\treturn Actions.parentWrapper?.removeWindow({\n\t\t\twindowIdentifier,\n\t\t\tposition: i,\n\t\t});\n\t},\n\tcloseTab: function (windowIdentifier) {\n\t\tconst close: StandardCallback = (err, wrap) => {\n\t\t\twrap.close({ removeFromWorkspace: true });\n\t\t};\n\t\tFSBL.FinsembleWindow.getInstance(windowIdentifier, close);\n\t},\n\treorderTab: function (tab, newIndex) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet { currentIndex } = Actions.findTab(tab);\n\t\tif (currentIndex === -1 || !Actions.parentWrapper) {\n\t\t\treturn Actions.addTab(tab, newIndex);\n\t\t}\n\t\ttabs.splice(currentIndex, 1);\n\t\ttabs.splice(newIndex, 0, tab);\n\t\t// Local change, quickly updates the dom.\n\t\tActions._setTabs(tabs);\n\t\tActions.parentWrapper.reorder({ windowIdentifiers: tabs });\n\t},\n\tfindTab: function (tab) {\n\t\tlet tabs = Actions.getTabs();\n\t\tlet currentIndex = tabs.findIndex((el) => tab.windowName === el.windowName);\n\t\treturn { tab, currentIndex };\n\t},\n\tsetActiveTab: function (windowIdentifier) {\n\t\tFSBL.Clients.Logger.system.debug(\"setActiveTab.visibleWindow\");\n\t\treturn finsembleWindow.parentWindow.setVisibleWindow({ windowIdentifier });\n\t},\n\tparentWrapper: null,\n\tonTabListChanged: function (err, response) {\n\t\tFSBL.Clients.Logger.system.debug(\"OnTabListChanged\", response.data);\n\t\tif (response.data && response.data.hasOwnProperty(constants.CHILD_WINDOW_FIELD)) {\n\t\t\tActions._setTabs(response.data[constants.CHILD_WINDOW_FIELD]);\n\t\t}\n\t},\n\tparentSubscriptions: [],\n\tstopListeningOnParentWrapper: function (cb) {\n\t\tActions.parentSubscriptions.forEach((sub) => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(sub);\n\t\t});\n\t\tActions.parentSubscriptions = []; // remove the subscribeId\n\t\t// Syncs scroll state across all tabs in a stack.\n\t\tFSBL.Clients.RouterClient.removeListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tcb();\n\t},\n\tlistenOnParentWrapper: function () {\n\t\tlet TABLIST_SUBSCRIPTION = FSBL.Clients.RouterClient.subscribe(\n\t\t\tconstants.PARENT_WRAPPER_UPDATES,\n\t\t\tActions.onTabListChanged\n\t\t);\n\t\tFSBL.Clients.RouterClient.addListener(\n\t\t\tconstants.TAB_SCROLL_POSITION_CHANGED,\n\t\t\tActions.onTabListScrollPositionChanged\n\t\t);\n\t\tActions.parentSubscriptions.push(TABLIST_SUBSCRIPTION);\n\t},\n\tsetupStore: function (cb = Function.prototype) {\n\t\tconstants = {\n\t\t\tPARENT_WRAPPER_UPDATES: `Finsemble.StackedWindow.${Actions.parentWrapper?.identifier?.windowName}`,\n\t\t\tCHILD_WINDOW_FIELD: \"childWindowIdentifiers\",\n\t\t\tVISIBLE_WINDOW_FIELD: \"visibleWindowIdentifier\",\n\t\t\tTAB_SCROLL_POSITION_CHANGED: `${Actions.parentWrapper?.name}.tabListTabListScrollPositionChanged`,\n\t\t};\n\t\tActions.listenOnParentWrapper();\n\t\tcb();\n\t},\n\tgetInitialTabList: function (cb) {\n\t\tfinsembleWindow.getParent((err, parentWrapper) => {\n\t\t\tActions.parentWrapper = parentWrapper;\n\t\t\tif (Actions.parentWrapper) {\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"GetInitialTabList, parent exists\");\n\t\t\t\tActions.setupStore(cb);\n\t\t\t} else {\n\t\t\t\tlet activeIdentifier: any = finsembleWindow.identifier;\n\t\t\t\tactiveIdentifier.title = finsembleWindow.windowOptions.title;\n\t\t\t\tlet tabs = [activeIdentifier];\n\t\t\t\tcb(null, tabs);\n\t\t\t}\n\t\t});\n\t},\n\tcreateParentWrapper(params: ParentParams, cb = Function.prototype) {\n\t\t(window as any).Actions = Actions;\n\t\tif (Actions.parentWrapper) {\n\t\t\tcb();\n\t\t} else {\n\t\t\tconst getStackedWindowCallback: StandardCallback = (err, wrap) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tActions.parentWrapper = null;\n\t\t\t\t\tActions._setTabs(null);\n\t\t\t\t} else {\n\t\t\t\t\tActions.parentWrapper = wrap;\n\t\t\t\t\tActions.setupStore(cb);\n\t\t\t\t}\n\t\t\t};\n\t\t\tgetStackedWindow(params, getStackedWindowCallback);\n\t\t}\n\t},\n};\n\n/**\n * Initializes the store for the windowTitleBar.\n *\n * @param {any} cb\n */\nfunction initialize(cb: Function) {\n\tFSBL.Clients.DistributedStoreClient.createStore(\n\t\t{ store: \"windowTitleBarStore\", values: windowTitleBarStoreDefaults },\n\t\t(err, store) => {\n\t\t\tif (!err && store) {\n\t\t\t\twindowTitleBarStore = store;\n\t\t\t}\n\t\t\tActions.initialize();\n\t\t\treturn cb(store, Actions);\n\t\t}\n\t);\n}\n\nlet getStore = () => windowTitleBarStore;\n\nclass StoreManager {\n\tinitialized = false;\n\n\tinitializing = false;\n\n\tstore: StoreModel | null = null;\n\n\tcallbacks: Function[] = [];\n\n\tconstructor() {}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: Function) {\n\t\tif (this.initialized) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport { storeManager };\nexport { initialize };\nexport { windowTitleBarStore as Store };\nexport { Actions };\nexport { getStore };\n"]}
@@ -147,7 +147,7 @@ export declare const rootReducer: import("redux").Reducer<import("redux").Combin
147
147
  }) | ({
148
148
  type: "update_apps";
149
149
  } & {
150
- payload: import("@finsemble/finsemble-api/types/services/Interop/types").AppDefinition[];
150
+ payload: import("@finsemble/finsemble-api").AppDefinition[];
151
151
  }) | ({
152
152
  type: "new_app";
153
153
  } & {
@@ -159,7 +159,7 @@ export declare const rootReducer: import("redux").Reducer<import("redux").Combin
159
159
  }) | ({
160
160
  type: "update_app";
161
161
  } & {
162
- payload: import("@finsemble/finsemble-api/types/services/Interop/types").AppDefinition;
162
+ payload: import("@finsemble/finsemble-api").AppDefinition;
163
163
  }) | ({
164
164
  type: "delete_app";
165
165
  } & {
package/react/store.d.ts CHANGED
@@ -133,7 +133,7 @@ export declare const createStore: () => import("redux").Store<import("redux").Em
133
133
  }) | ({
134
134
  type: "update_apps";
135
135
  } & {
136
- payload: import("@finsemble/finsemble-api/types/services/Interop/types").AppDefinition[];
136
+ payload: import("@finsemble/finsemble-api").AppDefinition[];
137
137
  }) | ({
138
138
  type: "new_app";
139
139
  } & {
@@ -145,7 +145,7 @@ export declare const createStore: () => import("redux").Store<import("redux").Em
145
145
  }) | ({
146
146
  type: "update_app";
147
147
  } & {
148
- payload: import("@finsemble/finsemble-api/types/services/Interop/types").AppDefinition;
148
+ payload: import("@finsemble/finsemble-api").AppDefinition;
149
149
  }) | ({
150
150
  type: "delete_app";
151
151
  } & {
@@ -338,7 +338,7 @@ export declare const store: import("redux").Store<import("redux").EmptyObject &
338
338
  }) | ({
339
339
  type: "update_apps";
340
340
  } & {
341
- payload: import("@finsemble/finsemble-api/types/services/Interop/types").AppDefinition[];
341
+ payload: import("@finsemble/finsemble-api").AppDefinition[];
342
342
  }) | ({
343
343
  type: "new_app";
344
344
  } & {
@@ -350,7 +350,7 @@ export declare const store: import("redux").Store<import("redux").EmptyObject &
350
350
  }) | ({
351
351
  type: "update_app";
352
352
  } & {
353
- payload: import("@finsemble/finsemble-api/types/services/Interop/types").AppDefinition;
353
+ payload: import("@finsemble/finsemble-api").AppDefinition;
354
354
  }) | ({
355
355
  type: "delete_app";
356
356
  } & {