@jbrowse/app-core 4.2.1 → 5.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/esm/AppSession/AppRootModel.d.ts +30 -0
  2. package/esm/AppSession/AppRootModel.js +1 -0
  3. package/esm/AppSession/AppSessionMixin.d.ts +1598 -0
  4. package/esm/AppSession/AppSessionMixin.js +62 -0
  5. package/esm/AppSession/index.d.ts +2 -0
  6. package/esm/AppSession/index.js +1 -0
  7. package/esm/Assemblies/AssembliesMixin.d.ts +225 -0
  8. package/esm/Assemblies/AssembliesMixin.js +149 -0
  9. package/esm/Assemblies/index.d.ts +1 -2
  10. package/esm/Assemblies/index.js +1 -2
  11. package/esm/HistoryManagement/index.d.ts +19 -0
  12. package/esm/HistoryManagement/index.js +42 -5
  13. package/esm/JBrowseConfig/RootConfiguration.d.ts +167 -78
  14. package/esm/JBrowseConfig/RootConfiguration.js +85 -7
  15. package/esm/JBrowseConfig/index.d.ts +169 -84
  16. package/esm/JBrowseConfig/index.js +62 -2
  17. package/esm/JBrowseModel/index.d.ts +176 -95
  18. package/esm/JBrowseModel/index.js +122 -21
  19. package/esm/RootMenu/index.d.ts +77 -2
  20. package/esm/RootMenu/index.js +107 -61
  21. package/esm/SessionSpec/index.d.ts +6 -0
  22. package/esm/SessionSpec/index.js +3 -0
  23. package/esm/SessionSpec/lgvUrlInit.d.ts +79 -0
  24. package/esm/SessionSpec/lgvUrlInit.js +158 -0
  25. package/esm/SessionSpec/loadSessionSpec.d.ts +21 -0
  26. package/esm/SessionSpec/loadSessionSpec.js +311 -0
  27. package/esm/SessionSpec/parseSessionSpecUrl.d.ts +13 -0
  28. package/esm/SessionSpec/parseSessionSpecUrl.js +196 -0
  29. package/esm/SessionSpec/types.d.ts +33 -0
  30. package/esm/SessionSpec/types.js +1 -0
  31. package/esm/WorkspaceLayout/LayoutRenderer.d.ts +24 -0
  32. package/esm/WorkspaceLayout/LayoutRenderer.js +185 -0
  33. package/esm/WorkspaceLayout/PanelView.d.ts +13 -0
  34. package/esm/WorkspaceLayout/PanelView.js +99 -0
  35. package/esm/WorkspaceLayout/TabStrip.d.ts +14 -0
  36. package/esm/WorkspaceLayout/TabStrip.js +226 -0
  37. package/esm/WorkspaceLayout/WorkspaceContainer.d.ts +16 -0
  38. package/esm/WorkspaceLayout/WorkspaceContainer.js +105 -0
  39. package/esm/WorkspaceLayout/WorkspacePanelActions.d.ts +24 -0
  40. package/esm/WorkspaceLayout/WorkspacePanelActions.js +120 -0
  41. package/esm/WorkspaceLayout/WorkspaceTab.d.ts +27 -0
  42. package/esm/WorkspaceLayout/WorkspaceTab.js +109 -0
  43. package/esm/WorkspaceLayout/dockviewTheme.d.ts +69 -0
  44. package/esm/WorkspaceLayout/dockviewTheme.js +82 -0
  45. package/esm/WorkspaceLayout/dropZone.d.ts +105 -0
  46. package/esm/WorkspaceLayout/dropZone.js +113 -0
  47. package/esm/WorkspaceLayout/index.d.ts +8 -0
  48. package/esm/WorkspaceLayout/index.js +4 -0
  49. package/esm/WorkspaceLayout/model.d.ts +240 -0
  50. package/esm/WorkspaceLayout/model.js +527 -0
  51. package/esm/WorkspaceLayout/panelChrome.d.ts +19 -0
  52. package/esm/WorkspaceLayout/panelChrome.js +4 -0
  53. package/esm/WorkspaceLayout/spec.d.ts +58 -0
  54. package/esm/WorkspaceLayout/spec.js +153 -0
  55. package/esm/WorkspaceLayout/splitter.d.ts +25 -0
  56. package/esm/WorkspaceLayout/splitter.js +37 -0
  57. package/esm/WorkspaceLayout/tree.d.ts +158 -0
  58. package/esm/WorkspaceLayout/tree.js +379 -0
  59. package/esm/WorkspaceLayout/useLayoutDrag.d.ts +34 -0
  60. package/esm/WorkspaceLayout/useLayoutDrag.js +232 -0
  61. package/esm/index.d.ts +16 -9
  62. package/esm/index.js +13 -9
  63. package/esm/menus.d.ts +63 -62
  64. package/esm/menus.js +131 -84
  65. package/esm/queryParams.d.ts +9 -0
  66. package/esm/queryParams.js +92 -0
  67. package/esm/sessionModelFactory.d.ts +18 -0
  68. package/esm/sessionModelFactory.js +1 -0
  69. package/esm/ui/App/App.d.ts +3 -14
  70. package/esm/ui/App/App.js +30 -17
  71. package/esm/ui/App/AppFab.d.ts +12 -3
  72. package/esm/ui/App/AppFab.js +15 -8
  73. package/esm/ui/App/AppReadyMarker.d.ts +34 -0
  74. package/esm/ui/App/AppReadyMarker.js +56 -0
  75. package/esm/ui/App/AppToolbar.d.ts +2 -14
  76. package/esm/ui/App/AppToolbar.js +23 -24
  77. package/esm/ui/App/ClassicViewsContainer.d.ts +3 -9
  78. package/esm/ui/App/ClassicViewsContainer.js +9 -8
  79. package/esm/ui/App/DialogQueue.d.ts +17 -1
  80. package/esm/ui/App/DialogQueue.js +30 -1
  81. package/esm/ui/App/Drawer.d.ts +1 -1
  82. package/esm/ui/App/Drawer.js +10 -39
  83. package/esm/ui/App/DrawerControls.d.ts +1 -5
  84. package/esm/ui/App/DrawerControls.js +1 -25
  85. package/esm/ui/App/DrawerHeader.d.ts +2 -3
  86. package/esm/ui/App/DrawerHeader.js +24 -10
  87. package/esm/ui/App/DrawerHeaderHelpButton.d.ts +1 -1
  88. package/esm/ui/App/DrawerHeaderHelpButton.js +3 -3
  89. package/esm/ui/App/DrawerHeaderHelpDialog.d.ts +2 -2
  90. package/esm/ui/App/DrawerHeaderHelpDialog.js +3 -4
  91. package/esm/ui/App/DrawerWidget.d.ts +1 -1
  92. package/esm/ui/App/DrawerWidget.js +9 -21
  93. package/esm/ui/App/JBrowseTabMenu.d.ts +2 -3
  94. package/esm/ui/App/JBrowseTabMenu.js +24 -5
  95. package/esm/ui/App/ViewButtons.d.ts +2 -4
  96. package/esm/ui/App/ViewButtons.js +15 -3
  97. package/esm/ui/App/ViewContainer.d.ts +3 -2
  98. package/esm/ui/App/ViewContainer.js +144 -24
  99. package/esm/ui/App/ViewContainerTitle.d.ts +1 -1
  100. package/esm/ui/App/ViewContainerTitle.js +9 -2
  101. package/esm/ui/App/ViewErrorFallback.d.ts +18 -0
  102. package/esm/ui/App/ViewErrorFallback.js +42 -0
  103. package/esm/ui/App/ViewHeader.d.ts +3 -4
  104. package/esm/ui/App/ViewHeader.js +28 -17
  105. package/esm/ui/App/ViewLauncher.d.ts +2 -8
  106. package/esm/ui/App/ViewLauncher.js +7 -5
  107. package/esm/ui/App/ViewMenu.d.ts +3 -5
  108. package/esm/ui/App/ViewMenu.js +87 -92
  109. package/esm/ui/App/ViewStack.d.ts +7 -0
  110. package/esm/ui/App/ViewStack.js +42 -0
  111. package/esm/ui/App/ViewWrapper.d.ts +15 -1
  112. package/esm/ui/App/ViewWrapper.js +26 -10
  113. package/esm/ui/App/ViewsContainer.d.ts +3 -8
  114. package/esm/ui/App/ViewsContainer.js +9 -6
  115. package/esm/ui/App/copyView.js +1 -1
  116. package/esm/ui/App/index.d.ts +2 -1
  117. package/esm/ui/App/index.js +3 -2
  118. package/esm/ui/App/lazyChunk.d.ts +13 -0
  119. package/esm/ui/App/lazyChunk.js +91 -0
  120. package/esm/ui/App/types.d.ts +12 -3
  121. package/esm/ui/App/types.js +1 -1
  122. package/esm/ui/App/useViewVisibility.d.ts +34 -0
  123. package/esm/ui/App/useViewVisibility.js +87 -0
  124. package/esm/ui/App/viewTitle.d.ts +5 -0
  125. package/esm/ui/App/viewTitle.js +9 -0
  126. package/esm/ui/index.d.ts +1 -1
  127. package/esm/ui/index.js +1 -1
  128. package/package.json +12 -17
  129. package/esm/AppFocus/index.d.ts +0 -5
  130. package/esm/AppFocus/index.js +0 -12
  131. package/esm/Assemblies/SessionAssembliesMixin.d.ts +0 -92
  132. package/esm/Assemblies/SessionAssembliesMixin.js +0 -53
  133. package/esm/Assemblies/TemporaryAssembliesMixin.d.ts +0 -10
  134. package/esm/Assemblies/TemporaryAssembliesMixin.js +0 -37
  135. package/esm/DockviewLayout/index.d.ts +0 -35
  136. package/esm/DockviewLayout/index.js +0 -111
  137. package/esm/ui/App/DockviewContext.d.ts +0 -22
  138. package/esm/ui/App/DockviewContext.js +0 -29
  139. package/esm/ui/App/DockviewLeftHeaderActions.d.ts +0 -2
  140. package/esm/ui/App/DockviewLeftHeaderActions.js +0 -58
  141. package/esm/ui/App/DockviewRightHeaderActions.d.ts +0 -2
  142. package/esm/ui/App/DockviewRightHeaderActions.js +0 -100
  143. package/esm/ui/App/DrawerWidgetSelector.d.ts +0 -5
  144. package/esm/ui/App/DrawerWidgetSelector.js +0 -47
  145. package/esm/ui/App/JBrowseViewPanel.d.ts +0 -8
  146. package/esm/ui/App/JBrowseViewPanel.js +0 -40
  147. package/esm/ui/App/JBrowseViewTab.d.ts +0 -8
  148. package/esm/ui/App/JBrowseViewTab.js +0 -97
  149. package/esm/ui/App/ModalWidget.d.ts +0 -6
  150. package/esm/ui/App/ModalWidget.js +0 -48
  151. package/esm/ui/App/TiledViewsContainer.d.ts +0 -6
  152. package/esm/ui/App/TiledViewsContainer.js +0 -366
  153. package/esm/ui/App/dockviewUtils.d.ts +0 -46
  154. package/esm/ui/App/dockviewUtils.js +0 -55
@@ -1,100 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
3
- import { makeStyles } from '@jbrowse/core/util/tss-react';
4
- import CloseIcon from '@mui/icons-material/Close';
5
- import DynamicFeedIcon from '@mui/icons-material/DynamicFeed';
6
- import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
7
- import TableRowsIcon from '@mui/icons-material/TableRows';
8
- import ViewColumnIcon from '@mui/icons-material/ViewColumn';
9
- import ViewModuleIcon from '@mui/icons-material/ViewModule';
10
- import { IconButton, Tooltip } from '@mui/material';
11
- import { useDockview } from "./DockviewContext.js";
12
- import { rearrangePanelsWithDirection } from "./dockviewUtils.js";
13
- const useStyles = makeStyles()(theme => ({
14
- headerActions: {
15
- display: 'flex',
16
- alignItems: 'center',
17
- height: '100%',
18
- },
19
- headerButton: {
20
- padding: 4,
21
- color: theme.palette.primary.contrastText,
22
- },
23
- headerIcon: {
24
- fontSize: 16,
25
- },
26
- }));
27
- export default function DockviewRightHeaderActions({ containerApi, group, }) {
28
- const { classes } = useStyles();
29
- const { rearrangePanels } = useDockview();
30
- const tileHorizontally = () => {
31
- rearrangePanels(api => {
32
- rearrangePanelsWithDirection(api, (idx, states) => idx === 0
33
- ? undefined
34
- : { referencePanel: states[0].id, direction: 'right' });
35
- });
36
- };
37
- const tileVertically = () => {
38
- rearrangePanels(api => {
39
- rearrangePanelsWithDirection(api, (idx, states) => idx === 0
40
- ? undefined
41
- : { referencePanel: states[0].id, direction: 'below' });
42
- });
43
- };
44
- const tileGrid = () => {
45
- rearrangePanels(api => {
46
- const panels = api.panels;
47
- if (panels.length <= 1) {
48
- return;
49
- }
50
- const cols = Math.ceil(Math.sqrt(panels.length));
51
- rearrangePanelsWithDirection(api, (idx, states) => {
52
- if (idx === 0) {
53
- return undefined;
54
- }
55
- const col = idx % cols;
56
- const row = Math.floor(idx / cols);
57
- if (col === 0) {
58
- const refIdx = (row - 1) * cols;
59
- return { referencePanel: states[refIdx].id, direction: 'below' };
60
- }
61
- return { referencePanel: states[idx - 1].id, direction: 'right' };
62
- });
63
- });
64
- };
65
- const stackAll = () => {
66
- rearrangePanels(api => {
67
- rearrangePanelsWithDirection(api, (idx, states) => idx === 0
68
- ? undefined
69
- : { referencePanel: states[0].id, direction: 'within' });
70
- });
71
- };
72
- const showLayoutOptions = containerApi.panels.length > 1;
73
- const showCloseGroup = containerApi.groups.length > 1;
74
- return (_jsxs("div", { className: classes.headerActions, children: [showLayoutOptions && (_jsx(CascadingMenuButton, { menuItems: [
75
- {
76
- label: 'Global: change layout into set of tabs',
77
- icon: DynamicFeedIcon,
78
- onClick: stackAll,
79
- },
80
- {
81
- label: 'Global: tile horizontally',
82
- icon: ViewColumnIcon,
83
- onClick: tileHorizontally,
84
- },
85
- {
86
- label: 'Global: tile vertically',
87
- icon: TableRowsIcon,
88
- onClick: tileVertically,
89
- },
90
- {
91
- label: 'Global: tile grid',
92
- icon: ViewModuleIcon,
93
- onClick: tileGrid,
94
- },
95
- ], size: "small", className: classes.headerButton, children: _jsx(MoreHorizIcon, { className: classes.headerIcon }) })), showCloseGroup && (_jsx(Tooltip, { title: "Close group", children: _jsx(IconButton, { size: "small", onClick: () => {
96
- for (const panel of group.panels) {
97
- panel.api.close();
98
- }
99
- }, className: classes.headerButton, children: _jsx(CloseIcon, { className: classes.headerIcon }) }) }))] }));
100
- }
@@ -1,5 +0,0 @@
1
- import type { SessionWithFocusedViewAndDrawerWidgets } from '@jbrowse/core/util/types';
2
- declare const DrawerWidgetSelector: ({ session, }: {
3
- session: SessionWithFocusedViewAndDrawerWidgets;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export default DrawerWidgetSelector;
@@ -1,47 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { getEnv } from '@jbrowse/core/util';
3
- import { makeStyles } from '@jbrowse/core/util/tss-react';
4
- import DeleteIcon from '@mui/icons-material/Delete';
5
- import { FormControl, IconButton, MenuItem, Select, Typography, } from '@mui/material';
6
- import { observer } from 'mobx-react';
7
- const useStyles = makeStyles()(theme => ({
8
- formControl: {
9
- margin: 0,
10
- },
11
- drawerSelect: {
12
- margin: 0,
13
- color: theme.palette.secondary.contrastText,
14
- },
15
- dropDownIcon: {
16
- color: theme.palette.secondary.contrastText,
17
- },
18
- }));
19
- const DrawerWidgetSelector = observer(function DrawerWidgetSelector({ session, }) {
20
- const { visibleWidget, activeWidgets } = session;
21
- const { classes } = useStyles();
22
- const { pluginManager } = getEnv(session);
23
- return (_jsx(FormControl, { className: classes.formControl, children: _jsx(Select, { value: visibleWidget?.id, "data-testid": "widget-drawer-selects", className: classes.drawerSelect, classes: { icon: classes.dropDownIcon }, renderValue: widgetId => {
24
- const widget = session.activeWidgets.get(widgetId);
25
- if (!widget) {
26
- return (_jsx(Typography, { variant: "h6", color: "inherit", children: "Unknown widget" }));
27
- }
28
- const widgetType = pluginManager.getWidgetType(widget.type);
29
- const { HeadingComponent, heading } = widgetType;
30
- return HeadingComponent ? (_jsx(HeadingComponent, { model: widget })) : (_jsx(Typography, { variant: "h6", color: "inherit", children: heading }));
31
- }, onChange: e => {
32
- const w = session.activeWidgets.get(e.target.value);
33
- if (w) {
34
- session.showWidget(w);
35
- }
36
- else {
37
- session.notify(`Widget not found ${e.target.value}`, 'warning');
38
- }
39
- }, children: [...activeWidgets.values()].map(widget => {
40
- const widgetType = pluginManager.getWidgetType(widget.type);
41
- const { HeadingComponent, heading } = widgetType;
42
- return (_jsxs(MenuItem, { "data-testid": `widget-drawer-selects-item-${widget.type}`, value: widget.id, children: [HeadingComponent ? (_jsx(HeadingComponent, { model: widget })) : (_jsx(Typography, { variant: "h6", color: "inherit", children: heading })), _jsx(IconButton, { "data-testid": `${widget.type}-drawer-delete`, color: "inherit", "aria-label": "Delete", onClick: () => {
43
- session.hideWidget(widget);
44
- }, children: _jsx(DeleteIcon, {}) })] }, widget.id));
45
- }) }) }));
46
- });
47
- export default DrawerWidgetSelector;
@@ -1,8 +0,0 @@
1
- import type { DockviewSessionType } from './types.ts';
2
- import type { IDockviewPanelProps } from 'dockview-react';
3
- export interface JBrowseViewPanelParams {
4
- panelId: string;
5
- session?: DockviewSessionType;
6
- }
7
- declare const JBrowseViewPanel: ({ params, }: IDockviewPanelProps<JBrowseViewPanelParams>) => import("react/jsx-runtime").JSX.Element;
8
- export default JBrowseViewPanel;
@@ -1,40 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Suspense, lazy } from 'react';
3
- import { makeStyles } from '@jbrowse/core/util/tss-react';
4
- import { observer } from 'mobx-react';
5
- import ViewContainer from "./ViewContainer.js";
6
- import { getViewsForPanel } from "./dockviewUtils.js";
7
- const ViewLauncher = lazy(() => import("./ViewLauncher.js"));
8
- const useStyles = makeStyles()(theme => ({
9
- container: {
10
- height: '100%',
11
- overflowY: 'auto',
12
- background: theme.palette.background.default,
13
- },
14
- viewStack: {
15
- display: 'flex',
16
- flexDirection: 'column',
17
- },
18
- spacer: {
19
- height: 300,
20
- },
21
- emptyPanel: {
22
- display: 'flex',
23
- alignItems: 'center',
24
- justifyContent: 'center',
25
- height: '100%',
26
- },
27
- }));
28
- const JBrowseViewPanel = observer(function JBrowseViewPanel({ params, }) {
29
- const { panelId, session } = params;
30
- const { classes } = useStyles();
31
- if (!session) {
32
- return _jsx("div", { className: classes.container, children: "Loading..." });
33
- }
34
- const views = getViewsForPanel(panelId, session);
35
- if (views.length === 0) {
36
- return (_jsx("div", { className: classes.container, children: _jsx("div", { className: classes.emptyPanel, children: _jsx(Suspense, { fallback: null, children: _jsx(ViewLauncher, { session: session }) }) }) }));
37
- }
38
- return (_jsx("div", { className: classes.container, children: _jsxs("div", { className: classes.viewStack, children: [views.map(view => (_jsx(ViewContainer, { view: view, session: session }, view.id))), _jsx("div", { className: classes.spacer })] }) }));
39
- });
40
- export default JBrowseViewPanel;
@@ -1,8 +0,0 @@
1
- import type { DockviewSessionType } from './types.ts';
2
- import type { IDockviewPanelHeaderProps } from 'dockview-react';
3
- export interface JBrowseViewPanelParams {
4
- panelId: string;
5
- session?: DockviewSessionType;
6
- }
7
- declare const JBrowseViewTab: ({ params, api, }: IDockviewPanelHeaderProps<JBrowseViewPanelParams>) => import("react/jsx-runtime").JSX.Element;
8
- export default JBrowseViewTab;
@@ -1,97 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { makeStyles } from '@jbrowse/core/util/tss-react';
4
- import { InputBase, Typography } from '@mui/material';
5
- import { observer } from 'mobx-react';
6
- import JBrowseTabMenu from "./JBrowseTabMenu.js";
7
- import { getViewsForPanel } from "./dockviewUtils.js";
8
- const useStyles = makeStyles()(theme => ({
9
- tabContainer: {
10
- display: 'flex',
11
- alignItems: 'center',
12
- height: '100%',
13
- padding: '0 4px',
14
- gap: 4,
15
- },
16
- tabTitle: {
17
- display: 'flex',
18
- alignItems: 'center',
19
- flex: 1,
20
- overflow: 'hidden',
21
- minWidth: 0,
22
- },
23
- tabTitleText: {
24
- overflow: 'hidden',
25
- textOverflow: 'ellipsis',
26
- whiteSpace: 'nowrap',
27
- fontSize: '0.8rem',
28
- },
29
- editInput: {
30
- fontSize: '0.8rem',
31
- padding: '2px 4px',
32
- color: 'inherit',
33
- backgroundColor: theme.palette.action.selected,
34
- borderRadius: theme.shape.borderRadius,
35
- flex: 1,
36
- },
37
- }));
38
- function stopEvent(e) {
39
- e.stopPropagation();
40
- e.preventDefault();
41
- }
42
- function getTabDisplayName(views, session) {
43
- if (views.length === 0) {
44
- return 'Empty';
45
- }
46
- if (views.length === 1) {
47
- const view = views[0];
48
- return (view.displayName ||
49
- view.assemblyNames
50
- ?.map(r => session.assemblyManager.get(r)?.displayName)
51
- .join(',') ||
52
- 'View');
53
- }
54
- return `${views.length} views`;
55
- }
56
- const JBrowseViewTab = observer(function JBrowseViewTab({ params, api, }) {
57
- const { panelId, session } = params;
58
- const { classes } = useStyles();
59
- const [isEditing, setIsEditing] = useState(false);
60
- const [isHovered, setIsHovered] = useState(false);
61
- const [editValue, setEditValue] = useState('');
62
- if (!session) {
63
- return (_jsx("div", { className: classes.tabContainer, children: _jsx("span", { className: classes.tabTitleText, children: "Loading..." }) }));
64
- }
65
- const views = getViewsForPanel(panelId, session);
66
- const displayValue = getTabDisplayName(views, session);
67
- const handleStartEdit = () => {
68
- setEditValue(api.title || displayValue);
69
- setIsEditing(true);
70
- };
71
- const handleSave = () => {
72
- if (editValue.trim()) {
73
- api.setTitle(editValue.trim());
74
- }
75
- setIsEditing(false);
76
- };
77
- const handleKeyDown = (e) => {
78
- if (e.key === 'Enter') {
79
- handleSave();
80
- }
81
- else if (e.key === 'Escape') {
82
- setIsEditing(false);
83
- }
84
- };
85
- return (_jsx("div", { className: classes.tabContainer, onMouseEnter: () => {
86
- setIsHovered(true);
87
- }, onMouseLeave: () => {
88
- setIsHovered(false);
89
- }, children: _jsx("div", { className: classes.tabTitle, children: isEditing ? (_jsx(InputBase, { autoFocus: true, className: classes.editInput, value: editValue, onChange: e => {
90
- setEditValue(e.target.value);
91
- }, onFocus: e => {
92
- e.target.select();
93
- }, onBlur: handleSave, onKeyDown: handleKeyDown, onClick: stopEvent })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { className: classes.tabTitleText, variant: "body2", onDoubleClick: handleStartEdit, children: api.title || displayValue }), _jsx(JBrowseTabMenu, { isHovered: isHovered, onRename: handleStartEdit, onClose: () => {
94
- api.close();
95
- } })] })) }) }));
96
- });
97
- export default JBrowseViewTab;
@@ -1,6 +0,0 @@
1
- import type { SessionWithWidgets } from '@jbrowse/core/util';
2
- declare const ModalWidget: ({ session, onClose, }: {
3
- session: SessionWithWidgets;
4
- onClose: () => void;
5
- }) => import("react/jsx-runtime").JSX.Element | null;
6
- export default ModalWidget;
@@ -1,48 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Suspense } from 'react';
3
- import { Dialog } from '@jbrowse/core/ui';
4
- import { makeStyles } from '@jbrowse/core/util/tss-react';
5
- import { getEnv } from '@jbrowse/mobx-state-tree';
6
- import CloseIcon from '@mui/icons-material/Close';
7
- import { AppBar, IconButton, Paper, Toolbar, Typography } from '@mui/material';
8
- import { observer } from 'mobx-react';
9
- const useStyles = makeStyles()(theme => ({
10
- paper: {
11
- overflow: 'auto',
12
- minWidth: 800,
13
- },
14
- closeButton: {
15
- position: 'absolute',
16
- right: theme.spacing(1),
17
- top: theme.spacing(1),
18
- color: theme.palette.grey[500],
19
- },
20
- }));
21
- const DrawerAppBar = observer(function DrawerAppBar({ session, onClose, }) {
22
- const { classes } = useStyles();
23
- const { visibleWidget } = session;
24
- const { pluginManager } = getEnv(session);
25
- if (!visibleWidget) {
26
- return null;
27
- }
28
- const { HeadingComponent, heading } = pluginManager.getWidgetType(visibleWidget.type);
29
- return (_jsxs(AppBar, { position: "static", children: [_jsx(Toolbar, { children: HeadingComponent ? (_jsx(HeadingComponent, { model: visibleWidget })) : (_jsx(Typography, { variant: "h6", children: heading })) }), _jsx(IconButton, { className: classes.closeButton, onClick: onClose, children: _jsx(CloseIcon, {}) })] }));
30
- });
31
- const ModalWidget = observer(function ModalWidget({ session, onClose, }) {
32
- const { classes } = useStyles();
33
- const { visibleWidget } = session;
34
- const { pluginManager } = getEnv(session);
35
- if (!visibleWidget) {
36
- return null;
37
- }
38
- const { ReactComponent } = pluginManager.getWidgetType(visibleWidget.type);
39
- const Component = pluginManager.evaluateExtensionPoint('Core-replaceWidget', ReactComponent, {
40
- session,
41
- model: visibleWidget,
42
- });
43
- return (_jsx(Dialog, { open: true, onClose: onClose, maxWidth: "xl", header: _jsx(DrawerAppBar, { onClose: onClose, session: session }), children: Component ? (_jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(Paper, { className: classes.paper, children: _jsx(Component, { model: visibleWidget, session: session, modal: true, overrideDimensions: {
44
- height: (window.innerHeight * 5) / 8,
45
- width: 800,
46
- } }) }) })) : null }));
47
- });
48
- export default ModalWidget;
@@ -1,6 +0,0 @@
1
- import type { DockviewSessionType } from './types.ts';
2
- interface Props {
3
- session: DockviewSessionType;
4
- }
5
- declare const TiledViewsContainer: ({ session, }: Props) => import("react/jsx-runtime").JSX.Element;
6
- export default TiledViewsContainer;