@jbrowse/core 2.2.1 → 2.2.2

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.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { AnyConfigurationModel } from '../configuration';
3
- export declare function FileInfo({ config }: {
3
+ export declare function FileInfoPanel({ config }: {
4
4
  config: AnyConfigurationModel;
5
5
  }): JSX.Element | null;
6
6
  export declare function AboutContents({ config }: {
package/ui/AboutDialog.js CHANGED
@@ -26,29 +26,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.AboutContents = exports.FileInfo = void 0;
29
+ exports.AboutContents = exports.FileInfoPanel = void 0;
30
30
  const react_1 = __importStar(require("react"));
31
31
  const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
32
32
  const material_1 = require("@mui/material");
33
- const Close_1 = __importDefault(require("@mui/icons-material/Close"));
34
33
  const mui_1 = require("tss-react/mui");
35
34
  const configuration_1 = require("../configuration");
35
+ const Dialog_1 = __importDefault(require("./Dialog"));
36
36
  const LoadingEllipses_1 = __importDefault(require("./LoadingEllipses"));
37
37
  const util_1 = require("../util");
38
38
  const tracks_1 = require("../util/tracks");
39
39
  const BaseFeatureDetail_1 = require("../BaseFeatureWidget/BaseFeatureDetail");
40
- const useStyles = (0, mui_1.makeStyles)()(theme => ({
41
- closeButton: {
42
- position: 'absolute',
43
- right: theme.spacing(1),
44
- top: theme.spacing(1),
45
- color: theme.palette.grey[500],
46
- },
40
+ const useStyles = (0, mui_1.makeStyles)()({
47
41
  content: {
48
42
  minWidth: 800,
49
43
  },
50
- }));
51
- function FileInfo({ config }) {
44
+ });
45
+ function FileInfoPanel({ config }) {
52
46
  const [error, setError] = (0, react_1.useState)();
53
47
  const [info, setInfo] = (0, react_1.useState)();
54
48
  const session = (0, util_1.getSession)(config);
@@ -89,7 +83,7 @@ function FileInfo({ config }) {
89
83
  : info || {};
90
84
  return info !== null ? (react_1.default.createElement(BaseFeatureDetail_1.BaseCard, { title: "File info" }, error ? (react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`)) : info === undefined ? (react_1.default.createElement(LoadingEllipses_1.default, { message: "Loading file data" })) : (react_1.default.createElement(BaseFeatureDetail_1.Attributes, { attributes: details })))) : null;
91
85
  }
92
- exports.FileInfo = FileInfo;
86
+ exports.FileInfoPanel = FileInfoPanel;
93
87
  function AboutContents({ config }) {
94
88
  const [copied, setCopied] = (0, react_1.useState)(false);
95
89
  const conf = (0, configuration_1.readConfObject)(config);
@@ -115,7 +109,7 @@ function AboutContents({ config }) {
115
109
  react_1.default.createElement(BaseFeatureDetail_1.Attributes, { attributes: confPostExt, omit: ['displays', 'baseUri', 'refNames', 'formatAbout'], hideUris: hideUris })),
116
110
  ExtraPanel ? (react_1.default.createElement(BaseFeatureDetail_1.BaseCard, { title: ExtraPanel.name },
117
111
  react_1.default.createElement(ExtraPanel.Component, { config: config }))) : null,
118
- react_1.default.createElement(FileInfo, { config: config })));
112
+ react_1.default.createElement(FileInfoPanel, { config: config })));
119
113
  }
120
114
  exports.AboutContents = AboutContents;
121
115
  function AboutDialog({ config, handleClose, }) {
@@ -124,11 +118,7 @@ function AboutDialog({ config, handleClose, }) {
124
118
  const trackName = (0, tracks_1.getTrackName)(config, session);
125
119
  const { pluginManager } = (0, util_1.getEnv)(session);
126
120
  const AboutComponent = pluginManager.evaluateExtensionPoint('Core-replaceAbout', AboutContents, { session, config });
127
- return (react_1.default.createElement(material_1.Dialog, { open: true, onClose: handleClose, maxWidth: "xl" },
128
- react_1.default.createElement(material_1.DialogTitle, null,
129
- trackName,
130
- react_1.default.createElement(material_1.IconButton, { className: classes.closeButton, onClick: () => handleClose(), size: "large" },
131
- react_1.default.createElement(Close_1.default, null))),
121
+ return (react_1.default.createElement(Dialog_1.default, { open: true, onClose: handleClose, title: trackName, maxWidth: "xl" },
132
122
  react_1.default.createElement(material_1.DialogContent, { className: classes.content },
133
123
  react_1.default.createElement(AboutComponent, { config: config }))));
134
124
  }
package/ui/Dialog.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { DialogProps } from '@mui/material';
3
+ declare function JBrowseDialog(props: DialogProps & {
4
+ title: string;
5
+ }): JSX.Element;
6
+ declare const _default: typeof JBrowseDialog;
7
+ export default _default;
package/ui/Dialog.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const material_1 = require("@mui/material");
8
+ const mobx_react_1 = require("mobx-react");
9
+ const mui_1 = require("tss-react/mui");
10
+ // icons
11
+ const Close_1 = __importDefault(require("@mui/icons-material/Close"));
12
+ const useStyles = (0, mui_1.makeStyles)()(theme => ({
13
+ closeButton: {
14
+ position: 'absolute',
15
+ right: theme.spacing(1),
16
+ top: theme.spacing(1),
17
+ color: theme.palette.grey[500],
18
+ },
19
+ }));
20
+ function JBrowseDialog(props) {
21
+ const { classes } = useStyles();
22
+ const { title, children, onClose } = props;
23
+ return (react_1.default.createElement(material_1.Dialog, { ...props },
24
+ react_1.default.createElement(material_1.ScopedCssBaseline, null,
25
+ react_1.default.createElement(material_1.DialogTitle, null,
26
+ title,
27
+ onClose ? (react_1.default.createElement(material_1.IconButton, { className: classes.closeButton, onClick: () => {
28
+ // @ts-ignore
29
+ onClose();
30
+ } },
31
+ react_1.default.createElement(Close_1.default, null))) : null),
32
+ react_1.default.createElement(material_1.Divider, null),
33
+ children)));
34
+ }
35
+ exports.default = (0, mobx_react_1.observer)(JBrowseDialog);
@@ -3,13 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const Button_1 = __importDefault(require("@mui/material/Button"));
7
- const Dialog_1 = __importDefault(require("@mui/material/Dialog"));
8
- const DialogTitle_1 = __importDefault(require("@mui/material/DialogTitle"));
9
- const DialogContent_1 = __importDefault(require("@mui/material/DialogContent"));
10
- const DialogContentText_1 = __importDefault(require("@mui/material/DialogContentText"));
11
- const DialogActions_1 = __importDefault(require("@mui/material/DialogActions"));
12
6
  const react_1 = __importDefault(require("react"));
7
+ const material_1 = require("@mui/material");
8
+ const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
13
9
  exports.default = ({ onClose, open, onFactoryReset, }) => {
14
10
  function handleDialogClose(action) {
15
11
  if (action === 'reset') {
@@ -17,11 +13,10 @@ exports.default = ({ onClose, open, onFactoryReset, }) => {
17
13
  }
18
14
  onClose();
19
15
  }
20
- return (react_1.default.createElement(Dialog_1.default, { open: open, onClose: () => handleDialogClose() },
21
- react_1.default.createElement(DialogTitle_1.default, { id: "alert-dialog-title" }, "Reset"),
22
- react_1.default.createElement(DialogContent_1.default, null,
23
- react_1.default.createElement(DialogContentText_1.default, { id: "alert-dialog-description" }, "Are you sure you want to reset? This will restore the default configuration.")),
24
- react_1.default.createElement(DialogActions_1.default, null,
25
- react_1.default.createElement(Button_1.default, { onClick: () => handleDialogClose(), color: "primary" }, "Cancel"),
26
- react_1.default.createElement(Button_1.default, { onClick: () => handleDialogClose('reset'), color: "primary", variant: "contained" }, "OK"))));
16
+ return (react_1.default.createElement(Dialog_1.default, { title: "Reset", onClose: () => handleDialogClose(), open: open },
17
+ react_1.default.createElement(material_1.DialogContent, null,
18
+ react_1.default.createElement(material_1.DialogContentText, null, "Are you sure you want to reset? This will restore the default configuration.")),
19
+ react_1.default.createElement(material_1.DialogActions, null,
20
+ react_1.default.createElement(material_1.Button, { onClick: () => handleDialogClose(), color: "primary" }, "Cancel"),
21
+ react_1.default.createElement(material_1.Button, { onClick: () => handleDialogClose('reset'), color: "primary", variant: "contained" }, "OK"))));
27
22
  };
@@ -6,24 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const mobx_react_1 = require("mobx-react");
8
8
  const material_1 = require("@mui/material");
9
- const mui_1 = require("tss-react/mui");
10
- const Close_1 = __importDefault(require("@mui/icons-material/Close"));
11
- const useStyles = (0, mui_1.makeStyles)()(theme => ({
12
- closeButton: {
13
- position: 'absolute',
14
- right: theme.spacing(1),
15
- top: theme.spacing(1),
16
- color: theme.palette.grey[500],
17
- },
18
- }));
9
+ const Dialog_1 = __importDefault(require("./Dialog"));
19
10
  function ReturnToImportFormDialog({ model, handleClose, }) {
20
- const { classes } = useStyles();
21
- return (react_1.default.createElement(material_1.Dialog, { maxWidth: "xl", open: true, onClose: handleClose },
22
- react_1.default.createElement(material_1.DialogTitle, null,
23
- "Reference sequence",
24
- handleClose ? (react_1.default.createElement(material_1.IconButton, { className: classes.closeButton, onClick: () => handleClose(), size: "large" },
25
- react_1.default.createElement(Close_1.default, null))) : null),
26
- react_1.default.createElement(material_1.Divider, null),
11
+ return (react_1.default.createElement(Dialog_1.default, { maxWidth: "xl", open: true, onClose: handleClose, title: "Reference sequence" },
27
12
  react_1.default.createElement(material_1.DialogContent, null,
28
13
  react_1.default.createElement(material_1.Typography, null, "Are you sure you want to return to the import form? This will lose your current view")),
29
14
  react_1.default.createElement(material_1.DialogActions, null,
package/ui/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './theme';
2
2
  export { LogoFull, Logomark } from './Logo';
3
+ export { default as Dialog } from './Dialog';
3
4
  export { default as App } from './App';
4
5
  export { default as ReturnToImportFormDialog } from './ReturnToImportFormDialog';
5
6
  export { default as ErrorMessage } from './ErrorMessage';
package/ui/index.js CHANGED
@@ -17,11 +17,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.LoadingEllipses = exports.SanitizedHTML = exports.CascadingMenu = exports.Menu = exports.FatalErrorDialog = exports.Tooltip = exports.FactoryResetDialog = exports.EditableTypography = exports.ResizeHandle = exports.PrerenderedCanvas = exports.FileSelector = exports.AssemblySelector = exports.ErrorMessage = exports.ReturnToImportFormDialog = exports.App = exports.Logomark = exports.LogoFull = void 0;
20
+ exports.LoadingEllipses = exports.SanitizedHTML = exports.CascadingMenu = exports.Menu = exports.FatalErrorDialog = exports.Tooltip = exports.FactoryResetDialog = exports.EditableTypography = exports.ResizeHandle = exports.PrerenderedCanvas = exports.FileSelector = exports.AssemblySelector = exports.ErrorMessage = exports.ReturnToImportFormDialog = exports.App = exports.Dialog = exports.Logomark = exports.LogoFull = void 0;
21
21
  __exportStar(require("./theme"), exports);
22
22
  var Logo_1 = require("./Logo");
23
23
  Object.defineProperty(exports, "LogoFull", { enumerable: true, get: function () { return Logo_1.LogoFull; } });
24
24
  Object.defineProperty(exports, "Logomark", { enumerable: true, get: function () { return Logo_1.Logomark; } });
25
+ var Dialog_1 = require("./Dialog");
26
+ Object.defineProperty(exports, "Dialog", { enumerable: true, get: function () { return __importDefault(Dialog_1).default; } });
25
27
  var App_1 = require("./App");
26
28
  Object.defineProperty(exports, "App", { enumerable: true, get: function () { return __importDefault(App_1).default; } });
27
29
  var ReturnToImportFormDialog_1 = require("./ReturnToImportFormDialog");
package/util/analytics.js CHANGED
@@ -89,7 +89,10 @@ exports.writeGAAnalytics = writeGAAnalytics;
89
89
  function doAnalytics(rootModel, initialTimestamp, initialSessionQuery) {
90
90
  if (rootModel &&
91
91
  !(0, configuration_1.readConfObject)(rootModel.jbrowse.configuration, 'disableAnalytics')) {
92
+ // ok if these are unhandled
93
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
92
94
  writeAWSAnalytics(rootModel, initialTimestamp, initialSessionQuery);
95
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
93
96
  writeGAAnalytics(rootModel, initialTimestamp);
94
97
  }
95
98
  }
@@ -7,7 +7,7 @@ export interface SeqChunk {
7
7
  * ref https://stackoverflow.com/a/51506718/2129219
8
8
  *
9
9
  * @param seqString - string
10
- * @returns formated sequence string
10
+ * @returns formatted sequence string
11
11
  */
12
12
  export declare function formatFastaLines(seqString: string): string;
13
13
  /**
@@ -6,7 +6,7 @@ exports.formatSeqFasta = exports.formatFastaLines = void 0;
6
6
  * ref https://stackoverflow.com/a/51506718/2129219
7
7
  *
8
8
  * @param seqString - string
9
- * @returns formated sequence string
9
+ * @returns formatted sequence string
10
10
  */
11
11
  function formatFastaLines(seqString) {
12
12
  return seqString.replace(/(.{1,80})/g, '$1\n').trimEnd();
package/util/index.d.ts CHANGED
@@ -340,3 +340,4 @@ export declare function measureGridWidth(elements: string[]): number;
340
340
  export declare function getEnv(obj: any): {
341
341
  pluginManager: PluginManager;
342
342
  };
343
+ export declare function dedupe<T, U>(results: T[] | undefined, cb: (result: T) => U): T[];
package/util/index.js CHANGED
@@ -30,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.bytesForRegions = exports.objectHash = exports.hashCode = exports.updateStatus = exports.generateCodonTable = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.measureText = exports.rIC = exports.blobToDataURL = exports.complement = exports.reverse = exports.revcom = exports.isElectron = exports.stringify = exports.shorten = exports.minmax = exports.renameRegionsIfNeeded = exports.renameRegionIfNeeded = exports.makeAbortableReaction = exports.findLastIndex = exports.iterMap = exports.bpSpanPx = exports.featureSpanPx = exports.cartesianToPolar = exports.polarToCartesian = exports.degToRad = exports.radToDeg = exports.bpToPx = exports.clamp = exports.compareLocStrings = exports.compareLocs = exports.parseLocString = exports.parseLocStringOneBased = exports.assembleLocStringFast = exports.assembleLocString = exports.getContainingDisplay = exports.getContainingTrack = exports.getContainingView = exports.getSession = exports.findParentThatIs = exports.springAnimate = exports.findParentThat = exports.useDebouncedCallback = exports.useDebounce = exports.inProduction = exports.inDevelopment = exports.isFeature = exports.SimpleFeature = void 0;
33
- exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale = exports.getBpDisplayStr = exports.supportedIndexingAdapters = void 0;
33
+ exports.dedupe = exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale = exports.getBpDisplayStr = exports.supportedIndexingAdapters = void 0;
34
34
  /* eslint-disable @typescript-eslint/no-explicit-any */
35
35
  const react_1 = require("react");
36
36
  const is_object_1 = __importDefault(require("is-object"));
@@ -1010,3 +1010,7 @@ function getEnv(obj) {
1010
1010
  return (0, mobx_state_tree_1.getEnv)(obj);
1011
1011
  }
1012
1012
  exports.getEnv = getEnv;
1013
+ function dedupe(results = [], cb) {
1014
+ return results.filter((elt, idx, self) => idx === self.findIndex(t => cb(t) === cb(elt)));
1015
+ }
1016
+ exports.dedupe = dedupe;
package/util/tracks.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare function storeBlobLocation(location: PreFileLocation): import("./
31
31
  * creates a new location from the provided location including the appropriate suffix and location type
32
32
  * @param location - the FileLocation
33
33
  * @param suffix - the file suffix (e.g. .bam)
34
- * @returns the constructed location object from the provided prameters
34
+ * @returns the constructed location object from the provided parameters
35
35
  */
36
36
  export declare function makeIndex(location: FileLocation, suffix: string): import("./types").BlobLocation | {
37
37
  uri: string;
package/util/tracks.js CHANGED
@@ -87,7 +87,7 @@ exports.storeBlobLocation = storeBlobLocation;
87
87
  * creates a new location from the provided location including the appropriate suffix and location type
88
88
  * @param location - the FileLocation
89
89
  * @param suffix - the file suffix (e.g. .bam)
90
- * @returns the constructed location object from the provided prameters
90
+ * @returns the constructed location object from the provided parameters
91
91
  */
92
92
  function makeIndex(location, suffix) {
93
93
  if ('uri' in location) {