@jbrowse/web-core 3.7.0 → 4.0.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/esm/BaseWebSession/index.d.ts +1375 -1595
- package/esm/BaseWebSession/index.js +81 -41
- package/esm/SessionConnections.d.ts +9 -144
- package/esm/SessionConnections.js +11 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/package.json +26 -33
- package/dist/BaseWebSession/AboutDialog.d.ts +0 -1
- package/dist/BaseWebSession/AboutDialog.js +0 -5
- package/dist/BaseWebSession/index.d.ts +0 -10033
- package/dist/BaseWebSession/index.js +0 -257
- package/dist/SessionConnections.d.ts +0 -159
- package/dist/SessionConnections.js +0 -49
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -18
|
@@ -1,257 +0,0 @@
|
|
|
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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BaseWebSession = BaseWebSession;
|
|
40
|
-
const react_1 = require("react");
|
|
41
|
-
const app_core_1 = require("@jbrowse/app-core");
|
|
42
|
-
const configuration_1 = require("@jbrowse/core/configuration");
|
|
43
|
-
const SnackbarModel_1 = __importDefault(require("@jbrowse/core/ui/SnackbarModel"));
|
|
44
|
-
const util_1 = require("@jbrowse/core/util");
|
|
45
|
-
const product_core_1 = require("@jbrowse/product-core");
|
|
46
|
-
const Delete_1 = __importDefault(require("@mui/icons-material/Delete"));
|
|
47
|
-
const FileCopy_1 = __importDefault(require("@mui/icons-material/FileCopy"));
|
|
48
|
-
const Info_1 = __importDefault(require("@mui/icons-material/Info"));
|
|
49
|
-
const Settings_1 = __importDefault(require("@mui/icons-material/Settings"));
|
|
50
|
-
const mobx_1 = require("mobx");
|
|
51
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
52
|
-
const SessionConnections_1 = require("../SessionConnections");
|
|
53
|
-
const AboutDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./AboutDialog'))));
|
|
54
|
-
function BaseWebSession({ pluginManager, assemblyConfigSchema, }) {
|
|
55
|
-
const sessionModel = mobx_state_tree_1.types
|
|
56
|
-
.compose('WebCoreSessionModel', mobx_state_tree_1.types.compose('WebCoreSessionModelGroupA', (0, product_core_1.ReferenceManagementSessionMixin)(pluginManager), (0, product_core_1.DrawerWidgetSessionMixin)(pluginManager), (0, product_core_1.DialogQueueSessionMixin)(pluginManager), (0, product_core_1.ThemeManagerSessionMixin)(pluginManager), (0, product_core_1.MultipleViewsSessionMixin)(pluginManager)), mobx_state_tree_1.types.compose('WebCoreSessionModelGroupB', (0, product_core_1.SessionTracksManagerSessionMixin)(pluginManager), (0, app_core_1.SessionAssembliesMixin)(pluginManager, assemblyConfigSchema), (0, app_core_1.TemporaryAssembliesMixin)(pluginManager, assemblyConfigSchema), (0, SessionConnections_1.WebSessionConnectionsMixin)(pluginManager), (0, app_core_1.AppFocusMixin)(), (0, SnackbarModel_1.default)()))
|
|
57
|
-
.props({
|
|
58
|
-
margin: 0,
|
|
59
|
-
sessionPlugins: mobx_state_tree_1.types.array(mobx_state_tree_1.types.frozen()),
|
|
60
|
-
})
|
|
61
|
-
.volatile(() => ({
|
|
62
|
-
sessionThemeName: (0, util_1.localStorageGetItem)('themeName') || 'default',
|
|
63
|
-
task: undefined,
|
|
64
|
-
}))
|
|
65
|
-
.views(self => ({
|
|
66
|
-
get tracks() {
|
|
67
|
-
return [...self.sessionTracks, ...self.jbrowse.tracks];
|
|
68
|
-
},
|
|
69
|
-
get root() {
|
|
70
|
-
return (0, mobx_state_tree_1.getParent)(self);
|
|
71
|
-
},
|
|
72
|
-
get assemblies() {
|
|
73
|
-
return [...self.jbrowse.assemblies, ...self.sessionAssemblies];
|
|
74
|
-
},
|
|
75
|
-
get connections() {
|
|
76
|
-
return [...self.jbrowse.connections, ...self.sessionConnections];
|
|
77
|
-
},
|
|
78
|
-
}))
|
|
79
|
-
.actions(self => ({
|
|
80
|
-
setName(str) {
|
|
81
|
-
self.name = str;
|
|
82
|
-
},
|
|
83
|
-
}))
|
|
84
|
-
.views(self => ({
|
|
85
|
-
get assemblyNames() {
|
|
86
|
-
return self.assemblies.map(f => (0, configuration_1.readConfObject)(f, 'name'));
|
|
87
|
-
},
|
|
88
|
-
get version() {
|
|
89
|
-
return self.root.version;
|
|
90
|
-
},
|
|
91
|
-
get shareURL() {
|
|
92
|
-
return (0, configuration_1.getConf)(self.jbrowse, 'shareURL');
|
|
93
|
-
},
|
|
94
|
-
get textSearchManager() {
|
|
95
|
-
return self.root.textSearchManager;
|
|
96
|
-
},
|
|
97
|
-
get assemblyManager() {
|
|
98
|
-
return self.root.assemblyManager;
|
|
99
|
-
},
|
|
100
|
-
get savedSessionMetadata() {
|
|
101
|
-
return self.root.savedSessionMetadata;
|
|
102
|
-
},
|
|
103
|
-
get previousAutosaveId() {
|
|
104
|
-
return self.root.previousAutosaveId;
|
|
105
|
-
},
|
|
106
|
-
get history() {
|
|
107
|
-
return self.root.history;
|
|
108
|
-
},
|
|
109
|
-
renderProps() {
|
|
110
|
-
return {
|
|
111
|
-
theme: self.theme,
|
|
112
|
-
highResolutionScaling: (0, configuration_1.getConf)(self, 'highResolutionScaling'),
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
}))
|
|
116
|
-
.actions(self => ({
|
|
117
|
-
addAssemblyConf(conf) {
|
|
118
|
-
self.jbrowse.addAssemblyConf(conf);
|
|
119
|
-
},
|
|
120
|
-
addSessionPlugin(plugin) {
|
|
121
|
-
if (self.sessionPlugins.some(p => p.name === plugin.name)) {
|
|
122
|
-
throw new Error('session plugin cannot be installed twice');
|
|
123
|
-
}
|
|
124
|
-
self.sessionPlugins.push(plugin);
|
|
125
|
-
self.root.setPluginsUpdated(true);
|
|
126
|
-
},
|
|
127
|
-
removeSessionPlugin(pluginDefinition) {
|
|
128
|
-
self.sessionPlugins = (0, mobx_state_tree_1.cast)(self.sessionPlugins.filter(plugin => plugin.url !== pluginDefinition.url ||
|
|
129
|
-
plugin.umdUrl !== pluginDefinition.umdUrl ||
|
|
130
|
-
plugin.cjsUrl !== pluginDefinition.cjsUrl ||
|
|
131
|
-
plugin.esmUrl !== pluginDefinition.esmUrl));
|
|
132
|
-
(0, mobx_state_tree_1.getParent)(self).setPluginsUpdated(true);
|
|
133
|
-
},
|
|
134
|
-
addSavedSession(sessionSnapshot) {
|
|
135
|
-
return self.root.addSavedSession(sessionSnapshot);
|
|
136
|
-
},
|
|
137
|
-
deleteSavedSession(id) {
|
|
138
|
-
return self.root.deleteSavedSession(id);
|
|
139
|
-
},
|
|
140
|
-
favoriteSavedSession(id) {
|
|
141
|
-
return self.root.favoriteSavedSession(id);
|
|
142
|
-
},
|
|
143
|
-
unfavoriteSavedSession(id) {
|
|
144
|
-
return self.root.unfavoriteSavedSession(id);
|
|
145
|
-
},
|
|
146
|
-
renameCurrentSession(sessionName) {
|
|
147
|
-
return self.root.renameCurrentSession(sessionName);
|
|
148
|
-
},
|
|
149
|
-
duplicateCurrentSession() {
|
|
150
|
-
return self.root.duplicateCurrentSession();
|
|
151
|
-
},
|
|
152
|
-
activateSession(sessionName) {
|
|
153
|
-
return self.root.activateSession(sessionName);
|
|
154
|
-
},
|
|
155
|
-
setDefaultSession() {
|
|
156
|
-
return self.root.setDefaultSession();
|
|
157
|
-
},
|
|
158
|
-
saveSessionToLocalStorage() {
|
|
159
|
-
return self.root.saveSessionToLocalStorage();
|
|
160
|
-
},
|
|
161
|
-
loadAutosaveSession() {
|
|
162
|
-
return self.root.loadAutosaveSession();
|
|
163
|
-
},
|
|
164
|
-
setSession(sessionSnapshot) {
|
|
165
|
-
return self.root.setSession(sessionSnapshot);
|
|
166
|
-
},
|
|
167
|
-
}))
|
|
168
|
-
.actions(self => ({
|
|
169
|
-
editTrackConfiguration(configuration) {
|
|
170
|
-
const { adminMode, sessionTracks } = self;
|
|
171
|
-
if (!adminMode && !sessionTracks.includes(configuration)) {
|
|
172
|
-
throw new Error("Can't edit the configuration of a non-session track");
|
|
173
|
-
}
|
|
174
|
-
self.editConfiguration(configuration);
|
|
175
|
-
},
|
|
176
|
-
}))
|
|
177
|
-
.views(self => ({
|
|
178
|
-
getTrackActionMenuItems(config) {
|
|
179
|
-
const { adminMode, sessionTracks } = self;
|
|
180
|
-
const canEdit = adminMode || sessionTracks.find(t => t.trackId === config.trackId);
|
|
181
|
-
const isRefSeq = config.type === 'ReferenceSequenceTrack';
|
|
182
|
-
return [
|
|
183
|
-
{
|
|
184
|
-
label: 'About track',
|
|
185
|
-
priority: 1002,
|
|
186
|
-
onClick: () => {
|
|
187
|
-
self.queueDialog(handleClose => [
|
|
188
|
-
AboutDialog,
|
|
189
|
-
{
|
|
190
|
-
config,
|
|
191
|
-
handleClose,
|
|
192
|
-
},
|
|
193
|
-
]);
|
|
194
|
-
},
|
|
195
|
-
icon: Info_1.default,
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
label: 'Settings',
|
|
199
|
-
priority: 1001,
|
|
200
|
-
disabled: !canEdit,
|
|
201
|
-
icon: Settings_1.default,
|
|
202
|
-
onClick: () => {
|
|
203
|
-
self.editTrackConfiguration(config);
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
label: 'Delete track',
|
|
208
|
-
priority: 1000,
|
|
209
|
-
disabled: !canEdit || isRefSeq,
|
|
210
|
-
icon: Delete_1.default,
|
|
211
|
-
onClick: () => {
|
|
212
|
-
self.deleteTrackConf(config);
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
label: 'Copy track',
|
|
217
|
-
priority: 999,
|
|
218
|
-
disabled: isRefSeq,
|
|
219
|
-
onClick: () => {
|
|
220
|
-
const snap = structuredClone((0, mobx_state_tree_1.getSnapshot)(config));
|
|
221
|
-
const now = Date.now();
|
|
222
|
-
snap.trackId += `-${now}`;
|
|
223
|
-
for (const display of snap.displays) {
|
|
224
|
-
display.displayId += `-${now}`;
|
|
225
|
-
}
|
|
226
|
-
if (!self.adminMode) {
|
|
227
|
-
snap.trackId += '-sessionTrack';
|
|
228
|
-
snap.category = undefined;
|
|
229
|
-
}
|
|
230
|
-
snap.name += ' (copy)';
|
|
231
|
-
self.addTrackConf(snap);
|
|
232
|
-
},
|
|
233
|
-
icon: FileCopy_1.default,
|
|
234
|
-
},
|
|
235
|
-
{ type: 'divider' },
|
|
236
|
-
];
|
|
237
|
-
},
|
|
238
|
-
menus() {
|
|
239
|
-
return self.root.menus();
|
|
240
|
-
},
|
|
241
|
-
}))
|
|
242
|
-
.actions(self => ({
|
|
243
|
-
afterAttach() {
|
|
244
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
245
|
-
(0, util_1.localStorageSetItem)('drawerPosition', self.drawerPosition);
|
|
246
|
-
(0, util_1.localStorageSetItem)('themeName', self.themeName);
|
|
247
|
-
}));
|
|
248
|
-
},
|
|
249
|
-
}));
|
|
250
|
-
const extendedSessionModel = pluginManager.evaluateExtensionPoint('Core-extendSession', sessionModel);
|
|
251
|
-
return mobx_state_tree_1.types.snapshotProcessor(extendedSessionModel, {
|
|
252
|
-
preProcessor(snapshot) {
|
|
253
|
-
const { connectionInstances, ...rest } = snapshot || {};
|
|
254
|
-
return !Array.isArray(connectionInstances) ? rest : snapshot;
|
|
255
|
-
},
|
|
256
|
-
});
|
|
257
|
-
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
-
import type { BaseConnectionConfigModel } from '@jbrowse/core/pluggableElementTypes/models/baseConnectionConfig';
|
|
4
|
-
export declare function WebSessionConnectionsMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
5
|
-
connectionInstances: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
6
|
-
name: import("mobx-state-tree").ISimpleType<string>;
|
|
7
|
-
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
8
|
-
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
9
|
-
name: {
|
|
10
|
-
type: string;
|
|
11
|
-
defaultValue: string;
|
|
12
|
-
description: string;
|
|
13
|
-
};
|
|
14
|
-
assemblyNames: {
|
|
15
|
-
type: string;
|
|
16
|
-
defaultValue: never[];
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
19
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
20
|
-
}, {
|
|
21
|
-
connect(_arg: AnyConfigurationModel): void;
|
|
22
|
-
} & {
|
|
23
|
-
afterAttach(): void;
|
|
24
|
-
addTrackConf(trackConf: ({
|
|
25
|
-
[x: string]: any;
|
|
26
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
27
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
28
|
-
[x: string]: any;
|
|
29
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
30
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
33
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
34
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | Record<string, unknown>): any;
|
|
35
|
-
addTrackConfs(trackConfs: (({
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
38
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
39
|
-
[x: string]: any;
|
|
40
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
41
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
42
|
-
[x: string]: any;
|
|
43
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
44
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
45
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | Record<string, unknown>)[]): void;
|
|
46
|
-
setTrackConfs(trackConfs: AnyConfigurationModel[]): void;
|
|
47
|
-
clear(): void;
|
|
48
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
49
|
-
} & {
|
|
50
|
-
sessionConnections: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
51
|
-
}, {
|
|
52
|
-
readonly connections: BaseConnectionConfigModel[];
|
|
53
|
-
} & {
|
|
54
|
-
makeConnection(configuration: AnyConfigurationModel, initialSnapshot?: {}): ({
|
|
55
|
-
name: string;
|
|
56
|
-
tracks: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
57
|
-
configuration: {
|
|
58
|
-
[x: string]: any;
|
|
59
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
60
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
61
|
-
[x: string]: any;
|
|
62
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
63
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
64
|
-
[x: string]: any;
|
|
65
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
66
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
67
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
68
|
-
name: {
|
|
69
|
-
type: string;
|
|
70
|
-
defaultValue: string;
|
|
71
|
-
description: string;
|
|
72
|
-
};
|
|
73
|
-
assemblyNames: {
|
|
74
|
-
type: string;
|
|
75
|
-
defaultValue: never[];
|
|
76
|
-
description: string;
|
|
77
|
-
};
|
|
78
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>>;
|
|
79
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
80
|
-
connect(_arg: AnyConfigurationModel): void;
|
|
81
|
-
} & {
|
|
82
|
-
afterAttach(): void;
|
|
83
|
-
addTrackConf(trackConf: ({
|
|
84
|
-
[x: string]: any;
|
|
85
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
86
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
87
|
-
[x: string]: any;
|
|
88
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
89
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
90
|
-
[x: string]: any;
|
|
91
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
92
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
93
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | Record<string, unknown>): any;
|
|
94
|
-
addTrackConfs(trackConfs: (({
|
|
95
|
-
[x: string]: any;
|
|
96
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
97
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
98
|
-
[x: string]: any;
|
|
99
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
100
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
101
|
-
[x: string]: any;
|
|
102
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
103
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
104
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | Record<string, unknown>)[]): void;
|
|
105
|
-
setTrackConfs(trackConfs: AnyConfigurationModel[]): void;
|
|
106
|
-
clear(): void;
|
|
107
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
108
|
-
name: import("mobx-state-tree").ISimpleType<string>;
|
|
109
|
-
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
110
|
-
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
111
|
-
name: {
|
|
112
|
-
type: string;
|
|
113
|
-
defaultValue: string;
|
|
114
|
-
description: string;
|
|
115
|
-
};
|
|
116
|
-
assemblyNames: {
|
|
117
|
-
type: string;
|
|
118
|
-
defaultValue: never[];
|
|
119
|
-
description: string;
|
|
120
|
-
};
|
|
121
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
122
|
-
}, {
|
|
123
|
-
connect(_arg: AnyConfigurationModel): void;
|
|
124
|
-
} & {
|
|
125
|
-
afterAttach(): void;
|
|
126
|
-
addTrackConf(trackConf: ({
|
|
127
|
-
[x: string]: any;
|
|
128
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
129
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
130
|
-
[x: string]: any;
|
|
131
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
132
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
133
|
-
[x: string]: any;
|
|
134
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
135
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
136
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | Record<string, unknown>): any;
|
|
137
|
-
addTrackConfs(trackConfs: (({
|
|
138
|
-
[x: string]: any;
|
|
139
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
140
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
141
|
-
[x: string]: any;
|
|
142
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
143
|
-
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
144
|
-
[x: string]: any;
|
|
145
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
146
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>);
|
|
147
|
-
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>) | Record<string, unknown>)[]): void;
|
|
148
|
-
setTrackConfs(trackConfs: AnyConfigurationModel[]): void;
|
|
149
|
-
clear(): void;
|
|
150
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
151
|
-
prepareToBreakConnection(configuration: AnyConfigurationModel): (Record<string, number> | (() => void))[] | undefined;
|
|
152
|
-
breakConnection(configuration: AnyConfigurationModel): void;
|
|
153
|
-
deleteConnection(configuration: AnyConfigurationModel): any;
|
|
154
|
-
addConnectionConf(connectionConf: AnyConfigurationModel): any;
|
|
155
|
-
clearConnections(): void;
|
|
156
|
-
} & {
|
|
157
|
-
addConnectionConf(connectionConf: BaseConnectionConfigModel): any;
|
|
158
|
-
deleteConnection(configuration: AnyConfigurationModel): any;
|
|
159
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebSessionConnectionsMixin = WebSessionConnectionsMixin;
|
|
4
|
-
const product_core_1 = require("@jbrowse/product-core");
|
|
5
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
|
-
function WebSessionConnectionsMixin(pluginManager) {
|
|
7
|
-
return mobx_state_tree_1.types
|
|
8
|
-
.compose('SessionConnectionsManagement', (0, product_core_1.ConnectionManagementSessionMixin)(pluginManager), mobx_state_tree_1.types.model({
|
|
9
|
-
sessionConnections: mobx_state_tree_1.types.array(pluginManager.pluggableConfigSchemaType('connection')),
|
|
10
|
-
}))
|
|
11
|
-
.actions(s => {
|
|
12
|
-
const self = s;
|
|
13
|
-
const superDeleteConnection = self.deleteConnection;
|
|
14
|
-
const superAddConnectionConf = self.addConnectionConf;
|
|
15
|
-
return {
|
|
16
|
-
addConnectionConf(connectionConf) {
|
|
17
|
-
if (self.adminMode) {
|
|
18
|
-
return superAddConnectionConf(connectionConf);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const { connectionId, type } = connectionConf;
|
|
22
|
-
if (!type) {
|
|
23
|
-
throw new Error(`unknown connection type "${type}"`);
|
|
24
|
-
}
|
|
25
|
-
const connection = self.sessionConnections.find(c => c.connectionId === connectionId);
|
|
26
|
-
if (connection) {
|
|
27
|
-
return connection;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const length = self.sessionConnections.push(connectionConf);
|
|
31
|
-
return self.sessionConnections[length - 1];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
deleteConnection(configuration) {
|
|
36
|
-
if (self.adminMode) {
|
|
37
|
-
return superDeleteConnection(configuration);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
const { connectionId } = configuration;
|
|
41
|
-
const idx = self.sessionConnections.findIndex(c => c.connectionId === connectionId);
|
|
42
|
-
return idx === -1
|
|
43
|
-
? undefined
|
|
44
|
-
: self.sessionConnections.splice(idx, 1);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./SessionConnections"), exports);
|
|
18
|
-
__exportStar(require("./BaseWebSession"), exports);
|