@jbrowse/display-ui 5.0.0-beta.1 → 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.
@@ -0,0 +1,5 @@
1
+ export declare const FloatingSvgOverlay: ({ width, height, children, }: {
2
+ width: number;
3
+ height: number;
4
+ children: React.ReactNode;
5
+ }) => import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
3
+ import { TrackOverlayPortal } from './trackOverlay/TrackOverlayPortal.js';
4
+ // Lifts an SVG legend / chrome above the inter-region padding masks: a
5
+ // full-track, pointer-events:none <svg> portaled into the TrackContainer overlay
6
+ // node (see TrackOverlayPortal). The SVG counterpart to the HTML overlays
7
+ // (FloatingLegend, HicOverlayPanel) — used where the same legend
8
+ // markup is also drawn by an SVG-export path, so it must stay <svg>.
9
+ //
10
+ // Children draw in <svg> user space; the wrapping <svg> stays pointer-events:none
11
+ // so it doesn't eat canvas events, so any interactive sub-content (a dismiss
12
+ // "×", clickable swatches) must set pointer-events:auto on its own element.
13
+ // fallbackInline={false}: outside a TrackContainer it renders nothing, matching
14
+ // callers whose export path draws its own inline legend.
15
+ export const FloatingSvgOverlay = observer(function FloatingSvgOverlay({ width, height, children, }) {
16
+ return (_jsx(TrackOverlayPortal, { fallbackInline: false, children: _jsx("svg", { style: {
17
+ position: 'absolute',
18
+ top: 0,
19
+ left: 0,
20
+ width,
21
+ height,
22
+ pointerEvents: 'none',
23
+ overflow: 'hidden',
24
+ }, children: children }) }));
25
+ });
@@ -22,6 +22,9 @@ import { useMouseState } from '@jbrowse/core/ui/useMouseTracking';
22
22
  * each.
23
23
  */
24
24
  export function PointerLayer({ mouseTracker, rowsTopOffset = 0, children, }) {
25
+ // >=: the rows begin AT the offset (their container sits at
26
+ // `top: rowsTopOffset`), so the boundary pixel is row 0's top edge — and with
27
+ // no band above, y=0 is the display's own top edge, not a dead line.
25
28
  const state = useMouseState(mouseTracker);
26
- return _jsx(_Fragment, { children: children(state, !!state && state.y > rowsTopOffset) });
29
+ return _jsx(_Fragment, { children: children(state, !!state && state.y >= rowsTopOffset) });
27
30
  }
package/esm/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export type { TrackControlMenu } from './trackControl/useTrackControlMenu.tsx';
9
9
  export type { TrackControlComponent, TrackControlIcon, TrackControlOption, TrackControlProps, } from './trackControl/types.ts';
10
10
  export { default as FloatingLegend } from './FloatingLegend.tsx';
11
11
  export type { LegendItem, LegendSection } from './FloatingLegend.tsx';
12
+ export { FloatingSvgOverlay } from './FloatingSvgOverlay.tsx';
12
13
  export { default as Tooltip } from './tooltip/Tooltip.tsx';
13
14
  export { useTooltip } from './tooltip/useTooltip.tsx';
14
15
  export type { TooltipTrigger } from './tooltip/useTooltip.tsx';
package/esm/index.js CHANGED
@@ -23,6 +23,12 @@ export { useTrackControlMenu } from './trackControl/useTrackControlMenu.js';
23
23
  // a display draws that is not its data. `@jbrowse/plugin-linear-genome-view`
24
24
  // re-exports it, so its published name is unchanged.
25
25
  export { default as FloatingLegend } from './FloatingLegend.js';
26
+ // The <svg> counterpart of that legend, for a display whose key is drawn by an
27
+ // SVG-export path as well as on screen. Beside it for the same reasons — it
28
+ // reaches no UI toolkit, and portaling chrome above the region masks is what
29
+ // this package is — and re-exported by `@jbrowse/plugin-linear-genome-view`, so
30
+ // its published name is unchanged.
31
+ export { FloatingSvgOverlay } from './FloatingSvgOverlay.js';
26
32
  // The hover label every control in here used to delegate to the browser's
27
33
  // `title` attribute. The box it draws is `@jbrowse/core`'s `BaseTooltip`, the
28
34
  // same one the display tooltips draw, anchored to the control instead of to the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/display-ui",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "The UI a display draws that is not data: the swappable chrome contract, its toolkit-free implementations, and the track overlay layer",
6
6
  "keywords": [
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@jbrowse/mobx-state-tree": "^6.5.1",
26
26
  "mobx-react": "^10.0.2",
27
- "@jbrowse/core": "^5.0.0-beta.1"
27
+ "@jbrowse/core": "^5.0.0-beta.2"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=19.0.0",