@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.2

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 (357) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +104 -65
  2. package/esm/FeatureTrack/configSchema.js +47 -1
  3. package/esm/FeatureTrack/index.js +1 -1
  4. package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
  5. package/esm/LaunchLinearGenomeView/index.js +6 -12
  6. package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
  7. package/esm/LinearGenomeView/afterAttach.js +250 -121
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +16 -7
  10. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
  11. package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
  12. package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
  13. package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
  14. package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
  15. package/esm/LinearGenomeView/components/Cytobands.js +76 -53
  16. package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
  18. package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
  19. package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
  20. package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
  21. package/esm/LinearGenomeView/components/Gridlines.js +29 -58
  22. package/esm/LinearGenomeView/components/Header.d.ts +1 -1
  23. package/esm/LinearGenomeView/components/Header.js +32 -16
  24. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
  25. package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
  26. package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
  27. package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
  28. package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
  29. package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
  30. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
  31. package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
  32. package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
  33. package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
  34. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
  35. package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
  36. package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
  37. package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +19 -23
  40. package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
  41. package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
  42. package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
  44. package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
  45. package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
  46. package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
  47. package/esm/LinearGenomeView/components/ImportForm.js +95 -61
  48. package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
  49. package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +13 -10
  54. package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
  55. package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
  56. package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
  57. package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
  58. package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
  59. package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
  60. package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
  61. package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
  62. package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
  63. package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
  66. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
  67. package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
  68. package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
  69. package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
  72. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
  73. package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
  74. package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
  75. package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
  78. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
  79. package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
  80. package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
  81. package/esm/LinearGenomeView/components/Rubberband.js +13 -16
  82. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  83. package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
  84. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
  85. package/esm/LinearGenomeView/components/Scalebar.js +16 -21
  86. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  87. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  88. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
  90. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  91. package/esm/LinearGenomeView/components/SearchBox.js +58 -66
  92. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  93. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  94. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
  95. package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
  96. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
  97. package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
  98. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  99. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  102. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  103. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  104. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
  105. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  106. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  107. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  108. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  109. package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
  110. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  111. package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
  112. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  113. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  114. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  115. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  116. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  117. package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
  118. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  119. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  120. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
  121. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
  122. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  123. package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
  124. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
  126. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  127. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  128. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  129. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  130. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  131. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  132. package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
  133. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  134. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  135. package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
  136. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  137. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  138. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  139. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  140. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
  141. package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
  142. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  143. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  144. package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
  145. package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
  146. package/esm/LinearGenomeView/components/util.d.ts +20 -6
  147. package/esm/LinearGenomeView/components/util.js +27 -6
  148. package/esm/LinearGenomeView/consts.d.ts +7 -2
  149. package/esm/LinearGenomeView/consts.js +18 -2
  150. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  151. package/esm/LinearGenomeView/flyTo.js +135 -0
  152. package/esm/LinearGenomeView/headerFit.d.ts +27 -0
  153. package/esm/LinearGenomeView/headerFit.js +59 -0
  154. package/esm/LinearGenomeView/index.d.ts +32 -2
  155. package/esm/LinearGenomeView/index.js +16 -6
  156. package/esm/LinearGenomeView/initKeys.d.ts +12 -0
  157. package/esm/LinearGenomeView/initKeys.js +68 -0
  158. package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
  159. package/esm/LinearGenomeView/keyboardHandler.js +10 -0
  160. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  161. package/esm/LinearGenomeView/launchKeys.js +23 -0
  162. package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
  163. package/esm/LinearGenomeView/lazyDialogs.js +3 -3
  164. package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
  165. package/esm/LinearGenomeView/linkedViewSync.js +58 -0
  166. package/esm/LinearGenomeView/menuItems.d.ts +27 -2
  167. package/esm/LinearGenomeView/menuItems.js +137 -101
  168. package/esm/LinearGenomeView/model.d.ts +3238 -136
  169. package/esm/LinearGenomeView/model.js +2425 -528
  170. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  171. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  172. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  173. package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
  174. package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
  175. package/esm/LinearGenomeView/stickyChrome.js +30 -0
  176. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  177. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
  178. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
  179. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
  180. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  181. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  185. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
  186. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  187. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
  188. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  189. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
  190. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  191. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
  192. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  193. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
  194. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  195. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
  197. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
  198. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  199. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  200. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  201. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  202. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  203. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  204. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  205. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
  206. package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
  207. package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
  208. package/esm/LinearGenomeView/types.d.ts +17 -31
  209. package/esm/LinearGenomeView/types.js +1 -0
  210. package/esm/LinearGenomeView/util.d.ts +332 -12
  211. package/esm/LinearGenomeView/util.js +606 -62
  212. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  213. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
  214. package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
  215. package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
  216. package/esm/MultiLevelRubberband/index.d.ts +2 -0
  217. package/esm/MultiLevelRubberband/index.js +1 -0
  218. package/esm/MultiLevelRubberband/types.d.ts +6 -0
  219. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
  220. package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
  221. package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
  222. package/esm/displayKitTests/perRegionTestEnv.js +138 -0
  223. package/esm/index.d.ts +122 -1235
  224. package/esm/index.js +101 -24
  225. package/esm/lazyPluginExports.d.ts +23 -0
  226. package/esm/lazyPluginExports.js +36 -0
  227. package/esm/searchUtils.d.ts +55 -11
  228. package/esm/searchUtils.js +342 -45
  229. package/esm/shared/RubberbandSpan.d.ts +15 -0
  230. package/esm/shared/RubberbandSpan.js +33 -0
  231. package/esm/shared/coordLabels.d.ts +40 -0
  232. package/esm/shared/coordLabels.js +119 -0
  233. package/package.json +18 -19
  234. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  235. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  236. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  237. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  238. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  239. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  240. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  241. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  242. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  243. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  244. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  245. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  246. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  247. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  248. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  249. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  250. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  251. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  252. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  253. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  254. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  255. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  256. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  257. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  258. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  260. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  261. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  262. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  263. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  264. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  265. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  266. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  267. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  268. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  269. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  270. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  271. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  272. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  273. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  274. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  275. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  276. package/esm/BaseLinearDisplay/components/util.js +0 -107
  277. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  278. package/esm/BaseLinearDisplay/index.js +0 -13
  279. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  280. package/esm/BaseLinearDisplay/model.js +0 -432
  281. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  282. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  283. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  284. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  285. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  286. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  287. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  288. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  289. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  290. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  291. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  292. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  293. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  294. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  295. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  296. package/esm/BaseLinearDisplay/models/util.js +0 -43
  297. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  298. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  299. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  300. package/esm/BaseLinearDisplay/types.js +0 -3
  301. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  302. package/esm/BaseLinearDisplay/util.js +0 -71
  303. package/esm/BasicTrack/configSchema.d.ts +0 -85
  304. package/esm/BasicTrack/configSchema.js +0 -8
  305. package/esm/BasicTrack/index.d.ts +0 -2
  306. package/esm/BasicTrack/index.js +0 -12
  307. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  308. package/esm/LinearBareDisplay/configSchema.js +0 -11
  309. package/esm/LinearBareDisplay/index.d.ts +0 -4
  310. package/esm/LinearBareDisplay/index.js +0 -20
  311. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  312. package/esm/LinearBareDisplay/model.js +0 -32
  313. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  314. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  315. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  316. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  317. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  318. package/esm/LinearBasicDisplay/index.js +0 -20
  319. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  320. package/esm/LinearBasicDisplay/model.js +0 -158
  321. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  322. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  323. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  324. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  325. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  326. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  327. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  328. package/esm/LinearFeatureDisplay/index.js +0 -2
  329. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  330. package/esm/LinearFeatureDisplay/model.js +0 -305
  331. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  332. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  333. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  334. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  335. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  336. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  337. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  338. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  339. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  340. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  345. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  346. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  347. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  348. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  349. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  350. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  351. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  352. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  353. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  354. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  355. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  356. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  357. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
+ import { observer } from 'mobx-react';
4
+ const useStyles = makeStyles()({
5
+ zoomContainer: {
6
+ position: 'absolute',
7
+ top: 0,
8
+ height: '100%',
9
+ width: '100%',
10
+ pointerEvents: 'none',
11
+ },
12
+ innerContainer: {
13
+ position: 'absolute',
14
+ height: '100%',
15
+ pointerEvents: 'none',
16
+ // its own compositor layer: a pan then moves the layer instead of
17
+ // re-rasterizing the root layer's tiles, which paid for the gridline paths
18
+ // on every frame
19
+ willChange: 'transform',
20
+ },
21
+ });
22
+ // Shared zoom/scroll-transform wrapper for the gridline ticks and padding-block
23
+ // overlays. Lays the overlay out in the staticBlocks frame and shifts it into
24
+ // the viewport by `staticBlocksTranslateX`, so it tracks scroll — but a
25
+ // re-render only patches this div's transform plus the child's path `d`
26
+ // strings, so it stays cheap per frame.
27
+ const ZoomTransform = observer(function ZoomTransform({ model, offset = 0, children, }) {
28
+ const { classes } = useStyles();
29
+ const { staticBlocks, staticBlocksTranslateX } = model;
30
+ return (_jsx("div", { className: classes.zoomContainer, children: _jsx("div", { className: classes.innerContainer, style: {
31
+ // unrounded, unlike ScalebarCoordinateLabels: the children here are
32
+ // paths and boxes rather than text, so there is no glyph to blur
33
+ transform: `translateX(${staticBlocksTranslateX - offset}px)`,
34
+ width: staticBlocks.totalWidthPx,
35
+ }, children: children }) }));
36
+ });
37
+ export default ZoomTransform;
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_MOTIFS = "# name<space>site \u2014 '^' or, cutting downstream, '(n/m)'. Edit freely.\nEcoRI G^AATTC\nBamHI G^GATCC\nHindIII A^AGCTT\nNotI GC^GGCCGC\nXhoI C^TCGAG\nSalI G^TCGAC\nPstI CTGCA^G\nSmaI CCC^GGG\nKpnI GGTAC^C\nSacI GAGCT^C\nXbaI T^CTAGA\nSpeI A^CTAGT\nNcoI C^CATGG\nNdeI CA^TATG\nEcoRV GAT^ATC\nBglII A^GATCT";
@@ -0,0 +1,22 @@
1
+ // A starting point, not a database: this is only the initial value of the motif
2
+ // textarea, so a user can wipe it and paste their own enzyme set (or any motif
3
+ // set at all) from REBASE or elsewhere. Sites use REBASE notation: '^' for a cut
4
+ // inside the site, '(n/m)' for the type IIS enzymes that cut downstream of it —
5
+ // the prefill sticks to the classic '^' cutters, but both parse.
6
+ export const DEFAULT_MOTIFS = `# name<space>site — '^' or, cutting downstream, '(n/m)'. Edit freely.
7
+ EcoRI G^AATTC
8
+ BamHI G^GATCC
9
+ HindIII A^AGCTT
10
+ NotI GC^GGCCGC
11
+ XhoI C^TCGAG
12
+ SalI G^TCGAC
13
+ PstI CTGCA^G
14
+ SmaI CCC^GGG
15
+ KpnI GGTAC^C
16
+ SacI GAGCT^C
17
+ XbaI T^CTAGA
18
+ SpeI A^CTAGT
19
+ NcoI C^CATGG
20
+ NdeI CA^TATG
21
+ EcoRV GAT^ATC
22
+ BglII A^GATCT`;
@@ -1,9 +1,8 @@
1
- import type { BpOffset } from '../types.ts';
2
- import type { Feature } from '@jbrowse/core/util';
1
+ import type { StatusCallback } from '@jbrowse/core/util';
2
+ import type { StopToken } from '@jbrowse/core/util/stopToken';
3
3
  import type { Region } from '@jbrowse/core/util/types';
4
- export declare function fetchSequence(model: {
5
- leftOffset?: BpOffset;
6
- rightOffset?: BpOffset;
7
- getSelectedRegions: (left?: BpOffset, right?: BpOffset) => Region[];
8
- setOffsets: (left?: BpOffset, right?: BpOffset) => void;
9
- }, regions: Region[]): Promise<Feature[]>;
4
+ import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
5
+ export declare function fetchSequence(model: IAnyStateTreeNode, regions: Region[], opts?: {
6
+ stopToken?: StopToken;
7
+ statusCallback?: StatusCallback;
8
+ }): Promise<import("@jbrowse/core/util").Feature[]>;
@@ -1,26 +1,34 @@
1
- import { getConf } from '@jbrowse/core/configuration';
1
+ import { getSequenceAdapterConfig } from '@jbrowse/core/assemblyManager/assembly';
2
2
  import { getSession } from '@jbrowse/core/util';
3
- export async function fetchSequence(model, regions) {
3
+ export async function fetchSequence(model, regions, opts = {}) {
4
4
  const session = getSession(model);
5
- const { leftOffset, rightOffset } = model;
6
- if (!leftOffset || !rightOffset) {
7
- throw new Error('no offsets on model to use for range');
8
- }
9
5
  const assemblyNames = new Set(regions.map(r => r.assemblyName));
10
6
  if (assemblyNames.size > 1) {
11
7
  throw new Error('not able to fetch sequences from multiple assemblies currently');
12
8
  }
13
9
  const { rpcManager, assemblyManager } = session;
14
- const assemblyName = leftOffset.assemblyName || rightOffset.assemblyName || '';
10
+ const assemblyName = regions[0]?.assemblyName;
11
+ if (!assemblyName) {
12
+ throw new Error('no assemblyName found on the selected region');
13
+ }
15
14
  const assembly = assemblyManager.get(assemblyName);
16
15
  if (!assembly) {
17
16
  throw new Error(`assembly ${assemblyName} not found`);
18
17
  }
19
- const adapterConfig = getConf(assembly, ['sequence', 'adapter']);
18
+ // Undefined here means the assembly's `configuration` safeReference is
19
+ // unresolved — the assembly outlived the config entry it points at. NOT an
20
+ // assembly whose sequence carries no residues: a ChromSizesAdapter one still
21
+ // has a `sequence.adapter`, and fails later, inside the adapter. Say which
22
+ // this is; passing the undefined on fails in getAdapterPre as "could not
23
+ // determine adapter type", naming neither the assembly nor what was wanted.
24
+ const adapterConfig = getSequenceAdapterConfig(assembly);
25
+ if (!adapterConfig) {
26
+ throw new Error(`assembly ${assemblyName} has no resolved configuration, so its sequence adapter cannot be read`);
27
+ }
20
28
  const sessionId = 'getSequence';
21
29
  return rpcManager.call(sessionId, 'CoreGetFeatures', {
22
30
  adapterConfig,
23
31
  regions,
24
- sessionId,
32
+ ...opts,
25
33
  });
26
34
  }
@@ -0,0 +1,15 @@
1
+ import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
2
+ import type { MenuItem, RecentLocation } from '@jbrowse/core/ui';
3
+ /**
4
+ * What a navigated result is worth remembering as. The display string is what
5
+ * the row shows; the location is what reopening it opens, and is absent for a
6
+ * freehand query, whose label is the searchable thing. Paired with the
7
+ * `BaseResult` the menu rebuilds below so the round trip stays visible in one
8
+ * place: a row replayed through it records the same pair it came from.
9
+ */
10
+ export declare function recentLocationOf(option: BaseResult): RecentLocation;
11
+ export declare function recentLocationsMenu({ recentLocations, onNavigate, onClear, }: {
12
+ recentLocations: RecentLocation[];
13
+ onNavigate: (option: BaseResult) => void;
14
+ onClear: () => void;
15
+ }): MenuItem[];
@@ -0,0 +1,36 @@
1
+ import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
2
+ /**
3
+ * What a navigated result is worth remembering as. The display string is what
4
+ * the row shows; the location is what reopening it opens, and is absent for a
5
+ * freehand query, whose label is the searchable thing. Paired with the
6
+ * `BaseResult` the menu rebuilds below so the round trip stays visible in one
7
+ * place: a row replayed through it records the same pair it came from.
8
+ */
9
+ export function recentLocationOf(option) {
10
+ return { label: option.getDisplayString(), loc: option.getLocation() };
11
+ }
12
+ // Builds the "Recent ▸" submenu shared by the header search box and the import
13
+ // form overflow menus, so both surfaces stay identical. Empty when there is no
14
+ // history yet, so the ⋮ button only appears once there is something to show.
15
+ export function recentLocationsMenu({ recentLocations, onNavigate, onClear, }) {
16
+ return recentLocations.length
17
+ ? [
18
+ {
19
+ label: 'Recent',
20
+ subMenu: [
21
+ ...recentLocations.map(({ label, loc }) => ({
22
+ label,
23
+ onClick: () => {
24
+ // a row that recorded a location navigates straight to it; one
25
+ // with only a label goes back through the search path, which is
26
+ // where a freehand query resolved the first time
27
+ onNavigate(new BaseResult({ label, locString: loc }));
28
+ },
29
+ })),
30
+ { type: 'divider' },
31
+ { label: 'Clear recent locations', onClick: onClear },
32
+ ],
33
+ },
34
+ ]
35
+ : [];
36
+ }
@@ -0,0 +1,13 @@
1
+ export interface SequenceSearchModel {
2
+ assemblyNames: string[];
3
+ launchTrack: (trackId: string) => Promise<unknown>;
4
+ }
5
+ export interface SequenceSearchModeProps {
6
+ model: SequenceSearchModel;
7
+ handleClose: () => void;
8
+ }
9
+ export declare function addReferenceScanTrack(model: SequenceSearchModel, args: {
10
+ trackId: string;
11
+ name: string;
12
+ adapter: Record<string, unknown>;
13
+ }): void;
@@ -0,0 +1,22 @@
1
+ import { getSession, isSessionWithAddSessionTrack } from '@jbrowse/core/util';
2
+ // Creates a FeatureTrack that scans the assembly's reference sequence and shows
3
+ // it. `adapter` carries the type + params only: the scan adapters resolve the
4
+ // sequence from the track's assembly at fetch time (getSequenceSubAdapter), so
5
+ // no sequence adapter is baked into the track config here.
6
+ export function addReferenceScanTrack(model, args) {
7
+ const session = getSession(model);
8
+ const assemblyName = model.assemblyNames[0];
9
+ if (isSessionWithAddSessionTrack(session)) {
10
+ session.addSessionTrackConf({
11
+ trackId: args.trackId,
12
+ name: args.name,
13
+ assemblyNames: [assemblyName],
14
+ type: 'FeatureTrack',
15
+ adapter: args.adapter,
16
+ });
17
+ void model.launchTrack(args.trackId);
18
+ }
19
+ else {
20
+ session.notify('This session does not support adding tracks', 'warning');
21
+ }
22
+ }
@@ -0,0 +1,7 @@
1
+ import type { LinearGenomeViewModel } from '../model.ts';
2
+ import type { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
3
+ import type { MenuItem } from '@jbrowse/core/ui';
4
+ export declare function getTrackOrderSubMenu({ view, track, }: {
5
+ view: LinearGenomeViewModel;
6
+ track: BaseTrackModel;
7
+ }): MenuItem[];
@@ -0,0 +1,67 @@
1
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
2
+ import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
3
+ import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown';
4
+ import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp';
5
+ import PushPinIcon from '@mui/icons-material/PushPin';
6
+ // Pin/unpin and reorder items for a single track. Pinning is only meaningful in
7
+ // a top-level view; the to-top/to-bottom jumps are redundant with up/down when
8
+ // there are only two tracks, so they need a third track to appear.
9
+ export function getTrackOrderSubMenu({ view, track, }) {
10
+ const { isTopLevelView, tracks } = view;
11
+ const { pinned } = track;
12
+ const canMove = tracks.length > 1;
13
+ const canJump = tracks.length > 2;
14
+ return [
15
+ ...(isTopLevelView
16
+ ? [
17
+ {
18
+ label: pinned ? 'Unpin track' : 'Pin track',
19
+ icon: PushPinIcon,
20
+ onClick: () => {
21
+ track.setPinned(!pinned);
22
+ },
23
+ },
24
+ ]
25
+ : []),
26
+ ...(canJump
27
+ ? [
28
+ {
29
+ label: 'Move track to top',
30
+ icon: KeyboardDoubleArrowUpIcon,
31
+ onClick: () => {
32
+ view.moveTrackToTop(track.id);
33
+ },
34
+ },
35
+ ]
36
+ : []),
37
+ ...(canMove
38
+ ? [
39
+ {
40
+ label: 'Move track up',
41
+ icon: KeyboardArrowUpIcon,
42
+ onClick: () => {
43
+ view.moveTrackUp(track.id);
44
+ },
45
+ },
46
+ {
47
+ label: 'Move track down',
48
+ icon: KeyboardArrowDownIcon,
49
+ onClick: () => {
50
+ view.moveTrackDown(track.id);
51
+ },
52
+ },
53
+ ]
54
+ : []),
55
+ ...(canJump
56
+ ? [
57
+ {
58
+ label: 'Move track to bottom',
59
+ icon: KeyboardDoubleArrowDownIcon,
60
+ onClick: () => {
61
+ view.moveTrackToBottom(track.id);
62
+ },
63
+ },
64
+ ]
65
+ : []),
66
+ ];
67
+ }
@@ -1,84 +1,29 @@
1
- import type React from 'react';
2
1
  import type { LinearGenomeViewModel } from '../index.ts';
2
+ import type React from 'react';
3
3
  interface AnchorPosition {
4
4
  offsetX: number;
5
5
  clientX: number;
6
6
  clientY: number;
7
- isClick?: boolean;
7
+ isClick: boolean;
8
8
  }
9
9
  export declare function useRangeSelect(ref: React.RefObject<HTMLDivElement | null>, model: LinearGenomeViewModel, shiftOnly?: boolean): {
10
10
  open: boolean;
11
11
  isClick: boolean | undefined;
12
- clickBpOffset: {
13
- coord: number;
14
- index: number;
15
- refName: string;
16
- oob: boolean;
17
- assemblyName: string;
18
- offset: number;
19
- start: number;
20
- end: number;
21
- reversed?: boolean;
22
- } | undefined;
23
- guideX: number | undefined;
24
- mouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
25
- mouseMove: (event: React.MouseEvent<HTMLDivElement>) => void;
26
- mouseOut: () => void;
27
- handleClose: () => void;
28
- handleMenuItemClick: (_: unknown, callback: () => void) => void;
29
- anchorPosition: AnchorPosition | undefined;
30
- rubberbandOn?: undefined;
31
- leftBpOffset?: undefined;
32
- rightBpOffset?: undefined;
33
- numOfBpSelected?: undefined;
34
- width?: undefined;
35
- left?: undefined;
36
- } | {
37
- open: boolean;
38
- isClick: boolean | undefined;
39
- clickBpOffset: {
40
- coord: number;
41
- index: number;
42
- refName: string;
43
- oob: boolean;
44
- assemblyName: string;
45
- offset: number;
46
- start: number;
47
- end: number;
48
- reversed?: boolean;
49
- } | undefined;
12
+ clickBpOffset: import("@jbrowse/core/util/Base1DUtils").PxToBpResult | undefined;
50
13
  guideX: number | undefined;
51
14
  rubberbandOn: boolean;
52
15
  mouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
53
16
  mouseMove: (event: React.MouseEvent<HTMLDivElement>) => void;
54
17
  mouseOut: () => void;
55
18
  handleClose: () => void;
56
- handleMenuItemClick: (_: unknown, callback: () => void) => void;
57
- leftBpOffset: {
58
- coord: number;
59
- index: number;
60
- refName: string;
61
- oob: boolean;
62
- assemblyName: string;
63
- offset: number;
64
- start: number;
65
- end: number;
66
- reversed?: boolean;
67
- };
68
- rightBpOffset: {
69
- coord: number;
70
- index: number;
71
- refName: string;
72
- oob: boolean;
73
- assemblyName: string;
74
- offset: number;
75
- start: number;
76
- end: number;
77
- reversed?: boolean;
78
- };
19
+ handleMenuItemClick: (callback: () => void) => void;
79
20
  anchorPosition: AnchorPosition | undefined;
80
- numOfBpSelected: number;
81
- width: number;
82
- left: number;
21
+ rubberband: {
22
+ leftBpOffset: ReturnType<LinearGenomeViewModel['pxToBp']>;
23
+ rightBpOffset: ReturnType<LinearGenomeViewModel['pxToBp']>;
24
+ numOfBpSelected: number;
25
+ width: number;
26
+ left: number;
27
+ } | undefined;
83
28
  };
84
29
  export {};
@@ -1,8 +1,10 @@
1
1
  import { useCallback, useEffect, useState } from 'react';
2
- import { getRelativeX } from "./util.js";
2
+ import { getRelativeX } from '@jbrowse/core/util/getRelativeX';
3
3
  export function useRangeSelect(ref, model, shiftOnly) {
4
4
  const [startX, setStartX] = useState();
5
5
  const [currentX, setCurrentX] = useState();
6
+ // clientX and clientY used for anchorPosition for menu
7
+ // offsetX used for calculations about width of selection
6
8
  const [anchorPosition, setAnchorPosition] = useState();
7
9
  const [guideX, setGuideX] = useState();
8
10
  const mouseDragging = startX !== undefined && anchorPosition === undefined;
@@ -13,102 +15,99 @@ export function useRangeSelect(ref, model, shiftOnly) {
13
15
  setGuideX(undefined);
14
16
  }, []);
15
17
  useEffect(() => {
16
- function computeOffsets(offsetX) {
17
- if (startX === undefined) {
18
- return;
19
- }
20
- const leftPx = Math.min(startX, offsetX);
21
- const rightPx = Math.max(startX, offsetX);
22
- return {
23
- leftOffset: model.pxToBp(leftPx),
24
- rightOffset: model.pxToBp(rightPx),
25
- };
18
+ const el = ref.current;
19
+ if (!mouseDragging || !el) {
20
+ return;
26
21
  }
22
+ // the container's left edge is fixed for the duration of a drag, so measure
23
+ // it once here rather than calling getBoundingClientRect on every mousemove
24
+ const { left } = el.getBoundingClientRect();
27
25
  function globalMouseMove(event) {
28
- if (ref.current && mouseDragging) {
29
- const relativeX = getRelativeX(event, ref.current);
30
- setCurrentX(relativeX);
31
- }
26
+ setCurrentX(event.clientX - left);
32
27
  }
33
28
  function globalMouseUp(event) {
34
- if (startX !== undefined && ref.current) {
35
- const { clientX, clientY } = event;
36
- const offsetX = getRelativeX(event, ref.current);
37
- const isClick = Math.abs(offsetX - startX) <= 3;
38
- if (isClick && model.scalebarRefNameClickPending) {
39
- setStartX(undefined);
40
- setCurrentX(undefined);
41
- return;
42
- }
43
- if (!isClick && model.scalebarRefNameClickPending) {
44
- model.setScalebarRefNameClickPending(false);
45
- }
46
- setAnchorPosition({
47
- offsetX,
48
- clientX,
49
- clientY,
50
- isClick,
51
- });
52
- if (isClick) {
53
- setGuideX(offsetX);
54
- }
55
- else {
56
- const args = computeOffsets(offsetX);
57
- if (args) {
58
- model.setOffsets(args.leftOffset, args.rightOffset);
59
- }
60
- setGuideX(undefined);
61
- }
29
+ if (startX === undefined) {
30
+ return;
31
+ }
32
+ const { clientX, clientY } = event;
33
+ const offsetX = clientX - left;
34
+ const isClick = Math.abs(offsetX - startX) <= 3;
35
+ // Clear the flag unconditionally once consumed: the label's own onClick
36
+ // also clears it, but that only fires if mouseup lands on the label, so
37
+ // relying on it alone can leave the flag stuck (swallowing the next
38
+ // scalebar click) when mouseup drifts a few px off the label edge.
39
+ const startedOnRefLabel = model.scalebarRefNameClickPending;
40
+ if (startedOnRefLabel) {
41
+ model.setScalebarRefNameClickPending(false);
42
+ }
43
+ // A click that began on a scalebar refname label is handled by that
44
+ // label's onClick (opens its menu), not by the rubberband menu here.
45
+ // Drop the hover guide too: the label's menu covers it while it is open,
46
+ // and nothing else clears it, so picking an item like "Focus on X" left a
47
+ // red line stranded on the scalebar with the pointer nowhere near it
48
+ if (isClick && startedOnRefLabel) {
49
+ setStartX(undefined);
50
+ setCurrentX(undefined);
51
+ setGuideX(undefined);
52
+ return;
53
+ }
54
+ setAnchorPosition({ offsetX, clientX, clientY, isClick });
55
+ if (isClick) {
56
+ setGuideX(offsetX);
57
+ }
58
+ else {
59
+ model.setOffsets(model.pxToBp(Math.min(startX, offsetX)), model.pxToBp(Math.max(startX, offsetX)));
60
+ setGuideX(undefined);
62
61
  }
63
62
  }
64
- if (mouseDragging) {
65
- window.addEventListener('mousemove', globalMouseMove);
66
- window.addEventListener('mouseup', globalMouseUp);
67
- return () => {
68
- window.removeEventListener('mousemove', globalMouseMove);
69
- window.removeEventListener('mouseup', globalMouseUp);
70
- };
63
+ function globalKeyDown(event) {
64
+ if (event.key === 'Escape') {
65
+ setStartX(undefined);
66
+ setCurrentX(undefined);
67
+ }
71
68
  }
72
- return () => { };
73
- }, [startX, mouseDragging, model, ref, handleClose]);
69
+ window.addEventListener('mousemove', globalMouseMove);
70
+ window.addEventListener('mouseup', globalMouseUp);
71
+ window.addEventListener('keydown', globalKeyDown);
72
+ return () => {
73
+ window.removeEventListener('mousemove', globalMouseMove);
74
+ window.removeEventListener('mouseup', globalMouseUp);
75
+ window.removeEventListener('keydown', globalKeyDown);
76
+ };
77
+ }, [startX, mouseDragging, model, ref]);
74
78
  function mouseDown(event) {
75
79
  if (shiftOnly && !event.shiftKey) {
76
80
  return;
77
81
  }
82
+ // a press with the refName menu already open reopens it on the label under
83
+ // the pointer; same stranded-guide reasoning as the mouseup path above
78
84
  if (model.isScalebarRefNameMenuOpen) {
85
+ setGuideX(undefined);
79
86
  return;
80
87
  }
81
88
  event.preventDefault();
82
89
  event.stopPropagation();
90
+ // clear any leftover menu/selection so a fresh drag isn't blocked by a
91
+ // stale anchorPosition keeping mouseDragging false
92
+ setAnchorPosition(undefined);
83
93
  const relativeX = getRelativeX(event, ref.current);
84
94
  setStartX(relativeX);
85
95
  setCurrentX(relativeX);
86
96
  }
87
97
  function mouseMove(event) {
98
+ // Keep the rubberband visible while a drag-selection menu is open
88
99
  if (anchorPosition?.isClick === false) {
89
100
  return;
90
101
  }
91
- if (mouseDragging) {
92
- setGuideX(undefined);
93
- }
94
- else if (shiftOnly) {
95
- if (event.shiftKey) {
96
- setGuideX(getRelativeX(event, ref.current));
97
- }
98
- else {
99
- setGuideX(undefined);
100
- }
101
- }
102
- else {
103
- setGuideX(getRelativeX(event, ref.current));
104
- }
102
+ const wantsGuide = !mouseDragging && (!shiftOnly || event.shiftKey);
103
+ setGuideX(wantsGuide ? getRelativeX(event, ref.current) : undefined);
105
104
  }
106
105
  function mouseOut() {
107
106
  if (!anchorPosition?.isClick) {
108
107
  setGuideX(undefined);
109
108
  }
110
109
  }
111
- function handleMenuItemClick(_, callback) {
110
+ function handleMenuItemClick(callback) {
112
111
  callback();
113
112
  handleClose();
114
113
  }
@@ -117,42 +116,34 @@ export function useRangeSelect(ref, model, shiftOnly) {
117
116
  const clickBpOffset = isClick
118
117
  ? model.pxToBp(anchorPosition.offsetX)
119
118
  : undefined;
120
- if (startX === undefined) {
121
- return {
122
- open,
123
- isClick,
124
- clickBpOffset,
125
- guideX,
126
- mouseDown,
127
- mouseMove,
128
- mouseOut,
129
- handleClose,
130
- handleMenuItemClick,
131
- anchorPosition,
119
+ // rubberband geometry only exists while a drag is in progress (startX set);
120
+ // grouped so a single truthiness check narrows all fields for RubberbandSpan
121
+ let rubberband;
122
+ if (startX !== undefined) {
123
+ const right = anchorPosition ? anchorPosition.offsetX : (currentX ?? startX);
124
+ const left = Math.min(right, startX);
125
+ const width = Math.abs(right - startX);
126
+ rubberband = {
127
+ leftBpOffset: model.pxToBp(left),
128
+ rightBpOffset: model.pxToBp(left + width),
129
+ numOfBpSelected: Math.ceil(width * model.bpPerPx),
130
+ width,
131
+ left,
132
132
  };
133
133
  }
134
- const right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
135
- const left = Math.min(right, startX);
136
- const width = Math.abs(right - startX);
137
- const leftBpOffset = model.pxToBp(left);
138
- const rightBpOffset = model.pxToBp(left + width);
139
- const numOfBpSelected = Math.ceil(width * model.bpPerPx);
140
134
  return {
141
135
  open,
142
136
  isClick,
143
137
  clickBpOffset,
144
138
  guideX,
145
- rubberbandOn: !isClick,
139
+ // true only mid-drag and not a click — drives RubberbandSpan vs guide
140
+ rubberbandOn: rubberband !== undefined && !isClick,
146
141
  mouseDown,
147
142
  mouseMove,
148
143
  mouseOut,
149
144
  handleClose,
150
145
  handleMenuItemClick,
151
- leftBpOffset,
152
- rightBpOffset,
153
146
  anchorPosition,
154
- numOfBpSelected,
155
- width,
156
- left,
147
+ rubberband,
157
148
  };
158
149
  }
@@ -0,0 +1,26 @@
1
+ import type { MenuItem } from '@jbrowse/core/ui';
2
+ /**
3
+ * Visibility and orientation of the search-box strip a stacked-LGV header
4
+ * draws, persisted per regime (few vs many rows) rather than under one global
5
+ * key, so the "compact default" heuristic isn't permanently overridden by a
6
+ * choice made in a differently-sized view.
7
+ *
8
+ * `prefix` keys the storage per container — the comparative view and the
9
+ * breakpoint split view remember their own. Everything else is shared, because
10
+ * the two headers held a copy each and the copies carried a comment telling the
11
+ * next editor to change the labels in both. They already import
12
+ * `HeaderSearchBoxRow` from this plugin, so the shared home costs no new
13
+ * dependency edge.
14
+ */
15
+ export declare function useSearchBoxPrefs(prefix: string, numViews: number): {
16
+ showSearchBoxes: boolean;
17
+ setShowSearchBoxes: (value: boolean | ((val: boolean) => boolean)) => void;
18
+ sideBySide: boolean;
19
+ setSideBySide: (value: boolean | ((val: boolean) => boolean)) => void;
20
+ };
21
+ export type SearchBoxPrefs = ReturnType<typeof useSearchBoxPrefs>;
22
+ /**
23
+ * The menu rows that drive those prefs. "Stacked" rather than "Vertical": the
24
+ * two headers name the same state and had drifted apart on it once already.
25
+ */
26
+ export declare function searchBoxMenuItems({ showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide, }: SearchBoxPrefs): MenuItem[];