@jbrowse/core 2.12.0 → 2.12.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.
Files changed (91) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +1 -1
  2. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +1 -1
  3. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +1 -1
  4. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +1 -1
  5. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +1 -1
  6. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
  7. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
  8. package/BaseFeatureWidget/BaseFeatureDetail/index.js +3 -3
  9. package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -5
  10. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -1
  11. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
  12. package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +1 -1
  13. package/BaseFeatureWidget/SequenceFeatureDetails/model.js +1 -2
  14. package/BaseFeatureWidget/SequenceFeatureDetails/util.js +2 -2
  15. package/BaseFeatureWidget/stateModelFactory.d.ts +2 -6
  16. package/BaseFeatureWidget/stateModelFactory.js +1 -2
  17. package/BaseFeatureWidget/util.d.ts +5 -5
  18. package/BaseFeatureWidget/util.js +6 -7
  19. package/PluginLoader.js +4 -5
  20. package/PluginManager.d.ts +6 -7
  21. package/ReExports/modules.d.ts +6 -6
  22. package/TextSearch/TextSearchManager.d.ts +6 -2
  23. package/assemblyManager/assembly.js +1 -1
  24. package/assemblyManager/assemblyManager.d.ts +9 -82
  25. package/configuration/configurationSchema.d.ts +7 -1
  26. package/configuration/configurationSchema.js +2 -3
  27. package/configuration/configurationSlot.js +1 -1
  28. package/configuration/util.d.ts +1 -1
  29. package/configuration/util.js +7 -8
  30. package/data_adapters/BaseAdapter/util.js +5 -6
  31. package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -1
  32. package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -2
  33. package/data_adapters/CytobandAdapter/index.js +1 -1
  34. package/data_adapters/dataAdapterCache.js +4 -5
  35. package/package.json +3 -3
  36. package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +1 -3
  37. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -3
  38. package/pluggableElementTypes/models/BaseTrackModel.d.ts +6 -2
  39. package/pluggableElementTypes/models/BaseTrackModel.js +2 -3
  40. package/pluggableElementTypes/models/InternetAccountModel.d.ts +13 -13
  41. package/pluggableElementTypes/models/baseTrackConfig.js +1 -2
  42. package/rpc/BaseRpcDriver.js +1 -2
  43. package/rpc/methods/util.js +1 -2
  44. package/rpc/remoteAbortSignals.js +5 -6
  45. package/stories/examples/WithSequencePanel.js +5 -6
  46. package/tsconfig.build.tsbuildinfo +1 -1
  47. package/ui/ColorPicker.js +3 -3
  48. package/ui/ErrorMessageStackTraceDialog.js +1 -1
  49. package/ui/FactoryResetDialog.js +1 -1
  50. package/ui/FatalErrorDialog.js +1 -1
  51. package/ui/Icons.js +9 -10
  52. package/ui/LoadingEllipses.js +1 -1
  53. package/ui/Logo.js +2 -3
  54. package/ui/Menu.js +1 -2
  55. package/ui/RedErrorMessageBox.js +1 -1
  56. package/ui/SanitizedHTML.js +1 -1
  57. package/ui/SnackbarModel.js +1 -1
  58. package/ui/theme.js +3 -3
  59. package/util/Base1DUtils.js +4 -5
  60. package/util/Base1DViewModel.d.ts +2 -2
  61. package/util/aborting.js +5 -6
  62. package/util/analytics.js +3 -4
  63. package/util/blobToDataURL.js +1 -2
  64. package/util/calculateDynamicBlocks.js +1 -1
  65. package/util/calculateStaticBlocks.js +1 -1
  66. package/util/color/cssColorsLevel4.js +2 -3
  67. package/util/color/index.js +4 -4
  68. package/util/dedupe.js +1 -2
  69. package/util/formatFastaStrings.js +2 -3
  70. package/util/idMaker.js +1 -1
  71. package/util/index.d.ts +2 -2
  72. package/util/index.js +70 -71
  73. package/util/io/RemoteFileWithRangeCache.d.ts +0 -1
  74. package/util/io/RemoteFileWithRangeCache.js +3 -3
  75. package/util/io/index.js +4 -4
  76. package/util/jexl.js +1 -1
  77. package/util/jexlStrings.js +1 -2
  78. package/util/map-obj.js +1 -1
  79. package/util/mst-reflection.js +6 -7
  80. package/util/offscreenCanvasPonyfill.js +2 -2
  81. package/util/offscreenCanvasUtils.js +3 -4
  82. package/util/range.js +3 -4
  83. package/util/rxjs.js +1 -2
  84. package/util/simpleFeature.js +1 -2
  85. package/util/stats.js +5 -6
  86. package/util/tracks.js +17 -17
  87. package/util/types/index.js +23 -23
  88. package/util/types/mst.d.ts +0 -1
  89. package/util/useMeasure.d.ts +2 -3
  90. package/util/useMeasure.js +1 -1
  91. package/util/when.js +2 -3
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveLateType = exports.getEnumerationValues = exports.getDefaultValue = exports.getPropertyType = exports.getUnionSubTypes = exports.getSubType = void 0;
3
+ exports.getSubType = getSubType;
4
+ exports.getUnionSubTypes = getUnionSubTypes;
5
+ exports.getPropertyType = getPropertyType;
6
+ exports.getDefaultValue = getDefaultValue;
7
+ exports.getEnumerationValues = getEnumerationValues;
8
+ exports.resolveLateType = resolveLateType;
4
9
  /* eslint-disable no-underscore-dangle */
5
10
  const mobx_state_tree_1 = require("mobx-state-tree");
6
11
  /**
@@ -30,7 +35,6 @@ function getSubType(type) {
30
35
  }
31
36
  return t;
32
37
  }
33
- exports.getSubType = getSubType;
34
38
  /**
35
39
  * get the array of the subtypes in a union
36
40
  */
@@ -53,14 +57,12 @@ function getUnionSubTypes(unionType) {
53
57
  }
54
58
  return t;
55
59
  }
56
- exports.getUnionSubTypes = getUnionSubTypes;
57
60
  /**
58
61
  * get the type of one of the properties of the given MST model type
59
62
  */
60
63
  function getPropertyType(type, propertyName) {
61
64
  return type.properties[propertyName];
62
65
  }
63
- exports.getPropertyType = getPropertyType;
64
66
  /**
65
67
  * get the base type from inside an MST optional type
66
68
  */
@@ -71,14 +73,12 @@ function getDefaultValue(type) {
71
73
  // @ts-expect-error
72
74
  return type._defaultValue || type.defaultValue;
73
75
  }
74
- exports.getDefaultValue = getDefaultValue;
75
76
  /** get the string values of an MST enumeration type */
76
77
  function getEnumerationValues(type) {
77
78
  const subtypes = getUnionSubTypes(type);
78
79
  // the subtypes should all be literals with a value member
79
80
  return subtypes.map(t => t.value);
80
81
  }
81
- exports.getEnumerationValues = getEnumerationValues;
82
82
  function resolveLateType(maybeLate) {
83
83
  if (!(0, mobx_state_tree_1.isUnionType)(maybeLate) &&
84
84
  !(0, mobx_state_tree_1.isArrayType)(maybeLate) &&
@@ -88,4 +88,3 @@ function resolveLateType(maybeLate) {
88
88
  }
89
89
  return maybeLate;
90
90
  }
91
- exports.resolveLateType = resolveLateType;
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
6
6
  };
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.drawImageOntoCanvasContext = exports.ImageBitmapType = exports.createImageBitmap = exports.createCanvas = void 0;
8
+ exports.ImageBitmapType = exports.createImageBitmap = exports.createCanvas = void 0;
9
+ exports.drawImageOntoCanvasContext = drawImageOntoCanvasContext;
9
10
  const detect_node_1 = __importDefault(require("detect-node"));
10
11
  const canvas_sequencer_1 = require("canvas-sequencer");
11
12
  function drawImageOntoCanvasContext(
@@ -19,7 +20,6 @@ imageData, context) {
19
20
  context.drawImage(imageData, 0, 0);
20
21
  }
21
22
  }
22
- exports.drawImageOntoCanvasContext = drawImageOntoCanvasContext;
23
23
  const weHave = {
24
24
  realOffscreenCanvas: typeof OffscreenCanvas === 'function',
25
25
  node: detect_node_1.default,
@@ -26,7 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ReactRendering = exports.getSerializedSvg = exports.renderToAbstractCanvas = void 0;
29
+ exports.renderToAbstractCanvas = renderToAbstractCanvas;
30
+ exports.getSerializedSvg = getSerializedSvg;
31
+ exports.ReactRendering = ReactRendering;
30
32
  /* eslint-disable react-refresh/only-export-components */
31
33
  const react_1 = __importDefault(require("react"));
32
34
  const canvas_sequencer_1 = require("canvas-sequencer");
@@ -77,7 +79,6 @@ async function renderToAbstractCanvas(width, height, opts, cb) {
77
79
  return { ...result, imageData: await (0, offscreenCanvasPonyfill_1.createImageBitmap)(canvas) };
78
80
  }
79
81
  }
80
- exports.renderToAbstractCanvas = renderToAbstractCanvas;
81
82
  async function getSerializedSvg(results) {
82
83
  const { width, height, canvasRecordedData } = results;
83
84
  // @ts-ignore needs to be ignore not expect error, produces error in build step
@@ -89,10 +90,8 @@ async function getSerializedSvg(results) {
89
90
  // our own <svg> element in the view's SVG export
90
91
  return ctx.getSvg().innerHTML;
91
92
  }
92
- exports.getSerializedSvg = getSerializedSvg;
93
93
  function ReactRendering({ rendering, }) {
94
94
  return react_1.default.isValidElement(rendering.reactElement) ? (rendering.reactElement) : (react_1.default.createElement("g", {
95
95
  /* eslint-disable-next-line react/no-danger */
96
96
  dangerouslySetInnerHTML: { __html: rendering.html || '' } }));
97
97
  }
98
- exports.ReactRendering = ReactRendering;
package/util/range.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isContainedWithin = exports.doesIntersect2 = exports.intersection2 = void 0;
3
+ exports.intersection2 = intersection2;
4
+ exports.doesIntersect2 = doesIntersect2;
5
+ exports.isContainedWithin = isContainedWithin;
4
6
  /**
5
7
  * fast low-level intersection of 2 coordinate ranges. assumes interbase coordinates.
6
8
  *
@@ -32,7 +34,6 @@ function intersection2(left1, right1, left2, right2) {
32
34
  }
33
35
  return [];
34
36
  }
35
- exports.intersection2 = intersection2;
36
37
  /**
37
38
  * Return whether 2 interbase coordinate ranges intersect.
38
39
  *
@@ -46,7 +47,6 @@ exports.intersection2 = intersection2;
46
47
  function doesIntersect2(left1, right1, left2, right2) {
47
48
  return right1 > left2 && left1 < right2;
48
49
  }
49
- exports.doesIntersect2 = doesIntersect2;
50
50
  /**
51
51
  * Return whether the first region is completely contained within the second region
52
52
  *
@@ -58,4 +58,3 @@ exports.doesIntersect2 = doesIntersect2;
58
58
  function isContainedWithin(left1, right1, left2, right2) {
59
59
  return left2 <= left1 && right2 >= right1;
60
60
  }
61
- exports.isContainedWithin = isContainedWithin;
package/util/rxjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ObservableCreate = void 0;
3
+ exports.ObservableCreate = ObservableCreate;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const _1 = require(".");
@@ -24,4 +24,3 @@ function ObservableCreate(func, signal) {
24
24
  }
25
25
  }).pipe((0, operators_1.takeUntil)((0, _1.observeAbortSignal)(signal)));
26
26
  }
27
- exports.ObservableCreate = ObservableCreate;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFeature = void 0;
3
+ exports.isFeature = isFeature;
4
4
  function isFeature(thing) {
5
5
  return (typeof thing === 'object' &&
6
6
  thing !== null &&
7
7
  typeof thing.get === 'function' &&
8
8
  typeof thing.id === 'function');
9
9
  }
10
- exports.isFeature = isFeature;
11
10
  function isSimpleFeatureSerialized(args) {
12
11
  return 'uniqueId' in args && typeof args.data !== 'object';
13
12
  }
package/util/stats.js CHANGED
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.blankStats = exports.scoresToStats = exports.calcPerBaseStats = exports.rectifyStats = exports.calcStdFromSums = void 0;
3
+ exports.calcStdFromSums = calcStdFromSums;
4
+ exports.rectifyStats = rectifyStats;
5
+ exports.calcPerBaseStats = calcPerBaseStats;
6
+ exports.scoresToStats = scoresToStats;
7
+ exports.blankStats = blankStats;
4
8
  const rxjs_1 = require("rxjs");
5
9
  const operators_1 = require("rxjs/operators");
6
10
  /**
@@ -30,7 +34,6 @@ function calcStdFromSums(sum, sumSquares, n, population = false) {
30
34
  }
31
35
  return variance < 0 ? 0 : Math.sqrt(variance);
32
36
  }
33
- exports.calcStdFromSums = calcStdFromSums;
34
37
  /**
35
38
  * @param stats - a summary stats object with scoreSum, featureCount,
36
39
  * scoreSumSquares, and basesCovered
@@ -45,7 +48,6 @@ function rectifyStats(s) {
45
48
  featureDensity: (s.featureCount || 1) / s.basesCovered,
46
49
  };
47
50
  }
48
- exports.rectifyStats = rectifyStats;
49
51
  /**
50
52
  * calculates per-base scores for variable width features over a region
51
53
  *
@@ -79,7 +81,6 @@ function calcPerBaseStats(region, features) {
79
81
  }
80
82
  return scores;
81
83
  }
82
- exports.calcPerBaseStats = calcPerBaseStats;
83
84
  /**
84
85
  * transform a list of scores to summary statistics
85
86
  *
@@ -120,7 +121,6 @@ async function scoresToStats(region, feats) {
120
121
  })
121
122
  : blankStats();
122
123
  }
123
- exports.scoresToStats = scoresToStats;
124
124
  function blankStats() {
125
125
  return {
126
126
  scoreMin: 0,
@@ -134,4 +134,3 @@ function blankStats() {
134
134
  basesCovered: 0,
135
135
  };
136
136
  }
137
- exports.blankStats = blankStats;
package/util/tracks.js CHANGED
@@ -1,6 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTrackName = exports.generateUnknownTrackConf = exports.generateUnsupportedTrackConf = exports.guessTrackType = exports.guessAdapter = exports.getFileName = exports.makeIndexType = exports.makeIndex = exports.storeBlobLocation = exports.setBlobMap = exports.getBlobMap = exports.getBlob = exports.UNSUPPORTED = exports.UNKNOWN = exports.getParentRenderProps = exports.getRpcSessionId = exports.getConfAssemblyNames = exports.getTrackAssemblyNames = void 0;
3
+ exports.UNSUPPORTED = exports.UNKNOWN = void 0;
4
+ exports.getTrackAssemblyNames = getTrackAssemblyNames;
5
+ exports.getConfAssemblyNames = getConfAssemblyNames;
6
+ exports.getRpcSessionId = getRpcSessionId;
7
+ exports.getParentRenderProps = getParentRenderProps;
8
+ exports.getBlob = getBlob;
9
+ exports.getBlobMap = getBlobMap;
10
+ exports.setBlobMap = setBlobMap;
11
+ exports.storeBlobLocation = storeBlobLocation;
12
+ exports.makeIndex = makeIndex;
13
+ exports.makeIndexType = makeIndexType;
14
+ exports.getFileName = getFileName;
15
+ exports.guessAdapter = guessAdapter;
16
+ exports.guessTrackType = guessTrackType;
17
+ exports.generateUnsupportedTrackConf = generateUnsupportedTrackConf;
18
+ exports.generateUnknownTrackConf = generateUnknownTrackConf;
19
+ exports.getTrackName = getTrackName;
4
20
  const mobx_state_tree_1 = require("mobx-state-tree");
5
21
  const index_1 = require("./index");
6
22
  const configuration_1 = require("../configuration");
@@ -8,7 +24,6 @@ const configuration_1 = require("../configuration");
8
24
  function getTrackAssemblyNames(track) {
9
25
  return getConfAssemblyNames(track.configuration);
10
26
  }
11
- exports.getTrackAssemblyNames = getTrackAssemblyNames;
12
27
  function getConfAssemblyNames(conf) {
13
28
  const trackAssemblyNames = (0, configuration_1.readConfObject)(conf, 'assemblyNames');
14
29
  if (!trackAssemblyNames) {
@@ -21,7 +36,6 @@ function getConfAssemblyNames(conf) {
21
36
  }
22
37
  return trackAssemblyNames;
23
38
  }
24
- exports.getConfAssemblyNames = getConfAssemblyNames;
25
39
  /** return the rpcSessionId of the highest parent node in the tree that has an rpcSessionId */
26
40
  function getRpcSessionId(thisNode) {
27
41
  let highestRpcSessionId;
@@ -36,7 +50,6 @@ function getRpcSessionId(thisNode) {
36
50
  }
37
51
  return highestRpcSessionId;
38
52
  }
39
- exports.getRpcSessionId = getRpcSessionId;
40
53
  /**
41
54
  * given an MST node, get the renderprops of the first parent container that
42
55
  * has renderProps
@@ -55,7 +68,6 @@ function getParentRenderProps(node) {
55
68
  }
56
69
  return {};
57
70
  }
58
- exports.getParentRenderProps = getParentRenderProps;
59
71
  exports.UNKNOWN = 'UNKNOWN';
60
72
  exports.UNSUPPORTED = 'UNSUPPORTED';
61
73
  let blobMap = {};
@@ -63,17 +75,14 @@ let blobMap = {};
63
75
  function getBlob(id) {
64
76
  return blobMap[id];
65
77
  }
66
- exports.getBlob = getBlob;
67
78
  // used to export entire context to webworker
68
79
  function getBlobMap() {
69
80
  return blobMap;
70
81
  }
71
- exports.getBlobMap = getBlobMap;
72
82
  // used in new contexts like webworkers
73
83
  function setBlobMap(map) {
74
84
  blobMap = map;
75
85
  }
76
- exports.setBlobMap = setBlobMap;
77
86
  let counter = 0;
78
87
  // blob files are stored in a global map. the blobId is based on a combination
79
88
  // of timestamp plus counter to be unique across sessions and fast repeated
@@ -86,7 +95,6 @@ function storeBlobLocation(location) {
86
95
  }
87
96
  return location;
88
97
  }
89
- exports.storeBlobLocation = storeBlobLocation;
90
98
  /**
91
99
  * creates a new location from the provided location including the appropriate suffix and location type
92
100
  * @param location - the FileLocation
@@ -105,7 +113,6 @@ function makeIndex(location, suffix) {
105
113
  }
106
114
  return location;
107
115
  }
108
- exports.makeIndex = makeIndex;
109
116
  /**
110
117
  * constructs a potential index file (with suffix) from the provided file name
111
118
  * @param name - the name of the index file
@@ -116,7 +123,6 @@ exports.makeIndex = makeIndex;
116
123
  function makeIndexType(name, typeA, typeB) {
117
124
  return (name === null || name === void 0 ? void 0 : name.toUpperCase().endsWith(typeA)) ? typeA : typeB;
118
125
  }
119
- exports.makeIndexType = makeIndexType;
120
126
  function getFileName(track) {
121
127
  const uri = 'uri' in track ? track.uri : undefined;
122
128
  const localPath = 'localPath' in track ? track.localPath : undefined;
@@ -126,7 +132,6 @@ function getFileName(track) {
126
132
  (localPath === null || localPath === void 0 ? void 0 : localPath.slice((localPath === null || localPath === void 0 ? void 0 : localPath.replace(/\\/g, '/').lastIndexOf('/')) + 1)) ||
127
133
  '');
128
134
  }
129
- exports.getFileName = getFileName;
130
135
  function guessAdapter(file, index, adapterHint, model) {
131
136
  if (model) {
132
137
  const { pluginManager } = (0, index_1.getEnv)(model);
@@ -142,7 +147,6 @@ function guessAdapter(file, index, adapterHint, model) {
142
147
  type: exports.UNKNOWN,
143
148
  };
144
149
  }
145
- exports.guessAdapter = guessAdapter;
146
150
  function guessTrackType(adapterType, model) {
147
151
  if (model) {
148
152
  const session = (0, index_1.getSession)(model);
@@ -156,7 +160,6 @@ function guessTrackType(adapterType, model) {
156
160
  }
157
161
  return 'FeatureTrack';
158
162
  }
159
- exports.guessTrackType = guessTrackType;
160
163
  function generateUnsupportedTrackConf(trackName, trackUrl, categories) {
161
164
  const conf = {
162
165
  type: 'FeatureTrack',
@@ -168,7 +171,6 @@ function generateUnsupportedTrackConf(trackName, trackUrl, categories) {
168
171
  conf.trackId = (0, index_1.objectHash)(conf);
169
172
  return conf;
170
173
  }
171
- exports.generateUnsupportedTrackConf = generateUnsupportedTrackConf;
172
174
  function generateUnknownTrackConf(trackName, trackUrl, categories) {
173
175
  const conf = {
174
176
  type: 'FeatureTrack',
@@ -180,7 +182,6 @@ function generateUnknownTrackConf(trackName, trackUrl, categories) {
180
182
  conf.trackId = (0, index_1.objectHash)(conf);
181
183
  return conf;
182
184
  }
183
- exports.generateUnknownTrackConf = generateUnknownTrackConf;
184
185
  function getTrackName(conf, session) {
185
186
  const trackName = (0, configuration_1.readConfObject)(conf, 'name');
186
187
  if (!trackName && (0, configuration_1.readConfObject)(conf, 'type') === 'ReferenceSequenceTrack') {
@@ -191,4 +192,3 @@ function getTrackName(conf, session) {
191
192
  }
192
193
  return trackName;
193
194
  }
194
- exports.getTrackName = getTrackName;
@@ -14,7 +14,29 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.isRetryException = exports.isAuthNeededException = exports.RetryError = exports.AuthNeededError = exports.isBlobLocation = exports.isLocalPathLocation = exports.isUriLocation = exports.isAbstractMenuManager = exports.isRootModelWithInternetAccounts = exports.isAppRootModel = exports.isTrackViewModel = exports.isDisplayModel = exports.isTrackModel = exports.isViewModel = exports.isSelectionContainer = exports.isSessionWithSessionPlugins = exports.isSessionModelWithConnectionEditing = exports.isSessionModelWithConnections = exports.isSessionModelWithWidgets = exports.isSessionWithShareURL = exports.isSessionWithAddTracks = exports.isSessionModelWithConfigEditing = exports.isSessionModel = exports.isViewContainer = void 0;
17
+ exports.RetryError = exports.AuthNeededError = void 0;
18
+ exports.isViewContainer = isViewContainer;
19
+ exports.isSessionModel = isSessionModel;
20
+ exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
21
+ exports.isSessionWithAddTracks = isSessionWithAddTracks;
22
+ exports.isSessionWithShareURL = isSessionWithShareURL;
23
+ exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
24
+ exports.isSessionModelWithConnections = isSessionModelWithConnections;
25
+ exports.isSessionModelWithConnectionEditing = isSessionModelWithConnectionEditing;
26
+ exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
27
+ exports.isSelectionContainer = isSelectionContainer;
28
+ exports.isViewModel = isViewModel;
29
+ exports.isTrackModel = isTrackModel;
30
+ exports.isDisplayModel = isDisplayModel;
31
+ exports.isTrackViewModel = isTrackViewModel;
32
+ exports.isAppRootModel = isAppRootModel;
33
+ exports.isRootModelWithInternetAccounts = isRootModelWithInternetAccounts;
34
+ exports.isAbstractMenuManager = isAbstractMenuManager;
35
+ exports.isUriLocation = isUriLocation;
36
+ exports.isLocalPathLocation = isLocalPathLocation;
37
+ exports.isBlobLocation = isBlobLocation;
38
+ exports.isAuthNeededException = isAuthNeededException;
39
+ exports.isRetryException = isRetryException;
18
40
  const mobx_state_tree_1 = require("mobx-state-tree");
19
41
  __exportStar(require("./util"), exports);
20
42
  function isViewContainer(thing) {
@@ -23,58 +45,47 @@ function isViewContainer(thing) {
23
45
  'addView' in thing &&
24
46
  'views' in thing);
25
47
  }
26
- exports.isViewContainer = isViewContainer;
27
48
  function isSessionModel(thing) {
28
49
  return (typeof thing === 'object' &&
29
50
  thing !== null &&
30
51
  'rpcManager' in thing &&
31
52
  'configuration' in thing);
32
53
  }
33
- exports.isSessionModel = isSessionModel;
34
54
  function isSessionModelWithConfigEditing(thing) {
35
55
  return isSessionModel(thing) && 'editConfiguration' in thing;
36
56
  }
37
- exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
38
57
  function isSessionWithAddTracks(thing) {
39
58
  return (
40
59
  // @ts-expect-error
41
60
  isSessionModel(thing) && 'addTrackConf' in thing && !thing.disableAddTracks);
42
61
  }
43
- exports.isSessionWithAddTracks = isSessionWithAddTracks;
44
62
  function isSessionWithShareURL(thing) {
45
63
  return isSessionModel(thing) && 'shareURL' in thing && !!thing.shareURL;
46
64
  }
47
- exports.isSessionWithShareURL = isSessionWithShareURL;
48
65
  function isSessionModelWithWidgets(thing) {
49
66
  return isSessionModel(thing) && 'widgets' in thing;
50
67
  }
51
- exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
52
68
  function isSessionModelWithConnections(thing) {
53
69
  return isSessionModel(thing) && 'makeConnection' in thing;
54
70
  }
55
- exports.isSessionModelWithConnections = isSessionModelWithConnections;
56
71
  function isSessionModelWithConnectionEditing(thing) {
57
72
  return isSessionModel(thing) && 'addConnectionConf' in thing;
58
73
  }
59
- exports.isSessionModelWithConnectionEditing = isSessionModelWithConnectionEditing;
60
74
  function isSessionWithSessionPlugins(thing) {
61
75
  return isSessionModel(thing) && 'sessionPlugins' in thing;
62
76
  }
63
- exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
64
77
  function isSelectionContainer(thing) {
65
78
  return (typeof thing === 'object' &&
66
79
  thing !== null &&
67
80
  'selection' in thing &&
68
81
  'setSelection' in thing);
69
82
  }
70
- exports.isSelectionContainer = isSelectionContainer;
71
83
  function isViewModel(thing) {
72
84
  return (typeof thing === 'object' &&
73
85
  thing !== null &&
74
86
  'width' in thing &&
75
87
  'setWidth' in thing);
76
88
  }
77
- exports.isViewModel = isViewModel;
78
89
  function isTrackModel(thing) {
79
90
  return (typeof thing === 'object' &&
80
91
  thing !== null &&
@@ -82,7 +93,6 @@ function isTrackModel(thing) {
82
93
  // @ts-expect-error
83
94
  thing.configuration.trackId);
84
95
  }
85
- exports.isTrackModel = isTrackModel;
86
96
  function isDisplayModel(thing) {
87
97
  return (typeof thing === 'object' &&
88
98
  thing !== null &&
@@ -90,55 +100,47 @@ function isDisplayModel(thing) {
90
100
  // @ts-expect-error
91
101
  thing.configuration.displayId);
92
102
  }
93
- exports.isDisplayModel = isDisplayModel;
94
103
  function isTrackViewModel(thing) {
95
104
  return (typeof thing === 'object' &&
96
105
  thing !== null &&
97
106
  'showTrack' in thing &&
98
107
  'hideTrack' in thing);
99
108
  }
100
- exports.isTrackViewModel = isTrackViewModel;
101
109
  function isAppRootModel(thing) {
102
110
  return (typeof thing === 'object' &&
103
111
  thing !== null &&
104
112
  'findAppropriateInternetAccount' in thing);
105
113
  }
106
- exports.isAppRootModel = isAppRootModel;
107
114
  function isRootModelWithInternetAccounts(thing) {
108
115
  return (typeof thing === 'object' &&
109
116
  thing !== null &&
110
117
  'internetAccounts' in thing &&
111
118
  'findAppropriateInternetAccount' in thing);
112
119
  }
113
- exports.isRootModelWithInternetAccounts = isRootModelWithInternetAccounts;
114
120
  function isAbstractMenuManager(thing) {
115
121
  return (typeof thing === 'object' &&
116
122
  thing !== null &&
117
123
  'appendMenu' in thing &&
118
124
  'appendToSubMenu' in thing);
119
125
  }
120
- exports.isAbstractMenuManager = isAbstractMenuManager;
121
126
  function isUriLocation(location) {
122
127
  return (typeof location === 'object' &&
123
128
  location !== null &&
124
129
  'uri' in location &&
125
130
  !!location.uri);
126
131
  }
127
- exports.isUriLocation = isUriLocation;
128
132
  function isLocalPathLocation(location) {
129
133
  return (typeof location === 'object' &&
130
134
  location !== null &&
131
135
  'localPath' in location &&
132
136
  !!location.localPath);
133
137
  }
134
- exports.isLocalPathLocation = isLocalPathLocation;
135
138
  function isBlobLocation(location) {
136
139
  return (typeof location === 'object' &&
137
140
  location !== null &&
138
141
  'blobId' in location &&
139
142
  !!location.blobId);
140
143
  }
141
- exports.isBlobLocation = isBlobLocation;
142
144
  class AuthNeededError extends Error {
143
145
  constructor(message, url) {
144
146
  super(message);
@@ -164,11 +166,9 @@ function isAuthNeededException(exception) {
164
166
  (exception.name === 'AuthNeededError' ||
165
167
  exception.url !== undefined));
166
168
  }
167
- exports.isAuthNeededException = isAuthNeededException;
168
169
  function isRetryException(exception) {
169
170
  return (
170
171
  // DOMException
171
172
  exception.name === 'RetryError' ||
172
173
  exception.internetAccountId !== undefined);
173
174
  }
174
- exports.isRetryException = isRetryException;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import propTypes from 'prop-types';
3
2
  export declare const ElementId: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
4
3
  export declare const PropTypes: {
@@ -1,5 +1,4 @@
1
- /// <reference types="react" />
2
1
  export default function useMeasure(): readonly [import("react").RefObject<HTMLDivElement>, {
3
- width?: number | undefined;
4
- height?: number | undefined;
2
+ width?: number;
3
+ height?: number;
5
4
  }];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = useMeasure;
3
4
  const react_1 = require("react");
4
5
  function useMeasure() {
5
6
  const ref = (0, react_1.useRef)(null);
@@ -31,4 +32,3 @@ function useMeasure() {
31
32
  }, []);
32
33
  return [ref, dims];
33
34
  }
34
- exports.default = useMeasure;
package/util/when.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.whenPresent = exports.when = void 0;
3
+ exports.when = when;
4
+ exports.whenPresent = whenPresent;
4
5
  const mobx_1 = require("mobx");
5
6
  const aborting_1 = require("./aborting");
6
7
  /**
@@ -52,7 +53,6 @@ function when(getter, { timeout, signal, name } = {}) {
52
53
  });
53
54
  });
54
55
  }
55
- exports.when = when;
56
56
  /**
57
57
  * Wrapper for mobx `when` that makes a promise for the return value
58
58
  * of the given function at the point in time when it becomes not
@@ -65,4 +65,3 @@ async function whenPresent(getter, opts = {}) {
65
65
  }, opts);
66
66
  return getter();
67
67
  }
68
- exports.whenPresent = whenPresent;