@jbrowse/core 2.16.1 → 2.18.0
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.
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +4 -8
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +22 -25
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +6 -8
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +3 -4
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +5 -9
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +0 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +24 -33
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +3 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -35
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +19 -44
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +3 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +5 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +0 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +0 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +1 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
- package/BaseFeatureWidget/stateModelFactory.d.ts +3 -94
- package/BaseFeatureWidget/stateModelFactory.js +3 -73
- package/BaseFeatureWidget/types.d.ts +3 -3
- package/BaseFeatureWidget/util.js +0 -4
- package/CorePlugin.d.ts +1 -1
- package/CorePlugin.js +2 -5
- package/Plugin.d.ts +2 -5
- package/Plugin.js +0 -3
- package/PluginLoader.d.ts +1 -1
- package/PluginLoader.js +2 -19
- package/PluginManager.d.ts +15 -31
- package/PluginManager.js +11 -39
- package/ReExports/DataGrid.js +0 -1
- package/ReExports/list.d.ts +0 -5
- package/ReExports/list.js +0 -5
- package/ReExports/modules.d.ts +22 -20
- package/ReExports/modules.js +16 -25
- package/TextSearch/BaseResults.d.ts +3 -3
- package/TextSearch/TextSearchManager.d.ts +4 -16
- package/TextSearch/TextSearchManager.js +1 -13
- package/assemblyManager/assembly.d.ts +5 -100
- package/assemblyManager/assembly.js +27 -143
- package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
- package/assemblyManager/assemblyConfigSchema.js +12 -46
- package/assemblyManager/assemblyManager.d.ts +7 -57
- package/assemblyManager/assemblyManager.js +2 -57
- package/configuration/configurationSchema.d.ts +4 -4
- package/configuration/configurationSchema.js +2 -14
- package/configuration/configurationSlot.d.ts +1 -12
- package/configuration/configurationSlot.js +2 -32
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +2 -2
- package/configuration/types.d.ts +2 -3
- package/configuration/util.d.ts +1 -25
- package/configuration/util.js +19 -56
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +10 -114
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +13 -79
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/index.d.ts +4 -4
- package/data_adapters/BaseAdapter/types.d.ts +2 -2
- package/data_adapters/BaseAdapter/util.d.ts +6 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +2 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +11 -12
- package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
- package/data_adapters/CytobandAdapter/configSchema.js +1 -7
- package/data_adapters/CytobandAdapter/index.d.ts +1 -1
- package/data_adapters/CytobandAdapter/index.js +1 -1
- package/data_adapters/dataAdapterCache.d.ts +4 -21
- package/data_adapters/dataAdapterCache.js +0 -19
- package/package.json +4 -5
- package/pluggableElementTypes/AdapterType.d.ts +2 -2
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
- package/pluggableElementTypes/ConnectionType.d.ts +3 -3
- package/pluggableElementTypes/DisplayType.d.ts +3 -9
- package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
- package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
- package/pluggableElementTypes/PluggableElementBase.js +2 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
- package/pluggableElementTypes/RpcMethodType.js +7 -19
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
- package/pluggableElementTypes/TrackType.d.ts +3 -3
- package/pluggableElementTypes/ViewType.d.ts +3 -3
- package/pluggableElementTypes/WidgetType.d.ts +4 -3
- package/pluggableElementTypes/index.d.ts +11 -11
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
- package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
- package/pluggableElementTypes/models/BaseTrackModel.js +0 -58
- package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
- package/pluggableElementTypes/models/BaseViewModel.js +2 -38
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
- package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
- package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
- package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +3 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +1 -6
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
- package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
- package/pluggableElementTypes/renderers/RendererType.d.ts +4 -8
- package/pluggableElementTypes/renderers/RendererType.js +1 -5
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -2
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +3 -12
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +6 -14
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +7 -57
- package/pluggableElementTypes/renderers/index.d.ts +1 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
- package/rpc/BaseRpcDriver.d.ts +3 -4
- package/rpc/BaseRpcDriver.js +20 -80
- package/rpc/MainThreadRpcDriver.d.ts +3 -7
- package/rpc/MainThreadRpcDriver.js +0 -5
- package/rpc/RpcManager.d.ts +3 -3
- package/rpc/RpcManager.js +2 -4
- package/rpc/WebWorkerRpcDriver.d.ts +3 -2
- package/rpc/WebWorkerRpcDriver.js +2 -13
- package/rpc/baseRpcConfig.d.ts +0 -3
- package/rpc/baseRpcConfig.js +1 -7
- package/rpc/configSchema.d.ts +0 -6
- package/rpc/configSchema.js +2 -11
- package/rpc/mainThreadRpcConfig.js +1 -7
- package/rpc/methods/CoreFreeResources.d.ts +0 -6
- package/rpc/methods/CoreFreeResources.js +2 -9
- package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
- package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
- package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
- package/rpc/methods/CoreGetFeatureDetails.js +0 -5
- package/rpc/methods/CoreGetFeatures.d.ts +5 -5
- package/rpc/methods/CoreGetFeatures.js +4 -5
- package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
- package/rpc/methods/CoreGetFileInfo.js +1 -1
- package/rpc/methods/CoreGetMetadata.d.ts +1 -2
- package/rpc/methods/CoreGetMetadata.js +1 -1
- package/rpc/methods/CoreGetRefNames.d.ts +1 -2
- package/rpc/methods/CoreGetRefNames.js +1 -1
- package/rpc/methods/CoreRender.d.ts +2 -6
- package/rpc/methods/CoreRender.js +5 -7
- package/rpc/methods/util.d.ts +3 -3
- package/rpc/methods/util.js +0 -1
- package/rpc/webWorkerRpcConfig.js +1 -7
- package/stories/JBrowseCore.stories.d.ts +1 -1
- package/stories/JBrowseCore.stories.js +3 -3
- package/stories/examples/WithSequencePanel.d.ts +1 -1
- package/stories/examples/WithSequencePanel.js +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +1 -1
- package/ui/AppLogo.js +0 -2
- package/ui/AssemblySelector.d.ts +2 -2
- package/ui/AssemblySelector.js +5 -5
- package/ui/BaseTooltip.js +2 -6
- package/ui/CascadingMenu.d.ts +2 -2
- package/ui/CascadingMenu.js +3 -4
- package/ui/CascadingMenuButton.d.ts +1 -1
- package/ui/CascadingMenuButton.js +1 -1
- package/ui/ColorPicker.js +1 -7
- package/ui/Dialog.d.ts +1 -1
- package/ui/Dialog.js +2 -6
- package/ui/DropDownMenu.d.ts +1 -1
- package/ui/DropDownMenu.js +2 -2
- package/ui/EditableTypography.d.ts +1 -1
- package/ui/EditableTypography.js +1 -5
- package/ui/ErrorBoundary.d.ts +2 -1
- package/ui/ErrorMessage.js +2 -9
- package/ui/ErrorMessageStackTraceDialog.js +2 -10
- package/ui/FactoryResetDialog.js +1 -1
- package/ui/FatalErrorDialog.js +1 -1
- package/ui/FileSelector/FileSelector.d.ts +4 -3
- package/ui/FileSelector/FileSelector.js +40 -40
- package/ui/FileSelector/LocalFileChooser.d.ts +1 -1
- package/ui/FileSelector/LocalFileChooser.js +0 -1
- package/ui/FileSelector/UrlChooser.d.ts +4 -3
- package/ui/FileSelector/UrlChooser.js +6 -2
- package/ui/Icons.d.ts +1 -1
- package/ui/Icons.js +1 -7
- package/ui/LoadingEllipses.d.ts +1 -1
- package/ui/LoadingEllipses.js +3 -3
- package/ui/Menu.d.ts +1 -1
- package/ui/Menu.js +3 -10
- package/ui/MenuButton.d.ts +1 -1
- package/ui/ResizeHandle.js +2 -2
- package/ui/ReturnToImportFormDialog.js +1 -1
- package/ui/SanitizedHTML.js +2 -19
- package/ui/Snackbar.d.ts +2 -2
- package/ui/Snackbar.js +1 -2
- package/ui/SnackbarModel.d.ts +1 -26
- package/ui/SnackbarModel.js +2 -30
- package/ui/colors.d.ts +1 -1
- package/ui/colors.js +1 -1
- package/ui/react-colorful.js +0 -3
- package/ui/theme.d.ts +1 -1
- package/ui/theme.js +24 -84
- package/util/Base1DUtils.d.ts +1 -1
- package/util/Base1DUtils.js +0 -12
- package/util/Base1DViewModel.d.ts +4 -81
- package/util/Base1DViewModel.js +4 -108
- package/util/QuickLRU.js +0 -9
- package/util/TimeTraveller.js +0 -4
- package/util/aborting.d.ts +0 -20
- package/util/aborting.js +0 -31
- package/util/analytics.js +1 -12
- package/util/blockTypes.d.ts +0 -11
- package/util/blockTypes.js +0 -13
- package/util/calculateDynamicBlocks.d.ts +1 -20
- package/util/calculateDynamicBlocks.js +1 -22
- package/util/calculateStaticBlocks.d.ts +2 -2
- package/util/calculateStaticBlocks.js +0 -2
- package/util/color/cssColorsLevel4.js +0 -1
- package/util/color/index.d.ts +0 -19
- package/util/color/index.js +0 -30
- package/util/compositeMap.js +0 -2
- package/util/dedupe.js +0 -1
- package/util/formatFastaStrings.d.ts +0 -13
- package/util/formatFastaStrings.js +0 -13
- package/util/idMaker.d.ts +1 -1
- package/util/idMaker.js +16 -12
- package/util/index.d.ts +25 -173
- package/util/index.js +87 -326
- package/util/io/RemoteFileWithRangeCache.d.ts +3 -2
- package/util/io/RemoteFileWithRangeCache.js +6 -10
- package/util/io/index.d.ts +3 -4
- package/util/io/index.js +3 -17
- package/util/jexl.js +3 -13
- package/util/jexlStrings.d.ts +0 -6
- package/util/jexlStrings.js +0 -8
- package/util/layouts/BaseLayout.d.ts +1 -1
- package/util/layouts/GranularRectLayout.d.ts +1 -17
- package/util/layouts/GranularRectLayout.js +4 -81
- package/util/layouts/MultiLayout.d.ts +1 -6
- package/util/layouts/MultiLayout.js +0 -6
- package/util/layouts/PrecomputedLayout.d.ts +1 -4
- package/util/layouts/PrecomputedLayout.js +0 -5
- package/util/layouts/PrecomputedMultiLayout.js +0 -2
- package/util/layouts/SceneGraph.d.ts +0 -12
- package/util/layouts/SceneGraph.js +0 -13
- package/util/makeAbortableReaction.d.ts +2 -0
- package/util/makeAbortableReaction.js +50 -0
- package/util/map-obj.js +0 -4
- package/util/mst-reflection.d.ts +1 -14
- package/util/mst-reflection.js +1 -28
- package/util/nanoid.js +0 -31
- package/util/nextTick.d.ts +1 -0
- package/util/nextTick.js +6 -0
- package/util/offscreenCanvasPonyfill.d.ts +0 -1
- package/util/offscreenCanvasPonyfill.js +1 -9
- package/util/offscreenCanvasUtils.js +1 -8
- package/util/range.d.ts +0 -25
- package/util/range.js +0 -34
- package/util/rxjs.d.ts +3 -7
- package/util/rxjs.js +2 -9
- package/util/simpleFeature.d.ts +0 -58
- package/util/simpleFeature.js +0 -35
- package/util/stats.d.ts +4 -34
- package/util/stats.js +0 -60
- package/util/stopToken.d.ts +3 -0
- package/util/stopToken.js +29 -0
- package/util/tracks.d.ts +3 -25
- package/util/tracks.js +0 -30
- package/util/types/index.d.ts +14 -30
- package/util/types/index.js +5 -14
- package/util/types/mst.js +0 -9
- package/util/types/util.d.ts +2 -9
- package/util/useMeasure.js +0 -1
- package/util/when.d.ts +1 -15
- package/util/when.js +3 -70
- package/rpc/remoteAbortSignals.d.ts +0 -36
- package/rpc/remoteAbortSignals.js +0 -79
package/ui/AppLogo.d.ts
CHANGED
package/ui/AppLogo.js
CHANGED
|
@@ -5,9 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const mobx_react_1 = require("mobx-react");
|
|
8
|
-
// locals
|
|
9
8
|
const configuration_1 = require("../configuration");
|
|
10
|
-
// ui elements
|
|
11
9
|
const Logo_1 = require("./Logo");
|
|
12
10
|
const Logo = (0, mobx_react_1.observer)(function ({ session, }) {
|
|
13
11
|
const { configuration } = session;
|
package/ui/AssemblySelector.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { AbstractSessionModel } from '../util';
|
|
3
|
+
import type { InputProps as IIP, TextFieldProps as TFP } from '@mui/material';
|
|
4
4
|
declare const AssemblySelector: ({ session, onChange, selected, InputProps, TextFieldProps, localStorageKey, helperText, }: {
|
|
5
5
|
session: AbstractSessionModel;
|
|
6
6
|
helperText?: string;
|
package/ui/AssemblySelector.js
CHANGED
|
@@ -27,7 +27,6 @@ const react_1 = __importStar(require("react"));
|
|
|
27
27
|
const material_1 = require("@mui/material");
|
|
28
28
|
const mobx_react_1 = require("mobx-react");
|
|
29
29
|
const mui_1 = require("tss-react/mui");
|
|
30
|
-
// locals
|
|
31
30
|
const configuration_1 = require("../configuration");
|
|
32
31
|
const util_1 = require("../util");
|
|
33
32
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
@@ -38,8 +37,6 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
38
37
|
const AssemblySelector = (0, mobx_react_1.observer)(function ({ session, onChange, selected, InputProps, TextFieldProps, localStorageKey, helperText = 'Select assembly to view', }) {
|
|
39
38
|
const { classes } = useStyles();
|
|
40
39
|
const { assemblyNames, assemblyManager } = session;
|
|
41
|
-
// constructs a localstorage key based on host/path/config to help
|
|
42
|
-
// remember. non-config assists usage with e.g. embedded apps
|
|
43
40
|
const config = new URLSearchParams(window.location.search).get('config');
|
|
44
41
|
const [lastSelected, setLastSelected] = typeof jest === 'undefined' && localStorageKey
|
|
45
42
|
? (0, util_1.useLocalStorage)(`lastAssembly-${[
|
|
@@ -57,9 +54,12 @@ const AssemblySelector = (0, mobx_react_1.observer)(function ({ session, onChang
|
|
|
57
54
|
}
|
|
58
55
|
}, [selection, onChange, selected]);
|
|
59
56
|
const error = assemblyNames.length ? '' : 'No configured assemblies';
|
|
60
|
-
return (react_1.default.createElement(material_1.TextField, { select: true, label: "Assembly", variant: "outlined", helperText: error || helperText, value: selection || '',
|
|
57
|
+
return (react_1.default.createElement(material_1.TextField, { select: true, label: "Assembly", variant: "outlined", helperText: error || helperText, value: selection || '', onChange: event => {
|
|
61
58
|
setLastSelected(event.target.value);
|
|
62
|
-
}, error: !!error,
|
|
59
|
+
}, error: !!error, disabled: !!error, className: classes.importFormEntry, ...TextFieldProps, slotProps: {
|
|
60
|
+
input: InputProps,
|
|
61
|
+
htmlInput: { 'data-testid': 'assembly-selector' },
|
|
62
|
+
} }, assemblyNames.map(name => {
|
|
63
63
|
const assembly = assemblyManager.get(name);
|
|
64
64
|
const displayName = assembly ? (0, configuration_1.getConf)(assembly, 'displayName') : '';
|
|
65
65
|
return (react_1.default.createElement(material_1.MenuItem, { key: name, value: name }, displayName || name));
|
package/ui/BaseTooltip.js
CHANGED
|
@@ -5,15 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = BaseTooltip;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const mui_1 = require("tss-react/mui");
|
|
9
|
-
const material_1 = require("@mui/material");
|
|
10
8
|
const react_2 = require("@floating-ui/react");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const mui_1 = require("tss-react/mui");
|
|
11
11
|
function round(value) {
|
|
12
12
|
return Math.round(value * 1e5) / 1e5;
|
|
13
13
|
}
|
|
14
14
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
15
|
-
// these styles come from
|
|
16
|
-
// https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Tooltip/Tooltip.js
|
|
17
15
|
tooltip: {
|
|
18
16
|
position: 'absolute',
|
|
19
17
|
pointerEvents: 'none',
|
|
@@ -43,8 +41,6 @@ function BaseTooltip({ clientPoint: clientPointCoords, children, placement = 'ri
|
|
|
43
41
|
react_1.default.createElement("div", { className: classes.tooltip, ref: refs.setFloating, style: {
|
|
44
42
|
...floatingStyles,
|
|
45
43
|
zIndex: 100000,
|
|
46
|
-
// workaround for tooltips flashing at top left corner of screen
|
|
47
|
-
// when first appearing
|
|
48
44
|
visibility: floatingStyles.transform === 'translate(0px, 0px)'
|
|
49
45
|
? 'hidden'
|
|
50
46
|
: undefined,
|
package/ui/CascadingMenu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MenuItem as JBMenuItem } from './Menu';
|
|
3
|
-
import { PopupState } from 'material-ui-popup-state/hooks';
|
|
2
|
+
import type { MenuItem as JBMenuItem } from './Menu';
|
|
3
|
+
import type { PopupState } from 'material-ui-popup-state/hooks';
|
|
4
4
|
declare function CascadingMenuChildren(props: {
|
|
5
5
|
onMenuItemClick: Function;
|
|
6
6
|
closeAfterItemClick?: boolean;
|
package/ui/CascadingMenu.js
CHANGED
|
@@ -26,13 +26,12 @@ 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
|
-
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
30
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const ChevronRight_1 = __importDefault(require("@mui/icons-material/ChevronRight"));
|
|
31
31
|
const material_1 = require("@mui/material");
|
|
32
|
-
const Menu_1 = require("./Menu");
|
|
33
|
-
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
34
32
|
const HoverMenu_1 = __importDefault(require("material-ui-popup-state/HoverMenu"));
|
|
35
|
-
const
|
|
33
|
+
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
34
|
+
const Menu_1 = require("./Menu");
|
|
36
35
|
const CascadingContext = react_1.default.createContext({
|
|
37
36
|
parentPopupState: null,
|
|
38
37
|
rootPopupState: null,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MenuItem } from '@jbrowse/core/ui';
|
|
2
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
3
3
|
declare const CascadingMenuButton: ({ children, menuItems, closeAfterItemClick, stopPropagation, setOpen, onClick: onClickExtra, ...rest }: {
|
|
4
4
|
children?: React.ReactElement;
|
|
5
5
|
menuItems: MenuItem[];
|
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
const CascadingMenu_1 = __importDefault(require("@jbrowse/core/ui/CascadingMenu"));
|
|
31
31
|
const material_1 = require("@mui/material");
|
|
32
|
-
const mobx_react_1 = require("mobx-react");
|
|
33
32
|
const hooks_1 = require("material-ui-popup-state/hooks");
|
|
33
|
+
const mobx_react_1 = require("mobx-react");
|
|
34
34
|
const CascadingMenuButton = (0, mobx_react_1.observer)(function CascadingMenuButton({ children, menuItems, closeAfterItemClick = true, stopPropagation, setOpen, onClick: onClickExtra, ...rest }) {
|
|
35
35
|
const popupState = (0, hooks_1.usePopupState)({
|
|
36
36
|
popupId: 'viewMenu',
|
package/ui/ColorPicker.js
CHANGED
|
@@ -30,12 +30,8 @@ const react_1 = __importStar(require("react"));
|
|
|
30
30
|
const colord_1 = require("@jbrowse/core/util/colord");
|
|
31
31
|
const material_1 = require("@mui/material");
|
|
32
32
|
const mui_1 = require("tss-react/mui");
|
|
33
|
-
// locals
|
|
34
33
|
const paletteColors = __importStar(require("./colors"));
|
|
35
34
|
const util_1 = require("../util");
|
|
36
|
-
// we are using a vendored copy of react-colorful because the default uses
|
|
37
|
-
// pure-ESM which is difficult to make pass with jest e.g.
|
|
38
|
-
// https://stackoverflow.com/questions/58613492/how-to-resolve-cannot-use-import-statement-outside-a-module-in-jest
|
|
39
35
|
const react_colorful_1 = require("./react-colorful");
|
|
40
36
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
41
37
|
picker: { position: 'relative' },
|
|
@@ -93,9 +89,7 @@ function ColorPicker({ onChange, color, }) {
|
|
|
93
89
|
const pal = event.target.value;
|
|
94
90
|
setVal(pal);
|
|
95
91
|
} }, palettes.map(p => (react_1.default.createElement(material_1.MenuItem, { value: p, key: p }, p)))),
|
|
96
|
-
react_1.default.createElement("div", { className: classes.swatches }, presetColors.map((presetColor, idx) => (react_1.default.createElement("button", { type: "button",
|
|
97
|
-
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
98
|
-
key: `${presetColor}-${idx}`, className: classes.swatch, style: { background: presetColor }, onClick: () => {
|
|
92
|
+
react_1.default.createElement("div", { className: classes.swatches }, presetColors.map((presetColor, idx) => (react_1.default.createElement("button", { type: "button", key: `${presetColor}-${idx}`, className: classes.swatch, style: { background: presetColor }, onClick: () => {
|
|
99
93
|
handleChange(presetColor);
|
|
100
94
|
} })))),
|
|
101
95
|
react_1.default.createElement(material_1.TextField, { helperText: 'Manually set color (hex, rgb, or css color name)', value: text, onChange: event => {
|
package/ui/Dialog.d.ts
CHANGED
package/ui/Dialog.js
CHANGED
|
@@ -4,13 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const ErrorBoundary_1 = require("@jbrowse/core/ui/ErrorBoundary");
|
|
8
|
+
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
7
9
|
const material_1 = require("@mui/material");
|
|
8
10
|
const mobx_react_1 = require("mobx-react");
|
|
9
11
|
const mui_1 = require("tss-react/mui");
|
|
10
|
-
const ErrorBoundary_1 = require("@jbrowse/core/ui/ErrorBoundary");
|
|
11
|
-
// icons
|
|
12
|
-
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
13
|
-
// locals
|
|
14
12
|
const ErrorMessage_1 = __importDefault(require("./ErrorMessage"));
|
|
15
13
|
const SanitizedHTML_1 = __importDefault(require("./SanitizedHTML"));
|
|
16
14
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
@@ -34,7 +32,6 @@ const Dialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
34
32
|
react_1.default.isValidElement(header) ? (header) : (react_1.default.createElement(material_1.DialogTitle, null,
|
|
35
33
|
react_1.default.createElement(SanitizedHTML_1.default, { html: title || '' }),
|
|
36
34
|
onClose ? (react_1.default.createElement(material_1.IconButton, { className: classes.closeButton, onClick: () => {
|
|
37
|
-
// @ts-expect-error
|
|
38
35
|
onClose();
|
|
39
36
|
} },
|
|
40
37
|
react_1.default.createElement(Close_1.default, null))) : null)),
|
|
@@ -45,7 +42,6 @@ const Dialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
45
42
|
MuiInputBase: {
|
|
46
43
|
styleOverrides: {
|
|
47
44
|
input: {
|
|
48
|
-
// xref https://github.com/GMOD/jbrowse-components/pull/3666
|
|
49
45
|
boxSizing: 'content-box!important',
|
|
50
46
|
},
|
|
51
47
|
},
|
package/ui/DropDownMenu.d.ts
CHANGED
package/ui/DropDownMenu.js
CHANGED
|
@@ -27,10 +27,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const ArrowDropDown_1 = __importDefault(require("@mui/icons-material/ArrowDropDown"));
|
|
30
31
|
const material_1 = require("@mui/material");
|
|
31
|
-
const mui_1 = require("tss-react/mui");
|
|
32
32
|
const mobx_react_1 = require("mobx-react");
|
|
33
|
-
const
|
|
33
|
+
const mui_1 = require("tss-react/mui");
|
|
34
34
|
const Menu_1 = __importDefault(require("./Menu"));
|
|
35
35
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
36
36
|
buttonRoot: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import type { TypographyProps } from '@mui/material';
|
|
3
3
|
type Variant = TypographyProps['variant'];
|
|
4
4
|
type EditableTypographyClassKey = 'input' | 'inputBase' | 'inputRoot' | 'inputFocused';
|
|
5
5
|
interface Props {
|
package/ui/EditableTypography.js
CHANGED
|
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const useMeasure_1 = __importDefault(require("@jbrowse/core/util/useMeasure"));
|
|
30
31
|
const material_1 = require("@mui/material");
|
|
31
32
|
const mui_1 = require("tss-react/mui");
|
|
32
|
-
const useMeasure_1 = __importDefault(require("@jbrowse/core/util/useMeasure"));
|
|
33
33
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
34
34
|
input: {},
|
|
35
35
|
inputBase: {},
|
|
@@ -48,7 +48,6 @@ const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
|
48
48
|
borderWidth: 2,
|
|
49
49
|
},
|
|
50
50
|
}));
|
|
51
|
-
// using forwardRef so that MUI Tooltip can wrap this component
|
|
52
51
|
const EditableTypography = react_1.default.forwardRef(function EditableTypography2(props, ref) {
|
|
53
52
|
const { value, setValue, variant, ...other } = props;
|
|
54
53
|
const [ref2, { width }] = (0, useMeasure_1.default)();
|
|
@@ -61,9 +60,6 @@ const EditableTypography = react_1.default.forwardRef(function EditableTypograph
|
|
|
61
60
|
setBlur(false);
|
|
62
61
|
}
|
|
63
62
|
}, [blur, inputNode]);
|
|
64
|
-
// possibly tss-react does not understand the passing of props to
|
|
65
|
-
// useStyles, but it appears to work
|
|
66
|
-
// @ts-expect-error
|
|
67
63
|
const { classes } = useStyles(props, { props });
|
|
68
64
|
const theme = (0, material_1.useTheme)();
|
|
69
65
|
const val = editedValue === undefined ? value : editedValue;
|
package/ui/ErrorBoundary.d.ts
CHANGED
package/ui/ErrorMessage.js
CHANGED
|
@@ -27,14 +27,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const Refresh_1 = __importDefault(require("@mui/icons-material/Refresh"));
|
|
31
|
+
const Report_1 = __importDefault(require("@mui/icons-material/Report"));
|
|
30
32
|
const material_1 = require("@mui/material");
|
|
31
33
|
const mui_1 = require("tss-react/mui");
|
|
32
|
-
// locals
|
|
33
34
|
const RedErrorMessageBox_1 = __importDefault(require("./RedErrorMessageBox"));
|
|
34
|
-
// icons
|
|
35
|
-
const Refresh_1 = __importDefault(require("@mui/icons-material/Refresh"));
|
|
36
|
-
const Report_1 = __importDefault(require("@mui/icons-material/Report"));
|
|
37
|
-
// lazies
|
|
38
35
|
const ErrorMessageStackTraceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./ErrorMessageStackTraceDialog'))));
|
|
39
36
|
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
40
37
|
bg: {
|
|
@@ -53,15 +50,11 @@ function parseError(str) {
|
|
|
53
50
|
const idx = str.indexOf(findStr);
|
|
54
51
|
if (idx !== -1) {
|
|
55
52
|
const trim = str.slice(0, idx + findStr.length);
|
|
56
|
-
// best effort to make a better error message than the default
|
|
57
|
-
// mobx-state-tree
|
|
58
|
-
// case 1. element has a path
|
|
59
53
|
const match = /.*at path "(.*)" snapshot `(.*)` is not assignable/m.exec(trim);
|
|
60
54
|
if (match) {
|
|
61
55
|
str = `Failed to load element at ${match[1]}...Failed element had snapshot`;
|
|
62
56
|
snapshotError = match[2];
|
|
63
57
|
}
|
|
64
|
-
// case 2. element has no path
|
|
65
58
|
const match2 = /.*snapshot `(.*)` is not assignable/.exec(trim);
|
|
66
59
|
if (match2) {
|
|
67
60
|
str = 'Failed to load element...Failed element had snapshot';
|
|
@@ -29,10 +29,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.default = ErrorMessageStackTraceDialog;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const material_1 = require("@mui/material");
|
|
32
|
-
const mui_1 = require("tss-react/mui");
|
|
33
|
-
const source_map_js_1 = require("source-map-js");
|
|
34
32
|
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
35
|
-
|
|
33
|
+
const source_map_js_1 = require("source-map-js");
|
|
34
|
+
const mui_1 = require("tss-react/mui");
|
|
36
35
|
const Dialog_1 = __importDefault(require("./Dialog"));
|
|
37
36
|
const LoadingEllipses_1 = __importDefault(require("./LoadingEllipses"));
|
|
38
37
|
function Link2({ href, children, }) {
|
|
@@ -53,8 +52,6 @@ async function myfetchtext(uri) {
|
|
|
53
52
|
const res = await myfetch(uri);
|
|
54
53
|
return res.text();
|
|
55
54
|
}
|
|
56
|
-
// produce a source-map resolved stack trace
|
|
57
|
-
// reference code https://stackoverflow.com/a/77158517/2129219
|
|
58
55
|
const sourceMaps = {};
|
|
59
56
|
async function getSourceMapFromUri(uri) {
|
|
60
57
|
var _a;
|
|
@@ -97,11 +94,8 @@ async function mapStackTrace(stack) {
|
|
|
97
94
|
return mappedStack.join('\n');
|
|
98
95
|
}
|
|
99
96
|
const MAX_ERR_LEN = 10000;
|
|
100
|
-
// Chrome has the error message in the stacktrace, firefox doesn't
|
|
101
97
|
function stripMessage(trace, error) {
|
|
102
98
|
if (trace.startsWith('Error:')) {
|
|
103
|
-
// remove the error message, which can be very long due to mobx-state-tree
|
|
104
|
-
// stuff, to get just the stack trace
|
|
105
99
|
const err = `${error}`;
|
|
106
100
|
return trace.slice(err.length);
|
|
107
101
|
}
|
|
@@ -151,7 +145,6 @@ function ErrorMessageStackTraceDialog({ error, onClose, extra, }) {
|
|
|
151
145
|
const errorText = error ? `${error}` : '';
|
|
152
146
|
const stackTrace = stripMessage(stackTracePreProcessed, errorText);
|
|
153
147
|
(0, react_1.useEffect)(() => {
|
|
154
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
155
148
|
;
|
|
156
149
|
(async () => {
|
|
157
150
|
try {
|
|
@@ -173,7 +166,6 @@ function ErrorMessageStackTraceDialog({ error, onClose, extra, }) {
|
|
|
173
166
|
? `${errorText.slice(0, MAX_ERR_LEN)}...`
|
|
174
167
|
: errorText,
|
|
175
168
|
mappedStackTrace || 'No stack trace available',
|
|
176
|
-
// @ts-expect-error add version info at bottom if we are in jbrowse-web
|
|
177
169
|
window.JBrowseSession ? `JBrowse ${window.JBrowseSession.version}` : '',
|
|
178
170
|
]
|
|
179
171
|
.filter(f => !!f)
|
package/ui/FactoryResetDialog.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = FactoryResetDialog;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const material_1 = require("@mui/material");
|
|
9
8
|
const Dialog_1 = __importDefault(require("@jbrowse/core/ui/Dialog"));
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
10
|
function FactoryResetDialog({ onClose, open, onFactoryReset, }) {
|
|
11
11
|
function handleDialogClose(action) {
|
|
12
12
|
if (action === 'reset') {
|
package/ui/FatalErrorDialog.js
CHANGED
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.default = FatalErrorDialog;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const material_1 = require("@mui/material");
|
|
32
|
-
const FactoryResetDialog_1 = __importDefault(require("./FactoryResetDialog"));
|
|
33
32
|
const ErrorMessage_1 = __importDefault(require("./ErrorMessage"));
|
|
33
|
+
const FactoryResetDialog_1 = __importDefault(require("./FactoryResetDialog"));
|
|
34
34
|
const ResetComponent = ({ onFactoryReset, resetButtonText, }) => {
|
|
35
35
|
const [dialogOpen, setDialogOpen] = (0, react_1.useState)(false);
|
|
36
36
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { AbstractRootModel, FileLocation } from '../../util/types';
|
|
3
3
|
declare const FileSelector: (props: {
|
|
4
4
|
location?: FileLocation;
|
|
5
|
-
setLocation: (param: FileLocation) => void;
|
|
6
|
-
setName?: (str: string) => void;
|
|
7
5
|
name?: string;
|
|
8
6
|
description?: string;
|
|
7
|
+
inline?: boolean;
|
|
9
8
|
rootModel?: AbstractRootModel;
|
|
9
|
+
setLocation: (param: FileLocation) => void;
|
|
10
|
+
setName?: (str: string) => void;
|
|
10
11
|
}) => React.JSX.Element;
|
|
11
12
|
export default FileSelector;
|
|
@@ -27,15 +27,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const
|
|
30
|
+
const ArrowDropDown_1 = __importDefault(require("@mui/icons-material/ArrowDropDown"));
|
|
31
31
|
const material_1 = require("@mui/material");
|
|
32
|
-
|
|
33
|
-
const types_1 = require("../../util/types");
|
|
32
|
+
const mobx_react_1 = require("mobx-react");
|
|
34
33
|
const LocalFileChooser_1 = __importDefault(require("./LocalFileChooser"));
|
|
35
34
|
const UrlChooser_1 = __importDefault(require("./UrlChooser"));
|
|
36
35
|
const util_1 = require("../../util");
|
|
37
|
-
|
|
38
|
-
const ArrowDropDown_1 = __importDefault(require("@mui/icons-material/ArrowDropDown"));
|
|
36
|
+
const types_1 = require("../../util/types");
|
|
39
37
|
const NUM_SHOWN = 2;
|
|
40
38
|
function ToggleButtonWithTooltip(props) {
|
|
41
39
|
const { title, children, ...other } = props;
|
|
@@ -48,8 +46,19 @@ function shorten(str, len) {
|
|
|
48
46
|
}
|
|
49
47
|
return str;
|
|
50
48
|
}
|
|
49
|
+
function Inline({ children }) {
|
|
50
|
+
return react_1.default.createElement("div", { style: { display: 'flex', gap: 4 } }, children);
|
|
51
|
+
}
|
|
52
|
+
function Box2({ children }) {
|
|
53
|
+
return (react_1.default.createElement(material_1.Box, { display: "flex", flexDirection: "row" },
|
|
54
|
+
react_1.default.createElement(material_1.Box, null, children)));
|
|
55
|
+
}
|
|
56
|
+
function Input(props) {
|
|
57
|
+
const { setLocation, inline, toggleButtonValue, selectedAccount } = props;
|
|
58
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.SelectorComponent) ? (react_1.default.createElement(selectedAccount.SelectorComponent, { ...props, setLocation: setLocation })) : toggleButtonValue === 'url' ? (react_1.default.createElement(UrlChooser_1.default, { ...props, setLocation: setLocation, label: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.selectorLabel, style: inline ? { margin: 0 } : undefined })) : toggleButtonValue === 'file' ? (react_1.default.createElement(LocalFileChooser_1.default, { ...props })) : null));
|
|
59
|
+
}
|
|
51
60
|
const FileSelector = (0, mobx_react_1.observer)(function (props) {
|
|
52
|
-
const { location, name, description, rootModel, setLocation } = props;
|
|
61
|
+
const { inline, location, name, description, rootModel, setLocation } = props;
|
|
53
62
|
const fileOrUrl = !location || (0, types_1.isUriLocation)(location) ? 'url' : 'file';
|
|
54
63
|
const [toggleButtonValue, setToggleButtonValue] = (0, react_1.useState)(location && 'internetAccountId' in location && location.internetAccountId
|
|
55
64
|
? location.internetAccountId
|
|
@@ -74,27 +83,19 @@ const FileSelector = (0, mobx_react_1.observer)(function (props) {
|
|
|
74
83
|
});
|
|
75
84
|
}, [setLocation, selectedAccount]);
|
|
76
85
|
(0, react_1.useEffect)(() => {
|
|
77
|
-
// if you swap account selection after inputting url
|
|
78
86
|
if (selectedAccount &&
|
|
79
87
|
(0, types_1.isUriLocation)(location) &&
|
|
80
88
|
location.internetAccountId !== selectedAccount.internetAccountId) {
|
|
81
89
|
setLocationWithAccount(location);
|
|
82
90
|
}
|
|
83
91
|
}, [location, selectedAccount, setLocationWithAccount]);
|
|
84
|
-
|
|
85
|
-
if (toggleButtonValue === 'file') {
|
|
86
|
-
locationInput = react_1.default.createElement(LocalFileChooser_1.default, { ...props });
|
|
87
|
-
}
|
|
88
|
-
if (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.SelectorComponent) {
|
|
89
|
-
const { SelectorComponent } = selectedAccount;
|
|
90
|
-
locationInput = (react_1.default.createElement(SelectorComponent, { ...props, setLocation: setLocationWithAccount }));
|
|
91
|
-
}
|
|
92
|
+
const Wrapper = inline ? Inline : Box2;
|
|
92
93
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
93
94
|
react_1.default.createElement(material_1.Box, { display: "flex" },
|
|
94
95
|
react_1.default.createElement(material_1.InputLabel, { shrink: true }, name)),
|
|
95
|
-
react_1.default.createElement(material_1.
|
|
96
|
-
react_1.default.createElement(
|
|
97
|
-
react_1.default.createElement(material_1.ToggleButtonGroup, { value: toggleButtonValue, exclusive: true, onChange: (_event, newState) => {
|
|
96
|
+
react_1.default.createElement(material_1.FormGroup, null,
|
|
97
|
+
react_1.default.createElement(Wrapper, null,
|
|
98
|
+
react_1.default.createElement(material_1.ToggleButtonGroup, { value: toggleButtonValue, exclusive: true, size: "small", onChange: (_event, newState) => {
|
|
98
99
|
setRecentlyUsedInternetAccounts([
|
|
99
100
|
...new Set([newState, ...recentlyUsedInternetAccounts].filter(util_1.notEmpty)),
|
|
100
101
|
]);
|
|
@@ -105,37 +106,36 @@ const FileSelector = (0, mobx_react_1.observer)(function (props) {
|
|
|
105
106
|
setLocationWithAccount(location);
|
|
106
107
|
}
|
|
107
108
|
}, "aria-label": "file, url, or account picker" },
|
|
108
|
-
new URLSearchParams(window.location.search).get('adminKey') ? null : (react_1.default.createElement(material_1.ToggleButton, { value: "file", "aria-label": "local file" }, "File")),
|
|
109
|
-
react_1.default.createElement(material_1.ToggleButton, { value: "url", "aria-label": "url" }, "URL"),
|
|
109
|
+
new URLSearchParams(window.location.search).get('adminKey') ? null : (react_1.default.createElement(material_1.ToggleButton, { size: "small", value: "file", "aria-label": "local file" }, "File")),
|
|
110
|
+
react_1.default.createElement(material_1.ToggleButton, { size: "small", value: "url", "aria-label": "url" }, "URL"),
|
|
110
111
|
shownAccounts.map(id => {
|
|
111
112
|
const { internetAccountId, name, toggleContents } = map[id];
|
|
112
113
|
return (react_1.default.createElement(ToggleButtonWithTooltip, { key: id, value: internetAccountId, title: name }, typeof toggleContents === 'string'
|
|
113
114
|
? shorten(toggleContents, 5)
|
|
114
115
|
: toggleContents || shorten(name, 5)));
|
|
115
116
|
}),
|
|
116
|
-
hiddenAccounts.length > 0 ? (
|
|
117
|
-
// @ts-expect-error
|
|
118
|
-
react_1.default.createElement(material_1.ToggleButton, { onClick: event => {
|
|
117
|
+
hiddenAccounts.length > 0 ? (react_1.default.createElement(material_1.ToggleButton, { onClick: event => {
|
|
119
118
|
setAnchorEl(event.target);
|
|
120
119
|
}, selected: false },
|
|
121
120
|
"More",
|
|
122
121
|
react_1.default.createElement(ArrowDropDown_1.default, null))) : null),
|
|
123
|
-
react_1.default.createElement(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
122
|
+
inline ? (react_1.default.createElement(Input, { ...props, toggleButtonValue: toggleButtonValue, selectedAccount: selectedAccount, setLocation: setLocationWithAccount })) : null),
|
|
123
|
+
!inline ? (react_1.default.createElement(Input, { ...props, toggleButtonValue: toggleButtonValue, selectedAccount: selectedAccount, setLocation: setLocationWithAccount })) : null),
|
|
124
|
+
react_1.default.createElement(material_1.FormHelperText, null, description),
|
|
125
|
+
anchorEl ? (react_1.default.createElement(material_1.Menu, { open: true, anchorEl: anchorEl, anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }, onClose: () => {
|
|
126
|
+
setAnchorEl(null);
|
|
127
|
+
} }, hiddenAccounts.map(id => {
|
|
128
|
+
const { internetAccountId, name } = map[id];
|
|
129
|
+
return (react_1.default.createElement(material_1.MenuItem, { key: id, value: internetAccountId, onClick: () => {
|
|
130
|
+
setRecentlyUsedInternetAccounts([
|
|
131
|
+
...new Set([
|
|
132
|
+
internetAccountId,
|
|
133
|
+
...recentlyUsedInternetAccounts,
|
|
134
|
+
].filter(util_1.notEmpty)),
|
|
135
|
+
]);
|
|
136
|
+
setToggleButtonValue(internetAccountId);
|
|
137
|
+
setAnchorEl(null);
|
|
138
|
+
} }, name));
|
|
139
|
+
}))) : null));
|
|
140
140
|
});
|
|
141
141
|
exports.default = FileSelector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FileLocation } from '../../util/types';
|
|
2
|
+
import type { FileLocation } from '../../util/types';
|
|
3
3
|
declare function LocalFileChooser({ location, setLocation, }: {
|
|
4
4
|
location?: FileLocation;
|
|
5
5
|
setLocation: (arg: FileLocation) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FileLocation } from '../../util/types';
|
|
3
|
-
declare const UrlChooser: ({ location,
|
|
2
|
+
import type { FileLocation } from '../../util/types';
|
|
3
|
+
declare const UrlChooser: ({ location, label, style, setLocation, }: {
|
|
4
4
|
location?: FileLocation;
|
|
5
|
-
setLocation: (arg: FileLocation) => void;
|
|
6
5
|
label?: string;
|
|
6
|
+
style?: Record<string, unknown>;
|
|
7
|
+
setLocation: (arg: FileLocation) => void;
|
|
7
8
|
}) => React.JSX.Element;
|
|
8
9
|
export default UrlChooser;
|
|
@@ -7,12 +7,16 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
const types_1 = require("../../util/types");
|
|
10
|
-
const UrlChooser = (0, mobx_react_1.observer)(function ({ location,
|
|
11
|
-
return (react_1.default.createElement(material_1.TextField, {
|
|
10
|
+
const UrlChooser = (0, mobx_react_1.observer)(function ({ location, label, style, setLocation, }) {
|
|
11
|
+
return (react_1.default.createElement(material_1.TextField, { variant: "outlined", fullWidth: true, defaultValue: location && (0, types_1.isUriLocation)(location) ? location.uri : '', label: label || 'Enter URL', style: style, onChange: event => {
|
|
12
12
|
setLocation({
|
|
13
13
|
uri: event.target.value.trim(),
|
|
14
14
|
locationType: 'UriLocation',
|
|
15
15
|
});
|
|
16
|
+
}, slotProps: {
|
|
17
|
+
htmlInput: {
|
|
18
|
+
'data-testid': 'urlInput',
|
|
19
|
+
},
|
|
16
20
|
} }));
|
|
17
21
|
});
|
|
18
22
|
exports.default = UrlChooser;
|
package/ui/Icons.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SvgIconProps } from '@mui/material/SvgIcon';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { SvgIconProps } from '@mui/material/SvgIcon';
|
|
3
3
|
export declare function ContentCopy(props: SvgIconProps): React.JSX.Element;
|
|
4
4
|
export declare function Indexing(props: SvgIconProps): React.JSX.Element;
|
|
5
5
|
export declare function ContentCut(props: SvgIconProps): React.JSX.Element;
|