@jbrowse/core 2.5.0 → 2.6.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 +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +0 -1
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +8 -25
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/{DataGrid.d.ts → DataGridDetails.d.ts} +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/{BasicField.d.ts → SimpleField.d.ts} +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/{BasicField.js → SimpleField.js} +3 -3
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +2 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +9 -38
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +14 -225
- package/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +1 -0
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +24 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +10 -13
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureSettingsDialog.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceHelpDialog.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceHelpDialog.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +2 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +17 -17
- package/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +16 -16
- package/BaseFeatureWidget/util.js +15 -5
- package/PluginManager.d.ts +3 -3
- package/README.md +0 -2
- package/ReExports/modules.d.ts +3 -3
- package/ReExports/modules.js +0 -3
- package/assemblyManager/assemblyConfigSchema.d.ts +2 -0
- package/assemblyManager/assemblyConfigSchema.js +1 -0
- package/assemblyManager/assemblyManager.d.ts +112 -0
- package/assemblyManager/assemblyManager.js +12 -1
- package/assemblyManager/index.d.ts +1 -0
- package/configuration/index.d.ts +1 -1
- package/configuration/types.d.ts +3 -1
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -1
- package/data_adapters/BaseAdapter/index.d.ts +1 -1
- package/package.json +2 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +9 -7
- package/pluggableElementTypes/RpcMethodType.js +9 -7
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +18 -0
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +9 -0
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -1
- package/pluggableElementTypes/models/BaseDisplayModel.js +9 -1
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -0
- package/pluggableElementTypes/models/BaseTrackModel.js +1 -0
- package/pluggableElementTypes/models/BaseViewModel.d.ts +46 -2
- package/pluggableElementTypes/models/BaseViewModel.js +6 -0
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +6 -2
- package/pluggableElementTypes/models/InternetAccountModel.js +27 -20
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +5 -2
- package/pluggableElementTypes/models/baseConnectionConfig.js +2 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -2
- package/pluggableElementTypes/models/baseTrackConfig.js +7 -5
- package/pluggableElementTypes/models/index.d.ts +1 -1
- package/pluggableElementTypes/renderers/BoxRendererType.js +1 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +2 -1
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +3 -1
- package/pluggableElementTypes/renderers/FeatureRendererType.js +4 -6
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/rpc/BaseRpcDriver.js +1 -7
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +2 -1
- package/ui/AssemblySelector.d.ts +2 -1
- package/ui/AssemblySelector.js +1 -1
- package/ui/CascadingMenu.d.ts +2 -1
- package/ui/CascadingMenuButton.d.ts +8 -0
- package/ui/CascadingMenuButton.js +20 -0
- package/ui/ColorPicker.d.ts +4 -3
- package/ui/Dialog.d.ts +5 -4
- package/ui/Dialog.js +5 -6
- package/ui/DropDownMenu.d.ts +2 -1
- package/ui/EditableTypography.js +1 -1
- package/ui/ErrorMessage.d.ts +2 -1
- package/ui/ErrorMessage.js +6 -2
- package/ui/FactoryResetDialog.d.ts +2 -1
- package/ui/FatalErrorDialog.d.ts +6 -6
- package/ui/FatalErrorDialog.js +7 -7
- package/ui/FileSelector/FileSelector.d.ts +2 -1
- package/ui/FileSelector/FileSelector.js +3 -2
- package/ui/FileSelector/LocalFileChooser.d.ts +2 -1
- package/ui/FileSelector/UrlChooser.d.ts +3 -3
- package/ui/FileSelector/UrlChooser.js +8 -10
- package/ui/Icons.d.ts +10 -9
- package/ui/LoadingEllipses.d.ts +2 -1
- package/ui/Logo.d.ts +3 -2
- package/ui/Menu.d.ts +2 -2
- package/ui/PrerenderedCanvas.d.ts +2 -1
- package/ui/ResizeBar.d.ts +1 -1
- package/ui/ResizeHandle.d.ts +2 -1
- package/ui/ReturnToImportFormDialog.d.ts +2 -1
- package/ui/SanitizedHTML.d.ts +2 -1
- package/ui/Snackbar.d.ts +7 -8
- package/ui/Snackbar.js +12 -17
- package/ui/SnackbarModel.d.ts +9 -3
- package/ui/SnackbarModel.js +3 -3
- package/ui/Tooltip.d.ts +2 -1
- package/ui/index.d.ts +0 -1
- package/ui/index.js +1 -3
- package/util/Base1DUtils.js +2 -1
- package/util/QuickLRU.d.ts +1 -1
- package/util/blockTypes.js +1 -1
- package/util/formatFastaStrings.js +1 -1
- package/util/index.d.ts +14 -0
- package/util/index.js +65 -8
- package/util/io/index.js +1 -1
- package/util/mst-reflection.js +1 -2
- package/util/offscreenCanvasUtils.d.ts +2 -2
- package/util/types/index.d.ts +6 -2
- package/util/types/index.js +6 -2
- package/util/types/util.d.ts +0 -3
- package/ui/AboutDialog.d.ts +0 -11
- package/ui/AboutDialog.js +0 -125
- package/ui/App.d.ts +0 -18
- package/ui/App.js +0 -114
- package/ui/AppToolbar.d.ts +0 -19
- package/ui/AppToolbar.js +0 -56
- package/ui/Drawer.d.ts +0 -8
- package/ui/Drawer.js +0 -34
- package/ui/DrawerWidget.d.ts +0 -5
- package/ui/DrawerWidget.js +0 -132
- package/ui/ViewContainer.d.ts +0 -9
- package/ui/ViewContainer.js +0 -76
- package/ui/ViewContainerTitle.d.ts +0 -5
- package/ui/ViewContainerTitle.js +0 -42
- package/ui/ViewLauncher.d.ts +0 -17
- package/ui/ViewLauncher.js +0 -50
- package/ui/ViewMenu.d.ts +0 -8
- package/ui/ViewMenu.js +0 -69
- package/ui/ViewPanel.d.ts +0 -18
- package/ui/ViewPanel.js +0 -49
- /package/BaseFeatureWidget/BaseFeatureDetail/{DataGrid.js → DataGridDetails.js} +0 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
|
+
const configuration_1 = require("../../configuration");
|
|
8
|
+
const baseConnectionConfig_1 = __importDefault(require("./baseConnectionConfig"));
|
|
4
9
|
/**
|
|
5
10
|
* #stateModel BaseConnectionModel
|
|
6
11
|
*/
|
|
@@ -15,6 +20,10 @@ function stateModelFactory(pluginManager) {
|
|
|
15
20
|
* #property
|
|
16
21
|
*/
|
|
17
22
|
tracks: mobx_state_tree_1.types.array(pluginManager.pluggableConfigSchemaType('track')),
|
|
23
|
+
/**
|
|
24
|
+
* #property
|
|
25
|
+
*/
|
|
26
|
+
configuration: (0, configuration_1.ConfigurationReference)(baseConnectionConfig_1.default),
|
|
18
27
|
})
|
|
19
28
|
.actions(self => ({
|
|
20
29
|
afterAttach() {
|
|
@@ -17,6 +17,7 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
17
17
|
}, {
|
|
18
18
|
rendererTypeName: string;
|
|
19
19
|
error: unknown;
|
|
20
|
+
message: string | undefined;
|
|
20
21
|
} & {
|
|
21
22
|
/**
|
|
22
23
|
* #getter
|
|
@@ -29,6 +30,7 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
29
30
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
30
31
|
rendererTypeName: string;
|
|
31
32
|
error: unknown;
|
|
33
|
+
message: string | undefined;
|
|
32
34
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
33
35
|
/**
|
|
34
36
|
* #property
|
|
@@ -45,6 +47,7 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
45
47
|
}, {
|
|
46
48
|
rendererTypeName: string;
|
|
47
49
|
error: unknown;
|
|
50
|
+
message: string | undefined;
|
|
48
51
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
49
52
|
onHorizontalScroll?: Function | undefined;
|
|
50
53
|
blockState?: Record<string, any> | undefined;
|
|
@@ -60,6 +63,7 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
60
63
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
61
64
|
rendererTypeName: string;
|
|
62
65
|
error: unknown;
|
|
66
|
+
message: string | undefined;
|
|
63
67
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
64
68
|
/**
|
|
65
69
|
* #property
|
|
@@ -76,6 +80,7 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
76
80
|
}, {
|
|
77
81
|
rendererTypeName: string;
|
|
78
82
|
error: unknown;
|
|
83
|
+
message: string | undefined;
|
|
79
84
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
80
85
|
}> | null;
|
|
81
86
|
/**
|
|
@@ -120,8 +125,12 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
120
125
|
* string of text describes why it cannot be rendered
|
|
121
126
|
* react node allows user to force load at current setting
|
|
122
127
|
*/
|
|
123
|
-
regionCannotBeRendered():
|
|
128
|
+
regionCannotBeRendered(): null;
|
|
124
129
|
} & {
|
|
130
|
+
/**
|
|
131
|
+
* #action
|
|
132
|
+
*/
|
|
133
|
+
setMessage(arg?: string): void;
|
|
125
134
|
/**
|
|
126
135
|
* #action
|
|
127
136
|
*/
|
|
@@ -9,6 +9,7 @@ const util_1 = require("../../util");
|
|
|
9
9
|
const mst_1 = require("../../util/types/mst");
|
|
10
10
|
/**
|
|
11
11
|
* #stateModel BaseDisplay
|
|
12
|
+
* #category display
|
|
12
13
|
*/
|
|
13
14
|
function stateModelFactory() {
|
|
14
15
|
return mobx_state_tree_1.types
|
|
@@ -29,6 +30,7 @@ function stateModelFactory() {
|
|
|
29
30
|
.volatile(() => ({
|
|
30
31
|
rendererTypeName: '',
|
|
31
32
|
error: undefined,
|
|
33
|
+
message: undefined,
|
|
32
34
|
}))
|
|
33
35
|
.views(self => ({
|
|
34
36
|
/**
|
|
@@ -122,10 +124,16 @@ function stateModelFactory() {
|
|
|
122
124
|
* react node allows user to force load at current setting
|
|
123
125
|
*/
|
|
124
126
|
regionCannotBeRendered( /* region */) {
|
|
125
|
-
return
|
|
127
|
+
return null;
|
|
126
128
|
},
|
|
127
129
|
}))
|
|
128
130
|
.actions(self => ({
|
|
131
|
+
/**
|
|
132
|
+
* #action
|
|
133
|
+
*/
|
|
134
|
+
setMessage(arg) {
|
|
135
|
+
self.message = arg;
|
|
136
|
+
},
|
|
129
137
|
/**
|
|
130
138
|
* #action
|
|
131
139
|
*/
|
|
@@ -9,6 +9,7 @@ export declare function getCompatibleDisplays(self: IAnyStateTreeNode): ({
|
|
|
9
9
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>)[];
|
|
10
10
|
/**
|
|
11
11
|
* #stateModel BaseTrackModel
|
|
12
|
+
* #category track
|
|
12
13
|
* these MST models only exist for tracks that are *shown*. they should contain
|
|
13
14
|
* only UI state for the track, and have a reference to a track configuration.
|
|
14
15
|
* note that multiple displayed tracks could use the same configuration.
|
|
@@ -19,6 +19,7 @@ function getCompatibleDisplays(self) {
|
|
|
19
19
|
exports.getCompatibleDisplays = getCompatibleDisplays;
|
|
20
20
|
/**
|
|
21
21
|
* #stateModel BaseTrackModel
|
|
22
|
+
* #category track
|
|
22
23
|
* these MST models only exist for tracks that are *shown*. they should contain
|
|
23
24
|
* only UI state for the track, and have a reference to a track configuration.
|
|
24
25
|
* note that multiple displayed tracks could use the same configuration.
|
|
@@ -34,5 +34,49 @@ declare const BaseViewModel: import("mobx-state-tree").IModelType<{
|
|
|
34
34
|
setMinimized(flag: boolean): void;
|
|
35
35
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
36
36
|
export default BaseViewModel;
|
|
37
|
-
export
|
|
38
|
-
|
|
37
|
+
export type IBaseViewModel = Instance<typeof BaseViewModel>;
|
|
38
|
+
export declare const BaseViewModelWithDisplayedRegions: import("mobx-state-tree").IModelType<{
|
|
39
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
40
|
+
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
41
|
+
minimized: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
42
|
+
} & {
|
|
43
|
+
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
44
|
+
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
45
|
+
start: import("mobx-state-tree").ISimpleType<number>;
|
|
46
|
+
end: import("mobx-state-tree").ISimpleType<number>;
|
|
47
|
+
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
48
|
+
} & {
|
|
49
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
50
|
+
}, {
|
|
51
|
+
setRefName(newRefName: string): void;
|
|
52
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
53
|
+
}, {
|
|
54
|
+
width: number;
|
|
55
|
+
} & {
|
|
56
|
+
/**
|
|
57
|
+
* #getter
|
|
58
|
+
*/
|
|
59
|
+
menuItems(): MenuItem[];
|
|
60
|
+
} & {
|
|
61
|
+
/**
|
|
62
|
+
* #action
|
|
63
|
+
*/
|
|
64
|
+
setDisplayName(name: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* #action
|
|
67
|
+
* width is an important attribute of the view model, when it becomes set, it
|
|
68
|
+
* often indicates when the app can start drawing to it. certain views like
|
|
69
|
+
* lgv are strict about this because if it tries to draw before it knows the
|
|
70
|
+
* width it should draw to, it may start fetching data for regions it doesn't
|
|
71
|
+
* need to
|
|
72
|
+
*
|
|
73
|
+
* setWidth is updated by a ResizeObserver generally, the views often need
|
|
74
|
+
* to know how wide they are to properly draw genomic regions
|
|
75
|
+
*/
|
|
76
|
+
setWidth(newWidth: number): void;
|
|
77
|
+
/**
|
|
78
|
+
* #action
|
|
79
|
+
*/
|
|
80
|
+
setMinimized(flag: boolean): void;
|
|
81
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
82
|
+
export type IBaseViewModelWithDisplayedRegions = Instance<typeof BaseViewModelWithDisplayedRegions>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseViewModelWithDisplayedRegions = void 0;
|
|
3
4
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
4
5
|
const mst_1 = require("../../util/types/mst");
|
|
6
|
+
const mst_2 = require("../../util/types/mst");
|
|
5
7
|
/**
|
|
6
8
|
* #stateModel BaseViewModel
|
|
9
|
+
* #category view
|
|
7
10
|
*/
|
|
8
11
|
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
12
|
const BaseViewModel = mobx_state_tree_1.types
|
|
@@ -63,3 +66,6 @@ const BaseViewModel = mobx_state_tree_1.types
|
|
|
63
66
|
},
|
|
64
67
|
}));
|
|
65
68
|
exports.default = BaseViewModel;
|
|
69
|
+
exports.BaseViewModelWithDisplayedRegions = BaseViewModel.props({
|
|
70
|
+
displayedRegions: mobx_state_tree_1.types.array(mst_2.Region),
|
|
71
|
+
});
|
|
@@ -120,12 +120,13 @@ export declare const InternetAccount: import("mobx-state-tree").IModelType<{
|
|
|
120
120
|
/**
|
|
121
121
|
* #action
|
|
122
122
|
* This can be used by an internetAccount to validate a token works before
|
|
123
|
-
* it is used. This is run when preAuthorizationInformation is requested,
|
|
124
|
-
* it can be used to check that a token is valid before sending it to a
|
|
123
|
+
* it is used. This is run when preAuthorizationInformation is requested,
|
|
124
|
+
* so it can be used to check that a token is valid before sending it to a
|
|
125
125
|
* worker thread. It expects the token to be returned so that this action
|
|
126
126
|
* can also be used to generate a new token (e.g. by using a refresh token)
|
|
127
127
|
* if the original one was invalid. Should throw an error if a token is
|
|
128
128
|
* invalid.
|
|
129
|
+
*
|
|
129
130
|
* @param token - Auth token
|
|
130
131
|
* @param loc - UriLocation of the resource
|
|
131
132
|
* @returns - Valid auth token
|
|
@@ -137,6 +138,7 @@ export declare const InternetAccount: import("mobx-state-tree").IModelType<{
|
|
|
137
138
|
* Try to get the token from the location pre-auth, from local storage,
|
|
138
139
|
* or from a previously cached promise. If token is not available, uses
|
|
139
140
|
* `getTokenFromUser`.
|
|
141
|
+
*
|
|
140
142
|
* @param location - UriLocation of the resource
|
|
141
143
|
* @returns A promise for the token
|
|
142
144
|
*/
|
|
@@ -164,6 +166,7 @@ export declare const InternetAccount: import("mobx-state-tree").IModelType<{
|
|
|
164
166
|
* #action
|
|
165
167
|
* Gets the token and returns it along with the information needed to
|
|
166
168
|
* create a new internetAccount.
|
|
169
|
+
*
|
|
167
170
|
* @param location - UriLocation of the resource
|
|
168
171
|
* @returns
|
|
169
172
|
*/
|
|
@@ -180,6 +183,7 @@ export declare const InternetAccount: import("mobx-state-tree").IModelType<{
|
|
|
180
183
|
* Get a fetch method that will add any needed authentication headers to
|
|
181
184
|
* the request before sending it. If location is provided, it will be
|
|
182
185
|
* checked to see if it includes a token in it pre-auth information.
|
|
186
|
+
*
|
|
183
187
|
* @param loc - UriLocation of the resource
|
|
184
188
|
* @returns A function that can be used to fetch
|
|
185
189
|
*/
|
|
@@ -9,6 +9,7 @@ const baseInternetAccountConfig_1 = require("./baseInternetAccountConfig");
|
|
|
9
9
|
const inWebWorker = typeof sessionStorage === 'undefined';
|
|
10
10
|
/**
|
|
11
11
|
* #stateModel BaseInternetAccountModel
|
|
12
|
+
* #category internetAccount
|
|
12
13
|
*/
|
|
13
14
|
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14
15
|
exports.InternetAccount = mobx_state_tree_1.types
|
|
@@ -137,12 +138,13 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
137
138
|
/**
|
|
138
139
|
* #action
|
|
139
140
|
* This can be used by an internetAccount to validate a token works before
|
|
140
|
-
* it is used. This is run when preAuthorizationInformation is requested,
|
|
141
|
-
* it can be used to check that a token is valid before sending it to a
|
|
141
|
+
* it is used. This is run when preAuthorizationInformation is requested,
|
|
142
|
+
* so it can be used to check that a token is valid before sending it to a
|
|
142
143
|
* worker thread. It expects the token to be returned so that this action
|
|
143
144
|
* can also be used to generate a new token (e.g. by using a refresh token)
|
|
144
145
|
* if the original one was invalid. Should throw an error if a token is
|
|
145
146
|
* invalid.
|
|
147
|
+
*
|
|
146
148
|
* @param token - Auth token
|
|
147
149
|
* @param loc - UriLocation of the resource
|
|
148
150
|
* @returns - Valid auth token
|
|
@@ -159,6 +161,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
159
161
|
* Try to get the token from the location pre-auth, from local storage,
|
|
160
162
|
* or from a previously cached promise. If token is not available, uses
|
|
161
163
|
* `getTokenFromUser`.
|
|
164
|
+
*
|
|
162
165
|
* @param location - UriLocation of the resource
|
|
163
166
|
* @returns A promise for the token
|
|
164
167
|
*/
|
|
@@ -180,17 +183,13 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
180
183
|
tokenPromise = Promise.resolve(token);
|
|
181
184
|
return tokenPromise;
|
|
182
185
|
}
|
|
183
|
-
tokenPromise = new Promise((
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
x(error);
|
|
191
|
-
}
|
|
192
|
-
self.getTokenFromUser(resolve, reject);
|
|
193
|
-
});
|
|
186
|
+
tokenPromise = new Promise((resolve, reject) => self.getTokenFromUser(token => {
|
|
187
|
+
self.storeToken(token);
|
|
188
|
+
resolve(token);
|
|
189
|
+
}, error => {
|
|
190
|
+
self.removeToken();
|
|
191
|
+
reject(error);
|
|
192
|
+
}));
|
|
194
193
|
return tokenPromise;
|
|
195
194
|
},
|
|
196
195
|
};
|
|
@@ -200,17 +199,21 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
200
199
|
* #action
|
|
201
200
|
*/
|
|
202
201
|
addAuthHeaderToInit(init = {}, token) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
return {
|
|
203
|
+
...init,
|
|
204
|
+
headers: new Headers({
|
|
205
|
+
...init.headers,
|
|
206
|
+
[self.authHeader]: self.tokenType
|
|
207
|
+
? `${self.tokenType} ${token}`
|
|
208
|
+
: token,
|
|
209
|
+
}),
|
|
210
|
+
};
|
|
209
211
|
},
|
|
210
212
|
/**
|
|
211
213
|
* #action
|
|
212
214
|
* Gets the token and returns it along with the information needed to
|
|
213
215
|
* create a new internetAccount.
|
|
216
|
+
*
|
|
214
217
|
* @param location - UriLocation of the resource
|
|
215
218
|
* @returns
|
|
216
219
|
*/
|
|
@@ -226,7 +229,10 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
226
229
|
}
|
|
227
230
|
return {
|
|
228
231
|
internetAccountType: self.type,
|
|
229
|
-
authInfo: {
|
|
232
|
+
authInfo: {
|
|
233
|
+
token: validatedToken,
|
|
234
|
+
configuration: (0, configuration_1.getConf)(self),
|
|
235
|
+
},
|
|
230
236
|
};
|
|
231
237
|
},
|
|
232
238
|
}))
|
|
@@ -236,6 +242,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
236
242
|
* Get a fetch method that will add any needed authentication headers to
|
|
237
243
|
* the request before sending it. If location is provided, it will be
|
|
238
244
|
* checked to see if it includes a token in it pre-auth information.
|
|
245
|
+
*
|
|
239
246
|
* @param loc - UriLocation of the resource
|
|
240
247
|
* @returns A function that can be used to fetch
|
|
241
248
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Instance } from 'mobx-state-tree';
|
|
2
|
+
declare const BaseConnectionConfig: import("../../configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
3
|
/**
|
|
3
4
|
* #slot
|
|
4
5
|
*/
|
|
@@ -16,4 +17,6 @@ declare const _default: import("../../configuration/configurationSchema").Config
|
|
|
16
17
|
description: string;
|
|
17
18
|
};
|
|
18
19
|
}, import("../../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
19
|
-
export default
|
|
20
|
+
export default BaseConnectionConfig;
|
|
21
|
+
export type BaseConnectionConfigSchema = typeof BaseConnectionConfig;
|
|
22
|
+
export type BaseConnectionConfigModel = Instance<BaseConnectionConfigSchema>;
|
|
@@ -5,7 +5,7 @@ const configuration_1 = require("../../configuration");
|
|
|
5
5
|
* #config BaseConnection
|
|
6
6
|
*/
|
|
7
7
|
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8
|
-
|
|
8
|
+
const BaseConnectionConfig = (0, configuration_1.ConfigurationSchema)('BaseConnection', {
|
|
9
9
|
/**
|
|
10
10
|
* #slot
|
|
11
11
|
*/
|
|
@@ -29,3 +29,4 @@ exports.default = (0, configuration_1.ConfigurationSchema)('BaseConnection', {
|
|
|
29
29
|
*/
|
|
30
30
|
explicitIdentifier: 'connectionId',
|
|
31
31
|
});
|
|
32
|
+
exports.default = BaseConnectionConfig;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseInternetAccountConfig = void 0;
|
|
4
4
|
const configuration_1 = require("../../configuration");
|
|
5
5
|
/**
|
|
6
|
-
* #config
|
|
6
|
+
* #config BaseInternetAccount
|
|
7
7
|
* the "base" internet account type
|
|
8
8
|
*/
|
|
9
9
|
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
@@ -121,5 +121,5 @@ export declare function createBaseTrackConfig(pluginManager: PluginManager): imp
|
|
|
121
121
|
};
|
|
122
122
|
}, import("../../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
123
123
|
}, import("../../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "trackId">>;
|
|
124
|
-
export type
|
|
125
|
-
export type BaseTrackConfig = Instance<
|
|
124
|
+
export type BaseTrackConfigSchema = ReturnType<typeof createBaseTrackConfig>;
|
|
125
|
+
export type BaseTrackConfig = Instance<BaseTrackConfigSchema>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBaseTrackConfig = void 0;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
4
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
5
|
const configuration_1 = require("../../configuration");
|
|
7
6
|
/**
|
|
@@ -126,15 +125,15 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
126
125
|
},
|
|
127
126
|
}),
|
|
128
127
|
}, {
|
|
129
|
-
preProcessSnapshot:
|
|
130
|
-
const snap = JSON.parse(JSON.stringify(
|
|
128
|
+
preProcessSnapshot: s2 => {
|
|
129
|
+
const snap = pluginManager.evaluateExtensionPoint('Core-preProcessTrackConfig', JSON.parse(JSON.stringify(s2)));
|
|
131
130
|
const displayTypes = new Set();
|
|
132
131
|
const { displays = [] } = snap;
|
|
133
132
|
if (snap.trackId !== 'placeholderId') {
|
|
134
133
|
// Gets the displays on the track snapshot and the possible displays
|
|
135
134
|
// from the track type and adds any missing possible displays to the
|
|
136
135
|
// snapshot
|
|
137
|
-
displays.forEach(
|
|
136
|
+
displays.forEach(d => d && displayTypes.add(d.type));
|
|
138
137
|
const trackType = pluginManager.getTrackType(snap.type);
|
|
139
138
|
trackType.displayTypes.forEach(displayType => {
|
|
140
139
|
if (!displayTypes.has(displayType.name)) {
|
|
@@ -152,13 +151,16 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
152
151
|
*/
|
|
153
152
|
explicitIdentifier: 'trackId',
|
|
154
153
|
explicitlyTyped: true,
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
155
|
actions: (self) => ({
|
|
156
156
|
addDisplayConf(conf) {
|
|
157
157
|
const { type } = conf;
|
|
158
158
|
if (!type) {
|
|
159
159
|
throw new Error(`unknown display type ${type}`);
|
|
160
160
|
}
|
|
161
|
-
const display = self.displays.find(
|
|
161
|
+
const display = self.displays.find(
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
163
|
+
(d) => (d === null || d === void 0 ? void 0 : d.displayId) === conf.displayId);
|
|
162
164
|
if (display) {
|
|
163
165
|
return display;
|
|
164
166
|
}
|
|
@@ -10,4 +10,4 @@ export { BaseInternetAccountConfig } from './baseInternetAccountConfig';
|
|
|
10
10
|
export { createBaseTrackModel } from './BaseTrackModel';
|
|
11
11
|
export type { BaseTrackModel, BaseTrackStateModel } from './BaseTrackModel';
|
|
12
12
|
export { createBaseTrackConfig } from './baseTrackConfig';
|
|
13
|
-
export type { BaseTrackConfig, BaseTrackConfigModel } from './baseTrackConfig';
|
|
13
|
+
export type { BaseTrackConfig, BaseTrackConfigSchema as BaseTrackConfigModel, } from './baseTrackConfig';
|
|
@@ -113,8 +113,7 @@ class BoxRendererType extends FeatureRendererType_1.default {
|
|
|
113
113
|
createLayoutInWorker(args) {
|
|
114
114
|
const { regions } = args;
|
|
115
115
|
const session = this.getWorkerSession(args);
|
|
116
|
-
|
|
117
|
-
return subLayout;
|
|
116
|
+
return session.layout.getSublayout(regions[0].refName);
|
|
118
117
|
}
|
|
119
118
|
serializeResultsInWorker(results, args) {
|
|
120
119
|
const serialized = super.serializeResultsInWorker(results, args);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SimpleFeature, SimpleFeatureSerialized } from '../../util';
|
|
2
3
|
import FeatureRenderer from './FeatureRendererType';
|
|
3
4
|
export default class CircularChordRendererType extends FeatureRenderer {
|
|
@@ -16,7 +17,7 @@ export default class CircularChordRendererType extends FeatureRenderer {
|
|
|
16
17
|
} | {
|
|
17
18
|
features: Map<string, SimpleFeature>;
|
|
18
19
|
blockKey: string;
|
|
19
|
-
reactElement: JSX.Element;
|
|
20
|
+
reactElement: React.JSX.Element;
|
|
20
21
|
html: string;
|
|
21
22
|
};
|
|
22
23
|
}
|
|
@@ -87,5 +87,7 @@ export default class FeatureRendererType extends ServerSideRendererType {
|
|
|
87
87
|
*
|
|
88
88
|
* @param props - render args
|
|
89
89
|
*/
|
|
90
|
-
render(props: RenderArgsDeserialized
|
|
90
|
+
render(props: RenderArgsDeserialized & {
|
|
91
|
+
features?: Map<string, Feature>;
|
|
92
|
+
}): Promise<RenderResults>;
|
|
91
93
|
}
|
|
@@ -120,10 +120,9 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
120
120
|
* @returns true if this feature passes all configured filters
|
|
121
121
|
*/
|
|
122
122
|
featurePassesFilters(renderArgs, feature) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return renderArgs.filters.passes(feature, renderArgs);
|
|
123
|
+
return renderArgs.filters
|
|
124
|
+
? renderArgs.filters.passes(feature, renderArgs)
|
|
125
|
+
: true;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* gets features and renders
|
|
@@ -131,8 +130,7 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
131
130
|
* @param props - render args
|
|
132
131
|
*/
|
|
133
132
|
async render(props) {
|
|
134
|
-
const features = props.features ||
|
|
135
|
-
(await this.getFeatures(props));
|
|
133
|
+
const features = props.features || (await this.getFeatures(props));
|
|
136
134
|
const result = await super.render({ ...props, features });
|
|
137
135
|
return { ...result, features };
|
|
138
136
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { AnyReactComponentType, Feature } from '../../util';
|
|
2
3
|
declare const _default: (props: {
|
|
3
4
|
html: string;
|
|
4
5
|
features: Map<string, Feature>;
|
|
5
6
|
RenderingComponent: AnyReactComponentType;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
7
8
|
export default _default;
|
|
@@ -3,5 +3,5 @@ import { ResultsSerialized, RenderArgs } from './ServerSideRendererType';
|
|
|
3
3
|
interface Props extends ResultsSerialized, RenderArgs {
|
|
4
4
|
RenderingComponent: React.ComponentType<any>;
|
|
5
5
|
}
|
|
6
|
-
export default function ({ theme, html, RenderingComponent, ...rest }: Props): JSX.Element;
|
|
6
|
+
export default function ({ theme, html, RenderingComponent, ...rest }: Props): React.JSX.Element;
|
|
7
7
|
export {};
|
package/rpc/BaseRpcDriver.js
CHANGED
|
@@ -6,13 +6,7 @@ const util_1 = require("../util");
|
|
|
6
6
|
const remoteAbortSignals_1 = require("./remoteAbortSignals");
|
|
7
7
|
const configuration_1 = require("../configuration");
|
|
8
8
|
function isClonable(thing) {
|
|
9
|
-
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
if (thing instanceof Error) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return true;
|
|
9
|
+
return !(typeof thing === 'function') && !(thing instanceof Error);
|
|
16
10
|
}
|
|
17
11
|
// watches the given worker object, returns a promise that will be rejected if
|
|
18
12
|
// the worker times out
|