@jbrowse/product-core 3.3.0 → 3.5.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.
@@ -1,7 +1,5 @@
1
1
  import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes';
3
- import type { IBaseViewModelWithDisplayedRegions } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
4
- import type { Region } from '@jbrowse/core/util';
5
3
  import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
6
4
  export declare function MultipleViewsSessionMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
7
5
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
@@ -1735,11 +1733,6 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
1735
1733
  moveViewToBottom(id: string): void;
1736
1734
  addView(typeName: string, initialState?: {}): any;
1737
1735
  removeView(view: IBaseViewModel): void;
1738
- addLinearGenomeViewOfAssembly(assemblyName: string, initialState?: {}): any;
1739
- addViewOfAssembly(viewType: string, assemblyName: string, initialState?: Record<string, unknown>): any;
1740
- addViewFromAnotherView(viewType: string, otherView: IBaseViewModelWithDisplayedRegions, initialState?: {
1741
- displayedRegions?: Region[];
1742
- }): any;
1743
1736
  setStickyViewHeaders(sticky: boolean): void;
1744
1737
  afterAttach(): void;
1745
1738
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -2,15 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MultipleViewsSessionMixin = MultipleViewsSessionMixin;
4
4
  exports.isSessionWithMultipleViews = isSessionWithMultipleViews;
5
- const configuration_1 = require("@jbrowse/core/configuration");
6
5
  const util_1 = require("@jbrowse/core/util");
7
6
  const mobx_1 = require("mobx");
8
7
  const mobx_state_tree_1 = require("mobx-state-tree");
9
8
  const BaseSession_1 = require("./BaseSession");
10
9
  const DrawerWidgets_1 = require("./DrawerWidgets");
11
- function localStorageSetBoolean(key, value) {
12
- (0, util_1.localStorageSetItem)(key, JSON.stringify(value));
13
- }
14
10
  function MultipleViewsSessionMixin(pluginManager) {
15
11
  return mobx_state_tree_1.types
16
12
  .compose((0, BaseSession_1.BaseSessionModel)(pluginManager), (0, DrawerWidgets_1.DrawerWidgetSessionMixin)(pluginManager))
@@ -64,31 +60,12 @@ function MultipleViewsSessionMixin(pluginManager) {
64
60
  }
65
61
  self.views.remove(view);
66
62
  },
67
- addLinearGenomeViewOfAssembly(assemblyName, initialState = {}) {
68
- return this.addViewOfAssembly('LinearGenomeView', assemblyName, initialState);
69
- },
70
- addViewOfAssembly(viewType, assemblyName, initialState = {}) {
71
- const asm = self.assemblies.find(s => (0, configuration_1.readConfObject)(s, 'name') === assemblyName);
72
- if (!asm) {
73
- throw new Error(`Could not add view of assembly "${assemblyName}", assembly name not found`);
74
- }
75
- return this.addView(viewType, {
76
- ...initialState,
77
- displayRegionsFromAssemblyName: (0, configuration_1.readConfObject)(asm, 'name'),
78
- });
79
- },
80
- addViewFromAnotherView(viewType, otherView, initialState = {}) {
81
- const state = { ...initialState };
82
- state.displayedRegions = (0, mobx_state_tree_1.getSnapshot)(otherView.displayedRegions);
83
- return this.addView(viewType, state);
84
- },
85
63
  setStickyViewHeaders(sticky) {
86
64
  self.stickyViewHeaders = sticky;
87
- localStorageSetBoolean('stickyViewHeaders', sticky);
88
65
  },
89
66
  afterAttach() {
90
67
  (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
91
- localStorageSetBoolean('stickyViewHeaders', self.stickyViewHeaders);
68
+ (0, util_1.localStorageSetBoolean)('stickyViewHeaders', self.stickyViewHeaders);
92
69
  }));
93
70
  },
94
71
  }));
@@ -1,7 +1,5 @@
1
1
  import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  import type { IBaseViewModel } from '@jbrowse/core/pluggableElementTypes';
3
- import type { IBaseViewModelWithDisplayedRegions } from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
4
- import type { Region } from '@jbrowse/core/util';
5
3
  import type { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
6
4
  export declare function MultipleViewsSessionMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
7
5
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
@@ -1735,11 +1733,6 @@ export declare function MultipleViewsSessionMixin(pluginManager: PluginManager):
1735
1733
  moveViewToBottom(id: string): void;
1736
1734
  addView(typeName: string, initialState?: {}): any;
1737
1735
  removeView(view: IBaseViewModel): void;
1738
- addLinearGenomeViewOfAssembly(assemblyName: string, initialState?: {}): any;
1739
- addViewOfAssembly(viewType: string, assemblyName: string, initialState?: Record<string, unknown>): any;
1740
- addViewFromAnotherView(viewType: string, otherView: IBaseViewModelWithDisplayedRegions, initialState?: {
1741
- displayedRegions?: Region[];
1742
- }): any;
1743
1736
  setStickyViewHeaders(sticky: boolean): void;
1744
1737
  afterAttach(): void;
1745
1738
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
@@ -1,12 +1,8 @@
1
- import { readConfObject } from '@jbrowse/core/configuration';
2
- import { localStorageGetBoolean, localStorageSetItem } from '@jbrowse/core/util';
1
+ import { localStorageGetBoolean, localStorageSetBoolean, } from '@jbrowse/core/util';
3
2
  import { autorun } from 'mobx';
4
- import { addDisposer, cast, getSnapshot, types } from 'mobx-state-tree';
3
+ import { addDisposer, cast, types } from 'mobx-state-tree';
5
4
  import { BaseSessionModel, isBaseSession } from './BaseSession';
6
5
  import { DrawerWidgetSessionMixin } from './DrawerWidgets';
7
- function localStorageSetBoolean(key, value) {
8
- localStorageSetItem(key, JSON.stringify(value));
9
- }
10
6
  export function MultipleViewsSessionMixin(pluginManager) {
11
7
  return types
12
8
  .compose(BaseSessionModel(pluginManager), DrawerWidgetSessionMixin(pluginManager))
@@ -60,27 +56,8 @@ export function MultipleViewsSessionMixin(pluginManager) {
60
56
  }
61
57
  self.views.remove(view);
62
58
  },
63
- addLinearGenomeViewOfAssembly(assemblyName, initialState = {}) {
64
- return this.addViewOfAssembly('LinearGenomeView', assemblyName, initialState);
65
- },
66
- addViewOfAssembly(viewType, assemblyName, initialState = {}) {
67
- const asm = self.assemblies.find(s => readConfObject(s, 'name') === assemblyName);
68
- if (!asm) {
69
- throw new Error(`Could not add view of assembly "${assemblyName}", assembly name not found`);
70
- }
71
- return this.addView(viewType, {
72
- ...initialState,
73
- displayRegionsFromAssemblyName: readConfObject(asm, 'name'),
74
- });
75
- },
76
- addViewFromAnotherView(viewType, otherView, initialState = {}) {
77
- const state = { ...initialState };
78
- state.displayedRegions = getSnapshot(otherView.displayedRegions);
79
- return this.addView(viewType, state);
80
- },
81
59
  setStickyViewHeaders(sticky) {
82
60
  self.stickyViewHeaders = sticky;
83
- localStorageSetBoolean('stickyViewHeaders', sticky);
84
61
  },
85
62
  afterAttach() {
86
63
  addDisposer(self, autorun(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/product-core",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "sideEffects": false,
5
5
  "description": "JBrowse 2 code shared between products but not used by plugins",
6
6
  "keywords": [
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@babel/runtime": "^7.16.3",
46
- "@jbrowse/core": "^3.3.0",
46
+ "@jbrowse/core": "^3.5.0",
47
47
  "@mui/icons-material": "^7.0.0",
48
48
  "@mui/material": "^7.0.0",
49
49
  "copy-to-clipboard": "^3.3.1",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
65
+ "gitHead": "8a8aa0aab2229dece106a5715a767e649e2fe92b"
66
66
  }