@jbrowse/app-core 5.0.0-beta.13 → 5.0.0-beta.14

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 (44) hide show
  1. package/esm/AppSession/AppSessionMixin.d.ts +110 -92
  2. package/esm/Assemblies/AssembliesMixin.d.ts +30 -0
  3. package/esm/HistoryManagement/index.d.ts +2 -0
  4. package/esm/HistoryManagement/index.js +2 -0
  5. package/esm/JBrowseConfig/RootConfiguration.d.ts +3 -2
  6. package/esm/JBrowseConfig/RootConfiguration.js +3 -2
  7. package/esm/JBrowseConfig/index.d.ts +2 -3
  8. package/esm/JBrowseConfig/index.js +2 -3
  9. package/esm/JBrowseModel/index.d.ts +9 -1
  10. package/esm/JBrowseModel/index.js +8 -7
  11. package/esm/JbApi/jbApi.js +5 -2
  12. package/esm/RootMenu/index.d.ts +2 -0
  13. package/esm/RootMenu/index.js +2 -0
  14. package/esm/SessionSpec/index.d.ts +2 -2
  15. package/esm/SessionSpec/index.js +1 -1
  16. package/esm/SessionSpec/parseSessionSpecUrl.d.ts +19 -0
  17. package/esm/SessionSpec/parseSessionSpecUrl.js +29 -0
  18. package/esm/WorkspaceLayout/WorkspaceContainer.js +2 -10
  19. package/esm/WorkspaceLayout/WorkspacePanelActions.js +1 -1
  20. package/esm/WorkspaceLayout/WorkspaceTab.d.ts +2 -3
  21. package/esm/WorkspaceLayout/WorkspaceTab.js +2 -2
  22. package/esm/WorkspaceLayout/model.d.ts +10 -15
  23. package/esm/WorkspaceLayout/model.js +36 -65
  24. package/esm/WorkspaceLayout/tree.d.ts +3 -6
  25. package/esm/WorkspaceLayout/tree.js +8 -12
  26. package/esm/WorkspaceLayout/useLayoutDrag.js +10 -4
  27. package/esm/index.d.ts +5 -3
  28. package/esm/index.js +3 -2
  29. package/esm/queryParams.d.ts +2 -0
  30. package/esm/queryParams.js +16 -5
  31. package/esm/sessionSummary.d.ts +16 -0
  32. package/esm/sessionSummary.js +57 -0
  33. package/esm/ui/App/DrawerHeaderHelpDialog.d.ts +3 -2
  34. package/esm/ui/App/DrawerHeaderHelpDialog.js +4 -2
  35. package/esm/ui/App/JBrowseTabMenu.d.ts +3 -2
  36. package/esm/ui/App/JBrowseTabMenu.js +4 -2
  37. package/esm/ui/App/ThemeModeButton.d.ts +4 -5
  38. package/esm/ui/App/ThemeModeButton.js +18 -11
  39. package/esm/ui/App/ViewContainer.js +7 -1
  40. package/esm/ui/App/ViewMenu.js +34 -25
  41. package/esm/ui/App/ViewWrapper.js +2 -2
  42. package/esm/ui/App/viewTitle.d.ts +6 -1
  43. package/esm/ui/App/viewTitle.js +7 -2
  44. package/package.json +6 -6
@@ -26,19 +26,18 @@ const ViewMenu = observer(function ViewMenu({ model, className, }) {
26
26
  bottom: session.moveViewToBottom,
27
27
  };
28
28
  const moveViewOut = (to) => {
29
- const allViewIds = session.views.map(v => v.id);
30
29
  if (to === 'tab') {
31
- session.moveViewToNewTab(model.id, allViewIds);
30
+ session.moveViewToNewTab(model.id);
32
31
  }
33
32
  else {
34
- session.moveViewToSplit(model.id, to, allViewIds);
33
+ session.moveViewToSplit(model.id, to);
35
34
  }
36
35
  };
37
36
  // views render in `session.views` order within a tab, so a view joining one
38
37
  // goes to its bottom rather than wherever its old slot falls
39
38
  const moveViewToTab = (tabId) => {
40
39
  const members = session.findTab(tabId)?.tab.viewIds ?? [];
41
- session.moveViewToTab(model.id, tabId, session.views.map(v => v.id));
40
+ session.moveViewToTab(model.id, tabId);
42
41
  session.moveViewToBottom(model.id, [...members, model.id]);
43
42
  };
44
43
  return (_jsx(CascadingMenuButton, { "data-testid": "view_menu_icon", tooltip: "View menu", menuItems: () => {
@@ -50,6 +49,8 @@ const ViewMenu = observer(function ViewMenu({ model, className, }) {
50
49
  ? session.tabs.filter(t => t.id !== home.tab.id)
51
50
  : [];
52
51
  const viewCount = scopeIds?.length ?? session.views.length;
52
+ const aloneInTab = viewCount <= 1;
53
+ const aloneInCell = aloneInTab && (home?.panel.tabs.length ?? 1) <= 1;
53
54
  return [
54
55
  {
55
56
  label: 'View options',
@@ -62,13 +63,17 @@ const ViewMenu = observer(function ViewMenu({ model, className, }) {
62
63
  session.addView(model.type, renameIds(getSnapshot(model)));
63
64
  },
64
65
  },
65
- {
66
- label: 'Move to new tab',
67
- icon: OpenInNewIcon,
68
- onClick: () => {
69
- moveViewOut('tab');
70
- },
71
- },
66
+ ...(aloneInTab
67
+ ? []
68
+ : [
69
+ {
70
+ label: 'Move to new tab',
71
+ icon: OpenInNewIcon,
72
+ onClick: () => {
73
+ moveViewOut('tab');
74
+ },
75
+ },
76
+ ]),
72
77
  ...(otherTabs.length > 0
73
78
  ? [
74
79
  {
@@ -84,20 +89,24 @@ const ViewMenu = observer(function ViewMenu({ model, className, }) {
84
89
  },
85
90
  ]
86
91
  : []),
87
- {
88
- label: 'Move to split view (right)',
89
- icon: VerticalSplitIcon,
90
- onClick: () => {
91
- moveViewOut('row');
92
- },
93
- },
94
- {
95
- label: 'Move to split view (below)',
96
- icon: HorizontalSplitIcon,
97
- onClick: () => {
98
- moveViewOut('column');
99
- },
100
- },
92
+ ...(aloneInCell
93
+ ? []
94
+ : [
95
+ {
96
+ label: 'Move to split view (right)',
97
+ icon: VerticalSplitIcon,
98
+ onClick: () => {
99
+ moveViewOut('row');
100
+ },
101
+ },
102
+ {
103
+ label: 'Move to split view (below)',
104
+ icon: HorizontalSplitIcon,
105
+ onClick: () => {
106
+ moveViewOut('column');
107
+ },
108
+ },
109
+ ]),
101
110
  // 'top'/'bottom' only mean something with a view above *and* below
102
111
  ...[
103
112
  ['top', 'Move view to top', KeyboardDoubleArrowUpIcon, 2],
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Suspense } from 'react';
3
+ import { ViewLoadingScreen } from '@jbrowse/core/ui';
3
4
  import { ErrorBoundary } from '@jbrowse/core/ui/ErrorBoundary';
4
- import LoadingEllipses from '@jbrowse/core/ui/LoadingEllipses';
5
5
  import { getEnv } from '@jbrowse/core/util';
6
6
  import { observer } from 'mobx-react';
7
7
  import ViewErrorFallback from './ViewErrorFallback.js';
@@ -12,7 +12,7 @@ import ViewErrorFallback from './ViewErrorFallback.js';
12
12
  const ViewComponent = observer(function ViewComponent({ view, session, }) {
13
13
  const { pluginManager } = getEnv(session);
14
14
  const { ReactComponent } = pluginManager.getViewType(view.type);
15
- return (_jsx(Suspense, { fallback: _jsx(LoadingEllipses, { variant: "h6", "data-view-component-pending": "true" }), children: _jsx(ReactComponent, { model: view, session: session }) }));
15
+ return (_jsx(Suspense, { fallback: _jsx("div", { "data-view-component-pending": "true", children: _jsx(ViewLoadingScreen, {}) }), children: _jsx(ReactComponent, { model: view, session: session }) }));
16
16
  });
17
17
  /**
18
18
  * A view's body, and the boundary that keeps a view that throws from being an
@@ -2,10 +2,15 @@ interface TitledView {
2
2
  displayName?: string;
3
3
  assemblyNames?: string[];
4
4
  minimized?: boolean;
5
+ initialized?: boolean;
6
+ showImportForm?: boolean;
7
+ error?: unknown;
5
8
  }
6
9
  /**
7
10
  * 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.
11
+ * clearing the title in the header puts the derived one back. A view still
12
+ * resolving its assembly is not untitled, only unnamed so far, so it reads
13
+ * blank rather than "Untitled view" for the moment before its name arrives.
9
14
  */
10
15
  export declare function viewName(view: TitledView, getDisplayName: (assemblyName: string) => string): string;
11
16
  export declare function viewTitle(view: TitledView, getDisplayName: (assemblyName: string) => string): string;
@@ -1,15 +1,20 @@
1
1
  /**
2
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.
3
+ * clearing the title in the header puts the derived one back. A view still
4
+ * resolving its assembly is not untitled, only unnamed so far, so it reads
5
+ * blank rather than "Untitled view" for the moment before its name arrives.
4
6
  */
5
7
  export function viewName(view, getDisplayName) {
6
8
  // assemblyNames is [] (not undefined) for a view with no displayed regions
7
9
  // yet, so fall back on emptiness rather than nullishness
8
10
  const assemblyNames = view.assemblyNames ?? [];
11
+ const launching = view.initialized === false && !view.showImportForm && !view.error;
9
12
  return (view.displayName ||
10
13
  (assemblyNames.length
11
14
  ? assemblyNames.map(r => getDisplayName(r)).join(', ')
12
- : 'Untitled view'));
15
+ : launching
16
+ ? ''
17
+ : 'Untitled view'));
13
18
  }
14
19
  export function viewTitle(view, getDisplayName) {
15
20
  const name = viewName(view, getDisplayName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/app-core",
3
- "version": "5.0.0-beta.13",
3
+ "version": "5.0.0-beta.14",
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,13 +24,13 @@
24
24
  "esm"
25
25
  ],
26
26
  "dependencies": {
27
- "@jbrowse/mobx-state-tree": "^6.7.0",
28
- "@mui/icons-material": "^9.4.0",
29
- "@mui/material": "^9.4.0",
27
+ "@jbrowse/mobx-state-tree": "^6.9.0",
28
+ "@mui/icons-material": "^9.5.0",
29
+ "@mui/material": "^9.5.0",
30
30
  "mobx": "^7.0.6",
31
31
  "mobx-react": "^10.0.2",
32
- "@jbrowse/product-core": "^5.0.0-beta.13",
33
- "@jbrowse/core": "^5.0.0-beta.13"
32
+ "@jbrowse/core": "^5.0.0-beta.14",
33
+ "@jbrowse/product-core": "^5.0.0-beta.14"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": ">=19.0.0",