@jbrowse/core 2.0.1 → 2.1.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.
Files changed (179) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +6 -0
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +313 -592
  3. package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -479
  4. package/BaseFeatureWidget/index.js +88 -126
  5. package/BaseFeatureWidget/types.js +1 -4
  6. package/BaseFeatureWidget/util.js +40 -75
  7. package/CorePlugin.js +55 -94
  8. package/Plugin.js +9 -34
  9. package/PluginLoader.js +153 -422
  10. package/PluginManager.d.ts +17 -14
  11. package/PluginManager.js +377 -666
  12. package/ReExports/Attributes.js +3 -10
  13. package/ReExports/BaseCard.js +3 -10
  14. package/ReExports/DataGrid.js +5 -12
  15. package/ReExports/FeatureDetails.js +3 -10
  16. package/ReExports/index.js +6 -12
  17. package/ReExports/list.d.ts +5 -0
  18. package/ReExports/list.js +271 -7
  19. package/ReExports/material-ui-colors.js +15 -16
  20. package/ReExports/modules.d.ts +0 -1
  21. package/ReExports/modules.js +453 -798
  22. package/TextSearch/BaseResults.js +51 -123
  23. package/TextSearch/TextSearchManager.js +66 -144
  24. package/assemblyManager/assembly.js +280 -555
  25. package/assemblyManager/assemblyConfigSchema.js +47 -64
  26. package/assemblyManager/assemblyManager.js +126 -272
  27. package/assemblyManager/index.js +9 -22
  28. package/configuration/configurationSchema.js +167 -203
  29. package/configuration/configurationSlot.js +248 -326
  30. package/configuration/index.js +19 -35
  31. package/configuration/util.js +131 -173
  32. package/data_adapters/BaseAdapter.d.ts +2 -2
  33. package/data_adapters/BaseAdapter.js +132 -521
  34. package/data_adapters/CytobandAdapter.js +40 -126
  35. package/data_adapters/dataAdapterCache.js +77 -158
  36. package/package.json +4 -5
  37. package/pluggableElementTypes/AdapterType.js +24 -79
  38. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
  39. package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
  40. package/pluggableElementTypes/ConnectionType.js +22 -65
  41. package/pluggableElementTypes/DisplayType.js +35 -82
  42. package/pluggableElementTypes/InternetAccountType.js +23 -64
  43. package/pluggableElementTypes/PluggableElementBase.js +8 -20
  44. package/pluggableElementTypes/RpcMethodType.js +85 -427
  45. package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
  46. package/pluggableElementTypes/TrackType.js +26 -70
  47. package/pluggableElementTypes/ViewType.js +21 -63
  48. package/pluggableElementTypes/WidgetType.js +21 -64
  49. package/pluggableElementTypes/index.d.ts +4 -3
  50. package/pluggableElementTypes/index.js +42 -125
  51. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
  52. package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
  53. package/pluggableElementTypes/models/BaseTrackModel.js +139 -199
  54. package/pluggableElementTypes/models/BaseViewModel.js +24 -40
  55. package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
  56. package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
  57. package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
  58. package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
  59. package/pluggableElementTypes/models/index.js +21 -70
  60. package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
  61. package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
  62. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
  63. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
  64. package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -264
  65. package/pluggableElementTypes/renderers/RendererType.js +31 -105
  66. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
  67. package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
  68. package/pluggableElementTypes/renderers/index.js +19 -62
  69. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
  70. package/rpc/BaseRpcDriver.js +169 -405
  71. package/rpc/MainThreadRpcDriver.js +27 -150
  72. package/rpc/RpcManager.js +58 -159
  73. package/rpc/WebWorkerRpcDriver.js +54 -171
  74. package/rpc/configSchema.js +25 -49
  75. package/rpc/coreRpcMethods.js +221 -959
  76. package/rpc/remoteAbortSignals.js +46 -70
  77. package/tsconfig.build.tsbuildinfo +1 -1
  78. package/ui/AboutDialog.js +106 -162
  79. package/ui/App.js +157 -242
  80. package/ui/AssemblySelector.js +59 -120
  81. package/ui/CascadingMenu.js +101 -196
  82. package/ui/ColorPicker.d.ts +16 -0
  83. package/ui/ColorPicker.js +97 -0
  84. package/ui/Drawer.js +28 -61
  85. package/ui/DrawerWidget.js +108 -202
  86. package/ui/DropDownMenu.js +60 -91
  87. package/ui/EditableTypography.js +87 -149
  88. package/ui/ErrorMessage.js +41 -56
  89. package/ui/FactoryResetDialog.js +24 -57
  90. package/ui/FatalErrorDialog.js +59 -91
  91. package/ui/FileSelector/FileSelector.js +123 -189
  92. package/ui/FileSelector/LocalFileChooser.js +44 -75
  93. package/ui/FileSelector/UrlChooser.js +17 -38
  94. package/ui/FileSelector/index.js +6 -12
  95. package/ui/Icons.js +45 -69
  96. package/ui/Logo.js +57 -110
  97. package/ui/Menu.js +232 -354
  98. package/ui/PrerenderedCanvas.js +63 -87
  99. package/ui/ResizeHandle.js +87 -116
  100. package/ui/ReturnToImportFormDialog.js +32 -63
  101. package/ui/SanitizedHTML.js +64 -47
  102. package/ui/Snackbar.js +74 -101
  103. package/ui/SnackbarModel.js +37 -51
  104. package/ui/Tooltip.js +49 -76
  105. package/ui/ViewContainer.js +113 -196
  106. package/ui/colors.d.ts +10 -0
  107. package/ui/colors.js +78 -0
  108. package/ui/index.js +51 -181
  109. package/ui/react-colorful.d.ts +17 -0
  110. package/ui/react-colorful.js +455 -0
  111. package/ui/theme.js +199 -247
  112. package/util/Base1DUtils.js +163 -202
  113. package/util/Base1DViewModel.js +121 -168
  114. package/util/QuickLRU.js +84 -332
  115. package/util/TimeTraveller.d.ts +19 -0
  116. package/util/TimeTraveller.js +86 -0
  117. package/util/aborting.js +49 -127
  118. package/util/analytics.js +91 -154
  119. package/util/blockTypes.js +106 -240
  120. package/util/calculateDynamicBlocks.js +98 -128
  121. package/util/calculateStaticBlocks.js +105 -125
  122. package/util/color/cssColorsLevel4.js +156 -160
  123. package/util/color/index.js +33 -55
  124. package/util/compositeMap.js +49 -333
  125. package/util/formatFastaStrings.js +9 -14
  126. package/util/idMaker.js +18 -31
  127. package/util/index.d.ts +7 -20
  128. package/util/index.js +742 -1188
  129. package/util/io/RemoteFileWithRangeCache.js +88 -257
  130. package/util/io/index.js +95 -169
  131. package/util/jexl.js +60 -115
  132. package/util/jexlStrings.js +24 -29
  133. package/util/layouts/BaseLayout.js +1 -4
  134. package/util/layouts/GranularRectLayout.js +388 -555
  135. package/util/layouts/MultiLayout.js +41 -109
  136. package/util/layouts/PrecomputedLayout.js +56 -112
  137. package/util/layouts/PrecomputedMultiLayout.js +22 -59
  138. package/util/layouts/SceneGraph.js +127 -197
  139. package/util/layouts/index.js +29 -66
  140. package/util/mst-reflection.js +55 -71
  141. package/util/offscreenCanvasPonyfill.js +66 -134
  142. package/util/offscreenCanvasUtils.d.ts +2 -7
  143. package/util/offscreenCanvasUtils.js +49 -146
  144. package/util/range.js +29 -40
  145. package/util/rxjs.js +20 -27
  146. package/util/simpleFeature.js +88 -152
  147. package/util/stats.js +91 -151
  148. package/util/tracks.js +130 -173
  149. package/util/types/index.js +110 -179
  150. package/util/types/mst.js +91 -146
  151. package/util/types/util.js +1 -4
  152. package/util/when.js +54 -101
  153. package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
  154. package/BaseFeatureWidget/index.test.js +0 -69
  155. package/TextSearch/BaseResults.test.js +0 -42
  156. package/configuration/configurationSchema.test.js +0 -266
  157. package/configuration/configurationSlot.test.js +0 -69
  158. package/configuration/util.test.js +0 -39
  159. package/data_adapters/BaseAdapter.test.js +0 -200
  160. package/declare.d.js +0 -1
  161. package/pluggableElementTypes/RpcMethodType.test.js +0 -118
  162. package/pluggableElementTypes/renderers/declare.d.js +0 -1
  163. package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
  164. package/rpc/BaseRpcDriver.test.js +0 -540
  165. package/rpc/declaration.d.js +0 -1
  166. package/ui/FatalErrorDialog.test.js +0 -82
  167. package/ui/SanitizedHTML.test.js +0 -36
  168. package/ui/theme.test.js +0 -92
  169. package/util/Base1DViewModel.test.js +0 -130
  170. package/util/calculateDynamicBlocks.test.js +0 -74
  171. package/util/calculateStaticBlocks.test.js +0 -297
  172. package/util/declare.d.js +0 -1
  173. package/util/formatFastaStrings.test.js +0 -40
  174. package/util/index.test.js +0 -213
  175. package/util/jexlStrings.test.js +0 -48
  176. package/util/layouts/GranularRectLayout.test.js +0 -99
  177. package/util/range.test.js +0 -64
  178. package/util/simpleFeature.test.js +0 -34
  179. package/util/stats.test.js +0 -172
@@ -1,214 +1,145 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- var _exportNames = {
9
- isViewContainer: true,
10
- isSessionModel: true,
11
- isSessionModelWithConfigEditing: true,
12
- isSessionWithAddTracks: true,
13
- isSessionModelWithWidgets: true,
14
- isSessionModelWithConnections: true,
15
- isSessionWithSessionPlugins: true,
16
- isSelectionContainer: true,
17
- isViewModel: true,
18
- isTrackModel: true,
19
- isDisplayModel: true,
20
- isTrackViewModel: true,
21
- isAppRootModel: true,
22
- isAbstractMenuManager: true,
23
- isUriLocation: true,
24
- AuthNeededError: true,
25
- RetryError: true,
26
- isAuthNeededException: true,
27
- isRetryException: true
28
- };
29
- exports.RetryError = exports.AuthNeededError = void 0;
30
- exports.isAbstractMenuManager = isAbstractMenuManager;
31
- exports.isAppRootModel = isAppRootModel;
32
- exports.isAuthNeededException = isAuthNeededException;
33
- exports.isDisplayModel = isDisplayModel;
34
- exports.isRetryException = isRetryException;
35
- exports.isSelectionContainer = isSelectionContainer;
36
- exports.isSessionModel = isSessionModel;
37
- exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
38
- exports.isSessionModelWithConnections = isSessionModelWithConnections;
39
- exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
40
- exports.isSessionWithAddTracks = isSessionWithAddTracks;
41
- exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
42
- exports.isTrackModel = isTrackModel;
43
- exports.isTrackViewModel = isTrackViewModel;
44
- exports.isUriLocation = isUriLocation;
45
- exports.isViewContainer = isViewContainer;
46
- exports.isViewModel = isViewModel;
47
-
48
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
49
-
50
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
51
-
52
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
53
-
54
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
55
-
56
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
57
-
58
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
59
-
60
- var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
61
-
62
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
63
-
64
- var _mobxStateTree = require("mobx-state-tree");
65
-
66
- var _util = require("./util");
67
-
68
- Object.keys(_util).forEach(function (key) {
69
- if (key === "default" || key === "__esModule") return;
70
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
71
- if (key in exports && exports[key] === _util[key]) return;
72
- Object.defineProperty(exports, key, {
73
- enumerable: true,
74
- get: function get() {
75
- return _util[key];
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
76
7
  }
77
- });
78
- });
79
-
80
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
81
-
82
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
83
-
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.isRetryException = exports.isAuthNeededException = exports.RetryError = exports.AuthNeededError = exports.isUriLocation = exports.isAbstractMenuManager = exports.isAppRootModel = exports.isTrackViewModel = exports.isDisplayModel = exports.isTrackModel = exports.isViewModel = exports.isSelectionContainer = exports.isSessionWithSessionPlugins = exports.isSessionModelWithConnections = exports.isSessionModelWithWidgets = exports.isSessionWithAddTracks = exports.isSessionModelWithConfigEditing = exports.isSessionModel = exports.isViewContainer = void 0;
21
+ const mobx_state_tree_1 = require("mobx-state-tree");
22
+ const TextSearchManager_1 = __importDefault(require("../../TextSearch/TextSearchManager"));
23
+ __exportStar(require("./util"), exports);
84
24
  function isViewContainer(thing) {
85
- return (0, _mobxStateTree.isStateTreeNode)(thing) && 'removeView' in thing && 'addView' in thing && 'views' in thing;
25
+ return ((0, mobx_state_tree_1.isStateTreeNode)(thing) &&
26
+ 'removeView' in thing &&
27
+ 'addView' in thing &&
28
+ 'views' in thing);
86
29
  }
87
-
30
+ exports.isViewContainer = isViewContainer;
88
31
  function isSessionModel(thing) {
89
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'rpcManager' in thing && 'configuration' in thing;
32
+ return (typeof thing === 'object' &&
33
+ thing !== null &&
34
+ 'rpcManager' in thing &&
35
+ 'configuration' in thing);
90
36
  }
91
- /** abstract interface for a session allows editing configurations */
92
-
93
-
37
+ exports.isSessionModel = isSessionModel;
94
38
  function isSessionModelWithConfigEditing(thing) {
95
- return isSessionModel(thing) && 'editConfiguration' in thing;
39
+ return isSessionModel(thing) && 'editConfiguration' in thing;
96
40
  }
97
- /** abstract interface for a session allows adding tracks */
98
-
99
-
41
+ exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
100
42
  function isSessionWithAddTracks(thing) {
101
- return isSessionModel(thing) && 'addTrackConf' in thing;
43
+ return isSessionModel(thing) && 'addTrackConf' in thing;
102
44
  }
103
-
45
+ exports.isSessionWithAddTracks = isSessionWithAddTracks;
104
46
  function isSessionModelWithWidgets(thing) {
105
- return isSessionModel(thing) && 'widgets' in thing;
47
+ return isSessionModel(thing) && 'widgets' in thing;
106
48
  }
107
-
49
+ exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
108
50
  function isSessionModelWithConnections(thing) {
109
- return isSessionModel(thing) && 'addConnectionConf' in thing;
51
+ return isSessionModel(thing) && 'addConnectionConf' in thing;
110
52
  }
111
-
53
+ exports.isSessionModelWithConnections = isSessionModelWithConnections;
112
54
  function isSessionWithSessionPlugins(thing) {
113
- return isSessionModel(thing) && 'sessionPlugins' in thing;
55
+ return isSessionModel(thing) && 'sessionPlugins' in thing;
114
56
  }
115
- /** abstract interface for a session that manages a global selection */
116
-
117
-
57
+ exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
118
58
  function isSelectionContainer(thing) {
119
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'selection' in thing && 'setSelection' in thing;
59
+ return (typeof thing === 'object' &&
60
+ thing !== null &&
61
+ 'selection' in thing &&
62
+ 'setSelection' in thing);
120
63
  }
121
- /** minimum interface that all view state models must implement */
122
-
123
-
64
+ exports.isSelectionContainer = isSelectionContainer;
124
65
  function isViewModel(thing) {
125
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'width' in thing && 'setWidth' in thing;
66
+ return (typeof thing === 'object' &&
67
+ thing !== null &&
68
+ 'width' in thing &&
69
+ 'setWidth' in thing);
126
70
  }
127
-
71
+ exports.isViewModel = isViewModel;
128
72
  function isTrackModel(thing) {
129
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'configuration' in thing && // @ts-ignore
130
- thing.configuration.trackId;
73
+ return (typeof thing === 'object' &&
74
+ thing !== null &&
75
+ 'configuration' in thing &&
76
+ // @ts-ignore
77
+ thing.configuration.trackId);
131
78
  }
132
-
79
+ exports.isTrackModel = isTrackModel;
133
80
  function isDisplayModel(thing) {
134
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'configuration' in thing && // @ts-ignore
135
- thing.configuration.displayId;
81
+ return (typeof thing === 'object' &&
82
+ thing !== null &&
83
+ 'configuration' in thing &&
84
+ // @ts-ignore
85
+ thing.configuration.displayId);
136
86
  }
137
-
87
+ exports.isDisplayModel = isDisplayModel;
138
88
  function isTrackViewModel(thing) {
139
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'showTrack' in thing && 'hideTrack' in thing;
89
+ return (typeof thing === 'object' &&
90
+ thing !== null &&
91
+ 'showTrack' in thing &&
92
+ 'hideTrack' in thing);
140
93
  }
141
- /** minimum interface for the root MST model of a JBrowse app */
142
-
143
-
94
+ exports.isTrackViewModel = isTrackViewModel;
144
95
  function isAppRootModel(thing) {
145
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'isAssemblyEditing' in thing && 'findAppropriateInternetAccount' in thing;
96
+ return (typeof thing === 'object' &&
97
+ thing !== null &&
98
+ 'isAssemblyEditing' in thing &&
99
+ 'findAppropriateInternetAccount' in thing);
146
100
  }
147
- /** a root model that manages global menus */
148
-
149
-
101
+ exports.isAppRootModel = isAppRootModel;
150
102
  function isAbstractMenuManager(thing) {
151
- return (0, _typeof2.default)(thing) === 'object' && thing !== null && 'appendMenu' in thing && 'appendToSubMenu' in thing;
152
- } // Empty interfaces required by mobx-state-tree
153
- // See https://mobx-state-tree.js.org/tips/typescript#using-a-mst-type-at-design-time
154
-
155
- /* eslint-disable @typescript-eslint/no-empty-interface */
156
-
157
-
103
+ return (typeof thing === 'object' &&
104
+ thing !== null &&
105
+ 'appendMenu' in thing &&
106
+ 'appendToSubMenu' in thing);
107
+ }
108
+ exports.isAbstractMenuManager = isAbstractMenuManager;
158
109
  function isUriLocation(location) {
159
- return (0, _typeof2.default)(location) === 'object' && location !== null && 'locationType' in location && 'uri' in location;
160
- }
161
-
162
- var AuthNeededError = /*#__PURE__*/function (_Error) {
163
- (0, _inherits2.default)(AuthNeededError, _Error);
164
-
165
- var _super = _createSuper(AuthNeededError);
166
-
167
- function AuthNeededError(message, url) {
168
- var _this;
169
-
170
- (0, _classCallCheck2.default)(this, AuthNeededError);
171
- _this = _super.call(this, message);
172
- _this.message = message;
173
- _this.url = url;
174
- _this.name = 'AuthNeededError';
175
- Object.setPrototypeOf((0, _assertThisInitialized2.default)(_this), AuthNeededError.prototype);
176
- return _this;
177
- }
178
-
179
- return (0, _createClass2.default)(AuthNeededError);
180
- }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
181
-
110
+ return typeof location === 'object' && location !== null && 'uri' in location;
111
+ }
112
+ exports.isUriLocation = isUriLocation;
113
+ class AuthNeededError extends Error {
114
+ constructor(message, url) {
115
+ super(message);
116
+ this.message = message;
117
+ this.url = url;
118
+ this.name = 'AuthNeededError';
119
+ Object.setPrototypeOf(this, AuthNeededError.prototype);
120
+ }
121
+ }
182
122
  exports.AuthNeededError = AuthNeededError;
183
-
184
- var RetryError = /*#__PURE__*/function (_Error2) {
185
- (0, _inherits2.default)(RetryError, _Error2);
186
-
187
- var _super2 = _createSuper(RetryError);
188
-
189
- function RetryError(message, internetAccountId) {
190
- var _this2;
191
-
192
- (0, _classCallCheck2.default)(this, RetryError);
193
- _this2 = _super2.call(this, message);
194
- _this2.message = message;
195
- _this2.internetAccountId = internetAccountId;
196
- _this2.name = 'RetryError';
197
- return _this2;
198
- }
199
-
200
- return (0, _createClass2.default)(RetryError);
201
- }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
202
-
123
+ class RetryError extends Error {
124
+ constructor(message, internetAccountId) {
125
+ super(message);
126
+ this.message = message;
127
+ this.internetAccountId = internetAccountId;
128
+ this.name = 'RetryError';
129
+ }
130
+ }
203
131
  exports.RetryError = RetryError;
204
-
205
132
  function isAuthNeededException(exception) {
206
- return exception instanceof Error && ( // DOMException
207
- exception.name === 'AuthNeededError' || exception.url !== undefined);
133
+ return (exception instanceof Error &&
134
+ // DOMException
135
+ (exception.name === 'AuthNeededError' ||
136
+ exception.url !== undefined));
208
137
  }
209
-
138
+ exports.isAuthNeededException = isAuthNeededException;
210
139
  function isRetryException(exception) {
211
- return (// DOMException
212
- exception.name === 'RetryError' || exception.internetAccountId !== undefined
213
- );
214
- }
140
+ return (
141
+ // DOMException
142
+ exception.name === 'RetryError' ||
143
+ exception.internetAccountId !== undefined);
144
+ }
145
+ exports.isRetryException = isRetryException;
package/util/types/mst.js CHANGED
@@ -1,153 +1,98 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.UriLocationRaw = exports.UriLocation = exports.Region = exports.PropTypes = exports.NoAssemblyRegion = exports.LocalPathLocation = exports.FileLocation = exports.ElementId = exports.BlobLocation = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
- var _shortid = _interopRequireDefault(require("shortid"));
15
-
16
- var _mobxStateTree = require("mobx-state-tree");
17
-
18
- var _propTypes = _interopRequireDefault(require("prop-types"));
19
-
20
- var _mobxReact = require("mobx-react");
21
-
22
- var _excluded = ["baseUri"],
23
- _excluded2 = ["locationType"];
24
-
25
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
-
27
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
-
29
- var ElementId = _mobxStateTree.types.optional(_mobxStateTree.types.identifier, _shortid.default.generate); // PropTypes that are useful when working with instances of these in react components
30
-
31
-
32
- exports.ElementId = ElementId;
33
- var PropTypes = {
34
- Region: _propTypes.default.shape({
35
- refName: _propTypes.default.string.isRequired,
36
- start: _propTypes.default.number.isRequired,
37
- end: _propTypes.default.number.isRequired
38
- }),
39
- ConfigSchema: _mobxReact.PropTypes.objectOrObservableObject,
40
- Feature: _propTypes.default.shape({
41
- get: _propTypes.default.func.isRequired,
42
- id: _propTypes.default.func.isRequired
43
- })
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
44
4
  };
45
- exports.PropTypes = PropTypes;
46
-
47
- var NoAssemblyRegion = _mobxStateTree.types.model('NoAssemblyRegion', {
48
- refName: _mobxStateTree.types.string,
49
- start: _mobxStateTree.types.number,
50
- end: _mobxStateTree.types.number,
51
- reversed: _mobxStateTree.types.optional(_mobxStateTree.types.boolean, false)
52
- }).actions(function (self) {
53
- return {
54
- setRefName: function setRefName(newRefName) {
55
- self.refName = newRefName;
56
- }
57
- };
58
- });
59
-
60
- exports.NoAssemblyRegion = NoAssemblyRegion;
61
-
62
- var Region = _mobxStateTree.types.compose('Region', NoAssemblyRegion, _mobxStateTree.types.model({
63
- assemblyName: _mobxStateTree.types.string
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FileLocation = exports.UriLocation = exports.UriLocationRaw = exports.BlobLocation = exports.LocalPathLocation = exports.Region = exports.NoAssemblyRegion = exports.PropTypes = exports.ElementId = void 0;
7
+ const shortid_1 = __importDefault(require("shortid"));
8
+ const mobx_state_tree_1 = require("mobx-state-tree");
9
+ const prop_types_1 = __importDefault(require("prop-types"));
10
+ const mobx_react_1 = require("mobx-react");
11
+ exports.ElementId = mobx_state_tree_1.types.optional(mobx_state_tree_1.types.identifier, shortid_1.default.generate);
12
+ // PropTypes that are useful when working with instances of these in react components
13
+ exports.PropTypes = {
14
+ Region: prop_types_1.default.shape({
15
+ refName: prop_types_1.default.string.isRequired,
16
+ start: prop_types_1.default.number.isRequired,
17
+ end: prop_types_1.default.number.isRequired,
18
+ }),
19
+ ConfigSchema: mobx_react_1.PropTypes.objectOrObservableObject,
20
+ Feature: prop_types_1.default.shape({
21
+ get: prop_types_1.default.func.isRequired,
22
+ id: prop_types_1.default.func.isRequired,
23
+ }),
24
+ };
25
+ exports.NoAssemblyRegion = mobx_state_tree_1.types
26
+ .model('NoAssemblyRegion', {
27
+ refName: mobx_state_tree_1.types.string,
28
+ start: mobx_state_tree_1.types.number,
29
+ end: mobx_state_tree_1.types.number,
30
+ reversed: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, false),
31
+ })
32
+ .actions(self => ({
33
+ setRefName(newRefName) {
34
+ self.refName = newRefName;
35
+ },
64
36
  }));
65
-
66
- exports.Region = Region;
67
-
68
- var LocalPathLocation = _mobxStateTree.types.model('LocalPathLocation', {
69
- locationType: _mobxStateTree.types.literal('LocalPathLocation'),
70
- localPath: _mobxStateTree.types.string
71
- }); // like how blobId is used to get a blob map
72
-
73
-
74
- exports.LocalPathLocation = LocalPathLocation;
75
-
76
- var BlobLocation = _mobxStateTree.types.model('BlobLocation', {
77
- locationType: _mobxStateTree.types.literal('BlobLocation'),
78
- name: _mobxStateTree.types.string,
79
- blobId: _mobxStateTree.types.string
37
+ exports.Region = mobx_state_tree_1.types.compose('Region', exports.NoAssemblyRegion, mobx_state_tree_1.types.model({
38
+ assemblyName: mobx_state_tree_1.types.string,
39
+ }));
40
+ exports.LocalPathLocation = mobx_state_tree_1.types.model('LocalPathLocation', {
41
+ locationType: mobx_state_tree_1.types.literal('LocalPathLocation'),
42
+ localPath: mobx_state_tree_1.types.string,
43
+ });
44
+ // like how blobId is used to get a blob map
45
+ exports.BlobLocation = mobx_state_tree_1.types.model('BlobLocation', {
46
+ locationType: mobx_state_tree_1.types.literal('BlobLocation'),
47
+ name: mobx_state_tree_1.types.string,
48
+ blobId: mobx_state_tree_1.types.string,
80
49
  });
81
-
82
- exports.BlobLocation = BlobLocation;
83
-
84
- var UriLocationRaw = _mobxStateTree.types.model('UriLocation', {
85
- locationType: _mobxStateTree.types.literal('UriLocation'),
86
- uri: _mobxStateTree.types.string,
87
- baseUri: _mobxStateTree.types.maybe(_mobxStateTree.types.string),
88
- internetAccountId: _mobxStateTree.types.maybe(_mobxStateTree.types.string),
89
- // auths information (such as tokens) needed for using this resource.
90
- // if provided, these must be completely sufficient for using it
91
- internetAccountPreAuthorization: _mobxStateTree.types.maybe(_mobxStateTree.types.model('InternetAccountPreAuthorization', {
92
- internetAccountType: _mobxStateTree.types.string,
93
- authInfo: _mobxStateTree.types.frozen()
94
- }))
50
+ exports.UriLocationRaw = mobx_state_tree_1.types.model('UriLocation', {
51
+ locationType: mobx_state_tree_1.types.literal('UriLocation'),
52
+ uri: mobx_state_tree_1.types.string,
53
+ baseUri: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
54
+ internetAccountId: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
55
+ // auths information (such as tokens) needed for using this resource.
56
+ // if provided, these must be completely sufficient for using it
57
+ internetAccountPreAuthorization: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.model('InternetAccountPreAuthorization', {
58
+ internetAccountType: mobx_state_tree_1.types.string,
59
+ authInfo: mobx_state_tree_1.types.frozen(),
60
+ })),
95
61
  });
96
-
97
- exports.UriLocationRaw = UriLocationRaw;
98
-
99
- var UriLocation = _mobxStateTree.types.snapshotProcessor(UriLocationRaw, {
100
- postProcessor: function postProcessor(snap) {
101
- // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
102
- var _ref = snap,
103
- baseUri = _ref.baseUri,
104
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
105
-
106
- if (!baseUri) {
107
- return rest;
108
- }
109
-
110
- return snap;
111
- }
62
+ exports.UriLocation = mobx_state_tree_1.types.snapshotProcessor(exports.UriLocationRaw, {
63
+ postProcessor: snap => {
64
+ // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
65
+ const { baseUri, ...rest } = snap;
66
+ if (!baseUri) {
67
+ return rest;
68
+ }
69
+ return snap;
70
+ },
112
71
  });
113
-
114
- exports.UriLocation = UriLocation;
115
-
116
- var FileLocation = _mobxStateTree.types.snapshotProcessor(_mobxStateTree.types.union(LocalPathLocation, UriLocation, BlobLocation), {
117
- // @ts-ignore
118
- preProcessor: function preProcessor(snap) {
119
- if (!snap) {
120
- return undefined;
121
- } // @ts-ignore
122
- // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
123
-
124
-
125
- var _ref2 = snap,
126
- locationType = _ref2.locationType,
127
- rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
128
-
129
- if (!locationType) {
130
- // @ts-ignore
131
- var uri = rest.uri,
132
- localPath = rest.localPath,
133
- blob = rest.blob;
134
- var _locationType = '';
135
-
136
- if (uri !== undefined) {
137
- _locationType = 'UriLocation';
138
- } else if (localPath !== undefined) {
139
- _locationType = 'LocalPathLocation';
140
- } else if (blob !== undefined) {
141
- _locationType = 'BlobLocation';
142
- }
143
-
144
- return _objectSpread(_objectSpread({}, rest), {}, {
145
- locationType: _locationType
146
- });
147
- }
148
-
149
- return snap;
150
- }
72
+ exports.FileLocation = mobx_state_tree_1.types.snapshotProcessor(mobx_state_tree_1.types.union(exports.LocalPathLocation, exports.UriLocation, exports.BlobLocation), {
73
+ // @ts-ignore
74
+ preProcessor(snap) {
75
+ if (!snap) {
76
+ return undefined;
77
+ }
78
+ // @ts-ignore
79
+ // xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
80
+ const { locationType, ...rest } = snap;
81
+ if (!locationType) {
82
+ // @ts-ignore
83
+ const { uri, localPath, blob } = rest;
84
+ let locationType = '';
85
+ if (uri !== undefined) {
86
+ locationType = 'UriLocation';
87
+ }
88
+ else if (localPath !== undefined) {
89
+ locationType = 'LocalPathLocation';
90
+ }
91
+ else if (blob !== undefined) {
92
+ locationType = 'BlobLocation';
93
+ }
94
+ return { ...rest, locationType };
95
+ }
96
+ return snap;
97
+ },
151
98
  });
152
-
153
- exports.FileLocation = FileLocation;
@@ -1,5 +1,2 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ Object.defineProperty(exports, "__esModule", { value: true });