@jbrowse/core 2.3.0 → 2.3.2

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,14 +1,32 @@
1
1
  import { IModelType, ModelProperties } from 'mobx-state-tree';
2
2
  import { IObservableArray } from 'mobx';
3
3
  import { NotificationLevel, SnackAction } from '../util/types';
4
+ /**
5
+ * #stateModel SnackbarModel
6
+ */
4
7
  declare function makeExtension(snackbarMessages: IObservableArray<any>): {
5
8
  views: {
9
+ /**
10
+ * #getter
11
+ */
6
12
  readonly snackbarMessages: IObservableArray<any>;
7
13
  };
8
14
  actions: {
15
+ /**
16
+ * #action
17
+ */
9
18
  notify(message: string, level?: NotificationLevel, action?: SnackAction): void;
19
+ /**
20
+ * #action
21
+ */
10
22
  pushSnackbarMessage(message: string, level?: NotificationLevel, action?: SnackAction): number;
23
+ /**
24
+ * #action
25
+ */
11
26
  popSnackbarMessage(): any;
27
+ /**
28
+ * #action
29
+ */
12
30
  removeSnackbarMessage(message: string): void;
13
31
  };
14
32
  };
@@ -1,15 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mobx_1 = require("mobx");
4
+ /**
5
+ * #stateModel SnackbarModel
6
+ */
4
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
8
  function makeExtension(snackbarMessages) {
6
9
  return {
7
10
  views: {
11
+ /**
12
+ * #getter
13
+ */
8
14
  get snackbarMessages() {
9
15
  return snackbarMessages;
10
16
  },
11
17
  },
12
18
  actions: {
19
+ /**
20
+ * #action
21
+ */
13
22
  notify(message, level, action) {
14
23
  this.pushSnackbarMessage(message, level, action);
15
24
  if (level === 'info' || level === 'success') {
@@ -18,12 +27,21 @@ function makeExtension(snackbarMessages) {
18
27
  }, 5000);
19
28
  }
20
29
  },
30
+ /**
31
+ * #action
32
+ */
21
33
  pushSnackbarMessage(message, level, action) {
22
34
  return snackbarMessages.push([message, level, action]);
23
35
  },
36
+ /**
37
+ * #action
38
+ */
24
39
  popSnackbarMessage() {
25
40
  return snackbarMessages.pop();
26
41
  },
42
+ /**
43
+ * #action
44
+ */
27
45
  removeSnackbarMessage(message) {
28
46
  const element = snackbarMessages.find(f => f[0] === message);
29
47
  if (element) {
package/ui/Tooltip.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Feature } from '../util/simpleFeature';
2
+ import { Feature } from '../util';
3
3
  declare const _default: ({ offsetX, offsetY, configuration, feature, timeout, }: {
4
4
  offsetX: number;
5
5
  offsetY: number;
package/util/index.d.ts CHANGED
@@ -341,3 +341,4 @@ export declare function measureGridWidth(elements: string[]): number;
341
341
  export declare function getEnv(obj: any): {
342
342
  pluginManager: PluginManager;
343
343
  };
344
+ export declare function localStorageGetItem(item: string): string | null | undefined;
package/util/index.js CHANGED
@@ -30,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.bytesForRegions = exports.objectHash = exports.hashCode = exports.updateStatus = exports.generateCodonTable = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.measureText = exports.rIC = exports.blobToDataURL = exports.complement = exports.reverse = exports.revcom = exports.isElectron = exports.stringify = exports.shorten = exports.minmax = exports.renameRegionsIfNeeded = exports.renameRegionIfNeeded = exports.makeAbortableReaction = exports.findLastIndex = exports.iterMap = exports.bpSpanPx = exports.featureSpanPx = exports.cartesianToPolar = exports.polarToCartesian = exports.degToRad = exports.radToDeg = exports.bpToPx = exports.clamp = exports.compareLocStrings = exports.compareLocs = exports.parseLocString = exports.parseLocStringOneBased = exports.assembleLocStringFast = exports.assembleLocString = exports.getContainingDisplay = exports.getContainingTrack = exports.getContainingView = exports.getSession = exports.findParentThatIs = exports.springAnimate = exports.findParentThat = exports.useDebouncedCallback = exports.useDebounce = exports.inProduction = exports.inDevelopment = exports.isFeature = exports.SimpleFeature = void 0;
33
- exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale = exports.getBpDisplayStr = exports.supportedIndexingAdapters = void 0;
33
+ exports.localStorageGetItem = exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale = exports.getBpDisplayStr = exports.supportedIndexingAdapters = void 0;
34
34
  /* eslint-disable @typescript-eslint/no-explicit-any */
35
35
  const react_1 = require("react");
36
36
  const is_object_1 = __importDefault(require("is-object"));
@@ -1011,3 +1011,9 @@ function getEnv(obj) {
1011
1011
  return (0, mobx_state_tree_1.getEnv)(obj);
1012
1012
  }
1013
1013
  exports.getEnv = getEnv;
1014
+ function localStorageGetItem(item) {
1015
+ return typeof localStorage !== 'undefined'
1016
+ ? localStorage.getItem(item)
1017
+ : undefined;
1018
+ }
1019
+ exports.localStorageGetItem = localStorageGetItem;
@@ -112,7 +112,10 @@ function isAbstractMenuManager(thing) {
112
112
  }
113
113
  exports.isAbstractMenuManager = isAbstractMenuManager;
114
114
  function isUriLocation(location) {
115
- return typeof location === 'object' && location !== null && 'uri' in location;
115
+ return (typeof location === 'object' &&
116
+ location !== null &&
117
+ 'uri' in location &&
118
+ !!location.uri);
116
119
  }
117
120
  exports.isUriLocation = isUriLocation;
118
121
  class AuthNeededError extends Error {