@jbrowse/core 5.0.0-beta.7 → 5.0.0-beta.9

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 (379) hide show
  1. package/README.md +427 -130
  2. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +3 -2
  3. package/esm/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +5 -3
  4. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +3 -5
  5. package/esm/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +8 -9
  6. package/esm/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +8 -13
  7. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -1
  8. package/esm/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +3 -3
  9. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.d.ts +8 -0
  10. package/esm/BaseFeatureWidget/BaseFeatureDetail/FieldActionsButton.js +24 -0
  11. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +3 -2
  12. package/esm/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +5 -3
  13. package/esm/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -0
  14. package/esm/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -4
  15. package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.d.ts +16 -0
  16. package/esm/BaseFeatureWidget/BaseFeatureDetail/jexlFilterActions.js +53 -0
  17. package/esm/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +0 -8
  18. package/esm/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -16
  19. package/esm/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +7 -34
  20. package/esm/BaseFeatureWidget/configSchema.d.ts +1 -1
  21. package/esm/BaseFeatureWidget/formatDetails.d.ts +13 -29
  22. package/esm/BaseFeatureWidget/formatDetails.js +46 -79
  23. package/esm/BaseFeatureWidget/index.d.ts +1 -0
  24. package/esm/BaseFeatureWidget/stateModelFactory.d.ts +35 -28
  25. package/esm/BaseFeatureWidget/stateModelFactory.js +94 -102
  26. package/esm/BaseFeatureWidget/types.d.ts +3 -0
  27. package/esm/BaseFeatureWidget/util.d.ts +0 -3
  28. package/esm/BaseFeatureWidget/util.js +0 -17
  29. package/esm/PluginLoader.d.ts +14 -9
  30. package/esm/PluginLoader.js +34 -26
  31. package/esm/PluginManager.d.ts +4 -4
  32. package/esm/PluginManager.js +1 -1
  33. package/esm/ReExports/coreModules.generated.d.ts +2 -0
  34. package/esm/ReExports/coreModules.generated.js +492 -0
  35. package/esm/ReExports/coreWorkerModules.generated.d.ts +2 -0
  36. package/esm/ReExports/coreWorkerModules.generated.js +453 -0
  37. package/esm/ReExports/frameworkModules.d.ts +2 -0
  38. package/esm/ReExports/frameworkModules.js +67 -0
  39. package/esm/ReExports/frameworkShared.d.ts +12 -0
  40. package/esm/ReExports/frameworkShared.js +16 -0
  41. package/esm/ReExports/frameworkWorkerModules.generated.d.ts +2 -0
  42. package/esm/ReExports/frameworkWorkerModules.generated.js +130 -0
  43. package/esm/ReExports/list.js +493 -79
  44. package/esm/ReExports/modules.d.ts +1 -1
  45. package/esm/ReExports/modules.js +10 -87
  46. package/esm/ReExports/registry.d.ts +1 -0
  47. package/esm/ReExports/registry.js +23 -5
  48. package/esm/ReExports/uiStub.d.ts +2 -1
  49. package/esm/ReExports/uiStub.js +24 -2
  50. package/esm/ReExports/workerModules.js +8 -12
  51. package/esm/TextSearch/TextSearchManager.d.ts +3 -12
  52. package/esm/TextSearch/TextSearchManager.js +22 -10
  53. package/esm/assemblyManager/assembly.d.ts +10 -14
  54. package/esm/assemblyManager/assembly.js +10 -14
  55. package/esm/assemblyManager/assemblyConfigSchema.d.ts +23 -81
  56. package/esm/assemblyManager/assemblyManager.d.ts +10 -16
  57. package/esm/assemblyManager/assemblyManager.js +7 -10
  58. package/esm/assemblyManager/loadRefNameMap.js +3 -3
  59. package/esm/configuration/configurationSchema.d.ts +75 -31
  60. package/esm/configuration/configurationSchema.js +74 -40
  61. package/esm/configuration/configurationSchemaUnion.d.ts +39 -0
  62. package/esm/configuration/configurationSchemaUnion.js +59 -0
  63. package/esm/configuration/configurationSlot.d.ts +37 -12
  64. package/esm/configuration/configurationSlot.js +83 -22
  65. package/esm/configuration/formatAboutConfigSchema.d.ts +7 -21
  66. package/esm/configuration/formatDetailsConfigSchema.d.ts +11 -37
  67. package/esm/configuration/formatDetailsConfigSchema.js +10 -13
  68. package/esm/configuration/getConf.d.ts +17 -9
  69. package/esm/configuration/getConf.js +52 -7
  70. package/esm/configuration/index.d.ts +11 -4
  71. package/esm/configuration/index.js +7 -4
  72. package/esm/configuration/mergeFormatCallbacks.d.ts +6 -7
  73. package/esm/configuration/mergeFormatCallbacks.js +13 -10
  74. package/esm/configuration/readConfObject.d.ts +2 -22
  75. package/esm/configuration/readConfObject.js +15 -49
  76. package/esm/configuration/requirements.d.ts +37 -0
  77. package/esm/configuration/requirements.js +88 -0
  78. package/esm/configuration/schemaRegistry.d.ts +21 -1
  79. package/esm/configuration/schemaRegistry.js +11 -0
  80. package/esm/configuration/schemaTypes.d.ts +3 -0
  81. package/esm/configuration/schemaTypes.js +10 -0
  82. package/esm/configuration/slotFacade.d.ts +35 -4
  83. package/esm/configuration/slotFacade.js +96 -9
  84. package/esm/configuration/snapshotPreprocess.d.ts +27 -0
  85. package/esm/configuration/snapshotPreprocess.js +102 -0
  86. package/esm/configuration/types.d.ts +161 -22
  87. package/esm/data_adapters/BaseAdapter/BaseAdapter.d.ts +2 -2
  88. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +11 -2
  89. package/esm/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +12 -1
  90. package/esm/data_adapters/BaseAdapter/featureDensity.d.ts +2 -3
  91. package/esm/data_adapters/BaseAdapter/featureDensity.js +2 -3
  92. package/esm/data_adapters/BaseAdapter/index.d.ts +22 -3
  93. package/esm/data_adapters/BaseAdapter/types.d.ts +3 -4
  94. package/esm/data_adapters/BaseAdapter/zoomRange.d.ts +10 -0
  95. package/esm/data_adapters/BaseAdapter/zoomRange.js +1 -0
  96. package/esm/data_adapters/CytobandAdapter/configSchema.d.ts +9 -11
  97. package/esm/data_adapters/getSequenceSubAdapter.d.ts +1 -3
  98. package/esm/data_adapters/getSequenceSubAdapter.js +1 -3
  99. package/esm/pluggableElementTypes/AdapterType.d.ts +7 -7
  100. package/esm/pluggableElementTypes/RpcMethodType.d.ts +1 -1
  101. package/esm/pluggableElementTypes/RpcMethodType.js +3 -8
  102. package/esm/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +1 -2
  103. package/esm/pluggableElementTypes/TextSearchAdapterType.d.ts +7 -7
  104. package/esm/pluggableElementTypes/index.d.ts +1 -1
  105. package/esm/pluggableElementTypes/index.js +1 -1
  106. package/esm/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +17 -7
  107. package/esm/pluggableElementTypes/models/BaseDisplayModel.d.ts +45 -48
  108. package/esm/pluggableElementTypes/models/BaseDisplayModel.js +40 -36
  109. package/esm/pluggableElementTypes/models/BaseTrackModel.d.ts +10 -13
  110. package/esm/pluggableElementTypes/models/BaseTrackModel.js +6 -6
  111. package/esm/pluggableElementTypes/models/BaseViewModel.d.ts +37 -17
  112. package/esm/pluggableElementTypes/models/BaseViewModel.js +25 -10
  113. package/esm/pluggableElementTypes/models/InternetAccountModel.d.ts +26 -16
  114. package/esm/pluggableElementTypes/models/assertDisplayContract.d.ts +1 -1
  115. package/esm/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -18
  116. package/esm/pluggableElementTypes/models/baseConnectionConfig.js +5 -5
  117. package/esm/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +26 -31
  118. package/esm/pluggableElementTypes/models/baseTrackConfig.d.ts +57 -141
  119. package/esm/pluggableElementTypes/models/baseTrackConfig.js +22 -26
  120. package/esm/pluggableElementTypes/models/components/SaveTrackData.js +2 -2
  121. package/esm/pluggableElementTypes/models/components/fetchTrackData.d.ts +3 -4
  122. package/esm/pluggableElementTypes/models/components/fetchTrackData.js +3 -3
  123. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.d.ts +15 -7
  124. package/esm/pluggableElementTypes/models/expandTrackConfigShorthand.js +38 -29
  125. package/esm/pluggableElementTypes/models/index.d.ts +1 -2
  126. package/esm/pluggableElementTypes/models/index.js +1 -2
  127. package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.d.ts +3 -3
  128. package/esm/pluggableElementTypes/models/saveTrackFileTypes/genbank.js +4 -4
  129. package/esm/pluggableElementTypes/models/saveTrackFileTypes/types.d.ts +3 -3
  130. package/esm/rpc/BaseRpcDriver.d.ts +1 -2
  131. package/esm/rpc/BaseRpcDriver.js +23 -30
  132. package/esm/rpc/MainThreadRpcDriver.d.ts +2 -2
  133. package/esm/rpc/MainThreadRpcDriver.js +13 -8
  134. package/esm/rpc/RpcClient.d.ts +17 -6
  135. package/esm/rpc/RpcClient.js +42 -12
  136. package/esm/rpc/RpcManager.d.ts +8 -10
  137. package/esm/rpc/RpcManager.js +1 -1
  138. package/esm/rpc/RpcRegistry.d.ts +8 -2
  139. package/esm/rpc/RpcServer.d.ts +3 -1
  140. package/esm/rpc/RpcServer.js +19 -12
  141. package/esm/rpc/WebWorkerRpcDriver.d.ts +3 -3
  142. package/esm/rpc/WebWorkerRpcDriver.js +9 -47
  143. package/esm/rpc/byteBudget.d.ts +3 -5
  144. package/esm/rpc/byteBudget.js +4 -4
  145. package/esm/rpc/configSchema.d.ts +7 -21
  146. package/esm/rpc/coreRpcMethods.d.ts +1 -0
  147. package/esm/rpc/coreRpcMethods.js +1 -0
  148. package/esm/rpc/methods/CoreEncodeFeatures.d.ts +6 -5
  149. package/esm/rpc/methods/CoreEncodeFeatures.js +26 -31
  150. package/esm/rpc/methods/CoreGetEncodedFeature.d.ts +13 -0
  151. package/esm/rpc/methods/CoreGetEncodedFeature.js +31 -0
  152. package/esm/rpc/methods/CoreGetExportData.js +2 -2
  153. package/esm/rpc/methods/CoreGetFeatureDensity.js +2 -2
  154. package/esm/rpc/methods/CoreGetFeatures.js +2 -2
  155. package/esm/rpc/methods/CoreGetSequence.js +2 -2
  156. package/esm/rpc/methods/layerFeatures.d.ts +26 -0
  157. package/esm/rpc/methods/layerFeatures.js +40 -0
  158. package/esm/svg/SvgExport.js +3 -4
  159. package/esm/svg/SvgThemeProviders.d.ts +12 -0
  160. package/esm/svg/SvgThemeProviders.js +15 -0
  161. package/esm/svg/exportViewSvg.d.ts +32 -0
  162. package/esm/svg/exportViewSvg.js +13 -0
  163. package/esm/svg/normalizeSvgMarkup.d.ts +7 -0
  164. package/esm/svg/normalizeSvgMarkup.js +99 -0
  165. package/esm/svg/serializeSvg.d.ts +7 -0
  166. package/esm/svg/serializeSvg.js +11 -0
  167. package/esm/svg/svgReady.d.ts +8 -7
  168. package/esm/svg/svgReady.js +8 -7
  169. package/esm/svg/trackNames.d.ts +5 -5
  170. package/esm/svg/trackNames.js +6 -6
  171. package/esm/svg/wrapSvgExport.js +6 -74
  172. package/esm/ui/CascadingMenu.js +83 -86
  173. package/esm/ui/ErrorMessageStackTraceDialog.js +0 -5
  174. package/esm/ui/FileSelector/useInternetAccounts.d.ts +156 -96
  175. package/esm/ui/HoverMenu.d.ts +1 -2
  176. package/esm/ui/HoverMenu.js +6 -3
  177. package/esm/ui/JexlFilterDialog.d.ts +13 -10
  178. package/esm/ui/JexlFilterDialog.js +122 -49
  179. package/esm/ui/JexlFilterRowEditors.d.ts +15 -0
  180. package/esm/ui/JexlFilterRowEditors.js +90 -0
  181. package/esm/ui/LazyBaseTooltip.d.ts +4 -0
  182. package/esm/ui/LazyBaseTooltip.js +9 -0
  183. package/esm/ui/LoadingOverlay.js +3 -1
  184. package/esm/ui/MonospaceTextField.d.ts +2 -1
  185. package/esm/ui/MonospaceTextField.js +21 -19
  186. package/esm/ui/PaletteContext.d.ts +7 -9
  187. package/esm/ui/PaletteContext.js +24 -10
  188. package/esm/ui/RefNameAutocomplete/index.d.ts +1 -2
  189. package/esm/ui/RefNameAutocomplete/index.js +1 -1
  190. package/esm/ui/ScrollChrome.d.ts +6 -9
  191. package/esm/ui/ScrollChrome.js +5 -6
  192. package/esm/ui/ScrollEdgeShadow.d.ts +6 -9
  193. package/esm/ui/ScrollEdgeShadow.js +9 -24
  194. package/esm/ui/SettingsChangesTable.js +3 -3
  195. package/esm/ui/VerticalScrollbar.d.ts +13 -34
  196. package/esm/ui/VerticalScrollbar.js +29 -83
  197. package/esm/ui/ViewLoadingScreen.d.ts +2 -2
  198. package/esm/ui/ViewLoadingScreen.js +3 -3
  199. package/esm/ui/colorScale.d.ts +26 -1
  200. package/esm/ui/colorScale.js +28 -5
  201. package/esm/ui/colors.d.ts +49 -1
  202. package/esm/ui/colors.js +139 -4
  203. package/esm/ui/hoverBoxStyle.d.ts +14 -2
  204. package/esm/ui/hoverBoxStyle.js +17 -2
  205. package/esm/ui/index.d.ts +5 -3
  206. package/esm/ui/index.js +9 -7
  207. package/esm/ui/launchViewMenu.js +3 -3
  208. package/esm/ui/legendSpec.d.ts +2 -0
  209. package/esm/ui/legendSpec.js +3 -0
  210. package/esm/ui/palette.d.ts +0 -1
  211. package/esm/ui/palette.js +3 -27
  212. package/esm/ui/replaceViewAction.d.ts +1 -1
  213. package/esm/ui/replaceViewAction.js +1 -1
  214. package/esm/ui/theme.d.ts +1 -1
  215. package/esm/ui/theme.js +6 -40
  216. package/esm/ui/viewHeaderHeight.d.ts +1 -0
  217. package/esm/ui/viewHeaderHeight.js +1 -0
  218. package/esm/util/Base1DUtils.d.ts +1 -1
  219. package/esm/util/Base1DUtils.js +2 -2
  220. package/esm/util/SvgCanvas.d.ts +15 -13
  221. package/esm/util/SvgCanvas.js +72 -53
  222. package/esm/util/aborting.d.ts +39 -0
  223. package/esm/util/aborting.js +84 -0
  224. package/esm/util/adapterMetadata.d.ts +1 -1
  225. package/esm/util/adapterMetadata.js +6 -6
  226. package/esm/util/addAndShowTrack.d.ts +1 -4
  227. package/esm/util/addRelativeUris.d.ts +10 -2
  228. package/esm/util/addRelativeUris.js +22 -7
  229. package/esm/util/addTrackFromWidget.d.ts +2 -5
  230. package/esm/util/animationAllowed.d.ts +9 -0
  231. package/esm/util/animationAllowed.js +13 -0
  232. package/esm/util/applyRowResizeWheel.d.ts +10 -5
  233. package/esm/util/applyRowResizeWheel.js +10 -21
  234. package/esm/util/bandLayout.d.ts +4 -4
  235. package/esm/util/bandLayout.js +4 -4
  236. package/esm/util/bezierConnector.js +5 -4
  237. package/esm/util/bgzfWorkerPool.d.ts +20 -74
  238. package/esm/util/bgzfWorkerPool.js +20 -74
  239. package/esm/util/cachedSetup.d.ts +1 -1
  240. package/esm/util/cachedSetup.js +2 -2
  241. package/esm/util/categoricalField.d.ts +37 -0
  242. package/esm/util/categoricalField.js +52 -0
  243. package/esm/util/color/cssColorsLevel4.d.ts +1 -0
  244. package/esm/util/color/cssColorsLevel4.js +1 -0
  245. package/esm/util/color/index.d.ts +5 -3
  246. package/esm/util/color/index.js +7 -4
  247. package/esm/util/colorBits.d.ts +1 -2
  248. package/esm/util/colorBits.js +17 -39
  249. package/esm/util/colorRamp.d.ts +27 -1
  250. package/esm/util/colorRamp.js +56 -2
  251. package/esm/util/colorSchemes.d.ts +9 -0
  252. package/esm/util/colorSchemes.js +7 -0
  253. package/esm/util/{createStopTokenRotation.d.ts → createAbortRotation.d.ts} +11 -14
  254. package/esm/util/{createStopTokenRotation.js → createAbortRotation.js} +14 -26
  255. package/esm/util/cssColorParse.d.ts +15 -0
  256. package/esm/util/cssColorParse.js +53 -0
  257. package/esm/util/diagonalizeRegions.d.ts +2 -3
  258. package/esm/util/diagonalizeRegions.js +7 -12
  259. package/esm/util/expandLooseSearchIndex.d.ts +7 -0
  260. package/esm/util/expandLooseSearchIndex.js +25 -0
  261. package/esm/util/featureTransforms.d.ts +30 -3
  262. package/esm/util/featureTransforms.js +233 -36
  263. package/esm/util/fetchAndMaybeUnzip.js +5 -6
  264. package/esm/util/fetchContext.d.ts +5 -6
  265. package/esm/util/fetchContext.js +1 -1
  266. package/esm/util/fetchHub.d.ts +3 -1
  267. package/esm/util/fetchHub.js +2 -2
  268. package/esm/util/fetchSeq.d.ts +2 -3
  269. package/esm/util/fetchSeq.js +2 -2
  270. package/esm/util/fieldReader.d.ts +17 -0
  271. package/esm/util/fieldReader.js +62 -0
  272. package/esm/util/groupKeys.d.ts +75 -0
  273. package/esm/util/groupKeys.js +152 -0
  274. package/esm/util/highlights.d.ts +6 -4
  275. package/esm/util/highlights.js +12 -25
  276. package/esm/util/hooks.d.ts +1 -2
  277. package/esm/util/hooks.js +1 -2
  278. package/esm/util/index.d.ts +3 -3
  279. package/esm/util/index.js +4 -3
  280. package/esm/util/indexCandidates.js +1 -1
  281. package/esm/util/installFetch.d.ts +13 -10
  282. package/esm/util/installFetch.js +11 -10
  283. package/esm/util/installPrerequisiteFetch.d.ts +5 -3
  284. package/esm/util/installPrerequisiteFetch.js +3 -4
  285. package/esm/util/io/index.js +12 -12
  286. package/esm/util/isDataCurrent.d.ts +7 -5
  287. package/esm/util/isDataCurrent.js +9 -6
  288. package/esm/util/jexl.js +24 -21
  289. package/esm/util/jexlFilterRows.d.ts +89 -0
  290. package/esm/util/jexlFilterRows.js +252 -0
  291. package/esm/util/jexlFilters.d.ts +7 -5
  292. package/esm/util/jexlStrings.d.ts +3 -4
  293. package/esm/util/jexlStrings.js +2 -3
  294. package/esm/util/legendCandidates.d.ts +31 -27
  295. package/esm/util/legendCandidates.js +79 -53
  296. package/esm/util/localStorage.js +4 -4
  297. package/esm/util/markEncoding.d.ts +32 -16
  298. package/esm/util/markEncoding.js +177 -150
  299. package/esm/util/markEncodingTypes.d.ts +137 -66
  300. package/esm/util/mstUtils.d.ts +19 -22
  301. package/esm/util/mstUtils.js +19 -22
  302. package/esm/util/numericUtils.d.ts +7 -0
  303. package/esm/util/numericUtils.js +16 -0
  304. package/esm/util/numericValue.d.ts +14 -0
  305. package/esm/util/numericValue.js +34 -0
  306. package/esm/util/openFeatureWidget.js +1 -2
  307. package/esm/util/openViews.d.ts +1 -0
  308. package/esm/util/openViews.js +3 -3
  309. package/esm/util/parseLineByLine.d.ts +3 -4
  310. package/esm/util/parseLineByLine.js +7 -13
  311. package/esm/util/progress.d.ts +21 -21
  312. package/esm/util/progress.js +27 -26
  313. package/esm/util/renameRegions.d.ts +1 -2
  314. package/esm/util/renderToStaticMarkup.js +16 -16
  315. package/esm/util/rxjs.d.ts +7 -8
  316. package/esm/util/rxjs.js +12 -15
  317. package/esm/util/simpleFeature.d.ts +0 -1
  318. package/esm/util/svgColorProps.d.ts +11 -0
  319. package/esm/util/svgColorProps.js +28 -1
  320. package/esm/util/tabix.d.ts +3 -4
  321. package/esm/util/tabix.js +6 -7
  322. package/esm/util/thresholdScale.d.ts +54 -0
  323. package/esm/util/thresholdScale.js +112 -0
  324. package/esm/util/timeGate.d.ts +4 -5
  325. package/esm/util/timeGate.js +4 -5
  326. package/esm/util/trackConfigDelta.d.ts +22 -18
  327. package/esm/util/trackConfigDelta.js +40 -38
  328. package/esm/util/tracks.d.ts +27 -4
  329. package/esm/util/tracks.js +116 -43
  330. package/esm/util/translateTranscript.d.ts +44 -0
  331. package/esm/util/translateTranscript.js +102 -0
  332. package/esm/util/types/index.d.ts +19 -7
  333. package/esm/util/types/services.d.ts +1 -1
  334. package/esm/util/unknownSnapshotKeys.d.ts +15 -0
  335. package/esm/util/unknownSnapshotKeys.js +13 -0
  336. package/esm/util/useFeatureSequence.js +4 -4
  337. package/esm/util/useFetch.d.ts +3 -4
  338. package/esm/util/useFetch.js +5 -6
  339. package/esm/util/usePanelVirtualScroll.d.ts +7 -39
  340. package/esm/util/usePanelVirtualScroll.js +9 -40
  341. package/esm/util/useRowVirtualScroll.d.ts +6 -29
  342. package/esm/util/useRowVirtualScroll.js +8 -49
  343. package/esm/util/useVirtualScrollWheel.d.ts +20 -4
  344. package/esm/util/useVirtualScrollWheel.js +40 -84
  345. package/esm/util/viewHighlights.d.ts +3 -0
  346. package/esm/util/viewHighlights.js +5 -0
  347. package/esm/util/viewStatus.d.ts +24 -15
  348. package/esm/util/viewStatus.js +17 -0
  349. package/esm/util/withLaunchInput.d.ts +1 -1
  350. package/esm/util/withLaunchInput.js +0 -4
  351. package/package.json +26 -12
  352. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.d.ts +0 -80
  353. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/DLGAP3.js +0 -583
  354. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.d.ts +0 -141
  355. package/esm/BaseFeatureWidget/SequenceFeatureDetails/test_data/NCDN.js +0 -1116
  356. package/esm/ReExports/BaseFeatureDetails.d.ts +0 -1
  357. package/esm/ReExports/BaseFeatureDetails.js +0 -10
  358. package/esm/ReExports/barrelOnlyNames.d.ts +0 -5
  359. package/esm/ReExports/barrelOnlyNames.js +0 -63
  360. package/esm/ReExports/index.d.ts +0 -1
  361. package/esm/ReExports/index.js +0 -1
  362. package/esm/ReExports/publicTracks.d.ts +0 -1
  363. package/esm/ReExports/publicTracks.js +0 -14
  364. package/esm/ReExports/publicUi.d.ts +0 -4
  365. package/esm/ReExports/publicUi.js +0 -33
  366. package/esm/ReExports/publicUtil.d.ts +0 -1
  367. package/esm/ReExports/publicUtil.js +0 -32
  368. package/esm/ReExports/sharedModules.d.ts +0 -96
  369. package/esm/ReExports/sharedModules.js +0 -66
  370. package/esm/ReExports/workerNamespaceNames.d.ts +0 -11
  371. package/esm/ReExports/workerNamespaceNames.js +0 -275
  372. package/esm/pluggableElementTypes/models/HighlightsMixin.d.ts +0 -51
  373. package/esm/pluggableElementTypes/models/HighlightsMixin.js +0 -78
  374. package/esm/ui/highlightChipReveal.d.ts +0 -32
  375. package/esm/ui/highlightChipReveal.js +0 -39
  376. package/esm/util/adapterConfigKey.d.ts +0 -12
  377. package/esm/util/adapterConfigKey.js +0 -14
  378. package/esm/util/stopToken.d.ts +0 -212
  379. package/esm/util/stopToken.js +0 -438
@@ -0,0 +1,44 @@
1
+ import type { TranslExcept } from './geneticCodes.ts';
2
+ import type { Feature } from './simpleFeature.ts';
3
+ export interface CdsSegment {
4
+ start: number;
5
+ end: number;
6
+ phase: number;
7
+ }
8
+ /**
9
+ * A transcript's CDS segments in genome coordinates, sorted and deduplicated. A
10
+ * GFF3 file can repeat a CDS row, and the duplicated bases would stitch into
11
+ * the translation and frameshift the protein. A standalone polyprotein CDS
12
+ * carries cleavage products rather than CDS children, so its own span is the
13
+ * one segment.
14
+ */
15
+ export declare function transcriptCDS(transcript: Feature): CdsSegment[];
16
+ /**
17
+ * The genetic code a transcript translates with: a `transl_table` on it or on
18
+ * its CDS, else the assembly's code for its contig, else undefined for the
19
+ * standard code.
20
+ */
21
+ export declare function transcriptGeneticCodeId(transcript: Feature, assemblyGeneticCodeId?: number): number | undefined;
22
+ /**
23
+ * A transcript's `transl_except` overrides (RefSeq's selenocysteines), read off
24
+ * the CDS by NCBI convention or the transcript itself, in the transcript-
25
+ * relative, strand-corrected frame `translateTranscript` translates in.
26
+ */
27
+ export declare function transcriptTranslExcept(transcript: Feature): TranslExcept[] | undefined;
28
+ /**
29
+ * A transcript's protein as JBrowse shows it: its CDS stitched in order, read
30
+ * with its genetic code and that code's alternative initiators, with any
31
+ * `transl_except` applied. `seq` is the genome under the transcript, its start
32
+ * to its end. Undefined for a transcript with no CDS. `cds` and `translExcept`
33
+ * are the transcript-relative, strand-corrected frame the protein was read in,
34
+ * for a caller placing residues back on it.
35
+ */
36
+ export declare function translateTranscript({ transcript, seq, assemblyGeneticCodeId, }: {
37
+ transcript: Feature;
38
+ seq: string;
39
+ assemblyGeneticCodeId?: number;
40
+ }): {
41
+ protein: string;
42
+ cds: CdsSegment[];
43
+ translExcept?: TranslExcept[];
44
+ } | undefined;
@@ -0,0 +1,102 @@
1
+ import { convertCodingSequenceToPeptides } from './convertCodingSequenceToPeptides.js';
2
+ import { getGeneticCode, parseTranslTable, relativizeTranslExcept, } from './geneticCodes.js';
3
+ import { revlist } from './revlist.js';
4
+ import { revcom } from './seqUtils.js';
5
+ function isCDS(feature) {
6
+ return feature.get('type')?.toLowerCase() === 'cds';
7
+ }
8
+ function subfeatures(feature) {
9
+ return feature.get('subfeatures') ?? [];
10
+ }
11
+ /**
12
+ * A transcript's CDS segments in genome coordinates, sorted and deduplicated. A
13
+ * GFF3 file can repeat a CDS row, and the duplicated bases would stitch into
14
+ * the translation and frameshift the protein. A standalone polyprotein CDS
15
+ * carries cleavage products rather than CDS children, so its own span is the
16
+ * one segment.
17
+ */
18
+ export function transcriptCDS(transcript) {
19
+ const seen = new Set();
20
+ const cds = [];
21
+ const sorted = subfeatures(transcript).toSorted((a, b) => a.get('start') - b.get('start'));
22
+ for (const sub of sorted) {
23
+ const start = sub.get('start');
24
+ const end = sub.get('end');
25
+ const key = `${start}-${end}`;
26
+ if (isCDS(sub) && start < end && !seen.has(key)) {
27
+ seen.add(key);
28
+ cds.push({ start, end, phase: sub.get('phase') ?? 0 });
29
+ }
30
+ }
31
+ if (cds.length === 0 && isCDS(transcript)) {
32
+ const start = transcript.get('start');
33
+ const end = transcript.get('end');
34
+ if (start < end) {
35
+ cds.push({ start, end, phase: transcript.get('phase') ?? 0 });
36
+ }
37
+ }
38
+ return cds;
39
+ }
40
+ /**
41
+ * The genetic code a transcript translates with: a `transl_table` on it or on
42
+ * its CDS, else the assembly's code for its contig, else undefined for the
43
+ * standard code.
44
+ */
45
+ export function transcriptGeneticCodeId(transcript, assemblyGeneticCodeId) {
46
+ const cds = subfeatures(transcript).find(isCDS);
47
+ return (parseTranslTable(transcript.get('transl_table')) ??
48
+ parseTranslTable(cds?.get('transl_table')) ??
49
+ assemblyGeneticCodeId);
50
+ }
51
+ /**
52
+ * A transcript's `transl_except` overrides (RefSeq's selenocysteines), read off
53
+ * the CDS by NCBI convention or the transcript itself, in the transcript-
54
+ * relative, strand-corrected frame `translateTranscript` translates in.
55
+ */
56
+ export function transcriptTranslExcept(transcript) {
57
+ const cds = subfeatures(transcript).find(isCDS);
58
+ const raw = transcript.get('transl_except') ?? cds?.get('transl_except');
59
+ const start = transcript.get('start');
60
+ return raw
61
+ ? relativizeTranslExcept({
62
+ raw,
63
+ featureStart: start,
64
+ featureLength: transcript.get('end') - start,
65
+ strand: transcript.get('strand'),
66
+ })
67
+ : undefined;
68
+ }
69
+ /**
70
+ * A transcript's protein as JBrowse shows it: its CDS stitched in order, read
71
+ * with its genetic code and that code's alternative initiators, with any
72
+ * `transl_except` applied. `seq` is the genome under the transcript, its start
73
+ * to its end. Undefined for a transcript with no CDS. `cds` and `translExcept`
74
+ * are the transcript-relative, strand-corrected frame the protein was read in,
75
+ * for a caller placing residues back on it.
76
+ */
77
+ export function translateTranscript({ transcript, seq, assemblyGeneticCodeId, }) {
78
+ const start = transcript.get('start');
79
+ const relative = transcriptCDS(transcript).map(c => ({
80
+ ...c,
81
+ start: c.start - start,
82
+ end: c.end - start,
83
+ }));
84
+ if (relative.length === 0) {
85
+ return undefined;
86
+ }
87
+ const minus = transcript.get('strand') === -1;
88
+ const cds = minus ? revlist(relative, seq.length) : relative;
89
+ const translExcept = transcriptTranslExcept(transcript);
90
+ const { codonTable, starts } = getGeneticCode(transcriptGeneticCodeId(transcript, assemblyGeneticCodeId));
91
+ return {
92
+ protein: convertCodingSequenceToPeptides({
93
+ cds,
94
+ sequence: minus ? revcom(seq) : seq,
95
+ codonTable,
96
+ starts,
97
+ translExcept,
98
+ }),
99
+ cds,
100
+ translExcept,
101
+ };
102
+ }
@@ -1,10 +1,11 @@
1
1
  import type { ViewSnapshotInput } from '../../PluginManager.ts';
2
2
  import type TextSearchManager from '../../TextSearch/TextSearchManager.ts';
3
3
  import type { AnyConfigurationModel } from '../../configuration/index.ts';
4
- import type { BaseInternetAccountModel } from '../../pluggableElementTypes/models/index.ts';
4
+ import type { BaseInternetAccountModel, BaseTrackConfig } from '../../pluggableElementTypes/models/index.ts';
5
5
  import type { PluginDefinition } from '../../pluginDefinitions.ts';
6
6
  import type RpcManager from '../../rpc/RpcManager.ts';
7
7
  import type { MenuItem } from '../../ui/index.ts';
8
+ import type { HighlightType } from '../highlights.ts';
8
9
  import type { Feature } from '../simpleFeature.ts';
9
10
  import type { TrackConfigChange } from '../trackConfigDelta.ts';
10
11
  import type { UriLocation } from './data.ts';
@@ -66,6 +67,7 @@ export interface AbstractSessionModel extends AbstractViewContainer, RenderingSe
66
67
  jbrowse: IAnyStateTreeNode;
67
68
  drawerPosition?: DrawerPosition;
68
69
  stickyViewHeaders?: boolean;
70
+ viewTitleBars?: boolean;
69
71
  configuration: AnyConfigurationModel;
70
72
  rpcManager: RpcManager;
71
73
  assemblyNames: string[];
@@ -75,9 +77,13 @@ export interface AbstractSessionModel extends AbstractViewContainer, RenderingSe
75
77
  theme: Theme;
76
78
  animationMode: AnimationMode;
77
79
  scrollZoom: boolean;
80
+ highlights: readonly HighlightType[];
81
+ addHighlight: (highlight: HighlightType) => void;
82
+ removeHighlight: (highlight: HighlightType) => void;
83
+ updateHighlight: (old: HighlightType, updates: Partial<HighlightType>) => void;
84
+ setHighlights: (highlights: HighlightType[]) => void;
78
85
  highlightsVisible: boolean;
79
86
  setHighlightsVisible: (arg: boolean) => void;
80
- revealHighlights: () => void;
81
87
  getPreference: (key: string) => unknown;
82
88
  setPreferenceOverride: (key: string, value: unknown) => void;
83
89
  clearPreferenceOverrides: () => void;
@@ -101,11 +107,11 @@ export interface AbstractSessionModel extends AbstractViewContainer, RenderingSe
101
107
  version: string;
102
108
  gitCommit?: string;
103
109
  getTrackActionMenuItems?: (arg: {
104
- config: AnyConfigurationModel;
110
+ config: BaseTrackConfig;
105
111
  view?: TrackActionView;
106
112
  }) => MenuItem[];
107
- getTrackActions?: (arg: AnyConfigurationModel, view?: TrackActionView) => MenuItem[];
108
- getTrackListMenuItems?: (arg: AnyConfigurationModel, view?: TrackActionView) => MenuItem[];
113
+ getTrackActions?: (arg: BaseTrackConfig, view?: TrackActionView) => MenuItem[];
114
+ getTrackListMenuItems?: (arg: BaseTrackConfig, view?: TrackActionView) => MenuItem[];
109
115
  addAssembly?: (conf: Record<string, unknown>) => void;
110
116
  addSessionAssembly?: (conf: Record<string, unknown>) => void;
111
117
  sessionAssemblies?: AnyConfigurationModel[];
@@ -310,6 +316,9 @@ export interface SessionWithWidgets extends AbstractSessionModel {
310
316
  addWidget(typeName: string, id: string, initialState?: Record<string, unknown>, configuration?: {
311
317
  type: string;
312
318
  }): Widget;
319
+ openWidget(typeName: string, id: string, initialState?: Record<string, unknown>, configuration?: {
320
+ type: string;
321
+ }): Widget;
313
322
  showWidget(widget: unknown): void;
314
323
  hideWidget(widget: unknown): void;
315
324
  }
@@ -463,10 +472,13 @@ export interface AbstractViewModel {
463
472
  /**
464
473
  * The same, counting the views this one is nested inside — a synteny row has
465
474
  * no container of its own to write `bodyMounted`, so that flag alone reads
466
- * `true` for a row whose whole stack is off screen. This is what a display's
475
+ * `true` for a row whose whole stack is off screen — and false while the body
476
+ * renders none of its displays (`rendersDisplays`). This is what a display's
467
477
  * phase asks.
468
478
  */
469
479
  effectiveBodyMounted: boolean;
480
+ /** See `BaseViewModel.rendersDisplays`. */
481
+ rendersDisplays: boolean;
470
482
  setWidth(width: number): void;
471
483
  setBodyMounted(flag: boolean): void;
472
484
  setMinimized(flag: boolean): void;
@@ -517,7 +529,7 @@ type Display = {
517
529
  export interface AbstractTrackModel {
518
530
  id: string;
519
531
  displays: AbstractDisplayModel[];
520
- configuration: AnyConfigurationModel & {
532
+ configuration: BaseTrackConfig & {
521
533
  displays: Display[];
522
534
  };
523
535
  minimized: boolean;
@@ -38,7 +38,7 @@ export type DialogComponentType = React.LazyExoticComponent<React.FC<any>> | Rea
38
38
  * dialog. It is the most-called session member from plugin code (49 sites), and
39
39
  * nearly all of them are a display saying "the user wants to configure
40
40
  * something" — so a host drawing its own UI needs exactly this one name, not a
41
- * session. `agent-docs/ideas/lightweight-toolkit.md` §3.
41
+ * session. `agent-docs/ideas/waiting-on-a-call/lightweight-toolkit.md` §3.
42
42
  */
43
43
  export interface DialogHost {
44
44
  DialogComponent?: DialogComponentType;
@@ -8,6 +8,21 @@ export declare function viewLabel(self: IStateTreeNode): string;
8
8
  * a typo reads the same whether it was written in a config or in a URL.
9
9
  */
10
10
  export declare function unknownKeysMessage(label: string, keys: string[]): string;
11
+ /** Why a settings key `applyDisplaySettings` was handed wrote nothing. */
12
+ export type UnappliedReason = 'no-slot' | 'setter-only' | 'display-type';
13
+ export interface UnappliedSetting {
14
+ key: string;
15
+ reason: UnappliedReason;
16
+ }
17
+ /** The action `setter-only` names: `height` -> `setHeight`. */
18
+ export declare function displaySetterName(key: string): string;
19
+ /**
20
+ * What a surface calls a key the display has an action for but no slot. Its own
21
+ * sentence rather than `unknownKeysMessage`'s: the display does take the
22
+ * setting, just not written this way, and saying "unknown key" over a key whose
23
+ * setter we name in the same breath contradicts itself.
24
+ */
25
+ export declare function setterOnlyMessage(label: string, keys: string[]): string;
11
26
  /**
12
27
  * Name the keys a view was handed and could not place, from the partition
13
28
  * `withLaunchInput` runs on the snapshot.
@@ -13,6 +13,19 @@ export function viewLabel(self) {
13
13
  export function unknownKeysMessage(label, keys) {
14
14
  return `${label} ignored unknown key(s): ${keys.join(', ')}`;
15
15
  }
16
+ /** The action `setter-only` names: `height` -> `setHeight`. */
17
+ export function displaySetterName(key) {
18
+ return `set${key[0].toUpperCase()}${key.slice(1)}`;
19
+ }
20
+ /**
21
+ * What a surface calls a key the display has an action for but no slot. Its own
22
+ * sentence rather than `unknownKeysMessage`'s: the display does take the
23
+ * setting, just not written this way, and saying "unknown key" over a key whose
24
+ * setter we name in the same breath contradicts itself.
25
+ */
26
+ export function setterOnlyMessage(label, keys) {
27
+ return `${label} did not apply ${keys.join(', ')}: no config slot takes ${keys.length > 1 ? 'them' : 'it'}. Call ${keys.map(displaySetterName).join(', ')} on the display instead.`;
28
+ }
16
29
  /**
17
30
  * Name the keys a view was handed and could not place, from the partition
18
31
  * `withLaunchInput` runs on the snapshot.
@@ -15,7 +15,7 @@ export function useFeatureSequence({ session, start, end, refName, upDownBp, for
15
15
  +forceLoad,
16
16
  ]
17
17
  : null, guard
18
- ? async (_name, _asm, _ref, _start, _end, _upDown, _force, stopToken, statusCallback) => {
18
+ ? async (_name, _asm, _ref, _start, _end, _upDown, _force, signal, statusCallback) => {
19
19
  const { session: s, assemblyName: asmName } = guard;
20
20
  if (!forceLoad && end - start > BPLIMIT) {
21
21
  return {
@@ -32,7 +32,7 @@ export function useFeatureSequence({ session, start, end, refName, upDownBp, for
32
32
  refName,
33
33
  assemblyName: asmName,
34
34
  session: s,
35
- stopToken,
35
+ signal,
36
36
  statusCallback: slot(),
37
37
  }),
38
38
  upDownBp > 0
@@ -42,7 +42,7 @@ export function useFeatureSequence({ session, start, end, refName, upDownBp, for
42
42
  refName,
43
43
  assemblyName: asmName,
44
44
  session: s,
45
- stopToken,
45
+ signal,
46
46
  statusCallback: slot(),
47
47
  })
48
48
  : Promise.resolve(''),
@@ -53,7 +53,7 @@ export function useFeatureSequence({ session, start, end, refName, upDownBp, for
53
53
  refName,
54
54
  assemblyName: asmName,
55
55
  session: s,
56
- stopToken,
56
+ signal,
57
57
  statusCallback: slot(),
58
58
  })
59
59
  : Promise.resolve(''),
@@ -1,5 +1,4 @@
1
1
  import type { RpcStatus, StatusCallback } from './progress.ts';
2
- import type { StopToken } from './stopToken.ts';
3
2
  export type FetchKey = string | readonly unknown[] | null | undefined | false;
4
3
  type FetchingKey<Key> = Exclude<Key, null | undefined | false>;
5
4
  /**
@@ -10,8 +9,8 @@ type FetchingKey<Key> = Exclude<Key, null | undefined | false>;
10
9
  * single argument (`useGenomesData`). Most fetchers close over what they need
11
10
  * and declare no parameters at all, which stays assignable either way.
12
11
  *
13
- * A stop token and a status callback follow the key arguments. The token is
14
- * created per fetch and stopped when the key changes or the component unmounts,
12
+ * A signal and a status callback follow the key arguments. The signal is
13
+ * created per fetch and aborted when the key changes or the component unmounts,
15
14
  * so a fetcher that forwards it to an RPC cancels the worker instead of leaving
16
15
  * it grinding on an answer nobody is waiting for. The callback is what the RPC's
17
16
  * own progress comes back through, and it surfaces on the hook's `status` — a
@@ -19,7 +18,7 @@ type FetchingKey<Key> = Exclude<Key, null | undefined | false>;
19
18
  * works, instead of a bare spinner over an uninterruptible whole-chromosome
20
19
  * read. Fetchers that take neither are unaffected.
21
20
  */
22
- type FetcherArgs<Key> = FetchingKey<Key> extends readonly unknown[] ? [...FetchingKey<Key>, StopToken, StatusCallback] : [FetchingKey<Key>, StopToken, StatusCallback];
21
+ type FetcherArgs<Key> = FetchingKey<Key> extends readonly unknown[] ? [...FetchingKey<Key>, AbortSignal, StatusCallback] : [FetchingKey<Key>, AbortSignal, StatusCallback];
23
22
  interface FetchState<Data> {
24
23
  data: Data | undefined;
25
24
  error: unknown;
@@ -1,6 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { createStatusWindow } from './progress.js';
3
- import { createStopToken, stopStopToken } from './stopToken.js';
4
3
  const isNil = (k) => k === null || k === undefined || k === false;
5
4
  // A null result means "don't fetch": no key, or an array key with a missing
6
5
  // piece (e.g. an offset that isn't resolved yet).
@@ -85,7 +84,7 @@ export function useFetch(key, fetcher, options = {}) {
85
84
  // fetch resolved is a different case, and the stream's own `clear` drops
86
85
  // that one.)
87
86
  let settled = false;
88
- const stopToken = createStopToken();
87
+ const controller = new AbortController();
89
88
  // A refetch under the same key — mutate(), or the cross-component
90
89
  // mutate(key) — is the same question asked again, so what is on screen is
91
90
  // a stale answer to it rather than an answer to something else: leave it
@@ -107,7 +106,7 @@ export function useFetch(key, fetcher, options = {}) {
107
106
  setStatus(undefined);
108
107
  // The runtime counterpart of FetcherArgs: an array key becomes one
109
108
  // argument per element, anything else a single argument, then the stop
110
- // token and the status callback. A conditional type over an unresolved
109
+ // signal and the status callback. A conditional type over an unresolved
111
110
  // `Key` can't be discharged
112
111
  // inside the function body, so the parameter list is erased for this one
113
112
  // call — callers still get the precise arity, and the looseness stops
@@ -127,7 +126,7 @@ export function useFetch(key, fetcher, options = {}) {
127
126
  const { statusCallback, clear: clearStatus } = statusWindow.open({
128
127
  isCurrent: () => alive && !settled,
129
128
  });
130
- const args = [...keyArgs, stopToken, statusCallback];
129
+ const args = [...keyArgs, controller.signal, statusCallback];
131
130
  const call = fetcher;
132
131
  Promise.resolve()
133
132
  .then(() => call(...args))
@@ -151,9 +150,9 @@ export function useFetch(key, fetcher, options = {}) {
151
150
  });
152
151
  return () => {
153
152
  alive = false;
154
- // the token's lifetime is this fetch's. An abort rejection lands in the
153
+ // the signal's lifetime is this fetch's. An abort rejection lands in the
155
154
  // catch above with alive already false, so it never surfaces as an error
156
- stopStopToken(stopToken);
155
+ controller.abort();
157
156
  // and the window's lifetime is too: `alive` already makes a queued
158
157
  // trailing write a no-op, but the timer behind it would otherwise stand
159
158
  // for up to a window past unmount
@@ -1,41 +1,9 @@
1
- interface PanelScrollTarget {
2
- scrollTop: number;
3
- scrollableHeight: number;
4
- setScrollTop: (n: number) => void;
5
- }
1
+ import type { VirtualScrollModel } from './useVirtualScrollWheel.ts';
6
2
  /**
7
- * Wheel gestures over a **scrolled canvas panel** — the alignments pileup and
8
- * the canvas basic display: a plain wheel scrolls it, `shift` keeps scrolling it
9
- * once `scrollZoom` has claimed the plain wheel for the view, and ctrl/meta is
10
- * left to the browser and the view's pinch-zoom. Nothing here resizes anything.
11
- * A sideways-dominant wheel is the view's pan and is declined
12
- * (`useVirtualScrollWheel`, which says what latching does with that).
13
- *
14
- * These panels paint a fixed-size canvas at `-scrollTop` rather than living in a
15
- * DOM overflow container, so nothing scrolls them without this. The latch (inside
16
- * `applyScroll`) owns `preventDefault` but never `stopPropagation`: the event
17
- * still reaches the LGV, which reads that flag and declines a gesture this panel
18
- * has claimed, so a diagonal wheel scrolls the reads without also panning the
19
- * genome sideways.
20
- *
21
- * ADR-027 keeps wheel-*intent* dispatch per handler, because the panels do not
22
- * agree on what a gesture means. This is the second of the two rules that
23
- * survived that split — the row-stack rule (`useRowVirtualScroll`, where `shift`
24
- * resizes) is the other — and the two displays sharing it had byte-identical
25
- * copies differing only in which getter named the viewport. The canvas display
26
- * converged here when it moved off a native overflow container; the ADR's table
27
- * still described its pre-virtual-scroll rule and has been corrected.
28
- *
29
- * `scrollZoom` and `viewportHeight` are inputs rather than reads off the model,
30
- * so core needs no view typing and each display keeps naming its own viewport
31
- * (the pileup's excludes the sticky coverage band; the canvas display's is the
32
- * whole track).
33
- *
34
- * `panel` is the element wrapping the canvas AND the DOM overlays drawn over it,
35
- * never the canvas alone — see `useVirtualScrollWheel`, which says why.
3
+ * Wheel gestures over a **scrolled canvas panel** — the alignments pileup, the
4
+ * canvas feature display, multi-way synteny: a plain wheel scrolls it, `shift`
5
+ * still scrolls it once `scrollZoom` has given the plain wheel to the view, and
6
+ * ctrl/meta is left to the browser and the view's pinch-zoom. The row-stack
7
+ * rule, where `shift` resizes, is `useRowVirtualScroll` (ADR-027).
36
8
  */
37
- export declare function usePanelVirtualScroll(panel: HTMLElement | null, model: PanelScrollTarget, { viewportHeight, scrollZoom, }: {
38
- viewportHeight: number;
39
- scrollZoom: boolean;
40
- }): void;
41
- export {};
9
+ export declare function usePanelVirtualScroll(panel: HTMLElement | null, model: VirtualScrollModel, scrollZoom: boolean): void;
@@ -1,46 +1,15 @@
1
1
  import { useVirtualScrollWheel } from './useVirtualScrollWheel.js';
2
2
  /**
3
- * Wheel gestures over a **scrolled canvas panel** — the alignments pileup and
4
- * the canvas basic display: a plain wheel scrolls it, `shift` keeps scrolling it
5
- * once `scrollZoom` has claimed the plain wheel for the view, and ctrl/meta is
6
- * left to the browser and the view's pinch-zoom. Nothing here resizes anything.
7
- * A sideways-dominant wheel is the view's pan and is declined
8
- * (`useVirtualScrollWheel`, which says what latching does with that).
9
- *
10
- * These panels paint a fixed-size canvas at `-scrollTop` rather than living in a
11
- * DOM overflow container, so nothing scrolls them without this. The latch (inside
12
- * `applyScroll`) owns `preventDefault` but never `stopPropagation`: the event
13
- * still reaches the LGV, which reads that flag and declines a gesture this panel
14
- * has claimed, so a diagonal wheel scrolls the reads without also panning the
15
- * genome sideways.
16
- *
17
- * ADR-027 keeps wheel-*intent* dispatch per handler, because the panels do not
18
- * agree on what a gesture means. This is the second of the two rules that
19
- * survived that split — the row-stack rule (`useRowVirtualScroll`, where `shift`
20
- * resizes) is the other — and the two displays sharing it had byte-identical
21
- * copies differing only in which getter named the viewport. The canvas display
22
- * converged here when it moved off a native overflow container; the ADR's table
23
- * still described its pre-virtual-scroll rule and has been corrected.
24
- *
25
- * `scrollZoom` and `viewportHeight` are inputs rather than reads off the model,
26
- * so core needs no view typing and each display keeps naming its own viewport
27
- * (the pileup's excludes the sticky coverage band; the canvas display's is the
28
- * whole track).
29
- *
30
- * `panel` is the element wrapping the canvas AND the DOM overlays drawn over it,
31
- * never the canvas alone — see `useVirtualScrollWheel`, which says why.
3
+ * Wheel gestures over a **scrolled canvas panel** — the alignments pileup, the
4
+ * canvas feature display, multi-way synteny: a plain wheel scrolls it, `shift`
5
+ * still scrolls it once `scrollZoom` has given the plain wheel to the view, and
6
+ * ctrl/meta is left to the browser and the view's pinch-zoom. The row-stack
7
+ * rule, where `shift` resizes, is `useRowVirtualScroll` (ADR-027).
32
8
  */
33
- export function usePanelVirtualScroll(panel, model, { viewportHeight, scrollZoom, }) {
34
- useVirtualScrollWheel(panel, (e, applyScroll) => {
35
- if ((scrollZoom && !e.shiftKey) || e.ctrlKey || e.metaKey) {
36
- return;
9
+ export function usePanelVirtualScroll(panel, model, scrollZoom) {
10
+ useVirtualScrollWheel(panel, model, (e, scroll) => {
11
+ if ((!scrollZoom || e.shiftKey) && !e.ctrlKey && !e.metaKey) {
12
+ scroll();
37
13
  }
38
- applyScroll(e, {
39
- scrollTop: model.scrollTop,
40
- viewportHeight,
41
- scrollableHeight: model.scrollableHeight,
42
- }, n => {
43
- model.setScrollTop(n);
44
- });
45
14
  });
46
15
  }
@@ -1,32 +1,9 @@
1
- interface RowScrollTarget {
2
- effectiveRowHeight: number;
3
- scrollTop: number;
4
- nrow: number;
5
- scrollableHeight: number;
6
- setRowHeight: (n: number) => void;
7
- setScrollTop: (n: number) => void;
8
- }
1
+ import type { RowResizeTarget } from './applyRowResizeWheel.ts';
9
2
  /**
10
3
  * Wheel gestures over a **row-stack** panel — the multi-sample variant displays
11
- * and MAF: `shift`+wheel resizes the rows (a vertical-zoom that keeps the row
12
- * under the cursor put), a plain wheel scrolls them, and anything the panel
13
- * can't consume — a sideways swipe included — is left to bubble to the view.
14
- *
15
- * These panels paint a fixed-size canvas at `-scrollTop` rather than living in a
16
- * DOM overflow container, so nothing scrolls them without this.
17
- *
18
- * ADR-027 keeps wheel-*intent* dispatch per handler, because the four panels do
19
- * not agree on what a gesture means — and that still holds. This is the one rule
20
- * two of them genuinely share, which the ADR states outright ("same rule as the
21
- * variant displays, and deliberately so: same sample-row shape, same coupled
22
- * row-height axis"). It is unified for exactly that reason, and no further: the
23
- * pileup / canvas-basic rule (`shift` scrolls, nothing resizes) stays where it
24
- * is. `scrollZoom` and `viewportHeight` are inputs rather than reads off the
25
- * model, so core needs no view typing and each display keeps naming its own
26
- * rows-area height.
4
+ * and MAF: `shift`+wheel resizes the rows, keeping the row under the cursor
5
+ * put, and a plain wheel scrolls them unless `scrollZoom` gave it to the view.
6
+ * ctrl/meta is the browser's zoom whatever else is held. The canvas-panel rule,
7
+ * where `shift` scrolls, is `usePanelVirtualScroll` (ADR-027).
27
8
  */
28
- export declare function useRowVirtualScroll(el: HTMLElement | null, model: RowScrollTarget, { viewportHeight, scrollZoom, }: {
29
- viewportHeight: number;
30
- scrollZoom: boolean;
31
- }): void;
32
- export {};
9
+ export declare function useRowVirtualScroll(el: HTMLElement | null, model: RowResizeTarget, scrollZoom: boolean): void;
@@ -2,62 +2,21 @@ import { applyRowResizeWheel } from './applyRowResizeWheel.js';
2
2
  import { useVirtualScrollWheel } from './useVirtualScrollWheel.js';
3
3
  /**
4
4
  * Wheel gestures over a **row-stack** panel — the multi-sample variant displays
5
- * and MAF: `shift`+wheel resizes the rows (a vertical-zoom that keeps the row
6
- * under the cursor put), a plain wheel scrolls them, and anything the panel
7
- * can't consume — a sideways swipe included — is left to bubble to the view.
8
- *
9
- * These panels paint a fixed-size canvas at `-scrollTop` rather than living in a
10
- * DOM overflow container, so nothing scrolls them without this.
11
- *
12
- * ADR-027 keeps wheel-*intent* dispatch per handler, because the four panels do
13
- * not agree on what a gesture means — and that still holds. This is the one rule
14
- * two of them genuinely share, which the ADR states outright ("same rule as the
15
- * variant displays, and deliberately so: same sample-row shape, same coupled
16
- * row-height axis"). It is unified for exactly that reason, and no further: the
17
- * pileup / canvas-basic rule (`shift` scrolls, nothing resizes) stays where it
18
- * is. `scrollZoom` and `viewportHeight` are inputs rather than reads off the
19
- * model, so core needs no view typing and each display keeps naming its own
20
- * rows-area height.
5
+ * and MAF: `shift`+wheel resizes the rows, keeping the row under the cursor
6
+ * put, and a plain wheel scrolls them unless `scrollZoom` gave it to the view.
7
+ * ctrl/meta is the browser's zoom whatever else is held. The canvas-panel rule,
8
+ * where `shift` scrolls, is `usePanelVirtualScroll` (ADR-027).
21
9
  */
22
- export function useRowVirtualScroll(el, model, { viewportHeight, scrollZoom, }) {
23
- useVirtualScrollWheel(el, (e, applyScroll, rowsEl) => {
24
- // ctrl/meta is the browser's own zoom (and the view's pinch-zoom) and is
25
- // never ours, whatever else is held. Tested first rather than only in the
26
- // scroll branch: ctrl+shift+wheel used to reach the resize below, which
27
- // `preventDefault`s — so a row-stack display swallowed page zoom where
28
- // every other display passes it through.
10
+ export function useRowVirtualScroll(el, model, scrollZoom) {
11
+ useVirtualScrollWheel(el, model, (e, scroll, rowsEl) => {
29
12
  if (e.ctrlKey || e.metaKey) {
30
13
  return;
31
14
  }
32
15
  if (e.shiftKey) {
33
- // Resizing exits fit-to-height into a pinned height, which is what makes
34
- // the gesture meaningful: the fit height is exactly the floor it shrinks
35
- // to, so there is nothing to zoom while the sentinel is set.
36
- applyRowResizeWheel(e, rowsEl, {
37
- effectiveRowHeight: model.effectiveRowHeight,
38
- scrollTop: model.scrollTop,
39
- nrow: model.nrow,
40
- viewportHeight,
41
- setRowHeight: n => {
42
- model.setRowHeight(n);
43
- },
44
- setScrollTop: n => {
45
- model.setScrollTop(n);
46
- },
47
- });
16
+ applyRowResizeWheel(e, rowsEl, model);
48
17
  }
49
18
  else if (!scrollZoom) {
50
- // A gesture the panel can't consume is left alone: with the rows fitting
51
- // the track (`scrollableHeight === 0`, always true in fit-to-height mode)
52
- // the wheel reaches the view and zooms or scrolls the page exactly as it
53
- // does over any other track. Same for the explicit zoom gestures.
54
- applyScroll(e, {
55
- scrollTop: model.scrollTop,
56
- viewportHeight,
57
- scrollableHeight: model.scrollableHeight,
58
- }, n => {
59
- model.setScrollTop(n);
60
- });
19
+ scroll();
61
20
  }
62
21
  });
63
22
  }
@@ -1,7 +1,23 @@
1
- export interface VirtualScrollOpts {
1
+ /**
2
+ * What a virtually scrolled panel reads and writes. `TrackHeightMixin`
3
+ * implements it, so a display passes itself.
4
+ */
5
+ export interface VirtualScrollModel {
2
6
  scrollTop: number;
3
- viewportHeight: number;
7
+ /** 0 when the content fits; never sub-pixel */
4
8
  scrollableHeight: number;
9
+ scrollViewportHeight: number;
10
+ setScrollTop: (scrollTop: number) => void;
5
11
  }
6
- export type ApplyVirtualScroll = (e: WheelEvent, opts: VirtualScrollOpts, commit: (scrollTop: number) => void) => void;
7
- export declare function useVirtualScrollWheel(panel: HTMLElement | null, onWheel: (e: WheelEvent, applyScroll: ApplyVirtualScroll, el: HTMLElement) => void): void;
12
+ /**
13
+ * Non-passive wheel wiring for a canvas-backed virtual scroll. Owns the scroll
14
+ * latch (and so `preventDefault`), per-frame coalescing of `setScrollTop`, and
15
+ * the listener lifecycle. `onWheel` decides what the gesture means and calls
16
+ * `scroll` when it means scrolling `model`.
17
+ *
18
+ * **Bind this to the panel, not to the `<canvas>`.** A canvas holds no DOM
19
+ * children, so the clickable overlays drawn over it are siblings, and a wheel
20
+ * over one never reaches a listener on the canvas. Overlays that run their own
21
+ * gestures opt out with `[data-gesture-owner]`.
22
+ */
23
+ export declare function useVirtualScrollWheel(panel: HTMLElement | null, model: VirtualScrollModel, onWheel: (e: WheelEvent, scroll: () => void, panel: HTMLElement) => void): void;