@jbrowse/app-core 4.3.0 → 5.0.0-beta.10
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/esm/AppSession/AppRootModel.d.ts +30 -0
- package/esm/AppSession/AppRootModel.js +1 -0
- package/esm/AppSession/AppSessionMixin.d.ts +1324 -0
- package/esm/AppSession/AppSessionMixin.js +62 -0
- package/esm/AppSession/index.d.ts +2 -0
- package/esm/AppSession/index.js +1 -0
- package/esm/Assemblies/AssembliesMixin.d.ts +294 -0
- package/esm/Assemblies/AssembliesMixin.js +154 -0
- package/esm/Assemblies/index.d.ts +1 -2
- package/esm/Assemblies/index.js +1 -2
- package/esm/HistoryManagement/index.d.ts +11 -0
- package/esm/HistoryManagement/index.js +43 -10
- package/esm/JBrowseConfig/RootConfiguration.d.ts +123 -78
- package/esm/JBrowseConfig/RootConfiguration.js +79 -7
- package/esm/JBrowseConfig/defaultShareUrl.d.ts +1 -0
- package/esm/JBrowseConfig/defaultShareUrl.js +5 -0
- package/esm/JBrowseConfig/index.d.ts +175 -84
- package/esm/JBrowseConfig/index.js +64 -2
- package/esm/JBrowseModel/index.d.ts +175 -97
- package/esm/JBrowseModel/index.js +132 -31
- package/esm/JbApi/index.d.ts +2 -0
- package/esm/JbApi/index.js +1 -0
- package/esm/JbApi/jbApi.d.ts +2767 -0
- package/esm/JbApi/jbApi.js +1383 -0
- package/esm/RootMenu/index.d.ts +69 -3
- package/esm/RootMenu/index.js +96 -61
- package/esm/SessionSpec/index.d.ts +6 -0
- package/esm/SessionSpec/index.js +3 -0
- package/esm/SessionSpec/lgvUrlInit.d.ts +79 -0
- package/esm/SessionSpec/lgvUrlInit.js +161 -0
- package/esm/SessionSpec/loadSessionSpec.d.ts +75 -0
- package/esm/SessionSpec/loadSessionSpec.js +473 -0
- package/esm/SessionSpec/parseSessionSpecUrl.d.ts +7 -0
- package/esm/SessionSpec/parseSessionSpecUrl.js +181 -0
- package/esm/SessionSpec/types.d.ts +37 -0
- package/esm/SessionSpec/types.js +1 -0
- package/esm/WorkspaceLayout/LayoutRenderer.d.ts +24 -0
- package/esm/WorkspaceLayout/LayoutRenderer.js +185 -0
- package/esm/WorkspaceLayout/PanelView.d.ts +13 -0
- package/esm/WorkspaceLayout/PanelView.js +99 -0
- package/esm/WorkspaceLayout/TabStrip.d.ts +14 -0
- package/esm/WorkspaceLayout/TabStrip.js +226 -0
- package/esm/WorkspaceLayout/WorkspaceContainer.d.ts +16 -0
- package/esm/WorkspaceLayout/WorkspaceContainer.js +107 -0
- package/esm/WorkspaceLayout/WorkspacePanelActions.d.ts +24 -0
- package/esm/WorkspaceLayout/WorkspacePanelActions.js +120 -0
- package/esm/WorkspaceLayout/WorkspaceTab.d.ts +27 -0
- package/esm/WorkspaceLayout/WorkspaceTab.js +105 -0
- package/esm/WorkspaceLayout/dockviewTheme.d.ts +69 -0
- package/esm/WorkspaceLayout/dockviewTheme.js +82 -0
- package/esm/WorkspaceLayout/dropZone.d.ts +105 -0
- package/esm/WorkspaceLayout/dropZone.js +113 -0
- package/esm/WorkspaceLayout/index.d.ts +8 -0
- package/esm/WorkspaceLayout/index.js +4 -0
- package/esm/WorkspaceLayout/model.d.ts +260 -0
- package/esm/WorkspaceLayout/model.js +586 -0
- package/esm/WorkspaceLayout/panelChrome.d.ts +19 -0
- package/esm/WorkspaceLayout/panelChrome.js +4 -0
- package/esm/WorkspaceLayout/spec.d.ts +88 -0
- package/esm/WorkspaceLayout/spec.js +226 -0
- package/esm/WorkspaceLayout/splitter.d.ts +25 -0
- package/esm/WorkspaceLayout/splitter.js +37 -0
- package/esm/WorkspaceLayout/tree.d.ts +158 -0
- package/esm/WorkspaceLayout/tree.js +379 -0
- package/esm/WorkspaceLayout/useLayoutDrag.d.ts +34 -0
- package/esm/WorkspaceLayout/useLayoutDrag.js +232 -0
- package/esm/index.d.ts +18 -9
- package/esm/index.js +16 -9
- package/esm/menus.d.ts +55 -68
- package/esm/menus.js +117 -86
- package/esm/queryParams.d.ts +9 -0
- package/esm/queryParams.js +93 -0
- package/esm/sessionModelFactory.d.ts +18 -0
- package/esm/sessionModelFactory.js +1 -0
- package/esm/ui/App/App.d.ts +3 -14
- package/esm/ui/App/App.js +39 -19
- package/esm/ui/App/AppFab.d.ts +12 -3
- package/esm/ui/App/AppFab.js +15 -8
- package/esm/ui/App/AppToolbar.d.ts +2 -14
- package/esm/ui/App/AppToolbar.js +45 -31
- package/esm/ui/App/ClassicViewsContainer.d.ts +4 -10
- package/esm/ui/App/ClassicViewsContainer.js +9 -8
- package/esm/ui/App/DialogQueue.d.ts +17 -1
- package/esm/ui/App/DialogQueue.js +30 -1
- package/esm/ui/App/Drawer.d.ts +1 -1
- package/esm/ui/App/Drawer.js +10 -39
- package/esm/ui/App/DrawerHeader.d.ts +2 -3
- package/esm/ui/App/DrawerHeader.js +24 -11
- package/esm/ui/App/DrawerHeaderHelpButton.d.ts +1 -1
- package/esm/ui/App/DrawerHeaderHelpButton.js +3 -3
- package/esm/ui/App/DrawerHeaderHelpDialog.d.ts +2 -2
- package/esm/ui/App/DrawerHeaderHelpDialog.js +3 -4
- package/esm/ui/App/DrawerWidget.d.ts +1 -1
- package/esm/ui/App/DrawerWidget.js +9 -21
- package/esm/ui/App/JBrowseTabMenu.d.ts +2 -3
- package/esm/ui/App/JBrowseTabMenu.js +24 -5
- package/esm/ui/App/ThemeModeButton.d.ts +12 -0
- package/esm/ui/App/ThemeModeButton.js +34 -0
- package/esm/ui/App/ViewButtons.d.ts +2 -4
- package/esm/ui/App/ViewButtons.js +15 -3
- package/esm/ui/App/ViewContainer.d.ts +3 -2
- package/esm/ui/App/ViewContainer.js +128 -24
- package/esm/ui/App/ViewContainerTitle.d.ts +1 -1
- package/esm/ui/App/ViewContainerTitle.js +21 -11
- package/esm/ui/App/ViewErrorFallback.d.ts +18 -0
- package/esm/ui/App/ViewErrorFallback.js +42 -0
- package/esm/ui/App/ViewHeader.d.ts +3 -4
- package/esm/ui/App/ViewHeader.js +28 -17
- package/esm/ui/App/ViewLauncher.d.ts +2 -8
- package/esm/ui/App/ViewLauncher.js +7 -5
- package/esm/ui/App/ViewMenu.d.ts +3 -5
- package/esm/ui/App/ViewMenu.js +87 -92
- package/esm/ui/App/ViewStack.d.ts +7 -0
- package/esm/ui/App/ViewStack.js +48 -0
- package/esm/ui/App/ViewWrapper.d.ts +15 -1
- package/esm/ui/App/ViewWrapper.js +26 -10
- package/esm/ui/App/ViewsContainer.d.ts +4 -11
- package/esm/ui/App/ViewsContainer.js +6 -9
- package/esm/ui/App/index.d.ts +2 -1
- package/esm/ui/App/index.js +3 -2
- package/esm/ui/App/lazyChunk.d.ts +13 -0
- package/esm/ui/App/lazyChunk.js +91 -0
- package/esm/ui/App/lazyParts.d.ts +32 -0
- package/esm/ui/App/lazyParts.js +8 -0
- package/esm/ui/App/preloadAppShell.d.ts +14 -0
- package/esm/ui/App/preloadAppShell.js +41 -0
- package/esm/ui/App/types.d.ts +17 -3
- package/esm/ui/App/types.js +1 -1
- package/esm/ui/App/useViewVisibility.d.ts +35 -0
- package/esm/ui/App/useViewVisibility.js +88 -0
- package/esm/ui/App/viewTitle.d.ts +12 -0
- package/esm/ui/App/viewTitle.js +17 -0
- package/esm/ui/index.d.ts +1 -1
- package/esm/ui/index.js +1 -1
- package/package.json +12 -17
- package/esm/AppFocus/index.d.ts +0 -5
- package/esm/AppFocus/index.js +0 -12
- package/esm/Assemblies/SessionAssembliesMixin.d.ts +0 -92
- package/esm/Assemblies/SessionAssembliesMixin.js +0 -53
- package/esm/Assemblies/TemporaryAssembliesMixin.d.ts +0 -10
- package/esm/Assemblies/TemporaryAssembliesMixin.js +0 -37
- package/esm/DockviewLayout/index.d.ts +0 -35
- package/esm/DockviewLayout/index.js +0 -111
- package/esm/ui/App/DockviewContext.d.ts +0 -22
- package/esm/ui/App/DockviewContext.js +0 -29
- package/esm/ui/App/DockviewLeftHeaderActions.d.ts +0 -2
- package/esm/ui/App/DockviewLeftHeaderActions.js +0 -58
- package/esm/ui/App/DockviewRightHeaderActions.d.ts +0 -2
- package/esm/ui/App/DockviewRightHeaderActions.js +0 -100
- package/esm/ui/App/DrawerControls.d.ts +0 -5
- package/esm/ui/App/DrawerControls.js +0 -25
- package/esm/ui/App/DrawerWidgetSelector.d.ts +0 -5
- package/esm/ui/App/DrawerWidgetSelector.js +0 -47
- package/esm/ui/App/JBrowseViewPanel.d.ts +0 -8
- package/esm/ui/App/JBrowseViewPanel.js +0 -40
- package/esm/ui/App/JBrowseViewTab.d.ts +0 -8
- package/esm/ui/App/JBrowseViewTab.js +0 -97
- package/esm/ui/App/ModalWidget.d.ts +0 -6
- package/esm/ui/App/ModalWidget.js +0 -48
- package/esm/ui/App/TiledViewsContainer.d.ts +0 -6
- package/esm/ui/App/TiledViewsContainer.js +0 -366
- package/esm/ui/App/copyView.d.ts +0 -1
- package/esm/ui/App/copyView.js +0 -29
- package/esm/ui/App/dockviewUtils.d.ts +0 -46
- package/esm/ui/App/dockviewUtils.js +0 -55
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View-level lazy mounting. A view only mounts its (GPU-heavy) body while it is
|
|
3
|
+
* on screen, and collapses to a height-preserving spacer once scrolled away. This bounds the number of simultaneously-live
|
|
4
|
+
* GPU canvases/contexts — the root cause of the "workspaces freeze" with many
|
|
5
|
+
* stacked views (one WebGL context per display canvas blows past the browser's
|
|
6
|
+
* per-page cap; see agent-docs/reference/ARCHITECTURAL_LIMITS.md, "One WebGL2
|
|
7
|
+
* context per display canvas").
|
|
8
|
+
*
|
|
9
|
+
* `root: null` (viewport) is container-agnostic: it reports on-screen-ness the
|
|
10
|
+
* same way whether the views scroll inside the classic container or a workspace
|
|
11
|
+
* panel, so neither container needs to know about windowing. It also means
|
|
12
|
+
* **a `rootMargin` would have no effect** wherever a container scrolls — an
|
|
13
|
+
* observer clips the target against each scrolling ancestor before
|
|
14
|
+
* intersecting with the root box that the margin expands, and both containers
|
|
15
|
+
* are `overflow-y: auto`. Only an embed whose page scrolls instead would feel
|
|
16
|
+
* one, and it gets the same window. So this is a hard window with no
|
|
17
|
+
* hysteresis: a view is torn down the moment it leaves its
|
|
18
|
+
* container and rebuilt when it returns, which on a GPU backend costs a fresh
|
|
19
|
+
* WebGL2 context and a full shader recompile per display.
|
|
20
|
+
*
|
|
21
|
+
* That is deliberate as of 2026-08-05, not an oversight. Rooting the observer at
|
|
22
|
+
* the scroll port restores the band and measures as a wash on scroll cost while
|
|
23
|
+
* roughly doubling live contexts — and the ceiling is 16 live contexts, so the
|
|
24
|
+
* cap bites before the rebuild saving pays for itself.
|
|
25
|
+
* agent-docs/reference/GPU_CONTEXT_BUDGET.md has the numbers and the three
|
|
26
|
+
* other fixes that were measured and eliminated.
|
|
27
|
+
*
|
|
28
|
+
* Starts hidden so a cold load with N crammed views doesn't mount them all at
|
|
29
|
+
* once; the observer's first callback mounts only what's near the viewport.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useViewVisibility(): {
|
|
32
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
33
|
+
visible: boolean;
|
|
34
|
+
measuredHeight: number | undefined;
|
|
35
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
// No IntersectionObserver (jsdom/SSR): start (and stay) visible, the
|
|
3
|
+
// pre-lazy-mount behavior, so tests and non-browser environments are unchanged.
|
|
4
|
+
function intersectionObserverAvailable() {
|
|
5
|
+
return typeof window !== 'undefined' && 'IntersectionObserver' in window;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* View-level lazy mounting. A view only mounts its (GPU-heavy) body while it is
|
|
9
|
+
* on screen, and collapses to a height-preserving spacer once scrolled away. This bounds the number of simultaneously-live
|
|
10
|
+
* GPU canvases/contexts — the root cause of the "workspaces freeze" with many
|
|
11
|
+
* stacked views (one WebGL context per display canvas blows past the browser's
|
|
12
|
+
* per-page cap; see agent-docs/reference/ARCHITECTURAL_LIMITS.md, "One WebGL2
|
|
13
|
+
* context per display canvas").
|
|
14
|
+
*
|
|
15
|
+
* `root: null` (viewport) is container-agnostic: it reports on-screen-ness the
|
|
16
|
+
* same way whether the views scroll inside the classic container or a workspace
|
|
17
|
+
* panel, so neither container needs to know about windowing. It also means
|
|
18
|
+
* **a `rootMargin` would have no effect** wherever a container scrolls — an
|
|
19
|
+
* observer clips the target against each scrolling ancestor before
|
|
20
|
+
* intersecting with the root box that the margin expands, and both containers
|
|
21
|
+
* are `overflow-y: auto`. Only an embed whose page scrolls instead would feel
|
|
22
|
+
* one, and it gets the same window. So this is a hard window with no
|
|
23
|
+
* hysteresis: a view is torn down the moment it leaves its
|
|
24
|
+
* container and rebuilt when it returns, which on a GPU backend costs a fresh
|
|
25
|
+
* WebGL2 context and a full shader recompile per display.
|
|
26
|
+
*
|
|
27
|
+
* That is deliberate as of 2026-08-05, not an oversight. Rooting the observer at
|
|
28
|
+
* the scroll port restores the band and measures as a wash on scroll cost while
|
|
29
|
+
* roughly doubling live contexts — and the ceiling is 16 live contexts, so the
|
|
30
|
+
* cap bites before the rebuild saving pays for itself.
|
|
31
|
+
* agent-docs/reference/GPU_CONTEXT_BUDGET.md has the numbers and the three
|
|
32
|
+
* other fixes that were measured and eliminated.
|
|
33
|
+
*
|
|
34
|
+
* Starts hidden so a cold load with N crammed views doesn't mount them all at
|
|
35
|
+
* once; the observer's first callback mounts only what's near the viewport.
|
|
36
|
+
*/
|
|
37
|
+
export function useViewVisibility() {
|
|
38
|
+
const ref = useRef(null);
|
|
39
|
+
const [state, setState] = useState(() => ({
|
|
40
|
+
visible: !intersectionObserverAvailable(),
|
|
41
|
+
}));
|
|
42
|
+
// Toggle `visible` as the body scrolls in/out of the viewport (root: null),
|
|
43
|
+
// and record the height it had on the way out.
|
|
44
|
+
//
|
|
45
|
+
// The height comes off the entry the observer already handed us. At the
|
|
46
|
+
// moment the body stops intersecting it is still mounted at full height (the
|
|
47
|
+
// collapse is what this callback is about to cause), so the entry's rect is
|
|
48
|
+
// exactly what a ResizeObserver would have reported. Keeping one
|
|
49
|
+
// meant a second observer per view whose every fire re-rendered the whole
|
|
50
|
+
// view chrome, and a view's height moves constantly: every track added,
|
|
51
|
+
// resized, or grown by its own data.
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const node = ref.current;
|
|
54
|
+
if (node && intersectionObserverAvailable()) {
|
|
55
|
+
const io = new IntersectionObserver(entries => {
|
|
56
|
+
const entry = entries.at(-1);
|
|
57
|
+
if (entry) {
|
|
58
|
+
const { isIntersecting } = entry;
|
|
59
|
+
setState(prev => {
|
|
60
|
+
if (prev.visible === isIntersecting) {
|
|
61
|
+
return prev;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
visible: isIntersecting,
|
|
65
|
+
// a minimized view measures 0 here (it renders no body at
|
|
66
|
+
// all), which must not become its remembered height
|
|
67
|
+
height: isIntersecting
|
|
68
|
+
? prev.height
|
|
69
|
+
: entry.boundingClientRect.height || prev.height,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
io.observe(node);
|
|
75
|
+
return () => {
|
|
76
|
+
io.disconnect();
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}, []);
|
|
81
|
+
// `measuredHeight` is undefined until the body has been seen at least once.
|
|
82
|
+
// The caller supplies the estimate, and supplies it lazily. See ViewContainer
|
|
83
|
+
return {
|
|
84
|
+
ref,
|
|
85
|
+
visible: state.visible,
|
|
86
|
+
measuredHeight: state.height,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface TitledView {
|
|
2
|
+
displayName?: string;
|
|
3
|
+
assemblyNames?: string[];
|
|
4
|
+
minimized?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The view's own name, or its assemblies'. An emptied name counts as unset, so
|
|
8
|
+
* clearing the title in the header puts the derived one back.
|
|
9
|
+
*/
|
|
10
|
+
export declare function viewName(view: TitledView, getDisplayName: (assemblyName: string) => string): string;
|
|
11
|
+
export declare function viewTitle(view: TitledView, getDisplayName: (assemblyName: string) => string): string;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view's own name, or its assemblies'. An emptied name counts as unset, so
|
|
3
|
+
* clearing the title in the header puts the derived one back.
|
|
4
|
+
*/
|
|
5
|
+
export function viewName(view, getDisplayName) {
|
|
6
|
+
// assemblyNames is [] (not undefined) for a view with no displayed regions
|
|
7
|
+
// yet, so fall back on emptiness rather than nullishness
|
|
8
|
+
const assemblyNames = view.assemblyNames ?? [];
|
|
9
|
+
return (view.displayName ||
|
|
10
|
+
(assemblyNames.length
|
|
11
|
+
? assemblyNames.map(r => getDisplayName(r)).join(', ')
|
|
12
|
+
: 'Untitled view'));
|
|
13
|
+
}
|
|
14
|
+
export function viewTitle(view, getDisplayName) {
|
|
15
|
+
const name = viewName(view, getDisplayName);
|
|
16
|
+
return view.minimized ? `${name} (minimized)` : name;
|
|
17
|
+
}
|
package/esm/ui/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { App, DialogQueue, preloadAppFrame, preloadAppShell, } from './App/index.ts';
|
package/esm/ui/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { App, DialogQueue, preloadAppFrame, preloadAppShell, } from './App/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/app-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JBrowse 2 code shared between the 'full featured' apps e.g. jbrowse-web and jbrowse-desktop",
|
|
6
6
|
"keywords": [
|
|
@@ -24,26 +24,24 @@
|
|
|
24
24
|
"esm"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jbrowse/mobx-state-tree": "^
|
|
28
|
-
"@mui/icons-material": "^
|
|
29
|
-
"@mui/material": "^
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"@jbrowse/core": "^4.3.0",
|
|
35
|
-
"@jbrowse/product-core": "^4.3.0"
|
|
27
|
+
"@jbrowse/mobx-state-tree": "^6.6.1",
|
|
28
|
+
"@mui/icons-material": "^9.4.0",
|
|
29
|
+
"@mui/material": "^9.4.0",
|
|
30
|
+
"mobx": "^7.0.5",
|
|
31
|
+
"mobx-react": "^10.0.2",
|
|
32
|
+
"@jbrowse/product-core": "^5.0.0-beta.10",
|
|
33
|
+
"@jbrowse/core": "^5.0.0-beta.10"
|
|
36
34
|
},
|
|
37
35
|
"peerDependencies": {
|
|
38
|
-
"react": ">=
|
|
39
|
-
"react-dom": ">=
|
|
36
|
+
"react": ">=19.0.0",
|
|
37
|
+
"react-dom": ">=19.0.0"
|
|
40
38
|
},
|
|
41
39
|
"publishConfig": {
|
|
42
40
|
"access": "public"
|
|
43
41
|
},
|
|
44
42
|
"sideEffects": false,
|
|
45
43
|
"scripts": {
|
|
46
|
-
"build:esm": "tsc
|
|
44
|
+
"build:esm": "node ../../node_modules/typescript7/bin/tsc --build tsconfig.build.esm.json",
|
|
47
45
|
"build": "pnpm build:esm",
|
|
48
46
|
"test": "cd ../..; jest --passWithNoTests packages/app-core",
|
|
49
47
|
"clean": "rimraf esm *.tsbuildinfo",
|
|
@@ -51,9 +49,6 @@
|
|
|
51
49
|
},
|
|
52
50
|
"types": "esm/index.d.ts",
|
|
53
51
|
"exports": {
|
|
54
|
-
".":
|
|
55
|
-
"types": "./esm/index.d.ts",
|
|
56
|
-
"import": "./esm/index.js"
|
|
57
|
-
}
|
|
52
|
+
".": "./esm/index.js"
|
|
58
53
|
}
|
|
59
54
|
}
|
package/esm/AppFocus/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function AppFocusMixin(): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
2
|
-
focusedViewId: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
|
|
3
|
-
}, {
|
|
4
|
-
setFocusedViewId(viewId: string): void;
|
|
5
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree")._NotCustomized>;
|
package/esm/AppFocus/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { types } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
export function AppFocusMixin() {
|
|
3
|
-
return types
|
|
4
|
-
.model({
|
|
5
|
-
focusedViewId: types.maybe(types.string),
|
|
6
|
-
})
|
|
7
|
-
.actions(self => ({
|
|
8
|
-
setFocusedViewId(viewId) {
|
|
9
|
-
self.focusedViewId = viewId;
|
|
10
|
-
},
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
import type { BaseAssemblyConfigSchema } from '@jbrowse/core/assemblyManager';
|
|
3
|
-
import type { AnyConfiguration } from '@jbrowse/core/configuration';
|
|
4
|
-
export declare function SessionAssembliesMixin(pluginManager: PluginManager, assemblyConfigSchemasType: BaseAssemblyConfigSchema): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
5
|
-
sessionAssemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
6
|
-
aliases: {
|
|
7
|
-
type: string;
|
|
8
|
-
defaultValue: never[];
|
|
9
|
-
description: string;
|
|
10
|
-
};
|
|
11
|
-
sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
12
|
-
refNameColors: {
|
|
13
|
-
type: string;
|
|
14
|
-
defaultValue: never[];
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
18
|
-
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
19
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
20
|
-
cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
21
|
-
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
22
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
23
|
-
displayName: {
|
|
24
|
-
type: string;
|
|
25
|
-
defaultValue: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>;
|
|
29
|
-
}, {
|
|
30
|
-
addSessionAssembly(conf: AnyConfiguration): ({
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
} & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
33
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
34
|
-
[x: string]: any;
|
|
35
|
-
} & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
36
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
37
|
-
[x: string]: any;
|
|
38
|
-
} & import("@jbrowse/mobx-state-tree/dist/internal").NonEmptyObject & any & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
39
|
-
} & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
40
|
-
} & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
41
|
-
aliases: {
|
|
42
|
-
type: string;
|
|
43
|
-
defaultValue: never[];
|
|
44
|
-
description: string;
|
|
45
|
-
};
|
|
46
|
-
sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
47
|
-
refNameColors: {
|
|
48
|
-
type: string;
|
|
49
|
-
defaultValue: never[];
|
|
50
|
-
description: string;
|
|
51
|
-
};
|
|
52
|
-
refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
53
|
-
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
54
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
55
|
-
cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
56
|
-
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
57
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
58
|
-
displayName: {
|
|
59
|
-
type: string;
|
|
60
|
-
defaultValue: string;
|
|
61
|
-
description: string;
|
|
62
|
-
};
|
|
63
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>) | undefined;
|
|
64
|
-
addAssembly(conf: AnyConfiguration): void;
|
|
65
|
-
removeAssembly(name: string): void;
|
|
66
|
-
removeSessionAssembly(assemblyName: string): void;
|
|
67
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree").ModelSnapshotType<{
|
|
68
|
-
sessionAssemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
69
|
-
aliases: {
|
|
70
|
-
type: string;
|
|
71
|
-
defaultValue: never[];
|
|
72
|
-
description: string;
|
|
73
|
-
};
|
|
74
|
-
sequence: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
75
|
-
refNameColors: {
|
|
76
|
-
type: string;
|
|
77
|
-
defaultValue: never[];
|
|
78
|
-
description: string;
|
|
79
|
-
};
|
|
80
|
-
refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
81
|
-
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
82
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
83
|
-
cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
84
|
-
adapter: import("@jbrowse/mobx-state-tree").IAnyModelType;
|
|
85
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
86
|
-
displayName: {
|
|
87
|
-
type: string;
|
|
88
|
-
defaultValue: string;
|
|
89
|
-
description: string;
|
|
90
|
-
};
|
|
91
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>;
|
|
92
|
-
}>>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { types } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
export function SessionAssembliesMixin(pluginManager, assemblyConfigSchemasType) {
|
|
3
|
-
return types
|
|
4
|
-
.model({
|
|
5
|
-
sessionAssemblies: types.array(assemblyConfigSchemasType),
|
|
6
|
-
})
|
|
7
|
-
.actions(s => {
|
|
8
|
-
const self = s;
|
|
9
|
-
return {
|
|
10
|
-
addSessionAssembly(conf) {
|
|
11
|
-
const asm = self.sessionAssemblies.find(f => f.name === conf.name);
|
|
12
|
-
if (asm) {
|
|
13
|
-
console.warn(`Assembly ${conf.name} already exists`);
|
|
14
|
-
return asm;
|
|
15
|
-
}
|
|
16
|
-
const length = self.sessionAssemblies.push(conf);
|
|
17
|
-
return self.sessionAssemblies[length - 1];
|
|
18
|
-
},
|
|
19
|
-
addAssembly(conf) {
|
|
20
|
-
if (self.adminMode) {
|
|
21
|
-
self.jbrowse.addAssemblyConf(conf);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
this.addSessionAssembly(conf);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
removeAssembly(name) {
|
|
28
|
-
if (self.adminMode) {
|
|
29
|
-
self.jbrowse.removeAssemblyConf(name);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this.removeSessionAssembly(name);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
removeSessionAssembly(assemblyName) {
|
|
36
|
-
const elt = self.sessionAssemblies.find(a => a.name === assemblyName);
|
|
37
|
-
if (elt) {
|
|
38
|
-
self.sessionAssemblies.remove(elt);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
})
|
|
43
|
-
.postProcessSnapshot(snap => {
|
|
44
|
-
if (!snap) {
|
|
45
|
-
return snap;
|
|
46
|
-
}
|
|
47
|
-
const { sessionAssemblies, ...rest } = snap;
|
|
48
|
-
return {
|
|
49
|
-
...rest,
|
|
50
|
-
...(sessionAssemblies.length ? { sessionAssemblies } : {}),
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
import type { AnyConfiguration } from '@jbrowse/core/configuration';
|
|
3
|
-
export declare function TemporaryAssembliesMixin(pluginManager: PluginManager, assemblyConfigSchemasType?: import("@jbrowse/mobx-state-tree").IType<any, any, any>): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
4
|
-
temporaryAssemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<any, any, any>>;
|
|
5
|
-
}, {
|
|
6
|
-
addTemporaryAssembly(conf: AnyConfiguration): any;
|
|
7
|
-
removeTemporaryAssembly(name: string): void;
|
|
8
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree").ModelSnapshotType<{
|
|
9
|
-
temporaryAssemblies: import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<any, any, any>>;
|
|
10
|
-
}>>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { types } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
export function TemporaryAssembliesMixin(pluginManager, assemblyConfigSchemasType = types.frozen()) {
|
|
3
|
-
return types
|
|
4
|
-
.model({
|
|
5
|
-
temporaryAssemblies: types.array(assemblyConfigSchemasType),
|
|
6
|
-
})
|
|
7
|
-
.actions(s => {
|
|
8
|
-
const self = s;
|
|
9
|
-
return {
|
|
10
|
-
addTemporaryAssembly(conf) {
|
|
11
|
-
const asm = self.temporaryAssemblies.find(f => f.name === conf.name);
|
|
12
|
-
if (asm) {
|
|
13
|
-
console.warn(`Assembly ${conf.name} was already existing`);
|
|
14
|
-
return asm;
|
|
15
|
-
}
|
|
16
|
-
const length = self.temporaryAssemblies.push(conf);
|
|
17
|
-
return self.temporaryAssemblies[length - 1];
|
|
18
|
-
},
|
|
19
|
-
removeTemporaryAssembly(name) {
|
|
20
|
-
const elt = self.temporaryAssemblies.find(a => a.name === name);
|
|
21
|
-
if (elt) {
|
|
22
|
-
self.temporaryAssemblies.remove(elt);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
})
|
|
27
|
-
.postProcessSnapshot(snap => {
|
|
28
|
-
if (!snap) {
|
|
29
|
-
return snap;
|
|
30
|
-
}
|
|
31
|
-
const { temporaryAssemblies, ...rest } = snap;
|
|
32
|
-
return {
|
|
33
|
-
...rest,
|
|
34
|
-
...(temporaryAssemblies.length ? { temporaryAssemblies } : {}),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { IAnyStateTreeNode, Instance } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
import type { SerializedDockview } from 'dockview-react';
|
|
3
|
-
export interface DockviewLayoutNode {
|
|
4
|
-
viewIds?: string[];
|
|
5
|
-
direction?: 'horizontal' | 'vertical';
|
|
6
|
-
children?: DockviewLayoutNode[];
|
|
7
|
-
size?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function DockviewLayoutMixin(): import("@jbrowse/mobx-state-tree").IModelType<{
|
|
10
|
-
dockviewLayout: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IType<SerializedDockview, SerializedDockview, SerializedDockview>>;
|
|
11
|
-
panelViewAssignments: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>, [undefined]>;
|
|
12
|
-
init: import("@jbrowse/mobx-state-tree").IType<DockviewLayoutNode | undefined, DockviewLayoutNode | undefined, DockviewLayoutNode | undefined>;
|
|
13
|
-
activePanelId: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
|
|
14
|
-
}, {
|
|
15
|
-
getViewIdsForPanel(panelId: string): never[] | (import("@jbrowse/mobx-state-tree").IMSTArray<import("@jbrowse/mobx-state-tree").ISimpleType<string>> & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>);
|
|
16
|
-
} & {
|
|
17
|
-
setDockviewLayout(layout: SerializedDockview | undefined): void;
|
|
18
|
-
setActivePanelId(panelId: string | undefined): void;
|
|
19
|
-
setInit(init: DockviewLayoutNode | undefined): void;
|
|
20
|
-
assignViewToPanel(panelId: string, viewId: string): void;
|
|
21
|
-
removeViewFromPanel(viewId: string): void;
|
|
22
|
-
removePanel(panelId: string): void;
|
|
23
|
-
moveViewUpInPanel(viewId: string): void;
|
|
24
|
-
moveViewDownInPanel(viewId: string): void;
|
|
25
|
-
moveViewToTopInPanel(viewId: string): void;
|
|
26
|
-
moveViewToBottomInPanel(viewId: string): void;
|
|
27
|
-
}, import("@jbrowse/mobx-state-tree")._NotCustomized, import("@jbrowse/mobx-state-tree").ModelSnapshotType<{
|
|
28
|
-
dockviewLayout: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").IType<SerializedDockview, SerializedDockview, SerializedDockview>>;
|
|
29
|
-
panelViewAssignments: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IMapType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").ISimpleType<string>>>, [undefined]>;
|
|
30
|
-
init: import("@jbrowse/mobx-state-tree").IType<DockviewLayoutNode | undefined, DockviewLayoutNode | undefined, DockviewLayoutNode | undefined>;
|
|
31
|
-
activePanelId: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
|
|
32
|
-
}>>;
|
|
33
|
-
export type DockviewLayoutMixinType = ReturnType<typeof DockviewLayoutMixin>;
|
|
34
|
-
export type SessionWithDockviewLayout = Instance<DockviewLayoutMixinType>;
|
|
35
|
-
export declare function isSessionWithDockviewLayout(session: IAnyStateTreeNode): session is SessionWithDockviewLayout;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { types } from '@jbrowse/mobx-state-tree';
|
|
2
|
-
export function DockviewLayoutMixin() {
|
|
3
|
-
return types
|
|
4
|
-
.model({
|
|
5
|
-
dockviewLayout: types.maybe(types.frozen()),
|
|
6
|
-
panelViewAssignments: types.optional(types.map(types.array(types.string)), {}),
|
|
7
|
-
init: types.frozen(),
|
|
8
|
-
activePanelId: types.maybe(types.string),
|
|
9
|
-
})
|
|
10
|
-
.views(self => ({
|
|
11
|
-
getViewIdsForPanel(panelId) {
|
|
12
|
-
return self.panelViewAssignments.get(panelId) ?? [];
|
|
13
|
-
},
|
|
14
|
-
}))
|
|
15
|
-
.actions(self => ({
|
|
16
|
-
setDockviewLayout(layout) {
|
|
17
|
-
self.dockviewLayout = layout;
|
|
18
|
-
},
|
|
19
|
-
setActivePanelId(panelId) {
|
|
20
|
-
self.activePanelId = panelId;
|
|
21
|
-
},
|
|
22
|
-
setInit(init) {
|
|
23
|
-
self.init = init;
|
|
24
|
-
},
|
|
25
|
-
assignViewToPanel(panelId, viewId) {
|
|
26
|
-
const existing = self.panelViewAssignments.get(panelId);
|
|
27
|
-
if (existing) {
|
|
28
|
-
if (!existing.includes(viewId)) {
|
|
29
|
-
existing.push(viewId);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
self.panelViewAssignments.set(panelId, [viewId]);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
removeViewFromPanel(viewId) {
|
|
37
|
-
for (const [panelId, viewIds] of self.panelViewAssignments.entries()) {
|
|
38
|
-
const idx = viewIds.indexOf(viewId);
|
|
39
|
-
if (idx !== -1) {
|
|
40
|
-
viewIds.splice(idx, 1);
|
|
41
|
-
if (viewIds.length === 0) {
|
|
42
|
-
self.panelViewAssignments.delete(panelId);
|
|
43
|
-
}
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
removePanel(panelId) {
|
|
49
|
-
self.panelViewAssignments.delete(panelId);
|
|
50
|
-
},
|
|
51
|
-
moveViewUpInPanel(viewId) {
|
|
52
|
-
for (const viewIds of self.panelViewAssignments.values()) {
|
|
53
|
-
const idx = viewIds.indexOf(viewId);
|
|
54
|
-
if (idx > 0) {
|
|
55
|
-
const temp = viewIds[idx - 1];
|
|
56
|
-
viewIds[idx - 1] = viewIds[idx];
|
|
57
|
-
viewIds[idx] = temp;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
moveViewDownInPanel(viewId) {
|
|
63
|
-
for (const viewIds of self.panelViewAssignments.values()) {
|
|
64
|
-
const idx = viewIds.indexOf(viewId);
|
|
65
|
-
if (idx !== -1 && idx < viewIds.length - 1) {
|
|
66
|
-
const temp = viewIds[idx + 1];
|
|
67
|
-
viewIds[idx + 1] = viewIds[idx];
|
|
68
|
-
viewIds[idx] = temp;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
moveViewToTopInPanel(viewId) {
|
|
74
|
-
for (const viewIds of self.panelViewAssignments.values()) {
|
|
75
|
-
const idx = viewIds.indexOf(viewId);
|
|
76
|
-
if (idx > 0) {
|
|
77
|
-
viewIds.splice(idx, 1);
|
|
78
|
-
viewIds.unshift(viewId);
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
moveViewToBottomInPanel(viewId) {
|
|
84
|
-
for (const viewIds of self.panelViewAssignments.values()) {
|
|
85
|
-
const idx = viewIds.indexOf(viewId);
|
|
86
|
-
if (idx !== -1 && idx < viewIds.length - 1) {
|
|
87
|
-
viewIds.splice(idx, 1);
|
|
88
|
-
viewIds.push(viewId);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
}))
|
|
94
|
-
.postProcessSnapshot(snap => {
|
|
95
|
-
if (!snap) {
|
|
96
|
-
return snap;
|
|
97
|
-
}
|
|
98
|
-
const { dockviewLayout, panelViewAssignments, init: _init, activePanelId, ...rest } = snap;
|
|
99
|
-
return {
|
|
100
|
-
...rest,
|
|
101
|
-
...(dockviewLayout !== undefined ? { dockviewLayout } : {}),
|
|
102
|
-
...(panelViewAssignments && Object.keys(panelViewAssignments).length
|
|
103
|
-
? { panelViewAssignments }
|
|
104
|
-
: {}),
|
|
105
|
-
...(activePanelId !== undefined ? { activePanelId } : {}),
|
|
106
|
-
};
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
export function isSessionWithDockviewLayout(session) {
|
|
110
|
-
return 'dockviewLayout' in session && 'setDockviewLayout' in session;
|
|
111
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { DockviewApi, DockviewGroupPanel } from 'dockview-react';
|
|
2
|
-
interface DockviewContextValue {
|
|
3
|
-
api: DockviewApi | null;
|
|
4
|
-
rearrangePanels: (arrange: (api: DockviewApi) => void) => void;
|
|
5
|
-
addEmptyTab: (targetGroup?: DockviewGroupPanel) => void;
|
|
6
|
-
moveViewToNewTab: (viewId: string) => void;
|
|
7
|
-
moveViewToSplitRight: (viewId: string) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function peekPendingMoveAction(): {
|
|
10
|
-
type: "newTab" | "splitRight";
|
|
11
|
-
viewId: string;
|
|
12
|
-
} | null;
|
|
13
|
-
export declare function clearPendingMoveAction(): void;
|
|
14
|
-
export declare function getPendingMoveAction(): {
|
|
15
|
-
type: "newTab" | "splitRight";
|
|
16
|
-
viewId: string;
|
|
17
|
-
} | null;
|
|
18
|
-
export declare function setPendingMoveToNewTab(viewId: string): void;
|
|
19
|
-
export declare function setPendingMoveToSplitRight(viewId: string): void;
|
|
20
|
-
export declare const DockviewContext: import("react").Context<DockviewContextValue>;
|
|
21
|
-
export declare function useDockview(): DockviewContextValue;
|
|
22
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
let pendingMoveAction = null;
|
|
3
|
-
export function peekPendingMoveAction() {
|
|
4
|
-
return pendingMoveAction;
|
|
5
|
-
}
|
|
6
|
-
export function clearPendingMoveAction() {
|
|
7
|
-
pendingMoveAction = null;
|
|
8
|
-
}
|
|
9
|
-
export function getPendingMoveAction() {
|
|
10
|
-
const action = pendingMoveAction;
|
|
11
|
-
pendingMoveAction = null;
|
|
12
|
-
return action;
|
|
13
|
-
}
|
|
14
|
-
export function setPendingMoveToNewTab(viewId) {
|
|
15
|
-
pendingMoveAction = { type: 'newTab', viewId };
|
|
16
|
-
}
|
|
17
|
-
export function setPendingMoveToSplitRight(viewId) {
|
|
18
|
-
pendingMoveAction = { type: 'splitRight', viewId };
|
|
19
|
-
}
|
|
20
|
-
export const DockviewContext = createContext({
|
|
21
|
-
api: null,
|
|
22
|
-
rearrangePanels: () => { },
|
|
23
|
-
addEmptyTab: () => { },
|
|
24
|
-
moveViewToNewTab: setPendingMoveToNewTab,
|
|
25
|
-
moveViewToSplitRight: setPendingMoveToSplitRight,
|
|
26
|
-
});
|
|
27
|
-
export function useDockview() {
|
|
28
|
-
return useContext(DockviewContext);
|
|
29
|
-
}
|