@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
@@ -8,6 +8,9 @@ import { assertNotReaddedDifferently } from './readdedTrackConf.js';
8
8
  import { assertTrackConfOutlivesItsAssemblies } from './temporaryAssemblyTracks.js';
9
9
  /**
10
10
  * #stateModel TracksManagerSessionMixin
11
+ * Adds track configs to a session: looking one up by trackId among the
12
+ * config's tracks, assembly sequences and connection tracks, and adding or
13
+ * editing one.
11
14
  */
12
15
  export function TracksManagerSessionMixin(pluginManager) {
13
16
  return types
@@ -1,11 +1,10 @@
1
- import type { SessionWithDialog } from './TrackMenu.ts';
2
1
  import type PluginManager from '@jbrowse/core/PluginManager';
3
2
  import type { AnyTrackConfig } from '@jbrowse/core/configuration';
4
3
  import type { MenuItem } from '@jbrowse/core/ui';
5
- import type { TrackActionView } from '@jbrowse/core/util/types';
4
+ import type { AbstractSessionModel, TrackActionView } from '@jbrowse/core/util/types';
6
5
  /**
7
6
  * plugin-contributed per-track items (`Core-extraTrackMenuItems`), surfaced in
8
7
  * both the hierarchical selector and the in-view label menu so plugins reach
9
8
  * every track menu consistently
10
9
  */
11
- export declare function pluginExtraTrackItems(pluginManager: PluginManager, session: SessionWithDialog, config: AnyTrackConfig, view?: TrackActionView): MenuItem[];
10
+ export declare function pluginExtraTrackItems(pluginManager: PluginManager, session: AbstractSessionModel, config: AnyTrackConfig, view?: TrackActionView): MenuItem[];
@@ -6,7 +6,7 @@ import { buildExtraTrackMenuItems } from '@jbrowse/core/ui/buildExtraTrackMenuIt
6
6
  */
7
7
  export function pluginExtraTrackItems(pluginManager, session, config, view) {
8
8
  return buildExtraTrackMenuItems(pluginManager, {
9
- session: session,
9
+ session,
10
10
  config,
11
11
  view,
12
12
  });
@@ -40,14 +40,14 @@ function migrateDisplay(display, trackConfigId, resolve, collected) {
40
40
  if (typeof configuration !== 'string') {
41
41
  return { ...display, type: displayType.name };
42
42
  }
43
+ const meta = getConfigurationSchemaMetadata(displayType.configSchema);
43
44
  const lifted = {
44
45
  ...state?.lift(display),
45
- ...(typeof display.heightPreConfig === 'number'
46
+ ...(typeof display.heightPreConfig === 'number' && meta?.definition.height
46
47
  ? { height: display.heightPreConfig }
47
48
  : {}),
48
49
  };
49
50
  const migrated = retired?.migrate?.(lifted) ?? lifted;
50
- const meta = getConfigurationSchemaMetadata(displayType.configSchema);
51
51
  const settings = meta ? liftRetiredSpellings(meta, migrated) : migrated;
52
52
  const displayId = retired && configuration === `${trackConfigId}-${retired.type}`
53
53
  ? `${trackConfigId}-${displayType.name}`
@@ -1,5 +1,6 @@
1
1
  import type { BaseRootModel } from './RootModel/BaseRootModel.ts';
2
2
  import type { BaseSession } from './Session/BaseSession.ts';
3
+ import type { AbstractSessionModel } from '@jbrowse/core/util';
3
4
  /**
4
5
  * `types.compose` can't thread the types of sibling mixins into one another, so
5
6
  * a mixin that reaches members contributed by a co-composed base (`jbrowse`,
@@ -12,3 +13,8 @@ import type { BaseSession } from './Session/BaseSession.ts';
12
13
  */
13
14
  export declare function asSession<S>(self: S): S & BaseSession;
14
15
  export declare function asRoot<S>(self: S): S & BaseRootModel;
16
+ /**
17
+ * A session mixin's `self` as the whole session, for handing to something
18
+ * declared over `AbstractSessionModel` (a dialog, a plugin extension point).
19
+ */
20
+ export declare function asAbstractSession(self: unknown): AbstractSessionModel;
@@ -14,3 +14,10 @@ export function asSession(self) {
14
14
  export function asRoot(self) {
15
15
  return self;
16
16
  }
17
+ /**
18
+ * A session mixin's `self` as the whole session, for handing to something
19
+ * declared over `AbstractSessionModel` (a dialog, a plugin extension point).
20
+ */
21
+ export function asAbstractSession(self) {
22
+ return self;
23
+ }
@@ -1,6 +1,6 @@
1
1
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
2
  import type { AbstractSessionModel } from '@jbrowse/core/util';
3
- export default function AboutDialog({ config, session, handleClose, }: {
3
+ declare const AboutDialog: ({ config, session, handleClose, }: {
4
4
  session: AbstractSessionModel;
5
5
  /**
6
6
  * the in-view track label passes `track.configuration`, a live node; the
@@ -9,4 +9,5 @@ export default function AboutDialog({ config, session, handleClose, }: {
9
9
  */
10
10
  config: AnyConfigurationModel | Record<string, unknown>;
11
11
  handleClose: () => void;
12
- }): import("react").JSX.Element;
12
+ }) => import("react").JSX.Element;
13
+ export default AboutDialog;
@@ -7,8 +7,9 @@ import Dialog from '@jbrowse/core/ui/Dialog';
7
7
  import { getEnv } from '@jbrowse/core/util';
8
8
  import { getTrackName } from '@jbrowse/core/util/tracks';
9
9
  import { isStateTreeNode } from '@jbrowse/mobx-state-tree';
10
+ import { observer } from 'mobx-react';
10
11
  import AboutContents from './AboutDialogContents.js';
11
- export default function AboutDialog({ config, session, handleClose, }) {
12
+ const AboutDialog = observer(function AboutDialog({ config, session, handleClose, }) {
12
13
  const { pluginManager } = getEnv(session);
13
14
  // hydrated once here, so every panel and every plugin on the two About points
14
15
  // reads one live node: "Copy config" gives the same JSON whichever menu
@@ -17,4 +18,5 @@ export default function AboutDialog({ config, session, handleClose, }) {
17
18
  ? config
18
19
  : hydrateTrackConfig(pluginManager, config);
19
20
  return (_jsx(Dialog, { open: true, onClose: handleClose, title: getTrackName(config, session), maxWidth: "xl", children: live ? (_jsx(PluggableComponent, { pluginManager: pluginManager, name: "Core-replaceAbout", component: AboutContents, props: { config: live, session } })) : (_jsx(BaseCard, { title: "Configuration", children: _jsx(Attributes, { attributes: config }) })) }));
20
- }
21
+ });
22
+ export default AboutDialog;
@@ -43,14 +43,14 @@ const useStyles = makeStyles()(theme => ({
43
43
  },
44
44
  },
45
45
  }));
46
- function Prose({ html }) {
46
+ const Prose = observer(function Prose({ html }) {
47
47
  const { classes } = useStyles();
48
48
  return _jsx(SanitizedHTML, { html: html, className: classes.prose });
49
- }
50
- function DescriptionCard({ url, children, }) {
49
+ });
50
+ const DescriptionCard = observer(function DescriptionCard({ url, children, }) {
51
51
  const { classes } = useStyles();
52
52
  return (_jsxs(BaseCard, { title: "Description", children: [_jsxs(Typography, { variant: "caption", color: "textSecondary", component: "div", className: classes.provenance, children: ["The track's description, written for the UCSC Genome Browser \u2014 some display options it describes differ in JBrowse.", url ? (_jsxs(_Fragment, { children: [' ', _jsx(Link, { href: url, target: "_blank", rel: "noopener noreferrer", children: "View original" })] })) : null] }), children] }));
53
- }
53
+ });
54
54
  const FetchedDescription = observer(function FetchedDescription({ url, }) {
55
55
  const { data: html, error, isLoading, } = useFetch(['trackDescriptionHtml', url], async (_name, url) => rebaseDescriptionHtml(await openLocation({ uri: url, locationType: 'UriLocation' }).readFile('utf8'), url));
56
56
  return (_jsx(DescriptionCard, { url: url, children: error ? (_jsx(ErrorBanner, { error: error })) : isLoading || html === undefined ? (_jsx(LoadingEllipses, { message: "Loading description" })) : (_jsx(Prose, { html: html })) }));
package/esm/ui/Drawer.js CHANGED
@@ -6,38 +6,34 @@ import { makeStyles } from '@jbrowse/core/util/tss-react';
6
6
  import { Paper } from '@mui/material';
7
7
  import { observer } from 'mobx-react';
8
8
  const useStyles = makeStyles()(theme => ({
9
- // The grid item, and the handle's containing block. Its own box rather than
10
- // the Paper's because the Paper is the thing that SCROLLS: a handle
11
- // positioned against it starts at the top of the scrolled content and rides
12
- // away with it, and one taken out of flow with `position: fixed` is measured
13
- // against the window instead — which is the same box only in a full-window
14
- // app, and put a page-tall col-resize strip down an embedded view's page.
9
+ // The grid item. The handle is a flex sibling of the Paper, so it takes its
10
+ // own 4px instead of covering the widget's edge text.
15
11
  root: {
16
12
  // the drawer places itself, so a host renders it once wherever it likes
17
13
  // rather than on the side matching `drawerPosition` (see
18
14
  // `drawerGridTemplateColumns`)
19
15
  gridColumn: 'drawer',
20
- position: 'relative',
16
+ // the last row: a drawer with no row of its own auto-places after the
17
+ // main item and drops to a new row when it sits on the left
18
+ gridRow: '-2 / -1',
19
+ display: 'flex',
21
20
  height: '100%',
22
21
  minWidth: 0,
23
22
  },
24
23
  paper: {
25
24
  overflowY: 'auto',
26
25
  height: '100%',
26
+ flex: 1,
27
+ minWidth: 0,
27
28
  // widgets position their own overlays against this
28
29
  position: 'relative',
29
30
  zIndex: DRAWER_Z_INDEX,
30
31
  outline: 'none',
31
32
  background: theme.palette.background.default,
32
33
  },
33
- resizeHandle: {
34
- position: 'absolute',
35
- top: 0,
36
- zIndex: DRAWER_Z_INDEX + 1,
37
- },
38
- // whichever edge faces the main content
39
- handleForLeftDrawer: { right: 0 },
40
- handleForRightDrawer: { left: 0 },
34
+ resizeHandle: { flexShrink: 0 },
35
+ handleForLeftDrawer: { order: 1 },
36
+ handleForRightDrawer: { order: -1 },
41
37
  }));
42
38
  /**
43
39
  * The drawer's chrome: the paper it sits on and the handle that resizes it.
@@ -3,5 +3,5 @@ interface HeaderButtonsProps {
3
3
  hideUris?: boolean;
4
4
  setShowRefNames: (show: boolean) => void;
5
5
  }
6
- declare function HeaderButtons({ conf, hideUris, setShowRefNames, }: HeaderButtonsProps): import("react").JSX.Element;
6
+ declare const HeaderButtons: ({ conf, hideUris, setShowRefNames, }: HeaderButtonsProps) => import("react").JSX.Element;
7
7
  export default HeaderButtons;
@@ -3,6 +3,7 @@ import { CopyToClipboardButton } from '@jbrowse/core/ui';
3
3
  import { stripBaseUris } from '@jbrowse/core/util/addRelativeUris';
4
4
  import { makeStyles } from '@jbrowse/core/util/tss-react';
5
5
  import { Button } from '@mui/material';
6
+ import { observer } from 'mobx-react';
6
7
  const useStyles = makeStyles()(theme => ({
7
8
  button: {
8
9
  float: 'right',
@@ -15,10 +16,10 @@ const useStyles = makeStyles()(theme => ({
15
16
  justifyContent: 'flex-end',
16
17
  },
17
18
  }));
18
- function HeaderButtons({ conf, hideUris, setShowRefNames, }) {
19
+ const HeaderButtons = observer(function HeaderButtons({ conf, hideUris, setShowRefNames, }) {
19
20
  const { classes } = useStyles();
20
21
  return (_jsx("span", { className: classes.button, children: _jsxs("span", { className: classes.buttons, children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
21
22
  setShowRefNames(true);
22
23
  }, children: "Show ref names" }), hideUris ? null : (_jsx(CopyToClipboardButton, { variant: "contained", value: () => JSON.stringify(stripBaseUris(structuredClone(conf)), null, 2), children: "Copy config" }))] }) }));
23
- }
24
+ });
24
25
  export default HeaderButtons;
@@ -1,6 +1,7 @@
1
- export default function PreferenceCheckbox({ checked, label, help, onChange, }: {
1
+ declare const PreferenceCheckbox: ({ checked, label, help, onChange, }: {
2
2
  checked: boolean;
3
3
  label: string;
4
4
  help?: string;
5
5
  onChange: (checked: boolean) => void;
6
- }): import("react").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
+ export default PreferenceCheckbox;
@@ -2,15 +2,17 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
2
2
  import { LabeledCheckbox } from '@jbrowse/core/ui';
3
3
  import { makeStyles } from '@jbrowse/core/util/tss-react';
4
4
  import { Typography } from '@mui/material';
5
+ import { observer } from 'mobx-react';
5
6
  const useStyles = makeStyles()({
6
7
  row: {
7
8
  alignItems: 'flex-start',
8
9
  marginTop: 8,
9
10
  },
10
11
  });
11
- export default function PreferenceCheckbox({ checked, label, help, onChange, }) {
12
+ const PreferenceCheckbox = observer(function PreferenceCheckbox({ checked, label, help, onChange, }) {
12
13
  const { classes } = useStyles();
13
14
  return (_jsx(LabeledCheckbox, { className: classes.row, checked: checked, onChange: checked => {
14
15
  onChange(checked);
15
16
  }, label: _jsxs(_Fragment, { children: [_jsx(Typography, { children: label }), help ? (_jsx(Typography, { variant: "body2", color: "text.secondary", children: help })) : null] }) }));
16
- }
17
+ });
18
+ export default PreferenceCheckbox;
@@ -1,7 +1,7 @@
1
1
  import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  import type { Widget } from '@jbrowse/core/util';
3
- declare function WidgetHeading({ widget, pluginManager, }: {
3
+ declare const WidgetHeading: ({ widget, pluginManager, }: {
4
4
  widget: Widget;
5
5
  pluginManager: PluginManager;
6
- }): import("react").JSX.Element;
6
+ }) => import("react").JSX.Element;
7
7
  export default WidgetHeading;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Typography } from '@mui/material';
3
- function WidgetHeading({ widget, pluginManager, }) {
3
+ import { observer } from 'mobx-react';
4
+ const WidgetHeading = observer(function WidgetHeading({ widget, pluginManager, }) {
4
5
  const { HeadingComponent, heading } = pluginManager.getWidgetType(widget.type);
5
6
  return HeadingComponent ? (_jsx(HeadingComponent, { model: widget })) : (_jsx(Typography, { variant: "h6", color: "inherit", children: heading }));
6
- }
7
+ });
7
8
  export default WidgetHeading;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/product-core",
3
- "version": "5.0.0-beta.13",
3
+ "version": "5.0.0-beta.14",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "JBrowse 2 code shared between products but not used by plugins",
@@ -28,13 +28,13 @@
28
28
  "esm"
29
29
  ],
30
30
  "dependencies": {
31
- "@jbrowse/mobx-state-tree": "^6.7.0",
32
- "@mui/icons-material": "^9.4.0",
33
- "@mui/material": "^9.4.0",
31
+ "@jbrowse/mobx-state-tree": "^6.9.0",
32
+ "@mui/icons-material": "^9.5.0",
33
+ "@mui/material": "^9.5.0",
34
34
  "mobx": "^7.0.6",
35
35
  "mobx-react": "^10.0.2",
36
- "@jbrowse/render-core": "^5.0.0-beta.13",
37
- "@jbrowse/core": "^5.0.0-beta.13"
36
+ "@jbrowse/render-core": "^5.0.0-beta.14",
37
+ "@jbrowse/core": "^5.0.0-beta.14"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=19.0.0",