@jbrowse/display-ui 5.0.0-beta.13 → 5.0.0-beta.14

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 (55) hide show
  1. package/README.md +70 -76
  2. package/esm/AxisCaption.d.ts +2 -2
  3. package/esm/AxisCaption.js +6 -4
  4. package/esm/AxisGutter.d.ts +2 -2
  5. package/esm/AxisGutter.js +5 -4
  6. package/esm/CrossHatches.d.ts +3 -2
  7. package/esm/CrossHatches.js +5 -2
  8. package/esm/DisplayUIProvider.d.ts +3 -2
  9. package/esm/DisplayUIProvider.js +4 -2
  10. package/esm/FloatingLegend.js +2 -2
  11. package/esm/FloatingText.d.ts +5 -5
  12. package/esm/FloatingText.js +6 -5
  13. package/esm/ScoreDomainCaption.d.ts +2 -2
  14. package/esm/ScoreDomainCaption.js +3 -2
  15. package/esm/ScoreRules.d.ts +3 -2
  16. package/esm/ScoreRules.js +5 -2
  17. package/esm/YScaleBar.js +1 -8
  18. package/esm/YScaleBarOverlay.d.ts +3 -2
  19. package/esm/YScaleBarOverlay.js +4 -2
  20. package/esm/axisPlacement.d.ts +11 -5
  21. package/esm/axisPlacement.js +15 -8
  22. package/esm/bottomRightCorner.d.ts +19 -47
  23. package/esm/bottomRightCorner.js +19 -47
  24. package/esm/chromeOverlayContext.js +10 -25
  25. package/esm/chromeOverlays.d.ts +73 -67
  26. package/esm/embed/engineBoundary.d.ts +34 -0
  27. package/esm/embed/engineBoundary.js +29 -0
  28. package/esm/embed/index.d.ts +6 -0
  29. package/esm/embed/index.js +18 -3
  30. package/esm/embed/legend.js +2 -2
  31. package/esm/embed/location.d.ts +2 -1
  32. package/esm/embed/location.js +18 -17
  33. package/esm/embed/notifications.d.ts +29 -0
  34. package/esm/embed/notifications.js +38 -0
  35. package/esm/embed/provider.d.ts +5 -3
  36. package/esm/embed/provider.js +6 -4
  37. package/esm/embed/regions.d.ts +3 -2
  38. package/esm/embed/regions.js +9 -7
  39. package/esm/embed/searchPicker.d.ts +24 -0
  40. package/esm/embed/searchPicker.js +14 -0
  41. package/esm/embed/toolbar.d.ts +16 -0
  42. package/esm/embed/toolbar.js +22 -0
  43. package/esm/index.d.ts +1 -1
  44. package/esm/isLiveModel.d.ts +10 -15
  45. package/esm/isLiveModel.js +10 -15
  46. package/esm/plainChromeOverlays.d.ts +2 -2
  47. package/esm/plainChromeOverlays.js +17 -44
  48. package/esm/tooltip/Tooltip.d.ts +3 -3
  49. package/esm/tooltip/Tooltip.js +4 -2
  50. package/esm/trackControl/plainTrackControl.d.ts +2 -1
  51. package/esm/trackControl/plainTrackControl.js +8 -6
  52. package/esm/trackOverlay/TrackOverlaySlot.d.ts +3 -3
  53. package/esm/trackOverlay/TrackOverlaySlot.js +4 -3
  54. package/esm/valueScale.d.ts +5 -5
  55. package/package.json +3 -3
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { observer } from 'mobx-react';
2
3
  import { createPortal } from 'react-dom';
3
4
  import Tooltip from '../tooltip/Tooltip.js';
4
5
  import { useTrackControlMenu } from './useTrackControlMenu.js';
@@ -34,14 +35,14 @@ const ICON_PATHS = {
34
35
  // warning state exists precisely so the user sees it without hovering. Chosen to
35
36
  // stay legible on both a light and a dark track.
36
37
  const WARNING_COLOR = '#d97706';
37
- function Icon({ icon }) {
38
+ const Icon = observer(function Icon({ icon }) {
38
39
  return (_jsx("svg", { viewBox: "0 0 16 16", width: 12, height: 12, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { flex: 'none' }, children: _jsx("path", { d: ICON_PATHS[icon] }) }));
39
- }
40
+ });
40
41
  // The ▾ after a label whose press opens a menu. Drawn like the icons, for the
41
42
  // same reason; smaller, because it qualifies the label rather than naming it.
42
- function Caret() {
43
+ const Caret = observer(function Caret() {
43
44
  return (_jsx("svg", { viewBox: "0 0 8 8", width: 8, height: 8, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { flex: 'none', marginLeft: -1 }, children: _jsx("path", { d: "M1.5 3l2.5 2.5L6.5 3" }) }));
44
- }
45
+ });
45
46
  function triggerStyle(warning) {
46
47
  return {
47
48
  font: 'inherit',
@@ -78,7 +79,7 @@ function triggerStyle(warning) {
78
79
  * `plainChromeOverlays` — the two are a pair, and both are things you hand to a
79
80
  * provider rather than render yourself.
80
81
  */
81
- export default function PlainTrackControl({ icon, tooltip, label, options, onClick, onMenuClose, onDelete, warning, }) {
82
+ const PlainTrackControl = observer(function PlainTrackControl({ icon, tooltip, label, options, onClick, onMenuClose, onDelete, warning, }) {
82
83
  const { open, triggerProps, menuProps, getOptionProps } = useTrackControlMenu(onMenuClose);
83
84
  return (_jsxs("span", { style: { display: 'inline-flex', alignItems: 'center' }, children: [_jsx(Tooltip, { title: tooltip, children: _jsxs("button", { type: "button", "aria-label": tooltip, "data-testid": `track-control-${icon}`, ...(options ? triggerProps : undefined), style: {
84
85
  ...triggerStyle(!!warning),
@@ -130,4 +131,5 @@ export default function PlainTrackControl({ icon, tooltip, label, options, onCli
130
131
  border: 'none',
131
132
  }, children: [option.selected ? '✓ ' : '', option.label] }, option.label))) }), document.body)
132
133
  : null] }));
133
- }
134
+ });
135
+ export default PlainTrackControl;
@@ -6,7 +6,7 @@
6
6
  * A display's React tree is sealed in a `contain: strict` sandbox — that is what
7
7
  * isolates its paint, and dropping it is measured and rejected (ADR-058). A
8
8
  * stacking context comes with the isolation, so floating chrome a display draws
9
- * (a colour key, hi-c's overlay panel, maf's row labels) cannot out-z-index
9
+ * (a color key, hi-c's overlay panel, maf's row labels) cannot out-z-index
10
10
  * anything painted over the track stack from outside. The escape is a node
11
11
  * mounted *beside* the sandbox rather than inside it, published through
12
12
  * `TrackOverlayContext`; this component is that node, its context and the paint
@@ -40,7 +40,7 @@
40
40
  * `data-gesture-owner`, so anything that does is already exempt from the LGV's
41
41
  * click-drag pan.
42
42
  */
43
- export declare function TrackOverlaySlot({ children, zIndex, style, overlayStyle, }: {
43
+ export declare const TrackOverlaySlot: ({ children, zIndex, style, overlayStyle, }: {
44
44
  children: React.ReactNode;
45
45
  /** Paint order for the overlay node, against whatever the caller draws over
46
46
  * the track stack. No default on purpose — see above. */
@@ -51,4 +51,4 @@ export declare function TrackOverlaySlot({ children, zIndex, style, overlayStyle
51
51
  * `left` to cancel its Paper border, so the node covers the canvas
52
52
  * edge-to-edge rather than leaving a sliver. */
53
53
  overlayStyle?: React.CSSProperties;
54
- }): import("react").JSX.Element;
54
+ }) => import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
+ import { observer } from 'mobx-react';
3
4
  import { TrackOverlayContext } from './TrackOverlayContext.js';
4
5
  /**
5
6
  * #api
@@ -9,7 +10,7 @@ import { TrackOverlayContext } from './TrackOverlayContext.js';
9
10
  * A display's React tree is sealed in a `contain: strict` sandbox — that is what
10
11
  * isolates its paint, and dropping it is measured and rejected (ADR-058). A
11
12
  * stacking context comes with the isolation, so floating chrome a display draws
12
- * (a colour key, hi-c's overlay panel, maf's row labels) cannot out-z-index
13
+ * (a color key, hi-c's overlay panel, maf's row labels) cannot out-z-index
13
14
  * anything painted over the track stack from outside. The escape is a node
14
15
  * mounted *beside* the sandbox rather than inside it, published through
15
16
  * `TrackOverlayContext`; this component is that node, its context and the paint
@@ -43,7 +44,7 @@ import { TrackOverlayContext } from './TrackOverlayContext.js';
43
44
  * `data-gesture-owner`, so anything that does is already exempt from the LGV's
44
45
  * click-drag pan.
45
46
  */
46
- export function TrackOverlaySlot({ children, zIndex, style, overlayStyle, }) {
47
+ export const TrackOverlaySlot = observer(function TrackOverlaySlot({ children, zIndex, style, overlayStyle, }) {
47
48
  // element state rather than a ref, so consumers re-render once the portal
48
49
  // target mounts and the context value flips from null to the node
49
50
  const [overlayEl, setOverlayEl] = useState(null);
@@ -57,4 +58,4 @@ export function TrackOverlaySlot({ children, zIndex, style, overlayStyle, }) {
57
58
  zIndex,
58
59
  ...overlayStyle,
59
60
  } })] }));
60
- }
61
+ });
@@ -16,7 +16,7 @@ export interface ValueScaleRule {
16
16
  /**
17
17
  * #api
18
18
  * A value scale a display places its y through, declared so the chrome can
19
- * derive the axis from it — the score axis's counterpart to a colour scale.
19
+ * derive the axis from it — the score axis's counterpart to a color scale.
20
20
  *
21
21
  * `domain` is the resolved `[min, max]`; `height` the band it rules and
22
22
  * `offset` the inset of the plot box inside that band (`axisPlotBox(height,
@@ -30,12 +30,12 @@ export interface ValueScaleRule {
30
30
  * the display stacks the same plot: the multi-wiggle's rows, a grouped
31
31
  * alignments track's coverage band per group, each projected through the
32
32
  * display's own scroll; the chrome drops the ones off screen. `[]` is a scale
33
- * the display maps to colour rather than to y (density rows each in their own
34
- * colour), which gets the `[min, max]` caption and no axis, as a scale whose
33
+ * the display maps to color rather than to y (density rows each in their own
34
+ * color), which gets the `[min, max]` caption and no axis, as a scale whose
35
35
  * bands are too short for one does. `side` and `left` are which of the band's
36
36
  * edges the display's own panels leave clear for a gutter: `right` where a
37
- * group label chip takes the left, `left: n` where a dendrogram takes the
38
- * first `n` px. `caption` is what the scale measures (`TLEN`), as a colour
37
+ * group label chip takes the left, `left: n` where a dendrogram and row
38
+ * labels take the first `n` px. `caption` is what the scale measures (`TLEN`), as a color
39
39
  * scale's `field` is; the chrome draws it once for the scale, beside the
40
40
  * bands on screen, however many it rules. `rules` are the reference lines the
41
41
  * scale declares and `grid` a line at every tick, both drawn across every
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/display-ui",
3
- "version": "5.0.0-beta.13",
3
+ "version": "5.0.0-beta.14",
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": [
@@ -29,10 +29,10 @@
29
29
  "esm"
30
30
  ],
31
31
  "dependencies": {
32
- "@jbrowse/mobx-state-tree": "^6.7.0",
32
+ "@jbrowse/mobx-state-tree": "^6.9.0",
33
33
  "mobx": "^7.0.6",
34
34
  "mobx-react": "^10.0.2",
35
- "@jbrowse/core": "^5.0.0-beta.13"
35
+ "@jbrowse/core": "^5.0.0-beta.14"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": ">=19.0.0",