@jbrowse/core 2.17.0 → 2.18.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 (308) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +1 -2
  2. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +4 -8
  3. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +1 -1
  4. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +1 -2
  5. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -3
  6. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +1 -1
  7. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +2 -3
  8. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +22 -25
  9. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -2
  10. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +6 -8
  11. package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +1 -1
  12. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
  13. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
  14. package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -1
  15. package/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -7
  16. package/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -5
  17. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -2
  18. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +0 -7
  19. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +2 -2
  20. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -7
  21. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -3
  22. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +24 -33
  23. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -2
  24. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +2 -2
  25. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +3 -4
  26. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +2 -2
  27. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +3 -6
  28. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -1
  29. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +1 -1
  30. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +2 -2
  31. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
  32. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
  33. package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -56
  34. package/BaseFeatureWidget/SequenceFeatureDetails/model.js +1 -56
  35. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +3 -3
  36. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +2 -2
  37. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +5 -6
  38. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +2 -2
  39. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +0 -1
  40. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +2 -2
  41. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +0 -2
  42. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +1 -1
  43. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +1 -3
  44. package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
  45. package/BaseFeatureWidget/stateModelFactory.d.ts +2 -93
  46. package/BaseFeatureWidget/stateModelFactory.js +3 -73
  47. package/BaseFeatureWidget/types.d.ts +3 -3
  48. package/BaseFeatureWidget/util.js +0 -4
  49. package/CorePlugin.d.ts +1 -1
  50. package/CorePlugin.js +2 -5
  51. package/Plugin.d.ts +2 -5
  52. package/Plugin.js +0 -3
  53. package/PluginLoader.d.ts +1 -1
  54. package/PluginLoader.js +2 -19
  55. package/PluginManager.d.ts +15 -31
  56. package/PluginManager.js +11 -39
  57. package/ReExports/DataGrid.js +0 -1
  58. package/ReExports/list.d.ts +0 -5
  59. package/ReExports/list.js +0 -5
  60. package/ReExports/modules.d.ts +22 -20
  61. package/ReExports/modules.js +16 -25
  62. package/TextSearch/BaseResults.d.ts +3 -3
  63. package/TextSearch/TextSearchManager.d.ts +4 -16
  64. package/TextSearch/TextSearchManager.js +1 -13
  65. package/assemblyManager/assembly.d.ts +5 -100
  66. package/assemblyManager/assembly.js +27 -143
  67. package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
  68. package/assemblyManager/assemblyConfigSchema.js +12 -46
  69. package/assemblyManager/assemblyManager.d.ts +7 -57
  70. package/assemblyManager/assemblyManager.js +2 -57
  71. package/configuration/configurationSchema.d.ts +4 -4
  72. package/configuration/configurationSchema.js +2 -14
  73. package/configuration/configurationSlot.d.ts +1 -12
  74. package/configuration/configurationSlot.js +2 -32
  75. package/configuration/index.d.ts +2 -2
  76. package/configuration/index.js +2 -2
  77. package/configuration/types.d.ts +2 -3
  78. package/configuration/util.d.ts +1 -25
  79. package/configuration/util.js +19 -56
  80. package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
  81. package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
  82. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +5 -114
  83. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +3 -79
  84. package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
  85. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
  86. package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
  87. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
  88. package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
  89. package/data_adapters/BaseAdapter/index.d.ts +4 -4
  90. package/data_adapters/BaseAdapter/types.d.ts +2 -2
  91. package/data_adapters/BaseAdapter/util.d.ts +6 -6
  92. package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +1 -1
  93. package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -2
  94. package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
  95. package/data_adapters/CytobandAdapter/configSchema.js +1 -7
  96. package/data_adapters/CytobandAdapter/index.d.ts +1 -1
  97. package/data_adapters/CytobandAdapter/index.js +1 -1
  98. package/data_adapters/dataAdapterCache.d.ts +4 -21
  99. package/data_adapters/dataAdapterCache.js +0 -19
  100. package/package.json +3 -4
  101. package/pluggableElementTypes/AdapterType.d.ts +2 -2
  102. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
  103. package/pluggableElementTypes/ConnectionType.d.ts +3 -3
  104. package/pluggableElementTypes/DisplayType.d.ts +3 -9
  105. package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
  106. package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
  107. package/pluggableElementTypes/PluggableElementBase.js +2 -2
  108. package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
  109. package/pluggableElementTypes/RpcMethodType.js +7 -19
  110. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
  111. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
  112. package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
  113. package/pluggableElementTypes/TrackType.d.ts +3 -3
  114. package/pluggableElementTypes/ViewType.d.ts +3 -3
  115. package/pluggableElementTypes/WidgetType.d.ts +4 -3
  116. package/pluggableElementTypes/index.d.ts +11 -11
  117. package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
  118. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
  119. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
  120. package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
  121. package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
  122. package/pluggableElementTypes/models/BaseTrackModel.js +0 -58
  123. package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
  124. package/pluggableElementTypes/models/BaseViewModel.js +2 -38
  125. package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
  126. package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
  127. package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
  128. package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
  129. package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
  130. package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
  131. package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
  132. package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
  133. package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
  134. package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
  135. package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +3 -2
  136. package/pluggableElementTypes/renderers/CircularChordRendererType.js +1 -6
  137. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
  138. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
  139. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
  140. package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
  141. package/pluggableElementTypes/renderers/RendererType.d.ts +4 -8
  142. package/pluggableElementTypes/renderers/RendererType.js +1 -5
  143. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -2
  144. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +3 -12
  145. package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
  146. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +6 -14
  147. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
  148. package/pluggableElementTypes/renderers/ServerSideRendererType.js +7 -57
  149. package/pluggableElementTypes/renderers/index.d.ts +1 -1
  150. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
  151. package/rpc/BaseRpcDriver.d.ts +3 -4
  152. package/rpc/BaseRpcDriver.js +20 -80
  153. package/rpc/MainThreadRpcDriver.d.ts +3 -7
  154. package/rpc/MainThreadRpcDriver.js +0 -5
  155. package/rpc/RpcManager.d.ts +3 -3
  156. package/rpc/RpcManager.js +2 -4
  157. package/rpc/WebWorkerRpcDriver.d.ts +3 -2
  158. package/rpc/WebWorkerRpcDriver.js +2 -13
  159. package/rpc/baseRpcConfig.d.ts +0 -3
  160. package/rpc/baseRpcConfig.js +1 -7
  161. package/rpc/configSchema.d.ts +0 -6
  162. package/rpc/configSchema.js +2 -11
  163. package/rpc/mainThreadRpcConfig.js +1 -7
  164. package/rpc/methods/CoreFreeResources.d.ts +0 -6
  165. package/rpc/methods/CoreFreeResources.js +2 -9
  166. package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
  167. package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
  168. package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
  169. package/rpc/methods/CoreGetFeatureDetails.js +0 -5
  170. package/rpc/methods/CoreGetFeatures.d.ts +5 -5
  171. package/rpc/methods/CoreGetFeatures.js +4 -5
  172. package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
  173. package/rpc/methods/CoreGetFileInfo.js +1 -1
  174. package/rpc/methods/CoreGetMetadata.d.ts +1 -2
  175. package/rpc/methods/CoreGetMetadata.js +1 -1
  176. package/rpc/methods/CoreGetRefNames.d.ts +1 -2
  177. package/rpc/methods/CoreGetRefNames.js +1 -1
  178. package/rpc/methods/CoreRender.d.ts +2 -6
  179. package/rpc/methods/CoreRender.js +5 -7
  180. package/rpc/methods/util.d.ts +3 -3
  181. package/rpc/methods/util.js +0 -1
  182. package/rpc/webWorkerRpcConfig.js +1 -7
  183. package/stories/JBrowseCore.stories.d.ts +1 -1
  184. package/stories/JBrowseCore.stories.js +3 -3
  185. package/stories/examples/WithSequencePanel.d.ts +1 -1
  186. package/stories/examples/WithSequencePanel.js +3 -3
  187. package/tsconfig.build.tsbuildinfo +1 -1
  188. package/ui/AppLogo.d.ts +1 -1
  189. package/ui/AppLogo.js +0 -2
  190. package/ui/AssemblySelector.d.ts +2 -2
  191. package/ui/AssemblySelector.js +0 -3
  192. package/ui/BaseTooltip.js +2 -6
  193. package/ui/CascadingMenu.d.ts +2 -2
  194. package/ui/CascadingMenu.js +3 -4
  195. package/ui/CascadingMenuButton.d.ts +1 -1
  196. package/ui/CascadingMenuButton.js +1 -1
  197. package/ui/ColorPicker.js +1 -7
  198. package/ui/Dialog.d.ts +1 -1
  199. package/ui/Dialog.js +2 -6
  200. package/ui/DropDownMenu.d.ts +1 -1
  201. package/ui/DropDownMenu.js +2 -2
  202. package/ui/EditableTypography.d.ts +1 -1
  203. package/ui/EditableTypography.js +1 -5
  204. package/ui/ErrorBoundary.d.ts +2 -1
  205. package/ui/ErrorMessage.js +2 -9
  206. package/ui/ErrorMessageStackTraceDialog.js +2 -10
  207. package/ui/FactoryResetDialog.js +1 -1
  208. package/ui/FatalErrorDialog.js +1 -1
  209. package/ui/FileSelector/FileSelector.d.ts +4 -3
  210. package/ui/FileSelector/FileSelector.js +40 -40
  211. package/ui/FileSelector/LocalFileChooser.d.ts +1 -1
  212. package/ui/FileSelector/LocalFileChooser.js +0 -1
  213. package/ui/FileSelector/UrlChooser.d.ts +4 -3
  214. package/ui/FileSelector/UrlChooser.js +5 -3
  215. package/ui/Icons.d.ts +1 -1
  216. package/ui/Icons.js +1 -7
  217. package/ui/LoadingEllipses.d.ts +1 -1
  218. package/ui/LoadingEllipses.js +3 -3
  219. package/ui/Menu.d.ts +1 -1
  220. package/ui/Menu.js +3 -10
  221. package/ui/MenuButton.d.ts +1 -1
  222. package/ui/ResizeHandle.js +2 -2
  223. package/ui/ReturnToImportFormDialog.js +1 -1
  224. package/ui/SanitizedHTML.js +1 -21
  225. package/ui/Snackbar.d.ts +2 -2
  226. package/ui/Snackbar.js +1 -2
  227. package/ui/SnackbarModel.d.ts +1 -26
  228. package/ui/SnackbarModel.js +2 -30
  229. package/ui/colors.d.ts +1 -1
  230. package/ui/colors.js +1 -1
  231. package/ui/react-colorful.js +0 -3
  232. package/ui/theme.d.ts +1 -1
  233. package/ui/theme.js +0 -40
  234. package/util/Base1DUtils.d.ts +1 -1
  235. package/util/Base1DUtils.js +0 -12
  236. package/util/Base1DViewModel.d.ts +4 -81
  237. package/util/Base1DViewModel.js +4 -108
  238. package/util/QuickLRU.js +0 -9
  239. package/util/TimeTraveller.js +0 -4
  240. package/util/aborting.d.ts +0 -20
  241. package/util/aborting.js +0 -31
  242. package/util/analytics.js +1 -12
  243. package/util/blockTypes.d.ts +0 -11
  244. package/util/blockTypes.js +0 -13
  245. package/util/calculateDynamicBlocks.d.ts +1 -20
  246. package/util/calculateDynamicBlocks.js +1 -22
  247. package/util/calculateStaticBlocks.d.ts +2 -2
  248. package/util/calculateStaticBlocks.js +0 -2
  249. package/util/color/cssColorsLevel4.js +0 -1
  250. package/util/color/index.d.ts +0 -19
  251. package/util/color/index.js +0 -30
  252. package/util/compositeMap.js +0 -2
  253. package/util/dedupe.js +0 -1
  254. package/util/formatFastaStrings.d.ts +0 -13
  255. package/util/formatFastaStrings.js +0 -13
  256. package/util/idMaker.d.ts +1 -1
  257. package/util/idMaker.js +16 -12
  258. package/util/index.d.ts +16 -164
  259. package/util/index.js +22 -282
  260. package/util/io/RemoteFileWithRangeCache.d.ts +3 -2
  261. package/util/io/RemoteFileWithRangeCache.js +6 -10
  262. package/util/io/index.d.ts +3 -4
  263. package/util/io/index.js +3 -17
  264. package/util/jexl.js +3 -13
  265. package/util/jexlStrings.d.ts +0 -6
  266. package/util/jexlStrings.js +0 -8
  267. package/util/layouts/BaseLayout.d.ts +1 -1
  268. package/util/layouts/GranularRectLayout.d.ts +1 -17
  269. package/util/layouts/GranularRectLayout.js +4 -81
  270. package/util/layouts/MultiLayout.d.ts +1 -6
  271. package/util/layouts/MultiLayout.js +0 -6
  272. package/util/layouts/PrecomputedLayout.d.ts +1 -4
  273. package/util/layouts/PrecomputedLayout.js +0 -5
  274. package/util/layouts/PrecomputedMultiLayout.js +0 -2
  275. package/util/layouts/SceneGraph.d.ts +0 -12
  276. package/util/layouts/SceneGraph.js +0 -13
  277. package/util/makeAbortableReaction.d.ts +2 -0
  278. package/util/makeAbortableReaction.js +50 -0
  279. package/util/map-obj.js +0 -4
  280. package/util/mst-reflection.d.ts +1 -14
  281. package/util/mst-reflection.js +1 -28
  282. package/util/nanoid.js +0 -31
  283. package/util/nextTick.d.ts +1 -0
  284. package/util/nextTick.js +6 -0
  285. package/util/offscreenCanvasPonyfill.d.ts +0 -1
  286. package/util/offscreenCanvasPonyfill.js +1 -9
  287. package/util/offscreenCanvasUtils.js +1 -8
  288. package/util/range.d.ts +0 -25
  289. package/util/range.js +0 -34
  290. package/util/rxjs.d.ts +3 -7
  291. package/util/rxjs.js +2 -9
  292. package/util/simpleFeature.d.ts +0 -50
  293. package/util/simpleFeature.js +0 -35
  294. package/util/stats.d.ts +3 -26
  295. package/util/stats.js +0 -25
  296. package/util/stopToken.d.ts +3 -0
  297. package/util/stopToken.js +29 -0
  298. package/util/tracks.d.ts +3 -25
  299. package/util/tracks.js +0 -30
  300. package/util/types/index.d.ts +14 -30
  301. package/util/types/index.js +5 -14
  302. package/util/types/mst.js +0 -9
  303. package/util/types/util.d.ts +2 -9
  304. package/util/useMeasure.js +0 -1
  305. package/util/when.d.ts +1 -15
  306. package/util/when.js +3 -70
  307. package/rpc/remoteAbortSignals.d.ts +0 -36
  308. package/rpc/remoteAbortSignals.js +0 -79
package/util/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.blobToDataURL = exports.SimpleFeature = exports.isFeature = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.rIC = exports.complementTable = exports.isElectron = void 0;
20
+ exports.makeAbortableReaction = exports.blobToDataURL = exports.isFeature = exports.SimpleFeature = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.rIC = exports.complementTable = exports.isElectron = void 0;
21
21
  exports.useDebounce = useDebounce;
22
22
  exports.useWidthSetter = useWidthSetter;
23
23
  exports.useDebouncedCallback = useDebouncedCallback;
@@ -45,7 +45,6 @@ exports.bpSpanPx = bpSpanPx;
45
45
  exports.iterMap = iterMap;
46
46
  exports.findLastIndex = findLastIndex;
47
47
  exports.findLast = findLast;
48
- exports.makeAbortableReaction = makeAbortableReaction;
49
48
  exports.renameRegionIfNeeded = renameRegionIfNeeded;
50
49
  exports.renameRegionsIfNeeded = renameRegionsIfNeeded;
51
50
  exports.minmax = minmax;
@@ -58,6 +57,7 @@ exports.measureText = measureText;
58
57
  exports.getFrame = getFrame;
59
58
  exports.generateCodonTable = generateCodonTable;
60
59
  exports.updateStatus = updateStatus;
60
+ exports.updateStatus2 = updateStatus2;
61
61
  exports.hashCode = hashCode;
62
62
  exports.objectHash = objectHash;
63
63
  exports.bytesForRegions = bytesForRegions;
@@ -91,20 +91,15 @@ exports.renderToStaticMarkup = renderToStaticMarkup;
91
91
  exports.isGzip = isGzip;
92
92
  exports.fetchAndMaybeUnzip = fetchAndMaybeUnzip;
93
93
  const react_1 = require("react");
94
+ const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
95
+ const useMeasure_1 = __importDefault(require("@jbrowse/core/util/useMeasure"));
94
96
  const is_object_1 = __importDefault(require("is-object"));
95
97
  const mobx_state_tree_1 = require("mobx-state-tree");
96
- const mobx_1 = require("mobx");
97
- const types_1 = require("./types");
98
- const aborting_1 = require("./aborting");
99
- const types_2 = require("./types");
100
- // has to be the full path and not the relative path to get the jest mock
101
- const useMeasure_1 = __importDefault(require("@jbrowse/core/util/useMeasure"));
102
- const colord_1 = require("./colord");
103
- // eslint-disable-next-line react/no-deprecated
104
98
  const react_dom_1 = require("react-dom");
105
- const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
99
+ const colord_1 = require("./colord");
100
+ const stopToken_1 = require("./stopToken");
101
+ const types_1 = require("./types");
106
102
  __exportStar(require("./types"), exports);
107
- __exportStar(require("./aborting"), exports);
108
103
  __exportStar(require("./when"), exports);
109
104
  __exportStar(require("./range"), exports);
110
105
  __exportStar(require("./dedupe"), exports);
@@ -122,14 +117,10 @@ function useDebounce(value, delay) {
122
117
  }, [value, delay]);
123
118
  return debouncedValue;
124
119
  }
125
- // used in ViewContainer files to get the width
126
120
  function useWidthSetter(view, padding) {
127
121
  const [ref, { width }] = (0, useMeasure_1.default)();
128
122
  (0, react_1.useEffect)(() => {
129
123
  if (width && (0, mobx_state_tree_1.isAlive)(view)) {
130
- // sets after a requestAnimationFrame
131
- // https://stackoverflow.com/a/58701523/2129219
132
- // avoids ResizeObserver loop error being shown during development
133
124
  requestAnimationFrame(() => {
134
125
  view.setWidth(width - Number.parseInt(padding, 10) * 2);
135
126
  });
@@ -137,26 +128,19 @@ function useWidthSetter(view, padding) {
137
128
  }, [padding, view, width]);
138
129
  return ref;
139
130
  }
140
- // https://stackoverflow.com/questions/56283920/
141
131
  function useDebouncedCallback(callback, wait = 400) {
142
- // track args & timeout handle between calls
143
132
  const argsRef = (0, react_1.useRef)();
144
133
  const timeout = (0, react_1.useRef)();
145
- // make sure our timeout gets cleared if our consuming component gets
146
- // unmounted
147
134
  (0, react_1.useEffect)(() => {
148
135
  if (timeout.current) {
149
136
  clearTimeout(timeout.current);
150
137
  }
151
138
  }, []);
152
139
  return function debouncedCallback(...args) {
153
- // capture latest args
154
140
  argsRef.current = args;
155
- // clear debounce timer
156
141
  if (timeout.current) {
157
142
  clearTimeout(timeout.current);
158
143
  }
159
- // start waiting again
160
144
  timeout.current = setTimeout(() => {
161
145
  if (argsRef.current) {
162
146
  callback(...argsRef.current);
@@ -164,9 +148,6 @@ function useDebouncedCallback(callback, wait = 400) {
164
148
  }, wait);
165
149
  };
166
150
  }
167
- /**
168
- * find the first node in the hierarchy that matches the given predicate
169
- */
170
151
  function findParentThat(node, predicate) {
171
152
  if (!(0, mobx_state_tree_1.hasParent)(node)) {
172
153
  throw new Error('node does not have parent');
@@ -185,7 +166,6 @@ function findParentThat(node, predicate) {
185
166
  }
186
167
  throw new Error('no matching node found');
187
168
  }
188
- // based on https://github.com/react-spring/react-spring/blob/cd5548a987383b8023efd620f3726a981f9e18ea/src/animated/FrameLoop.ts
189
169
  function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, precision = 0, tension = 400, friction = 20, clamp = true) {
190
170
  const mass = 1;
191
171
  if (!precision) {
@@ -197,11 +177,9 @@ function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, preci
197
177
  let position = animation.lastPosition;
198
178
  let lastTime = animation.lastTime || time;
199
179
  let velocity = animation.lastVelocity || 0;
200
- // If we lost a lot of frames just jump to the end.
201
180
  if (time > lastTime + 64) {
202
181
  lastTime = time;
203
182
  }
204
- // http://gafferongames.com/game-physics/fix-your-timestep/
205
183
  const numSteps = Math.floor(time - lastTime);
206
184
  for (let i = 0; i < numSteps; ++i) {
207
185
  const force = -tension * (position - toValue);
@@ -242,17 +220,9 @@ function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, preci
242
220
  },
243
221
  ];
244
222
  }
245
- /**
246
- * find the first node in the hierarchy that matches the given 'is' typescript
247
- * type guard predicate
248
- */
249
223
  function findParentThatIs(node, predicate) {
250
224
  return findParentThat(node, predicate);
251
225
  }
252
- /**
253
- * get the current JBrowse session model, starting at any node in the state
254
- * tree
255
- */
256
226
  function getSession(node) {
257
227
  try {
258
228
  return findParentThatIs(node, types_1.isSessionModel);
@@ -261,10 +231,6 @@ function getSession(node) {
261
231
  throw new Error('no session model found!');
262
232
  }
263
233
  }
264
- /**
265
- * get the state model of the view in the state tree that contains the given
266
- * node
267
- */
268
234
  function getContainingView(node) {
269
235
  try {
270
236
  return findParentThatIs(node, types_1.isViewModel);
@@ -273,10 +239,6 @@ function getContainingView(node) {
273
239
  throw new Error('no containing view found');
274
240
  }
275
241
  }
276
- /**
277
- * get the state model of the view in the state tree that contains the given
278
- * node
279
- */
280
242
  function getContainingTrack(node) {
281
243
  try {
282
244
  return findParentThatIs(node, types_1.isTrackModel);
@@ -285,10 +247,6 @@ function getContainingTrack(node) {
285
247
  throw new Error('no containing track found');
286
248
  }
287
249
  }
288
- /**
289
- * get the state model of the display in the state tree that contains the given
290
- * node
291
- */
292
250
  function getContainingDisplay(node) {
293
251
  try {
294
252
  return findParentThatIs(node, types_1.isDisplayModel);
@@ -297,46 +255,9 @@ function getContainingDisplay(node) {
297
255
  throw new Error('no containing display found');
298
256
  }
299
257
  }
300
- /**
301
- * Assemble a 1-based "locString" from an interbase genomic location
302
- * @param region - Region
303
- * @example
304
- * ```ts
305
- * assembleLocString({ refName: 'chr1', start: 0, end: 100 })
306
- * // ↳ 'chr1:1..100'
307
- * ```
308
- * @example
309
- * ```ts
310
- * assembleLocString({ assemblyName: 'hg19', refName: 'chr1', start: 0, end: 100 })
311
- * // ↳ '{hg19}chr1:1..100'
312
- * ```
313
- * @example
314
- * ```ts
315
- * assembleLocString({ refName: 'chr1' })
316
- * // ↳ 'chr1'
317
- * ```
318
- * @example
319
- * ```ts
320
- * assembleLocString({ refName: 'chr1', start: 0 })
321
- * // ↳ 'chr1:1..'
322
- * ```
323
- * @example
324
- * ```ts
325
- * assembleLocString({ refName: 'chr1', end: 100 })
326
- * // ↳ 'chr1:1..100'
327
- * ```
328
- * @example
329
- * ```ts
330
- * assembleLocString({ refName: 'chr1', start: 0, end: 1 })
331
- * // ↳ 'chr1:1'
332
- * ```
333
- */
334
258
  function assembleLocString(region) {
335
259
  return assembleLocStringFast(region, toLocale);
336
260
  }
337
- // same as assembleLocString above, but does not perform toLocaleString which
338
- // can slow down the speed of block calculations which use assembleLocString
339
- // for block.key
340
261
  function assembleLocStringFast(region, cb = (n) => n) {
341
262
  const { assemblyName, refName, start, end, reversed } = region;
342
263
  const assemblyNameString = assemblyName ? `{${assemblyName}}` : '';
@@ -372,10 +293,7 @@ function parseLocStringOneBased(locString, isValidRefName) {
372
293
  reversed = true;
373
294
  locString = locString.replace(/\[rev]$/, '');
374
295
  }
375
- // remove any whitespace
376
296
  locString = locString.replace(/\s/, '');
377
- // refNames can have colons, refer to
378
- // https://samtools.github.io/hts-specs/SAMv1.pdf Appendix A
379
297
  const assemblyMatch = /({(.+)})?(.+)/.exec(locString);
380
298
  if (!assemblyMatch) {
381
299
  throw new Error(`invalid location string: "${locString}"`);
@@ -405,9 +323,7 @@ function parseLocStringOneBased(locString, isValidRefName) {
405
323
  }
406
324
  else if (isValidRefName(prefix, assemblyName)) {
407
325
  if (suffix) {
408
- // see if it's a range
409
326
  const rangeMatch = /^(-?(\d+|\d{1,3}(,\d{3})*))(\.\.|-)(-?(\d+|\d{1,3}(,\d{3})*))$/.exec(suffix);
410
- // see if it's a single point
411
327
  const singleMatch = /^(-?(\d+|\d{1,3}(,\d{3})*))(\.\.|-)?$/.exec(suffix);
412
328
  if (rangeMatch) {
413
329
  const [, start, , , , end] = rangeMatch;
@@ -425,7 +341,6 @@ function parseLocStringOneBased(locString, isValidRefName) {
425
341
  const [, start, , , separator] = singleMatch;
426
342
  if (start !== undefined) {
427
343
  if (separator) {
428
- // indefinite end
429
344
  return {
430
345
  assemblyName,
431
346
  refName: prefix,
@@ -463,43 +378,6 @@ function parseLocStringOneBased(locString, isValidRefName) {
463
378
  }
464
379
  throw new Error(`unknown reference sequence name in location "${locString}"`);
465
380
  }
466
- /**
467
- * Parse a 1-based location string into an interbase genomic location
468
- * @param locString - Location string
469
- * @param isValidRefName - Function that checks if a refName exists in the set
470
- * of all known refNames, or in the set of refNames for an assembly if
471
- * assemblyName is given
472
- * @example
473
- * ```ts
474
- * parseLocString('chr1:1..100', isValidRefName)
475
- * // ↳ { refName: 'chr1', start: 0, end: 100 }
476
- * ```
477
- * @example
478
- * ```ts
479
- * parseLocString('chr1:1-100', isValidRefName)
480
- * // ↳ { refName: 'chr1', start: 0, end: 100 }
481
- * ```
482
- * @example
483
- * ```ts
484
- * parseLocString(`{hg19}chr1:1..100`, isValidRefName)
485
- * // ↳ { assemblyName: 'hg19', refName: 'chr1', start: 0, end: 100 }
486
- * ```
487
- * @example
488
- * ```ts
489
- * parseLocString('chr1', isValidRefName)
490
- * // ↳ { refName: 'chr1' }
491
- * ```
492
- * @example
493
- * ```ts
494
- * parseLocString('chr1:1', isValidRefName)
495
- * // ↳ { refName: 'chr1', start: 0, end: 1 }
496
- * ```
497
- * @example
498
- * ```ts
499
- * parseLocString('chr1:1..', isValidRefName)
500
- * // ↳ { refName: 'chr1', start: 0}
501
- * ```
502
- */
503
381
  function parseLocString(locString, isValidRefName) {
504
382
  const parsed = parseLocStringOneBased(locString, isValidRefName);
505
383
  if (typeof parsed.start === 'number') {
@@ -539,13 +417,6 @@ function compareLocStrings(a, b, isValidRefName) {
539
417
  const locB = parseLocString(b, isValidRefName);
540
418
  return compareLocs(locA, locB);
541
419
  }
542
- /**
543
- * Ensure that a number is at least min and at most max.
544
- *
545
- * @param num -
546
- * @param min -
547
- * @param max -
548
- */
549
420
  function clamp(num, min, max) {
550
421
  if (num < min) {
551
422
  return min;
@@ -558,11 +429,6 @@ function clamp(num, min, max) {
558
429
  function roundToNearestPointOne(num) {
559
430
  return Math.round(num * 10) / 10;
560
431
  }
561
- /**
562
- * @param bp -
563
- * @param region -
564
- * @param bpPerPx -
565
- */
566
432
  function bpToPx(bp, { reversed, end = 0, start = 0, }, bpPerPx) {
567
433
  return roundToNearestPointOne((reversed ? end - bp : bp - start) / bpPerPx);
568
434
  }
@@ -574,17 +440,9 @@ function radToDeg(radians) {
574
440
  function degToRad(degrees) {
575
441
  return (degrees * piOverOneEighty) % (2 * Math.PI);
576
442
  }
577
- /**
578
- * @returns [x, y]
579
- */
580
443
  function polarToCartesian(rho, theta) {
581
444
  return [rho * Math.cos(theta), rho * Math.sin(theta)];
582
445
  }
583
- /**
584
- * @param x - the x
585
- * @param y - the y
586
- * @returns [rho, theta]
587
- */
588
446
  function cartesianToPolar(x, y) {
589
447
  const rho = Math.sqrt(x * x + y * y);
590
448
  const theta = Math.atan(y / x);
@@ -598,7 +456,6 @@ function bpSpanPx(leftBp, rightBp, region, bpPerPx) {
598
456
  const end = bpToPx(rightBp, region, bpPerPx);
599
457
  return region.reversed ? [end, start] : [start, end];
600
458
  }
601
- // do an array map of an iterable
602
459
  function iterMap(iter, func, sizeHint) {
603
460
  const results = Array.from({ length: sizeHint || 0 });
604
461
  let counter = 0;
@@ -608,18 +465,6 @@ function iterMap(iter, func, sizeHint) {
608
465
  }
609
466
  return results;
610
467
  }
611
- /**
612
- * Returns the index of the last element in the array where predicate is true,
613
- * and -1 otherwise. Based on https://stackoverflow.com/a/53187807
614
- *
615
- * @param array - The source array to search in
616
- *
617
- * @param predicate - find calls predicate once for each element of the array, in
618
- * descending order, until it finds one where predicate returns true.
619
- *
620
- * @returns findLastIndex returns element index where predicate is true.
621
- * Otherwise, findLastIndex returns -1.
622
- */
623
468
  function findLastIndex(array, predicate) {
624
469
  let l = array.length;
625
470
  while (l--) {
@@ -638,87 +483,14 @@ function findLast(array, predicate) {
638
483
  }
639
484
  return undefined;
640
485
  }
641
- /**
642
- * makes a mobx reaction with the given functions, that calls actions on the
643
- * model for each stage of execution, and to abort the reaction function when
644
- * the model is destroyed.
645
- *
646
- * Will call startedFunction(signal), successFunction(result), and
647
- * errorFunction(error) when the async reaction function starts, completes, and
648
- * errors respectively.
649
- *
650
- * @param self -
651
- * @param dataFunction -
652
- * @param asyncReactionFunction -
653
- * @param reactionOptions -
654
- * @param startedFunction -
655
- * @param successFunction -
656
- * @param errorFunction -
657
- */
658
- function makeAbortableReaction(self, dataFunction, asyncReactionFunction,
659
- // @ts-expect-error
660
- reactionOptions, startedFunction, successFunction, errorFunction) {
661
- let inProgress;
662
- function handleError(error) {
663
- if (!(0, aborting_1.isAbortException)(error)) {
664
- if ((0, mobx_state_tree_1.isAlive)(self)) {
665
- errorFunction(error);
666
- }
667
- else {
668
- console.error(error);
669
- }
670
- }
671
- }
672
- (0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.reaction)(() => {
673
- try {
674
- return dataFunction(self);
675
- }
676
- catch (e) {
677
- handleError(e);
678
- return undefined;
679
- }
680
- }, async (data, mobxReactionHandle) => {
681
- if (inProgress && !inProgress.signal.aborted) {
682
- inProgress.abort();
683
- }
684
- if (!(0, mobx_state_tree_1.isAlive)(self)) {
685
- return;
686
- }
687
- inProgress = new AbortController();
688
- const thisInProgress = inProgress;
689
- startedFunction(thisInProgress);
690
- try {
691
- const result = await asyncReactionFunction(data, thisInProgress.signal, self,
692
- // @ts-expect-error
693
- mobxReactionHandle);
694
- (0, aborting_1.checkAbortSignal)(thisInProgress.signal);
695
- if ((0, mobx_state_tree_1.isAlive)(self)) {
696
- successFunction(result);
697
- }
698
- }
699
- catch (e) {
700
- if (!thisInProgress.signal.aborted) {
701
- thisInProgress.abort();
702
- }
703
- handleError(e);
704
- }
705
- }, reactionOptions));
706
- (0, mobx_state_tree_1.addDisposer)(self, () => {
707
- if (inProgress && !inProgress.signal.aborted) {
708
- inProgress.abort();
709
- }
710
- });
711
- }
712
486
  function renameRegionIfNeeded(refNameMap, region) {
713
487
  if ((0, mobx_state_tree_1.isStateTreeNode)(region) && !(0, mobx_state_tree_1.isAlive)(region)) {
714
488
  return region;
715
489
  }
716
490
  if (refNameMap === null || refNameMap === void 0 ? void 0 : refNameMap[region.refName]) {
717
- // clone the region so we don't modify it
718
491
  region = (0, mobx_state_tree_1.isStateTreeNode)(region)
719
492
  ? { ...(0, mobx_state_tree_1.getSnapshot)(region) }
720
493
  : { ...region };
721
- // modify it directly in the container
722
494
  const newRef = refNameMap[region.refName];
723
495
  if (newRef) {
724
496
  return { ...region, refName: newRef, originalRefName: region.refName };
@@ -740,9 +512,7 @@ async function renameRegionsIfNeeded(assemblyManager, args) {
740
512
  })));
741
513
  return {
742
514
  ...args,
743
- regions: regions.map((region, i) =>
744
- // note: uses assemblyNames defined above since region could be dead now
745
- renameRegionIfNeeded(assemblyMaps[assemblyNames[i]], region)),
515
+ regions: regions.map((region, i) => renameRegionIfNeeded(assemblyMaps[assemblyNames[i]], region)),
746
516
  };
747
517
  }
748
518
  function minmax(a, b) {
@@ -761,16 +531,7 @@ function stringify({ refName, coord, assemblyName, oob, }, useAssemblyName) {
761
531
  : '',
762
532
  ].join('');
763
533
  }
764
- // this is recommended in a later comment in
765
- // https://github.com/electron/electron/issues/2288 for detecting electron in a
766
- // renderer process, which is the one that has node enabled for us
767
- //
768
- // const isElectron = process.versions.electron
769
- // const i2 = process.versions.hasOwnProperty('electron')
770
534
  exports.isElectron = /electron/i.test(typeof navigator !== 'undefined' ? navigator.userAgent : '');
771
- // from bioperl: tr/acgtrymkswhbvdnxACGTRYMKSWHBVDNX/tgcayrkmswdvbhnxTGCAYRKMSWDVBHNX/
772
- // generated with:
773
- // perl -MJSON -E '@l = split "","acgtrymkswhbvdnxACGTRYMKSWHBVDNX"; print to_json({ map { my $in = $_; tr/acgtrymkswhbvdnxACGTRYMKSWHBVDNX/tgcayrkmswdvbhnxTGCAYRKMSWDVBHNX/; $in => $_ } @l})'
774
535
  exports.complementTable = {
775
536
  S: 'S',
776
537
  w: 'w',
@@ -823,17 +584,13 @@ function reverse(str) {
823
584
  function complement(str) {
824
585
  var _a;
825
586
  let comp = '';
826
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
827
587
  for (let i = 0; i < str.length; i++) {
828
588
  comp += (_a = exports.complementTable[str[i]]) !== null && _a !== void 0 ? _a : str[i];
829
589
  }
830
590
  return comp;
831
591
  }
832
- // requires immediate execution in jest environment, because (hypothesis) it
833
- // otherwise listens for prerendered_canvas but reads empty pixels, and doesn't
834
- // get the contents of the canvas
835
592
  exports.rIC = typeof jest === 'undefined'
836
- ? // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
593
+ ?
837
594
  typeof window !== 'undefined' && window.requestIdleCallback
838
595
  ? window.requestIdleCallback
839
596
  : (cb) => setTimeout(() => {
@@ -842,9 +599,7 @@ exports.rIC = typeof jest === 'undefined'
842
599
  : (cb) => {
843
600
  cb();
844
601
  };
845
- // prettier-ignore
846
602
  const widths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625];
847
- // xref https://gist.github.com/tophtucker/62f93a4658387bb61e4510c37e2e97cf
848
603
  function measureText(str, fontSize = 10) {
849
604
  var _a;
850
605
  const avg = 0.5279276315789471;
@@ -929,10 +684,6 @@ exports.defaultCodonTable = {
929
684
  GGG: 'G',
930
685
  GGT: 'G',
931
686
  };
932
- /**
933
- * take CodonTable above and generate larger codon table that includes all
934
- * permutations of upper and lower case nucleotides
935
- */
936
687
  function generateCodonTable(table) {
937
688
  const tempCodonTable = {};
938
689
  Object.keys(table).forEach(codon => {
@@ -958,13 +709,19 @@ function generateCodonTable(table) {
958
709
  });
959
710
  return tempCodonTable;
960
711
  }
961
- // call statusCallback with current status and clear when finished
962
712
  async function updateStatus(msg, cb, fn) {
963
713
  cb(msg);
964
714
  const res = await fn();
965
715
  cb('');
966
716
  return res;
967
717
  }
718
+ async function updateStatus2(msg, cb, stopToken, fn) {
719
+ cb(msg);
720
+ const res = await fn();
721
+ (0, stopToken_1.checkStopToken)(stopToken);
722
+ cb('');
723
+ return res;
724
+ }
968
725
  function hashCode(str) {
969
726
  let hash = 0;
970
727
  if (str.length === 0) {
@@ -973,7 +730,7 @@ function hashCode(str) {
973
730
  for (let i = 0; i < str.length; i++) {
974
731
  const chr = str.charCodeAt(i);
975
732
  hash = (hash << 5) - hash + chr;
976
- hash |= 0; // Convert to 32bit integer
733
+ hash |= 0;
977
734
  }
978
735
  return hash;
979
736
  }
@@ -990,8 +747,6 @@ async function bytesForRegions(regions, index) {
990
747
  }))
991
748
  .reduce((a, b) => a + b.end - b.start, 0);
992
749
  }
993
- // supported adapter types by text indexer ensure that this matches the method
994
- // found in @jbrowse/text-indexing/util
995
750
  function isSupportedIndexingAdapter(type = '') {
996
751
  return [
997
752
  'Gff3TabixAdapter',
@@ -1020,7 +775,6 @@ function getTickDisplayStr(totalBp, bpPerPx) {
1020
775
  : toLocale(Math.floor(totalBp));
1021
776
  }
1022
777
  function getViewParams(model, exportSVG) {
1023
- // @ts-expect-error
1024
778
  const { dynamicBlocks, staticBlocks, offsetPx } = getContainingView(model);
1025
779
  const b = (dynamicBlocks === null || dynamicBlocks === void 0 ? void 0 : dynamicBlocks.contentBlocks[0]) || {};
1026
780
  const staticblock = (staticBlocks === null || staticBlocks === void 0 ? void 0 : staticBlocks.contentBlocks[0]) || {};
@@ -1035,7 +789,6 @@ function getViewParams(model, exportSVG) {
1035
789
  function getLayoutId({ sessionId, layoutId, }) {
1036
790
  return `${sessionId}-${layoutId}`;
1037
791
  }
1038
- // Hook from https://usehooks.com/useLocalStorage/
1039
792
  function useLocalStorage(key, initialValue) {
1040
793
  const [storedValue, setStoredValue] = (0, react_1.useState)(() => {
1041
794
  if (typeof window === 'undefined') {
@@ -1077,23 +830,18 @@ function getUriLink(value) {
1077
830
  }
1078
831
  function getStr(obj) {
1079
832
  return (0, is_object_1.default)(obj)
1080
- ? (0, types_2.isUriLocation)(obj)
833
+ ? (0, types_1.isUriLocation)(obj)
1081
834
  ? getUriLink(obj)
1082
835
  : JSON.stringify(obj)
1083
836
  : String(obj);
1084
837
  }
1085
- // tries to measure grid width without HTML tags included
1086
838
  function coarseStripHTML(s) {
1087
839
  return s.replaceAll(/(<([^>]+)>)/gi, '');
1088
840
  }
1089
- // based on autolink-js, license MIT
1090
- // https://github.com/bryanwoods/autolink-js/blob/1418049970152c56ced73d43dcc62d80b320fb71/autolink.js#L9
1091
841
  function linkify(s) {
1092
842
  const pattern = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;
1093
843
  return s.replaceAll(pattern, '$1<a href=\'$2\' target="_blank">$2</a>');
1094
844
  }
1095
- // heuristic measurement for a column of a @mui/x-data-grid, pass in
1096
- // values from a column
1097
845
  function measureGridWidth(elements, args) {
1098
846
  const { padding = 30, minWidth = 80, fontSize = 12, maxWidth = 1000, stripHTML = false, } = args || {};
1099
847
  return max(elements
@@ -1154,27 +902,18 @@ function notEmpty(value) {
1154
902
  return value !== null && value !== undefined;
1155
903
  }
1156
904
  function mergeIntervals(intervals, w = 5000) {
1157
- // test if there are at least 2 intervals
1158
905
  if (intervals.length <= 1) {
1159
906
  return intervals;
1160
907
  }
1161
908
  const stack = [];
1162
909
  let top = null;
1163
- // sort the intervals based on their start values
1164
910
  intervals = intervals.sort((a, b) => a.start - b.start);
1165
- // push the 1st interval into the stack
1166
911
  stack.push(intervals[0]);
1167
- // start from the next interval and merge if needed
1168
912
  for (let i = 1; i < intervals.length; i++) {
1169
- // get the top element
1170
913
  top = stack.at(-1);
1171
- // if the current interval doesn't overlap with the
1172
- // stack top element, push it to the stack
1173
914
  if (top.end + w < intervals[i].start - w) {
1174
915
  stack.push(intervals[i]);
1175
916
  }
1176
- // otherwise update the end value of the top element
1177
- // if end of current interval is higher
1178
917
  else if (top.end < intervals[i].end) {
1179
918
  top.end = Math.max(top.end, intervals[i].end);
1180
919
  stack.pop();
@@ -1183,7 +922,6 @@ function mergeIntervals(intervals, w = 5000) {
1183
922
  }
1184
923
  return stack;
1185
924
  }
1186
- // returns new array non-overlapping features
1187
925
  function gatherOverlaps(regions, w = 5000) {
1188
926
  const memo = {};
1189
927
  for (const x of regions) {
@@ -1211,7 +949,6 @@ function getFillProps(str) {
1211
949
  fill: c.alpha(1).toHex(),
1212
950
  };
1213
951
  }
1214
- // https://react.dev/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code
1215
952
  function renderToStaticMarkup(node, createRootFn) {
1216
953
  const div = document.createElement('div');
1217
954
  (0, react_dom_1.flushSync)(() => {
@@ -1235,7 +972,10 @@ async function fetchAndMaybeUnzip(loc, opts) {
1235
972
  : buf;
1236
973
  }
1237
974
  var simpleFeature_1 = require("./simpleFeature");
1238
- Object.defineProperty(exports, "isFeature", { enumerable: true, get: function () { return simpleFeature_1.isFeature; } });
1239
975
  Object.defineProperty(exports, "SimpleFeature", { enumerable: true, get: function () { return __importDefault(simpleFeature_1).default; } });
976
+ Object.defineProperty(exports, "isFeature", { enumerable: true, get: function () { return simpleFeature_1.isFeature; } });
1240
977
  var blobToDataURL_1 = require("./blobToDataURL");
1241
978
  Object.defineProperty(exports, "blobToDataURL", { enumerable: true, get: function () { return blobToDataURL_1.blobToDataURL; } });
979
+ var makeAbortableReaction_1 = require("./makeAbortableReaction");
980
+ Object.defineProperty(exports, "makeAbortableReaction", { enumerable: true, get: function () { return makeAbortableReaction_1.makeAbortableReaction; } });
981
+ __exportStar(require("./aborting"), exports);
@@ -1,5 +1,6 @@
1
1
  import { Buffer } from 'buffer';
2
- import { RemoteFile, PolyfilledResponse } from 'generic-filehandle';
2
+ import { RemoteFile } from 'generic-filehandle';
3
+ import type { PolyfilledResponse } from 'generic-filehandle';
3
4
  export interface BinaryRangeResponse {
4
5
  headers: Record<string, string>;
5
6
  requestDate: Date;
@@ -11,6 +12,6 @@ export declare class RemoteFileWithRangeCache extends RemoteFile {
11
12
  fetch(url: RequestInfo, init?: RequestInit): Promise<PolyfilledResponse>;
12
13
  fetchBinaryRange(url: string, start: number, end: number, options?: {
13
14
  headers?: HeadersInit;
14
- signal?: AbortSignal;
15
+ stopToken?: string;
15
16
  }): Promise<BinaryRangeResponse>;
16
17
  }