@jbrowse/core 2.3.4 → 2.4.1
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.d.ts +18 -19
- package/BaseFeatureWidget/BaseFeatureDetail.js +76 -69
- package/BaseFeatureWidget/SequenceBox.js +9 -3
- package/BaseFeatureWidget/SequenceFeatureDetails.js +70 -52
- package/BaseFeatureWidget/SequencePanel.d.ts +3 -3
- package/BaseFeatureWidget/SequencePanel.js +8 -5
- package/BaseFeatureWidget/index.js +2 -2
- package/CorePlugin.js +2 -7
- package/PluginLoader.d.ts +1 -1
- package/PluginLoader.js +20 -24
- package/PluginManager.d.ts +1 -1
- package/PluginManager.js +2 -3
- package/ReExports/Attributes.d.ts +1 -2
- package/ReExports/Attributes.js +4 -3
- package/ReExports/BaseCard.d.ts +1 -2
- package/ReExports/BaseCard.js +4 -3
- package/ReExports/DataGrid.d.ts +1 -2
- package/ReExports/DataGrid.js +2 -2
- package/ReExports/FeatureDetails.d.ts +1 -2
- package/ReExports/FeatureDetails.js +4 -3
- package/ReExports/index.d.ts +1 -2
- package/ReExports/index.js +3 -2
- package/ReExports/modules.d.ts +1 -1
- package/ReExports/modules.js +2 -2
- package/assemblyManager/assembly.js +5 -5
- package/assemblyManager/assemblyConfigSchema.js +2 -2
- package/configuration/configurationSchema.js +1 -1
- package/configuration/util.js +1 -1
- package/data_adapters/BaseAdapter.js +1 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +8 -0
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +40 -0
- package/data_adapters/CytobandAdapter/configSchema.d.ts +2 -0
- package/data_adapters/CytobandAdapter/configSchema.js +17 -0
- package/data_adapters/CytobandAdapter/index.d.ts +3 -0
- package/data_adapters/CytobandAdapter/index.js +37 -0
- package/data_adapters/dataAdapterCache.d.ts +3 -2
- package/data_adapters/dataAdapterCache.js +2 -3
- package/package.json +5 -4
- package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
- package/pluggableElementTypes/PluggableElementBase.js +1 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +5 -8
- package/pluggableElementTypes/RpcMethodType.js +23 -34
- package/pluggableElementTypes/index.d.ts +11 -1
- package/pluggableElementTypes/index.js +23 -23
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +2 -2
- package/pluggableElementTypes/models/BaseTrackModel.js +8 -13
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +13 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +10 -2
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +8 -2
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +10 -4
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +2 -34
- package/pluggableElementTypes/renderers/index.d.ts +7 -9
- package/pluggableElementTypes/renderers/index.js +15 -15
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -1
- package/rpc/BaseRpcDriver.js +7 -8
- package/rpc/WebWorkerRpcDriver.js +18 -12
- package/rpc/coreRpcMethods.d.ts +9 -11
- package/rpc/coreRpcMethods.js +17 -17
- package/rpc/methods/CoreGetFeatureDetails.js +1 -1
- package/rpc/methods/util.d.ts +2 -2
- package/rpc/methods/util.js +2 -2
- package/rpc/remoteAbortSignals.js +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/App.js +3 -18
- package/ui/AppLogo.js +1 -6
- package/ui/ColorPicker.js +1 -1
- package/ui/Dialog.js +1 -1
- package/ui/DrawerWidget.js +4 -4
- package/ui/EditableTypography.js +1 -1
- package/ui/FileSelector/FileSelector.d.ts +2 -2
- package/ui/FileSelector/FileSelector.js +24 -35
- package/ui/FileSelector/index.d.ts +1 -2
- package/ui/FileSelector/index.js +3 -2
- package/ui/LoadingEllipses.js +2 -2
- package/ui/Menu.js +45 -32
- package/ui/ResizeBar.js +10 -6
- package/ui/ResizeHandle.js +3 -6
- package/ui/SanitizedHTML.js +2 -0
- package/ui/ViewContainer.js +7 -44
- package/ui/ViewMenu.d.ts +9 -0
- package/ui/ViewMenu.js +69 -0
- package/ui/ViewPanel.d.ts +19 -0
- package/ui/ViewPanel.js +49 -0
- package/ui/theme.d.ts +10 -166
- package/ui/theme.js +260 -48
- package/util/Base1DUtils.js +16 -14
- package/util/Base1DViewModel.d.ts +1 -1
- package/util/Base1DViewModel.js +9 -8
- package/util/aborting.js +1 -1
- package/util/analytics.js +1 -1
- package/util/blockTypes.js +10 -10
- package/util/color/index.d.ts +1 -2
- package/util/color/index.js +4 -3
- package/util/idMaker.js +5 -8
- package/util/index.d.ts +9 -9
- package/util/index.js +35 -52
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/io/index.d.ts +1 -2
- package/util/io/index.js +6 -6
- package/util/jexl.js +3 -1
- package/util/layouts/GranularRectLayout.js +10 -4
- package/util/layouts/MultiLayout.js +1 -1
- package/util/layouts/SceneGraph.js +3 -7
- package/util/map-obj.d.ts +3 -0
- package/util/map-obj.js +33 -0
- package/util/offscreenCanvasPonyfill.js +4 -3
- package/util/offscreenCanvasUtils.d.ts +18 -4
- package/util/offscreenCanvasUtils.js +49 -7
- package/util/tracks.d.ts +1 -1
- package/util/tracks.js +0 -1
- package/util/types/index.d.ts +1 -1
- package/util/types/index.js +3 -3
- package/util/types/mst.js +3 -3
- package/data_adapters/CytobandAdapter.d.ts +0 -8
- package/data_adapters/CytobandAdapter.js +0 -49
package/ui/ViewPanel.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_error_boundary_1 = require("react-error-boundary");
|
|
31
|
+
const mobx_react_1 = require("mobx-react");
|
|
32
|
+
// locals
|
|
33
|
+
const util_1 = require("../util");
|
|
34
|
+
// ui elements
|
|
35
|
+
const ErrorMessage_1 = __importDefault(require("./ErrorMessage"));
|
|
36
|
+
const LoadingEllipses_1 = __importDefault(require("./LoadingEllipses"));
|
|
37
|
+
const ViewContainer_1 = __importDefault(require("./ViewContainer"));
|
|
38
|
+
const ViewPanel = (0, mobx_react_1.observer)(function ({ view, session, }) {
|
|
39
|
+
const { pluginManager } = (0, util_1.getEnv)(session);
|
|
40
|
+
const viewType = pluginManager.getViewType(view.type);
|
|
41
|
+
if (!viewType) {
|
|
42
|
+
throw new Error(`unknown view type ${view.type}`);
|
|
43
|
+
}
|
|
44
|
+
const { ReactComponent } = viewType;
|
|
45
|
+
return (react_1.default.createElement(ViewContainer_1.default, { view: view, onClose: () => session.removeView(view), onMinimize: () => view.setMinimized(!view.minimized) }, !view.minimized ? (react_1.default.createElement(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ({ error }) => react_1.default.createElement(ErrorMessage_1.default, { error: error }) },
|
|
46
|
+
react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement(LoadingEllipses_1.default, { variant: "h6" }) },
|
|
47
|
+
react_1.default.createElement(ReactComponent, { model: view, session: session })))) : (false)));
|
|
48
|
+
});
|
|
49
|
+
exports.default = ViewPanel;
|
package/ui/theme.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ThemeOptions } from '@mui/material/styles';
|
|
2
|
-
import type { PaletteOptions } from '@mui/material/styles/createPalette';
|
|
3
2
|
declare module '@mui/material/styles/createPalette' {
|
|
4
3
|
interface Palette {
|
|
5
4
|
tertiary: Palette['primary'];
|
|
6
5
|
quaternary: Palette['primary'];
|
|
6
|
+
stopCodon?: string;
|
|
7
|
+
startCodon?: string;
|
|
7
8
|
bases: {
|
|
8
9
|
A: Palette['primary'];
|
|
9
10
|
C: Palette['primary'];
|
|
@@ -14,6 +15,8 @@ declare module '@mui/material/styles/createPalette' {
|
|
|
14
15
|
interface PaletteOptions {
|
|
15
16
|
tertiary?: PaletteOptions['primary'];
|
|
16
17
|
quaternary?: PaletteOptions['primary'];
|
|
18
|
+
stopCodon?: string;
|
|
19
|
+
startCodon?: string;
|
|
17
20
|
bases?: {
|
|
18
21
|
A?: PaletteOptions['primary'];
|
|
19
22
|
C?: PaletteOptions['primary'];
|
|
@@ -22,169 +25,10 @@ declare module '@mui/material/styles/createPalette' {
|
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
|
-
export declare const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
secondary: {
|
|
30
|
-
main: string;
|
|
31
|
-
};
|
|
32
|
-
tertiary: import("@mui/material/styles").PaletteColor;
|
|
33
|
-
quaternary: import("@mui/material/styles").PaletteColor;
|
|
34
|
-
stopCodon: string;
|
|
35
|
-
startCodon: string;
|
|
36
|
-
bases: {
|
|
37
|
-
A: import("@mui/material/styles").PaletteColor;
|
|
38
|
-
C: import("@mui/material/styles").PaletteColor;
|
|
39
|
-
G: import("@mui/material/styles").PaletteColor;
|
|
40
|
-
T: import("@mui/material/styles").PaletteColor;
|
|
41
|
-
};
|
|
28
|
+
export declare const defaultThemes: ThemeMap;
|
|
29
|
+
export declare function createJBrowseBaseTheme(theme?: ThemeOptions): ThemeOptions;
|
|
30
|
+
type ThemeMap = {
|
|
31
|
+
[key: string]: ThemeOptions;
|
|
42
32
|
};
|
|
43
|
-
export declare function
|
|
44
|
-
|
|
45
|
-
MuiButton: {
|
|
46
|
-
defaultProps: {
|
|
47
|
-
size: "small";
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
MuiAccordion: {
|
|
51
|
-
defaultProps: {
|
|
52
|
-
disableGutters: boolean;
|
|
53
|
-
TransitionProps: {
|
|
54
|
-
timeout: number;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
MuiFilledInput: {
|
|
59
|
-
defaultProps: {
|
|
60
|
-
margin: "dense";
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
MuiFormControl: {
|
|
64
|
-
defaultProps: {
|
|
65
|
-
margin: "dense";
|
|
66
|
-
size: "small";
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
MuiFormHelperText: {
|
|
70
|
-
defaultProps: {
|
|
71
|
-
margin: "dense";
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
MuiIconButton: {
|
|
75
|
-
defaultProps: {
|
|
76
|
-
size: "small";
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
MuiInputBase: {
|
|
80
|
-
defaultProps: {
|
|
81
|
-
margin: "dense";
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
MuiAutocomplete: {
|
|
85
|
-
defaultProps: {
|
|
86
|
-
size: "small";
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
MuiInputLabel: {
|
|
90
|
-
defaultProps: {
|
|
91
|
-
margin: "dense";
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
MuiToolbar: {
|
|
95
|
-
defaultProps: {
|
|
96
|
-
variant: "dense";
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
MuiListItem: {
|
|
100
|
-
defaultProps: {
|
|
101
|
-
dense: boolean;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
MuiOutlinedInput: {
|
|
105
|
-
defaultProps: {
|
|
106
|
-
margin: "dense";
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
MuiFab: {
|
|
110
|
-
defaultProps: {
|
|
111
|
-
size: "small";
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
MuiTable: {
|
|
115
|
-
defaultProps: {
|
|
116
|
-
size: "small";
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
MuiPopover: {
|
|
120
|
-
defaultProps: {
|
|
121
|
-
transitionDuration: number;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
MuiMenu: {
|
|
125
|
-
defaultProps: {
|
|
126
|
-
transitionDuration: number;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
MuiMenuList: {
|
|
130
|
-
defaultProps: {
|
|
131
|
-
dense: boolean;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
MuiMenuItem: {
|
|
135
|
-
defaultProps: {
|
|
136
|
-
dense: boolean;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
MuiTextField: {
|
|
140
|
-
defaultProps: {
|
|
141
|
-
margin: "dense";
|
|
142
|
-
variant: "standard";
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
export declare function createJBrowseDefaultOverrides(palette?: PaletteOptions): {
|
|
148
|
-
components: {
|
|
149
|
-
MuiIconButton: {
|
|
150
|
-
styleOverrides: {
|
|
151
|
-
colorSecondary: {
|
|
152
|
-
color: string;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
MuiButton: {
|
|
157
|
-
styleOverrides: {
|
|
158
|
-
textSecondary: {
|
|
159
|
-
color: string;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
MuiFab: {
|
|
164
|
-
styleOverrides: {
|
|
165
|
-
secondary: {
|
|
166
|
-
backgroundColor: string;
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
MuiLink: {
|
|
171
|
-
styleOverrides: {
|
|
172
|
-
root: {
|
|
173
|
-
color: string;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
MuiAccordionSummary: {
|
|
178
|
-
styleOverrides: {
|
|
179
|
-
root: {
|
|
180
|
-
backgroundColor: string;
|
|
181
|
-
};
|
|
182
|
-
content: {
|
|
183
|
-
color: string;
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
export declare function createJBrowseBaseTheme(palette?: PaletteOptions): ThemeOptions;
|
|
190
|
-
export declare function createJBrowseTheme(theme?: ThemeOptions): import("@mui/material/styles").Theme;
|
|
33
|
+
export declare function createJBrowseTheme(configTheme?: ThemeOptions, themes?: ThemeMap, themeName?: string): import("@mui/material/styles").Theme;
|
|
34
|
+
export {};
|
package/ui/theme.js
CHANGED
|
@@ -3,7 +3,7 @@ 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
|
-
exports.createJBrowseTheme = exports.createJBrowseBaseTheme = exports.
|
|
6
|
+
exports.createJBrowseTheme = exports.createJBrowseBaseTheme = exports.defaultThemes = void 0;
|
|
7
7
|
const colors_1 = require("@mui/material/colors");
|
|
8
8
|
const styles_1 = require("@mui/material/styles");
|
|
9
9
|
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
@@ -12,28 +12,156 @@ const grape = '#721E63';
|
|
|
12
12
|
const forest = '#135560';
|
|
13
13
|
const mandarin = '#FFB11D';
|
|
14
14
|
const refTheme = (0, styles_1.createTheme)();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
function stockTheme() {
|
|
16
|
+
return {
|
|
17
|
+
palette: {
|
|
18
|
+
mode: undefined,
|
|
19
|
+
primary: { main: midnight },
|
|
20
|
+
secondary: { main: grape },
|
|
21
|
+
tertiary: refTheme.palette.augmentColor({ color: { main: forest } }),
|
|
22
|
+
quaternary: refTheme.palette.augmentColor({ color: { main: mandarin } }),
|
|
23
|
+
stopCodon: '#e22',
|
|
24
|
+
startCodon: '#3e3',
|
|
25
|
+
bases: {
|
|
26
|
+
A: refTheme.palette.augmentColor({ color: colors_1.green }),
|
|
27
|
+
C: refTheme.palette.augmentColor({ color: colors_1.blue }),
|
|
28
|
+
G: refTheme.palette.augmentColor({ color: colors_1.orange }),
|
|
29
|
+
T: refTheme.palette.augmentColor({ color: colors_1.red }),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
components: {
|
|
33
|
+
MuiLink: {
|
|
34
|
+
styleOverrides: {
|
|
35
|
+
// the default link color uses theme.palette.primary.main which is
|
|
36
|
+
// very bad with dark mode+midnight primary
|
|
37
|
+
//
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
root: ({ theme }) => ({
|
|
40
|
+
color: theme.palette.tertiary.main,
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getDefaultTheme() {
|
|
48
|
+
return {
|
|
49
|
+
name: 'Default (from config)',
|
|
50
|
+
...stockTheme(),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function getLightStockTheme() {
|
|
54
|
+
return {
|
|
55
|
+
name: 'Light (stock)',
|
|
56
|
+
...stockTheme(),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function getDarkStockTheme() {
|
|
60
|
+
return {
|
|
61
|
+
name: 'Dark (stock)',
|
|
62
|
+
palette: {
|
|
63
|
+
mode: 'dark',
|
|
64
|
+
primary: { main: midnight },
|
|
65
|
+
secondary: { main: grape },
|
|
66
|
+
tertiary: refTheme.palette.augmentColor({ color: { main: forest } }),
|
|
67
|
+
quaternary: refTheme.palette.augmentColor({ color: { main: mandarin } }),
|
|
68
|
+
stopCodon: '#e22',
|
|
69
|
+
startCodon: '#3e3',
|
|
70
|
+
bases: {
|
|
71
|
+
A: refTheme.palette.augmentColor({ color: colors_1.green }),
|
|
72
|
+
C: refTheme.palette.augmentColor({ color: colors_1.blue }),
|
|
73
|
+
G: refTheme.palette.augmentColor({ color: colors_1.orange }),
|
|
74
|
+
T: refTheme.palette.augmentColor({ color: colors_1.red }),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
components: {
|
|
78
|
+
MuiAppBar: {
|
|
79
|
+
defaultProps: {
|
|
80
|
+
enableColorOnDark: true,
|
|
81
|
+
},
|
|
82
|
+
styleOverrides: {
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
primary: (props) => {
|
|
85
|
+
return props.theme.palette.primary.main;
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function getDarkMinimalTheme() {
|
|
93
|
+
return {
|
|
94
|
+
name: 'Dark (minimal)',
|
|
95
|
+
palette: {
|
|
96
|
+
mode: 'dark',
|
|
97
|
+
primary: { main: colors_1.grey[700] },
|
|
98
|
+
secondary: { main: colors_1.grey[800] },
|
|
99
|
+
tertiary: refTheme.palette.augmentColor({ color: { main: colors_1.grey[900] } }),
|
|
100
|
+
quaternary: refTheme.palette.augmentColor({ color: { main: mandarin } }),
|
|
101
|
+
stopCodon: '#e22',
|
|
102
|
+
startCodon: '#3e3',
|
|
103
|
+
bases: {
|
|
104
|
+
A: refTheme.palette.augmentColor({ color: colors_1.green }),
|
|
105
|
+
C: refTheme.palette.augmentColor({ color: colors_1.blue }),
|
|
106
|
+
G: refTheme.palette.augmentColor({ color: colors_1.orange }),
|
|
107
|
+
T: refTheme.palette.augmentColor({ color: colors_1.red }),
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function getMinimalTheme() {
|
|
113
|
+
return {
|
|
114
|
+
name: 'Light (minimal)',
|
|
115
|
+
palette: {
|
|
116
|
+
primary: { main: colors_1.grey[900] },
|
|
117
|
+
secondary: { main: colors_1.grey[800] },
|
|
118
|
+
tertiary: refTheme.palette.augmentColor({ color: { main: colors_1.grey[900] } }),
|
|
119
|
+
quaternary: refTheme.palette.augmentColor({ color: { main: mandarin } }),
|
|
120
|
+
stopCodon: '#e22',
|
|
121
|
+
startCodon: '#3e3',
|
|
122
|
+
bases: {
|
|
123
|
+
A: refTheme.palette.augmentColor({ color: colors_1.green }),
|
|
124
|
+
C: refTheme.palette.augmentColor({ color: colors_1.blue }),
|
|
125
|
+
G: refTheme.palette.augmentColor({ color: colors_1.orange }),
|
|
126
|
+
T: refTheme.palette.augmentColor({ color: colors_1.red }),
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
exports.defaultThemes = {
|
|
132
|
+
default: getDefaultTheme(),
|
|
133
|
+
lightStock: getLightStockTheme(),
|
|
134
|
+
lightMinimal: getMinimalTheme(),
|
|
135
|
+
darkMinimal: getDarkMinimalTheme(),
|
|
136
|
+
darkStock: getDarkStockTheme(),
|
|
29
137
|
};
|
|
30
|
-
function
|
|
138
|
+
function createDefaultProps(theme) {
|
|
139
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31
140
|
return {
|
|
32
141
|
components: {
|
|
33
142
|
MuiButton: {
|
|
34
143
|
defaultProps: {
|
|
35
144
|
size: 'small',
|
|
36
145
|
},
|
|
146
|
+
styleOverrides: {
|
|
147
|
+
// the default button, especially when not using variant=contained, uses
|
|
148
|
+
// theme.palette.primary.main for text which is very bad with dark
|
|
149
|
+
// mode+midnight primary
|
|
150
|
+
//
|
|
151
|
+
// keeps text secondary for darkmode, uses
|
|
152
|
+
// a text-like coloring to ensure contrast
|
|
153
|
+
// xref https://stackoverflow.com/a/72546130/2129219
|
|
154
|
+
//
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
root: (props) => {
|
|
157
|
+
const { theme } = props;
|
|
158
|
+
return theme.palette.mode === 'dark'
|
|
159
|
+
? {
|
|
160
|
+
color: theme.palette.text.primary,
|
|
161
|
+
}
|
|
162
|
+
: undefined;
|
|
163
|
+
},
|
|
164
|
+
},
|
|
37
165
|
},
|
|
38
166
|
MuiAccordion: {
|
|
39
167
|
defaultProps: {
|
|
@@ -96,6 +224,12 @@ function createJBrowseDefaultProps( /* palette: PaletteOptions = {} */) {
|
|
|
96
224
|
defaultProps: {
|
|
97
225
|
size: 'small',
|
|
98
226
|
},
|
|
227
|
+
styleOverrides: {
|
|
228
|
+
secondary: {
|
|
229
|
+
// @ts-expect-error
|
|
230
|
+
backgroundColor: (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.quaternary) === null || _b === void 0 ? void 0 : _b.main,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
99
233
|
},
|
|
100
234
|
MuiTable: {
|
|
101
235
|
defaultProps: {
|
|
@@ -128,66 +262,125 @@ function createJBrowseDefaultProps( /* palette: PaletteOptions = {} */) {
|
|
|
128
262
|
variant: 'standard',
|
|
129
263
|
},
|
|
130
264
|
},
|
|
131
|
-
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
exports.createJBrowseDefaultProps = createJBrowseDefaultProps;
|
|
135
|
-
function createJBrowseDefaultOverrides(palette = {}) {
|
|
136
|
-
const generatedPalette = (0, deepmerge_1.default)(exports.jbrowseDefaultPalette, palette);
|
|
137
|
-
return {
|
|
138
|
-
components: {
|
|
139
|
-
MuiIconButton: {
|
|
265
|
+
MuiLink: {
|
|
140
266
|
styleOverrides: {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
267
|
+
// the default link color uses theme.palette.primary.main which is
|
|
268
|
+
// very bad with dark mode+midnight primary
|
|
269
|
+
//
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
271
|
+
root: ({ theme }) => ({
|
|
272
|
+
color: theme.palette.text.secondary,
|
|
273
|
+
}),
|
|
144
274
|
},
|
|
145
275
|
},
|
|
146
|
-
|
|
276
|
+
MuiCheckbox: {
|
|
147
277
|
styleOverrides: {
|
|
148
|
-
|
|
149
|
-
|
|
278
|
+
// the default checkbox-when-checked color uses
|
|
279
|
+
// theme.palette.primary.main which is very bad with dark
|
|
280
|
+
// mode+midnight primary
|
|
281
|
+
//
|
|
282
|
+
// keeps the forest-green checkbox by default but for darkmode, uses
|
|
283
|
+
// a text-like coloring to ensure contrast
|
|
284
|
+
// xref https://stackoverflow.com/a/72546130/2129219
|
|
285
|
+
//
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
287
|
+
root: (props) => {
|
|
288
|
+
const { theme } = props;
|
|
289
|
+
return theme.palette.mode === 'dark'
|
|
290
|
+
? {
|
|
291
|
+
color: theme.palette.text.secondary,
|
|
292
|
+
'&.Mui-checked': {
|
|
293
|
+
color: theme.palette.text.secondary,
|
|
294
|
+
},
|
|
295
|
+
}
|
|
296
|
+
: undefined;
|
|
150
297
|
},
|
|
151
298
|
},
|
|
152
299
|
},
|
|
153
|
-
|
|
300
|
+
MuiRadio: {
|
|
154
301
|
styleOverrides: {
|
|
155
|
-
|
|
156
|
-
|
|
302
|
+
// the default checkbox-when-checked color uses
|
|
303
|
+
// theme.palette.primary.main which is very bad with dark
|
|
304
|
+
// mode+midnight primary
|
|
305
|
+
//
|
|
306
|
+
// keeps the forest-green checkbox by default but for darkmode, uses
|
|
307
|
+
// a text-like coloring to ensure contrast
|
|
308
|
+
// xref https://stackoverflow.com/a/72546130/2129219
|
|
309
|
+
//
|
|
310
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
311
|
+
root: (props) => {
|
|
312
|
+
const { theme } = props;
|
|
313
|
+
return theme.palette.mode === 'dark'
|
|
314
|
+
? {
|
|
315
|
+
color: theme.palette.text.secondary,
|
|
316
|
+
'&.Mui-checked': {
|
|
317
|
+
color: theme.palette.text.secondary,
|
|
318
|
+
},
|
|
319
|
+
}
|
|
320
|
+
: undefined;
|
|
157
321
|
},
|
|
158
322
|
},
|
|
159
323
|
},
|
|
160
|
-
|
|
324
|
+
MuiFormLabel: {
|
|
161
325
|
styleOverrides: {
|
|
162
|
-
|
|
163
|
-
|
|
326
|
+
// the default checkbox-when-checked color uses
|
|
327
|
+
// theme.palette.primary.main which is very bad with dark
|
|
328
|
+
// mode+midnight primary
|
|
329
|
+
//
|
|
330
|
+
// keeps the forest-green checkbox by default but for darkmode, uses
|
|
331
|
+
// a text-like coloring to ensure contrast
|
|
332
|
+
// xref https://stackoverflow.com/a/72546130/2129219
|
|
333
|
+
//
|
|
334
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
335
|
+
root: (props) => {
|
|
336
|
+
const { theme } = props;
|
|
337
|
+
return theme.palette.mode === 'dark'
|
|
338
|
+
? {
|
|
339
|
+
color: theme.palette.text.secondary,
|
|
340
|
+
'&.Mui-focused': {
|
|
341
|
+
color: theme.palette.text.secondary,
|
|
342
|
+
},
|
|
343
|
+
}
|
|
344
|
+
: undefined;
|
|
164
345
|
},
|
|
165
346
|
},
|
|
166
347
|
},
|
|
167
348
|
MuiAccordionSummary: {
|
|
168
349
|
styleOverrides: {
|
|
169
350
|
root: {
|
|
170
|
-
|
|
351
|
+
// @ts-expect-error
|
|
352
|
+
backgroundColor: (_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.tertiary) === null || _d === void 0 ? void 0 : _d.main,
|
|
171
353
|
},
|
|
172
354
|
content: {
|
|
173
|
-
|
|
355
|
+
// @ts-expect-error
|
|
356
|
+
color: (_f = (_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e.tertiary) === null || _f === void 0 ? void 0 : _f.contrastText,
|
|
174
357
|
},
|
|
175
358
|
},
|
|
176
359
|
},
|
|
360
|
+
MuiToggleButtonGroup: {
|
|
361
|
+
defaultProps: {
|
|
362
|
+
size: 'small',
|
|
363
|
+
},
|
|
364
|
+
},
|
|
177
365
|
},
|
|
178
366
|
};
|
|
179
367
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
palette: exports.jbrowseDefaultPalette,
|
|
368
|
+
function createJBrowseBaseTheme(theme) {
|
|
369
|
+
return (0, deepmerge_1.default)({
|
|
370
|
+
palette: theme === null || theme === void 0 ? void 0 : theme.palette,
|
|
184
371
|
typography: { fontSize: 12 },
|
|
185
372
|
spacing: 4,
|
|
186
|
-
...(
|
|
187
|
-
};
|
|
373
|
+
...createDefaultProps(theme),
|
|
374
|
+
}, theme || {});
|
|
188
375
|
}
|
|
189
376
|
exports.createJBrowseBaseTheme = createJBrowseBaseTheme;
|
|
190
|
-
function createJBrowseTheme(
|
|
377
|
+
function createJBrowseTheme(configTheme = {}, themes = exports.defaultThemes, themeName = 'default') {
|
|
378
|
+
return (0, styles_1.createTheme)(createJBrowseBaseTheme(themeName === 'default'
|
|
379
|
+
? (0, deepmerge_1.default)(themes['default'], augmentTheme(configTheme))
|
|
380
|
+
: augmentThemePlus(themes[themeName]) || themes['default']));
|
|
381
|
+
}
|
|
382
|
+
exports.createJBrowseTheme = createJBrowseTheme;
|
|
383
|
+
function augmentTheme(theme = {}) {
|
|
191
384
|
var _a, _b;
|
|
192
385
|
if ((_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.tertiary) {
|
|
193
386
|
theme = (0, deepmerge_1.default)(theme, {
|
|
@@ -207,6 +400,25 @@ function createJBrowseTheme(theme) {
|
|
|
207
400
|
},
|
|
208
401
|
});
|
|
209
402
|
}
|
|
210
|
-
return
|
|
403
|
+
return theme;
|
|
404
|
+
}
|
|
405
|
+
// creates some blank quaternary/tertiary colors if unsupplied by a user theme
|
|
406
|
+
function augmentThemePlus(theme = {}) {
|
|
407
|
+
var _a, _b;
|
|
408
|
+
theme = augmentTheme(theme);
|
|
409
|
+
if (!((_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.quaternary)) {
|
|
410
|
+
theme = (0, deepmerge_1.default)(theme, {
|
|
411
|
+
palette: {
|
|
412
|
+
quaternary: refTheme.palette.augmentColor({ color: { main: '#aaa' } }),
|
|
413
|
+
},
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
if (!((_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.tertiary)) {
|
|
417
|
+
theme = (0, deepmerge_1.default)(theme, {
|
|
418
|
+
palette: {
|
|
419
|
+
tertiary: refTheme.palette.augmentColor({ color: { main: '#aaa' } }),
|
|
420
|
+
},
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
return theme;
|
|
211
424
|
}
|
|
212
|
-
exports.createJBrowseTheme = createJBrowseTheme;
|