@jbrowse/plugin-linear-genome-view 3.0.3 → 3.0.4

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.
@@ -55,10 +55,12 @@ const BaseLinearDisplay = (0, mobx_react_1.observer)(function (props) {
55
55
  }, onClose: () => {
56
56
  setContextCoord(undefined);
57
57
  model.setContextMenuFeature(undefined);
58
- }, TransitionProps: {
59
- onExit: () => {
60
- setContextCoord(undefined);
61
- model.setContextMenuFeature(undefined);
58
+ }, slotProps: {
59
+ transition: {
60
+ onExit: () => {
61
+ setContextCoord(undefined);
62
+ model.setContextMenuFeature(undefined);
63
+ },
62
64
  },
63
65
  }, anchorReference: "anchorPosition", anchorPosition: contextCoord
64
66
  ? { top: contextCoord[1], left: contextCoord[0] }
@@ -162,7 +162,7 @@ function renderBlockData(self, optDisplay) {
162
162
  const { config } = renderProps;
163
163
  (0, configuration_1.readConfObject)(config);
164
164
  const sessionId = (0, tracks_1.getRpcSessionId)(display);
165
- const layoutId = (0, util_1.getContainingView)(display).id;
165
+ const layoutId = (0, util_1.getContainingTrack)(display).id;
166
166
  const cannotBeRenderedReason = display.regionCannotBeRendered(self.region);
167
167
  return {
168
168
  rendererType,
@@ -1,8 +1,7 @@
1
1
  import type { AutocompleteRenderInputParams, TextFieldProps as TFP } from '@mui/material';
2
- export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, showHelp, setInputValue, setCurrentSearch, }: {
2
+ export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, setInputValue, setCurrentSearch, }: {
3
3
  TextFieldProps: TFP;
4
4
  inputBoxVal: string;
5
- showHelp?: boolean;
6
5
  params: AutocompleteRenderInputParams;
7
6
  setInputValue: (arg: string) => void;
8
7
  setCurrentSearch: (arg: string) => void;
@@ -1,21 +1,16 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.default = AutocompleteTextField;
7
4
  const jsx_runtime_1 = require("react/jsx-runtime");
8
5
  const material_1 = require("@mui/material");
9
- const EndAdornment_1 = __importDefault(require("./EndAdornment"));
10
- function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, showHelp, setInputValue, setCurrentSearch, }) {
11
- const { helperText, InputProps = {} } = TextFieldProps;
6
+ function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, setInputValue, setCurrentSearch, }) {
7
+ const { helperText, slotProps = {} } = TextFieldProps;
12
8
  return ((0, jsx_runtime_1.jsx)(material_1.TextField, { onBlur: () => {
13
9
  setInputValue(inputBoxVal);
14
10
  }, ...params, ...TextFieldProps, size: "small", helperText: helperText, slotProps: {
15
11
  input: {
16
12
  ...params.InputProps,
17
- ...InputProps,
18
- endAdornment: ((0, jsx_runtime_1.jsx)(EndAdornment_1.default, { showHelp: showHelp, endAdornment: params.InputProps.endAdornment })),
13
+ ...slotProps.input,
19
14
  },
20
15
  }, placeholder: "Search for location", onChange: e => {
21
16
  setCurrentSearch(e.target.value);
@@ -1,4 +1,3 @@
1
- export default function EndAdornment({ showHelp, endAdornment, }: {
1
+ export default function EndAdornment({ showHelp }: {
2
2
  showHelp?: boolean;
3
- endAdornment: React.ReactNode;
4
3
  }): import("react/jsx-runtime").JSX.Element;
@@ -51,6 +51,6 @@ function HelpAdornment() {
51
51
  setHelpDialogDisplayed(false);
52
52
  } }) })) : null] }));
53
53
  }
54
- function EndAdornment({ showHelp, endAdornment, }) {
55
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.InputAdornment, { position: "end", style: { marginRight: 7 }, children: [(0, jsx_runtime_1.jsx)(Search_1.default, { fontSize: "small" }), showHelp ? (0, jsx_runtime_1.jsx)(HelpAdornment, {}) : null] }), endAdornment] }));
54
+ function EndAdornment({ showHelp }) {
55
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.InputAdornment, { position: "end", style: { marginRight: 7 }, children: [(0, jsx_runtime_1.jsx)(Search_1.default, { fontSize: "small" }), showHelp ? (0, jsx_runtime_1.jsx)(HelpAdornment, {}) : null] }) }));
56
56
  }
@@ -1,7 +1,7 @@
1
1
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
2
2
  import type { LinearGenomeViewModel } from '../../model';
3
3
  import type { TextFieldProps as TFP } from '@mui/material';
4
- declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, showHelp, minWidth, maxWidth, TextFieldProps, }: {
4
+ declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, minWidth, maxWidth, TextFieldProps, }: {
5
5
  model: LinearGenomeViewModel;
6
6
  onSelect?: (region: BaseResult) => void;
7
7
  onChange?: (val: string) => void;
@@ -11,7 +11,6 @@ declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetc
11
11
  style?: React.CSSProperties;
12
12
  minWidth?: number;
13
13
  maxWidth?: number;
14
- showHelp?: boolean;
15
14
  TextFieldProps?: TFP;
16
15
  }) => import("react/jsx-runtime").JSX.Element;
17
16
  export default RefNameAutocomplete;
@@ -44,7 +44,7 @@ const material_1 = require("@mui/material");
44
44
  const mobx_react_1 = require("mobx-react");
45
45
  const AutocompleteTextField_1 = __importDefault(require("./AutocompleteTextField"));
46
46
  const util_2 = require("./util");
47
- const RefNameAutocomplete = (0, mobx_react_1.observer)(function ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, showHelp = true, minWidth = 200, maxWidth = 550, TextFieldProps = {}, }) {
47
+ const RefNameAutocomplete = (0, mobx_react_1.observer)(function ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, minWidth = 200, maxWidth = 550, TextFieldProps = {}, }) {
48
48
  const session = (0, util_1.getSession)(model);
49
49
  const { assemblyManager } = session;
50
50
  const [open, setOpen] = (0, react_1.useState)(false);
@@ -106,6 +106,6 @@ const RefNameAutocomplete = (0, mobx_react_1.observer)(function ({ model, onSele
106
106
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedOption.result);
107
107
  }
108
108
  setInputValue(inputBoxVal);
109
- }, options: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.length) ? searchOptions : regionOptions, getOptionDisabled: option => option.group === 'limitOption', filterOptions: (opts, { inputValue }) => (0, util_2.getFiltered)(opts, inputValue), renderInput: params => ((0, jsx_runtime_1.jsx)(AutocompleteTextField_1.default, { showHelp: showHelp, params: params, inputBoxVal: inputBoxVal, TextFieldProps: TextFieldProps, setCurrentSearch: setCurrentSearch, setInputValue: setInputValue })), getOptionLabel: opt => typeof opt === 'string' ? opt : opt.result.getDisplayString() }));
109
+ }, options: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.length) ? searchOptions : regionOptions, getOptionDisabled: option => option.group === 'limitOption', filterOptions: (opts, { inputValue }) => (0, util_2.getFiltered)(opts, inputValue), renderInput: params => ((0, jsx_runtime_1.jsx)(AutocompleteTextField_1.default, { params: params, inputBoxVal: inputBoxVal, TextFieldProps: TextFieldProps, setCurrentSearch: setCurrentSearch, setInputValue: setInputValue })), getOptionLabel: opt => typeof opt === 'string' ? opt : opt.result.getDisplayString() }));
110
110
  });
111
111
  exports.default = RefNameAutocomplete;
@@ -9,6 +9,7 @@ const material_1 = require("@mui/material");
9
9
  const mobx_react_1 = require("mobx-react");
10
10
  const mui_1 = require("tss-react/mui");
11
11
  const RefNameAutocomplete_1 = __importDefault(require("./RefNameAutocomplete"));
12
+ const EndAdornment_1 = __importDefault(require("./RefNameAutocomplete/EndAdornment"));
12
13
  const util_2 = require("./util");
13
14
  const searchUtils_1 = require("../../searchUtils");
14
15
  const consts_1 = require("../consts");
@@ -17,7 +18,7 @@ const useStyles = (0, mui_1.makeStyles)()(() => ({
17
18
  minWidth: 100,
18
19
  },
19
20
  }));
20
- const SearchBox = (0, mobx_react_1.observer)(function ({ model, showHelp, }) {
21
+ const SearchBox = (0, mobx_react_1.observer)(function ({ model, showHelp = true, }) {
21
22
  const { classes } = useStyles();
22
23
  const theme = (0, material_1.useTheme)();
23
24
  const session = (0, util_1.getSession)(model);
@@ -26,7 +27,7 @@ const SearchBox = (0, mobx_react_1.observer)(function ({ model, showHelp, }) {
26
27
  const assemblyName = assemblyNames[0];
27
28
  const assembly = assemblyManager.get(assemblyName);
28
29
  const searchScope = model.searchScope(assemblyName);
29
- return ((0, jsx_runtime_1.jsx)(RefNameAutocomplete_1.default, { showHelp: showHelp, onSelect: async (option) => {
30
+ return ((0, jsx_runtime_1.jsx)(RefNameAutocomplete_1.default, { onSelect: async (option) => {
30
31
  var _a;
31
32
  try {
32
33
  if (option.hasLocation()) {
@@ -59,11 +60,14 @@ const SearchBox = (0, mobx_react_1.observer)(function ({ model, showHelp, }) {
59
60
  style: {
60
61
  margin: consts_1.SPACING,
61
62
  },
62
- InputProps: {
63
- style: {
64
- padding: 0,
65
- height: consts_1.WIDGET_HEIGHT,
66
- background: (0, material_1.alpha)(theme.palette.background.paper, 0.8),
63
+ slotProps: {
64
+ input: {
65
+ style: {
66
+ padding: 0,
67
+ height: consts_1.WIDGET_HEIGHT,
68
+ background: (0, material_1.alpha)(theme.palette.background.paper, 0.8),
69
+ },
70
+ endAdornment: (0, jsx_runtime_1.jsx)(EndAdornment_1.default, { showHelp: showHelp }),
67
71
  },
68
72
  },
69
73
  } }));
@@ -49,10 +49,12 @@ const BaseLinearDisplay = observer(function (props) {
49
49
  }, onClose: () => {
50
50
  setContextCoord(undefined);
51
51
  model.setContextMenuFeature(undefined);
52
- }, TransitionProps: {
53
- onExit: () => {
54
- setContextCoord(undefined);
55
- model.setContextMenuFeature(undefined);
52
+ }, slotProps: {
53
+ transition: {
54
+ onExit: () => {
55
+ setContextCoord(undefined);
56
+ model.setContextMenuFeature(undefined);
57
+ },
56
58
  },
57
59
  }, anchorReference: "anchorPosition", anchorPosition: contextCoord
58
60
  ? { top: contextCoord[1], left: contextCoord[0] }
@@ -1,5 +1,5 @@
1
1
  import { readConfObject } from '@jbrowse/core/configuration';
2
- import { assembleLocString, getContainingDisplay, getContainingView, getSession, getViewParams, makeAbortableReaction, } from '@jbrowse/core/util';
2
+ import { assembleLocString, getContainingDisplay, getContainingTrack, getSession, getViewParams, makeAbortableReaction, } from '@jbrowse/core/util';
3
3
  import { stopStopToken } from '@jbrowse/core/util/stopToken';
4
4
  import { getRpcSessionId, getTrackAssemblyNames, } from '@jbrowse/core/util/tracks';
5
5
  import { isRetryException } from '@jbrowse/core/util/types';
@@ -156,7 +156,7 @@ export function renderBlockData(self, optDisplay) {
156
156
  const { config } = renderProps;
157
157
  readConfObject(config);
158
158
  const sessionId = getRpcSessionId(display);
159
- const layoutId = getContainingView(display).id;
159
+ const layoutId = getContainingTrack(display).id;
160
160
  const cannotBeRenderedReason = display.regionCannotBeRendered(self.region);
161
161
  return {
162
162
  rendererType,
@@ -1,8 +1,7 @@
1
1
  import type { AutocompleteRenderInputParams, TextFieldProps as TFP } from '@mui/material';
2
- export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, showHelp, setInputValue, setCurrentSearch, }: {
2
+ export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, setInputValue, setCurrentSearch, }: {
3
3
  TextFieldProps: TFP;
4
4
  inputBoxVal: string;
5
- showHelp?: boolean;
6
5
  params: AutocompleteRenderInputParams;
7
6
  setInputValue: (arg: string) => void;
8
7
  setCurrentSearch: (arg: string) => void;
@@ -1,15 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TextField } from '@mui/material';
3
- import EndAdornment from './EndAdornment';
4
- export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, showHelp, setInputValue, setCurrentSearch, }) {
5
- const { helperText, InputProps = {} } = TextFieldProps;
3
+ export default function AutocompleteTextField({ TextFieldProps, inputBoxVal, params, setInputValue, setCurrentSearch, }) {
4
+ const { helperText, slotProps = {} } = TextFieldProps;
6
5
  return (_jsx(TextField, { onBlur: () => {
7
6
  setInputValue(inputBoxVal);
8
7
  }, ...params, ...TextFieldProps, size: "small", helperText: helperText, slotProps: {
9
8
  input: {
10
9
  ...params.InputProps,
11
- ...InputProps,
12
- endAdornment: (_jsx(EndAdornment, { showHelp: showHelp, endAdornment: params.InputProps.endAdornment })),
10
+ ...slotProps.input,
13
11
  },
14
12
  }, placeholder: "Search for location", onChange: e => {
15
13
  setCurrentSearch(e.target.value);
@@ -1,4 +1,3 @@
1
- export default function EndAdornment({ showHelp, endAdornment, }: {
1
+ export default function EndAdornment({ showHelp }: {
2
2
  showHelp?: boolean;
3
- endAdornment: React.ReactNode;
4
3
  }): import("react/jsx-runtime").JSX.Element;
@@ -12,6 +12,6 @@ function HelpAdornment() {
12
12
  setHelpDialogDisplayed(false);
13
13
  } }) })) : null] }));
14
14
  }
15
- export default function EndAdornment({ showHelp, endAdornment, }) {
16
- return (_jsxs(_Fragment, { children: [_jsxs(InputAdornment, { position: "end", style: { marginRight: 7 }, children: [_jsx(SearchIcon, { fontSize: "small" }), showHelp ? _jsx(HelpAdornment, {}) : null] }), endAdornment] }));
15
+ export default function EndAdornment({ showHelp }) {
16
+ return (_jsx(_Fragment, { children: _jsxs(InputAdornment, { position: "end", style: { marginRight: 7 }, children: [_jsx(SearchIcon, { fontSize: "small" }), showHelp ? _jsx(HelpAdornment, {}) : null] }) }));
17
17
  }
@@ -1,7 +1,7 @@
1
1
  import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
2
2
  import type { LinearGenomeViewModel } from '../../model';
3
3
  import type { TextFieldProps as TFP } from '@mui/material';
4
- declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, showHelp, minWidth, maxWidth, TextFieldProps, }: {
4
+ declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, minWidth, maxWidth, TextFieldProps, }: {
5
5
  model: LinearGenomeViewModel;
6
6
  onSelect?: (region: BaseResult) => void;
7
7
  onChange?: (val: string) => void;
@@ -11,7 +11,6 @@ declare const RefNameAutocomplete: ({ model, onSelect, assemblyName, style, fetc
11
11
  style?: React.CSSProperties;
12
12
  minWidth?: number;
13
13
  maxWidth?: number;
14
- showHelp?: boolean;
15
14
  TextFieldProps?: TFP;
16
15
  }) => import("react/jsx-runtime").JSX.Element;
17
16
  export default RefNameAutocomplete;
@@ -6,7 +6,7 @@ import { Autocomplete } from '@mui/material';
6
6
  import { observer } from 'mobx-react';
7
7
  import AutocompleteTextField from './AutocompleteTextField';
8
8
  import { getDeduplicatedResult, getFiltered } from './util';
9
- const RefNameAutocomplete = observer(function ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, showHelp = true, minWidth = 200, maxWidth = 550, TextFieldProps = {}, }) {
9
+ const RefNameAutocomplete = observer(function ({ model, onSelect, assemblyName, style, fetchResults, onChange, value, minWidth = 200, maxWidth = 550, TextFieldProps = {}, }) {
10
10
  const session = getSession(model);
11
11
  const { assemblyManager } = session;
12
12
  const [open, setOpen] = useState(false);
@@ -68,6 +68,6 @@ const RefNameAutocomplete = observer(function ({ model, onSelect, assemblyName,
68
68
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedOption.result);
69
69
  }
70
70
  setInputValue(inputBoxVal);
71
- }, options: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.length) ? searchOptions : regionOptions, getOptionDisabled: option => option.group === 'limitOption', filterOptions: (opts, { inputValue }) => getFiltered(opts, inputValue), renderInput: params => (_jsx(AutocompleteTextField, { showHelp: showHelp, params: params, inputBoxVal: inputBoxVal, TextFieldProps: TextFieldProps, setCurrentSearch: setCurrentSearch, setInputValue: setInputValue })), getOptionLabel: opt => typeof opt === 'string' ? opt : opt.result.getDisplayString() }));
71
+ }, options: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.length) ? searchOptions : regionOptions, getOptionDisabled: option => option.group === 'limitOption', filterOptions: (opts, { inputValue }) => getFiltered(opts, inputValue), renderInput: params => (_jsx(AutocompleteTextField, { params: params, inputBoxVal: inputBoxVal, TextFieldProps: TextFieldProps, setCurrentSearch: setCurrentSearch, setInputValue: setInputValue })), getOptionLabel: opt => typeof opt === 'string' ? opt : opt.result.getDisplayString() }));
72
72
  });
73
73
  export default RefNameAutocomplete;
@@ -4,6 +4,7 @@ import { alpha, useTheme } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
5
  import { makeStyles } from 'tss-react/mui';
6
6
  import RefNameAutocomplete from './RefNameAutocomplete';
7
+ import EndAdornment from './RefNameAutocomplete/EndAdornment';
7
8
  import { fetchResults } from './util';
8
9
  import { handleSelectedRegion, navToOption } from '../../searchUtils';
9
10
  import { SPACING, WIDGET_HEIGHT } from '../consts';
@@ -12,7 +13,7 @@ const useStyles = makeStyles()(() => ({
12
13
  minWidth: 100,
13
14
  },
14
15
  }));
15
- const SearchBox = observer(function ({ model, showHelp, }) {
16
+ const SearchBox = observer(function ({ model, showHelp = true, }) {
16
17
  const { classes } = useStyles();
17
18
  const theme = useTheme();
18
19
  const session = getSession(model);
@@ -21,7 +22,7 @@ const SearchBox = observer(function ({ model, showHelp, }) {
21
22
  const assemblyName = assemblyNames[0];
22
23
  const assembly = assemblyManager.get(assemblyName);
23
24
  const searchScope = model.searchScope(assemblyName);
24
- return (_jsx(RefNameAutocomplete, { showHelp: showHelp, onSelect: async (option) => {
25
+ return (_jsx(RefNameAutocomplete, { onSelect: async (option) => {
25
26
  var _a;
26
27
  try {
27
28
  if (option.hasLocation()) {
@@ -54,11 +55,14 @@ const SearchBox = observer(function ({ model, showHelp, }) {
54
55
  style: {
55
56
  margin: SPACING,
56
57
  },
57
- InputProps: {
58
- style: {
59
- padding: 0,
60
- height: WIDGET_HEIGHT,
61
- background: alpha(theme.palette.background.paper, 0.8),
58
+ slotProps: {
59
+ input: {
60
+ style: {
61
+ padding: 0,
62
+ height: WIDGET_HEIGHT,
63
+ background: alpha(theme.palette.background.paper, 0.8),
64
+ },
65
+ endAdornment: _jsx(EndAdornment, { showHelp: showHelp }),
62
66
  },
63
67
  },
64
68
  } }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -38,7 +38,7 @@
38
38
  "useSrc": "node ../../scripts/useSrc.js"
39
39
  },
40
40
  "dependencies": {
41
- "@jbrowse/core": "^3.0.3",
41
+ "@jbrowse/core": "^3.0.4",
42
42
  "@mui/icons-material": "^6.0.0",
43
43
  "@mui/material": "^6.0.0",
44
44
  "@types/file-saver": "^2.0.1",
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "module": "esm/index.js",
61
- "gitHead": "f516540428282351d26e46743e69a724651bfb2c"
61
+ "gitHead": "61e6d26f83acbf58a946c2add3415bc46b878df9"
62
62
  }