@finsemble/finsemble-ui 7.2.0-alpha.1 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/react/components/appCatalog/AppCatalogComponent.d.ts +12 -0
- package/react/components/appCatalog/components/AppCard.d.ts +13 -0
- package/react/components/appCatalog/components/Carousel.d.ts +5 -0
- package/react/components/appCatalog/components/Showcase/AppShowcase.d.ts +9 -0
- package/react/components/menu/keyboardNavigation.js.map +1 -1
- package/react/components/menu/menuHelpers.d.ts +1 -1
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
- package/react/components/sdd/Appearance.d.ts +1 -13
- package/react/components/sdd/Appearance.js +2 -2
- package/react/components/sdd/Appearance.js.map +1 -1
- package/react/components/sdd/AssetsPage.d.ts +1 -13
- package/react/components/sdd/AssetsPage.js +50 -47
- package/react/components/sdd/AssetsPage.js.map +1 -1
- package/react/components/sdd/SmartDesktopDesigner.d.ts +1 -1
- package/react/components/sdd/SmartDesktopDesigner.js +7 -3
- package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
- package/react/components/sdd/Themes.d.ts +1 -6
- package/react/components/sdd/Themes.js +5 -52
- package/react/components/sdd/Themes.js.map +1 -1
- package/react/components/sdd/common/fsbl_functions.d.ts +1 -1
- package/react/components/sdd/common/views.js +0 -2
- package/react/components/sdd/common/views.js.map +1 -1
- package/react/components/sdd/css/addApp.css +11 -5
- package/react/components/sdd/fixtures/themeProps.d.ts +0 -4
- package/react/components/sdd/fixtures/themeProps.js +0 -15
- package/react/components/sdd/fixtures/themeProps.js.map +1 -1
- package/react/components/sdd/fixtures/views.js +1 -1
- package/react/components/sdd/fixtures/views.js.map +1 -1
- package/react/components/sdd/smartDesktopClient.d.ts +3 -3
- package/react/components/sdd/stories/Appearance.stories.d.ts +1 -1
- package/react/components/sdd/stories/Appearance.stories.js +0 -12
- package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
- package/react/components/sdd/stories/AssetsPage.stories.d.ts +1 -1
- package/react/components/sdd/stories/AssetsPage.stories.js +0 -24
- package/react/components/sdd/stories/AssetsPage.stories.js.map +1 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.d.ts +1 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js +16 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/sdd/stories/Themes.stories.d.ts +1 -1
- package/react/components/sdd/stories/Themes.stories.js +0 -25
- package/react/components/sdd/stories/Themes.stories.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +2 -2
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -5
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +25 -0
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts +23 -0
- package/react/components/windowTitleBar/components/left/ShareButton.d.ts +16 -0
- package/react/components/windowTitleBar/components/windowTitle.js +2 -2
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/reducers/smartDesktopDesignerReducer.js +1 -0
- package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
- package/react/tsconfig.tsbuildinfo +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +1 -0
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WindowTitleBarShell.js","sourceRoot":"","sources":["../../../src/components/windowTitleBar/WindowTitleBarShell.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CA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AC,QAAQ;YAClC,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,gBAAgB;YAC5D,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;YACxC,YAAY,EAAE,IAAI,CAAC,uBAAuB;YAC1C,iBAAiB,EAAE,eAAe;YAClC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACvC,SAAS,EAAE,gBAAgB;YAC3B,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACvC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB;YACzC,iBAAiB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,uBAAuB;YACtD,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,cAAc,EAAE,IAAI,CAAC,gBAAgB;YACrC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,gBAAgB;YACvE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACnC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB;SACnD,CAAC;QAEF,OAAO,CACN,6BAAK,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAClE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAC1B,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAkC,CACtG,CACI,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport * as React from \"react\";\nimport { WindowTitleBarContext } from \"./windowTitleBarContext\";\nimport { storeManager, Actions, getStore } from \"./stores/windowTitleBarStore\";\nimport \"../../assets/css/windowTitleBar.css\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { TabProperties } from \"../../types/windowTitleBar\";\nimport { clone } from \"../sdd/Appearance.helpers\";\nimport { Logger } from \"@finsemble/finsemble-api\";\n\n// Values for possible zero\nconst possibleZeros = [\"0\", \"0px\", 0];\n\ntype BumpElements = {\n\tbumpBy: string;\n\tfixed: string;\n\tabsolute: string;\n\tmonitorFixedAdditions: boolean;\n};\n\ninterface WindowTitleBarShellProps {}\n\ninterface WindowTitleBarShellState {\n\ttabs: TabProperties[];\n\tactiveTab: TabProperties;\n\twindowTitle: string;\n\tinitialized: boolean;\n\talwaysOnTop: boolean;\n\tshowTabs: boolean;\n\tminButton: boolean;\n\tmaxButton: boolean;\n\tcloseButton: boolean;\n\tshowShareButton: boolean;\n\tshowLinkerButton: boolean;\n\tisTopRight: boolean;\n\tdockingEnabled: boolean;\n\talwaysOnTopButton: boolean;\n\tallowDragOnCenterRegion: boolean;\n\tdockingIcon: string;\n\thackScrollbar: boolean;\n\tshowDockingTooltip: boolean;\n\tshowTabRegion: boolean;\n\ttabBarBoundingBox: any;\n\tuseDOMBasedMovement: boolean;\n\tdragHandleName: string;\n\tbumpElements: BumpElements;\n\tadjustContentHeights: boolean;\n}\n\nexport class WindowTitleBarShell extends React.Component<WindowTitleBarShellProps, WindowTitleBarShellState> {\n\tstore?: StoreModel;\n\n\t// Keep track of if the mouse button is pressed\n\tisMousePressed = false;\n\n\tconstructor(props: WindowTitleBarShellProps) {\n\t\tsuper(props);\n\t\tthis.store = undefined;\n\n\t\tthis.bindCorrectContext();\n\t\tthis.state = {\n\t\t\tactiveTab: FSBL.Clients.WindowClient.getWindowIdentifier() as TabProperties,\n\t\t\tallowDragOnCenterRegion: true,\n\t\t\talwaysOnTop: false,\n\t\t\talwaysOnTopButton: false,\n\t\t\tcloseButton: false,\n\t\t\tdockingEnabled: false,\n\t\t\tdockingIcon: \"\",\n\t\t\thackScrollbar: false,\n\t\t\tinitialized: false,\n\t\t\tisTopRight: false,\n\t\t\tmaxButton: false,\n\t\t\tminButton: false,\n\t\t\tshowDockingTooltip: false,\n\t\t\tshowLinkerButton: false,\n\t\t\tshowShareButton: false,\n\t\t\tshowTabs: false,\n\t\t\tshowTabRegion: false,\n\t\t\ttabs: [],\n\t\t\ttabBarBoundingBox: {},\n\t\t\twindowTitle: \"\",\n\t\t\tuseDOMBasedMovement: true,\n\t\t\tdragHandleName: \"fsbl-drag-handle\",\n\t\t\tbumpElements: {} as BumpElements,\n\t\t\tadjustContentHeights: true,\n\t\t};\n\n\t\tfinsembleWindow.isAlwaysOnTop({}, (err, alwaysOnTop: boolean) => {\n\t\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t\t});\n\n\t\tfinsembleWindow.addEventListener(\"alwaysOnTop\", this.alwaysOnTopListener);\n\t}\n\n\talwaysOnTopListener({ data: { alwaysOnTop } }: any) {\n\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t}\n\n\t/**\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\n\t *\n\t * @memberof WindowTitleBar\n\t */\n\tbindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDockingEnabledChanged = this.onDockingEnabledChanged.bind(this);\n\t\tthis.onAlwaysOnTopChanged = this.onAlwaysOnTopChanged.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t\tthis.isTopRight = this.isTopRight.bind(this);\n\t\tthis.allowDragOnCenterRegion = this.allowDragOnCenterRegion.bind(this);\n\t\tthis.disallowDragOnCenterRegion = this.disallowDragOnCenterRegion.bind(this);\n\t\tthis.setDOMBasedMovement = this.setDOMBasedMovement.bind(this);\n\t\tthis.onShareEmitterChanged = this.onShareEmitterChanged.bind(this);\n\t\tthis.onTabsChanged = this.onTabsChanged.bind(this);\n\t\tthis.onShowTabsChanged = this.onShowTabsChanged.bind(this);\n\t\tthis.onTilingStop = this.onTilingStop.bind(this);\n\t\tthis.onTilingStart = this.onTilingStart.bind(this);\n\t\tthis.resizeDragHandle = this.resizeDragHandle.bind(this);\n\t\tthis.onDoubleClick = this.onDoubleClick.bind(this);\n\t\tthis.alwaysOnTopListener = this.alwaysOnTopListener.bind(this);\n\t\tthis.onInitialized = this.onInitialized.bind(this);\n\t}\n\n\tonInitialized() {\n\t\tthis.store = getStore();\n\t\tthis.store.addListeners(\n\t\t\t[\n\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t{ field: \"Main.showDockingTooltip\", listener: this.onShowDockingToolTip },\n\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t{ field: \"Main.dockingEnabled\", listener: this.onDockingEnabledChanged },\n\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t{ field: \"Sharer.emitterEnabled\", listener: this.onShareEmitterChanged },\n\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"hackScrollbar\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"Main.useDOMBasedMovement\", listener: this.setDOMBasedMovement },\n\t\t\t],\n\t\t\t() => {}\n\t\t);\n\n\t\t// Add listeners for tiling/tabbing\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.onTilingStart);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.onTilingStop);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.onTilingStop);\n\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.allowDragOnCenterRegion);\n\n\t\tthis.onStoreChange();\n\t\tthis.setState({\n\t\t\tinitialized: true,\n\t\t});\n\t}\n\n\tonStoreChange() {\n\t\tlet activeIdentifier = finsembleWindow.identifier as TabProperties;\n\t\tactiveIdentifier.title = this.store?.getValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t});\n\n\t\tthis.setState({\n\t\t\twindowTitle: this.store?.getValue({ field: \"Main.windowTitle\" }),\n\t\t\tminButton: !this.store?.getValue({ field: \"Minimize.hide\" }),\n\t\t\tmaxButton: !this.store?.getValue({ field: \"Maximize.hide\" }),\n\t\t\tcloseButton: !this.store?.getValue({ field: \"Close.hide\" }),\n\t\t\tshowLinkerButton: this.store?.getValue({\n\t\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\t}),\n\t\t\tshowShareButton: this.store?.getValue({\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t}),\n\t\t\tisTopRight: this.store?.getValue({ field: \"isTopRight\" }),\n\t\t\talwaysOnTopButton: this.store?.getValue({\n\t\t\t\tfield: \"AlwaysOnTop.show\",\n\t\t\t}),\n\t\t\tshowTabs: this.store?.getValue({ field: \"showTabs\" }),\n\t\t\thackScrollbar: this.store?.getValue({ field: \"hackScrollbar\" }),\n\t\t\tbumpElements: this.store?.getValue({ field: \"bumpElements\" }),\n\t\t\tadjustContentHeights: this.store?.getValue({ field: \"adjustContentHeights\" }),\n\t\t\ttabs: [activeIdentifier], // array of tabs for this window\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\t// Goal: If a user gets focus into the title bar (if they Alt+Tab or Cmd+Tab into the window),\n\t\t// we want to let get into the rest of the component using the keyboard alone. The UX for\n\t\t// this task will be to seemingly TAB from the title bar into the window, if possible.\n\t\t// Code: If the user presses the \"Tab\" key, move their focus to the browser view\n\t\twindow.addEventListener(\"keydown\", (e) => {\n\t\t\tif (e.key === \"Tab\") {\n\t\t\t\t// This magic moves focus to a browserView, if one exists\n\t\t\t\tfinsembleWindow.focus();\n\t\t\t}\n\t\t});\n\t\tlet header = document.getElementsByClassName(\"fsbl-header\")[0];\n\n\t\t//Add a margin top to the body if there title bar is injected into the component.\n\t\tif (header) {\n\t\t\tdocument.body.style.margin = \"0px\";\n\t\t\tdocument.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\t\t}\n\t\tthis.resizeDragHandle();\n\t\tthis.hackScrollbar();\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.resizeDragHandle();\n\t\tthis.hackScrollbar();\n\t\tthis.maybeAdjustWindow();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\n\t\tif (this.state.initialized) {\n\t\t\tthis.store?.removeListeners(\n\t\t\t\t[\n\t\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.showDockingTooltip\",\n\t\t\t\t\t\tlistener: this.onShowDockingToolTip,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.dockingEnabled\",\n\t\t\t\t\t\tlistener: this.onDockingEnabledChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\t\t\tlistener: this.onShareEmitterChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t],\n\t\t\t\t() => {},\n\t\t\t\t() => {}\n\t\t\t);\n\n\t\t\t// Cleanup all listeners\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.cancelTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.startTilingOrTabbing\", this.onTilingStart);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.stopTilingOrTabbing\", this.onTilingStop);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.cancelTilingOrTabbing\", this.onTilingStop);\n\t\t}\n\t}\n\n\tsetDOMBasedMovement(err: StandardError, response: any) {\n\t\tif (response && response.hasOwnProperty(\"value\")) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tuseDOMBasedMovement: response.value,\n\t\t\t\t\tdragHandleName: response.value ? \"fsbl-drag-handle\" : \"fsbl-drag-handle-native-movement\",\n\t\t\t\t},\n\t\t\t\tthis.resizeDragHandle\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * When we are not tiling/tabbing, we want to allow the user to drag the window around via any available space in the tab-region. This function allows that.\n\t */\n\tallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: true,\n\t\t});\n\t}\n\n\t/**\n\t * When we are tiling/tabbing, we do not want to allow any window to be dragged around and moved.\n\t */\n\tdisallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: false,\n\t\t});\n\t}\n\n\t/**\n\t * When tiling start, we want to find the dragHandler and hide it\n\t */\n\tonTilingStart() {\n\t\tdocument.querySelector(`.${this.state.dragHandleName}`)?.classList.add(\"hidden\");\n\t}\n\n\t/**\n\t * When tiling stops, we want to find the dragHandler and re-show it\n\t */\n\tonTilingStop() {\n\t\tdocument.querySelector(`.${this.state.dragHandleName}.hidden`)?.classList.remove(\"hidden\");\n\t}\n\n\t/**\n\t * Called whenever a tab is dropped on a non tab area.\n\t * It won't be called when dropped on a tab that handles handle the event.\n\t */\n\tonDropHandler() {\n\t\tFSBL.Clients.RouterClient.transmit(\"DockingService.cancelTilingOrTabbing\", {});\n\t}\n\n\t/**\n\t * Called when user double clicks on drag handle\n\t */\n\tonDoubleClick() {\n\t\t// Actions.clickMaximize checks the window state\n\t\t// and toggles between maximize and minimize.\n\t\tActions.clickMaximize();\n\t}\n\n\t_setOnMouseUpAndDownHandlers(element: HTMLDivElement) {\n\t\t// if do double click it will invoke MouseDown and MouseUp events which could break the window bounds. So wait a 100ms for moving or resizing the window.\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\t// prevent a second call if the button hasn't been unpressed\n\t\t\tif (this.isMousePressed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Indicate that the mouse has been pressed\n\t\t\tthis.isMousePressed = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (this.isMousePressed) {\n\t\t\t\t\tFSBL.Clients.WindowClient.startMovingWindow(event);\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t};\n\t\tconst handleMouseUp = () => {\n\t\t\t// prevent a call if the button hasn't been pressed\n\t\t\tif (!this.isMousePressed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.isMousePressed = false;\n\t\t\tFSBL.Clients.WindowClient.stopMovingWindow();\n\t\t};\n\n\t\telement.onmousedown = handleMouseDown;\n\t\telement.onmouseup = handleMouseUp;\n\t}\n\n\tmakeDragHandle(fsblHeader: Element, dragHandleCssClass: string): HTMLElement {\n\t\tlet dragHandle = document.createElement(\"div\");\n\t\tdragHandle.className = dragHandleCssClass;\n\t\tthis._setOnMouseUpAndDownHandlers(dragHandle);\n\n\t\tdragHandle.ondblclick = () => {\n\t\t\tthis.onDoubleClick();\n\t\t};\n\t\tfsblHeader.insertBefore(dragHandle, fsblHeader.firstChild);\n\t\twindow.addEventListener(\"resize\", () => {\n\t\t\tthis.resizeDragHandle();\n\t\t});\n\n\t\treturn dragHandle;\n\t}\n\n\tdragHandleBoundsForShowTabs(startingBounds: DOMRect): DOMRect {\n\t\t// If there is more than one tab, then the drag area is the padding-left of fsbl-header-right\n\t\t// See .fsbl-tabs-multiple in the css\n\t\tif (this.state.tabs.length > 1) {\n\t\t\tconst headerRight = document.querySelector(\".fsbl-header-right\");\n\t\t\tif (headerRight) {\n\t\t\t\tconst computedStyle = getComputedStyle(headerRight);\n\t\t\t\t// override the bounds.width with the paddingLeft amount\n\t\t\t\treturn {\n\t\t\t\t\t// The spread operator only uses own properties; simply\n\t\t\t\t\t// spreading \"headerRight.getBoundingClientRect()\" will result in an\n\t\t\t\t\t// empty object being spread. Clone the object to be sure all\n\t\t\t\t\t// values are spread\n\t\t\t\t\t...clone(headerRight.getBoundingClientRect()),\n\t\t\t\t\twidth: parseInt(computedStyle.paddingLeft, 10),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn startingBounds;\n\t\t\t}\n\t\t} else {\n\t\t\t// If tabs are not enabled, then the remained of fsbl-header-center beyond the tabs\n\t\t\t// is the draggable area. This assumes left aligned tabs.\n\t\t\tconst fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\tconst bounds = fsblHeaderCenter?.getBoundingClientRect() ?? startingBounds;\n\t\t\tconst tabRegionWrapperDiv = fsblHeaderCenter?.querySelector(\".tab-region-wrapper div.fsbl-header-title\");\n\t\t\tif (tabRegionWrapperDiv) {\n\t\t\t\tconst theTabBounds = tabRegionWrapperDiv.getBoundingClientRect();\n\t\t\t\t// Calculate the right portion\n\t\t\t\treturn {\n\t\t\t\t\t...clone(bounds),\n\t\t\t\t\tleft: bounds.left + theTabBounds.width,\n\t\t\t\t\twidth: bounds.width - theTabBounds.width,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn bounds;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * The dragger is an absolutely positioned element that is superimposed on the actual area that we'd like to drag.\n\t * This is necessary due to a bug in Chromium. Effectively, we need the dragger to change its left position and width\n\t * to match the intended drag area. These dimensions can change whenever the header is re-rendered (for instance when\n\t * changing mode from tabbing to non-tabbing). Dimensions can also change when the window itself is resized (due to natural\n\t * css).\n\t *\n\t * Can remove all of the cq-drag and cq-no-drag because Chromium bug is fixed\n\t * Remove fsbl-drag-region, it is no longer needed\n\t * Hide the dragHandle during drop operations, so that it doesn't interfere\n\t */\n\tresizeDragHandle() {\n\t\t// This function is invoked when a window is grouped or ungrouped (or docked); in all these cases, reset the mouse pressed state\n\t\t//\n\t\t// Reset the mouse pressed state\n\t\tthis.isMousePressed = false;\n\n\t\ttry {\n\t\t\tconst fsblHeader = document.querySelector(\".fsbl-header\");\n\t\t\t// If there isn't an FSBLHeader then there doesn't need to be a drag handle.\n\t\t\tif (!fsblHeader) return;\n\n\t\t\tconst dragHandleCssClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle\"\n\t\t\t\t: \"fsbl-drag-handle-native-movement\";\n\n\t\t\tconst dragHandleToRemoveClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle-native-movement\"\n\t\t\t\t: \"fsbl-drag-handle\";\n\n\t\t\t// Create the dragger if it doesn't already exist\n\t\t\tlet dragHandle =\n\t\t\t\t(document.querySelector(`.${dragHandleCssClass}`) as HTMLElement) ??\n\t\t\t\tthis.makeDragHandle(fsblHeader, dragHandleCssClass);\n\n\t\t\t// When the titlebar starts up, useDOMBasedMovement will have a default value that is not the same as the config value\n\t\t\t// When the value from the config propagates down to the UI, we need to make sure the old drag handle is removed in place of the new\n\t\t\tconst dragHandleToRemove = document.querySelector(`.${dragHandleToRemoveClass}`) as HTMLElement;\n\t\t\tif (dragHandleToRemove) dragHandleToRemove.parentNode?.removeChild(dragHandleToRemove);\n\n\t\t\t// Set the height of the dragHandle to match the height of the window title bar\n\t\t\t// Do this every time through the render loop just in case a customer builds a\n\t\t\t// header bar with dynamic height!\n\t\t\tlet bounds = fsblHeader.getBoundingClientRect();\n\n\t\t\tdragHandle.style.height = `${bounds.height - 5}px`; // Subtract 5 pixels from height in order to make room for resize window cursor at top edge of window\n\t\t\tdragHandle.style.marginTop = `${-bounds.height + 5}px`; // Negative margin pulls the drag handle up over the fixed header\n\n\t\t\t// Start logic for determining where to place our dragHandle\n\t\t\tif (this.state.showTabs) {\n\t\t\t\tbounds = this.dragHandleBoundsForShowTabs(bounds);\n\t\t\t} else {\n\t\t\t\t// If tabs are not enabled, then the entire center is the drag area\n\t\t\t\tlet fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\t\tif (fsblHeaderCenter) bounds = fsblHeaderCenter.getBoundingClientRect();\n\t\t\t}\n\n\t\t\tif (bounds) {\n\t\t\t\tdragHandle.style.left = `${bounds.left}px`;\n\t\t\t\tdragHandle.style.width = `${bounds.width}px`;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Whether the component's config allows for the linker.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tshowLinkerButton(err: StandardError, response: any) {\n\t\tthis.setState({ showLinkerButton: response.value });\n\t}\n\n\t/**\n\t * Whether the window is the top-right-most window in a group of windows. If so, it renders a minimize icon for the whole group.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tisTopRight(err: StandardError, response: any) {\n\t\tthis.setState({ isTopRight: response.value });\n\t}\n\n\t/**\n\t * @param {*} err\n\t * @param {*} response\n\t */\n\tonTitleChange(err: StandardError, response: any) {\n\t\tlet { tabs } = this.state;\n\t\tlet myIdentifier = FSBL.Clients.WindowClient.getWindowIdentifier();\n\n\t\ttabs = tabs.map((el) => {\n\t\t\tif (!el.windowName && el.name) el.windowName = el.name;\n\t\t\tif (!el.name && el.windowName) el.name = el.windowName;\n\t\t\treturn el;\n\t\t});\n\n\t\tconst myIndex = tabs.findIndex((el: TabProperties) => el.name === myIdentifier.windowName);\n\t\tif (myIndex === -1) return;\n\n\t\tlet myTab = tabs[myIndex] || {};\n\t\tmyTab.title = response.value;\n\t\ttabs.splice(myIndex, 1, myTab);\n\n\t\tthis.setState({\n\t\t\twindowTitle: response.value,\n\t\t\ttabs: tabs,\n\t\t});\n\t}\n\n\t/**\n\t * The next few methods are store change handlers that sync local state with the store's state.\n\t */\n\tonShowDockingToolTip(err: StandardError, response: any) {\n\t\tthis.setState({ showDockingTooltip: response.value });\n\t}\n\n\tonToggleDockingIcon(err: StandardError, response: any) {\n\t\tthis.setState({ dockingIcon: response.value });\n\t}\n\n\tonDockingEnabledChanged(err: StandardError, response: any) {\n\t\tthis.setState({ dockingEnabled: response.value });\n\t}\n\n\tonAlwaysOnTopChanged(err: StandardError, response: any) {\n\t\tthis.setState({ alwaysOnTopButton: response.value });\n\t}\n\n\tonStoreChanged(newState: WindowTitleBarShellState) {\n\t\tthis.setState(newState);\n\t}\n\n\tonShareEmitterChanged(err: StandardError, response: any) {\n\t\tthis.setState({ showShareButton: response.value });\n\t}\n\n\tonTabsChanged(err: StandardError, response: any) {\n\t\tthis.setState({\n\t\t\ttabs: response.value,\n\t\t});\n\t}\n\n\tonShowTabsChanged(err: StandardError, response: any) {\n\t\t// If we are not showing tabs, then it means that it is a non tabbed window\n\t\t// therefore we need to check whether we have a window title contained in\n\t\t// .div.fsbl-tab-editor so that we can edit it.\n\t\tif (!response.value) {\n\t\t\tlet tabEditor = document.querySelector(\"div.fsbl-tab-editor\") as HTMLDivElement;\n\t\t\tif (tabEditor) {\n\t\t\t\t// we set this z-index value to be slightly higher than the drag handle\n\t\t\t\t// to make the editor dragable AND double-clickcable\n\t\t\t\ttabEditor.style.zIndex = \"2147483647\";\n\t\t\t\t// We add the mousedown and mouseup functions to the tab editor\n\t\t\t\t// so that on a single mouse down it allows the user to drag the\n\t\t\t\t// window on both the .fsbl-drag-handle and the .fsbl-tab-editor\n\t\t\t\tthis._setOnMouseUpAndDownHandlers(tabEditor);\n\t\t\t}\n\t\t}\n\t\tthis.setState({\n\t\t\tshowTabs: response.value,\n\t\t});\n\t}\n\n\t// Hack the window's scrollbar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\t// This is turned on by default. Set \"Window Manager.hackScrollbar: false\" to turn it off\n\thackScrollbar() {\n\t\tif (this.state.hackScrollbar) {\n\t\t\tconst htmlElement = document.querySelector(\"html\");\n\t\t\tif (htmlElement) htmlElement.style.overflowY = \"hidden\";\n\t\t\tconst bodyElement = document.querySelector(\"body\");\n\t\t\tif (bodyElement) bodyElement.style.overflowY = \"auto\";\n\t\t}\n\t}\n\n\tbeginAdjustment() {\n\t\tconst header = document.getElementsByClassName(\"fsbl-header\")[0];\n\t\tif (header) {\n\t\t\tconst bodyElement = document.querySelector(\"body\");\n\t\t\tconst headerHeight = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\n\t\t\tif (bodyElement) {\n\t\t\t\tbodyElement.style.height = `calc(100vh - ${headerHeight})`;\n\t\t\t}\n\n\t\t\tif (this.state.adjustContentHeights) this.adjustTopLevelHeight(Number(headerHeight.split(\"px\")[0]));\n\n\t\t\tthis.bumpElements(this.state.bumpElements);\n\t\t\tif (this.state.bumpElements.monitorFixedAdditions) this.monitorFixedPositionedElements(headerHeight);\n\t\t} else {\n\t\t\tLogger.system.error(\"WindowTitleBarShell.maybeAdjustWindow:could not find the header.\");\n\t\t}\n\t}\n\n\t/**\n\t * Once document is ready and header is injected into DOM, begin adjusting the height of elements and bump fixed/absolute elements\n\t */\n\tasync maybeAdjustWindow() {\n\t\t// don't start pushing stuff down until page is ready. This is needed for preloaded titlebars because they can happen before the page is ready.\n\t\tif (document.readyState === \"complete\") {\n\t\t\tthis.beginAdjustment();\n\t\t} else {\n\t\t\tdocument.addEventListener(\"readystatechange\", () => {\n\t\t\t\tif (document.readyState === \"complete\") this.beginAdjustment();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Monitors the DOM for mutations, if the added node has a fixed position with a top style of 0px, it will be bumped by the title bar height.\n\t * @param headerHeight the height of the header\n\t */\n\tmonitorFixedPositionedElements(headerHeight: string) {\n\t\tconst options = {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t};\n\n\t\t/**\n\t\t * MutationObserver interface provides the ability to watch for\n\t\t * changes to the DOM tree using the observe method\n\t\t */\n\t\tconst mutationObserver = new MutationObserver((mutations) => {\n\t\t\tmutations.forEach((mutation) => {\n\t\t\t\tmutation.addedNodes.forEach((node: any) => {\n\t\t\t\t\tif (!node.className?.includes(\"bumped-element\")) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst nodeStyle = window.getComputedStyle(node);\n\t\t\t\t\t\t\tconst topStyle = nodeStyle.top;\n\n\t\t\t\t\t\t\t// make sure node is fixed, has top style set to 0, and has not been bumped\n\t\t\t\t\t\t\tif (nodeStyle.position === \"fixed\" && possibleZeros.includes(topStyle)) {\n\t\t\t\t\t\t\t\tnode.style.top = this.calculateBumpValue(\"0Positioned\", topStyle, headerHeight);\n\t\t\t\t\t\t\t\tnode.classList.add(\"bumped-element\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t// Expected to error if the node is not an Element e.g text is not of type Element\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// We observe the body and do not disconnect because there may be other elements that are dynamically loaded, such as a dialogue menu.\n\t\tmutationObserver.observe(document.body, options);\n\t}\n\n\t/**\n\t * Calls functions to bump fixed and/or absolute elements if configured to do so.\n\t * @param {object} config bumpElements object\n\t */\n\tbumpElements(config: BumpElements) {\n\t\tif (config?.bumpBy && config?.bumpBy !== \"0px\") {\n\t\t\tif (config.fixed) this.bumpFixedElements(config);\n\t\t\tif (config.absolute) this.bumpAbsoluteElements(config);\n\t\t}\n\t}\n\n\t/**\n\t * Set the max height of each element to be the height of the parent container\n\t * subtracted by the height of the previous element. This forces the element to either obey its\n\t * predefined height or stay within the bounds of the max height.\n\t * @param {object} elem HTML element\n\t * @param {number} prev height of previous sibling\n\t * @param maxHeight\n\t */\n\tprivate adjust(elem: HTMLElement, prev: number, maxHeight: string = \"100vh\") {\n\t\tif (\n\t\t\t!elem.classList?.contains(\"adjusted-element\") &&\n\t\t\t// workaround to fix dnd scrim disappearing\n\t\t\t!elem.classList?.contains(\"fsbl-share-scrim\")\n\t\t) {\n\t\t\tconst clientHeight = elem.clientHeight ? elem.clientHeight : 0;\n\t\t\tconst offsetHeight = elem.offsetHeight ? elem.offsetHeight : 0;\n\t\t\tconst offset = offsetHeight - clientHeight;\n\t\t\tconst adjustPrev = prev + offset;\n\n\t\t\telem.style.maxHeight = `calc(${maxHeight} - ${adjustPrev}px)`;\n\t\t\telem.classList.add(\"adjusted-element\");\n\t\t}\n\t}\n\n\t/**\n\t * Adjusts the top level content view height to be its height subtracted by the headerHeight and its\n\t * maxHeight to be 100vh subtracted by the total height of the previous elements.\n\t * The height of the previous elements are added to this calculation if they are not fixed or absolute.\n\t * @param {number} headerHeight the height of the header\n\t */\n\tprivate adjustTopLevelHeight(headerHeight: number) {\n\t\tconst elems: any = document.body.querySelectorAll(\":scope > *:not(#FSBLHeader, .fsbl-header)\");\n\t\tlet prev = headerHeight;\n\n\t\telems.forEach((elem: any) => {\n\t\t\tthis.adjust(elem, prev);\n\t\t\t// Heights of fixed and absolute positioned elements are not added to the total heights of previous elements\n\t\t\t// since they are removed from the document flow and can be positioned anywhere in the page.\n\t\t\tif (elem.style.position !== \"fixed\" && elem.style.position !== \"absolute\") prev = prev + elem.offsetHeight;\n\n\t\t\tthis.adjustContentHeight(elem);\n\t\t});\n\t}\n\n\t/**\n\t * Adjusts the content view height to be maximum the parent container height subtracted by the total height elements above it.\n\t * The height of the previous elements are added to this calculation if they are not fixed or absolute.\n\t * @param {object} headerNode window titlebar\n\t */\n\tprivate adjustContentHeight(headerNode: any) {\n\t\tconst elem: any = headerNode;\n\t\tconst maxHeight = `100%`;\n\n\t\tconst { children } = elem;\n\t\tconst len = children.length;\n\t\tlet prev = 0;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\t// Fixed and absolute positioned elements are ignored since they are removed from the document flow.\n\t\t\tif (children[i].style.position !== \"fixed\" && children[i].style.position !== \"absolute\") {\n\t\t\t\tthis.adjust(children[i], prev, maxHeight);\n\t\t\t\tprev = prev + children[i].offsetHeight;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calculates value to bump element by. If 'all' return top style and header height, if '0Positioned' return header height\n\t * @param type Whether all elements are being bumped by the header height and their top style or just header height\n\t * @param topStyle Element top value\n\t * @param bumpBy Value to bump element by\n\t * @returns Top style for element\n\t */\n\tprivate calculateBumpValue(type: string, topStyle: string, bumpBy: string) {\n\t\tlet topVal = topStyle;\n\t\tif (type == \"all\") {\n\t\t\ttopVal = `calc(${topStyle} + ${bumpBy})`;\n\t\t} else if (type == \"0Positioned\" && possibleZeros.includes(topStyle)) {\n\t\t\ttopVal = bumpBy;\n\t\t}\n\t\treturn topVal;\n\t}\n\n\t/**\n\t * Recursively traverse through the HTML document and return an array of the top level elements\n\t * and elements with static parents\n\t * @param {object} element The HTML element\n\t * @param {array} acc accumulator\n\t * @returns {array} array top level elements and elements with static parents\n\t *\n\t */\n\tprivate traverseHtml(element: any, acc: any[] = []) {\n\t\tconst elems: any = element.children;\n\t\tconst len = elems.length;\n\t\tif (!len) {\n\t\t\tacc.push(element);\n\t\t} else {\n\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\t\t\t\tif (style.getPropertyValue(\"position\") == \"static\") {\n\t\t\t\t\tacc = this.traverseHtml(elems[i], acc);\n\t\t\t\t} else {\n\t\t\t\t\tacc.push(elems[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t}\n\n\t/**\n\t * Bumps elements with fixed positioning down by the configured amount.\n\t * @private\n\t */\n\tprivate bumpFixedElements(params: any) {\n\t\tlet { fixed, bumpBy } = params;\n\n\t\tconst getFixedElements = (nodes: any) => {\n\t\t\tconst fixedElems: any[] = [];\n\t\t\tnodes.forEach((node: any) => {\n\t\t\t\tconst style = window.getComputedStyle(node, null);\n\t\t\t\tif (style.getPropertyValue(\"position\") == \"fixed\") fixedElems.push(node);\n\t\t\t\tconst elems = node.querySelectorAll(\"*\");\n\t\t\t\telems.forEach((elem: any) => {\n\t\t\t\t\tconst childStyle = window.getComputedStyle(elem, null);\n\t\t\t\t\tif (childStyle.getPropertyValue(\"position\") == \"fixed\") fixedElems.push(elem);\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn fixedElems;\n\t\t};\n\n\t\tconst selector = \"*:not(#FSBLHeader, .fsbl-header)\";\n\t\t// Get all fixed positioned elements\n\t\tconst elems: any = getFixedElements(document.body.querySelectorAll(`${selector}`));\n\t\tconst len = elems.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\n\t\t\tconst topStyle = style.getPropertyValue(\"top\");\n\t\t\tif (!elems[i].className?.includes(\"bumped-element\")) {\n\t\t\t\telems[i].style.top = this.calculateBumpValue(fixed, topStyle, bumpBy);\n\t\t\t\telems[i].classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bumps absolute positioned elements with static parents down by the configured amount.\n\t * @private\n\t */\n\tprivate bumpAbsoluteElements(params: any) {\n\t\tlet { absolute, bumpBy } = params;\n\n\t\tconst selector = \"*:not(#FSBLHeader, .fsbl-header)\";\n\t\t// Get top level absolute positioned elements and elements who have static parents\n\t\tconst elems: any = this.traverseHtml({ children: document.body.querySelectorAll(`:scope > ${selector}`) });\n\t\tconst len = elems.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\n\t\t\tconst topStyle = style.getPropertyValue(\"top\");\n\n\t\t\t// Target absolute positioned elements\n\t\t\tif (style.getPropertyValue(\"position\") == \"absolute\" && !elems[i].className?.includes(\"bumped-element\")) {\n\t\t\t\telems[i].style.top = this.calculateBumpValue(absolute, topStyle, bumpBy);\n\t\t\t\telems[i].classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tlet showDockingIcon = !this.state.dockingEnabled ? false : this.state.dockingIcon;\n\t\tlet isGrouped = this.state.dockingIcon == \"ejector\";\n\t\tlet showMinimizeIcon = (isGrouped && this.state.isTopRight) || !isGrouped; // If not in a group or if topright in a group\n\t\tlet tabRegionClasses = \"fsbl-tab-area\";\n\t\tlet headerClasses = \"fsbl-header\";\n\n\t\t// If we're showing tabs, we throw these classes on to modify styles.\n\t\tif (this.state.showTabs) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-enabled`;\n\t\t}\n\t\tif (this.state.tabs.length > 1) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-multiple`;\n\t\t}\n\t\tconst context = {\n\t\t\tshowLinkerButton: this.state.showLinkerButton,\n\t\t\tshowShareButton: this.state.showShareButton,\n\t\t\tshowTabRegion: this.state.showTabs,\n\t\t\tshowMinimizeButton: this.state.minButton && showMinimizeIcon,\n\t\t\tshowMaximizeButton: this.state.maxButton,\n\t\t\tonTabDropped: this.allowDragOnCenterRegion,\n\t\t\tshowDockingButton: showDockingIcon,\n\t\t\tshowCloseButton: this.state.closeButton,\n\t\t\tclassName: tabRegionClasses,\n\t\t\tthisWindowTitle: this.state.windowTitle,\n\t\t\tboundingBox: this.state.tabBarBoundingBox,\n\t\t\tlistenForDragOver: !this.state.allowDragOnCenterRegion,\n\t\t\ttabs: this.state.tabs,\n\t\t\tonTitleUpdated: this.resizeDragHandle,\n\t\t\tshowAlwaysOnTopButton: this.state.alwaysOnTopButton && showMinimizeIcon,\n\t\t\tshowTabs: this.state.showTabs,\n\t\t\talwaysOnTop: this.state.alwaysOnTop,\n\t\t\tuseDOMBasedMovement: this.state.useDOMBasedMovement,\n\t\t};\n\n\t\treturn (\n\t\t\t<div className={headerClasses} onDrop={this.onDropHandler.bind(this)}>\n\t\t\t\t{this.state.initialized && (\n\t\t\t\t\t<WindowTitleBarContext.Provider value={context}>{this.props.children}</WindowTitleBarContext.Provider>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"WindowTitleBarShell.js","sourceRoot":"","sources":["../../../src/components/windowTitleBar/WindowTitleBarShell.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,qCAAqC,CAAC;AAI7C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,2BAA2B;AAC3B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAsCtC,MAAM,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAA6D;IAM3G,YAAY,KAA+B;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;QAJd,+CAA+C;QAC/C,mBAAc,GAAG,KAAK,CAAC;QAItB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QAEvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG;YACZ,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAmB;YAC3E,uBAAuB,EA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QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACnC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB;SACnD,CAAC;QAEF,OAAO,CACN,6BAAK,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAClE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAC1B,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAkC,CACtG,CACI,CACN,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport * as React from \"react\";\nimport { WindowTitleBarContext } from \"./windowTitleBarContext\";\nimport { storeManager, Actions, getStore } from \"./stores/windowTitleBarStore\";\nimport \"../../assets/css/windowTitleBar.css\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { TabProperties } from \"../../types/windowTitleBar\";\nimport { clone } from \"../sdd/Appearance.helpers\";\nimport { Logger } from \"@finsemble/finsemble-api\";\n\n// Values for possible zero\nconst possibleZeros = [\"0\", \"0px\", 0];\n\ntype BumpElements = {\n\tbumpBy: string;\n\tfixed: string;\n\tabsolute: string;\n\tmonitorFixedAdditions: boolean;\n};\n\ninterface WindowTitleBarShellProps {}\n\ninterface WindowTitleBarShellState {\n\ttabs: TabProperties[];\n\tactiveTab: TabProperties;\n\twindowTitle: string;\n\tinitialized: boolean;\n\talwaysOnTop: boolean;\n\tshowTabs: boolean;\n\tminButton: boolean;\n\tmaxButton: boolean;\n\tcloseButton: boolean;\n\tshowShareButton: boolean;\n\tshowLinkerButton: boolean;\n\tisTopRight: boolean;\n\tdockingEnabled: boolean;\n\talwaysOnTopButton: boolean;\n\tallowDragOnCenterRegion: boolean;\n\tdockingIcon: string;\n\thackScrollbar: boolean;\n\tshowDockingTooltip: boolean;\n\tshowTabRegion: boolean;\n\ttabBarBoundingBox: any;\n\tuseDOMBasedMovement: boolean;\n\tdragHandleName: string;\n\tbumpElements: BumpElements;\n\tadjustContentHeights: boolean;\n}\n\nexport class WindowTitleBarShell extends React.Component<WindowTitleBarShellProps, WindowTitleBarShellState> {\n\tstore?: StoreModel;\n\n\t// Keep track of if the mouse button is pressed\n\tisMousePressed = false;\n\n\tconstructor(props: WindowTitleBarShellProps) {\n\t\tsuper(props);\n\t\tthis.store = undefined;\n\n\t\tthis.bindCorrectContext();\n\t\tthis.state = {\n\t\t\tactiveTab: FSBL.Clients.WindowClient.getWindowIdentifier() as TabProperties,\n\t\t\tallowDragOnCenterRegion: true,\n\t\t\talwaysOnTop: false,\n\t\t\talwaysOnTopButton: false,\n\t\t\tcloseButton: false,\n\t\t\tdockingEnabled: false,\n\t\t\tdockingIcon: \"\",\n\t\t\thackScrollbar: false,\n\t\t\tinitialized: false,\n\t\t\tisTopRight: false,\n\t\t\tmaxButton: false,\n\t\t\tminButton: false,\n\t\t\tshowDockingTooltip: false,\n\t\t\tshowLinkerButton: false,\n\t\t\tshowShareButton: false,\n\t\t\tshowTabs: false,\n\t\t\tshowTabRegion: false,\n\t\t\ttabs: [],\n\t\t\ttabBarBoundingBox: {},\n\t\t\twindowTitle: \"\",\n\t\t\tuseDOMBasedMovement: true,\n\t\t\tdragHandleName: \"fsbl-drag-handle\",\n\t\t\tbumpElements: {} as BumpElements,\n\t\t\tadjustContentHeights: true,\n\t\t};\n\n\t\tfinsembleWindow.isAlwaysOnTop({}, (err, alwaysOnTop: boolean) => {\n\t\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t\t});\n\n\t\tfinsembleWindow.addEventListener(\"alwaysOnTop\", this.alwaysOnTopListener);\n\t}\n\n\talwaysOnTopListener({ data: { alwaysOnTop } }: any) {\n\t\tthis.setState({ ...this.state, alwaysOnTop });\n\t}\n\n\t/**\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\n\t *\n\t * @memberof WindowTitleBar\n\t */\n\tbindCorrectContext() {\n\t\tthis.onTitleChange = this.onTitleChange.bind(this);\n\t\tthis.onShowDockingToolTip = this.onShowDockingToolTip.bind(this);\n\t\tthis.onToggleDockingIcon = this.onToggleDockingIcon.bind(this);\n\t\tthis.onDockingEnabledChanged = this.onDockingEnabledChanged.bind(this);\n\t\tthis.onAlwaysOnTopChanged = this.onAlwaysOnTopChanged.bind(this);\n\t\tthis.showLinkerButton = this.showLinkerButton.bind(this);\n\t\tthis.isTopRight = this.isTopRight.bind(this);\n\t\tthis.allowDragOnCenterRegion = this.allowDragOnCenterRegion.bind(this);\n\t\tthis.disallowDragOnCenterRegion = this.disallowDragOnCenterRegion.bind(this);\n\t\tthis.setDOMBasedMovement = this.setDOMBasedMovement.bind(this);\n\t\tthis.onShareEmitterChanged = this.onShareEmitterChanged.bind(this);\n\t\tthis.onTabsChanged = this.onTabsChanged.bind(this);\n\t\tthis.onShowTabsChanged = this.onShowTabsChanged.bind(this);\n\t\tthis.onTilingStop = this.onTilingStop.bind(this);\n\t\tthis.onTilingStart = this.onTilingStart.bind(this);\n\t\tthis.resizeDragHandle = this.resizeDragHandle.bind(this);\n\t\tthis.onDoubleClick = this.onDoubleClick.bind(this);\n\t\tthis.alwaysOnTopListener = this.alwaysOnTopListener.bind(this);\n\t\tthis.onInitialized = this.onInitialized.bind(this);\n\t}\n\n\tonInitialized() {\n\t\tthis.store = getStore();\n\t\tthis.store.addListeners(\n\t\t\t[\n\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t{ field: \"Main.showDockingTooltip\", listener: this.onShowDockingToolTip },\n\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t{ field: \"Main.dockingEnabled\", listener: this.onDockingEnabledChanged },\n\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t{ field: \"Sharer.emitterEnabled\", listener: this.onShareEmitterChanged },\n\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"hackScrollbar\", listener: this.onShowTabsChanged },\n\t\t\t\t{ field: \"Main.useDOMBasedMovement\", listener: this.setDOMBasedMovement },\n\t\t\t],\n\t\t\t() => {}\n\t\t);\n\n\t\t// Add listeners for tiling/tabbing\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.onTilingStart);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.onTilingStop);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.onTilingStop);\n\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\tFSBL.Clients.RouterClient.addListener(\"DockingService.cancelTilingOrTabbing\", this.allowDragOnCenterRegion);\n\n\t\tthis.onStoreChange();\n\t\tthis.setState({\n\t\t\tinitialized: true,\n\t\t});\n\t}\n\n\tonStoreChange() {\n\t\tlet activeIdentifier = finsembleWindow.identifier as TabProperties;\n\t\tactiveIdentifier.title = this.store?.getValue({\n\t\t\tfield: \"Main.windowTitle\",\n\t\t});\n\n\t\tthis.setState({\n\t\t\twindowTitle: this.store?.getValue({ field: \"Main.windowTitle\" }),\n\t\t\tminButton: !this.store?.getValue({ field: \"Minimize.hide\" }),\n\t\t\tmaxButton: !this.store?.getValue({ field: \"Maximize.hide\" }),\n\t\t\tcloseButton: !this.store?.getValue({ field: \"Close.hide\" }),\n\t\t\tshowLinkerButton: this.store?.getValue({\n\t\t\t\tfield: \"Linker.showLinkerButton\",\n\t\t\t}),\n\t\t\tshowShareButton: this.store?.getValue({\n\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t}),\n\t\t\tisTopRight: this.store?.getValue({ field: \"isTopRight\" }),\n\t\t\talwaysOnTopButton: this.store?.getValue({\n\t\t\t\tfield: \"AlwaysOnTop.show\",\n\t\t\t}),\n\t\t\tshowTabs: this.store?.getValue({ field: \"showTabs\" }),\n\t\t\thackScrollbar: this.store?.getValue({ field: \"hackScrollbar\" }),\n\t\t\tbumpElements: this.store?.getValue({ field: \"bumpElements\" }),\n\t\t\tadjustContentHeights: this.store?.getValue({ field: \"adjustContentHeights\" }),\n\t\t\ttabs: [activeIdentifier], // array of tabs for this window\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\t// Goal: If a user gets focus into the title bar (if they Alt+Tab or Cmd+Tab into the window),\n\t\t// we want to let get into the rest of the component using the keyboard alone. The UX for\n\t\t// this task will be to seemingly TAB from the title bar into the window, if possible.\n\t\t// Code: If the user presses the \"Tab\" key, move their focus to the browser view\n\t\twindow.addEventListener(\"keydown\", (e) => {\n\t\t\tif (e.key === \"Tab\") {\n\t\t\t\t// This magic moves focus to a browserView, if one exists\n\t\t\t\tfinsembleWindow.focus();\n\t\t\t}\n\t\t});\n\t\tlet header = document.getElementsByClassName(\"fsbl-header\")[0];\n\n\t\t//Add a margin top to the body if there title bar is injected into the component.\n\t\tif (header) {\n\t\t\tdocument.body.style.margin = \"0px\";\n\t\t\tdocument.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\t\t}\n\t\tthis.resizeDragHandle();\n\t\tthis.hackScrollbar();\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.resizeDragHandle();\n\t\t// Sometimes handleMouseUp is not invoked; specifically this can happen if the mouse is not over the drag handle when the button is\n\t\t// unpressed. This happens when the drag starts near the bottom of the drag handle and the mouse is moved UP. If the window is\n\t\t// docked to a window ABOVE then it may snap a few pixels up, making the mouse no longer on top of the drag handle. At this point, the\n\t\t// componentDidUpdate is executed and the onmouseup handler is not invoked. Setting this.isMousePressed handles that narrow case.\n\t\tthis.isMousePressed = false;\n\t\tthis.hackScrollbar();\n\t\tthis.maybeAdjustWindow();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\n\t\tif (this.state.initialized) {\n\t\t\tthis.store?.removeListeners(\n\t\t\t\t[\n\t\t\t\t\t{ field: \"Main.windowTitle\", listener: this.onTitleChange },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.showDockingTooltip\",\n\t\t\t\t\t\tlistener: this.onShowDockingToolTip,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"Main.dockingIcon\", listener: this.onToggleDockingIcon },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Main.dockingEnabled\",\n\t\t\t\t\t\tlistener: this.onDockingEnabledChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"AlwaysOnTop.show\", listener: this.onAlwaysOnTopChanged },\n\t\t\t\t\t{ field: \"Linker.showLinkerButton\", listener: this.showLinkerButton },\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"Sharer.emitterEnabled\",\n\t\t\t\t\t\tlistener: this.onShareEmitterChanged,\n\t\t\t\t\t},\n\t\t\t\t\t{ field: \"isTopRight\", listener: this.isTopRight },\n\t\t\t\t\t{ field: \"tabs\", listener: this.onTabsChanged },\n\t\t\t\t\t{ field: \"showTabs\", listener: this.onShowTabsChanged },\n\t\t\t\t],\n\t\t\t\t() => {},\n\t\t\t\t() => {}\n\t\t\t);\n\n\t\t\t// Cleanup all listeners\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.startTilingOrTabbing\", this.disallowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.stopTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.cancelTilingOrTabbing\", this.allowDragOnCenterRegion);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.startTilingOrTabbing\", this.onTilingStart);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.stopTilingOrTabbing\", this.onTilingStop);\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"DockingService.cancelTilingOrTabbing\", this.onTilingStop);\n\t\t}\n\t}\n\n\tsetDOMBasedMovement(err: StandardError, response: any) {\n\t\tif (response && response.hasOwnProperty(\"value\")) {\n\t\t\tthis.setState(\n\t\t\t\t{\n\t\t\t\t\tuseDOMBasedMovement: response.value,\n\t\t\t\t\tdragHandleName: response.value ? \"fsbl-drag-handle\" : \"fsbl-drag-handle-native-movement\",\n\t\t\t\t},\n\t\t\t\tthis.resizeDragHandle\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * When we are not tiling/tabbing, we want to allow the user to drag the window around via any available space in the tab-region. This function allows that.\n\t */\n\tallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: true,\n\t\t});\n\t}\n\n\t/**\n\t * When we are tiling/tabbing, we do not want to allow any window to be dragged around and moved.\n\t */\n\tdisallowDragOnCenterRegion() {\n\t\tthis.setState({\n\t\t\tallowDragOnCenterRegion: false,\n\t\t});\n\t}\n\n\t/**\n\t * When tiling start, we want to find the dragHandler and hide it\n\t */\n\tonTilingStart() {\n\t\tdocument.querySelector(`.${this.state.dragHandleName}`)?.classList.add(\"hidden\");\n\t}\n\n\t/**\n\t * When tiling stops, we want to find the dragHandler and re-show it\n\t */\n\tonTilingStop() {\n\t\tdocument.querySelector(`.${this.state.dragHandleName}.hidden`)?.classList.remove(\"hidden\");\n\t}\n\n\t/**\n\t * Called whenever a tab is dropped on a non tab area.\n\t * It won't be called when dropped on a tab that handles handle the event.\n\t */\n\tonDropHandler() {\n\t\tFSBL.Clients.RouterClient.transmit(\"DockingService.cancelTilingOrTabbing\", {});\n\t}\n\n\t/**\n\t * Called when user double clicks on drag handle\n\t */\n\tonDoubleClick() {\n\t\t// Actions.clickMaximize checks the window state\n\t\t// and toggles between maximize and minimize.\n\t\tActions.clickMaximize();\n\t}\n\n\t_setOnMouseUpAndDownHandlers(element: HTMLDivElement) {\n\t\t// Sometimes the mouse cursor can leave the drag handle when the window is moved quickly\n\t\t// In this case, the drag will succeed but handleMouseUp() is not invoked; as a consequence,\n\t\t// this.isMousePressed is not reset and FSBL.Clients.WindowClient.stopMovingWindow() is not called.\n\t\t//\n\t\t// To work around this, a new variable is introduced in order to keep track of if the mouse cursor\n\t\t// has left the drag handle. If handleMouseDown is invoked AND mouseHasLeft has been set to true, then\n\t\t// any click (handleMouseDown) will reset mouseHasLeft and this.isMousePressed (the drag state)\n\t\tlet mouseHasLeft = false;\n\n\t\t/**\n\t\t * Keeps track of when the mouse cursor leaves the drag handle.\n\t\t */\n\t\tconst handleMouseLeave = () => {\n\t\t\tmouseHasLeft = true;\n\t\t};\n\n\t\t// if do double click it will invoke MouseDown and MouseUp events which could break the window bounds. So wait a 100ms for moving or resizing the window.\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\t// If the mouse has left the drag handle then reset drag state on click\n\t\t\tif (mouseHasLeft) {\n\t\t\t\tmouseHasLeft = false;\n\t\t\t\tthis.isMousePressed = false;\n\t\t\t\tFSBL.Clients.WindowClient.stopMovingWindow();\n\t\t\t}\n\n\t\t\t// prevent a second call if the button hasn't been unpressed\n\t\t\tif (this.isMousePressed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Indicate that the mouse has been pressed\n\t\t\tthis.isMousePressed = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (this.isMousePressed) {\n\t\t\t\t\tFSBL.Clients.WindowClient.startMovingWindow(event);\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t};\n\t\tconst handleMouseUp = () => {\n\t\t\t// prevent a call if the button hasn't been pressed\n\t\t\tif (!this.isMousePressed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.isMousePressed = false;\n\t\t\tFSBL.Clients.WindowClient.stopMovingWindow();\n\t\t};\n\n\t\telement.onmouseleave = handleMouseLeave;\n\t\telement.onmousedown = handleMouseDown;\n\t\telement.onmouseup = handleMouseUp;\n\t}\n\n\tmakeDragHandle(fsblHeader: Element, dragHandleCssClass: string): HTMLElement {\n\t\tlet dragHandle = document.createElement(\"div\");\n\t\tdragHandle.className = dragHandleCssClass;\n\t\tthis._setOnMouseUpAndDownHandlers(dragHandle);\n\n\t\tdragHandle.ondblclick = () => {\n\t\t\tthis.onDoubleClick();\n\t\t};\n\t\tfsblHeader.insertBefore(dragHandle, fsblHeader.firstChild);\n\t\twindow.addEventListener(\"resize\", () => {\n\t\t\tthis.resizeDragHandle();\n\t\t});\n\n\t\treturn dragHandle;\n\t}\n\n\tdragHandleBoundsForShowTabs(startingBounds: DOMRect): DOMRect {\n\t\tif (this.state.tabs.length > 1) {\n\t\t\t// The drag handle is the space between the right-most tab and the left-most window button (minimize, maximize, close, etc)\n\t\t\t//\n\t\t\t// The bounds will largely be the same as \".fsbl-header-right\"\n\t\t\tconst headerRight = document.querySelector(\".fsbl-header-right\");\n\n\t\t\tif (headerRight) {\n\t\t\t\t// The padding (in pixels) for the left and right of the drag handle\n\t\t\t\tconst padding = 2;\n\n\t\t\t\t// Get the RIGHT-MOST x-coordinate for the drag handle\n\t\t\t\t//\n\t\t\t\t// The \"x\" coordinate of the LEFT-MOST element in the \"fsbl-header-right\" container; but\n\t\t\t\t// if there are no elements in the container then use the \"innerWidth\" of the window because that\n\t\t\t\t// value is the furthest RIGHT x-coordinate available to use\n\t\t\t\tconst leftMostRightHeaderElement = document.querySelector(\n\t\t\t\t\t\".fsbl-tabs-multiple .fsbl-header-right div:first-child\"\n\t\t\t\t);\n\t\t\t\tconst rightXCoord = leftMostRightHeaderElement\n\t\t\t\t\t? leftMostRightHeaderElement.getBoundingClientRect().x\n\t\t\t\t\t: window.innerWidth;\n\n\t\t\t\t// Get the LEFT-MOST x-coordinate for the drag handle\n\t\t\t\t//\n\t\t\t\t// Get the \"x\" coordinate for the RIGHT-MOST tab; the \"right\" attribute will be the\n\t\t\t\t// LEFT x-coordinate for the drag handle\n\t\t\t\tconst rightTab = document.querySelector(\".tab-region-wrapper .fsbl-tab:last-child\");\n\t\t\t\t// The \"left\" bounds is to the RIGHT of the RIGHT-MOST tab, plus padding\n\t\t\t\tconst leftXCoord = Math.trunc(rightTab?.getBoundingClientRect().right || 0) + padding;\n\n\t\t\t\t// The \"width\" bounds attribute is the difference between leftXCoord and rightXCoord, minus padding\n\t\t\t\tconst width = rightXCoord - leftXCoord - padding;\n\n\t\t\t\t// Override bounds.width and bounds.left with the calculated values\n\t\t\t\treturn {\n\t\t\t\t\t// The spread operator only uses own properties; simply\n\t\t\t\t\t// spreading \"headerRight.getBoundingClientRect()\" will result in an\n\t\t\t\t\t// empty object being spread. Clone the object to be sure all\n\t\t\t\t\t// values are spread\n\t\t\t\t\t...clone(headerRight.getBoundingClientRect()),\n\t\t\t\t\twidth: width,\n\t\t\t\t\tleft: leftXCoord,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn startingBounds;\n\t\t\t}\n\t\t} else {\n\t\t\t// If tabs are not enabled, then the remained of fsbl-header-center beyond the tabs\n\t\t\t// is the draggable area. This assumes left aligned tabs.\n\t\t\tconst fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\tconst bounds = fsblHeaderCenter?.getBoundingClientRect() ?? startingBounds;\n\t\t\tconst tabRegionWrapperDiv = fsblHeaderCenter?.querySelector(\".tab-region-wrapper div.fsbl-header-title\");\n\t\t\tif (tabRegionWrapperDiv) {\n\t\t\t\tconst theTabBounds = tabRegionWrapperDiv.getBoundingClientRect();\n\t\t\t\t// Calculate the right portion\n\t\t\t\treturn {\n\t\t\t\t\t...clone(bounds),\n\t\t\t\t\tleft: bounds.left + theTabBounds.width,\n\t\t\t\t\twidth: bounds.width - theTabBounds.width,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn bounds;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * The dragger is an absolutely positioned element that is superimposed on the actual area that we'd like to drag.\n\t * This is necessary due to a bug in Chromium. Effectively, we need the dragger to change its left position and width\n\t * to match the intended drag area. These dimensions can change whenever the header is re-rendered (for instance when\n\t * changing mode from tabbing to non-tabbing). Dimensions can also change when the window itself is resized (due to natural\n\t * css).\n\t *\n\t * Can remove all of the cq-drag and cq-no-drag because Chromium bug is fixed\n\t * Remove fsbl-drag-region, it is no longer needed\n\t * Hide the dragHandle during drop operations, so that it doesn't interfere\n\t */\n\tresizeDragHandle() {\n\t\t// Sometimes this function is called during a drag (determined by this.isMousePressed); in this case,\n\t\t// the function should abort.\n\t\t//\n\t\t// This happens if the cursor starts dragging near the left end of the drag handle. When the mouse is moved left, the cursor\n\t\t// moves left (over the right-most) tab for a few moments, triggering an invocation of this function. This is incorrect\n\t\t// behavior and should be avoided\n\t\tif (this.isMousePressed) {\n\t\t\treturn;\n\t\t}\n\t\t// This function is invoked when a window is grouped or ungrouped (or docked); in all these cases, reset the mouse pressed state\n\t\t//\n\t\t// Reset the mouse pressed state\n\t\tthis.isMousePressed = false;\n\n\t\ttry {\n\t\t\tconst fsblHeader = document.querySelector(\".fsbl-header\");\n\t\t\t// If there isn't an FSBLHeader then there doesn't need to be a drag handle.\n\t\t\tif (!fsblHeader) return;\n\n\t\t\tconst dragHandleCssClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle\"\n\t\t\t\t: \"fsbl-drag-handle-native-movement\";\n\n\t\t\tconst dragHandleToRemoveClass = this.state.useDOMBasedMovement\n\t\t\t\t? \"fsbl-drag-handle-native-movement\"\n\t\t\t\t: \"fsbl-drag-handle\";\n\n\t\t\t// Create the dragger if it doesn't already exist\n\t\t\tlet dragHandle =\n\t\t\t\t(document.querySelector(`.${dragHandleCssClass}`) as HTMLElement) ??\n\t\t\t\tthis.makeDragHandle(fsblHeader, dragHandleCssClass);\n\n\t\t\t// When the titlebar starts up, useDOMBasedMovement will have a default value that is not the same as the config value\n\t\t\t// When the value from the config propagates down to the UI, we need to make sure the old drag handle is removed in place of the new\n\t\t\tconst dragHandleToRemove = document.querySelector(`.${dragHandleToRemoveClass}`) as HTMLElement;\n\t\t\tif (dragHandleToRemove) dragHandleToRemove.parentNode?.removeChild(dragHandleToRemove);\n\n\t\t\t// Set the height of the dragHandle to match the height of the window title bar\n\t\t\t// Do this every time through the render loop just in case a customer builds a\n\t\t\t// header bar with dynamic height!\n\t\t\tlet bounds = fsblHeader.getBoundingClientRect();\n\n\t\t\tdragHandle.style.height = `${bounds.height - 5}px`; // Subtract 5 pixels from height in order to make room for resize window cursor at top edge of window\n\t\t\tdragHandle.style.marginTop = `${-bounds.height + 5}px`; // Negative margin pulls the drag handle up over the fixed header\n\n\t\t\t// Start logic for determining where to place our dragHandle\n\t\t\tif (this.state.showTabs) {\n\t\t\t\tbounds = this.dragHandleBoundsForShowTabs(bounds);\n\t\t\t} else {\n\t\t\t\t// If tabs are not enabled, then the entire center is the drag area\n\t\t\t\tlet fsblHeaderCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\t\tif (fsblHeaderCenter) bounds = fsblHeaderCenter.getBoundingClientRect();\n\t\t\t}\n\n\t\t\tif (bounds) {\n\t\t\t\tdragHandle.style.left = `${bounds.left}px`;\n\t\t\t\tdragHandle.style.width = `${bounds.width}px`;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * Whether the component's config allows for the linker.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tshowLinkerButton(err: StandardError, response: any) {\n\t\tthis.setState({ showLinkerButton: response.value });\n\t}\n\n\t/**\n\t * Whether the window is the top-right-most window in a group of windows. If so, it renders a minimize icon for the whole group.\n\t * @param {} err\n\t * @param {*} response\n\t */\n\tisTopRight(err: StandardError, response: any) {\n\t\tthis.setState({ isTopRight: response.value });\n\t}\n\n\t/**\n\t * @param {*} err\n\t * @param {*} response\n\t */\n\tonTitleChange(err: StandardError, response: any) {\n\t\tlet { tabs } = this.state;\n\t\tlet myIdentifier = FSBL.Clients.WindowClient.getWindowIdentifier();\n\n\t\ttabs = tabs.map((el) => {\n\t\t\tif (!el.windowName && el.name) el.windowName = el.name;\n\t\t\tif (!el.name && el.windowName) el.name = el.windowName;\n\t\t\treturn el;\n\t\t});\n\n\t\tconst myIndex = tabs.findIndex((el: TabProperties) => el.name === myIdentifier.windowName);\n\t\tif (myIndex === -1) return;\n\n\t\tlet myTab = tabs[myIndex] || {};\n\t\tmyTab.title = response.value;\n\t\ttabs.splice(myIndex, 1, myTab);\n\n\t\tthis.setState({\n\t\t\twindowTitle: response.value,\n\t\t\ttabs: tabs,\n\t\t});\n\t}\n\n\t/**\n\t * The next few methods are store change handlers that sync local state with the store's state.\n\t */\n\tonShowDockingToolTip(err: StandardError, response: any) {\n\t\tthis.setState({ showDockingTooltip: response.value });\n\t}\n\n\tonToggleDockingIcon(err: StandardError, response: any) {\n\t\tthis.setState({ dockingIcon: response.value });\n\t}\n\n\tonDockingEnabledChanged(err: StandardError, response: any) {\n\t\tthis.setState({ dockingEnabled: response.value });\n\t}\n\n\tonAlwaysOnTopChanged(err: StandardError, response: any) {\n\t\tthis.setState({ alwaysOnTopButton: response.value });\n\t}\n\n\tonStoreChanged(newState: WindowTitleBarShellState) {\n\t\tthis.setState(newState);\n\t}\n\n\tonShareEmitterChanged(err: StandardError, response: any) {\n\t\tthis.setState({ showShareButton: response.value });\n\t}\n\n\tonTabsChanged(err: StandardError, response: any) {\n\t\tthis.setState({\n\t\t\ttabs: response.value,\n\t\t});\n\t}\n\n\tonShowTabsChanged(err: StandardError, response: any) {\n\t\t// If we are not showing tabs, then it means that it is a non tabbed window\n\t\t// therefore we need to check whether we have a window title contained in\n\t\t// .div.fsbl-tab-editor so that we can edit it.\n\t\tif (!response.value) {\n\t\t\tlet tabEditor = document.querySelector(\"div.fsbl-tab-editor\") as HTMLDivElement;\n\t\t\tif (tabEditor) {\n\t\t\t\t// we set this z-index value to be slightly higher than the drag handle\n\t\t\t\t// to make the editor dragable AND double-clickcable\n\t\t\t\ttabEditor.style.zIndex = \"2147483647\";\n\t\t\t\t// We add the mousedown and mouseup functions to the tab editor\n\t\t\t\t// so that on a single mouse down it allows the user to drag the\n\t\t\t\t// window on both the .fsbl-drag-handle and the .fsbl-tab-editor\n\t\t\t\tthis._setOnMouseUpAndDownHandlers(tabEditor);\n\t\t\t}\n\t\t}\n\t\tthis.setState({\n\t\t\tshowTabs: response.value,\n\t\t});\n\t}\n\n\t// Hack the window's scrollbar so that it displays underneath the header. html.overflow: hidden body.overflow:auto\n\t// This is turned on by default. Set \"Window Manager.hackScrollbar: false\" to turn it off\n\thackScrollbar() {\n\t\tif (this.state.hackScrollbar) {\n\t\t\tconst htmlElement = document.querySelector(\"html\");\n\t\t\tif (htmlElement) htmlElement.style.overflowY = \"hidden\";\n\t\t\tconst bodyElement = document.querySelector(\"body\");\n\t\t\tif (bodyElement) bodyElement.style.overflowY = \"auto\";\n\t\t}\n\t}\n\n\tbeginAdjustment() {\n\t\tconst header = document.getElementsByClassName(\"fsbl-header\")[0];\n\t\tif (header) {\n\t\t\tconst bodyElement = document.querySelector(\"body\");\n\t\t\tconst headerHeight = window.getComputedStyle(header, null).getPropertyValue(\"height\");\n\n\t\t\tif (bodyElement) {\n\t\t\t\tbodyElement.style.height = `calc(100vh - ${headerHeight})`;\n\t\t\t}\n\n\t\t\tif (this.state.adjustContentHeights) this.adjustTopLevelHeight(Number(headerHeight.split(\"px\")[0]));\n\n\t\t\tthis.bumpElements(this.state.bumpElements);\n\t\t\tif (this.state.bumpElements.monitorFixedAdditions) this.monitorFixedPositionedElements(headerHeight);\n\t\t} else {\n\t\t\tLogger.system.error(\"WindowTitleBarShell.maybeAdjustWindow:could not find the header.\");\n\t\t}\n\t}\n\n\t/**\n\t * Once document is ready and header is injected into DOM, begin adjusting the height of elements and bump fixed/absolute elements\n\t */\n\tasync maybeAdjustWindow() {\n\t\t// don't start pushing stuff down until page is ready. This is needed for preloaded titlebars because they can happen before the page is ready.\n\t\tif (document.readyState === \"complete\") {\n\t\t\tthis.beginAdjustment();\n\t\t} else {\n\t\t\tdocument.addEventListener(\"readystatechange\", () => {\n\t\t\t\tif (document.readyState === \"complete\") this.beginAdjustment();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Monitors the DOM for mutations, if the added node has a fixed position with a top style of 0px, it will be bumped by the title bar height.\n\t * @param headerHeight the height of the header\n\t */\n\tmonitorFixedPositionedElements(headerHeight: string) {\n\t\tconst options = {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t};\n\n\t\t/**\n\t\t * MutationObserver interface provides the ability to watch for\n\t\t * changes to the DOM tree using the observe method\n\t\t */\n\t\tconst mutationObserver = new MutationObserver((mutations) => {\n\t\t\tmutations.forEach((mutation) => {\n\t\t\t\tmutation.addedNodes.forEach((node: any) => {\n\t\t\t\t\tif (!node.className?.includes(\"bumped-element\")) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst nodeStyle = window.getComputedStyle(node);\n\t\t\t\t\t\t\tconst topStyle = nodeStyle.top;\n\n\t\t\t\t\t\t\t// make sure node is fixed, has top style set to 0, and has not been bumped\n\t\t\t\t\t\t\tif (nodeStyle.position === \"fixed\" && possibleZeros.includes(topStyle)) {\n\t\t\t\t\t\t\t\tnode.style.top = this.calculateBumpValue(\"0Positioned\", topStyle, headerHeight);\n\t\t\t\t\t\t\t\tnode.classList.add(\"bumped-element\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t// Expected to error if the node is not an Element e.g text is not of type Element\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// We observe the body and do not disconnect because there may be other elements that are dynamically loaded, such as a dialogue menu.\n\t\tmutationObserver.observe(document.body, options);\n\t}\n\n\t/**\n\t * Calls functions to bump fixed and/or absolute elements if configured to do so.\n\t * @param {object} config bumpElements object\n\t */\n\tbumpElements(config: BumpElements) {\n\t\tif (config?.bumpBy && config?.bumpBy !== \"0px\") {\n\t\t\tif (config.fixed) this.bumpFixedElements(config);\n\t\t\tif (config.absolute) this.bumpAbsoluteElements(config);\n\t\t}\n\t}\n\n\t/**\n\t * Set the max height of each element to be the height of the parent container\n\t * subtracted by the height of the previous element. This forces the element to either obey its\n\t * predefined height or stay within the bounds of the max height.\n\t * @param {object} elem HTML element\n\t * @param {number} prev height of previous sibling\n\t * @param maxHeight\n\t */\n\tprivate adjust(elem: HTMLElement, prev: number, maxHeight: string = \"100vh\") {\n\t\tif (\n\t\t\t!elem.classList?.contains(\"adjusted-element\") &&\n\t\t\t// workaround to fix dnd scrim disappearing\n\t\t\t!elem.classList?.contains(\"fsbl-share-scrim\")\n\t\t) {\n\t\t\tconst clientHeight = elem.clientHeight ? elem.clientHeight : 0;\n\t\t\tconst offsetHeight = elem.offsetHeight ? elem.offsetHeight : 0;\n\t\t\tconst offset = offsetHeight - clientHeight;\n\t\t\tconst adjustPrev = prev + offset;\n\n\t\t\telem.style.maxHeight = `calc(${maxHeight} - ${adjustPrev}px)`;\n\t\t\telem.classList.add(\"adjusted-element\");\n\t\t}\n\t}\n\n\t/**\n\t * Adjusts the top level content view height to be its height subtracted by the headerHeight and its\n\t * maxHeight to be 100vh subtracted by the total height of the previous elements.\n\t * The height of the previous elements are added to this calculation if they are not fixed or absolute.\n\t * @param {number} headerHeight the height of the header\n\t */\n\tprivate adjustTopLevelHeight(headerHeight: number) {\n\t\tconst elems: any = document.body.querySelectorAll(\":scope > *:not(#FSBLHeader, .fsbl-header)\");\n\t\tlet prev = headerHeight;\n\n\t\telems.forEach((elem: any) => {\n\t\t\tthis.adjust(elem, prev);\n\t\t\t// Heights of fixed and absolute positioned elements are not added to the total heights of previous elements\n\t\t\t// since they are removed from the document flow and can be positioned anywhere in the page.\n\t\t\tif (elem.style.position !== \"fixed\" && elem.style.position !== \"absolute\") prev = prev + elem.offsetHeight;\n\n\t\t\tthis.adjustContentHeight(elem);\n\t\t});\n\t}\n\n\t/**\n\t * Adjusts the content view height to be maximum the parent container height subtracted by the total height elements above it.\n\t * The height of the previous elements are added to this calculation if they are not fixed or absolute.\n\t * @param {object} headerNode window titlebar\n\t */\n\tprivate adjustContentHeight(headerNode: any) {\n\t\tconst elem: any = headerNode;\n\t\tconst maxHeight = `100%`;\n\n\t\tconst { children } = elem;\n\t\tconst len = children.length;\n\t\tlet prev = 0;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\t// Fixed and absolute positioned elements are ignored since they are removed from the document flow.\n\t\t\tif (children[i].style.position !== \"fixed\" && children[i].style.position !== \"absolute\") {\n\t\t\t\tthis.adjust(children[i], prev, maxHeight);\n\t\t\t\tprev = prev + children[i].offsetHeight;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calculates value to bump element by. If 'all' return top style and header height, if '0Positioned' return header height\n\t * @param type Whether all elements are being bumped by the header height and their top style or just header height\n\t * @param topStyle Element top value\n\t * @param bumpBy Value to bump element by\n\t * @returns Top style for element\n\t */\n\tprivate calculateBumpValue(type: string, topStyle: string, bumpBy: string) {\n\t\tlet topVal = topStyle;\n\t\tif (type == \"all\") {\n\t\t\ttopVal = `calc(${topStyle} + ${bumpBy})`;\n\t\t} else if (type == \"0Positioned\" && possibleZeros.includes(topStyle)) {\n\t\t\ttopVal = bumpBy;\n\t\t}\n\t\treturn topVal;\n\t}\n\n\t/**\n\t * Recursively traverse through the HTML document and return an array of the top level elements\n\t * and elements with static parents\n\t * @param {object} element The HTML element\n\t * @param {array} acc accumulator\n\t * @returns {array} array top level elements and elements with static parents\n\t *\n\t */\n\tprivate traverseHtml(element: any, acc: any[] = []) {\n\t\tconst elems: any = element.children;\n\t\tconst len = elems.length;\n\t\tif (!len) {\n\t\t\tacc.push(element);\n\t\t} else {\n\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\t\t\t\tif (style.getPropertyValue(\"position\") == \"static\") {\n\t\t\t\t\tacc = this.traverseHtml(elems[i], acc);\n\t\t\t\t} else {\n\t\t\t\t\tacc.push(elems[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t}\n\n\t/**\n\t * Bumps elements with fixed positioning down by the configured amount.\n\t * @private\n\t */\n\tprivate bumpFixedElements(params: any) {\n\t\tlet { fixed, bumpBy } = params;\n\n\t\tconst getFixedElements = (nodes: any) => {\n\t\t\tconst fixedElems: any[] = [];\n\t\t\tnodes.forEach((node: any) => {\n\t\t\t\tconst style = window.getComputedStyle(node, null);\n\t\t\t\tif (style.getPropertyValue(\"position\") == \"fixed\") fixedElems.push(node);\n\t\t\t\tconst elems = node.querySelectorAll(\"*\");\n\t\t\t\telems.forEach((elem: any) => {\n\t\t\t\t\tconst childStyle = window.getComputedStyle(elem, null);\n\t\t\t\t\tif (childStyle.getPropertyValue(\"position\") == \"fixed\") fixedElems.push(elem);\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn fixedElems;\n\t\t};\n\n\t\tconst selector = \"*:not(#FSBLHeader, .fsbl-header)\";\n\t\t// Get all fixed positioned elements\n\t\tconst elems: any = getFixedElements(document.body.querySelectorAll(`${selector}`));\n\t\tconst len = elems.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\n\t\t\tconst topStyle = style.getPropertyValue(\"top\");\n\t\t\tif (!elems[i].className?.includes(\"bumped-element\")) {\n\t\t\t\telems[i].style.top = this.calculateBumpValue(fixed, topStyle, bumpBy);\n\t\t\t\telems[i].classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bumps absolute positioned elements with static parents down by the configured amount.\n\t * @private\n\t */\n\tprivate bumpAbsoluteElements(params: any) {\n\t\tlet { absolute, bumpBy } = params;\n\n\t\tconst selector = \"*:not(#FSBLHeader, .fsbl-header)\";\n\t\t// Get top level absolute positioned elements and elements who have static parents\n\t\tconst elems: any = this.traverseHtml({ children: document.body.querySelectorAll(`:scope > ${selector}`) });\n\t\tconst len = elems.length;\n\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst style = window.getComputedStyle(elems[i], null);\n\n\t\t\tconst topStyle = style.getPropertyValue(\"top\");\n\n\t\t\t// Target absolute positioned elements\n\t\t\tif (style.getPropertyValue(\"position\") == \"absolute\" && !elems[i].className?.includes(\"bumped-element\")) {\n\t\t\t\telems[i].style.top = this.calculateBumpValue(absolute, topStyle, bumpBy);\n\t\t\t\telems[i].classList.add(\"bumped-element\");\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tlet showDockingIcon = !this.state.dockingEnabled ? false : this.state.dockingIcon;\n\t\tlet isGrouped = this.state.dockingIcon == \"ejector\";\n\t\tlet showMinimizeIcon = (isGrouped && this.state.isTopRight) || !isGrouped; // If not in a group or if topright in a group\n\t\tlet tabRegionClasses = \"fsbl-tab-area\";\n\t\tlet headerClasses = \"fsbl-header\";\n\n\t\t// If we're showing tabs, we throw these classes on to modify styles.\n\t\tif (this.state.showTabs) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-enabled`;\n\t\t}\n\t\tif (this.state.tabs.length > 1) {\n\t\t\theaderClasses = `${headerClasses} fsbl-tabs-multiple`;\n\t\t}\n\t\tconst context = {\n\t\t\tshowLinkerButton: this.state.showLinkerButton,\n\t\t\tshowShareButton: this.state.showShareButton,\n\t\t\tshowTabRegion: this.state.showTabs,\n\t\t\tshowMinimizeButton: this.state.minButton && showMinimizeIcon,\n\t\t\tshowMaximizeButton: this.state.maxButton,\n\t\t\tonTabDropped: this.allowDragOnCenterRegion,\n\t\t\tshowDockingButton: showDockingIcon,\n\t\t\tshowCloseButton: this.state.closeButton,\n\t\t\tclassName: tabRegionClasses,\n\t\t\tthisWindowTitle: this.state.windowTitle,\n\t\t\tboundingBox: this.state.tabBarBoundingBox,\n\t\t\tlistenForDragOver: !this.state.allowDragOnCenterRegion,\n\t\t\ttabs: this.state.tabs,\n\t\t\tonTitleUpdated: this.resizeDragHandle,\n\t\t\tshowAlwaysOnTopButton: this.state.alwaysOnTopButton && showMinimizeIcon,\n\t\t\tshowTabs: this.state.showTabs,\n\t\t\talwaysOnTop: this.state.alwaysOnTop,\n\t\t\tuseDOMBasedMovement: this.state.useDOMBasedMovement,\n\t\t};\n\n\t\treturn (\n\t\t\t<div className={headerClasses} onDrop={this.onDropHandler.bind(this)}>\n\t\t\t\t{this.state.initialized && (\n\t\t\t\t\t<WindowTitleBarContext.Provider value={context}>{this.props.children}</WindowTitleBarContext.Provider>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
export class LinkerButton extends React.Component<any, any, any> {
|
|
5
5
|
static contextType: React.Context<import("../../windowTitleBarContext").WindowTitleBarContextType>;
|
|
6
6
|
constructor(props: any);
|
|
7
|
+
state: {
|
|
8
|
+
channels: {};
|
|
9
|
+
allChannels: {};
|
|
10
|
+
showLinker: boolean;
|
|
11
|
+
hoverState: string;
|
|
12
|
+
};
|
|
7
13
|
/**
|
|
8
14
|
* This is necessary to make sure that the `this` inside of the callback is correct.
|
|
9
15
|
*
|
|
@@ -55,5 +61,24 @@ export class LinkerButton extends React.Component<any, any, any> {
|
|
|
55
61
|
* @memberof LinkerButton
|
|
56
62
|
*/
|
|
57
63
|
onStoreChanged(newState: any): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add listeners to the store.
|
|
66
|
+
*
|
|
67
|
+
* @memberof LinkerButton
|
|
68
|
+
*/
|
|
69
|
+
componentDidMount(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Remove listeners from the store.
|
|
72
|
+
*
|
|
73
|
+
* @memberof LinkerButton
|
|
74
|
+
*/
|
|
75
|
+
componentWillUnmount(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Render method.
|
|
78
|
+
*
|
|
79
|
+
* @returns
|
|
80
|
+
* @memberof LinkerButton
|
|
81
|
+
*/
|
|
82
|
+
render(): JSX.Element;
|
|
58
83
|
}
|
|
59
84
|
import * as React from "react";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export default class LinkerGroups extends React.Component<any, any, any> {
|
|
2
2
|
constructor(props: any);
|
|
3
|
+
state: {
|
|
4
|
+
channels: any;
|
|
5
|
+
accessibleLinker: boolean;
|
|
6
|
+
};
|
|
3
7
|
/**
|
|
4
8
|
* This is necessary to make sure that the `this` inside of the callback is correct.
|
|
5
9
|
*
|
|
@@ -14,6 +18,18 @@ export default class LinkerGroups extends React.Component<any, any, any> {
|
|
|
14
18
|
* @memberof LinkerGroups
|
|
15
19
|
*/
|
|
16
20
|
onChannelChange(err: any, response: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* Add listeners to the store.
|
|
23
|
+
*
|
|
24
|
+
* @memberof LinkerGroups
|
|
25
|
+
*/
|
|
26
|
+
componentDidMount(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Remove listeners from the store.
|
|
29
|
+
*
|
|
30
|
+
* @memberof LinkerGroups
|
|
31
|
+
*/
|
|
32
|
+
componentWillUnmount(): void;
|
|
17
33
|
/**
|
|
18
34
|
* Whenever the store changes, set state.
|
|
19
35
|
*
|
|
@@ -22,5 +38,12 @@ export default class LinkerGroups extends React.Component<any, any, any> {
|
|
|
22
38
|
*/
|
|
23
39
|
onStoreChanged(newState: any): void;
|
|
24
40
|
onClick(e: any, channel: any): void;
|
|
41
|
+
/**
|
|
42
|
+
* Render method.
|
|
43
|
+
*
|
|
44
|
+
* @returns
|
|
45
|
+
* @memberof LinkerGroups
|
|
46
|
+
*/
|
|
47
|
+
render(): JSX.Element;
|
|
25
48
|
}
|
|
26
49
|
import * as React from "react";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export class ShareButton extends React.Component<any, any, any> {
|
|
2
2
|
static contextType: React.Context<import("../../windowTitleBarContext").WindowTitleBarContextType>;
|
|
3
3
|
constructor(props: any);
|
|
4
|
+
state: {
|
|
5
|
+
hoverState: string;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* This is necessary to make sure that the `this` inside of the callback is correct.
|
|
6
9
|
*
|
|
@@ -21,5 +24,18 @@ export class ShareButton extends React.Component<any, any, any> {
|
|
|
21
24
|
* @memberof ShareButton
|
|
22
25
|
*/
|
|
23
26
|
onDragStart(ev: any): void;
|
|
27
|
+
/**
|
|
28
|
+
* Add listeners to store.
|
|
29
|
+
*
|
|
30
|
+
* @memberof ShareButton
|
|
31
|
+
*/
|
|
32
|
+
UNSAFE_componentWillMount(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Remove listeners from the store.
|
|
35
|
+
*
|
|
36
|
+
* @memberof ShareButton
|
|
37
|
+
*/
|
|
38
|
+
componentWillUnmount(): void;
|
|
39
|
+
render(): JSX.Element;
|
|
24
40
|
}
|
|
25
41
|
import * as React from "react";
|
|
@@ -170,7 +170,7 @@ export class Title extends Component {
|
|
|
170
170
|
// There is a subtle difference bewtween windowTitle and tabTitle. Since this code executes
|
|
171
171
|
// when *any* tab has a name change, this code can execute when the active window represents
|
|
172
172
|
// a tab other than the currently rendering tab (ie an inactive tab).
|
|
173
|
-
var _a, _b
|
|
173
|
+
var _a, _b;
|
|
174
174
|
// The window represented by this tab title instance
|
|
175
175
|
const { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);
|
|
176
176
|
// "tabWindowOptions" refers to the options from the window which hosts the component represented by this tab
|
|
@@ -178,7 +178,7 @@ export class Title extends Component {
|
|
|
178
178
|
// Derive the title: "config title" then "document.title" then "appd title"
|
|
179
179
|
let title = await __classPrivateFieldGet(this, _Title_instances, "m", _Title_calculateTabTitle).call(this);
|
|
180
180
|
// Get the titleBar icon from the WindowDescriptor for the TAB window (not the CURRENT window)
|
|
181
|
-
const icon = (
|
|
181
|
+
const icon = (_b = (_a = tabWindowOptions === null || tabWindowOptions === void 0 ? void 0 : tabWindowOptions.icons) === null || _a === void 0 ? void 0 : _a.titleBarIcon) !== null && _b !== void 0 ? _b : {
|
|
182
182
|
imageType: "initials",
|
|
183
183
|
name: title,
|
|
184
184
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windowTitle.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/components/windowTitle.tsx"],"names":[],"mappings":";;;;;;AAGA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAgDtD,mEAAmE;AACnE,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAClD,8CAA8C;AAC9C,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAEpD,mCAAmC;AACnC,IAAI,kBAAuB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACxC,IAAI,CAAC,kBAAkB,EAAE;QACxB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;YACjF,KAAK,EAAE,sBAAsB;SAC7B,CAAC,CAAC;QACH,kBAAkB,GAAG,KAAK,CAAC;KAC3B;IAED,mBAAmB;IACnB,OAAO,kBAAkB,CAAC;AAC3B,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,KAAmB;IACnC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA6B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M,CAAC,KAAK,CACxB,4BAA4B,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAC3G,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,KAAK;IACJ,wCAAwC;IACxC,MAAM,KAAK,GAAG,MAAM,qBAAqB,EAAE,CAAC;IAC5C,mEAAmE;IACnE,IAAI,CAAC,KAAK,EAAE;QACX,oDAAoD;QACpD,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;YACV,qGAAqG;YACrG,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// The windowTabNameStore reference\nlet windowTabNameStore: any;\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\tif (!windowTabNameStore) {\n\t\tlet { data: store } = await FSBL.Clients.DistributedStoreClient.createGlobalStore({\n\t\t\tstore: WINDOW_TAB_TITLE_STORE,\n\t\t});\n\t\twindowTabNameStore = store;\n\t}\n\n\t// Return the store\n\treturn windowTabNameStore;\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\tid=\"title_editor_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\tif (!!this._mounted) {\n\t\t\tthis.updateTitle();\n\t\t}\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\n\t\t// Declare the initial title as a blank string\n\t\tlet initialTitle = \" \";\n\n\t\t// If the currently rendering tab represents the current window, then use the document title (or window name)\n\t\tif (\n\t\t\tundefined !== finsembleWindow?.thisWindowName &&\n\t\t\tfinsembleWindow?.thisWindowName === props?.windowIdentifier?.windowName\n\t\t) {\n\t\t\tinitialTitle = document.title || props.windowIdentifier?.windowName;\n\t\t}\n\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: initialTitle,\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\n\t\t// Initial title set\n\t\tthis.updateTitle();\n\t}\n\n\t/**\n\t * Gets a reference to the \"Window Manager\" component for the tab which is rendering. If the this tab IS the active tab, then the WindowManager will be the same as the WindowManager\n\t * attached to the WindowClient. However, all other tab components displayed in this window will need to derive the WindowManager from the config, based on the\n\t * tab's windowIdentifier.\n\t *\n\t * This is because the tab's windowIdentifier only has the name (ex: SomeApp-37ba6708-3a75-462e-b900-1812e338cbf1). The name is derived by removing the last 5 substrings\n\t * separated by \"-\". This will fail in the face of a UUID format change.\n\t *\n\t * @returns the \"Window Manager\" component, or \"undefined\" if the \"Window Manager\" is not found\n\t */\n\tasync #getWindowManagerForTab() {\n\t\t// On second thought, ALL tabs will derive the WindowManager the same way; at least if it is wrong, it is wrong consistently\n\t\t//\n\t\t// if (finsembleWindow.thisWindowName === this.props?.windowIdentifier?.windowName) {\n\t\t// \treturn FSBL.Clients.WindowClient.options?.customData?.foreign?.components?.[\"Window Manager\"] || FSBL.Clients.WindowClient.options?.customData?.appDConfig?.manifest?.foreign?.components?.[\"Window Manager\"];\n\t\t// } else {\n\n\t\t// Check that \"windowName\" exists\n\t\tif (!!this.props?.windowIdentifier?.windowName) {\n\t\t\t// Get the window name\n\t\t\tconst tabsWindowName = this.props.windowIdentifier.windowName;\n\t\t\t// Get the active descriptors\n\t\t\tconst { data: activeDescriptors } = await FSBL.Clients.LauncherClient.getActiveDescriptors();\n\t\t\t// Return the \"Window Manager\" for the window whose name matches THIS tab's name\n\t\t\treturn activeDescriptors?.[tabsWindowName]?.customData?.appDConfig?.manifest?.foreign?.components?.[\n\t\t\t\t\"Window Manager\"\n\t\t\t];\n\t\t}\n\n\t\treturn undefined;\n\t\t// }\n\t}\n\n\t/**\n\t * Calculates a tab title. Uses the following algorithm until a non-null value is found.\n\t * <ol>\n\t * <li>user edited tab title</li>\n\t * <li>the component config</li>\n\t * <li>document.title</li>\n\t * <li>appd config</li>\n\t * </ol>\n\t *\n\t * @returns the calculated tab title\n\t */\n\tasync #calculateTabTitle() {\n\t\treturn (\n\t\t\t(await this.#getUserEditedTitle()) ||\n\t\t\t(await this.#getConfigTitle()) ||\n\t\t\t(await this.#getDocumentTitle()) ||\n\t\t\tthis.#getAppDTitle()\n\t\t);\n\t}\n\n\t/**\n\t * Returns the name of the title supplied by a user; undefined if the user has not supplied a title.\n\t *\n\t * @returns The name of the title supplied by a user; undefined if the user has not supplied a title\n\t */\n\tasync #getUserEditedTitle() {\n\t\tconst { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);\n\t\treturn new Promise((resolve) => {\n\t\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t\tif (!!error) {\n\t\t\t\t\t// should always return value even if it hasn't been retrieved from the state\n\t\t\t\t\tresolve(undefined);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(persistedTitle);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Gets a title set in the component configuration.\n\t *\n\t * @returns any title set in the component configuration\n\t */\n\tasync #getConfigTitle() {\n\t\tconst windowManager = await this.#getWindowManagerForTab();\n\t\treturn windowManager?.FSBLHeader?.title || windowManager?.title;\n\t}\n\n\t/**\n\t * Returns document.title.\n\t *\n\t * @returns the document.title (from the \"tab name\" store)\n\t */\n\tasync #getDocumentTitle() {\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 setting the tab title: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.props?.windowIdentifier?.windowName\n\t\t\t? (await store.getGlobalValue(this.props.windowIdentifier.windowName)).data\n\t\t\t: undefined;\n\t}\n\n\t/**\n\t * Gets the AppD configuration\n\t *\n\t * @returns The AppD name\n\t */\n\t#getAppDTitle() {\n\t\treturn (\n\t\t\tFSBL.Clients.WindowClient.options?.customData?.appDConfig?.manifest?.component?.displayName ||\n\t\t\tFSBL.Clients.WindowClient.options?.customData?.appDConfig?.name\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// 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\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// Derive the title: \"config title\" then \"document.title\" then \"appd title\"\n\t\tlet title = await this.#calculateTabTitle();\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// Log a message\n\t\tFSBL.Clients.Logger.debug(`Setting tab title ${title} for window ${this.props.windowIdentifier.windowName}`);\n\n\t\t// Finally, set the state if the component is mounted\n\t\tif (!!this._mounted) {\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\n\t\t// If this tab component instance represents the window (that is, this is the active tab), then set the title\n\t\tif (finsembleWindow.thisWindowName === this.props.windowIdentifier.windowName) {\n\t\t\tdocument.title = await this.#calculateTabTitle();\n\t\t}\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,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAgDtD,mEAAmE;AACnE,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAClD,8CAA8C;AAC9C,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAEpD,mCAAmC;AACnC,IAAI,kBAAuB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACxC,IAAI,CAAC,kBAAkB,EAAE;QACxB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;YACjF,KAAK,EAAE,sBAAsB;SAC7B,C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AU,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// The windowTabNameStore reference\nlet windowTabNameStore: any;\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\tif (!windowTabNameStore) {\n\t\tlet { data: store } = await FSBL.Clients.DistributedStoreClient.createGlobalStore({\n\t\t\tstore: WINDOW_TAB_TITLE_STORE,\n\t\t});\n\t\twindowTabNameStore = store;\n\t}\n\n\t// Return the store\n\treturn windowTabNameStore;\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\tid=\"title_editor_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\tif (!!this._mounted) {\n\t\t\tthis.updateTitle();\n\t\t}\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\n\t\t// Declare the initial title as a blank string\n\t\tlet initialTitle = \" \";\n\n\t\t// If the currently rendering tab represents the current window, then use the document title (or window name)\n\t\tif (\n\t\t\tundefined !== finsembleWindow?.thisWindowName &&\n\t\t\tfinsembleWindow?.thisWindowName === props?.windowIdentifier?.windowName\n\t\t) {\n\t\t\tinitialTitle = document.title || props.windowIdentifier?.windowName;\n\t\t}\n\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: initialTitle,\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\n\t\t// Initial title set\n\t\tthis.updateTitle();\n\t}\n\n\t/**\n\t * Gets a reference to the \"Window Manager\" component for the tab which is rendering. If the this tab IS the active tab, then the WindowManager will be the same as the WindowManager\n\t * attached to the WindowClient. However, all other tab components displayed in this window will need to derive the WindowManager from the config, based on the\n\t * tab's windowIdentifier.\n\t *\n\t * This is because the tab's windowIdentifier only has the name (ex: SomeApp-37ba6708-3a75-462e-b900-1812e338cbf1). The name is derived by removing the last 5 substrings\n\t * separated by \"-\". This will fail in the face of a UUID format change.\n\t *\n\t * @returns the \"Window Manager\" component, or \"undefined\" if the \"Window Manager\" is not found\n\t */\n\tasync #getWindowManagerForTab() {\n\t\t// On second thought, ALL tabs will derive the WindowManager the same way; at least if it is wrong, it is wrong consistently\n\t\t//\n\t\t// if (finsembleWindow.thisWindowName === this.props?.windowIdentifier?.windowName) {\n\t\t// \treturn FSBL.Clients.WindowClient.options?.customData?.foreign?.components?.[\"Window Manager\"] || FSBL.Clients.WindowClient.options?.customData?.appDConfig?.manifest?.foreign?.components?.[\"Window Manager\"];\n\t\t// } else {\n\n\t\t// Check that \"windowName\" exists\n\t\tif (!!this.props?.windowIdentifier?.windowName) {\n\t\t\t// Get the window name\n\t\t\tconst tabsWindowName = this.props.windowIdentifier.windowName;\n\t\t\t// Get the active descriptors\n\t\t\tconst { data: activeDescriptors } = await FSBL.Clients.LauncherClient.getActiveDescriptors();\n\t\t\t// Return the \"Window Manager\" for the window whose name matches THIS tab's name\n\t\t\treturn activeDescriptors?.[tabsWindowName]?.customData?.appDConfig?.manifest?.foreign?.components?.[\n\t\t\t\t\"Window Manager\"\n\t\t\t];\n\t\t}\n\n\t\treturn undefined;\n\t\t// }\n\t}\n\n\t/**\n\t * Calculates a tab title. Uses the following algorithm until a non-null value is found.\n\t * <ol>\n\t * <li>user edited tab title</li>\n\t * <li>the component config</li>\n\t * <li>document.title</li>\n\t * <li>appd config</li>\n\t * </ol>\n\t *\n\t * @returns the calculated tab title\n\t */\n\tasync #calculateTabTitle() {\n\t\treturn (\n\t\t\t(await this.#getUserEditedTitle()) ||\n\t\t\t(await this.#getConfigTitle()) ||\n\t\t\t(await this.#getDocumentTitle()) ||\n\t\t\tthis.#getAppDTitle()\n\t\t);\n\t}\n\n\t/**\n\t * Returns the name of the title supplied by a user; undefined if the user has not supplied a title.\n\t *\n\t * @returns The name of the title supplied by a user; undefined if the user has not supplied a title\n\t */\n\tasync #getUserEditedTitle() {\n\t\tconst { wrap: tabWindow } = await FSBL.FinsembleWindow.getInstance(this.props.windowIdentifier);\n\t\treturn new Promise((resolve) => {\n\t\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t\tif (!!error) {\n\t\t\t\t\t// should always return value even if it hasn't been retrieved from the state\n\t\t\t\t\tresolve(undefined);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(persistedTitle);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Gets a title set in the component configuration.\n\t *\n\t * @returns any title set in the component configuration\n\t */\n\tasync #getConfigTitle() {\n\t\tconst windowManager = await this.#getWindowManagerForTab();\n\t\treturn windowManager?.FSBLHeader?.title || windowManager?.title;\n\t}\n\n\t/**\n\t * Returns document.title.\n\t *\n\t * @returns the document.title (from the \"tab name\" store)\n\t */\n\tasync #getDocumentTitle() {\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 setting the tab title: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.props?.windowIdentifier?.windowName\n\t\t\t? (await store.getGlobalValue(this.props.windowIdentifier.windowName)).data\n\t\t\t: undefined;\n\t}\n\n\t/**\n\t * Gets the AppD configuration\n\t *\n\t * @returns The AppD name\n\t */\n\t#getAppDTitle() {\n\t\treturn (\n\t\t\tFSBL.Clients.WindowClient.options?.customData?.appDConfig?.manifest?.component?.displayName ||\n\t\t\tFSBL.Clients.WindowClient.options?.customData?.appDConfig?.name\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// 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\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// Derive the title: \"config title\" then \"document.title\" then \"appd title\"\n\t\tlet title = await this.#calculateTabTitle();\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// Log a message\n\t\tFSBL.Clients.Logger.debug(`Setting tab title ${title} for window ${this.props.windowIdentifier.windowName}`);\n\n\t\t// Finally, set the state if the component is mounted\n\t\tif (!!this._mounted) {\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\n\t\t// If this tab component instance represents the window (that is, this is the active tab), then set the title\n\t\tif (finsembleWindow.thisWindowName === this.props.windowIdentifier.windowName) {\n\t\t\tdocument.title = await this.#calculateTabTitle();\n\t\t}\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"]}
|