@jbrowse/core 2.17.0 → 3.0.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 (354) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +1 -2
  2. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +7 -13
  3. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -2
  4. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +20 -25
  5. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -3
  6. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +3 -7
  7. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +1 -2
  8. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +5 -8
  9. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -3
  10. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +7 -10
  11. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +1 -2
  12. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +25 -55
  13. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +3 -4
  14. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +16 -34
  15. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -2
  16. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -6
  17. package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -3
  18. package/BaseFeatureWidget/BaseFeatureDetail/Position.js +2 -5
  19. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +1 -2
  20. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +3 -5
  21. package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +1 -2
  22. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +3 -5
  23. package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +4 -5
  24. package/BaseFeatureWidget/BaseFeatureDetail/index.js +6 -14
  25. package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -13
  26. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
  27. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +48 -0
  28. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -4
  29. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +33 -41
  30. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +3 -4
  31. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +30 -29
  32. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
  33. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +28 -0
  34. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +2 -10
  35. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +11 -85
  36. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +1 -2
  37. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +6 -25
  38. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +3 -4
  39. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +11 -46
  40. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +3 -4
  41. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +101 -96
  42. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +2 -3
  43. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +49 -53
  44. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +2 -3
  45. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +20 -55
  46. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
  47. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
  48. package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -56
  49. package/BaseFeatureWidget/SequenceFeatureDetails/model.js +4 -66
  50. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +4 -5
  51. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +6 -9
  52. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +3 -4
  53. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +6 -7
  54. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +3 -4
  55. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +5 -9
  56. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +3 -4
  57. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +2 -4
  58. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +2 -3
  59. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +3 -10
  60. package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
  61. package/BaseFeatureWidget/SequenceFeatureDetails/types.js +2 -0
  62. package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
  63. package/BaseFeatureWidget/stateModelFactory.d.ts +2 -93
  64. package/BaseFeatureWidget/stateModelFactory.js +3 -73
  65. package/BaseFeatureWidget/types.d.ts +3 -3
  66. package/BaseFeatureWidget/util.js +0 -4
  67. package/CorePlugin.d.ts +1 -1
  68. package/CorePlugin.js +19 -12
  69. package/Plugin.d.ts +2 -5
  70. package/Plugin.js +0 -3
  71. package/PluginLoader.d.ts +1 -1
  72. package/PluginLoader.js +2 -19
  73. package/PluginManager.d.ts +17 -32
  74. package/PluginManager.js +15 -41
  75. package/ReExports/DataGrid.js +0 -1
  76. package/ReExports/list.d.ts +0 -5
  77. package/ReExports/list.js +3 -5
  78. package/ReExports/modules.d.ts +26 -22
  79. package/ReExports/modules.js +45 -44
  80. package/TextSearch/BaseResults.d.ts +4 -4
  81. package/TextSearch/TextSearchManager.d.ts +4 -16
  82. package/TextSearch/TextSearchManager.js +1 -13
  83. package/assemblyManager/assembly.d.ts +5 -100
  84. package/assemblyManager/assembly.js +30 -146
  85. package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
  86. package/assemblyManager/assemblyConfigSchema.js +12 -46
  87. package/assemblyManager/assemblyManager.d.ts +7 -57
  88. package/assemblyManager/assemblyManager.js +2 -57
  89. package/configuration/configurationSchema.d.ts +4 -4
  90. package/configuration/configurationSchema.js +2 -14
  91. package/configuration/configurationSlot.d.ts +2 -13
  92. package/configuration/configurationSlot.js +2 -32
  93. package/configuration/index.d.ts +2 -2
  94. package/configuration/index.js +2 -2
  95. package/configuration/types.d.ts +2 -3
  96. package/configuration/util.d.ts +1 -25
  97. package/configuration/util.js +19 -56
  98. package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
  99. package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
  100. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +5 -114
  101. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +3 -79
  102. package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
  103. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
  104. package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
  105. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
  106. package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
  107. package/data_adapters/BaseAdapter/index.d.ts +4 -4
  108. package/data_adapters/BaseAdapter/types.d.ts +2 -2
  109. package/data_adapters/BaseAdapter/util.d.ts +6 -6
  110. package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +1 -1
  111. package/data_adapters/CytobandAdapter/CytobandAdapter.js +2 -6
  112. package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
  113. package/data_adapters/CytobandAdapter/configSchema.js +1 -7
  114. package/data_adapters/CytobandAdapter/index.d.ts +1 -1
  115. package/data_adapters/CytobandAdapter/index.js +21 -8
  116. package/data_adapters/dataAdapterCache.d.ts +4 -22
  117. package/data_adapters/dataAdapterCache.js +2 -28
  118. package/data_adapters/util.d.ts +1 -0
  119. package/data_adapters/util.js +10 -0
  120. package/package.json +8 -11
  121. package/pluggableElementTypes/AdapterType.d.ts +2 -2
  122. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
  123. package/pluggableElementTypes/ConnectionType.d.ts +3 -3
  124. package/pluggableElementTypes/DisplayType.d.ts +3 -9
  125. package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
  126. package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
  127. package/pluggableElementTypes/PluggableElementBase.js +2 -2
  128. package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
  129. package/pluggableElementTypes/RpcMethodType.js +7 -19
  130. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
  131. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
  132. package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
  133. package/pluggableElementTypes/TrackType.d.ts +3 -3
  134. package/pluggableElementTypes/ViewType.d.ts +3 -3
  135. package/pluggableElementTypes/WidgetType.d.ts +4 -3
  136. package/pluggableElementTypes/index.d.ts +11 -11
  137. package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
  138. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
  139. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
  140. package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
  141. package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
  142. package/pluggableElementTypes/models/BaseTrackModel.js +9 -63
  143. package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
  144. package/pluggableElementTypes/models/BaseViewModel.js +2 -38
  145. package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
  146. package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
  147. package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
  148. package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
  149. package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
  150. package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
  151. package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
  152. package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
  153. package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
  154. package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
  155. package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +4 -4
  156. package/pluggableElementTypes/renderers/CircularChordRendererType.js +3 -8
  157. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
  158. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
  159. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
  160. package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
  161. package/pluggableElementTypes/renderers/RendererType.d.ts +5 -9
  162. package/pluggableElementTypes/renderers/RendererType.js +3 -7
  163. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +3 -4
  164. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +11 -76
  165. package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -3
  166. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +10 -74
  167. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
  168. package/pluggableElementTypes/renderers/ServerSideRendererType.js +10 -60
  169. package/pluggableElementTypes/renderers/index.d.ts +1 -1
  170. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
  171. package/rpc/BaseRpcDriver.d.ts +3 -4
  172. package/rpc/BaseRpcDriver.js +20 -80
  173. package/rpc/MainThreadRpcDriver.d.ts +3 -7
  174. package/rpc/MainThreadRpcDriver.js +0 -5
  175. package/rpc/RpcManager.d.ts +3 -3
  176. package/rpc/RpcManager.js +2 -4
  177. package/rpc/WebWorkerRpcDriver.d.ts +3 -2
  178. package/rpc/WebWorkerRpcDriver.js +2 -13
  179. package/rpc/baseRpcConfig.d.ts +0 -3
  180. package/rpc/baseRpcConfig.js +1 -7
  181. package/rpc/configSchema.d.ts +0 -6
  182. package/rpc/configSchema.js +2 -11
  183. package/rpc/mainThreadRpcConfig.js +1 -7
  184. package/rpc/methods/CoreFreeResources.d.ts +0 -6
  185. package/rpc/methods/CoreFreeResources.js +2 -9
  186. package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
  187. package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
  188. package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
  189. package/rpc/methods/CoreGetFeatureDetails.js +0 -5
  190. package/rpc/methods/CoreGetFeatures.d.ts +5 -5
  191. package/rpc/methods/CoreGetFeatures.js +4 -5
  192. package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
  193. package/rpc/methods/CoreGetFileInfo.js +1 -1
  194. package/rpc/methods/CoreGetMetadata.d.ts +1 -2
  195. package/rpc/methods/CoreGetMetadata.js +1 -1
  196. package/rpc/methods/CoreGetRefNames.d.ts +1 -2
  197. package/rpc/methods/CoreGetRefNames.js +1 -1
  198. package/rpc/methods/CoreRender.d.ts +2 -6
  199. package/rpc/methods/CoreRender.js +5 -7
  200. package/rpc/methods/util.d.ts +3 -3
  201. package/rpc/methods/util.js +0 -1
  202. package/rpc/webWorkerRpcConfig.js +1 -7
  203. package/stories/JBrowseCore.stories.d.ts +1 -1
  204. package/stories/JBrowseCore.stories.js +3 -3
  205. package/stories/examples/WithSequencePanel.d.ts +6 -7
  206. package/stories/examples/WithSequencePanel.js +9 -9
  207. package/tsconfig.build.tsbuildinfo +1 -1
  208. package/ui/AppLogo.d.ts +2 -3
  209. package/ui/AppLogo.js +2 -7
  210. package/ui/AssemblySelector.d.ts +5 -5
  211. package/ui/AssemblySelector.js +11 -36
  212. package/ui/BaseTooltip.d.ts +1 -2
  213. package/ui/BaseTooltip.js +10 -17
  214. package/ui/CascadingMenu.d.ts +3 -4
  215. package/ui/CascadingMenu.js +18 -57
  216. package/ui/CascadingMenuButton.d.ts +2 -3
  217. package/ui/CascadingMenuButton.js +18 -42
  218. package/ui/ColorPicker.d.ts +3 -4
  219. package/ui/ColorPicker.js +33 -37
  220. package/ui/Dialog.d.ts +2 -3
  221. package/ui/Dialog.js +15 -27
  222. package/ui/DraggableDialog.d.ts +5 -0
  223. package/ui/DraggableDialog.js +32 -0
  224. package/ui/DropDownMenu.d.ts +2 -3
  225. package/ui/DropDownMenu.js +10 -36
  226. package/ui/EditableTypography.d.ts +2 -3
  227. package/ui/EditableTypography.js +30 -59
  228. package/ui/ErrorBoundary.d.ts +3 -2
  229. package/ui/ErrorBoundary.js +3 -25
  230. package/ui/ErrorMessage.d.ts +1 -2
  231. package/ui/ErrorMessage.js +27 -34
  232. package/ui/ErrorMessageStackTraceDialog.d.ts +1 -2
  233. package/ui/ErrorMessageStackTraceDialog.js +13 -54
  234. package/ui/FactoryResetDialog.d.ts +1 -2
  235. package/ui/FactoryResetDialog.js +8 -13
  236. package/ui/FatalErrorDialog.d.ts +1 -2
  237. package/ui/FatalErrorDialog.js +11 -42
  238. package/ui/FileSelector/FileSelector.d.ts +5 -5
  239. package/ui/FileSelector/FileSelector.js +41 -80
  240. package/ui/FileSelector/LocalFileChooser.d.ts +2 -3
  241. package/ui/FileSelector/LocalFileChooser.js +17 -29
  242. package/ui/FileSelector/UrlChooser.d.ts +5 -5
  243. package/ui/FileSelector/UrlChooser.js +6 -7
  244. package/ui/Icons.d.ts +10 -11
  245. package/ui/Icons.js +10 -25
  246. package/ui/LoadingEllipses.d.ts +2 -3
  247. package/ui/LoadingEllipses.js +4 -7
  248. package/ui/Logo.d.ts +2 -3
  249. package/ui/Logo.js +5 -23
  250. package/ui/Menu.d.ts +3 -4
  251. package/ui/Menu.js +85 -122
  252. package/ui/MenuButton.d.ts +2 -3
  253. package/ui/MenuButton.js +11 -35
  254. package/ui/PrerenderedCanvas.d.ts +1 -2
  255. package/ui/PrerenderedCanvas.js +3 -25
  256. package/ui/RedErrorMessageBox.d.ts +1 -2
  257. package/ui/RedErrorMessageBox.js +2 -5
  258. package/ui/ResizeHandle.d.ts +1 -2
  259. package/ui/ResizeHandle.js +5 -27
  260. package/ui/ReturnToImportFormDialog.d.ts +1 -2
  261. package/ui/ReturnToImportFormDialog.js +8 -13
  262. package/ui/SanitizedHTML.d.ts +2 -3
  263. package/ui/SanitizedHTML.js +4 -24
  264. package/ui/Snackbar.d.ts +3 -4
  265. package/ui/Snackbar.js +41 -21
  266. package/ui/SnackbarContents.d.ts +5 -0
  267. package/ui/SnackbarContents.js +16 -0
  268. package/ui/SnackbarModel.d.ts +1 -26
  269. package/ui/SnackbarModel.js +22 -39
  270. package/ui/colors.d.ts +1 -1
  271. package/ui/colors.js +2 -2
  272. package/ui/index.d.ts +0 -2
  273. package/ui/index.js +1 -5
  274. package/ui/react-colorful.js +17 -10
  275. package/ui/theme.d.ts +1 -1
  276. package/ui/theme.js +7 -40
  277. package/util/Base1DUtils.d.ts +1 -1
  278. package/util/Base1DUtils.js +0 -12
  279. package/util/Base1DViewModel.d.ts +4 -81
  280. package/util/Base1DViewModel.js +4 -108
  281. package/util/QuickLRU.js +0 -9
  282. package/util/TimeTraveller.js +0 -4
  283. package/util/aborting.d.ts +0 -20
  284. package/util/aborting.js +0 -31
  285. package/util/analytics.js +1 -12
  286. package/util/blockTypes.d.ts +0 -11
  287. package/util/blockTypes.js +0 -13
  288. package/util/calculateDynamicBlocks.d.ts +1 -20
  289. package/util/calculateDynamicBlocks.js +1 -22
  290. package/util/calculateStaticBlocks.d.ts +2 -2
  291. package/util/calculateStaticBlocks.js +0 -2
  292. package/util/color/cssColorsLevel4.js +0 -1
  293. package/util/color/index.d.ts +0 -19
  294. package/util/color/index.js +0 -30
  295. package/util/compositeMap.js +0 -2
  296. package/util/dedupe.js +0 -1
  297. package/util/formatFastaStrings.d.ts +0 -13
  298. package/util/formatFastaStrings.js +0 -13
  299. package/util/idMaker.d.ts +1 -1
  300. package/util/idMaker.js +16 -12
  301. package/util/index.d.ts +27 -173
  302. package/util/index.js +53 -293
  303. package/util/io/RemoteFileWithRangeCache.d.ts +4 -5
  304. package/util/io/RemoteFileWithRangeCache.js +12 -14
  305. package/util/io/index.d.ts +3 -4
  306. package/util/io/index.js +5 -19
  307. package/util/jexl.js +3 -13
  308. package/util/jexlStrings.d.ts +0 -6
  309. package/util/jexlStrings.js +0 -8
  310. package/util/layouts/BaseLayout.d.ts +1 -1
  311. package/util/layouts/GranularRectLayout.d.ts +1 -17
  312. package/util/layouts/GranularRectLayout.js +4 -81
  313. package/util/layouts/MultiLayout.d.ts +1 -6
  314. package/util/layouts/MultiLayout.js +0 -6
  315. package/util/layouts/PrecomputedLayout.d.ts +1 -4
  316. package/util/layouts/PrecomputedLayout.js +0 -5
  317. package/util/layouts/PrecomputedMultiLayout.js +0 -2
  318. package/util/layouts/SceneGraph.d.ts +0 -12
  319. package/util/layouts/SceneGraph.js +0 -13
  320. package/util/makeAbortableReaction.d.ts +2 -0
  321. package/util/makeAbortableReaction.js +50 -0
  322. package/util/map-obj.js +0 -4
  323. package/util/mst-reflection.d.ts +1 -14
  324. package/util/mst-reflection.js +1 -28
  325. package/util/nanoid.d.ts +1 -1
  326. package/util/nanoid.js +0 -31
  327. package/util/nextTick.d.ts +1 -0
  328. package/util/nextTick.js +6 -0
  329. package/util/offscreenCanvasPonyfill.d.ts +0 -1
  330. package/util/offscreenCanvasPonyfill.js +1 -9
  331. package/util/offscreenCanvasUtils.d.ts +2 -3
  332. package/util/offscreenCanvasUtils.js +22 -21
  333. package/util/range.d.ts +0 -25
  334. package/util/range.js +0 -34
  335. package/util/rxjs.d.ts +3 -7
  336. package/util/rxjs.js +2 -9
  337. package/util/simpleFeature.d.ts +0 -50
  338. package/util/simpleFeature.js +0 -35
  339. package/util/stats.d.ts +3 -26
  340. package/util/stats.js +0 -25
  341. package/util/stopToken.d.ts +3 -0
  342. package/util/stopToken.js +29 -0
  343. package/util/tracks.d.ts +4 -26
  344. package/util/tracks.js +8 -33
  345. package/util/types/index.d.ts +14 -30
  346. package/util/types/index.js +5 -14
  347. package/util/types/mst.js +0 -9
  348. package/util/types/util.d.ts +2 -9
  349. package/util/useMeasure.d.ts +1 -1
  350. package/util/useMeasure.js +0 -1
  351. package/util/when.d.ts +1 -15
  352. package/util/when.js +3 -70
  353. package/rpc/remoteAbortSignals.d.ts +0 -36
  354. 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;
@@ -90,21 +90,21 @@ exports.getFillProps = getFillProps;
90
90
  exports.renderToStaticMarkup = renderToStaticMarkup;
91
91
  exports.isGzip = isGzip;
92
92
  exports.fetchAndMaybeUnzip = fetchAndMaybeUnzip;
93
+ exports.fetchAndMaybeUnzipText = fetchAndMaybeUnzipText;
94
+ exports.isObject = isObject;
95
+ exports.localStorageGetNumber = localStorageGetNumber;
96
+ exports.localStorageGetBoolean = localStorageGetBoolean;
97
+ exports.testAdapter = testAdapter;
93
98
  const react_1 = require("react");
94
- const is_object_1 = __importDefault(require("is-object"));
95
- 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
99
+ const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
101
100
  const useMeasure_1 = __importDefault(require("@jbrowse/core/util/useMeasure"));
102
- const colord_1 = require("./colord");
103
- // eslint-disable-next-line react/no-deprecated
101
+ const mobx_state_tree_1 = require("mobx-state-tree");
104
102
  const react_dom_1 = require("react-dom");
105
- const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
103
+ const client_1 = require("react-dom/client");
104
+ const colord_1 = require("./colord");
105
+ const stopToken_1 = require("./stopToken");
106
+ const types_1 = require("./types");
106
107
  __exportStar(require("./types"), exports);
107
- __exportStar(require("./aborting"), exports);
108
108
  __exportStar(require("./when"), exports);
109
109
  __exportStar(require("./range"), exports);
110
110
  __exportStar(require("./dedupe"), exports);
@@ -122,14 +122,10 @@ function useDebounce(value, delay) {
122
122
  }, [value, delay]);
123
123
  return debouncedValue;
124
124
  }
125
- // used in ViewContainer files to get the width
126
125
  function useWidthSetter(view, padding) {
127
126
  const [ref, { width }] = (0, useMeasure_1.default)();
128
127
  (0, react_1.useEffect)(() => {
129
128
  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
129
  requestAnimationFrame(() => {
134
130
  view.setWidth(width - Number.parseInt(padding, 10) * 2);
135
131
  });
@@ -137,26 +133,19 @@ function useWidthSetter(view, padding) {
137
133
  }, [padding, view, width]);
138
134
  return ref;
139
135
  }
140
- // https://stackoverflow.com/questions/56283920/
141
136
  function useDebouncedCallback(callback, wait = 400) {
142
- // track args & timeout handle between calls
143
- const argsRef = (0, react_1.useRef)();
144
- const timeout = (0, react_1.useRef)();
145
- // make sure our timeout gets cleared if our consuming component gets
146
- // unmounted
137
+ const argsRef = (0, react_1.useRef)(null);
138
+ const timeout = (0, react_1.useRef)(null);
147
139
  (0, react_1.useEffect)(() => {
148
140
  if (timeout.current) {
149
141
  clearTimeout(timeout.current);
150
142
  }
151
143
  }, []);
152
144
  return function debouncedCallback(...args) {
153
- // capture latest args
154
145
  argsRef.current = args;
155
- // clear debounce timer
156
146
  if (timeout.current) {
157
147
  clearTimeout(timeout.current);
158
148
  }
159
- // start waiting again
160
149
  timeout.current = setTimeout(() => {
161
150
  if (argsRef.current) {
162
151
  callback(...argsRef.current);
@@ -164,9 +153,6 @@ function useDebouncedCallback(callback, wait = 400) {
164
153
  }, wait);
165
154
  };
166
155
  }
167
- /**
168
- * find the first node in the hierarchy that matches the given predicate
169
- */
170
156
  function findParentThat(node, predicate) {
171
157
  if (!(0, mobx_state_tree_1.hasParent)(node)) {
172
158
  throw new Error('node does not have parent');
@@ -185,7 +171,6 @@ function findParentThat(node, predicate) {
185
171
  }
186
172
  throw new Error('no matching node found');
187
173
  }
188
- // based on https://github.com/react-spring/react-spring/blob/cd5548a987383b8023efd620f3726a981f9e18ea/src/animated/FrameLoop.ts
189
174
  function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, precision = 0, tension = 400, friction = 20, clamp = true) {
190
175
  const mass = 1;
191
176
  if (!precision) {
@@ -197,11 +182,9 @@ function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, preci
197
182
  let position = animation.lastPosition;
198
183
  let lastTime = animation.lastTime || time;
199
184
  let velocity = animation.lastVelocity || 0;
200
- // If we lost a lot of frames just jump to the end.
201
185
  if (time > lastTime + 64) {
202
186
  lastTime = time;
203
187
  }
204
- // http://gafferongames.com/game-physics/fix-your-timestep/
205
188
  const numSteps = Math.floor(time - lastTime);
206
189
  for (let i = 0; i < numSteps; ++i) {
207
190
  const force = -tension * (position - toValue);
@@ -242,17 +225,9 @@ function springAnimate(fromValue, toValue, setValue, onFinish = () => { }, preci
242
225
  },
243
226
  ];
244
227
  }
245
- /**
246
- * find the first node in the hierarchy that matches the given 'is' typescript
247
- * type guard predicate
248
- */
249
228
  function findParentThatIs(node, predicate) {
250
229
  return findParentThat(node, predicate);
251
230
  }
252
- /**
253
- * get the current JBrowse session model, starting at any node in the state
254
- * tree
255
- */
256
231
  function getSession(node) {
257
232
  try {
258
233
  return findParentThatIs(node, types_1.isSessionModel);
@@ -261,10 +236,6 @@ function getSession(node) {
261
236
  throw new Error('no session model found!');
262
237
  }
263
238
  }
264
- /**
265
- * get the state model of the view in the state tree that contains the given
266
- * node
267
- */
268
239
  function getContainingView(node) {
269
240
  try {
270
241
  return findParentThatIs(node, types_1.isViewModel);
@@ -273,10 +244,6 @@ function getContainingView(node) {
273
244
  throw new Error('no containing view found');
274
245
  }
275
246
  }
276
- /**
277
- * get the state model of the view in the state tree that contains the given
278
- * node
279
- */
280
247
  function getContainingTrack(node) {
281
248
  try {
282
249
  return findParentThatIs(node, types_1.isTrackModel);
@@ -285,10 +252,6 @@ function getContainingTrack(node) {
285
252
  throw new Error('no containing track found');
286
253
  }
287
254
  }
288
- /**
289
- * get the state model of the display in the state tree that contains the given
290
- * node
291
- */
292
255
  function getContainingDisplay(node) {
293
256
  try {
294
257
  return findParentThatIs(node, types_1.isDisplayModel);
@@ -297,46 +260,9 @@ function getContainingDisplay(node) {
297
260
  throw new Error('no containing display found');
298
261
  }
299
262
  }
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
263
  function assembleLocString(region) {
335
264
  return assembleLocStringFast(region, toLocale);
336
265
  }
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
266
  function assembleLocStringFast(region, cb = (n) => n) {
341
267
  const { assemblyName, refName, start, end, reversed } = region;
342
268
  const assemblyNameString = assemblyName ? `{${assemblyName}}` : '';
@@ -372,10 +298,7 @@ function parseLocStringOneBased(locString, isValidRefName) {
372
298
  reversed = true;
373
299
  locString = locString.replace(/\[rev]$/, '');
374
300
  }
375
- // remove any whitespace
376
301
  locString = locString.replace(/\s/, '');
377
- // refNames can have colons, refer to
378
- // https://samtools.github.io/hts-specs/SAMv1.pdf Appendix A
379
302
  const assemblyMatch = /({(.+)})?(.+)/.exec(locString);
380
303
  if (!assemblyMatch) {
381
304
  throw new Error(`invalid location string: "${locString}"`);
@@ -405,9 +328,7 @@ function parseLocStringOneBased(locString, isValidRefName) {
405
328
  }
406
329
  else if (isValidRefName(prefix, assemblyName)) {
407
330
  if (suffix) {
408
- // see if it's a range
409
331
  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
332
  const singleMatch = /^(-?(\d+|\d{1,3}(,\d{3})*))(\.\.|-)?$/.exec(suffix);
412
333
  if (rangeMatch) {
413
334
  const [, start, , , , end] = rangeMatch;
@@ -425,7 +346,6 @@ function parseLocStringOneBased(locString, isValidRefName) {
425
346
  const [, start, , , separator] = singleMatch;
426
347
  if (start !== undefined) {
427
348
  if (separator) {
428
- // indefinite end
429
349
  return {
430
350
  assemblyName,
431
351
  refName: prefix,
@@ -463,43 +383,6 @@ function parseLocStringOneBased(locString, isValidRefName) {
463
383
  }
464
384
  throw new Error(`unknown reference sequence name in location "${locString}"`);
465
385
  }
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
386
  function parseLocString(locString, isValidRefName) {
504
387
  const parsed = parseLocStringOneBased(locString, isValidRefName);
505
388
  if (typeof parsed.start === 'number') {
@@ -539,13 +422,6 @@ function compareLocStrings(a, b, isValidRefName) {
539
422
  const locB = parseLocString(b, isValidRefName);
540
423
  return compareLocs(locA, locB);
541
424
  }
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
425
  function clamp(num, min, max) {
550
426
  if (num < min) {
551
427
  return min;
@@ -558,11 +434,6 @@ function clamp(num, min, max) {
558
434
  function roundToNearestPointOne(num) {
559
435
  return Math.round(num * 10) / 10;
560
436
  }
561
- /**
562
- * @param bp -
563
- * @param region -
564
- * @param bpPerPx -
565
- */
566
437
  function bpToPx(bp, { reversed, end = 0, start = 0, }, bpPerPx) {
567
438
  return roundToNearestPointOne((reversed ? end - bp : bp - start) / bpPerPx);
568
439
  }
@@ -574,17 +445,9 @@ function radToDeg(radians) {
574
445
  function degToRad(degrees) {
575
446
  return (degrees * piOverOneEighty) % (2 * Math.PI);
576
447
  }
577
- /**
578
- * @returns [x, y]
579
- */
580
448
  function polarToCartesian(rho, theta) {
581
449
  return [rho * Math.cos(theta), rho * Math.sin(theta)];
582
450
  }
583
- /**
584
- * @param x - the x
585
- * @param y - the y
586
- * @returns [rho, theta]
587
- */
588
451
  function cartesianToPolar(x, y) {
589
452
  const rho = Math.sqrt(x * x + y * y);
590
453
  const theta = Math.atan(y / x);
@@ -598,7 +461,6 @@ function bpSpanPx(leftBp, rightBp, region, bpPerPx) {
598
461
  const end = bpToPx(rightBp, region, bpPerPx);
599
462
  return region.reversed ? [end, start] : [start, end];
600
463
  }
601
- // do an array map of an iterable
602
464
  function iterMap(iter, func, sizeHint) {
603
465
  const results = Array.from({ length: sizeHint || 0 });
604
466
  let counter = 0;
@@ -608,18 +470,6 @@ function iterMap(iter, func, sizeHint) {
608
470
  }
609
471
  return results;
610
472
  }
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
473
  function findLastIndex(array, predicate) {
624
474
  let l = array.length;
625
475
  while (l--) {
@@ -638,87 +488,14 @@ function findLast(array, predicate) {
638
488
  }
639
489
  return undefined;
640
490
  }
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
491
  function renameRegionIfNeeded(refNameMap, region) {
713
492
  if ((0, mobx_state_tree_1.isStateTreeNode)(region) && !(0, mobx_state_tree_1.isAlive)(region)) {
714
493
  return region;
715
494
  }
716
495
  if (refNameMap === null || refNameMap === void 0 ? void 0 : refNameMap[region.refName]) {
717
- // clone the region so we don't modify it
718
496
  region = (0, mobx_state_tree_1.isStateTreeNode)(region)
719
497
  ? { ...(0, mobx_state_tree_1.getSnapshot)(region) }
720
498
  : { ...region };
721
- // modify it directly in the container
722
499
  const newRef = refNameMap[region.refName];
723
500
  if (newRef) {
724
501
  return { ...region, refName: newRef, originalRefName: region.refName };
@@ -740,9 +517,7 @@ async function renameRegionsIfNeeded(assemblyManager, args) {
740
517
  })));
741
518
  return {
742
519
  ...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)),
520
+ regions: regions.map((region, i) => renameRegionIfNeeded(assemblyMaps[assemblyNames[i]], region)),
746
521
  };
747
522
  }
748
523
  function minmax(a, b) {
@@ -761,16 +536,7 @@ function stringify({ refName, coord, assemblyName, oob, }, useAssemblyName) {
761
536
  : '',
762
537
  ].join('');
763
538
  }
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
539
  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
540
  exports.complementTable = {
775
541
  S: 'S',
776
542
  w: 'w',
@@ -823,17 +589,13 @@ function reverse(str) {
823
589
  function complement(str) {
824
590
  var _a;
825
591
  let comp = '';
826
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
827
592
  for (let i = 0; i < str.length; i++) {
828
593
  comp += (_a = exports.complementTable[str[i]]) !== null && _a !== void 0 ? _a : str[i];
829
594
  }
830
595
  return comp;
831
596
  }
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
597
  exports.rIC = typeof jest === 'undefined'
836
- ? // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
598
+ ?
837
599
  typeof window !== 'undefined' && window.requestIdleCallback
838
600
  ? window.requestIdleCallback
839
601
  : (cb) => setTimeout(() => {
@@ -842,9 +604,7 @@ exports.rIC = typeof jest === 'undefined'
842
604
  : (cb) => {
843
605
  cb();
844
606
  };
845
- // prettier-ignore
846
607
  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
608
  function measureText(str, fontSize = 10) {
849
609
  var _a;
850
610
  const avg = 0.5279276315789471;
@@ -929,10 +689,6 @@ exports.defaultCodonTable = {
929
689
  GGG: 'G',
930
690
  GGT: 'G',
931
691
  };
932
- /**
933
- * take CodonTable above and generate larger codon table that includes all
934
- * permutations of upper and lower case nucleotides
935
- */
936
692
  function generateCodonTable(table) {
937
693
  const tempCodonTable = {};
938
694
  Object.keys(table).forEach(codon => {
@@ -958,13 +714,19 @@ function generateCodonTable(table) {
958
714
  });
959
715
  return tempCodonTable;
960
716
  }
961
- // call statusCallback with current status and clear when finished
962
717
  async function updateStatus(msg, cb, fn) {
963
718
  cb(msg);
964
719
  const res = await fn();
965
720
  cb('');
966
721
  return res;
967
722
  }
723
+ async function updateStatus2(msg, cb, stopToken, fn) {
724
+ cb(msg);
725
+ const res = await fn();
726
+ (0, stopToken_1.checkStopToken)(stopToken);
727
+ cb('');
728
+ return res;
729
+ }
968
730
  function hashCode(str) {
969
731
  let hash = 0;
970
732
  if (str.length === 0) {
@@ -973,7 +735,7 @@ function hashCode(str) {
973
735
  for (let i = 0; i < str.length; i++) {
974
736
  const chr = str.charCodeAt(i);
975
737
  hash = (hash << 5) - hash + chr;
976
- hash |= 0; // Convert to 32bit integer
738
+ hash |= 0;
977
739
  }
978
740
  return hash;
979
741
  }
@@ -990,8 +752,6 @@ async function bytesForRegions(regions, index) {
990
752
  }))
991
753
  .reduce((a, b) => a + b.end - b.start, 0);
992
754
  }
993
- // supported adapter types by text indexer ensure that this matches the method
994
- // found in @jbrowse/text-indexing/util
995
755
  function isSupportedIndexingAdapter(type = '') {
996
756
  return [
997
757
  'Gff3TabixAdapter',
@@ -1020,7 +780,6 @@ function getTickDisplayStr(totalBp, bpPerPx) {
1020
780
  : toLocale(Math.floor(totalBp));
1021
781
  }
1022
782
  function getViewParams(model, exportSVG) {
1023
- // @ts-expect-error
1024
783
  const { dynamicBlocks, staticBlocks, offsetPx } = getContainingView(model);
1025
784
  const b = (dynamicBlocks === null || dynamicBlocks === void 0 ? void 0 : dynamicBlocks.contentBlocks[0]) || {};
1026
785
  const staticblock = (staticBlocks === null || staticBlocks === void 0 ? void 0 : staticBlocks.contentBlocks[0]) || {};
@@ -1035,7 +794,6 @@ function getViewParams(model, exportSVG) {
1035
794
  function getLayoutId({ sessionId, layoutId, }) {
1036
795
  return `${sessionId}-${layoutId}`;
1037
796
  }
1038
- // Hook from https://usehooks.com/useLocalStorage/
1039
797
  function useLocalStorage(key, initialValue) {
1040
798
  const [storedValue, setStoredValue] = (0, react_1.useState)(() => {
1041
799
  if (typeof window === 'undefined') {
@@ -1076,24 +834,19 @@ function getUriLink(value) {
1076
834
  return href;
1077
835
  }
1078
836
  function getStr(obj) {
1079
- return (0, is_object_1.default)(obj)
1080
- ? (0, types_2.isUriLocation)(obj)
837
+ return isObject(obj)
838
+ ? (0, types_1.isUriLocation)(obj)
1081
839
  ? getUriLink(obj)
1082
840
  : JSON.stringify(obj)
1083
841
  : String(obj);
1084
842
  }
1085
- // tries to measure grid width without HTML tags included
1086
843
  function coarseStripHTML(s) {
1087
844
  return s.replaceAll(/(<([^>]+)>)/gi, '');
1088
845
  }
1089
- // based on autolink-js, license MIT
1090
- // https://github.com/bryanwoods/autolink-js/blob/1418049970152c56ced73d43dcc62d80b320fb71/autolink.js#L9
1091
846
  function linkify(s) {
1092
847
  const pattern = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;
1093
848
  return s.replaceAll(pattern, '$1<a href=\'$2\' target="_blank">$2</a>');
1094
849
  }
1095
- // heuristic measurement for a column of a @mui/x-data-grid, pass in
1096
- // values from a column
1097
850
  function measureGridWidth(elements, args) {
1098
851
  const { padding = 30, minWidth = 80, fontSize = 12, maxWidth = 1000, stripHTML = false, } = args || {};
1099
852
  return max(elements
@@ -1154,27 +907,18 @@ function notEmpty(value) {
1154
907
  return value !== null && value !== undefined;
1155
908
  }
1156
909
  function mergeIntervals(intervals, w = 5000) {
1157
- // test if there are at least 2 intervals
1158
910
  if (intervals.length <= 1) {
1159
911
  return intervals;
1160
912
  }
1161
913
  const stack = [];
1162
914
  let top = null;
1163
- // sort the intervals based on their start values
1164
915
  intervals = intervals.sort((a, b) => a.start - b.start);
1165
- // push the 1st interval into the stack
1166
916
  stack.push(intervals[0]);
1167
- // start from the next interval and merge if needed
1168
917
  for (let i = 1; i < intervals.length; i++) {
1169
- // get the top element
1170
918
  top = stack.at(-1);
1171
- // if the current interval doesn't overlap with the
1172
- // stack top element, push it to the stack
1173
919
  if (top.end + w < intervals[i].start - w) {
1174
920
  stack.push(intervals[i]);
1175
921
  }
1176
- // otherwise update the end value of the top element
1177
- // if end of current interval is higher
1178
922
  else if (top.end < intervals[i].end) {
1179
923
  top.end = Math.max(top.end, intervals[i].end);
1180
924
  stack.pop();
@@ -1183,7 +927,6 @@ function mergeIntervals(intervals, w = 5000) {
1183
927
  }
1184
928
  return stack;
1185
929
  }
1186
- // returns new array non-overlapping features
1187
930
  function gatherOverlaps(regions, w = 5000) {
1188
931
  const memo = {};
1189
932
  for (const x of regions) {
@@ -1211,16 +954,10 @@ function getFillProps(str) {
1211
954
  fill: c.alpha(1).toHex(),
1212
955
  };
1213
956
  }
1214
- // https://react.dev/reference/react-dom/server/renderToString#removing-rendertostring-from-the-client-code
1215
- function renderToStaticMarkup(node, createRootFn) {
957
+ function renderToStaticMarkup(node) {
1216
958
  const div = document.createElement('div');
1217
959
  (0, react_dom_1.flushSync)(() => {
1218
- if (createRootFn) {
1219
- createRootFn(div).render(node);
1220
- }
1221
- else {
1222
- (0, react_dom_1.render)(node, div);
1223
- }
960
+ (0, client_1.createRoot)(div).render(node);
1224
961
  });
1225
962
  return div.innerHTML.replaceAll(/\brgba\((.+?),[^,]+?\)/g, 'rgb($1)');
1226
963
  }
@@ -1234,8 +971,31 @@ async function fetchAndMaybeUnzip(loc, opts) {
1234
971
  ? await updateStatus('Unzipping', statusCallback, () => (0, bgzf_filehandle_1.unzip)(buf))
1235
972
  : buf;
1236
973
  }
974
+ async function fetchAndMaybeUnzipText(loc, opts) {
975
+ const buffer = await fetchAndMaybeUnzip(loc, opts);
976
+ if (buffer.length > 536870888) {
977
+ throw new Error('Data exceeds maximum string length (512MB)');
978
+ }
979
+ return new TextDecoder('utf8', { fatal: true }).decode(buffer);
980
+ }
981
+ function isObject(x) {
982
+ return typeof x === 'object' && x !== null;
983
+ }
984
+ function localStorageGetNumber(key, defaultVal) {
985
+ var _a;
986
+ return +((_a = localStorageGetItem(key)) !== null && _a !== void 0 ? _a : defaultVal);
987
+ }
988
+ function localStorageGetBoolean(key, defaultVal) {
989
+ return Boolean(JSON.parse(localStorageGetItem(key) || JSON.stringify(defaultVal)));
990
+ }
991
+ function testAdapter(fileName, regex, adapterHint, expected) {
992
+ return (regex.test(fileName) && !adapterHint) || adapterHint === expected;
993
+ }
1237
994
  var simpleFeature_1 = require("./simpleFeature");
1238
- Object.defineProperty(exports, "isFeature", { enumerable: true, get: function () { return simpleFeature_1.isFeature; } });
1239
995
  Object.defineProperty(exports, "SimpleFeature", { enumerable: true, get: function () { return __importDefault(simpleFeature_1).default; } });
996
+ Object.defineProperty(exports, "isFeature", { enumerable: true, get: function () { return simpleFeature_1.isFeature; } });
1240
997
  var blobToDataURL_1 = require("./blobToDataURL");
1241
998
  Object.defineProperty(exports, "blobToDataURL", { enumerable: true, get: function () { return blobToDataURL_1.blobToDataURL; } });
999
+ var makeAbortableReaction_1 = require("./makeAbortableReaction");
1000
+ Object.defineProperty(exports, "makeAbortableReaction", { enumerable: true, get: function () { return makeAbortableReaction_1.makeAbortableReaction; } });
1001
+ __exportStar(require("./aborting"), exports);