@finsemble/finsemble-ui 6.4.0 → 6.5.0-beta.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 +19 -18
- package/react/actions/smartDesktopDesignerActions.d.ts +6 -2
- package/react/actions/smartDesktopDesignerActions.js +2 -0
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/assets/icons/code-block.svg +15 -0
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.d.ts +2 -2
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/common/Checkbox.js +1 -1
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/DropZone.js +3 -1
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/FinsembleIcon.d.ts +1 -1
- package/react/components/common/FinsembleIcon.js +2 -0
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js +1 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/Tooltip.js +3 -1
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/application-list.css +4 -0
- package/react/components/common/css/preload-edit-page.css +37 -0
- package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
- package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/linker/remoteRedux.d.ts +1 -1
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuPortal.js +19 -0
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.d.ts +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/types.d.ts +1 -1
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.d.ts +1 -1
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/search/SearchResult.js +4 -3
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditPage.d.ts +2 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js +77 -73
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Appearance.css +8 -0
- package/react/components/smartDesktopDesigner/Application.d.ts +10 -3
- package/react/components/smartDesktopDesigner/Application.js +35 -42
- package/react/components/smartDesktopDesigner/Application.js.map +1 -1
- package/react/components/smartDesktopDesigner/Applications.d.ts +2 -0
- package/react/components/smartDesktopDesigner/Applications.js +17 -7
- package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
- package/react/components/smartDesktopDesigner/EditPreload.d.ts +14 -0
- package/react/components/smartDesktopDesigner/EditPreload.js +169 -0
- package/react/components/smartDesktopDesigner/EditPreload.js.map +1 -0
- package/react/components/smartDesktopDesigner/ItemList.d.ts +17 -0
- package/react/components/smartDesktopDesigner/ItemList.js +58 -0
- package/react/components/smartDesktopDesigner/ItemList.js.map +1 -0
- package/react/components/smartDesktopDesigner/OptionalSettingsView.d.ts +11 -0
- package/react/components/smartDesktopDesigner/OptionalSettingsView.js +71 -0
- package/react/components/smartDesktopDesigner/OptionalSettingsView.js.map +1 -0
- package/react/components/smartDesktopDesigner/Preloads.d.ts +8 -0
- package/react/components/smartDesktopDesigner/Preloads.js +26 -0
- package/react/components/smartDesktopDesigner/Preloads.js.map +1 -0
- package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/smartDesktopDesigner/Toolbar.js +5 -5
- package/react/components/smartDesktopDesigner/Toolbar.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +18 -0
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/css/appearance.css +3 -0
- package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +1 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js +23 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/preloads.d.ts +22 -0
- package/react/components/smartDesktopDesigner/fixtures/preloads.js +40 -0
- package/react/components/smartDesktopDesigner/fixtures/preloads.js.map +1 -0
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +1 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/views.js +9 -0
- package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +1 -0
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/EditPreload.stories.d.ts +11 -0
- package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js +35 -0
- package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/ItemList.stories.d.ts +16 -0
- package/react/components/smartDesktopDesigner/stories/{ApplicationList.stories.js → ItemList.stories.js} +26 -26
- package/react/components/smartDesktopDesigner/stories/ItemList.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.d.ts +11 -0
- package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js +28 -0
- package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/Preloads.stories.d.ts +11 -0
- package/react/components/smartDesktopDesigner/stories/Preloads.stories.js +31 -0
- package/react/components/smartDesktopDesigner/stories/Preloads.stories.js.map +1 -0
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1099 -258
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.d.ts → Application.spec.d.ts} +0 -0
- package/react/components/smartDesktopDesigner/tests/Application.spec.js +1496 -0
- package/react/components/smartDesktopDesigner/tests/Application.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js +3 -3
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/EditPreload.spec.d.ts +1 -0
- package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js +61 -0
- package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/ItemList.spec.d.ts +1 -0
- package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.js → ItemList.spec.js} +8 -8
- package/react/components/smartDesktopDesigner/tests/ItemList.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/Preloads.spec.d.ts +1 -0
- package/react/components/smartDesktopDesigner/tests/Preloads.spec.js +47 -0
- package/react/components/smartDesktopDesigner/tests/Preloads.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +6 -0
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
- package/react/components/toolbar/DragHandle.spec.js +31 -0
- package/react/components/toolbar/DragHandle.spec.js.map +1 -0
- package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
- package/react/components/toolbar/DragHandle.stories.js +39 -0
- package/react/components/toolbar/DragHandle.stories.js.map +1 -0
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +9 -12
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +1 -1
- package/react/components/userPreferences/components/content/Workspaces.js +1 -1
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +4 -2
- package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -59
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -2
- package/react/components/windowTitleBar/components/center/TabList.js +3 -0
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.d.ts +5 -2
- package/react/components/windowTitleBar/components/windowTitle.js +93 -89
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +213 -217
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/hooks/useDashbar.js.map +1 -1
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +1 -1
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +11 -3
- package/react/reducers/smartDesktopDesignerReducer.js +8 -0
- package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
- package/react/store.d.ts +22 -6
- package/react/types/fdc3.d.ts +2 -2
- package/react/types/fdc3.js.map +1 -1
- package/react/types/searchTypes.d.ts +1 -8
- package/react/types/searchTypes.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +8 -2
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/windowTitleBar.d.ts +1 -1
- package/react/types/windowTitleBar.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -16
- package/react/components/smartDesktopDesigner/ApplicationList.js +0 -60
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -16
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windowTitle.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/components/windowTitle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAsCtD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAElD,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAOpD,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAClC,IAAI,OAAO,CACO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAEpC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CACpD,EAAE,KAAK,EAAE,sBAAsB,EAAE,EACjC,CAAC,GAAG,EAAqB,KAAK,EAAkB,EAAE;QAEjD,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE;YACpB,MAAM,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAC;SACrC;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,CAAC;SACf;IACF,CAAC,CACD,CAAC;AACH,CAAC,CACD,CAAC;AAQH,MAAM,+B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indowIdentifier } from \"@finsemble/finsemble-core\";\n// TODO: Circular reference during \"yarn dev\"\n// This error is referenced as \"WT01\" in this file; search for the string \"WT01\" and uncomment appropriate changes\n// import { StandardError, StoreModel } from \"@finsemble/finsemble-core/types/types\"; // WT01 - uncomment to import\nimport React, { Component } from \"react\";\nimport { EditTabProps } from \"../../../types/windowTitleBar\";\nimport { Icon } from \"../../icon/Icon\";\nimport { iconFromConfig } from \"../../icon/Icon\";\nimport { Store } from \"../stores/windowTitleBarStore\";\n\n/**\n * TAB TITLES: HOW DO THEY WORK?\n *\n * Each component, when stacked, will have several tab titles. For each component, there is a window. For each window, there are 2 tab titles per component.\n *\n * Whichever component is \"active\" will render all tabs - exactly one \"active\" tab and n-1 \"inactive\" tabs (where n is the number of components in the stack). When\n * the active component is changed (via a click, for example), then the visible window becomes the window associated with the active component.\n *\n * Tab titles may change at any time, and for a number of reasons. For example, the component may execute \"document.title='...some title'\". Or perhaps the tab title has\n * been edited by the user. In order to account for all title changes, the following flow is used:\n * *something* updates document.title\n * The WindowClient for the component will notice the title change and send a router message (via FinsembleWindow.setTitle) with a topic representitive of the windowName\n * BaseWindow listens to router changes on the same topic and updates a DistributedStore dedicated to tab names\n * The tab components all subscribe to the DistributedStore dedicated to tab names and will update the title accordingly\n *\n * This is a \"one-way\" operation; that is to say that some code will ultimately alter the DistributedStore and the tab title components will read the changes. While this generally\n * happens with a write to document.title, it can also happen when a user edits the tab title manually. In this case, the component state is altered with a field \"persistedTitle\"\n * whose value is the edited title. At render time, the tab title component will use any value in \"persistedTitle\" as the title, irregardless of any other value.\n *\n * NOTE: A tab may be edited only when it is the active component; ergo the call to \"setComponentState\" is safe.\n */\n\ntype TitleProps = {\n\twindowIdentifier: WindowIdentifier;\n\tonUpdate?: Function;\n\ttitleWidth?: number;\n\tonClick?: () => void;\n};\n\ntype TitleState = {\n\ttitle: string | undefined;\n\ticon: any;\n\twindowName?: string;\n};\n\n// The store name for the distributed store which tracks tab titles\nconst WINDOW_TAB_TITLE_STORE = \"window-tab-title\";\n// The field name to watch for tab title edits\nconst FIELD_NAME_PERSISTED_TITLE = \"persistedTitle\";\n\n/**\n * Gets the store which tracks the tab title for a windowName. This is a distributed store shared by all components.\n *\n * @returns the StoreModel associated with window and tab names\n */\nconst getWindowTabNameStore = () =>\n\tnew Promise<any>(\n\t\t/*<StoreModel>*/ (resolve, reject) => {\n\t\t\t// WT01 - Change the \"any\" generic to \"StoreModel\"\n\t\t\tFSBL.Clients.DistributedStoreClient.createGlobalStore(\n\t\t\t\t{ store: WINDOW_TAB_TITLE_STORE },\n\t\t\t\t(err /*:StandardError*/, store /*:StoreModel*/) => {\n\t\t\t\t\t// WT01 - Define the types for \"err\" and \"store\"\n\t\t\t\t\tif (!!err || !store) {\n\t\t\t\t\t\treject(err || \"Could not get store\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve(store);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n/**\n * Gets the FinsembleWindow instance associated with the specified <i>windowIdentifier</i>\n *\n * @param windowIdentifier the windowIdentifier for the FinsembleWindow to obtain a reference for\n * @returns a Promise which resolves to the FinsembleWindow associated with the <i>windowIdentifier</i>\n */\nconst getCorrespondingFinsembleWindow = async (windowIdentifier: WindowIdentifier): Promise<FinsembleWindow> =>\n\t(await FSBL.FinsembleWindow.getInstance(windowIdentifier)).wrap;\n\n/**\n * The wrapper component for tab renaming\n * @param {*} props\n */\nfunction EditTab(props: EditTabProps) {\n\tconst [editingTitle, setEditingTitle] = React.useState(false);\n\tconst [clickTimeout, setClickTimeout] = React.useState<NodeJS.Timeout | undefined>(undefined);\n\tconst inputEl = React.useRef<HTMLInputElement>(null);\n\n\tconst updateTabTitle = (e: React.KeyboardEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement>) => {\n\t\tconst title = (e.target as HTMLInputElement).value;\n\n\t\t// Get the tab name store\n\t\tgetWindowTabNameStore()\n\t\t\t// Set the title for the window identified in the windowName\n\t\t\t.then((store /*: StoreModel*/) => store.setValue({ field: props.windowIdentifier.windowName, value: title })) // WT01 - Type \"store\"\n\t\t\t// Get the FinsembleWindow for the window\n\t\t\t.then(() => getCorrespondingFinsembleWindow(props.windowIdentifier))\n\t\t\t// Set the component state \"persistedTitle\" (which is the edited title)\n\t\t\t.then(\n\t\t\t\t(win) =>\n\t\t\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\t\t\tFSBL.Clients.Logger.debug(`Setting component state \"${FIELD_NAME_PERSISTED_TITLE}\" with value \"${title}\"`);\n\t\t\t\t\t\twin.setComponentState({ field: FIELD_NAME_PERSISTED_TITLE, value: title }, (err, res) => {\n\t\t\t\t\t\t\tif (!!err) {\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresolve(res);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})\n\t\t\t)\n\t\t\t.catch((err) => FSBL.Clients.Logger.error(\"Error persisting tab title via EditTab\", err))\n\t\t\t// Stop editing in all cases\n\t\t\t.finally(() => setEditingTitle(false));\n\t};\n\n\tconst beginEditing = async () => {\n\t\tawait setEditingTitle(true);\n\t\tawait inputEl?.current?.focus();\n\t\tif (inputEl?.current) {\n\t\t\tinputEl.current.value = props.title ?? \"\";\n\t\t}\n\t};\n\n\tconst clickHandler = () => {\n\t\tconst allowTabEditing = Store.getValue(\"allowTabEditing\");\n\n\t\tif (clickTimeout) {\n\t\t\t// double click\n\t\t\tif (allowTabEditing) {\n\t\t\t\tbeginEditing();\n\t\t\t}\n\t\t} else if (!editingTitle) {\n\t\t\t// single click\n\t\t\tlet timeout = setTimeout(() => {\n\t\t\t\tclearTimeout(clickTimeout);\n\t\t\t\tsetClickTimeout(undefined);\n\t\t\t}, 500);\n\t\t\tsetClickTimeout(timeout);\n\t\t\tif (props.setActiveTab) props.setActiveTab();\n\t\t}\n\t};\n\n\tconst blurHandler = (e: React.FocusEvent<HTMLInputElement>) => {\n\t\tupdateTabTitle(e);\n\t};\n\n\tconst keyDownHandler = (e: React.KeyboardEvent<HTMLInputElement>) => {\n\t\te.key === \"Enter\" && updateTabTitle(e);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"fsbl-tab-editor\"\n\t\t\t// We can't use Click and Dblclick events together cause for one dblclick fires two click events which close title editor.\n\t\t\t// Workaround with setTimeout should resolve this behavior.\n\t\t\tonClick={clickHandler}\n\t\t>\n\t\t\t{editingTitle ? (\n\t\t\t\t<div className=\"fsbl-tab fsbl-active-tab\" style={{ width: props.tabWidth || \"auto\" }}>\n\t\t\t\t\t{/* workaround to disable tab dragging in the edit mode */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tdraggable={true}\n\t\t\t\t\t\tonDragStart={(e) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref={inputEl}\n\t\t\t\t\t\t\tonBlur={blurHandler}\n\t\t\t\t\t\t\tonKeyDown={keyDownHandler}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclassName=\"tab__input\"\n\t\t\t\t\t\t\tmaxLength={32}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tprops.children\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\n/*\n * Description how stacked window tabs work.\n *\n * The simplest case - when you have only 2 tabs. In that case you will actually have 2 windows and 4 tabs.\n * Lets call them as: window 1 - w1, window 2 - w2, tab 1 from window 1 - w1_t1, tab 2 from window 1 - w1_t2, for tabs from window 2 - w2_t1 and w2_t2.\n * When you switch tabs you activate w1 or w2 with active tab w1_t1 or w2_t2 correspondingly.\n * Tabs w1_t2 and w2_t1 are inactive. They needed only for rendering. I call them as remote tabs, cause their titles must be synchronized with active tabs titles.\n * Thus when you rename active tab (w1_t1), the corresponding remote tab (w2_t1) should be updated automatically.\n */\n\nexport class Title extends Component<TitleProps, TitleState> {\n\t// The subscription for tab title change events via the DistributedStoreClient\n\ttabTitleChangedStoreSubscription: any;\n\n\tconstructor(props: TitleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\ttitle: props.windowIdentifier?.windowName || document.title,\n\t\t\ticon: null,\n\t\t\t// save active window name\n\t\t\twindowName: props.windowIdentifier?.windowName,\n\t\t};\n\n\t\t// Bind the \"updateTitle\" function (in order to use React component functions)\n\t\tthis.updateTitle = this.updateTitle.bind(this);\n\n\t\t// Invoke \"updateTitle\" to set the initial title\n\t\tthis.updateTitle();\n\t}\n\n\tasync updateTitle() {\n\t\t// happens when a stacked window loads\n\t\tif (!this.props?.windowIdentifier) {\n\t\t\t// Nothing to do here\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the window/tab store\n\t\tlet store = await getWindowTabNameStore(); // WT01 - Type \"store\"\n\t\t// Get the title for the tab represented by the window\n\t\tstore.getValue(this.props.windowIdentifier.windowName, async (err: any, res: any) => {\n\t\t\t// WT01 - Type \"err\" and \"res\"\n\t\t\tif (!!err) {\n\t\t\t\tFSBL.Clients.Logger.error(\n\t\t\t\t\t`Error getting the tab name from the store \"${WINDOW_TAB_TITLE_STORE}\" for the window \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The window represented by this tab title instance\n\t\t\tconst tabWindow = await getCorrespondingFinsembleWindow(this.props.windowIdentifier);\n\t\t\t// \"data\" refers to the options from the window which hosts the component represented by this tab\n\t\t\tconst { data } = await tabWindow.getOptions();\n\n\t\t\t// The title variable\n\t\t\tlet title = res;\n\n\t\t\t// If there is no title then use some logic to derive a title\n\t\t\tif (!title) {\n\t\t\t\t// This code runs when there is no tab name in the store. This happens when a workspace is loaded and\n\t\t\t\t// the workspace has stacked windows. In this case, fallback to:\n\t\t\t\t// 1.) the displayName from the manifest (there are TWO places to look in the manifest!)\n\t\t\t\t// 2.) the title from the WindowClient (this is only correct for the hosting tab!)\n\t\t\t\t// 3.) the title from the window title bar (this is only correct for the hosting tab!)\n\t\t\t\t// 4.) the name of the window which is hosting the window associated with the tab\n\t\t\t\t// 5.) the empty string\n\t\t\t\t//\n\t\t\t\t// Note that in most cases this name is temporarty since most components will update their title with\n\t\t\t\t// a call to \"document.title='...some title!'\"\n\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t`No stored tab tile for \"${this.props.windowIdentifier.windowName}\"; falling back to code-based derivation`\n\t\t\t\t);\n\n\t\t\t\t// \"options\" refers to the options from the window which hosts all the tabs (this will always be the currently active component/window)\n\t\t\t\tconst { options } = FSBL.Clients.WindowClient;\n\t\t\t\tconst windowTitleBarConfig = options?.customData?.foreign?.components[\"Window Manager\"];\n\n\t\t\t\t// Display name is the first candidate for the title\n\t\t\t\tconst displayName =\n\t\t\t\t\t// From the appd manifest\n\t\t\t\t\tdata?.customData?.appDConfig?.manifest?.component?.displayName ||\n\t\t\t\t\t// This seems like a default\n\t\t\t\t\tdata?.customData?.component?.displayName;\n\n\t\t\t\t// The title assignment\n\t\t\t\ttitle = displayName || FSBL.Clients.WindowClient.title || windowTitleBarConfig?.title || tabWindow.name || \"\";\n\t\t\t}\n\n\t\t\t// Get the icon from the config for the TAB window (not the CURRENT window)\n\t\t\tconst icon = iconFromConfig(data?.customData?.foreign?.components?.Toolbar, title);\n\n\t\t\t// Get the component state for THIS component (the tab title)\n\t\t\t// The field \"persistedTitle\" is set when a tab has been edited via EditTab\n\t\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t\tif (persistedTitle) {\n\t\t\t\t\ttitle = persistedTitle;\n\t\t\t\t}\n\t\t\t\tFSBL.Clients.Logger.debug(`Setting tab title ${title} for window ${this.props.windowIdentifier.windowName}`);\n\t\t\t\tthis.setState({\n\t\t\t\t\ttitle: title,\n\t\t\t\t\ticon: icon,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.updateTitle();\n\t\t// Subscribe to the DistributedStoreClient (these messages originate from BaseWindow or EventTab - when the DistributedStore has been updated)\n\t\tif (!!this.props.windowIdentifier) {\n\t\t\tgetWindowTabNameStore().then((store) => {\n\t\t\t\t// WT01 - Type \"store\"\n\t\t\t\tthis.tabTitleChangedStoreSubscription = (err: any, res: any) => {\n\t\t\t\t\t// WT01 - Type \"err\" and \"res\"\n\t\t\t\t\tif (!!err) {\n\t\t\t\t\t\t// This is not critical; in the worst case this tab title will be stale\n\t\t\t\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t\t\t\t`Listener error for store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\t\t\terr\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Log a message\n\t\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t\t`Store \"${WINDOW_TAB_TITLE_STORE}\" notified of new title \"${res.name}\" for window \"${res.field}\"`\n\t\t\t\t\t);\n\t\t\t\t\t// Invoke updateTitle\n\t\t\t\t\tthis.updateTitle();\n\t\t\t\t};\n\t\t\t\tstore.addListener(\n\t\t\t\t\t{ field: this.props.windowIdentifier.windowName },\n\t\t\t\t\tthis.tabTitleChangedStoreSubscription,\n\t\t\t\t\t(subErr: any, subRes: any) => {\n\t\t\t\t\t\t// WT01 - Type \"err\", \"res\", \"subErr\" and \"subRes\"\n\t\t\t\t\t\tif (!!subErr) {\n\t\t\t\t\t\t\t// This is not critical; in the worst case this tab title will be stale\n\t\t\t\t\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t\t\t\t\t`Could not add listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\t\t\t\tsubErr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t\t\t`Added listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\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\t}\n\n\t// Triggers a re-rendering of the drag handle in the title bar.\n\tcomponentDidUpdate() {\n\t\tif (typeof this.props.onUpdate === \"function\") {\n\t\t\tthis.props.onUpdate();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\t// Unsubscribe from the window/tab store\n\t\tgetWindowTabNameStore().then((store) => {\n\t\t\t// WT01 - Type \"store\"\n\t\t\tstore.removeListener(\n\t\t\t\t{ field: this.props.windowIdentifier.windowName },\n\t\t\t\tthis.tabTitleChangedStoreSubscription,\n\t\t\t\t(subErr: any, subRes: any) => {\n\t\t\t\t\t// WT01 - Type \"err\", \"res\", \"subErr\" and \"subRes\"\n\t\t\t\t\tif (!!subErr) {\n\t\t\t\t\t\t// This is not critical; the listener could not be removed from the store - this may be a memory leak\n\t\t\t\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t\t\t\t`Could not remove listener from store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\t\t\tsubErr\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t\t`Removed listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t}\n\n\trender() {\n\t\tconst { titleWidth } = this.props;\n\t\tconst style = titleWidth ? { width: titleWidth } : {};\n\t\treturn (\n\t\t\t<EditTab\n\t\t\t\ttabWidth={titleWidth}\n\t\t\t\tsetActiveTab={this?.props?.onClick}\n\t\t\t\ttitle={this.state.title}\n\t\t\t\twindowIdentifier={this.props.windowIdentifier}\n\t\t\t>\n\t\t\t\t<div className=\"fsbl-tab-title\" style={style}>\n\t\t\t\t\t{this.state.icon && <Icon {...this.state.icon} />}\n\t\t\t\t\t<div className=\"title-text\">{this.state.title}</div>\n\t\t\t\t</div>\n\t\t\t</EditTab>\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"windowTitle.js","sourceRoot":"","sources":["../../../../src/components/windowTitleBar/components/windowTitle.tsx"],"names":[],"mappings":";;;;;;AAGA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AA+CtD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAElD,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAOpD,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACxC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACrH,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAYF,MAAM,+BAA+B,GAAG,KAAK,EAAE,gBAAkC,EAA4B,EAAE,CAC9G,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;AAMjE,SAAS,OAAO,CAAC,KAAmB;IACnC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KA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BAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAC3G,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,2BAKD,KAAK;IAEJ,MAAM,KAAK,GAAG,MAAM,qBAAqB,EAAE,CAAC;IAE5C,IAAI,CAAC,KAAK,EAAE;QAEX,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QACzF,OAAO;KACP;IACD,KAAK,CAAC,cAAc,CACnB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,EACjD,IAAI,CAAC,4BAA4B,EACjC,CAAC,GAAkB,EAAE,QAA6B,EAAE,EAAE;QACrD,IAAI,CAAC,CAAC,GAAG,EAAE;YAEV,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CACvB,yCAAyC,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,EACxH,GAAG,CACH,CAAC;YACF,OAAO;SACP;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CACxB,8BAA8B,sBAAsB,gBAAgB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAC7G,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["import { FinsembleWindow, WindowIdentifier } from \"@finsemble/finsemble-api\";\nimport { ListenerFunction } from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport React, { Component } from \"react\";\nimport { EditTabProps } from \"../../../types/windowTitleBar\";\nimport { Icon } from \"../../icon/Icon\";\nimport { iconFromConfig } from \"../../icon/Icon\";\nimport { Store } from \"../stores/windowTitleBarStore\";\n\n/**\n * TAB TITLES: HOW DO THEY WORK?\n *\n * Each component, when stacked, will have several tab titles. For each component, there is a window. For each window, there are 2 tab titles per component.\n *\n * Whichever component is \"active\" will render all tabs - exactly one \"active\" tab and n-1 \"inactive\" tabs (where n is the number of components in the stack). When\n * the active component is changed (via a click, for example), then the visible window becomes the window associated with the active component.\n *\n * Tab titles may change at any time, and for a number of reasons. For example, the component may execute \"document.title='...some title'\". Or perhaps the tab title has\n * been edited by the user. In order to account for all title changes, the following flow is used:\n * *something* updates document.title\n * The WindowClient for the component will notice the title change and send a router message (via FinsembleWindow.setTitle) with a topic representitive of the windowName\n * BaseWindow listens to router changes on the same topic and updates a DistributedStore dedicated to tab names\n * The tab components all subscribe to the DistributedStore dedicated to tab names and will update the title accordingly\n *\n * This is a \"one-way\" operation; that is to say that some code will ultimately alter the DistributedStore and the tab title components will read the changes. While this generally\n * happens with a write to document.title, it can also happen when a user edits the tab title manually. In this case, the component state is altered with a field \"persistedTitle\"\n * whose value is the edited title. At render time, the tab title component will use any value in \"persistedTitle\" as the title, irregardless of any other value.\n *\n * NOTE: A tab may be edited only when it is the active component; ergo the call to \"setComponentState\" is safe.\n */\n\n/**\n * WINDOW TITLES: HOW DO THEY WORK?\n *\n * Each application window has a title which is displayed in the operating system taskbar and task switcher. This title comes from the\n * value of \"document.title\" in the window title bar component. It is important to understand that when tabs are stacked, the actual window\n * which holds the window title is the title of the window of the active component. It is therefore important to keep the window title and the\n * tab titles up to date and synchronized.\n */\n\ntype TitleProps = {\n\twindowIdentifier: WindowIdentifier;\n\tonUpdate?: Function;\n\ttitleWidth?: number;\n\tonClick?: () => void;\n};\n\ntype TitleState = {\n\ttitle: string | undefined;\n\ticon: any;\n\twindowName?: string;\n};\n\n// The store name for the distributed store which tracks tab titles\nconst WINDOW_TAB_TITLE_STORE = \"window-tab-title\";\n// The field name to watch for tab title edits\nconst FIELD_NAME_PERSISTED_TITLE = \"persistedTitle\";\n\n/**\n * Gets the store which tracks the tab title for a windowName. This is a distributed store shared by all components.\n *\n * @returns a Promise which resolves the StoreModel associated with window and tab names\n */\nconst getWindowTabNameStore = async () => {\n\tlet { data: store } = await FSBL.Clients.DistributedStoreClient.createGlobalStore({ store: WINDOW_TAB_TITLE_STORE });\n\treturn store;\n};\n\n/**\n * Gets the FinsembleWindow instance associated with the specified <i>windowIdentifier</i>.\n *\n * Any instance of this component (a tab title) will actually be in the window of the \"active\"\n * tab; this function will return the FinsembleWindow instance for which this tab title instance\n * represents.\n *\n * @param windowIdentifier the windowIdentifier for the FinsembleWindow to obtain a reference for\n * @returns a Promise which resolves to the FinsembleWindow associated with the <i>windowIdentifier</i>\n */\nconst getCorrespondingFinsembleWindow = async (windowIdentifier: WindowIdentifier): Promise<FinsembleWindow> =>\n\t(await FSBL.FinsembleWindow.getInstance(windowIdentifier)).wrap;\n\n/**\n * The wrapper component for tab renaming\n * @param {*} props\n */\nfunction EditTab(props: EditTabProps) {\n\tconst [editingTitle, setEditingTitle] = React.useState(false);\n\tconst [clickTimeout, setClickTimeout] = React.useState<NodeJS.Timeout | undefined>(undefined);\n\tconst inputEl = React.useRef<HTMLInputElement>(null);\n\n\tconst updateTabTitle = async (e: React.KeyboardEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement>) => {\n\t\t// When the tab title has changed via a user edit, simply update the DistributedStore\n\n\t\t// Get the title\n\t\tconst title = (e.target as HTMLInputElement).value;\n\n\t\t// Get the tab name store\n\t\tlet store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be persisted\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error persisting tab title via EditTab: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Persist the tab title\n\t\tstore.setValue({ field: props.windowIdentifier.windowName, value: title });\n\n\t\t// Get the window which coresponds to the tab being edited\n\t\tlet win = await getCorrespondingFinsembleWindow(props.windowIdentifier);\n\n\t\t// Set the component state \"persistedTitle\" (which is the edited title)\n\t\tFSBL.Clients.Logger.debug(`Setting component state \"${FIELD_NAME_PERSISTED_TITLE}\" with value \"${title}\"`);\n\t\tawait win.setComponentState({ field: FIELD_NAME_PERSISTED_TITLE, value: title });\n\n\t\t// Stop editing in all cases\n\t\tsetEditingTitle(false);\n\t};\n\n\tconst beginEditing = async () => {\n\t\tawait setEditingTitle(true);\n\t\tawait inputEl?.current?.focus();\n\t\tif (inputEl?.current) {\n\t\t\tinputEl.current.value = props.title ?? \"\";\n\t\t}\n\t};\n\n\tconst clickHandler = () => {\n\t\tconst allowTabEditing = Store.getValue(\"allowTabEditing\");\n\n\t\tif (clickTimeout) {\n\t\t\t// double click\n\t\t\tif (allowTabEditing) {\n\t\t\t\tbeginEditing();\n\t\t\t}\n\t\t} else if (!editingTitle) {\n\t\t\t// single click\n\t\t\tlet timeout = setTimeout(() => {\n\t\t\t\tclearTimeout(clickTimeout);\n\t\t\t\tsetClickTimeout(undefined);\n\t\t\t}, 500);\n\t\t\tsetClickTimeout(timeout);\n\t\t\tif (props.setActiveTab) props.setActiveTab();\n\t\t}\n\t};\n\n\tconst blurHandler = (e: React.FocusEvent<HTMLInputElement>) => {\n\t\tupdateTabTitle(e);\n\t};\n\n\tconst keyDownHandler = (e: React.KeyboardEvent<HTMLInputElement>) => {\n\t\te.key === \"Enter\" && updateTabTitle(e);\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"fsbl-tab-editor\"\n\t\t\t// We can't use Click and Dblclick events together cause for one dblclick fires two click events which close title editor.\n\t\t\t// Workaround with setTimeout should resolve this behavior.\n\t\t\tonClick={clickHandler}\n\t\t>\n\t\t\t{editingTitle ? (\n\t\t\t\t<div className=\"fsbl-tab fsbl-active-tab\" style={{ width: props.tabWidth || \"auto\" }}>\n\t\t\t\t\t{/* workaround to disable tab dragging in the edit mode */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tdraggable={true}\n\t\t\t\t\t\tonDragStart={(e) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref={inputEl}\n\t\t\t\t\t\t\tonBlur={blurHandler}\n\t\t\t\t\t\t\tonKeyDown={keyDownHandler}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclassName=\"tab__input\"\n\t\t\t\t\t\t\tmaxLength={32}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tprops.children\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\n/*\n * Description how stacked window tabs work.\n *\n * The simplest case - when you have only 2 tabs. In that case you will actually have 2 windows and 4 tabs.\n * Lets call them as: window 1 - w1, window 2 - w2, tab 1 from window 1 - w1_t1, tab 2 from window 1 - w1_t2, for tabs from window 2 - w2_t1 and w2_t2.\n * When you switch tabs you activate w1 or w2 with active tab w1_t1 or w2_t2 correspondingly.\n * Tabs w1_t2 and w2_t1 are inactive. They needed only for rendering. I call them as remote tabs, cause their titles must be synchronized with active tabs titles.\n * Thus when you rename active tab (w1_t1), the corresponding remote tab (w2_t1) should be updated automatically.\n */\n\nexport class Title extends Component<TitleProps, TitleState> {\n\t// The listener for tab title change events via the DistributedStoreClient, kept as a reference so\n\t// that the listener can be deregistered when the component is unmounted\n\ttabTitleChangedStoreListener: ListenerFunction = (err: StandardError, response: { field: string; value: string }) => {\n\t\tif (!!err) {\n\t\t\t// This is not critical; in the worst case this tab title will be stale\n\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t`Listener error for store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\terr\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Log a message\n\t\tFSBL.Clients.Logger.debug(\n\t\t\t`Store \"${WINDOW_TAB_TITLE_STORE}\" notified of new title \"${response.value}\" for window \"${response.field}\"`\n\t\t);\n\n\t\t// Invoke updateTitle\n\t\tthis.updateTitle();\n\t};\n\n\t// Flag to determine if this instance is currently mounted; this is necessary because:\n\t// 1.) Title components are mounted and unmounted as an artifact of how the tab or tab list is rendered\n\t// 2.) Keeping tab titles synchronized is an asynchronous process\n\t// 3.) During the asynchronous process of tab title synchronization, a call to setState is made and\n\t// that raises a React warning since the component state cannot be changed while the component\n\t// is unmounted\n\t_mounted = false;\n\n\tconstructor(props: TitleProps) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\ttitle: props.windowIdentifier?.windowName || document.title,\n\t\t\ticon: null,\n\t\t\t// The \"windowName\" is the name of the window which corresponds to the this instance of the\n\t\t\t// Title component, though the actual current window may belong to some other\n\t\t\t// component(ie this tab represents an inactive window)\n\t\t\twindowName: props.windowIdentifier?.windowName,\n\t\t};\n\n\t\t// Bind the \"updateTitle\" function (in order to use React component functions)\n\t\tthis.updateTitle = this.updateTitle.bind(this);\n\t}\n\n\t/**\n\t * Sets the title of the window.\n\t *\n\t * @param title the window title\n\t */\n\t#setWindowTitle(title: string) {\n\t\tdocument.title = title;\n\t}\n\n\t/**\n\t * Sets the title of the tab.\n\t *\n\t * @param title the title of the tab\n\t */\n\tasync #setTabTitle(title: string) {\n\t\t// The window represented by this tab title instance\n\t\tconst tabWindow = await getCorrespondingFinsembleWindow(this.props.windowIdentifier);\n\t\t// \"tabWindowOptions\" refers to the options from the window which hosts the component represented by this tab\n\t\tconst { data: tabWindowOptions } = await tabWindow.getOptions();\n\n\t\t// If there is no title then use some logic to derive a title\n\t\tif (!title) {\n\t\t\t// This code runs when there is no tab name in the store. This happens when a workspace is loaded and\n\t\t\t// the workspace has stacked windows. In this case, fallback to:\n\t\t\t// 1.) the displayName from the manifest (there are TWO places to look in the manifest!)\n\t\t\t// 2.) the title from the WindowClient (this is only correct for the hosting tab!)\n\t\t\t// 3.) the title from the window title bar (this is only correct for the hosting tab!)\n\t\t\t// 4.) the name of the window which is hosting the window associated with the tab\n\t\t\t// 5.) the empty string\n\t\t\t//\n\t\t\t// Note that in most cases this name is temporarty since most components will update their title with\n\t\t\t// a call to \"document.title='...some title!'\"\n\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t`No stored tab tile for \"${this.props.windowIdentifier.windowName}\"; falling back to code-based derivation`\n\t\t\t);\n\n\t\t\t// \"windowClientOptions\" refers to the options from the window which hosts\n\t\t\t// all the tabs (this will always be the currently active component / window)\n\t\t\tconst { options: windowClientOptions } = FSBL.Clients.WindowClient;\n\t\t\tconst windowTitleBarConfig = windowClientOptions?.customData?.foreign?.components[\"Window Manager\"];\n\n\t\t\t// Display name is the first candidate for the title\n\t\t\tconst displayName =\n\t\t\t\t// From the appd manifest\n\t\t\t\ttabWindowOptions?.customData?.appDConfig?.manifest?.component?.displayName ||\n\t\t\t\t// This seems like a default\n\t\t\t\ttabWindowOptions?.customData?.component?.displayName;\n\n\t\t\t// The title assignment\n\t\t\ttitle = displayName || FSBL.Clients.WindowClient.title || windowTitleBarConfig?.title || tabWindow.name || \"\";\n\t\t}\n\n\t\t// Get the icon from the config for the TAB window (not the CURRENT window)\n\t\tconst icon = iconFromConfig(tabWindowOptions?.customData?.foreign?.components?.Toolbar, title);\n\n\t\t// Get the component state for THIS component (the tab title)\n\t\t// The field \"persistedTitle\" is set when a tab has been edited via EditTab\n\t\ttabWindow.getComponentState({ field: FIELD_NAME_PERSISTED_TITLE }, (error: any, persistedTitle: any) => {\n\t\t\t// When the component is being mounted/unmounted quickly, this code may be run during a time when\n\t\t\t// the component is not mounted. This check prevents React warnings in the dev console.\n\t\t\tif (!this._mounted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a \"persistedTitle\" then the title has been edited by a user\n\t\t\tif (persistedTitle) {\n\t\t\t\t// Set the title to the edited title\n\t\t\t\ttitle = persistedTitle;\n\t\t\t}\n\t\t\tFSBL.Clients.Logger.debug(`Setting tab title ${title} for window ${this.props.windowIdentifier.windowName}`);\n\n\t\t\t// Finally, set the state\n\t\t\tthis.setState({\n\t\t\t\ttitle: title,\n\t\t\t\ticon: icon,\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Updates the title for both the tab and the window.\n\t *\n\t * @returns a Promise which resolves nothing\n\t */\n\tasync updateTitle() {\n\t\t// Get the store (which holds the values for the tab titles)\n\t\tconst store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error setting the tab title: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// The FinsembleWindow which represents the current window\n\t\tconst { data: windowTitle } = await store.getGlobalValue(finsembleWindow.thisWindowName);\n\t\t// The FinsembleWindow instance which this Title component represents\n\t\tconst { data: tabTitle } = await store.getGlobalValue(this.props.windowIdentifier.windowName);\n\n\t\t// There is a subtle difference bewtween windowTitle and tabTitle. Since this code executes\n\t\t// when *any* tab has a name change, this code can execute when the active window represents\n\t\t// a tab other than the currently rendering tab (ie an inactive tab).\n\n\t\tthis.#setTabTitle(tabTitle);\n\t\tthis.#setWindowTitle(windowTitle);\n\t}\n\n\t/**\n\t * Adds the listener(s) required to set window and tab titles.\n\t */\n\tasync #addListeners() {\n\t\t// Subscribe to the DistributedStoreClient (these messages originate from BaseWindow, when the\n\t\t// DistributedStore has been updated).\n\t\t//\n\t\t// Each window will have n listeners, where n is the number of tabs held in the window.\n\n\t\t// Get the store and add a listener\n\t\tconst store = await getWindowTabNameStore();\n\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error adding a tab title listener: the store was not found\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Add a listener\n\t\tstore.addListener({ field: this.props.windowIdentifier.windowName }, this.tabTitleChangedStoreListener, () => {\n\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t`Added listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Removes listener(s) required to set window and tab titles.\n\t */\n\tasync #removeListeners() {\n\t\t// Unsubscribe from the window/tab store\n\t\tconst store = await getWindowTabNameStore();\n\t\t// If the store is unavailable, then the tab name cannot be updated\n\t\tif (!store) {\n\t\t\t// This is not critical, but tab titles may be stale\n\t\t\tFSBL.Clients.Logger.warn(\"Error removing a tab title listener: the store was not found\");\n\t\t\treturn;\n\t\t}\n\t\tstore.removeListener(\n\t\t\t{ field: this.props.windowIdentifier.windowName },\n\t\t\tthis.tabTitleChangedStoreListener,\n\t\t\t(err: StandardError, response: boolean | undefined) => {\n\t\t\t\tif (!!err) {\n\t\t\t\t\t// This is not critical; the listener could not be removed from the store - this may be a memory leak\n\t\t\t\t\tFSBL.Clients.Logger.warn(\n\t\t\t\t\t\t`Could not remove listener from store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`,\n\t\t\t\t\t\terr\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tFSBL.Clients.Logger.debug(\n\t\t\t\t\t`Removed listener to store \"${WINDOW_TAB_TITLE_STORE}\" for field \"${this.props.windowIdentifier.windowName}\"`\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * React component lifecycle event, triggered once the component has been added to the DOM.\n\t */\n\tcomponentDidMount() {\n\t\t// Set the mounted flag to true (this component is currently mounted)\n\t\tthis._mounted = true;\n\n\t\t// Add listeners\n\t\tthis.#addListeners();\n\t}\n\n\t// Triggers a re-rendering of the drag handle in the title bar.\n\tcomponentDidUpdate() {\n\t\tif (typeof this.props.onUpdate === \"function\") {\n\t\t\tthis.props.onUpdate();\n\t\t}\n\t}\n\n\t/**\n\t * React component lifecycle event, triggered before the component is removed from the DOM.\n\t */\n\tcomponentWillUnmount() {\n\t\t// Set the mounted flag to false (this component is not currently mounted)\n\t\tthis._mounted = false;\n\n\t\t// Remove listeners\n\t\tthis.#removeListeners();\n\t}\n\n\trender() {\n\t\tconst { titleWidth } = this.props;\n\t\tconst style = titleWidth ? { width: titleWidth } : {};\n\t\treturn (\n\t\t\t<EditTab\n\t\t\t\ttabWidth={titleWidth}\n\t\t\t\tsetActiveTab={this?.props?.onClick}\n\t\t\t\ttitle={this.state.title}\n\t\t\t\t// The windowIdentifier indicates which app/component this tab instance should represent\n\t\t\t\twindowIdentifier={this.props.windowIdentifier}\n\t\t\t>\n\t\t\t\t<div className=\"fsbl-tab-title\" style={style}>\n\t\t\t\t\t{this.state.icon && <Icon {...this.state.icon} />}\n\t\t\t\t\t<div className=\"title-text\">{this.state.title}</div>\n\t\t\t\t</div>\n\t\t\t</EditTab>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StandardCallback } from "@finsemble/finsemble-
|
|
2
|
-
import { FinsembleWindow, WindowIdentifier } from "@finsemble/finsemble-
|
|
3
|
-
import StoreModel from "@finsemble/finsemble-
|
|
1
|
+
import { StandardCallback } from "@finsemble/finsemble-api/types/types";
|
|
2
|
+
import { FinsembleWindow, WindowIdentifier } from "@finsemble/finsemble-api";
|
|
3
|
+
import StoreModel from "@finsemble/finsemble-api/types/clients/StoreModel";
|
|
4
4
|
declare type ParentParams = {
|
|
5
5
|
windowIdentifiers: WindowIdentifier[];
|
|
6
6
|
visibleWindowIdentifier: WindowIdentifier;
|
|
@@ -29,237 +29,233 @@ const getStackedWindow = (params, cb) => {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
let windowTitleBarStore;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
32
|
+
const onDockingGroupUpdate = (err, response) => {
|
|
33
|
+
if (err || !response.data || !response.data.groupData) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
FSBL.Clients.Logger.system.debug("On docking group update", response.data.groupData);
|
|
37
|
+
let groupNames = Object.keys(response.data.groupData);
|
|
38
|
+
let movableGroups = groupNames
|
|
39
|
+
.filter((groupName) => response.data.groupData[groupName].isMovable)
|
|
40
|
+
.map((groupName) => response.data.groupData[groupName]);
|
|
41
|
+
windowTitleBarStore.setValue({
|
|
42
|
+
field: "Main.allDockingGroups",
|
|
43
|
+
value: response.data.groupData,
|
|
44
|
+
});
|
|
45
|
+
windowTitleBarStore.setValue({
|
|
46
|
+
field: "Main.allMovableDockingGroups",
|
|
47
|
+
value: movableGroups,
|
|
48
|
+
});
|
|
49
|
+
let myGroups = Actions.getMyDockingGroups(response.data.groupData);
|
|
50
|
+
windowTitleBarStore.setValue({
|
|
51
|
+
field: "Main.dockingGroups",
|
|
52
|
+
value: myGroups,
|
|
53
|
+
});
|
|
54
|
+
let isSnapped = false;
|
|
55
|
+
let isInMovableGroup = false;
|
|
56
|
+
let isTopRight = false;
|
|
57
|
+
let windowName = getWindowNameForDocking(finsembleWindow);
|
|
58
|
+
for (let i = 0; i < myGroups.length; i++) {
|
|
59
|
+
let myGroup = myGroups[i];
|
|
60
|
+
if (myGroup.isMovable) {
|
|
61
|
+
isInMovableGroup = true;
|
|
62
|
+
if (windowName == myGroup.topRightWindow) {
|
|
63
|
+
isTopRight = true;
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (response.channels) {
|
|
65
|
-
windowTitleBarStore.setValue({
|
|
66
|
-
field: "Linker.channels",
|
|
67
|
-
value: response.channels,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
windowTitleBarStore.setValue({
|
|
71
|
-
field: "Linker.showLinkerButton",
|
|
72
|
-
value: true,
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
cb(null, FSBL.Clients.LinkerClient.getState());
|
|
76
|
-
FSBL.Clients.LinkerClient.onStateChange(cb);
|
|
66
|
+
else {
|
|
67
|
+
isSnapped = true;
|
|
77
68
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
}
|
|
70
|
+
let icon = false;
|
|
71
|
+
if (isSnapped) {
|
|
72
|
+
icon = "joiner";
|
|
73
|
+
}
|
|
74
|
+
if (isInMovableGroup) {
|
|
75
|
+
icon = "ejector";
|
|
76
|
+
}
|
|
77
|
+
windowTitleBarStore.setValues([
|
|
78
|
+
{ field: "isSnapped", value: isSnapped },
|
|
79
|
+
{ field: "isGrouped", value: isInMovableGroup },
|
|
80
|
+
{ field: "isTopRight", value: isTopRight },
|
|
81
|
+
{ field: "Main.dockingIcon", value: icon },
|
|
82
|
+
]);
|
|
83
|
+
};
|
|
84
|
+
const listenForDNDUpdates = () => {
|
|
85
|
+
FSBL.Clients.RouterClient.subscribe(`${FSBL.Clients.WindowClient.options.name}Finsemble.Sharer`, (err, response) => {
|
|
86
|
+
if (err) {
|
|
87
|
+
return console.error(err);
|
|
88
|
+
}
|
|
89
|
+
windowTitleBarStore.setValues([
|
|
90
|
+
{
|
|
91
|
+
field: "Sharer.emitterEnabled",
|
|
92
|
+
value: response.data.emitterEnabled,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
field: "Sharer.receiverEnabled",
|
|
96
|
+
value: response.data.receiverEnabled,
|
|
97
|
+
},
|
|
98
|
+
]);
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const showLinkerButton = () => {
|
|
102
|
+
const cb = (err, response) => {
|
|
103
|
+
if (response.channels) {
|
|
104
|
+
windowTitleBarStore.setValue({
|
|
105
|
+
field: "Linker.channels",
|
|
106
|
+
value: response.channels,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
windowTitleBarStore.setValue({
|
|
110
|
+
field: "Linker.showLinkerButton",
|
|
111
|
+
value: true,
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
cb(null, FSBL.Clients.LinkerClient.getState());
|
|
115
|
+
FSBL.Clients.LinkerClient.onStateChange(cb);
|
|
116
|
+
};
|
|
117
|
+
const processInitialTabList = (err, values) => {
|
|
118
|
+
const onParentSet = () => {
|
|
119
|
+
Actions.parentWrapper = null;
|
|
120
|
+
Actions.getInitialTabList(() => {
|
|
121
|
+
FSBL.Clients.Logger.system.debug("docking group update after initial tab list");
|
|
122
|
+
onDockingGroupUpdate(null, {
|
|
123
|
+
data: {
|
|
124
|
+
groupData: windowTitleBarStore.getValue({
|
|
125
|
+
field: "Main.allDockingGroups",
|
|
126
|
+
}),
|
|
90
127
|
},
|
|
91
|
-
|
|
128
|
+
});
|
|
92
129
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
130
|
+
};
|
|
131
|
+
const onParentCleared = () => {
|
|
132
|
+
Actions.parentWrapper = null;
|
|
133
|
+
FSBL.Clients.Logger.system.debug("ClearParent, setting tabs to null");
|
|
134
|
+
Actions.stopListeningOnParentWrapper(() => {
|
|
135
|
+
Actions.parentWrapperStore = null;
|
|
136
|
+
Actions._setTabs(null);
|
|
137
|
+
onDockingGroupUpdate(null, {
|
|
138
|
+
data: {
|
|
139
|
+
groupData: windowTitleBarStore.getValue({
|
|
140
|
+
field: "Main.allDockingGroups",
|
|
141
|
+
}),
|
|
142
|
+
},
|
|
105
143
|
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
finsembleWindow === null || finsembleWindow === void 0 ? void 0 : finsembleWindow.addListener("setParent", onParentSet);
|
|
147
|
+
finsembleWindow === null || finsembleWindow === void 0 ? void 0 : finsembleWindow.addListener("clearParent", onParentCleared);
|
|
148
|
+
if (err) {
|
|
149
|
+
return FSBL.Clients.Logger.system.error("Error in getInitialTabList.", err);
|
|
150
|
+
}
|
|
151
|
+
if (values)
|
|
152
|
+
Actions._setTabs(values);
|
|
153
|
+
};
|
|
154
|
+
const processFSBLHeader = (FSBLHeader, windowTitleBarConfig, options) => {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
const displayName = (_b = (_a = options.customData) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.displayName;
|
|
157
|
+
const max = !!FSBLHeader.hideMaximize;
|
|
158
|
+
windowTitleBarStore.setValues([
|
|
159
|
+
{ field: "Maximize.hide", value: max },
|
|
160
|
+
{ field: "Minimize.hide", value: !!FSBLHeader.hideMinimize },
|
|
161
|
+
{ field: "Close.hide", value: !!FSBLHeader.hideClose },
|
|
162
|
+
{ field: "AlwaysOnTop.show", value: !!FSBLHeader.alwaysOnTop },
|
|
163
|
+
]);
|
|
164
|
+
windowTitleBarStore.setValue({
|
|
165
|
+
field: "hackScrollbar",
|
|
166
|
+
value: windowTitleBarConfig.hackScrollbar !== false,
|
|
167
|
+
});
|
|
168
|
+
const title = FSBL.Clients.WindowClient.title || windowTitleBarConfig.title || displayName;
|
|
169
|
+
if (title) {
|
|
170
|
+
document.title = title;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const getOptionsCallback = (err, opts) => {
|
|
174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
175
|
+
const windowAllowTabbing = (_d = (_c = (_b = (_a = opts.customData) === null || _a === void 0 ? void 0 : _a.foreign) === null || _b === void 0 ? void 0 : _b.services) === null || _c === void 0 ? void 0 : _c.windowService) === null || _d === void 0 ? void 0 : _d.allowTabbing;
|
|
176
|
+
const windowIgnoreTabbing = (_h = (_g = (_f = (_e = opts.customData) === null || _e === void 0 ? void 0 : _e.foreign) === null || _f === void 0 ? void 0 : _f.services) === null || _g === void 0 ? void 0 : _g.windowService) === null || _h === void 0 ? void 0 : _h.ignoreTilingAndTabbingRequests;
|
|
177
|
+
const dockingAllowTabbing = (_m = (_l = (_k = (_j = opts.customData) === null || _j === void 0 ? void 0 : _j.foreign) === null || _k === void 0 ? void 0 : _k.services) === null || _l === void 0 ? void 0 : _l.dockingService) === null || _m === void 0 ? void 0 : _m.allowTabbing;
|
|
178
|
+
const dockingIgnoreTabbing = (_q = (_p = (_o = opts.customData) === null || _o === void 0 ? void 0 : _o.foreign.services) === null || _p === void 0 ? void 0 : _p.dockingService) === null || _q === void 0 ? void 0 : _q.ignoreTilingAndTabbingRequests;
|
|
179
|
+
const dontShowTabs = windowAllowTabbing === false ||
|
|
180
|
+
windowIgnoreTabbing === true ||
|
|
181
|
+
dockingAllowTabbing === false ||
|
|
182
|
+
dockingIgnoreTabbing === true;
|
|
183
|
+
windowTitleBarStore.setValue({
|
|
184
|
+
field: "showTabs",
|
|
185
|
+
value: !dontShowTabs,
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
const processFEAAndFinsembleConfig = (values, windowTitleBarConfig) => {
|
|
189
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
190
|
+
const finsembleConfig = values.finsemble;
|
|
191
|
+
const { useDOMBasedMovement } = values["finsemble-electron-adapter"];
|
|
192
|
+
windowTitleBarStore.setValue({
|
|
193
|
+
field: "Main.useDOMBasedMovement",
|
|
194
|
+
value: typeof useDOMBasedMovement === "undefined" ? true : useDOMBasedMovement,
|
|
195
|
+
});
|
|
196
|
+
const globalWindowManagerConfig = finsembleConfig["Window Manager"] || {
|
|
197
|
+
alwaysOnTopIcon: false,
|
|
198
|
+
showTabs: false,
|
|
199
|
+
};
|
|
200
|
+
finsembleConfig.servicesConfig = (_a = finsembleConfig.servicesConfig) !== null && _a !== void 0 ? _a : {};
|
|
201
|
+
const defaultDockingConfig = {
|
|
202
|
+
enabled: true,
|
|
203
|
+
};
|
|
204
|
+
let dockingConfig = (_e = (_c = (_b = finsembleConfig.servicesConfig.docking) !== null && _b !== void 0 ? _b : finsembleConfig.docking) !== null && _c !== void 0 ? _c : (_d = finsembleConfig.betaFeatures) === null || _d === void 0 ? void 0 : _d.docking) !== null && _e !== void 0 ? _e : defaultDockingConfig;
|
|
205
|
+
dockingConfig.tabbing = (_f = dockingConfig.tabbing) !== null && _f !== void 0 ? _f : {};
|
|
206
|
+
windowTitleBarStore.setValues([{ field: "Main.dockingEnabled", value: dockingConfig.enabled }]);
|
|
207
|
+
const alwaysOnTopIcon = (_h = (_g = windowTitleBarConfig.alwaysOnTopIcon) !== null && _g !== void 0 ? _g : globalWindowManagerConfig.alwaysOnTopIcon) !== null && _h !== void 0 ? _h : false;
|
|
208
|
+
windowTitleBarStore.setValues([{ field: "AlwaysOnTop.show", value: alwaysOnTopIcon }]);
|
|
209
|
+
if (dockingConfig.tabbing.enabled === false) {
|
|
210
|
+
windowTitleBarStore.setValue({
|
|
211
|
+
field: "showTabs",
|
|
212
|
+
value: dockingConfig.tabbing.enabled,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
windowTitleBarStore.setValue({
|
|
217
|
+
field: "allowTabEditing",
|
|
218
|
+
value: dockingConfig.tabbing.allowEditing !== undefined ? dockingConfig.tabbing.allowEditing : true,
|
|
219
|
+
});
|
|
220
|
+
if (typeof windowTitleBarConfig.showTabs !== "boolean") {
|
|
106
221
|
windowTitleBarStore.setValue({
|
|
107
|
-
field: "
|
|
108
|
-
value:
|
|
222
|
+
field: "showTabs",
|
|
223
|
+
value: globalWindowManagerConfig.showTabs,
|
|
109
224
|
});
|
|
110
|
-
|
|
225
|
+
}
|
|
226
|
+
if (windowTitleBarConfig.showTabs || windowTitleBarConfig.showTabs === false) {
|
|
111
227
|
windowTitleBarStore.setValue({
|
|
112
|
-
field: "
|
|
113
|
-
value:
|
|
228
|
+
field: "showTabs",
|
|
229
|
+
value: windowTitleBarConfig.showTabs,
|
|
114
230
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
let icon = false;
|
|
132
|
-
if (isSnapped) {
|
|
133
|
-
icon = "joiner";
|
|
134
|
-
}
|
|
135
|
-
if (isInMovableGroup) {
|
|
136
|
-
icon = "ejector";
|
|
137
|
-
}
|
|
138
|
-
windowTitleBarStore.setValues([
|
|
139
|
-
{ field: "isSnapped", value: isSnapped },
|
|
140
|
-
{ field: "isGrouped", value: isInMovableGroup },
|
|
141
|
-
{ field: "isTopRight", value: isTopRight },
|
|
142
|
-
{ field: "Main.dockingIcon", value: icon },
|
|
143
|
-
]);
|
|
144
|
-
};
|
|
231
|
+
}
|
|
232
|
+
finsembleWindow.getOptions(getOptionsCallback);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
let constants;
|
|
236
|
+
const Actions = {
|
|
237
|
+
parentWrapperStore: null,
|
|
238
|
+
initialize: () => {
|
|
239
|
+
const { options } = FSBL.Clients.WindowClient;
|
|
240
|
+
const windowTitleBarConfig = options.customData.foreign.components["Window Manager"];
|
|
241
|
+
const { FSBLHeader } = windowTitleBarConfig;
|
|
242
|
+
if (FSBLHeader)
|
|
243
|
+
processFSBLHeader(FSBLHeader, windowTitleBarConfig, options);
|
|
244
|
+
if (windowTitleBarConfig.showLinker)
|
|
245
|
+
showLinkerButton();
|
|
246
|
+
listenForDNDUpdates();
|
|
145
247
|
FSBL.Clients.RouterClient.subscribe("Finsemble.WorkspaceService.groupUpdate", onDockingGroupUpdate);
|
|
146
248
|
windowTitleBarStore.setValue({
|
|
147
249
|
field: "Main.windowTitle",
|
|
148
250
|
value: FSBL.Clients.WindowClient.getWindowTitle(),
|
|
149
251
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
let globalWindowManagerConfig = finsembleConfig["Window Manager"] || {
|
|
158
|
-
alwaysOnTopIcon: false,
|
|
159
|
-
showTabs: false,
|
|
160
|
-
};
|
|
161
|
-
if (!finsembleConfig.servicesConfig)
|
|
162
|
-
finsembleConfig.servicesConfig = {};
|
|
163
|
-
let dockingConfig = finsembleConfig.servicesConfig.docking || finsembleConfig.docking;
|
|
164
|
-
if (!dockingConfig && finsembleConfig.betaFeatures)
|
|
165
|
-
dockingConfig = finsembleConfig.betaFeatures.docking;
|
|
166
|
-
if (!dockingConfig)
|
|
167
|
-
dockingConfig = { enabled: true };
|
|
168
|
-
if (!dockingConfig.tabbing)
|
|
169
|
-
dockingConfig.tabbing = {};
|
|
170
|
-
windowTitleBarStore.setValues([{ field: "Main.dockingEnabled", value: dockingConfig.enabled }]);
|
|
171
|
-
let { alwaysOnTopIcon } = globalWindowManagerConfig;
|
|
172
|
-
if (windowTitleBarConfig.alwaysOnTopIcon === false || windowTitleBarConfig.alwaysOnTopIcon === true)
|
|
173
|
-
({ alwaysOnTopIcon } = windowTitleBarConfig);
|
|
174
|
-
windowTitleBarStore.setValues([{ field: "AlwaysOnTop.show", value: alwaysOnTopIcon }]);
|
|
175
|
-
if (dockingConfig.tabbing.enabled === false) {
|
|
176
|
-
windowTitleBarStore.setValue({
|
|
177
|
-
field: "showTabs",
|
|
178
|
-
value: dockingConfig.tabbing.enabled,
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
windowTitleBarStore.setValue({
|
|
183
|
-
field: "allowTabEditing",
|
|
184
|
-
value: dockingConfig.tabbing.allowEditing !== undefined ? dockingConfig.tabbing.allowEditing : true,
|
|
185
|
-
});
|
|
186
|
-
if (typeof windowTitleBarConfig.showTabs !== "boolean") {
|
|
187
|
-
windowTitleBarStore.setValue({
|
|
188
|
-
field: "showTabs",
|
|
189
|
-
value: globalWindowManagerConfig.showTabs,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
if (windowTitleBarConfig.showTabs || windowTitleBarConfig.showTabs === false) {
|
|
193
|
-
windowTitleBarStore.setValue({
|
|
194
|
-
field: "showTabs",
|
|
195
|
-
value: windowTitleBarConfig.showTabs,
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
let showTabs = true;
|
|
199
|
-
const getOptionsCallback = (_, opts) => {
|
|
200
|
-
if (opts.customData && opts.customData.foreign && opts.customData.foreign.services) {
|
|
201
|
-
if (opts.customData.foreign.services.windowService) {
|
|
202
|
-
if (opts.customData.foreign.services.windowService.allowTabbing !== undefined) {
|
|
203
|
-
showTabs = opts.customData.foreign.services.windowService.allowTabbing;
|
|
204
|
-
}
|
|
205
|
-
else if (opts.customData.foreign.services.windowService.ignoreTilingAndTabbingRequests != undefined) {
|
|
206
|
-
showTabs = !opts.customData.foreign.services.windowService.ignoreTilingAndTabbingRequests;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
else if (opts.customData.foreign.services.dockingService) {
|
|
210
|
-
if (opts.customData.foreign.services.dockingService.allowTabbing !== undefined) {
|
|
211
|
-
showTabs = opts.customData.foreign.services.dockingService.allowTabbing;
|
|
212
|
-
}
|
|
213
|
-
else if (opts.customData.foreign.services.dockingService.ignoreTilingAndTabbingRequests != undefined) {
|
|
214
|
-
showTabs = !opts.customData.foreign.services.dockingService.ignoreTilingAndTabbingRequests;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
windowTitleBarStore.setValue({
|
|
219
|
-
field: "showTabs",
|
|
220
|
-
value: showTabs,
|
|
221
|
-
});
|
|
222
|
-
};
|
|
223
|
-
finsembleWindow.getOptions(getOptionsCallback);
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
FSBL.Clients.ConfigClient.getValues([{ field: "finsemble" }, { field: "finsemble-electron-adapter" }], getValuesCallback);
|
|
227
|
-
Actions.getInitialTabList((err, values) => {
|
|
228
|
-
const onParentSet = () => {
|
|
229
|
-
Actions.parentWrapper = null;
|
|
230
|
-
Actions.getInitialTabList(() => {
|
|
231
|
-
FSBL.Clients.Logger.system.debug("docking group update after initial tab list");
|
|
232
|
-
onDockingGroupUpdate(null, {
|
|
233
|
-
data: {
|
|
234
|
-
groupData: windowTitleBarStore.getValue({
|
|
235
|
-
field: "Main.allDockingGroups",
|
|
236
|
-
}),
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
const onParentCleared = () => {
|
|
242
|
-
Actions.parentWrapper = null;
|
|
243
|
-
FSBL.Clients.Logger.system.debug("ClearParent, setting tabs to null");
|
|
244
|
-
Actions.stopListeningOnParentWrapper(() => {
|
|
245
|
-
Actions.parentWrapperStore = null;
|
|
246
|
-
Actions._setTabs(null);
|
|
247
|
-
onDockingGroupUpdate(null, {
|
|
248
|
-
data: {
|
|
249
|
-
groupData: windowTitleBarStore.getValue({
|
|
250
|
-
field: "Main.allDockingGroups",
|
|
251
|
-
}),
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
finsembleWindow === null || finsembleWindow === void 0 ? void 0 : finsembleWindow.addListener("setParent", onParentSet);
|
|
257
|
-
finsembleWindow === null || finsembleWindow === void 0 ? void 0 : finsembleWindow.addListener("clearParent", onParentCleared);
|
|
258
|
-
if (err) {
|
|
259
|
-
return FSBL.Clients.Logger.system.error("Error in getInitialTabList.", err);
|
|
260
|
-
}
|
|
261
|
-
if (values)
|
|
262
|
-
Actions._setTabs(values);
|
|
252
|
+
FSBL.Clients.ConfigClient.getValues([{ field: "finsemble" }, { field: "finsemble-electron-adapter" }], (err, config) => {
|
|
253
|
+
if (config)
|
|
254
|
+
processFEAAndFinsembleConfig(config, windowTitleBarConfig);
|
|
255
|
+
});
|
|
256
|
+
Actions.getInitialTabList(processInitialTabList);
|
|
257
|
+
FSBL.Clients.WindowClient.headerCommandChannel((command, state) => {
|
|
258
|
+
Actions.remoteStateUpdate(command, state);
|
|
263
259
|
});
|
|
264
260
|
},
|
|
265
261
|
getMyDockingGroups: function (groupData) {
|
|
@@ -415,7 +411,7 @@ const Actions = {
|
|
|
415
411
|
Actions.parentWrapper.reorder({ windowIdentifiers: tabs });
|
|
416
412
|
},
|
|
417
413
|
findTab: function (tab) {
|
|
418
|
-
let tabs =
|
|
414
|
+
let tabs = Actions.getTabs();
|
|
419
415
|
let currentIndex = tabs.findIndex((el) => tab.windowName === el.windowName && tab.uuid === el.uuid);
|
|
420
416
|
return { tab, currentIndex };
|
|
421
417
|
},
|