@jbrowse/core 1.7.11 → 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 (204) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +20 -4
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +313 -558
  3. package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -473
  4. package/BaseFeatureWidget/index.d.ts +2 -2
  5. package/BaseFeatureWidget/index.js +88 -124
  6. package/BaseFeatureWidget/types.d.ts +1 -0
  7. package/BaseFeatureWidget/types.js +1 -4
  8. package/BaseFeatureWidget/util.js +40 -75
  9. package/CorePlugin.js +55 -94
  10. package/Plugin.js +9 -34
  11. package/PluginLoader.js +153 -422
  12. package/PluginManager.d.ts +84 -117
  13. package/PluginManager.js +377 -666
  14. package/ReExports/Attributes.d.ts +2 -0
  15. package/ReExports/Attributes.js +5 -0
  16. package/ReExports/BaseCard.d.ts +2 -0
  17. package/ReExports/BaseCard.js +5 -0
  18. package/ReExports/DataGrid.d.ts +2 -0
  19. package/ReExports/DataGrid.js +6 -0
  20. package/ReExports/FeatureDetails.d.ts +2 -0
  21. package/ReExports/FeatureDetails.js +5 -0
  22. package/ReExports/index.js +6 -12
  23. package/ReExports/list.d.ts +5 -0
  24. package/ReExports/list.js +271 -7
  25. package/ReExports/material-ui-colors.d.ts +1 -19
  26. package/ReExports/material-ui-colors.js +16 -158
  27. package/ReExports/modules.d.ts +68 -109
  28. package/ReExports/modules.js +455 -244
  29. package/TextSearch/BaseResults.js +51 -123
  30. package/TextSearch/TextSearchManager.d.ts +3 -1
  31. package/TextSearch/TextSearchManager.js +66 -144
  32. package/assemblyManager/assembly.js +280 -554
  33. package/assemblyManager/assemblyConfigSchema.js +47 -64
  34. package/assemblyManager/assemblyManager.d.ts +12 -10
  35. package/assemblyManager/assemblyManager.js +126 -270
  36. package/assemblyManager/index.js +9 -22
  37. package/configuration/configurationSchema.js +167 -203
  38. package/configuration/configurationSlot.js +248 -326
  39. package/configuration/index.js +19 -35
  40. package/configuration/util.d.ts +1 -1
  41. package/configuration/util.js +131 -173
  42. package/data_adapters/BaseAdapter.d.ts +2 -2
  43. package/data_adapters/BaseAdapter.js +132 -521
  44. package/data_adapters/CytobandAdapter.js +40 -126
  45. package/data_adapters/dataAdapterCache.js +77 -158
  46. package/package.json +16 -18
  47. package/pluggableElementTypes/AdapterType.js +24 -79
  48. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
  49. package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
  50. package/pluggableElementTypes/ConnectionType.js +22 -65
  51. package/pluggableElementTypes/DisplayType.js +35 -82
  52. package/pluggableElementTypes/InternetAccountType.js +23 -64
  53. package/pluggableElementTypes/PluggableElementBase.js +8 -20
  54. package/pluggableElementTypes/RpcMethodType.js +85 -427
  55. package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
  56. package/pluggableElementTypes/TrackType.js +26 -70
  57. package/pluggableElementTypes/ViewType.js +21 -63
  58. package/pluggableElementTypes/WidgetType.js +21 -64
  59. package/pluggableElementTypes/index.d.ts +4 -3
  60. package/pluggableElementTypes/index.js +42 -125
  61. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
  62. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -10
  63. package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
  64. package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
  65. package/pluggableElementTypes/models/BaseTrackModel.js +139 -200
  66. package/pluggableElementTypes/models/BaseViewModel.js +24 -40
  67. package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
  68. package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
  69. package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
  70. package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
  71. package/pluggableElementTypes/models/index.js +21 -70
  72. package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
  73. package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
  74. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
  75. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
  76. package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -255
  77. package/pluggableElementTypes/renderers/RendererType.js +31 -105
  78. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
  79. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +2 -2
  80. package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
  81. package/pluggableElementTypes/renderers/index.js +19 -62
  82. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
  83. package/rpc/BaseRpcDriver.js +169 -405
  84. package/rpc/MainThreadRpcDriver.js +27 -150
  85. package/rpc/RpcManager.js +58 -159
  86. package/rpc/WebWorkerRpcDriver.js +54 -171
  87. package/rpc/configSchema.js +25 -49
  88. package/rpc/coreRpcMethods.d.ts +1 -3
  89. package/rpc/coreRpcMethods.js +221 -959
  90. package/rpc/remoteAbortSignals.js +46 -70
  91. package/tsconfig.build.tsbuildinfo +1 -1
  92. package/ui/AboutDialog.js +107 -158
  93. package/ui/App.js +157 -261
  94. package/ui/AssemblySelector.d.ts +1 -1
  95. package/ui/AssemblySelector.js +59 -115
  96. package/ui/CascadingMenu.js +100 -199
  97. package/ui/ColorPicker.d.ts +16 -0
  98. package/ui/ColorPicker.js +97 -0
  99. package/ui/Drawer.js +28 -58
  100. package/ui/DrawerWidget.js +109 -209
  101. package/ui/DropDownMenu.d.ts +0 -8
  102. package/ui/DropDownMenu.js +60 -97
  103. package/ui/EditableTypography.d.ts +1 -1
  104. package/ui/EditableTypography.js +87 -155
  105. package/ui/ErrorMessage.js +41 -66
  106. package/ui/FactoryResetDialog.js +24 -57
  107. package/ui/FatalErrorDialog.js +59 -91
  108. package/ui/FileSelector/FileSelector.js +123 -189
  109. package/ui/FileSelector/LocalFileChooser.js +44 -71
  110. package/ui/FileSelector/UrlChooser.js +17 -38
  111. package/ui/FileSelector/index.js +6 -12
  112. package/ui/Icons.d.ts +1 -1
  113. package/ui/Icons.js +45 -69
  114. package/ui/Logo.js +57 -110
  115. package/ui/Menu.d.ts +1 -1
  116. package/ui/Menu.js +232 -355
  117. package/ui/PrerenderedCanvas.js +63 -78
  118. package/ui/ResizeHandle.js +87 -114
  119. package/ui/ReturnToImportFormDialog.js +32 -59
  120. package/ui/SanitizedHTML.js +63 -52
  121. package/ui/Snackbar.js +74 -99
  122. package/ui/SnackbarModel.js +37 -51
  123. package/ui/Tooltip.d.ts +3 -1
  124. package/ui/Tooltip.js +49 -74
  125. package/ui/ViewContainer.js +113 -183
  126. package/ui/colors.d.ts +10 -0
  127. package/ui/colors.js +78 -0
  128. package/ui/index.js +51 -181
  129. package/ui/react-colorful.d.ts +17 -0
  130. package/ui/react-colorful.js +455 -0
  131. package/ui/theme.d.ts +279 -131
  132. package/ui/theme.js +197 -225
  133. package/util/Base1DUtils.d.ts +32 -0
  134. package/util/Base1DUtils.js +174 -0
  135. package/util/Base1DViewModel.d.ts +16 -37
  136. package/util/Base1DViewModel.js +116 -295
  137. package/util/QuickLRU.js +84 -332
  138. package/util/TimeTraveller.d.ts +19 -0
  139. package/util/TimeTraveller.js +86 -0
  140. package/util/aborting.js +49 -127
  141. package/util/analytics.js +91 -154
  142. package/util/blockTypes.js +106 -240
  143. package/util/calculateDynamicBlocks.js +98 -128
  144. package/util/calculateStaticBlocks.js +105 -125
  145. package/util/color/cssColorsLevel4.js +156 -160
  146. package/util/color/index.js +33 -55
  147. package/util/compositeMap.js +49 -333
  148. package/util/formatFastaStrings.js +9 -14
  149. package/util/idMaker.js +18 -31
  150. package/util/index.d.ts +18 -39
  151. package/util/index.js +743 -1236
  152. package/util/io/RemoteFileWithRangeCache.js +88 -257
  153. package/util/io/index.js +95 -169
  154. package/util/jexl.js +60 -115
  155. package/util/jexlStrings.js +24 -29
  156. package/util/layouts/BaseLayout.js +1 -4
  157. package/util/layouts/GranularRectLayout.js +388 -557
  158. package/util/layouts/MultiLayout.js +41 -109
  159. package/util/layouts/PrecomputedLayout.js +56 -114
  160. package/util/layouts/PrecomputedMultiLayout.js +22 -59
  161. package/util/layouts/SceneGraph.js +127 -197
  162. package/util/layouts/index.js +29 -66
  163. package/util/mst-reflection.js +55 -71
  164. package/util/offscreenCanvasPonyfill.js +66 -134
  165. package/util/offscreenCanvasUtils.d.ts +2 -7
  166. package/util/offscreenCanvasUtils.js +49 -146
  167. package/util/range.js +29 -40
  168. package/util/rxjs.js +20 -27
  169. package/util/simpleFeature.js +88 -152
  170. package/util/stats.js +91 -151
  171. package/util/tracks.js +130 -171
  172. package/util/types/index.d.ts +3 -3
  173. package/util/types/index.js +110 -179
  174. package/util/types/mst.d.ts +3 -3
  175. package/util/types/mst.js +91 -142
  176. package/util/types/util.js +1 -4
  177. package/util/when.js +54 -101
  178. package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
  179. package/BaseFeatureWidget/index.test.js +0 -51
  180. package/TextSearch/BaseResults.test.js +0 -42
  181. package/configuration/configurationSchema.test.js +0 -266
  182. package/configuration/configurationSlot.test.js +0 -69
  183. package/configuration/util.test.js +0 -39
  184. package/data_adapters/BaseAdapter.test.js +0 -200
  185. package/declare.d.js +0 -1
  186. package/pluggableElementTypes/RpcMethodType.test.js +0 -118
  187. package/pluggableElementTypes/renderers/declare.d.js +0 -1
  188. package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
  189. package/rpc/BaseRpcDriver.test.js +0 -540
  190. package/rpc/declaration.d.js +0 -1
  191. package/ui/FatalErrorDialog.test.js +0 -82
  192. package/ui/SanitizedHTML.test.js +0 -36
  193. package/ui/theme.test.js +0 -111
  194. package/util/Base1DViewModel.test.js +0 -130
  195. package/util/calculateDynamicBlocks.test.js +0 -74
  196. package/util/calculateStaticBlocks.test.js +0 -297
  197. package/util/declare.d.js +0 -1
  198. package/util/formatFastaStrings.test.js +0 -40
  199. package/util/index.test.js +0 -213
  200. package/util/jexlStrings.test.js +0 -48
  201. package/util/layouts/GranularRectLayout.test.js +0 -99
  202. package/util/range.test.js +0 -64
  203. package/util/simpleFeature.test.js +0 -34
  204. 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;
@@ -108,11 +108,11 @@ export declare const FileLocation: import("mobx-state-tree").ISnapshotProcessor<
108
108
  internetAccountType: import("mobx-state-tree").ISimpleType<string>;
109
109
  authInfo: import("mobx-state-tree").IType<any, any, any>;
110
110
  }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
111
- }>> | import("mobx-state-tree").ModelInstanceTypeProps<{
111
+ }>> | import("mobx-state-tree").ModelInstanceType<{
112
112
  locationType: import("mobx-state-tree").ISimpleType<"BlobLocation">;
113
113
  name: import("mobx-state-tree").ISimpleType<string>;
114
114
  blobId: import("mobx-state-tree").ISimpleType<string>;
115
- }> | import("mobx-state-tree").ModelInstanceTypeProps<{
115
+ }, {}> | import("mobx-state-tree").ModelInstanceType<{
116
116
  locationType: import("mobx-state-tree").ISimpleType<"LocalPathLocation">;
117
117
  localPath: import("mobx-state-tree").ISimpleType<string>;
118
- }>>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
118
+ }, {}>>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
package/util/types/mst.js CHANGED
@@ -1,149 +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
- var baseUri = snap.baseUri,
102
- rest = (0, _objectWithoutProperties2.default)(snap, _excluded);
103
-
104
- if (!baseUri) {
105
- return rest;
106
- }
107
-
108
- return snap;
109
- }
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
+ },
110
71
  });
111
-
112
- exports.UriLocation = UriLocation;
113
-
114
- var FileLocation = _mobxStateTree.types.snapshotProcessor(_mobxStateTree.types.union(LocalPathLocation, UriLocation, BlobLocation), {
115
- // @ts-ignore
116
- preProcessor: function preProcessor(snapshot) {
117
- if (!snapshot) {
118
- return undefined;
119
- } // @ts-ignore
120
-
121
-
122
- var locationType = snapshot.locationType,
123
- rest = (0, _objectWithoutProperties2.default)(snapshot, _excluded2);
124
-
125
- if (!locationType) {
126
- // @ts-ignore
127
- var uri = rest.uri,
128
- localPath = rest.localPath,
129
- blob = rest.blob;
130
- var _locationType = '';
131
-
132
- if (uri !== undefined) {
133
- _locationType = 'UriLocation';
134
- } else if (localPath !== undefined) {
135
- _locationType = 'LocalPathLocation';
136
- } else if (blob !== undefined) {
137
- _locationType = 'BlobLocation';
138
- }
139
-
140
- return _objectSpread(_objectSpread({}, rest), {}, {
141
- locationType: _locationType
142
- });
143
- }
144
-
145
- return snapshot;
146
- }
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
+ },
147
98
  });
148
-
149
- 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 });