@jbrowse/product-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 (47) hide show
  1. package/esm/RootModel/BaseRootModel.d.ts +88 -47
  2. package/esm/RootModel/BaseRootModel.js +45 -2
  3. package/esm/RootModel/HierarchicalConfig.d.ts +3 -1
  4. package/esm/RootModel/HierarchicalConfig.js +3 -1
  5. package/esm/RootModel/InternetAccounts.d.ts +2 -0
  6. package/esm/RootModel/InternetAccounts.js +2 -0
  7. package/esm/RootModel/PreferencesConfig.d.ts +4 -4
  8. package/esm/RootModel/PreferencesConfig.js +4 -4
  9. package/esm/RootModel/menuItems.d.ts +1 -2
  10. package/esm/RootModel/menuItems.js +3 -4
  11. package/esm/Session/BaseSession.d.ts +7 -5
  12. package/esm/Session/BaseSession.js +15 -5
  13. package/esm/Session/Connections.d.ts +3 -0
  14. package/esm/Session/Connections.js +3 -0
  15. package/esm/Session/DrawerWidgets.d.ts +2 -0
  16. package/esm/Session/DrawerWidgets.js +2 -0
  17. package/esm/Session/MultipleViews.d.ts +122 -96
  18. package/esm/Session/MultipleViews.js +5 -3
  19. package/esm/Session/Preferences.d.ts +122 -97
  20. package/esm/Session/Preferences.js +5 -4
  21. package/esm/Session/ReferenceManagement.d.ts +2 -0
  22. package/esm/Session/ReferenceManagement.js +2 -0
  23. package/esm/Session/SessionTracks.d.ts +119 -93
  24. package/esm/Session/SessionTracks.js +2 -0
  25. package/esm/Session/Themes.d.ts +7 -5
  26. package/esm/Session/Themes.js +15 -10
  27. package/esm/Session/TrackMenu.d.ts +4 -8
  28. package/esm/Session/TrackMenu.js +13 -7
  29. package/esm/Session/TrackMenuSessionMixin.js +7 -3
  30. package/esm/Session/Tracks.d.ts +120 -93
  31. package/esm/Session/Tracks.js +3 -0
  32. package/esm/Session/pluginExtraTrackItems.d.ts +2 -3
  33. package/esm/Session/pluginExtraTrackItems.js +1 -1
  34. package/esm/sessionMigrations/index.js +2 -2
  35. package/esm/siblingCast.d.ts +6 -0
  36. package/esm/siblingCast.js +7 -0
  37. package/esm/ui/AboutDialog.d.ts +3 -2
  38. package/esm/ui/AboutDialog.js +4 -2
  39. package/esm/ui/DescriptionPanel.js +4 -4
  40. package/esm/ui/Drawer.js +11 -15
  41. package/esm/ui/HeaderButtons.d.ts +1 -1
  42. package/esm/ui/HeaderButtons.js +3 -2
  43. package/esm/ui/PreferenceCheckbox.d.ts +3 -2
  44. package/esm/ui/PreferenceCheckbox.js +4 -2
  45. package/esm/ui/WidgetHeading.d.ts +2 -2
  46. package/esm/ui/WidgetHeading.js +3 -2
  47. package/package.json +6 -6
@@ -56,6 +56,8 @@ function perIdComputed(derive) {
56
56
  }
57
57
  /**
58
58
  * #stateModel SessionTracksManagerSessionMixin
59
+ * Adds session tracks to a session, and stores the user's edits to any track
60
+ * as a delta against its base config.
59
61
  */
60
62
  export function SessionTracksManagerSessionMixin(pluginManager) {
61
63
  // A base is the raw config-file object — shorthand `uri`, no display stubs —
@@ -12,6 +12,8 @@ export type ThemeModeSelection = PaletteMode | 'system';
12
12
  export declare function storedThemeArgs(): SerializableThemeArgs;
13
13
  /**
14
14
  * #stateModel ThemeManagerSessionMixin
15
+ * Adds the UI theme to a session: the selected theme, light or dark mode or
16
+ * following the OS, and the themes an admin adds through `extraThemes`.
15
17
  */
16
18
  export declare function ThemeManagerSessionMixin(_pluginManager: PluginManager): import("@jbrowse/mobx-state-tree").IModelType<{}, {
17
19
  sessionThemeName: string;
@@ -35,7 +37,7 @@ export declare function ThemeManagerSessionMixin(_pluginManager: PluginManager):
35
37
  * #getter
36
38
  * Light, dark, or following the OS — the axis the palette is drawn
37
39
  * along, and what the mode picker shows. `effectiveThemeMode` is the
38
- * one to read for a colour decision.
40
+ * one to read for a color decision.
39
41
  */
40
42
  readonly themeMode: ThemeModeSelection;
41
43
  /**
@@ -132,10 +134,10 @@ export declare function ThemeManagerSessionMixin(_pluginManager: PluginManager):
132
134
  setSystemPrefersDark(dark: boolean): void;
133
135
  /**
134
136
  * #action
135
- * Hold a session that follows the system on the mode the OS is not
136
- * asking for, or `undefined` to follow it again. The toolbar's sun/moon
137
- * writes this, so it stays in the toolbar after a click. The OS flipping
138
- * clears it, since by then the OS has come round to the held mode. The
137
+ * Hold a session on the mode its setting is not asking for, or
138
+ * `undefined` to return to the setting. The toolbar's sun/moon writes
139
+ * this, so it stays in the toolbar after a click. The OS flipping clears
140
+ * it, since by then the OS has come round to the held mode. The
139
141
  * palette is untouched: a reader on Minimal who does this keeps Minimal.
140
142
  */
141
143
  setSystemThemeOverride(mode?: PaletteMode): void;
@@ -56,13 +56,14 @@ export function storedThemeArgs() {
56
56
  const { sessionThemeName, sessionThemeMode, systemThemeOverride } = storedSelection();
57
57
  return {
58
58
  themeName: sessionThemeName,
59
- mode: sessionThemeMode === 'system'
60
- ? (systemThemeOverride ?? systemMode())
61
- : sessionThemeMode,
59
+ mode: systemThemeOverride ??
60
+ (sessionThemeMode === 'system' ? systemMode() : sessionThemeMode),
62
61
  };
63
62
  }
64
63
  /**
65
64
  * #stateModel ThemeManagerSessionMixin
65
+ * Adds the UI theme to a session: the selected theme, light or dark mode or
66
+ * following the OS, and the themes an admin adds through `extraThemes`.
66
67
  */
67
68
  export function ThemeManagerSessionMixin(_pluginManager) {
68
69
  return types
@@ -95,7 +96,7 @@ export function ThemeManagerSessionMixin(_pluginManager) {
95
96
  * #getter
96
97
  * Light, dark, or following the OS — the axis the palette is drawn
97
98
  * along, and what the mode picker shows. `effectiveThemeMode` is the
98
- * one to read for a colour decision.
99
+ * one to read for a color decision.
99
100
  */
100
101
  get themeMode() {
101
102
  return self.sessionThemeMode;
@@ -107,9 +108,13 @@ export function ThemeManagerSessionMixin(_pluginManager) {
107
108
  * Dark Reader never touches the file.
108
109
  */
109
110
  get selectedThemeMode() {
111
+ if (self.systemThemeOverride) {
112
+ return self.systemThemeOverride;
113
+ }
110
114
  return this.themeMode === 'system'
111
- ? (self.systemThemeOverride ??
112
- (self.systemPrefersDark ? 'dark' : 'light'))
115
+ ? self.systemPrefersDark
116
+ ? 'dark'
117
+ : 'light'
113
118
  : this.themeMode;
114
119
  },
115
120
  /**
@@ -257,10 +262,10 @@ export function ThemeManagerSessionMixin(_pluginManager) {
257
262
  },
258
263
  /**
259
264
  * #action
260
- * Hold a session that follows the system on the mode the OS is not
261
- * asking for, or `undefined` to follow it again. The toolbar's sun/moon
262
- * writes this, so it stays in the toolbar after a click. The OS flipping
263
- * clears it, since by then the OS has come round to the held mode. The
265
+ * Hold a session on the mode its setting is not asking for, or
266
+ * `undefined` to return to the setting. The toolbar's sun/moon writes
267
+ * this, so it stays in the toolbar after a click. The OS flipping clears
268
+ * it, since by then the OS has come round to the held mode. The
264
269
  * palette is untouched: a reader on Minimal who does this keeps Minimal.
265
270
  */
266
271
  setSystemThemeOverride(mode) {
@@ -2,8 +2,7 @@ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  import type { AnyConfigurationModel, AnyTrackConfig } from '@jbrowse/core/configuration';
3
3
  import type { BaseTrackConfig } from '@jbrowse/core/pluggableElementTypes';
4
4
  import type { MenuItem } from '@jbrowse/core/ui';
5
- import type { DialogComponentType } from '@jbrowse/core/util';
6
- import type { TrackActionView } from '@jbrowse/core/util/types';
5
+ import type { AbstractSessionModel, TrackActionView } from '@jbrowse/core/util/types';
7
6
  interface TrackActionSession<C> {
8
7
  editConfiguration: (config: AnyConfigurationModel | {
9
8
  trackId: string;
@@ -47,21 +46,18 @@ export declare function trackActionItems<C extends {
47
46
  isSessionOverride?: boolean;
48
47
  makeCopy: () => C;
49
48
  }): MenuItem[];
50
- export interface SessionWithDialog {
51
- queueDialog: (cb: (done: () => void) => [DialogComponentType, Record<string, unknown>]) => void;
52
- }
53
49
  type TrackConfig = AnyConfigurationModel | Record<string, unknown>;
54
50
  /** "About track" menu item, shared by every product's track menu */
55
- export declare function aboutTrackMenuItem(session: SessionWithDialog, config: TrackConfig): MenuItem;
51
+ export declare function aboutTrackMenuItem(session: AbstractSessionModel, config: TrackConfig): MenuItem;
56
52
  /**
57
53
  * flattened track menu (About + raw actions) for the hierarchical track selector
58
54
  */
59
- export declare function trackListMenuItems(session: SessionWithDialog, config: TrackConfig, actions: MenuItem[]): MenuItem[];
55
+ export declare function trackListMenuItems(session: AbstractSessionModel, config: TrackConfig, actions: MenuItem[]): MenuItem[];
60
56
  /**
61
57
  * track menu with an "About track" item and a "Track actions" submenu, for the
62
58
  * in-view track label menu
63
59
  */
64
- export declare function trackActionMenuItems(session: SessionWithDialog, config: TrackConfig, actions: MenuItem[]): MenuItem[];
60
+ export declare function trackActionMenuItems(session: AbstractSessionModel, config: TrackConfig, actions: MenuItem[]): MenuItem[];
65
61
  /**
66
62
  * #stateModel TrackMenuItemsSessionMixin
67
63
  *
@@ -1,5 +1,6 @@
1
1
  import { lazy } from 'react';
2
2
  import { InfoIcon } from '@jbrowse/core/ui/Icons';
3
+ import { TRACK_MENU_PRIORITY } from '@jbrowse/core/ui/menuItems';
3
4
  import { namesTemporaryAssembly } from '@jbrowse/core/util';
4
5
  import { types } from '@jbrowse/mobx-state-tree';
5
6
  import DeleteIcon from '@mui/icons-material/Delete';
@@ -7,6 +8,7 @@ import CopyIcon from '@mui/icons-material/FileCopy';
7
8
  import OpenInNewIcon from '@mui/icons-material/OpenInNew';
8
9
  import SettingsIcon from '@mui/icons-material/Settings';
9
10
  import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore';
11
+ import { asAbstractSession } from '../siblingCast.js';
10
12
  import { pluginExtraTrackItems } from './pluginExtraTrackItems.js';
11
13
  const AboutDialog = lazy(() => import('../ui/AboutDialog.js'));
12
14
  /**
@@ -124,15 +126,18 @@ export function trackActionMenuItems(session, config, actions) {
124
126
  return [
125
127
  {
126
128
  ...aboutTrackMenuItem(session, config),
127
- priority: 1002,
129
+ priority: TRACK_MENU_PRIORITY.aboutTrack,
128
130
  },
129
131
  {
130
132
  type: 'subMenu',
131
133
  label: 'Track actions',
132
- priority: 1001,
134
+ priority: TRACK_MENU_PRIORITY.trackActions,
133
135
  subMenu: actions,
134
136
  },
135
- { type: 'divider' },
137
+ {
138
+ type: 'divider',
139
+ priority: TRACK_MENU_PRIORITY.trackActionsDivider,
140
+ },
136
141
  ];
137
142
  }
138
143
  // (TrackMenuSessionMixin — the minimal embedded-view variant — lives in its own
@@ -149,6 +154,7 @@ export function trackActionMenuItems(session, config, actions) {
149
154
  export function TrackMenuItemsSessionMixin(pluginManager) {
150
155
  return types.model('TrackMenuItemsSessionMixin', {}).views(s => {
151
156
  const self = s;
157
+ const session = asAbstractSession(self);
152
158
  return {
153
159
  /**
154
160
  * #method
@@ -156,8 +162,8 @@ export function TrackMenuItemsSessionMixin(pluginManager) {
156
162
  */
157
163
  getTrackListMenuItems(config, view) {
158
164
  return [
159
- ...trackListMenuItems(self, config, self.getTrackActions(config, view)),
160
- ...pluginExtraTrackItems(pluginManager, self, config, view),
165
+ ...trackListMenuItems(session, config, self.getTrackActions(config, view)),
166
+ ...pluginExtraTrackItems(pluginManager, session, config, view),
161
167
  ];
162
168
  },
163
169
  /**
@@ -165,9 +171,9 @@ export function TrackMenuItemsSessionMixin(pluginManager) {
165
171
  * track menu with About + "Track actions" submenu for the in-view label
166
172
  */
167
173
  getTrackActionMenuItems({ config, view, }) {
168
- return trackActionMenuItems(self, config, [
174
+ return trackActionMenuItems(session, config, [
169
175
  ...self.getTrackActions(config, view),
170
- ...pluginExtraTrackItems(pluginManager, self, config, view),
176
+ ...pluginExtraTrackItems(pluginManager, session, config, view),
171
177
  ]);
172
178
  },
173
179
  };
@@ -1,5 +1,6 @@
1
+ import { TRACK_MENU_PRIORITY } from '@jbrowse/core/ui/menuItems';
1
2
  import { types } from '@jbrowse/mobx-state-tree';
2
- import { asSession } from '../siblingCast.js';
3
+ import { asAbstractSession } from '../siblingCast.js';
3
4
  import { aboutTrackMenuItem, trackListMenuItems } from './TrackMenu.js';
4
5
  import { pluginExtraTrackItems } from './pluginExtraTrackItems.js';
5
6
  /**
@@ -13,7 +14,7 @@ import { pluginExtraTrackItems } from './pluginExtraTrackItems.js';
13
14
  */
14
15
  export function TrackMenuSessionMixin(pluginManager) {
15
16
  return types.model('TrackMenuSessionMixin', {}).views(s => {
16
- const self = asSession(s);
17
+ const self = asAbstractSession(s);
17
18
  return {
18
19
  /**
19
20
  * #method
@@ -33,7 +34,10 @@ export function TrackMenuSessionMixin(pluginManager) {
33
34
  // priority mirrors the full TrackMenuItemsSessionMixin so "About
34
35
  // track" sorts to the top of the in-view label menu consistently
35
36
  // across embedded and full products
36
- { ...aboutTrackMenuItem(self, config), priority: 1002 },
37
+ {
38
+ ...aboutTrackMenuItem(self, config),
39
+ priority: TRACK_MENU_PRIORITY.aboutTrack,
40
+ },
37
41
  ...pluginExtraTrackItems(pluginManager, self, config, view),
38
42
  ];
39
43
  },