@jbrowse/core 3.2.0 → 3.4.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.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +4 -4
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +10 -9
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +3 -13
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +2 -2
- package/BaseFeatureWidget/stateModelFactory.d.ts +15 -10
- package/BaseFeatureWidget/stateModelFactory.js +7 -12
- package/BaseFeatureWidget/types.d.ts +9 -1
- package/BaseFeatureWidget/util.d.ts +4 -1
- package/BaseFeatureWidget/util.js +11 -0
- package/PluginManager.d.ts +1 -143
- package/PluginManager.js +3 -2
- package/ReExports/BaseFeatureDetails.d.ts +1 -0
- package/ReExports/BaseFeatureDetails.js +45 -0
- package/ReExports/MuiDataGridReExports.d.ts +2 -0
- package/ReExports/MuiDataGridReExports.js +167 -0
- package/ReExports/MuiReExports.d.ts +133 -0
- package/ReExports/MuiReExports.js +150 -0
- package/ReExports/lazify.d.ts +2 -0
- package/ReExports/lazify.js +14 -0
- package/ReExports/list.js +1 -0
- package/ReExports/modules.d.ts +1 -173
- package/ReExports/modules.js +36 -329
- package/TextSearch/TextSearchManager.d.ts +17 -2
- package/TextSearch/TextSearchManager.js +23 -3
- package/assemblyManager/assemblyManager.js +1 -1
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -0
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -1
- package/package.json +10 -9
- package/pluggableElementTypes/models/baseTrackConfig.js +25 -8
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -9
- package/pluggableElementTypes/renderers/FeatureRendererType.js +8 -2
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -4
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +2 -30
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +2 -30
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +6 -7
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/DataGridFlexContainer.d.ts +3 -0
- package/ui/DataGridFlexContainer.js +15 -0
- package/ui/index.d.ts +1 -0
- package/ui/index.js +3 -1
- package/ui/theme.d.ts +2 -2
- package/ui/theme.js +18 -10
- package/util/cluster.d.ts +17 -0
- package/util/cluster.js +96 -0
- package/util/index.d.ts +3 -1
- package/util/index.js +13 -4
- package/util/offscreenCanvasUtils.d.ts +13 -12
- package/util/offscreenCanvasUtils.js +9 -6
|
@@ -20,7 +20,13 @@ export default class TextSearchManager {
|
|
|
20
20
|
[x: string]: any;
|
|
21
21
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>);
|
|
22
22
|
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
|
|
23
|
-
getAdaptersWithAssembly(assemblyName: string, confs: AnyConfigurationModel[]):
|
|
23
|
+
getAdaptersWithAssembly(assemblyName: string, confs: AnyConfigurationModel[]): ({
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
26
|
+
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>);
|
|
29
|
+
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
|
|
24
30
|
getTrackAdaptersWithAssembly(assemblyName: string, confs: AnyConfigurationModel[]): ({
|
|
25
31
|
[x: string]: any;
|
|
26
32
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -29,5 +35,14 @@ export default class TextSearchManager {
|
|
|
29
35
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>);
|
|
30
36
|
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
|
|
31
37
|
search(args: BaseTextSearchArgs, searchScope: SearchScope, rankFn: (results: BaseResult[]) => BaseResult[]): Promise<BaseResult[]>;
|
|
32
|
-
|
|
38
|
+
search2({ args, searchScope, rankFn, }: {
|
|
39
|
+
args: BaseTextSearchArgs;
|
|
40
|
+
searchScope: SearchScope;
|
|
41
|
+
rankFn: (results: BaseResult[]) => BaseResult[];
|
|
42
|
+
}): Promise<BaseResult[]>;
|
|
43
|
+
sortResults2({ results, rankFn, args, }: {
|
|
44
|
+
results: BaseResult[];
|
|
45
|
+
args: BaseTextSearchArgs;
|
|
46
|
+
rankFn: (results: BaseResult[]) => BaseResult[];
|
|
47
|
+
}): BaseResult[];
|
|
33
48
|
}
|
|
@@ -3,6 +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
|
+
const ufuzzy_1 = __importDefault(require("@leeoniya/ufuzzy"));
|
|
6
7
|
const configuration_1 = require("../configuration");
|
|
7
8
|
const QuickLRU_1 = __importDefault(require("../util/QuickLRU"));
|
|
8
9
|
class TextSearchManager {
|
|
@@ -54,12 +55,31 @@ class TextSearchManager {
|
|
|
54
55
|
.map(conf => conf.textSearching.textSearchAdapter);
|
|
55
56
|
}
|
|
56
57
|
async search(args, searchScope, rankFn) {
|
|
58
|
+
return this.search2({ args, searchScope, rankFn });
|
|
59
|
+
}
|
|
60
|
+
async search2({ args, searchScope, rankFn, }) {
|
|
57
61
|
const adapters = await this.loadTextSearchAdapters(searchScope);
|
|
58
62
|
const results = await Promise.all(adapters.map(a => a.searchIndex(args)));
|
|
59
|
-
return this.
|
|
63
|
+
return this.sortResults2({
|
|
64
|
+
args,
|
|
65
|
+
results: results.flat(),
|
|
66
|
+
rankFn,
|
|
67
|
+
});
|
|
60
68
|
}
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
sortResults2({ results, rankFn, args, }) {
|
|
70
|
+
const uf = new ufuzzy_1.default({});
|
|
71
|
+
const haystack = results.map(r => r.getDisplayString());
|
|
72
|
+
const needle = args.queryString;
|
|
73
|
+
const idxs = uf.filter(haystack, needle);
|
|
74
|
+
const res = [];
|
|
75
|
+
if (idxs != null && idxs.length > 0) {
|
|
76
|
+
const info = uf.info(idxs, haystack, needle);
|
|
77
|
+
const order = uf.sort(info, haystack, needle);
|
|
78
|
+
for (const element of order) {
|
|
79
|
+
res.push(results[info.idx[element]]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return rankFn(res);
|
|
63
83
|
}
|
|
64
84
|
}
|
|
65
85
|
exports.default = TextSearchManager;
|
|
@@ -86,7 +86,7 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
86
86
|
if (assembly) {
|
|
87
87
|
return assembly.isValidRefName(refName);
|
|
88
88
|
}
|
|
89
|
-
throw new Error(`Failed to look up refName
|
|
89
|
+
throw new Error(`Failed to look up refName:${refName} on assemblyName:${assemblyName} (assembly does not exist)`);
|
|
90
90
|
},
|
|
91
91
|
}))
|
|
92
92
|
.actions(self => ({
|
|
@@ -2,7 +2,7 @@ import type PluginManager from '../../PluginManager';
|
|
|
2
2
|
import type { AnyConfigurationModel } from '../../configuration';
|
|
3
3
|
import type { AugmentedRegion as Region } from '../../util/types';
|
|
4
4
|
import type { getSubAdapterType } from '../dataAdapterCache';
|
|
5
|
-
export declare
|
|
5
|
+
export declare class BaseAdapter {
|
|
6
6
|
config: AnyConfigurationModel;
|
|
7
7
|
getSubAdapter?: getSubAdapterType | undefined;
|
|
8
8
|
pluginManager?: PluginManager | undefined;
|
|
@@ -10,5 +10,5 @@ export declare abstract class BaseAdapter {
|
|
|
10
10
|
static capabilities: string[];
|
|
11
11
|
constructor(config?: AnyConfigurationModel, getSubAdapter?: getSubAdapterType | undefined, pluginManager?: PluginManager | undefined);
|
|
12
12
|
getConf(arg: string | string[]): any;
|
|
13
|
-
|
|
13
|
+
freeResources(_region: Region): void;
|
|
14
14
|
}
|
|
@@ -13,6 +13,7 @@ class CytobandAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
13
13
|
return text
|
|
14
14
|
.split(/\n|\r\n|\r/)
|
|
15
15
|
.filter(f => !!f.trim())
|
|
16
|
+
.filter(f => !f.startsWith('#'))
|
|
16
17
|
.map((line, i) => {
|
|
17
18
|
const [refName, start, end, name, type] = line.split('\t');
|
|
18
19
|
return new util_1.SimpleFeature({
|
|
@@ -26,6 +27,5 @@ class CytobandAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
26
27
|
});
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
freeResources() { }
|
|
30
30
|
}
|
|
31
31
|
exports.default = CytobandAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -31,12 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@floating-ui/react": "^0.27.0",
|
|
34
|
-
"@gmod/abortable-promise-cache": "^
|
|
35
|
-
"@gmod/bgzf-filehandle": "^
|
|
36
|
-
"@gmod/http-range-fetcher": "^
|
|
37
|
-
"@
|
|
38
|
-
"@mui/material": "^
|
|
39
|
-
"@mui/
|
|
34
|
+
"@gmod/abortable-promise-cache": "^3.0.1",
|
|
35
|
+
"@gmod/bgzf-filehandle": "^3.0.2",
|
|
36
|
+
"@gmod/http-range-fetcher": "^5.0.0",
|
|
37
|
+
"@leeoniya/ufuzzy": "^1.0.18",
|
|
38
|
+
"@mui/icons-material": "^7.0.0",
|
|
39
|
+
"@mui/material": "^7.0.0",
|
|
40
|
+
"@mui/x-data-grid": "^8.0.0",
|
|
40
41
|
"canvas-sequencer": "^3.1.0",
|
|
41
42
|
"canvas2svg": "^1.0.16",
|
|
42
43
|
"colord": "^2.9.3",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"dompurify": "^3.2.0",
|
|
47
48
|
"escape-html": "^1.0.3",
|
|
48
49
|
"fast-deep-equal": "^3.1.3",
|
|
49
|
-
"generic-filehandle2": "^
|
|
50
|
+
"generic-filehandle2": "^2.0.1",
|
|
50
51
|
"jexl": "^2.3.0",
|
|
51
52
|
"librpc-web-mod": "^1.1.5",
|
|
52
53
|
"load-script": "^2.0.0",
|
|
@@ -69,5 +70,5 @@
|
|
|
69
70
|
"access": "public",
|
|
70
71
|
"directory": "dist"
|
|
71
72
|
},
|
|
72
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "a9f1ac35fc2dd810bae92cdaf1fc19995bee4413"
|
|
73
74
|
}
|
|
@@ -86,17 +86,34 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
86
86
|
const snap = pluginManager.evaluateExtensionPoint('Core-preProcessTrackConfig', structuredClone(s2));
|
|
87
87
|
const { displays = [] } = snap;
|
|
88
88
|
if (snap.trackId !== 'placeholderId') {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
try {
|
|
90
|
+
const configDisplayTypes = new Set(displays.map(d => d.type));
|
|
91
|
+
for (const d of pluginManager.getTrackType(snap.type)
|
|
92
|
+
.displayTypes) {
|
|
93
|
+
if (!configDisplayTypes.has(d.name)) {
|
|
94
|
+
displays.push({
|
|
95
|
+
displayId: `${snap.trackId}-${d.name}`,
|
|
96
|
+
type: d.name,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
96
99
|
}
|
|
97
100
|
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
throw new Error(`Unknown track type "${snap.type}" in ${JSON.stringify(snap)}`, {
|
|
103
|
+
cause: e,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
98
106
|
}
|
|
99
|
-
return {
|
|
107
|
+
return {
|
|
108
|
+
...snap,
|
|
109
|
+
displays: displays.map(d => {
|
|
110
|
+
var _a;
|
|
111
|
+
return ({
|
|
112
|
+
...d,
|
|
113
|
+
displayId: (_a = d.displayId) !== null && _a !== void 0 ? _a : `${snap.trackId}-${d.type}`,
|
|
114
|
+
});
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
100
117
|
},
|
|
101
118
|
explicitIdentifier: 'trackId',
|
|
102
119
|
explicitlyTyped: true,
|
|
@@ -14,22 +14,21 @@ class CircularChordRendererType extends FeatureRendererType_1.default {
|
|
|
14
14
|
}
|
|
15
15
|
deserializeResultsInClient(res, args) {
|
|
16
16
|
const deserializedFeatures = new Map(res.features.map(f => util_1.SimpleFeature.fromJSON(f)).map(f => [f.id(), f]));
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
return args.exportSVG
|
|
18
|
+
? {
|
|
19
19
|
...res,
|
|
20
20
|
features: deserializedFeatures,
|
|
21
21
|
blockKey: 'circularChord',
|
|
22
22
|
html: this.supportsSVG
|
|
23
23
|
? res.html
|
|
24
24
|
: '<text y="12" fill="black">SVG export not supported for this track</text>',
|
|
25
|
+
}
|
|
26
|
+
: {
|
|
27
|
+
...res,
|
|
28
|
+
features: deserializedFeatures,
|
|
29
|
+
blockKey: 'circularChord',
|
|
30
|
+
reactElement: ((0, jsx_runtime_1.jsx)(RpcRenderedSvgGroup_1.default, { ...args, ...res, features: deserializedFeatures, RenderingComponent: this.ReactComponent })),
|
|
25
31
|
};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
...res,
|
|
29
|
-
features: deserializedFeatures,
|
|
30
|
-
blockKey: 'circularChord',
|
|
31
|
-
reactElement: ((0, jsx_runtime_1.jsx)(RpcRenderedSvgGroup_1.default, { ...args, ...res, features: deserializedFeatures, RenderingComponent: this.ReactComponent })),
|
|
32
|
-
};
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
exports.default = CircularChordRendererType;
|
|
@@ -72,8 +72,14 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
72
72
|
}
|
|
73
73
|
async render(props) {
|
|
74
74
|
const features = props.features || (await this.getFeatures(props));
|
|
75
|
-
const result = await super.render({
|
|
76
|
-
|
|
75
|
+
const result = await super.render({
|
|
76
|
+
...props,
|
|
77
|
+
features,
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
...result,
|
|
81
|
+
features,
|
|
82
|
+
};
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
exports.default = FeatureRendererType;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { AnyReactComponentType, Feature } from '../../util';
|
|
2
2
|
import type { ThemeOptions } from '@mui/material';
|
|
3
|
-
|
|
3
|
+
declare const RpcRenderedSvgGroup: (props: {
|
|
4
4
|
html: string;
|
|
5
5
|
features: Map<string, Feature>;
|
|
6
6
|
theme: ThemeOptions;
|
|
7
|
-
displayModel?: any;
|
|
8
7
|
RenderingComponent: AnyReactComponentType;
|
|
9
|
-
}
|
|
10
|
-
declare const RpcRenderedSvgGroup: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
9
|
export default RpcRenderedSvgGroup;
|
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
4
|
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const client_1 = require("react-dom/client");
|
|
8
|
-
const ui_1 = require("../../ui");
|
|
9
|
-
const util_1 = require("../../util");
|
|
10
5
|
const RpcRenderedSvgGroup = (0, mobx_react_1.observer)(function RpcRenderedSvgGroup(props) {
|
|
11
|
-
const { html,
|
|
12
|
-
|
|
13
|
-
const rootRef = (0, react_1.useRef)(null);
|
|
14
|
-
(0, react_1.useEffect)(() => {
|
|
15
|
-
const renderTimeout = (0, util_1.rIC)(() => {
|
|
16
|
-
var _a;
|
|
17
|
-
if (!ref.current) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const jbrowseTheme = (0, ui_1.createJBrowseTheme)(theme);
|
|
21
|
-
rootRef.current =
|
|
22
|
-
(_a = rootRef.current) !== null && _a !== void 0 ? _a : (0, client_1.hydrateRoot)(ref.current, (0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: jbrowseTheme, children: (0, jsx_runtime_1.jsx)(RenderingComponent, { ...rest }) }));
|
|
23
|
-
});
|
|
24
|
-
return () => {
|
|
25
|
-
if (renderTimeout !== undefined) {
|
|
26
|
-
clearTimeout(renderTimeout);
|
|
27
|
-
}
|
|
28
|
-
const root = rootRef.current;
|
|
29
|
-
rootRef.current = null;
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
root === null || root === void 0 ? void 0 : root.unmount();
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
}, [RenderingComponent, theme, rest]);
|
|
35
|
-
return (0, jsx_runtime_1.jsx)("g", { ref: ref, dangerouslySetInnerHTML: { __html: html } });
|
|
6
|
+
const { html, RenderingComponent, ...rest } = props;
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(RenderingComponent, { ...rest });
|
|
36
8
|
});
|
|
37
9
|
exports.default = RpcRenderedSvgGroup;
|
|
@@ -2,5 +2,5 @@ import type { RenderArgs, ResultsSerialized } from './ServerSideRendererType';
|
|
|
2
2
|
interface Props extends ResultsSerialized, RenderArgs {
|
|
3
3
|
RenderingComponent: React.ComponentType<any>;
|
|
4
4
|
}
|
|
5
|
-
declare const ServerSideRenderedContent: ({
|
|
5
|
+
declare const ServerSideRenderedContent: ({ html, RenderingComponent, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ServerSideRenderedContent;
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const styles_1 = require("@mui/material/styles");
|
|
6
4
|
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const util_1 = require("../../util");
|
|
10
|
-
const ServerSideRenderedContent = (0, mobx_react_1.observer)(function ServerSideRenderedContent({ theme, html, RenderingComponent, ...rest }) {
|
|
11
|
-
const ref = (0, react_1.useRef)(null);
|
|
12
|
-
const rootRef = (0, react_1.useRef)(null);
|
|
13
|
-
(0, react_1.useEffect)(() => {
|
|
14
|
-
const renderTimeout = (0, util_1.rIC)(() => {
|
|
15
|
-
var _a;
|
|
16
|
-
if (!ref.current) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const jbrowseTheme = (0, ui_1.createJBrowseTheme)(theme);
|
|
20
|
-
rootRef.current =
|
|
21
|
-
(_a = rootRef.current) !== null && _a !== void 0 ? _a : (0, client_1.hydrateRoot)(ref.current, (0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: jbrowseTheme, children: (0, jsx_runtime_1.jsx)(RenderingComponent, { ...rest }) }));
|
|
22
|
-
});
|
|
23
|
-
return () => {
|
|
24
|
-
if (renderTimeout !== undefined) {
|
|
25
|
-
clearTimeout(renderTimeout);
|
|
26
|
-
}
|
|
27
|
-
const root = rootRef.current;
|
|
28
|
-
rootRef.current = null;
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
root === null || root === void 0 ? void 0 : root.unmount();
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
}, [theme, rest, RenderingComponent]);
|
|
34
|
-
return (0, jsx_runtime_1.jsx)("div", { ref: ref, dangerouslySetInnerHTML: { __html: html } });
|
|
5
|
+
const ServerSideRenderedContent = (0, mobx_react_1.observer)(function ServerSideRenderedContent({ html, RenderingComponent, ...props }) {
|
|
6
|
+
return (0, jsx_runtime_1.jsx)(RenderingComponent, { ...props });
|
|
35
7
|
});
|
|
36
8
|
exports.default = ServerSideRenderedContent;
|
|
@@ -28,18 +28,17 @@ class ServerSideRenderer extends RendererType_1.default {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
deserializeResultsInClient(res, args) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
return args.exportSVG
|
|
32
|
+
? {
|
|
33
33
|
...res,
|
|
34
34
|
html: this.supportsSVG
|
|
35
35
|
? res.html
|
|
36
36
|
: '<text y="12" fill="black">SVG export not supported for this track</text>',
|
|
37
|
+
}
|
|
38
|
+
: {
|
|
39
|
+
...res,
|
|
40
|
+
reactElement: ((0, jsx_runtime_1.jsx)(ServerSideRenderedContent_1.default, { ...args, ...res, RenderingComponent: this.ReactComponent })),
|
|
37
41
|
};
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
...res,
|
|
41
|
-
reactElement: ((0, jsx_runtime_1.jsx)(ServerSideRenderedContent_1.default, { ...args, ...res, RenderingComponent: this.ReactComponent })),
|
|
42
|
-
};
|
|
43
42
|
}
|
|
44
43
|
deserializeArgsInWorker(args) {
|
|
45
44
|
const deserialized = { ...args };
|