@jbrowse/plugin-grid-bookmark 2.9.0 → 2.10.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/dist/GridBookmarkWidget/components/BookmarkGrid.js +57 -48
- package/dist/GridBookmarkWidget/components/GridBookmarkWidget.js +110 -15
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.d.ts +7 -0
- package/dist/GridBookmarkWidget/components/Highlight/Highlight.js +92 -0
- package/dist/GridBookmarkWidget/components/Highlight/index.d.ts +2 -0
- package/dist/GridBookmarkWidget/components/Highlight/index.js +19 -0
- package/dist/GridBookmarkWidget/components/{DeleteBookmarksDialog.d.ts → dialogs/DeleteBookmarksDialog.d.ts} +1 -1
- package/{esm/GridBookmarkWidget/components → dist/GridBookmarkWidget/components/dialogs}/EditBookmarkLabelDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +7 -0
- package/dist/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +48 -0
- package/dist/GridBookmarkWidget/components/{ExportBookmarksDialog.d.ts → dialogs/ExportBookmarksDialog.d.ts} +1 -1
- package/dist/GridBookmarkWidget/components/{ExportBookmarksDialog.js → dialogs/ExportBookmarksDialog.js} +12 -6
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +7 -0
- package/dist/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +27 -0
- package/{esm/GridBookmarkWidget/components → dist/GridBookmarkWidget/components/dialogs}/ImportBookmarksDialog.d.ts +1 -1
- package/dist/GridBookmarkWidget/components/{ImportBookmarksDialog.js → dialogs/ImportBookmarksDialog.js} +2 -2
- package/dist/GridBookmarkWidget/components/{ShareBookmarksDialog.d.ts → dialogs/ShareBookmarksDialog.d.ts} +1 -1
- package/dist/GridBookmarkWidget/components/{ShareBookmarksDialog.js → dialogs/ShareBookmarksDialog.js} +1 -1
- package/dist/GridBookmarkWidget/index.js +3 -0
- package/dist/GridBookmarkWidget/model.d.ts +101 -0
- package/dist/GridBookmarkWidget/model.js +109 -5
- package/dist/index.js +55 -7
- package/esm/GridBookmarkWidget/components/BookmarkGrid.js +58 -49
- package/esm/GridBookmarkWidget/components/GridBookmarkWidget.js +87 -15
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.d.ts +7 -0
- package/esm/GridBookmarkWidget/components/Highlight/Highlight.js +64 -0
- package/esm/GridBookmarkWidget/components/Highlight/index.d.ts +2 -0
- package/esm/GridBookmarkWidget/components/Highlight/index.js +13 -0
- package/esm/GridBookmarkWidget/components/{DeleteBookmarksDialog.d.ts → dialogs/DeleteBookmarksDialog.d.ts} +1 -1
- package/{dist/GridBookmarkWidget/components → esm/GridBookmarkWidget/components/dialogs}/EditBookmarkLabelDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.d.ts +7 -0
- package/esm/GridBookmarkWidget/components/dialogs/EditHighlightColorDialog.js +23 -0
- package/esm/GridBookmarkWidget/components/{ExportBookmarksDialog.d.ts → dialogs/ExportBookmarksDialog.d.ts} +1 -1
- package/esm/GridBookmarkWidget/components/{ExportBookmarksDialog.js → dialogs/ExportBookmarksDialog.js} +12 -6
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.d.ts +7 -0
- package/esm/GridBookmarkWidget/components/dialogs/HighlightSettingsDialog.js +22 -0
- package/{dist/GridBookmarkWidget/components → esm/GridBookmarkWidget/components/dialogs}/ImportBookmarksDialog.d.ts +1 -1
- package/esm/GridBookmarkWidget/components/{ImportBookmarksDialog.js → dialogs/ImportBookmarksDialog.js} +2 -2
- package/esm/GridBookmarkWidget/components/{ShareBookmarksDialog.d.ts → dialogs/ShareBookmarksDialog.d.ts} +1 -1
- package/esm/GridBookmarkWidget/components/{ShareBookmarksDialog.js → dialogs/ShareBookmarksDialog.js} +1 -1
- package/esm/GridBookmarkWidget/index.js +3 -0
- package/esm/GridBookmarkWidget/model.d.ts +101 -0
- package/esm/GridBookmarkWidget/model.js +109 -5
- package/esm/index.js +55 -7
- package/package.json +2 -2
- package/dist/GridBookmarkWidget/components/DeleteBookmarks.d.ts +0 -6
- package/dist/GridBookmarkWidget/components/DeleteBookmarks.js +0 -41
- package/dist/GridBookmarkWidget/components/ExportBookmarks.d.ts +0 -6
- package/dist/GridBookmarkWidget/components/ExportBookmarks.js +0 -41
- package/dist/GridBookmarkWidget/components/ImportBookmarks.d.ts +0 -6
- package/dist/GridBookmarkWidget/components/ImportBookmarks.js +0 -42
- package/dist/GridBookmarkWidget/components/ShareBookmarks.d.ts +0 -6
- package/dist/GridBookmarkWidget/components/ShareBookmarks.js +0 -37
- package/esm/GridBookmarkWidget/components/DeleteBookmarks.d.ts +0 -6
- package/esm/GridBookmarkWidget/components/DeleteBookmarks.js +0 -13
- package/esm/GridBookmarkWidget/components/ExportBookmarks.d.ts +0 -6
- package/esm/GridBookmarkWidget/components/ExportBookmarks.js +0 -13
- package/esm/GridBookmarkWidget/components/ImportBookmarks.d.ts +0 -6
- package/esm/GridBookmarkWidget/components/ImportBookmarks.js +0 -14
- package/esm/GridBookmarkWidget/components/ShareBookmarks.d.ts +0 -6
- package/esm/GridBookmarkWidget/components/ShareBookmarks.js +0 -12
- /package/dist/GridBookmarkWidget/components/{DeleteBookmarksDialog.js → dialogs/DeleteBookmarksDialog.js} +0 -0
- /package/dist/GridBookmarkWidget/components/{EditBookmarkLabelDialog.js → dialogs/EditBookmarkLabelDialog.js} +0 -0
- /package/esm/GridBookmarkWidget/components/{DeleteBookmarksDialog.js → dialogs/DeleteBookmarksDialog.js} +0 -0
- /package/esm/GridBookmarkWidget/components/{EditBookmarkLabelDialog.js → dialogs/EditBookmarkLabelDialog.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Instance, SnapshotIn, IMSTArray } from 'mobx-state-tree';
|
|
2
2
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
import { Region } from '@jbrowse/core/util/types';
|
|
4
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
4
5
|
declare const LabeledRegionModel: import("mobx-state-tree").IModelType<{
|
|
5
6
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
6
7
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
@@ -10,25 +11,38 @@ declare const LabeledRegionModel: import("mobx-state-tree").IModelType<{
|
|
|
10
11
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
11
12
|
} & {
|
|
12
13
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
14
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
13
15
|
}, {
|
|
14
16
|
setRefName(newRefName: string): void;
|
|
15
17
|
} & {
|
|
16
18
|
setLabel(label: string): void;
|
|
19
|
+
setHighlight(color: string): void;
|
|
17
20
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
21
|
+
export interface IExtendedLGV extends LinearGenomeViewModel {
|
|
22
|
+
showBookmarkHighlights: boolean;
|
|
23
|
+
showBookmarkLabels: boolean;
|
|
24
|
+
toggleShowBookmarkHighlights: (arg: boolean) => {};
|
|
25
|
+
toggleShowBookmarkLabels: (arg: boolean) => {};
|
|
26
|
+
}
|
|
18
27
|
export interface ILabeledRegionModel extends SnapshotIn<typeof LabeledRegionModel> {
|
|
19
28
|
refName: string;
|
|
20
29
|
start: number;
|
|
21
30
|
end: number;
|
|
22
31
|
reversed: boolean;
|
|
32
|
+
highlight: string;
|
|
23
33
|
assemblyName: string;
|
|
24
34
|
label: string;
|
|
25
35
|
setRefName: (newRefName: string) => void;
|
|
26
36
|
setLabel: (label: string) => void;
|
|
37
|
+
setHighlight: (color: string) => void;
|
|
27
38
|
}
|
|
28
39
|
export interface IExtendedLabeledRegionModel extends ILabeledRegionModel {
|
|
29
40
|
id: number;
|
|
30
41
|
correspondingObj: ILabeledRegionModel;
|
|
31
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* #stateModel GridBookmarkWidgetModel
|
|
45
|
+
*/
|
|
32
46
|
export default function f(_pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
33
47
|
/**
|
|
34
48
|
* #property
|
|
@@ -51,18 +65,37 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
51
65
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
52
66
|
} & {
|
|
53
67
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
68
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
54
69
|
}, {
|
|
55
70
|
setRefName(newRefName: string): void;
|
|
56
71
|
} & {
|
|
57
72
|
setLabel(label: string): void;
|
|
73
|
+
setHighlight(color: string): void;
|
|
58
74
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>, [undefined]>;
|
|
59
75
|
}, {
|
|
60
76
|
selectedBookmarks: IExtendedLabeledRegionModel[];
|
|
61
77
|
selectedAssembliesPre: string[] | undefined;
|
|
62
78
|
} & {
|
|
79
|
+
/**
|
|
80
|
+
* #getter
|
|
81
|
+
*/
|
|
63
82
|
readonly bookmarkAssemblies: string[];
|
|
83
|
+
/**
|
|
84
|
+
* #getter
|
|
85
|
+
*/
|
|
64
86
|
readonly validAssemblies: Set<string>;
|
|
87
|
+
/**
|
|
88
|
+
* #getter
|
|
89
|
+
*/
|
|
90
|
+
readonly areBookmarksHighlightedOnAllOpenViews: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* #getter
|
|
93
|
+
*/
|
|
94
|
+
readonly areBookmarksHighlightLabelsOnAllOpenViews: boolean;
|
|
65
95
|
} & {
|
|
96
|
+
/**
|
|
97
|
+
* #getter
|
|
98
|
+
*/
|
|
66
99
|
readonly bookmarksWithValidAssemblies: ({
|
|
67
100
|
refName: string;
|
|
68
101
|
start: number;
|
|
@@ -70,10 +103,12 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
70
103
|
reversed: boolean;
|
|
71
104
|
assemblyName: string;
|
|
72
105
|
label: string;
|
|
106
|
+
highlight: string;
|
|
73
107
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
74
108
|
setRefName(newRefName: string): void;
|
|
75
109
|
} & {
|
|
76
110
|
setLabel(label: string): void;
|
|
111
|
+
setHighlight(color: string): void;
|
|
77
112
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
78
113
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
79
114
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
@@ -83,12 +118,17 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
83
118
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
84
119
|
} & {
|
|
85
120
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
121
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
86
122
|
}, {
|
|
87
123
|
setRefName(newRefName: string): void;
|
|
88
124
|
} & {
|
|
89
125
|
setLabel(label: string): void;
|
|
126
|
+
setHighlight(color: string): void;
|
|
90
127
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
91
128
|
} & {
|
|
129
|
+
/**
|
|
130
|
+
* #getter
|
|
131
|
+
*/
|
|
92
132
|
readonly sharedBookmarksModel: {
|
|
93
133
|
sharedBookmarks: (IMSTArray<import("mobx-state-tree").IModelType<{
|
|
94
134
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -99,10 +139,12 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
99
139
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
100
140
|
} & {
|
|
101
141
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
142
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
102
143
|
}, {
|
|
103
144
|
setRefName(newRefName: string): void;
|
|
104
145
|
} & {
|
|
105
146
|
setLabel(label: string): void;
|
|
147
|
+
setHighlight(color: string): void;
|
|
106
148
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
107
149
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
108
150
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
@@ -112,10 +154,12 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
112
154
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
113
155
|
} & {
|
|
114
156
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
157
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
115
158
|
}, {
|
|
116
159
|
setRefName(newRefName: string): void;
|
|
117
160
|
} & {
|
|
118
161
|
setLabel(label: string): void;
|
|
162
|
+
setHighlight(color: string): void;
|
|
119
163
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>>) | undefined;
|
|
120
164
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
121
165
|
sharedBookmarks: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
@@ -127,12 +171,17 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
127
171
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
128
172
|
} & {
|
|
129
173
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
174
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
130
175
|
}, {
|
|
131
176
|
setRefName(newRefName: string): void;
|
|
132
177
|
} & {
|
|
133
178
|
setLabel(label: string): void;
|
|
179
|
+
setHighlight(color: string): void;
|
|
134
180
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
135
181
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
182
|
+
/**
|
|
183
|
+
* #getter
|
|
184
|
+
*/
|
|
136
185
|
readonly allBookmarksModel: {
|
|
137
186
|
sharedBookmarks: (IMSTArray<import("mobx-state-tree").IModelType<{
|
|
138
187
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -143,10 +192,12 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
143
192
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
144
193
|
} & {
|
|
145
194
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
195
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
146
196
|
}, {
|
|
147
197
|
setRefName(newRefName: string): void;
|
|
148
198
|
} & {
|
|
149
199
|
setLabel(label: string): void;
|
|
200
|
+
setHighlight(color: string): void;
|
|
150
201
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
151
202
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
152
203
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
@@ -156,10 +207,12 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
156
207
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
157
208
|
} & {
|
|
158
209
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
210
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
159
211
|
}, {
|
|
160
212
|
setRefName(newRefName: string): void;
|
|
161
213
|
} & {
|
|
162
214
|
setLabel(label: string): void;
|
|
215
|
+
setHighlight(color: string): void;
|
|
163
216
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>>) | undefined;
|
|
164
217
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
165
218
|
sharedBookmarks: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
@@ -171,25 +224,73 @@ export default function f(_pluginManager: PluginManager): import("mobx-state-tre
|
|
|
171
224
|
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
172
225
|
} & {
|
|
173
226
|
label: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
227
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
174
228
|
}, {
|
|
175
229
|
setRefName(newRefName: string): void;
|
|
176
230
|
} & {
|
|
177
231
|
setLabel(label: string): void;
|
|
232
|
+
setHighlight(color: string): void;
|
|
178
233
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
179
234
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
180
235
|
} & {
|
|
236
|
+
/**
|
|
237
|
+
* #action
|
|
238
|
+
*/
|
|
181
239
|
setSelectedAssemblies(assemblies?: string[]): void;
|
|
182
240
|
} & {
|
|
241
|
+
/**
|
|
242
|
+
* #getter
|
|
243
|
+
*/
|
|
183
244
|
readonly selectedAssemblies: string[];
|
|
184
245
|
} & {
|
|
246
|
+
/**
|
|
247
|
+
* #action
|
|
248
|
+
*/
|
|
185
249
|
importBookmarks(regions: Region[]): void;
|
|
250
|
+
/**
|
|
251
|
+
* #action
|
|
252
|
+
*/
|
|
186
253
|
addBookmark(region: Region): void;
|
|
254
|
+
/**
|
|
255
|
+
* #action
|
|
256
|
+
*/
|
|
187
257
|
removeBookmark(index: number): void;
|
|
258
|
+
/**
|
|
259
|
+
* #action
|
|
260
|
+
*/
|
|
188
261
|
updateBookmarkLabel(bookmark: IExtendedLabeledRegionModel, label: string): void;
|
|
262
|
+
/**
|
|
263
|
+
* #action
|
|
264
|
+
*/
|
|
265
|
+
updateBookmarkHighlight(bookmark: IExtendedLabeledRegionModel, color: string): void;
|
|
266
|
+
/**
|
|
267
|
+
* #action
|
|
268
|
+
*/
|
|
269
|
+
updateBulkBookmarkHighlights(color: string): void;
|
|
270
|
+
/**
|
|
271
|
+
* #action
|
|
272
|
+
*/
|
|
189
273
|
setSelectedBookmarks(bookmarks: IExtendedLabeledRegionModel[]): void;
|
|
274
|
+
/**
|
|
275
|
+
* #action
|
|
276
|
+
*/
|
|
190
277
|
setBookmarkedRegions(regions: IMSTArray<typeof LabeledRegionModel>): void;
|
|
278
|
+
/**
|
|
279
|
+
* #action
|
|
280
|
+
*/
|
|
281
|
+
setHighlightToggle(toggle: boolean): void;
|
|
282
|
+
/**
|
|
283
|
+
* #action
|
|
284
|
+
*/
|
|
285
|
+
setLabelToggle(toggle: boolean): void;
|
|
191
286
|
} & {
|
|
287
|
+
/**
|
|
288
|
+
* #action
|
|
289
|
+
*/
|
|
192
290
|
clearAllBookmarks(): void;
|
|
291
|
+
/**
|
|
292
|
+
* #action
|
|
293
|
+
*/
|
|
193
294
|
clearSelectedBookmarks(): void;
|
|
194
295
|
} & {
|
|
195
296
|
afterAttach(): void;
|
|
@@ -7,11 +7,15 @@ const mobx_1 = require("mobx");
|
|
|
7
7
|
const LabeledRegionModel = mobx_state_tree_1.types
|
|
8
8
|
.compose(mst_1.Region, mobx_state_tree_1.types.model('Label', {
|
|
9
9
|
label: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, ''),
|
|
10
|
+
highlight: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, 'rgba(247, 129, 192, 0.35)'),
|
|
10
11
|
}))
|
|
11
12
|
.actions(self => ({
|
|
12
13
|
setLabel(label) {
|
|
13
14
|
self.label = label;
|
|
14
15
|
},
|
|
16
|
+
setHighlight(color) {
|
|
17
|
+
self.highlight = color;
|
|
18
|
+
},
|
|
15
19
|
}));
|
|
16
20
|
const SharedBookmarksModel = mobx_state_tree_1.types.model('SharedBookmarksModel', {
|
|
17
21
|
sharedBookmarks: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.array(LabeledRegionModel)),
|
|
@@ -19,6 +23,9 @@ const SharedBookmarksModel = mobx_state_tree_1.types.model('SharedBookmarksModel
|
|
|
19
23
|
const localStorageKeyF = () => typeof window !== undefined
|
|
20
24
|
? `bookmarks-${[window.location.host + window.location.pathname].join('-')}`
|
|
21
25
|
: 'empty';
|
|
26
|
+
/**
|
|
27
|
+
* #stateModel GridBookmarkWidgetModel
|
|
28
|
+
*/
|
|
22
29
|
function f(_pluginManager) {
|
|
23
30
|
return mobx_state_tree_1.types
|
|
24
31
|
.model('GridBookmarkModel', {
|
|
@@ -41,20 +48,46 @@ function f(_pluginManager) {
|
|
|
41
48
|
selectedAssembliesPre: undefined,
|
|
42
49
|
}))
|
|
43
50
|
.views(self => ({
|
|
51
|
+
/**
|
|
52
|
+
* #getter
|
|
53
|
+
*/
|
|
44
54
|
get bookmarkAssemblies() {
|
|
45
55
|
return [...new Set(self.bookmarks.map(r => r.assemblyName))];
|
|
46
56
|
},
|
|
57
|
+
/**
|
|
58
|
+
* #getter
|
|
59
|
+
*/
|
|
47
60
|
get validAssemblies() {
|
|
48
61
|
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
49
62
|
return new Set(this.bookmarkAssemblies.filter(a => assemblyManager.get(a)));
|
|
50
63
|
},
|
|
64
|
+
/**
|
|
65
|
+
* #getter
|
|
66
|
+
*/
|
|
67
|
+
get areBookmarksHighlightedOnAllOpenViews() {
|
|
68
|
+
const { views } = (0, util_1.getSession)(self);
|
|
69
|
+
return views.every(v => 'showBookmarkHighlights' in v ? v.showBookmarkHighlights : true);
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* #getter
|
|
73
|
+
*/
|
|
74
|
+
get areBookmarksHighlightLabelsOnAllOpenViews() {
|
|
75
|
+
const { views } = (0, util_1.getSession)(self);
|
|
76
|
+
return views.every(v => 'showBookmarkLabels' in v ? v.showBookmarkLabels : true);
|
|
77
|
+
},
|
|
51
78
|
}))
|
|
52
79
|
.views(self => ({
|
|
80
|
+
/**
|
|
81
|
+
* #getter
|
|
82
|
+
*/
|
|
53
83
|
get bookmarksWithValidAssemblies() {
|
|
54
84
|
return self.bookmarks.filter(e => self.validAssemblies.has(e.assemblyName));
|
|
55
85
|
},
|
|
56
86
|
}))
|
|
57
87
|
.views(self => ({
|
|
88
|
+
/**
|
|
89
|
+
* #getter
|
|
90
|
+
*/
|
|
58
91
|
get sharedBookmarksModel() {
|
|
59
92
|
// requires cloning bookmarks with JSON.stringify/parse to avoid duplicate
|
|
60
93
|
// reference to same object in the same state tree, will otherwise error
|
|
@@ -63,6 +96,9 @@ function f(_pluginManager) {
|
|
|
63
96
|
sharedBookmarks: JSON.parse(JSON.stringify(self.selectedBookmarks)),
|
|
64
97
|
});
|
|
65
98
|
},
|
|
99
|
+
/**
|
|
100
|
+
* #getter
|
|
101
|
+
*/
|
|
66
102
|
get allBookmarksModel() {
|
|
67
103
|
// requires cloning bookmarks with JSON.stringify/parse to avoid duplicate
|
|
68
104
|
// reference to same object in the same state tree, will otherwise error
|
|
@@ -73,44 +109,102 @@ function f(_pluginManager) {
|
|
|
73
109
|
},
|
|
74
110
|
}))
|
|
75
111
|
.actions(self => ({
|
|
112
|
+
/**
|
|
113
|
+
* #action
|
|
114
|
+
*/
|
|
76
115
|
setSelectedAssemblies(assemblies) {
|
|
77
116
|
self.selectedAssembliesPre = assemblies;
|
|
78
117
|
},
|
|
79
118
|
}))
|
|
80
119
|
.views(self => ({
|
|
120
|
+
/**
|
|
121
|
+
* #getter
|
|
122
|
+
*/
|
|
81
123
|
get selectedAssemblies() {
|
|
82
124
|
var _a, _b;
|
|
83
125
|
return ((_b = (_a = self.selectedAssembliesPre) === null || _a === void 0 ? void 0 : _a.filter(f => self.validAssemblies.has(f))) !== null && _b !== void 0 ? _b : [...self.validAssemblies]);
|
|
84
126
|
},
|
|
85
127
|
}))
|
|
86
128
|
.actions(self => ({
|
|
129
|
+
/**
|
|
130
|
+
* #action
|
|
131
|
+
*/
|
|
87
132
|
importBookmarks(regions) {
|
|
88
133
|
self.bookmarks = (0, mobx_state_tree_1.cast)([...self.bookmarks, ...regions]);
|
|
89
134
|
},
|
|
135
|
+
/**
|
|
136
|
+
* #action
|
|
137
|
+
*/
|
|
90
138
|
addBookmark(region) {
|
|
91
139
|
self.bookmarks.push(region);
|
|
92
140
|
},
|
|
141
|
+
/**
|
|
142
|
+
* #action
|
|
143
|
+
*/
|
|
93
144
|
removeBookmark(index) {
|
|
94
145
|
self.bookmarks.splice(index, 1);
|
|
95
146
|
},
|
|
147
|
+
/**
|
|
148
|
+
* #action
|
|
149
|
+
*/
|
|
96
150
|
updateBookmarkLabel(bookmark, label) {
|
|
97
151
|
bookmark.correspondingObj.setLabel(label);
|
|
98
152
|
},
|
|
153
|
+
/**
|
|
154
|
+
* #action
|
|
155
|
+
*/
|
|
156
|
+
updateBookmarkHighlight(bookmark, color) {
|
|
157
|
+
bookmark.correspondingObj.setHighlight(color);
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* #action
|
|
161
|
+
*/
|
|
162
|
+
updateBulkBookmarkHighlights(color) {
|
|
163
|
+
self.selectedBookmarks.forEach(bookmark => this.updateBookmarkHighlight(bookmark, color));
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* #action
|
|
167
|
+
*/
|
|
99
168
|
setSelectedBookmarks(bookmarks) {
|
|
100
169
|
self.selectedBookmarks = bookmarks;
|
|
101
170
|
},
|
|
171
|
+
/**
|
|
172
|
+
* #action
|
|
173
|
+
*/
|
|
102
174
|
setBookmarkedRegions(regions) {
|
|
103
175
|
self.bookmarks = (0, mobx_state_tree_1.cast)(regions);
|
|
104
176
|
},
|
|
177
|
+
/**
|
|
178
|
+
* #action
|
|
179
|
+
*/
|
|
180
|
+
setHighlightToggle(toggle) {
|
|
181
|
+
const { views } = (0, util_1.getSession)(self);
|
|
182
|
+
views.forEach(view => {
|
|
183
|
+
var _a;
|
|
184
|
+
(_a = view.toggleShowBookmarkHighlights) === null || _a === void 0 ? void 0 : _a.call(view, toggle);
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* #action
|
|
189
|
+
*/
|
|
190
|
+
setLabelToggle(toggle) {
|
|
191
|
+
const { views } = (0, util_1.getSession)(self);
|
|
192
|
+
views.forEach(view => {
|
|
193
|
+
var _a;
|
|
194
|
+
(_a = view.toggleShowBookmarkLabels) === null || _a === void 0 ? void 0 : _a.call(view, toggle);
|
|
195
|
+
});
|
|
196
|
+
},
|
|
105
197
|
}))
|
|
106
198
|
.actions(self => ({
|
|
199
|
+
/**
|
|
200
|
+
* #action
|
|
201
|
+
*/
|
|
107
202
|
clearAllBookmarks() {
|
|
108
|
-
|
|
109
|
-
if (self.validAssemblies.has(bookmark.assemblyName)) {
|
|
110
|
-
self.bookmarks.remove(bookmark);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
203
|
+
self.setBookmarkedRegions(self.bookmarks.filter(bookmark => !self.validAssemblies.has(bookmark.assemblyName)));
|
|
113
204
|
},
|
|
205
|
+
/**
|
|
206
|
+
* #action
|
|
207
|
+
*/
|
|
114
208
|
clearSelectedBookmarks() {
|
|
115
209
|
for (const bookmark of self.selectedBookmarks) {
|
|
116
210
|
self.bookmarks.remove(bookmark.correspondingObj);
|
|
@@ -121,6 +215,16 @@ function f(_pluginManager) {
|
|
|
121
215
|
.actions(self => ({
|
|
122
216
|
afterAttach() {
|
|
123
217
|
const key = localStorageKeyF();
|
|
218
|
+
function handler(e) {
|
|
219
|
+
if (e.key === key) {
|
|
220
|
+
const localStorage = JSON.parse((0, util_1.localStorageGetItem)(key) || '[]');
|
|
221
|
+
self.setBookmarkedRegions(localStorage);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
window.addEventListener('storage', handler);
|
|
225
|
+
(0, mobx_state_tree_1.addDisposer)(self, () => {
|
|
226
|
+
window.removeEventListener('storage', handler);
|
|
227
|
+
});
|
|
124
228
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
125
229
|
(0, util_1.localStorageSetItem)(key, JSON.stringify(self.bookmarks));
|
|
126
230
|
}));
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,8 @@ const util_1 = require("@jbrowse/core/util");
|
|
|
8
8
|
// icons
|
|
9
9
|
const Bookmark_1 = __importDefault(require("@mui/icons-material/Bookmark"));
|
|
10
10
|
const Bookmarks_1 = __importDefault(require("@mui/icons-material/Bookmarks"));
|
|
11
|
+
const Highlight_1 = __importDefault(require("@mui/icons-material/Highlight"));
|
|
12
|
+
const Label_1 = __importDefault(require("@mui/icons-material/Label"));
|
|
11
13
|
const GridBookmarkWidget_1 = __importDefault(require("./GridBookmarkWidget"));
|
|
12
14
|
class default_1 extends Plugin_1.default {
|
|
13
15
|
constructor() {
|
|
@@ -21,7 +23,33 @@ class default_1 extends Plugin_1.default {
|
|
|
21
23
|
const { stateModel } = pluggableElement;
|
|
22
24
|
const lgv = stateModel;
|
|
23
25
|
const newStateModel = lgv
|
|
26
|
+
.props({
|
|
27
|
+
/**
|
|
28
|
+
* #property
|
|
29
|
+
* show the bookmark highlights on this track
|
|
30
|
+
*/
|
|
31
|
+
showBookmarkHighlights: true,
|
|
32
|
+
/**
|
|
33
|
+
* #property
|
|
34
|
+
* show the bookmark labels on this track
|
|
35
|
+
*/
|
|
36
|
+
showBookmarkLabels: true,
|
|
37
|
+
})
|
|
24
38
|
.actions(self => ({
|
|
39
|
+
/**
|
|
40
|
+
* #action
|
|
41
|
+
*/
|
|
42
|
+
toggleShowBookmarkHighlights(toggle) {
|
|
43
|
+
self.showBookmarkHighlights =
|
|
44
|
+
toggle !== undefined ? toggle : !self.showBookmarkHighlights;
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* #action
|
|
48
|
+
*/
|
|
49
|
+
toggleShowBookmarkLabels(toggle) {
|
|
50
|
+
self.showBookmarkLabels =
|
|
51
|
+
toggle !== undefined ? toggle : !self.showBookmarkLabels;
|
|
52
|
+
},
|
|
25
53
|
activateBookmarkWidget() {
|
|
26
54
|
const session = (0, util_1.getSession)(self);
|
|
27
55
|
if ((0, util_1.isSessionModelWithWidgets)(session)) {
|
|
@@ -64,14 +92,34 @@ class default_1 extends Plugin_1.default {
|
|
|
64
92
|
...superMenuItems(),
|
|
65
93
|
{ type: 'divider' },
|
|
66
94
|
{
|
|
67
|
-
label: '
|
|
95
|
+
label: 'Bookmarks',
|
|
68
96
|
icon: Bookmarks_1.default,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
97
|
+
subMenu: [
|
|
98
|
+
{
|
|
99
|
+
label: 'Open bookmark widget',
|
|
100
|
+
icon: Bookmarks_1.default,
|
|
101
|
+
onClick: () => self.activateBookmarkWidget(),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: 'Bookmark current region',
|
|
105
|
+
icon: Bookmark_1.default,
|
|
106
|
+
onClick: () => self.bookmarkCurrentRegion(),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: 'Toggle bookmark highlights',
|
|
110
|
+
icon: Highlight_1.default,
|
|
111
|
+
type: 'checkbox',
|
|
112
|
+
checked: self.showBookmarkHighlights,
|
|
113
|
+
onClick: () => self.toggleShowBookmarkHighlights(),
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'Toggle bookmark labels',
|
|
117
|
+
icon: Label_1.default,
|
|
118
|
+
type: 'checkbox',
|
|
119
|
+
checked: self.showBookmarkLabels,
|
|
120
|
+
onClick: () => self.toggleShowBookmarkLabels(),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
75
123
|
},
|
|
76
124
|
];
|
|
77
125
|
},
|