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

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 (363) hide show
  1. package/esm/FeatureTrack/configSchema.d.ts +202 -71
  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 +265 -120
  8. package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
  9. package/esm/LinearGenomeView/components/CenterLine.js +20 -9
  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 +142 -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 +8 -3
  17. package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -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 +42 -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 +18 -8
  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 +38 -52
  38. package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
  39. package/esm/LinearGenomeView/components/Highlight.js +21 -25
  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 +8 -0
  43. package/esm/LinearGenomeView/components/HighlightChip.js +13 -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 +7 -6
  50. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
  51. package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
  52. package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
  53. package/esm/LinearGenomeView/components/MiniControls.js +14 -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 +25 -0
  64. package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
  65. package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
  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 +87 -83
  70. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
  71. package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -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 +56 -0
  76. package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
  77. package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -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/ResizeAllTracksHandle.d.ts +5 -0
  81. package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
  82. package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
  83. package/esm/LinearGenomeView/components/Rubberband.js +15 -17
  84. package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
  85. package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
  86. package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
  87. package/esm/LinearGenomeView/components/Scalebar.js +20 -22
  88. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
  89. package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
  90. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
  91. package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +157 -126
  92. package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
  93. package/esm/LinearGenomeView/components/SearchBox.js +61 -68
  94. package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
  95. package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
  96. package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
  97. package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
  98. package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
  99. package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
  100. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
  101. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
  102. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
  103. package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
  104. package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
  105. package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
  106. package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +3 -5
  107. package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
  108. package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
  109. package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
  110. package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
  111. package/esm/LinearGenomeView/components/TrackContainer.js +136 -38
  112. package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
  113. package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
  114. package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
  115. package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
  116. package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
  117. package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
  118. package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
  119. package/esm/LinearGenomeView/components/TrackLabelMenu.js +35 -87
  120. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
  121. package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
  122. package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
  123. package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
  124. package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
  125. package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
  126. package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
  127. package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
  128. package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
  129. package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
  130. package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
  131. package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
  132. package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
  133. package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
  134. package/esm/LinearGenomeView/components/fetchSequence.d.ts +6 -8
  135. package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
  136. package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
  137. package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -0
  138. package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
  139. package/esm/LinearGenomeView/components/searchModes.js +22 -0
  140. package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
  141. package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
  142. package/esm/LinearGenomeView/components/useRangeSelect.d.ts +9 -67
  143. package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
  144. package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
  145. package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
  146. package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
  147. package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
  148. package/esm/LinearGenomeView/components/util.d.ts +24 -6
  149. package/esm/LinearGenomeView/components/util.js +28 -5
  150. package/esm/LinearGenomeView/consts.d.ts +9 -2
  151. package/esm/LinearGenomeView/consts.js +20 -2
  152. package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
  153. package/esm/LinearGenomeView/containingLgv.js +23 -0
  154. package/esm/LinearGenomeView/flyTo.d.ts +38 -0
  155. package/esm/LinearGenomeView/flyTo.js +135 -0
  156. package/esm/LinearGenomeView/headerFit.d.ts +29 -0
  157. package/esm/LinearGenomeView/headerFit.js +72 -0
  158. package/esm/LinearGenomeView/index.d.ts +28 -3
  159. package/esm/LinearGenomeView/index.js +13 -7
  160. package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
  161. package/esm/LinearGenomeView/keyboardHandler.js +25 -1
  162. package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
  163. package/esm/LinearGenomeView/launchKeys.js +27 -0
  164. package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
  165. package/esm/LinearGenomeView/lazyDialogs.js +4 -3
  166. package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
  167. package/esm/LinearGenomeView/linkedViewSync.js +36 -0
  168. package/esm/LinearGenomeView/menuItems.d.ts +25 -2
  169. package/esm/LinearGenomeView/menuItems.js +306 -179
  170. package/esm/LinearGenomeView/model.d.ts +3363 -164
  171. package/esm/LinearGenomeView/model.js +2548 -565
  172. package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
  173. package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
  174. package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
  175. package/esm/LinearGenomeView/showRegionsWithUndo.js +50 -0
  176. package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
  177. package/esm/LinearGenomeView/stickyChrome.js +26 -0
  178. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
  179. package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
  180. package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
  181. package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
  182. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
  183. package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
  184. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
  185. package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
  186. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
  187. package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +73 -41
  188. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
  189. package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
  190. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
  191. package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
  192. package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
  193. package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
  194. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
  195. package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
  196. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
  197. package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
  198. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
  199. package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
  200. package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
  201. package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -21
  202. package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
  203. package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
  204. package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
  205. package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
  206. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
  207. package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
  208. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
  209. package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +245 -0
  210. package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
  211. package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
  212. package/esm/LinearGenomeView/types.d.ts +20 -37
  213. package/esm/LinearGenomeView/types.js +1 -0
  214. package/esm/LinearGenomeView/util.d.ts +347 -12
  215. package/esm/LinearGenomeView/util.js +577 -62
  216. package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
  217. package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
  218. package/esm/MultiLevelRubberband/index.d.ts +4 -0
  219. package/esm/MultiLevelRubberband/index.js +3 -0
  220. package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
  221. package/esm/MultiLevelRubberband/menuItems.js +52 -0
  222. package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
  223. package/esm/MultiLevelRubberband/rowLabel.js +27 -0
  224. package/esm/MultiLevelRubberband/types.d.ts +7 -0
  225. package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
  226. package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
  227. package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
  228. package/esm/displayKitTests/perRegionTestEnv.js +142 -0
  229. package/esm/index.d.ts +50 -1245
  230. package/esm/index.js +88 -33
  231. package/esm/searchUtils.d.ts +62 -12
  232. package/esm/searchUtils.js +335 -48
  233. package/esm/shared/RubberbandSpan.d.ts +15 -0
  234. package/esm/shared/RubberbandSpan.js +34 -0
  235. package/esm/shared/coordLabels.d.ts +47 -0
  236. package/esm/shared/coordLabels.js +133 -0
  237. package/esm/shared/useWindowDrag.d.ts +18 -0
  238. package/esm/shared/useWindowDrag.js +45 -0
  239. package/package.json +18 -19
  240. package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
  241. package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
  242. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
  243. package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
  244. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
  245. package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
  246. package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
  247. package/esm/BaseLinearDisplay/components/Block.js +0 -45
  248. package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
  249. package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
  250. package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
  251. package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
  252. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
  253. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
  254. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
  255. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
  256. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
  257. package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
  258. package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
  259. package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
  260. package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
  261. package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
  262. package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
  263. package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
  264. package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
  265. package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
  266. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
  267. package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
  268. package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
  269. package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
  270. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
  271. package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
  272. package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
  273. package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
  274. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
  275. package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
  276. package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
  277. package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
  278. package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
  279. package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
  280. package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
  281. package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
  282. package/esm/BaseLinearDisplay/components/util.js +0 -107
  283. package/esm/BaseLinearDisplay/index.d.ts +0 -17
  284. package/esm/BaseLinearDisplay/index.js +0 -13
  285. package/esm/BaseLinearDisplay/model.d.ts +0 -1197
  286. package/esm/BaseLinearDisplay/model.js +0 -432
  287. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
  288. package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
  289. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
  290. package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
  291. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
  292. package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
  293. package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
  294. package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
  295. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
  296. package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
  297. package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
  298. package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
  299. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
  300. package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
  301. package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
  302. package/esm/BaseLinearDisplay/models/util.js +0 -43
  303. package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
  304. package/esm/BaseLinearDisplay/renderSvg.js +0 -63
  305. package/esm/BaseLinearDisplay/types.d.ts +0 -43
  306. package/esm/BaseLinearDisplay/types.js +0 -3
  307. package/esm/BaseLinearDisplay/util.d.ts +0 -16
  308. package/esm/BaseLinearDisplay/util.js +0 -71
  309. package/esm/BasicTrack/configSchema.d.ts +0 -85
  310. package/esm/BasicTrack/configSchema.js +0 -8
  311. package/esm/BasicTrack/index.d.ts +0 -2
  312. package/esm/BasicTrack/index.js +0 -12
  313. package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
  314. package/esm/LinearBareDisplay/configSchema.js +0 -11
  315. package/esm/LinearBareDisplay/index.d.ts +0 -4
  316. package/esm/LinearBareDisplay/index.js +0 -20
  317. package/esm/LinearBareDisplay/model.d.ts +0 -1196
  318. package/esm/LinearBareDisplay/model.js +0 -32
  319. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
  320. package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
  321. package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
  322. package/esm/LinearBasicDisplay/configSchema.js +0 -11
  323. package/esm/LinearBasicDisplay/index.d.ts +0 -4
  324. package/esm/LinearBasicDisplay/index.js +0 -20
  325. package/esm/LinearBasicDisplay/model.d.ts +0 -1391
  326. package/esm/LinearBasicDisplay/model.js +0 -158
  327. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
  328. package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
  329. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
  330. package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
  331. package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
  332. package/esm/LinearFeatureDisplay/configSchema.js +0 -11
  333. package/esm/LinearFeatureDisplay/index.d.ts +0 -3
  334. package/esm/LinearFeatureDisplay/index.js +0 -2
  335. package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
  336. package/esm/LinearFeatureDisplay/model.js +0 -305
  337. package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
  338. package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
  339. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
  340. package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
  341. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
  342. package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
  343. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
  344. package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
  345. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
  346. package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
  347. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
  348. package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
  349. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
  350. package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
  351. package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
  352. package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
  353. package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
  354. package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
  355. package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
  356. package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
  357. package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
  358. package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
  359. package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
  360. package/esm/LinearGenomeView/svgExportUtil.js +0 -6
  361. package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
  362. package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
  363. /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
@@ -1,168 +1,199 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
3
  import { Menu } from '@jbrowse/core/ui';
4
+ import { assembleLocString, assembleLocStrings } from '@jbrowse/core/util';
5
+ import { copyText } from '@jbrowse/core/util/copyText';
4
6
  import { makeStyles } from '@jbrowse/core/util/tss-react';
5
7
  import { observer } from 'mobx-react';
8
+ import { REF_NAME_LABEL_FONT_SIZE, regionMoveActions, regionRunBounds, withRegionMoved, withRegionRemoved, withRegionReversed, withRegionsKept, } from '../util.js';
9
+ import { scalebarRefLabelProps } from './util.js';
6
10
  const useStyles = makeStyles()(theme => ({
7
11
  refLabel: {
8
- fontSize: 11,
12
+ // the width the fit test in getScalebarRefNameLabels measures against
13
+ fontSize: REF_NAME_LABEL_FONT_SIZE,
14
+ // maxWidth is the label's whole box, paddingLeft included — stated here
15
+ // rather than inherited from whatever box-sizing the embedding page sets,
16
+ // since under content-box the padding comes off the text twice (once in the
17
+ // maxWidth the fit test was given, once in the layout) and every name wide
18
+ // enough to need the space is clipped mid-glyph
19
+ boxSizing: 'border-box',
9
20
  position: 'absolute',
10
- left: 2,
21
+ // x-position is driven by transform:translateX (compositor-only) not left
22
+ left: 0,
11
23
  top: -1,
12
24
  fontWeight: 'bold',
13
25
  lineHeight: 'normal',
14
26
  zIndex: 1,
15
27
  background: theme.palette.background.paper,
16
- cursor: 'pointer',
17
- overflow: 'hidden',
28
+ // clip, not hidden: transform/maxWidth are patched on every scroll-zoom
29
+ // frame, and `hidden` would make each label its own scroll container —
30
+ // scrollable-overflow bookkeeping and scroll anchoring per label per frame,
31
+ // for a box that never scrolls. clip is a paint-time rect instead
32
+ overflow: 'clip',
18
33
  whiteSpace: 'nowrap',
34
+ },
35
+ // refName labels only: the caption chip opens no menu
36
+ clickable: {
37
+ cursor: 'pointer',
19
38
  '&:hover': {
20
- background: theme.palette.grey[300],
39
+ background: theme.palette.action.hover,
21
40
  },
22
41
  },
23
- b0: {
24
- left: 0,
42
+ caption: {
25
43
  zIndex: 100,
26
44
  },
27
45
  }));
28
46
  const ScalebarRefNameLabels = observer(function ScalebarRefNameLabels({ model, }) {
29
47
  const { classes, cx } = useStyles();
30
- const { staticBlocks, offsetPx, scalebarDisplayPrefix } = model;
31
48
  const [menuState, setMenuState] = useState();
32
- useEffect(() => {
33
- model.setIsScalebarRefNameMenuOpen(!!menuState);
34
- }, [model, menuState]);
35
- let lastLeftBlock = staticBlocks.blocks.findIndex(b => b.type === 'ContentBlock');
36
- if (lastLeftBlock < 0) {
37
- lastLeftBlock = 0;
38
- }
39
- staticBlocks.forEach((block, i) => {
40
- if (block.type === 'ContentBlock' && block.offsetPx - offsetPx < 0) {
41
- lastLeftBlock = i;
42
- }
43
- });
44
- const val = scalebarDisplayPrefix();
45
- const b0 = staticBlocks.blocks[0];
46
- const regionEndPx = new Map();
47
- for (const block of staticBlocks.blocks) {
48
- if (block.type === 'ContentBlock' && block.regionNumber !== undefined) {
49
- const endPx = block.offsetPx + block.widthPx;
50
- const current = regionEndPx.get(block.regionNumber);
51
- if (current === undefined || endPx > current) {
52
- regionEndPx.set(block.regionNumber, endPx);
53
- }
54
- }
55
- }
56
- return (_jsxs(_Fragment, { children: [b0?.type !== 'ContentBlock' && val ? (_jsx("span", { className: cx(classes.b0, classes.refLabel), children: val })) : null, staticBlocks.map((block, index) => {
57
- const { offsetPx: blockOffsetPx, isLeftEndOfDisplayedRegion, key, type, refName, regionNumber, } = block;
58
- const last = index === lastLeftBlock;
59
- const regEndPx = regionNumber !== undefined ? regionEndPx.get(regionNumber) : undefined;
60
- const labelStartPx = last ? offsetPx : blockOffsetPx;
61
- const maxWidth = regEndPx !== undefined ? regEndPx - labelStartPx - 2 : undefined;
62
- const minLabelWidth = 20;
63
- const hasEnoughSpace = maxWidth === undefined || maxWidth >= minLabelWidth;
64
- return type === 'ContentBlock' &&
65
- (isLeftEndOfDisplayedRegion || last) &&
66
- hasEnoughSpace ? (_jsxs("span", { style: {
67
- left: last
68
- ? Math.max(0, -offsetPx)
69
- : blockOffsetPx - offsetPx - 1,
70
- paddingLeft: last ? 0 : 1,
71
- maxWidth: maxWidth !== undefined && maxWidth > 0 ? maxWidth : undefined,
72
- }, className: classes.refLabel, "data-testid": `refLabel-${refName}`, onMouseDown: () => {
73
- model.setScalebarRefNameClickPending(true);
74
- }, onClick: event => {
75
- model.setScalebarRefNameClickPending(false);
76
- setMenuState({
77
- anchorEl: event.currentTarget,
78
- refName,
79
- regionNumber: regionNumber,
80
- });
81
- }, children: [last && val ? `${val}:` : '', refName] }, `refLabel-${key}-${index}`)) : null;
82
- }), menuState ? (_jsx(RefNameMenu, { model: model, menuState: menuState, onClose: () => {
49
+ const { labels, caption } = model.scalebarRefNameLabels;
50
+ return (_jsxs(_Fragment, { children: [labels.map((label, i) => (_jsx(RefLabel
51
+ // eslint-disable-next-line @eslint-react/no-array-index-key -- position IS the identity here; keying by the run makes the list churn on zoom
52
+ , { model: model, label: label, onOpenMenu: setMenuState }, i))), caption === undefined ? null : (_jsx("span", { className: cx(classes.caption, classes.refLabel), "data-testid": "refLabel-prefix", children: caption })), menuState ? (_jsx(RefNameMenu, { model: model, menuState: menuState, onClose: () => {
53
+ model.setIsScalebarRefNameMenuOpen(false);
83
54
  setMenuState(undefined);
84
55
  } })) : null] }));
85
56
  });
86
- function RefNameMenu({ model, menuState, onClose, }) {
57
+ // Not an observer: `label` is plain data from the parent. The attribute tells
58
+ // the scalebar's rubberband to leave a click here to this label's onClick.
59
+ function RefLabel({ model, label, onOpenMenu, }) {
60
+ const { classes, cx } = useStyles();
61
+ const { refName, transform, maxWidth, paddingLeft, text } = label;
62
+ return (_jsx("span", { className: cx(classes.refLabel, classes.clickable), style: {
63
+ transform: `translateX(${transform}px)`,
64
+ paddingLeft,
65
+ maxWidth,
66
+ }, "data-testid": `refLabel-${refName}`, ...scalebarRefLabelProps, onClick: e => {
67
+ model.setIsScalebarRefNameMenuOpen(true);
68
+ onOpenMenu({ anchorEl: e.currentTarget, label });
69
+ }, children: text }));
70
+ }
71
+ const RefNameMenu = observer(function RefNameMenu({ model, menuState, onClose, }) {
87
72
  const { displayedRegions } = model;
88
- const { refName, regionNumber } = menuState;
73
+ const { refName, displayedRegionIndex: idx, lastDisplayedRegionIndex: lastIdx, } = menuState.label;
89
74
  const numRegions = displayedRegions.length;
90
- function moveRegion(fromIndex, toIndex) {
91
- const regions = [...displayedRegions];
92
- const [removed] = regions.splice(fromIndex, 1);
93
- regions.splice(toIndex, 0, removed);
94
- model.setDisplayedRegions(regions);
95
- }
96
- function removeRegion(index) {
97
- const regions = displayedRegions.filter((_, i) => i !== index);
98
- model.setDisplayedRegions(regions);
99
- }
100
- const actionItems = [
101
- ...(regionNumber > 0
102
- ? [
103
- {
104
- label: 'Move left',
105
- onClick: () => {
106
- moveRegion(regionNumber, regionNumber - 1);
107
- },
108
- },
109
- ]
110
- : []),
111
- ...(regionNumber < numRegions - 1
112
- ? [
113
- {
114
- label: 'Move right',
115
- onClick: () => {
116
- moveRegion(regionNumber, regionNumber + 1);
117
- },
118
- },
119
- ]
120
- : []),
121
- ...(numRegions > 2 && regionNumber > 0
122
- ? [
123
- {
124
- label: 'Move to far left',
125
- onClick: () => {
126
- moveRegion(regionNumber, 0);
127
- },
128
- },
129
- ]
130
- : []),
131
- ...(numRegions > 2 && regionNumber < numRegions - 1
132
- ? [
133
- {
134
- label: 'Move to far right',
135
- onClick: () => {
136
- moveRegion(regionNumber, numRegions - 1);
137
- },
138
- },
139
- ]
140
- : []),
141
- {
142
- label: 'Remove this region from view',
143
- onClick: () => {
144
- removeRegion(regionNumber);
145
- },
146
- },
147
- ];
148
- return (_jsx(Menu, { anchorEl: menuState.anchorEl, open: true, onClose: onClose, onMenuItemClick: (_, callback) => {
75
+ const labeled = displayedRegions.slice(idx, lastIdx + 1);
76
+ // A label naming several regions is the collapsed-intron case: adjacent
77
+ // regions sharing a refName get one label between them. Reverse/move/remove
78
+ // are per-region and this label names no particular one — it used to act on
79
+ // whichever region the label happened to ride, which for the pinned label
80
+ // changed as you scrolled — so a run offers only the two items that mean the
81
+ // whole run.
82
+ const oneRegion = idx === lastIdx;
83
+ // one region keeps its `{assembly}` qualifier; a run drops the qualifier the
84
+ // regions all share, as the view header does for the same list
85
+ const locString = oneRegion
86
+ ? assembleLocString(displayedRegions[idx])
87
+ : assembleLocStrings(labeled);
88
+ // The region this label's blocks were cut out of. Taken over the WHOLE run
89
+ // rather than `labeled`, which the viewport clips: a collapsed-introns view
90
+ // zoomed into two exons would otherwise offer a span that is not the gene's.
91
+ const { first: runFirst, last: runLast } = regionRunBounds(displayedRegions, idx, lastIdx);
92
+ const run = displayedRegions.slice(runFirst, runLast + 1);
93
+ const wholeSpan = {
94
+ ...run[0],
95
+ start: Math.min(...run.map(r => r.start)),
96
+ end: Math.max(...run.map(r => r.end)),
97
+ };
98
+ return (_jsx(Menu, { anchorEl: menuState.anchorEl, open: true, onClose: onClose, onMenuItemClick: callback => {
149
99
  callback();
150
100
  onClose();
151
101
  }, menuItems: [
152
102
  {
153
103
  label: `Focus on ${refName}`,
104
+ // moveTo by index, not navTo by refName: navTo resolves to the FIRST
105
+ // region carrying the name, so on a duplicated refName (a chromosome
106
+ // displayed twice) clicking the third chr1 label jumped to the first.
107
+ // Every other item in this menu is already idx-based.
154
108
  onClick: () => {
155
- model.navTo({ refName });
109
+ const last = displayedRegions[lastIdx];
110
+ model.moveTo({ index: idx, offset: 0 }, { index: lastIdx, offset: last.end - last.start });
156
111
  },
157
112
  },
158
- ...(numRegions > 1
113
+ ...(labeled.length < numRegions
114
+ ? [
115
+ {
116
+ label: oneRegion
117
+ ? 'Show only this region'
118
+ : `Show only ${refName}`,
119
+ onClick: () => {
120
+ model.editDisplayedRegions(withRegionsKept(displayedRegions, idx, lastIdx));
121
+ },
122
+ },
123
+ ]
124
+ : []),
125
+ ...(runLast > runFirst
126
+ ? [
127
+ {
128
+ // Names its subject the way the two rows above it do; the span
129
+ // it lands on is not spelled into the label, which would move
130
+ // under the reader as they navigate.
131
+ label: `Show the whole span of ${refName}`,
132
+ // Focused rather than centre-kept: the rejoined region is one
133
+ // the old viewport never saw, so there is no centre to hold,
134
+ // and showing the span is the whole point of the row.
135
+ onClick: () => {
136
+ model.setDisplayedRegions([
137
+ ...displayedRegions.slice(0, runFirst),
138
+ wholeSpan,
139
+ ...displayedRegions.slice(runLast + 1),
140
+ ]);
141
+ model.moveTo({ index: runFirst, offset: 0 }, {
142
+ index: runFirst,
143
+ offset: wholeSpan.end - wholeSpan.start,
144
+ });
145
+ },
146
+ },
147
+ ]
148
+ : []),
149
+ {
150
+ label: 'Copy to clipboard',
151
+ subMenu: [
152
+ {
153
+ label: 'Reference sequence name',
154
+ onClick: () => {
155
+ void copyText(model, refName, 'reference sequence name');
156
+ },
157
+ },
158
+ {
159
+ label: 'Region',
160
+ onClick: () => {
161
+ void copyText(model, locString, 'region');
162
+ },
163
+ },
164
+ ],
165
+ },
166
+ ...(oneRegion
159
167
  ? [
160
168
  {
161
169
  label: 'Actions',
162
- subMenu: actionItems,
170
+ subMenu: [
171
+ {
172
+ label: 'Reverse region',
173
+ onClick: () => {
174
+ model.editDisplayedRegions(withRegionReversed(displayedRegions, idx));
175
+ },
176
+ },
177
+ ...regionMoveActions(idx, numRegions).map(({ label, to }) => ({
178
+ label,
179
+ onClick: () => {
180
+ model.editDisplayedRegions(withRegionMoved(displayedRegions, idx, to));
181
+ },
182
+ })),
183
+ ...(numRegions > 1
184
+ ? [
185
+ {
186
+ label: 'Remove this region from view',
187
+ onClick: () => {
188
+ model.editDisplayedRegions(withRegionRemoved(displayedRegions, idx));
189
+ },
190
+ },
191
+ ]
192
+ : []),
193
+ ],
163
194
  },
164
195
  ]
165
196
  : []),
166
197
  ] }));
167
- }
198
+ });
168
199
  export default ScalebarRefNameLabels;
@@ -1,6 +1,26 @@
1
1
  import type { LinearGenomeViewModel } from '../model.ts';
2
- declare const SearchBox: ({ model, showHelp, }: {
2
+ import type React from 'react';
3
+ /**
4
+ * What the box asks its row for at `value`, margins included — the number
5
+ * `headerFit` sheds against.
6
+ *
7
+ * The ask follows the locstring, which is the whole point of asking: 194px at
8
+ * `ctgA:1..20,000` and 284px at `chr22:10,510,000..10,610,000`, so a row sized
9
+ * against the 189px floor sheds too little and flexbox squeezes the box anyway.
10
+ * It is `getInputWidth`, the same function the box sizes itself with, rather
11
+ * than that arithmetic done again out here.
12
+ *
13
+ * `showHelp` is the component's own default below, and with help on
14
+ * `adornmentReservePx` returns the same number whatever the recent-locations
15
+ * menu holds — so the count only this component's hook knows cannot change the
16
+ * answer.
17
+ */
18
+ export declare function searchBoxWidth(value: string): number;
19
+ declare const SearchBox: ({ model, showHelp, minWidth, maxWidth, style, }: {
3
20
  showHelp?: boolean;
4
21
  model: LinearGenomeViewModel;
5
- }) => import("react/jsx-runtime").JSX.Element;
22
+ minWidth?: number;
23
+ maxWidth?: number;
24
+ style?: React.CSSProperties;
25
+ }) => React.JSX.Element;
6
26
  export default SearchBox;
@@ -1,82 +1,75 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { RefNameAutocomplete, RefNameAutocompleteEndAdornment, adornmentReservePx, getInputWidth, useRecentLocations, } from '@jbrowse/core/ui';
3
+ import { usePalette } from '@jbrowse/core/ui/PaletteContext';
4
+ import { alpha } from '@jbrowse/core/ui/palette';
2
5
  import { getSession } from '@jbrowse/core/util';
3
- import { makeStyles } from '@jbrowse/core/util/tss-react';
4
- import { alpha, useTheme } from '@mui/material';
5
6
  import { observer } from 'mobx-react';
6
- import EndAdornment from "./RefNameAutocomplete/EndAdornment.js";
7
- import RefNameAutocomplete from "./RefNameAutocomplete/index.js";
8
- import { fetchResults } from "./util.js";
9
- import { handleSelectedRegion, navToOption } from "../../searchUtils.js";
10
- import { SPACING, WIDGET_HEIGHT } from "../consts.js";
11
- const useStyles = makeStyles()({
12
- headerRefName: {
13
- minWidth: 100,
14
- },
15
- });
16
- async function onSelect({ option, model, assemblyName, }) {
17
- const { assemblyManager } = getSession(model);
18
- const assembly = assemblyManager.get(assemblyName);
19
- if (option.hasLocation()) {
20
- await navToOption({
21
- option,
22
- model,
23
- assemblyName,
24
- });
25
- }
26
- else if (option.results?.length) {
27
- model.setSearchResults(option.results, option.getLabel());
28
- }
29
- else if (assembly) {
30
- await handleSelectedRegion({
31
- input: option.getLabel(),
32
- assembly,
33
- model,
34
- });
35
- }
7
+ import { fetchResults, navigateToSelectedOption, notifySearchFailure, } from '../../searchUtils.js';
8
+ import { SPACING, WIDGET_HEIGHT } from '../consts.js';
9
+ import { recentLocationOf, recentLocationsMenu } from './recentLocationsMenu.js';
10
+ const defaultStyle = { margin: SPACING };
11
+ // The header box's floor and ceiling. A stacked view's row passes its own, and
12
+ // `searchBoxWidth` answers for these.
13
+ const MIN_WIDTH = 175;
14
+ const MAX_WIDTH = 550;
15
+ /**
16
+ * What the box asks its row for at `value`, margins included — the number
17
+ * `headerFit` sheds against.
18
+ *
19
+ * The ask follows the locstring, which is the whole point of asking: 194px at
20
+ * `ctgA:1..20,000` and 284px at `chr22:10,510,000..10,610,000`, so a row sized
21
+ * against the 189px floor sheds too little and flexbox squeezes the box anyway.
22
+ * It is `getInputWidth`, the same function the box sizes itself with, rather
23
+ * than that arithmetic done again out here.
24
+ *
25
+ * `showHelp` is the component's own default below, and with help on
26
+ * `adornmentReservePx` returns the same number whatever the recent-locations
27
+ * menu holds — so the count only this component's hook knows cannot change the
28
+ * answer.
29
+ */
30
+ export function searchBoxWidth(value) {
31
+ return (getInputWidth(value, MIN_WIDTH, MAX_WIDTH, adornmentReservePx({ showHelp: true })) +
32
+ 2 * SPACING);
36
33
  }
37
- const SearchBox = observer(function SearchBox({ model, showHelp = true, }) {
38
- const { classes } = useStyles();
39
- const theme = useTheme();
34
+ const SearchBox = observer(function SearchBox({ model, showHelp = true, minWidth = MIN_WIDTH, maxWidth = MAX_WIDTH, style = defaultStyle, }) {
35
+ const palette = usePalette();
40
36
  const session = getSession(model);
41
37
  const { textSearchManager, assemblyManager } = session;
42
- const { assemblyNames, rankSearchResults } = model;
38
+ const { assemblyNames } = model;
43
39
  const assemblyName = assemblyNames[0];
44
40
  const assembly = assemblyManager.get(assemblyName);
45
- const searchScope = model.searchScope(assemblyName);
46
- return (_jsx(RefNameAutocomplete, { onSelect: async (option) => {
47
- try {
48
- await onSelect({
49
- model,
50
- assemblyName,
51
- option,
52
- });
53
- }
54
- catch (e) {
55
- console.error(e);
56
- getSession(model).notify(`${e}`, 'warning');
57
- }
58
- }, assemblyName: assemblyName, fetchResults: queryString => fetchResults({
41
+ const { recentLocations, addRecentLocation, clearRecentLocations } = useRecentLocations(assemblyName);
42
+ async function navigate(option) {
43
+ try {
44
+ await navigateToSelectedOption({ model, assemblyName, option });
45
+ addRecentLocation(recentLocationOf(option));
46
+ }
47
+ catch (e) {
48
+ notifySearchFailure(session, e);
49
+ }
50
+ }
51
+ const recentMenuItems = recentLocationsMenu({
52
+ recentLocations,
53
+ onNavigate: option => {
54
+ void navigate(option);
55
+ },
56
+ onClear: clearRecentLocations,
57
+ });
58
+ return (_jsx(RefNameAutocomplete, { onSelect: option => {
59
+ void navigate(option);
60
+ }, assemblyName: assemblyName, fetchResults: (queryString, signal) => fetchResults({
59
61
  queryString,
60
- searchScope,
61
- rankSearchResults,
62
+ assemblyName,
62
63
  textSearchManager,
63
64
  assembly,
64
- }), model: model, minWidth: 175, TextFieldProps: {
65
- variant: 'outlined',
66
- className: classes.headerRefName,
67
- style: {
68
- margin: SPACING,
69
- },
70
- slotProps: {
71
- input: {
72
- style: {
73
- padding: 0,
74
- height: WIDGET_HEIGHT,
75
- background: alpha(theme.palette.background.paper, 0.8),
76
- },
77
- endAdornment: _jsx(EndAdornment, { showHelp: showHelp }),
78
- },
79
- },
65
+ signal,
66
+ }), session: session, value: model.coarseVisibleLocStrings, minWidth: minWidth, maxWidth: maxWidth, adornmentWidth: adornmentReservePx({
67
+ showHelp,
68
+ menuItemCount: recentMenuItems.length,
69
+ }), style: style, endAdornment: _jsx(RefNameAutocompleteEndAdornment, { showHelp: showHelp, menuItems: recentMenuItems }), inputStyle: {
70
+ padding: 0,
71
+ height: WIDGET_HEIGHT,
72
+ background: alpha(palette.background.paper, 0.8),
80
73
  } }));
81
74
  });
82
75
  export default SearchBox;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export default function SearchPanelForm({ onSubmit, handleClose, submitDisabled, submitText, actions, children, }: {
3
+ onSubmit: () => void;
4
+ handleClose: () => void;
5
+ submitDisabled: boolean;
6
+ submitText?: string;
7
+ actions?: ReactNode;
8
+ children: ReactNode;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SubmitForm } from '@jbrowse/core/ui';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
4
+ const useStyles = makeStyles()({
5
+ dialogContent: {
6
+ width: '34em',
7
+ display: 'flex',
8
+ flexDirection: 'column',
9
+ gap: 12,
10
+ },
11
+ });
12
+ // The chrome shared by the sequence-search mode panels: the fixed-width column
13
+ // their fields lay out in, plus SubmitForm's Cancel/Submit footer. Each panel
14
+ // still owns its own fields and its own submit, so this is only the frame.
15
+ export default function SearchPanelForm({ onSubmit, handleClose, submitDisabled, submitText, actions, children, }) {
16
+ const { classes } = useStyles();
17
+ return (_jsx(SubmitForm, { contentClassName: classes.dialogContent, onSubmit: onSubmit, onCancel: handleClose, submitDisabled: submitDisabled, submitText: submitText, actions: actions, children: children }));
18
+ }
@@ -1,9 +1,10 @@
1
1
  import type { LinearGenomeViewModel } from '../../index.ts';
2
2
  import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
3
- export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, }: {
3
+ export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, onPick, }: {
4
4
  model: LinearGenomeViewModel;
5
- assemblyName?: string;
5
+ assemblyName: string;
6
6
  searchQuery: string;
7
- searchResults?: BaseResult[];
7
+ searchResults: BaseResult[];
8
8
  handleClose: () => void;
9
- }): import("react/jsx-runtime").JSX.Element;
9
+ onPick: (result: BaseResult) => Promise<unknown>;
10
+ }): import("react").JSX.Element;
@@ -1,9 +1,7 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Dialog } from '@jbrowse/core/ui';
3
- import { Button, DialogActions, DialogContent, Divider, Typography, } from '@mui/material';
4
- import SearchResultsTable from "./SearchResultsTable.js";
5
- export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, }) {
6
- return (_jsxs(Dialog, { open: true, maxWidth: "xl", onClose: handleClose, title: "Search results", children: [_jsx(DialogContent, { children: !searchResults?.length ? (_jsxs(Typography, { children: ["No results found for ", _jsx("b", { children: searchQuery })] })) : (_jsxs(_Fragment, { children: [_jsxs(Typography, { children: ["Showing results for ", _jsx("b", { children: searchQuery })] }), _jsx(SearchResultsTable, { model: model, handleClose: handleClose, assemblyName: assemblyName, searchResults: searchResults })] })) }), _jsx(Divider, {}), _jsx(DialogActions, { children: _jsx(Button, { onClick: () => {
7
- handleClose();
8
- }, color: "primary", children: "Cancel" }) })] }));
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { InfoDialog } from '@jbrowse/core/ui';
3
+ import { Typography } from '@mui/material';
4
+ import SearchResultsTable from './SearchResultsTable.js';
5
+ export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, onPick, }) {
6
+ return (_jsx(InfoDialog, { open: true, maxWidth: "xl", onClose: handleClose, title: "Search results", children: !searchResults.length ? (_jsxs(Typography, { children: ["No results found for ", _jsx("b", { children: searchQuery })] })) : (_jsxs(_Fragment, { children: [_jsxs(Typography, { children: ["Showing results for ", _jsx("b", { children: searchQuery })] }), _jsx(SearchResultsTable, { model: model, handleClose: handleClose, assemblyName: assemblyName, searchResults: searchResults, onPick: onPick })] })) }));
9
7
  }
@@ -1,8 +1,10 @@
1
1
  import type { LinearGenomeViewModel } from '../../index.ts';
2
2
  import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
3
- export default function SearchResultsTable({ searchResults, assemblyName: optAssemblyName, model, handleClose, }: {
3
+ declare const SearchResultsTable: ({ searchResults, assemblyName, model, handleClose, onPick, }: {
4
4
  searchResults: BaseResult[];
5
- assemblyName?: string;
5
+ assemblyName: string;
6
6
  model: LinearGenomeViewModel;
7
7
  handleClose: () => void;
8
- }): import("react/jsx-runtime").JSX.Element;
8
+ onPick: (result: BaseResult) => Promise<unknown>;
9
+ }) => import("react").JSX.Element;
10
+ export default SearchResultsTable;