@finsemble/finsemble-ui 7.3.0-beta.1 → 7.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finsemble/finsemble-ui",
3
- "version": "7.3.0-beta.1",
3
+ "version": "7.3.2",
4
4
  "description": "Ready-made React components to give you a head-start building your SmartDesktop.",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -29,7 +29,7 @@
29
29
  "build-storybook": "build-storybook"
30
30
  },
31
31
  "dependencies": {
32
- "@finsemble/finsemble-api": "7.3.0-beta.1",
32
+ "@finsemble/finsemble-api": "7.3.2",
33
33
  "@q42/floating-focus-a11y": "^1.3.3",
34
34
  "@reduxjs/toolkit": "^1.5.0",
35
35
  "@svgr/webpack": "^5.5.0",
@@ -185,7 +185,9 @@ html.desktop-active .fsbl-header-title[data-hover="true"] {
185
185
 
186
186
  user-select: none;
187
187
  position: relative;
188
- padding-bottom: 3px; /* This needs to be half of the thing subtracted from the height. e.g. height = 100% - 6px, then this is 3px) */
188
+ padding-bottom: 3px;
189
+
190
+ /* This needs to be half of the thing subtracted from the height. e.g. height = 100% - 6px, then this is 3px) */
189
191
  }
190
192
 
191
193
  .fsbl-tabs-enabled .fsbl-header-center {
@@ -44,6 +44,8 @@ interface WindowTitleBarShellState {
44
44
  export declare class WindowTitleBarShell extends React.Component<WindowTitleBarShellProps, WindowTitleBarShellState> {
45
45
  store?: StoreModel;
46
46
  isMousePressed: boolean;
47
+ dragMutationObserver?: MutationObserver;
48
+ dragResizeObserver?: ResizeObserver;
47
49
  constructor(props: WindowTitleBarShellProps);
48
50
  alwaysOnTopListener({ data: { alwaysOnTop } }: any): void;
49
51
  /**
@@ -8,6 +8,7 @@ import { storeManager, Actions, getStore } from "./stores/windowTitleBarStore";
8
8
  import "../../assets/css/windowTitleBar.css";
9
9
  import { clone } from "../sdd/Appearance.helpers";
10
10
  import { Logger } from "@finsemble/finsemble-api";
11
+ import _throttle from "lodash/throttle";
11
12
  // Values for possible zero
12
13
  const possibleZeros = ["0", "0px", 0];
13
14
  export class WindowTitleBarShell extends React.Component {
@@ -76,6 +77,7 @@ export class WindowTitleBarShell extends React.Component {
76
77
  this.onDoubleClick = this.onDoubleClick.bind(this);
77
78
  this.alwaysOnTopListener = this.alwaysOnTopListener.bind(this);
78
79
  this.onInitialized = this.onInitialized.bind(this);
80
+ window.resizeDragHandle = this.resizeDragHandle.bind(this);
79
81
  }
80
82
  onInitialized() {
81
83
  this.store = getStore();
@@ -150,13 +152,13 @@ export class WindowTitleBarShell extends React.Component {
150
152
  document.body.style.margin = "0px";
151
153
  document.body.style.marginTop = window.getComputedStyle(header, null).getPropertyValue("height");
152
154
  }
153
- this.resizeDragHandle();
154
155
  this.hackScrollbar();
155
156
  storeManager.addInitializedListener(this.onInitialized);
156
157
  storeManager.initialize();
157
158
  }
158
159
  componentDidUpdate() {
159
- this.resizeDragHandle();
160
+ Logger.system.debug("WindowTitleBarShell:componentDidUpdate");
161
+ // this.resizeDragHandle();
160
162
  // Sometimes handleMouseUp is not invoked; specifically this can happen if the mouse is not over the drag handle when the button is
161
163
  // unpressed. This happens when the drag starts near the bottom of the drag handle and the mouse is moved UP. If the window is
162
164
  // 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
@@ -164,12 +166,27 @@ export class WindowTitleBarShell extends React.Component {
164
166
  this.isMousePressed = false;
165
167
  this.hackScrollbar();
166
168
  this.maybeAdjustWindow();
169
+ if (!this.dragMutationObserver) {
170
+ const headerCenter = document.querySelector(".fsbl-header-center");
171
+ if (headerCenter) {
172
+ this.dragMutationObserver = new MutationObserver(_throttle(this.resizeDragHandle, 250));
173
+ this.dragMutationObserver.observe(headerCenter, {
174
+ childList: true,
175
+ characterData: false,
176
+ subtree: true,
177
+ });
178
+ this.dragResizeObserver = new ResizeObserver(_throttle(this.resizeDragHandle, 250));
179
+ this.dragResizeObserver.observe(headerCenter);
180
+ }
181
+ }
167
182
  }
168
183
  componentWillUnmount() {
169
- var _a;
184
+ var _a, _b, _c;
185
+ (_a = this.dragMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
186
+ (_b = this.dragResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
170
187
  storeManager.removeInitializedListener(this.onInitialized);
171
188
  if (this.state.initialized) {
172
- (_a = this.store) === null || _a === void 0 ? void 0 : _a.removeListeners([
189
+ (_c = this.store) === null || _c === void 0 ? void 0 : _c.removeListeners([
173
190
  { field: "Main.windowTitle", listener: this.onTitleChange },
174
191
  {
175
192
  field: "Main.showDockingTooltip",
@@ -204,7 +221,7 @@ export class WindowTitleBarShell extends React.Component {
204
221
  this.setState({
205
222
  useDOMBasedMovement: response.value,
206
223
  dragHandleName: response.value ? "fsbl-drag-handle" : "fsbl-drag-handle-native-movement",
207
- }, this.resizeDragHandle);
224
+ });
208
225
  }
209
226
  }
210
227
  /**
@@ -307,9 +324,6 @@ export class WindowTitleBarShell extends React.Component {
307
324
  this.onDoubleClick();
308
325
  };
309
326
  fsblHeader.insertBefore(dragHandle, fsblHeader.firstChild);
310
- window.addEventListener("resize", () => {
311
- this.resizeDragHandle();
312
- });
313
327
  return dragHandle;
314
328
  }
315
329
  dragHandleBoundsForShowTabs(startingBounds) {
@@ -335,11 +349,19 @@ export class WindowTitleBarShell extends React.Component {
335
349
  //
336
350
  // Get the "x" coordinate for the RIGHT-MOST tab; the "right" attribute will be the
337
351
  // LEFT x-coordinate for the drag handle
338
- const rightTab = document.querySelector(".tab-region-wrapper .fsbl-tab:last-child");
339
- // The "left" bounds is to the RIGHT of the RIGHT-MOST tab, plus padding
340
- const leftXCoord = Math.trunc((rightTab === null || rightTab === void 0 ? void 0 : rightTab.getBoundingClientRect().right) || 0) + padding;
352
+ const allTabs = document.querySelectorAll(".tab-region-wrapper .fsbl-tab");
353
+ const leftXCoord = allTabs.length
354
+ ? Math.max(...[...allTabs].map((n) => n.getBoundingClientRect().right)) + padding
355
+ : padding;
341
356
  // The "width" bounds attribute is the difference between leftXCoord and rightXCoord, minus padding
342
357
  const width = rightXCoord - leftXCoord - padding;
358
+ Logger.system.debug("dragHandleBoundsForShowTabs: calculating dimensions:", {
359
+ leftMostRightHeaderElement_getBoundingClientRect_x: leftMostRightHeaderElement === null || leftMostRightHeaderElement === void 0 ? void 0 : leftMostRightHeaderElement.getBoundingClientRect().x,
360
+ innerWidth,
361
+ rightXCoord,
362
+ leftXCoord,
363
+ width,
364
+ });
343
365
  // Override bounds.width and bounds.left with the calculated values
344
366
  return Object.assign(Object.assign({}, clone(headerRight.getBoundingClientRect())), { width: width, left: leftXCoord });
345
367
  }
@@ -416,6 +438,7 @@ export class WindowTitleBarShell extends React.Component {
416
438
  // Start logic for determining where to place our dragHandle
417
439
  if (this.state.showTabs) {
418
440
  bounds = this.dragHandleBoundsForShowTabs(bounds);
441
+ Logger.system.debug("dragHandleBoundsForShowTabs: calculated bounds:", bounds);
419
442
  }
420
443
  else {
421
444
  // If tabs are not enabled, then the entire center is the drag area
@@ -866,7 +889,7 @@ export class WindowTitleBarShell extends React.Component {
866
889
  boundingBox: this.state.tabBarBoundingBox,
867
890
  listenForDragOver: !this.state.allowDragOnCenterRegion,
868
891
  tabs: this.state.tabs,
869
- onTitleUpdated: this.resizeDragHandle,
892
+ onTitleUpdated: Function.prototype,
870
893
  showAlwaysOnTopButton: this.state.alwaysOnTopButton && showMinimizeIcon,
871
894
  showTabs: this.state.showTabs,
872
895
  alwaysOnTop: this.state.alwaysOnTop,
@@ -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,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,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C,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\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\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 * Begin adjusting the body and top level elements and their direct descendants by the header height.\n\t */\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.parseInt(headerHeight, 10));\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 * Togglable setting found in `foreign.components.[\"Window Manager\"].FSBLHeader.adjustContentHeights`\n\t * Called from beginAdjustment()\n\t *\n\t * Adjusts the top level content 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 * These top level elements will be passed into adjustContentHeight where their descendants\n\t * will also have their heights adjusted.\n\t * Example:\n\t * In this below situation, the B element extends passed the view because the header is injected. B doesn't have a\n\t * set height so it'll extend as far as it needs.\n\t * --------------------\n\t * |******************|\n\t * |* Titlebar *|\n\t * |******************|\n\t * |******************|\n\t * |* A *|\n\t * |* *|\n\t * |******************|\n\t * |******************|\n\t * |* *|\n\t * |* *|\n\t * |* B *|\n\t * |* *|\n\t * |* *|\n\t * |* *|\n\t * --------------------\n\t * The chain of adjust functions will set the maxHeight of A and B to ensure they both occupy space that the above element doesn't\n\t * and keep it within the bounds of the view.\n\t * --------------------\n\t * |******************|\n\t * |* Titlebar *|\n\t * |******************|\n\t * |******************|\n\t * |* A *|\n\t * |* *|\n\t * |******************|\n\t * |******************|\n\t * |* *|\n\t * |* *|\n\t * |* B *|\n\t * |* *|\n\t * |* *|\n\t * |******************|\n\t * --------------------\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 of the parent container (passed in by adjustTopLevelHeight()) height\n\t * subtracted by the total height of elements above it. The height of the previous elements are added to this calculation\n\t * if they are not fixed or absolute.\n\t * @param {object} parentElem parent element\n\t */\n\tprivate adjustContentHeight(parentElem: any) {\n\t\tconst elem: any = parentElem;\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 * This is used in adjustTopLevelHeight() and adjustContentHeight()\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 *\n\t * @param {object} elem HTML element\n\t * @param {number} prev height of previous sibling\n\t * @param {string} maxHeight maximum height of the element\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 * Togglable setting found in `foreign.components.[\"Window Manager\"].FSBLHeader.bumpElements.[bumpBy|fixed|absolute]`\n\t * Called from beginAdjustment()\n\t *\n\t * Calls bumpFixedElements and bumpAbsoluteElements to bump fixed and/or absolute elements by the value of bumpBy if configured to do so.\n\t * Since absolute and fixed positioned elements are removed from the document flow their positions will not be adjusted when the titlebar\n\t * is injected and they have a set top style. However, if the element is an absolute positioned element and it's\n\t * parent container has a position that is not set to static, then it'll adjust relative to the parent. Fixed positioned elements, on the otherhand,\n\t * won't adjust unless their top stlyes are changed.\n\t * @param {object} config bumpElements object\n\t */\n\tbumpElements(config: BumpElements) {\n\t\tif (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 * Called from bumpElements\n\t *\n\t * Bumps all elements with fixed positioning, that are not in the header, down by the configured amount.\n\t * @private\n\t * @param {object} params bumpElements object\n\t */\n\tprivate bumpFixedElements(params: any) {\n\t\tlet { fixed, bumpBy } = params;\n\n\t\tconst getFixedElements = (selector: string) => {\n\t\t\tconst fixedElems: any[] = [];\n\t\t\tconst nodes = document.body.querySelectorAll(selector);\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});\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(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]?.classList?.contains(\"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 * Called from bumpElements\n\t *\n\t * Bumps all absolute positioned elements with static parents, that are not in the header, down by the configured amount.\n\t * @private\n\t * @param {object} params bumpElements object\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]?.classList?.contains(\"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\t/**\n\t * Used in bumpFixedElements and bumpAbsoluteElements\n\t * Calculates value to bump element by. If 'all' return top style plus the header height, if '0Positioned' return just 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 * Used in bumpAbsoluteElements\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 * Togglable setting found in `foreign.components.[\"Window Manager\"].FSBLHeader.bumpElements.[monitorFixedAdditions]`\n\t * Called from beginAdjustment()\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 * This ensures that if a fixed positioned element is dynamically added to the DOM, for example a pop-up modal, it'll have it's height adjusted\n\t * by the header height since the initial bumping of elements can happen before this element exists.\n\t *\n\t * Element heights are not monitored and adjusted since this would require that all pre-existing elements have ther height recalculated each time\n\t * a new element is dynamically added onto the page. Absolute postioned elements, however, could be monitored and adjusted since all we would\n\t * need to check for is that it's parent has a static position or not, if it does then it can be adjusted.\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?.classList?.contains(\"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\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,KA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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,QAAQ,CAAC,SAAS;YAClC,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\";\nimport _throttle from \"lodash/throttle\";\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\tdragMutationObserver?: MutationObserver;\n\n\tdragResizeObserver?: ResizeObserver;\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\t(window as any).resizeDragHandle = this.resizeDragHandle.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.hackScrollbar();\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentDidUpdate() {\n\t\tLogger.system.debug(\"WindowTitleBarShell:componentDidUpdate\");\n\t\t// this.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\n\t\tif (!this.dragMutationObserver) {\n\t\t\tconst headerCenter = document.querySelector(\".fsbl-header-center\");\n\t\t\tif (headerCenter) {\n\t\t\t\tthis.dragMutationObserver = new MutationObserver(_throttle(this.resizeDragHandle, 250));\n\t\t\t\tthis.dragMutationObserver.observe(headerCenter, {\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tcharacterData: false,\n\t\t\t\t\tsubtree: true,\n\t\t\t\t});\n\t\t\t\tthis.dragResizeObserver = new ResizeObserver(_throttle(this.resizeDragHandle, 250));\n\t\t\t\tthis.dragResizeObserver.observe(headerCenter);\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.dragMutationObserver?.disconnect();\n\t\tthis.dragResizeObserver?.disconnect();\n\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\tuseDOMBasedMovement: response.value,\n\t\t\t\tdragHandleName: response.value ? \"fsbl-drag-handle\" : \"fsbl-drag-handle-native-movement\",\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\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 allTabs = document.querySelectorAll(\".tab-region-wrapper .fsbl-tab\");\n\t\t\t\tconst leftXCoord = allTabs.length\n\t\t\t\t\t? Math.max(...[...allTabs].map((n) => n.getBoundingClientRect().right)) + padding\n\t\t\t\t\t: 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\t\t\t\tLogger.system.debug(\"dragHandleBoundsForShowTabs: calculating dimensions:\", {\n\t\t\t\t\tleftMostRightHeaderElement_getBoundingClientRect_x: leftMostRightHeaderElement?.getBoundingClientRect().x,\n\t\t\t\t\tinnerWidth,\n\t\t\t\t\trightXCoord,\n\t\t\t\t\tleftXCoord,\n\t\t\t\t\twidth,\n\t\t\t\t});\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\tLogger.system.debug(\"dragHandleBoundsForShowTabs: calculated bounds:\", 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\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 * Begin adjusting the body and top level elements and their direct descendants by the header height.\n\t */\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.parseInt(headerHeight, 10));\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 * Togglable setting found in `foreign.components.[\"Window Manager\"].FSBLHeader.adjustContentHeights`\n\t * Called from beginAdjustment()\n\t *\n\t * Adjusts the top level content 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 * These top level elements will be passed into adjustContentHeight where their descendants\n\t * will also have their heights adjusted.\n\t * Example:\n\t * In this below situation, the B element extends passed the view because the header is injected. B doesn't have a\n\t * set height so it'll extend as far as it needs.\n\t * --------------------\n\t * |******************|\n\t * |* Titlebar *|\n\t * |******************|\n\t * |******************|\n\t * |* A *|\n\t * |* *|\n\t * |******************|\n\t * |******************|\n\t * |* *|\n\t * |* *|\n\t * |* B *|\n\t * |* *|\n\t * |* *|\n\t * |* *|\n\t * --------------------\n\t * The chain of adjust functions will set the maxHeight of A and B to ensure they both occupy space that the above element doesn't\n\t * and keep it within the bounds of the view.\n\t * --------------------\n\t * |******************|\n\t * |* Titlebar *|\n\t * |******************|\n\t * |******************|\n\t * |* A *|\n\t * |* *|\n\t * |******************|\n\t * |******************|\n\t * |* *|\n\t * |* *|\n\t * |* B *|\n\t * |* *|\n\t * |* *|\n\t * |******************|\n\t * --------------------\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 of the parent container (passed in by adjustTopLevelHeight()) height\n\t * subtracted by the total height of elements above it. The height of the previous elements are added to this calculation\n\t * if they are not fixed or absolute.\n\t * @param {object} parentElem parent element\n\t */\n\tprivate adjustContentHeight(parentElem: any) {\n\t\tconst elem: any = parentElem;\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 * This is used in adjustTopLevelHeight() and adjustContentHeight()\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 *\n\t * @param {object} elem HTML element\n\t * @param {number} prev height of previous sibling\n\t * @param {string} maxHeight maximum height of the element\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 * Togglable setting found in `foreign.components.[\"Window Manager\"].FSBLHeader.bumpElements.[bumpBy|fixed|absolute]`\n\t * Called from beginAdjustment()\n\t *\n\t * Calls bumpFixedElements and bumpAbsoluteElements to bump fixed and/or absolute elements by the value of bumpBy if configured to do so.\n\t * Since absolute and fixed positioned elements are removed from the document flow their positions will not be adjusted when the titlebar\n\t * is injected and they have a set top style. However, if the element is an absolute positioned element and it's\n\t * parent container has a position that is not set to static, then it'll adjust relative to the parent. Fixed positioned elements, on the otherhand,\n\t * won't adjust unless their top stlyes are changed.\n\t * @param {object} config bumpElements object\n\t */\n\tbumpElements(config: BumpElements) {\n\t\tif (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 * Called from bumpElements\n\t *\n\t * Bumps all elements with fixed positioning, that are not in the header, down by the configured amount.\n\t * @private\n\t * @param {object} params bumpElements object\n\t */\n\tprivate bumpFixedElements(params: any) {\n\t\tlet { fixed, bumpBy } = params;\n\n\t\tconst getFixedElements = (selector: string) => {\n\t\t\tconst fixedElems: any[] = [];\n\t\t\tconst nodes = document.body.querySelectorAll(selector);\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});\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(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]?.classList?.contains(\"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 * Called from bumpElements\n\t *\n\t * Bumps all absolute positioned elements with static parents, that are not in the header, down by the configured amount.\n\t * @private\n\t * @param {object} params bumpElements object\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]?.classList?.contains(\"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\t/**\n\t * Used in bumpFixedElements and bumpAbsoluteElements\n\t * Calculates value to bump element by. If 'all' return top style plus the header height, if '0Positioned' return just 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 * Used in bumpAbsoluteElements\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 * Togglable setting found in `foreign.components.[\"Window Manager\"].FSBLHeader.bumpElements.[monitorFixedAdditions]`\n\t * Called from beginAdjustment()\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 * This ensures that if a fixed positioned element is dynamically added to the DOM, for example a pop-up modal, it'll have it's height adjusted\n\t * by the header height since the initial bumping of elements can happen before this element exists.\n\t *\n\t * Element heights are not monitored and adjusted since this would require that all pre-existing elements have ther height recalculated each time\n\t * a new element is dynamically added onto the page. Absolute postioned elements, however, could be monitored and adjusted since all we would\n\t * need to check for is that it's parent has a static position or not, if it does then it can be adjusted.\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?.classList?.contains(\"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\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: Function.prototype,\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"]}
@@ -246,7 +246,7 @@ const processFEAAndFinsembleConfig = (values, windowTitleBarConfig) => {
246
246
  { field: "Main.dockingEnabled", value: dockingConfig.enabled },
247
247
  {
248
248
  field: "allowWindowTitleRenaming",
249
- value: (_k = (_j = servicesConfigWindow.allowWindowTitleRenaming) !== null && _j !== void 0 ? _j : dockingConfig.tabbing.allowEditing) !== null && _k !== void 0 ? _k : false,
249
+ value: (_k = (_j = servicesConfigWindow === null || servicesConfigWindow === void 0 ? void 0 : servicesConfigWindow.allowWindowTitleRenaming) !== null && _j !== void 0 ? _j : dockingConfig.tabbing.allowEditing) !== null && _k !== void 0 ? _k : false,
250
250
  },
251
251
  { field: "AlwaysOnTop.show", value: alwaysOnTopIcon },
252
252
  ]);