@vitessce/vit-s 3.3.1 → 3.3.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.
package/dist/index.js CHANGED
@@ -35394,10 +35394,10 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
35394
35394
  CoordinationType$1.EMBEDDING_OBS_OPACITY
35395
35395
  ];
35396
35396
  const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
35397
- const version = "3.3.1";
35398
- const date = "2023-11-08";
35397
+ const version = "3.3.2";
35398
+ const date = "2023-11-30";
35399
35399
  const branch = "changeset-release/main";
35400
- const hash = "8e897a20";
35400
+ const hash = "a562d787";
35401
35401
  const META_VERSION = {
35402
35402
  note,
35403
35403
  version,
@@ -44453,12 +44453,13 @@ function PlotOptions(props) {
44453
44453
  const { options } = props;
44454
44454
  const [open, setOpen] = useState(false);
44455
44455
  const classes = useStyles$1();
44456
+ const buttonIcon = useMemo(() => /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsIconWithArrow, { open }), [open]);
44456
44457
  return options ? /* @__PURE__ */ jsxRuntimeExports.jsx(
44457
44458
  PopperMenu,
44458
44459
  {
44459
44460
  open,
44460
44461
  setOpen,
44461
- buttonIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsIconWithArrow, { open }),
44462
+ buttonIcon,
44462
44463
  buttonClassName: classes.iconButton,
44463
44464
  placement: "bottom-end",
44464
44465
  "aria-label": "Open plot options menu",
@@ -44476,16 +44477,17 @@ function DownloadOptions(props) {
44476
44477
  const { urls } = props;
44477
44478
  const [open, setOpen] = useState(false);
44478
44479
  const classes = useStyles$1();
44480
+ const buttonIcon = useMemo(() => /* @__PURE__ */ jsxRuntimeExports.jsx(CloudDownloadIconWithArrow, { open }), [open]);
44479
44481
  return urls && urls.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(
44480
44482
  PopperMenu,
44481
44483
  {
44482
44484
  open,
44483
44485
  setOpen,
44484
- buttonIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloudDownloadIconWithArrow, { open }),
44486
+ buttonIcon,
44485
44487
  buttonClassName: classes.iconButton,
44486
44488
  placement: "bottom-end",
44487
44489
  "aria-label": "Open download options menu",
44488
- children: urls.map(({ url, name }) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem$1, { dense: true, getArialLabel: () => `Click to download ${name}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Link$1, { underline: "always", href: url, target: "_blank", rel: "noopener", className: classes.downloadLink, children: [
44490
+ children: urls.map(({ url, name }) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem$1, { dense: true, "aria-label": `Click to download ${name}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Link$1, { underline: "always", href: url, target: "_blank", rel: "noopener", className: classes.downloadLink, children: [
44489
44491
  "Download ",
44490
44492
  name
44491
44493
  ] }) }, `${url}_${name}`))
@@ -44517,7 +44519,9 @@ function TitleInfo(props) {
44517
44519
  removeGridComponent,
44518
44520
  urls,
44519
44521
  isReady,
44520
- options
44522
+ options,
44523
+ closeButtonVisible = true,
44524
+ downloadButtonVisible = true
44521
44525
  } = props;
44522
44526
  const classes = useTitleStyles();
44523
44527
  return (
@@ -44533,18 +44537,18 @@ function TitleInfo(props) {
44533
44537
  options
44534
44538
  }
44535
44539
  ),
44536
- /* @__PURE__ */ jsxRuntimeExports.jsx(
44540
+ downloadButtonVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(
44537
44541
  DownloadOptions,
44538
44542
  {
44539
44543
  urls
44540
44544
  }
44541
- ),
44542
- /* @__PURE__ */ jsxRuntimeExports.jsx(
44545
+ ) : null,
44546
+ closeButtonVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(
44543
44547
  ClosePaneButton,
44544
44548
  {
44545
44549
  removeGridComponent
44546
44550
  }
44547
- )
44551
+ ) : null
44548
44552
  ] })
44549
44553
  ] }),
44550
44554
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -1 +1 @@
1
- {"version":3,"file":"TitleInfo.d.ts","sourceRoot":"","sources":["../src/TitleInfo.js"],"names":[],"mappings":"AA0HA,mDAiDC"}
1
+ {"version":3,"file":"TitleInfo.d.ts","sourceRoot":"","sources":["../src/TitleInfo.js"],"names":[],"mappings":"AA6HA,mDAqDC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useState } from 'react';
2
+ import React, { useState, useMemo } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { makeStyles, MenuItem, IconButton, Link } from '@material-ui/core';
5
5
  import { CloudDownload as CloudDownloadIcon, ArrowDropDown as ArrowDropDownIcon, ArrowDropUp as ArrowDropUpIcon, Settings as SettingsIcon, Close as CloseIcon, } from '@material-ui/icons';
@@ -43,7 +43,8 @@ function PlotOptions(props) {
43
43
  const { options } = props;
44
44
  const [open, setOpen] = useState(false);
45
45
  const classes = useStyles();
46
- return (options ? (_jsx(PopperMenu, { open: open, setOpen: setOpen, buttonIcon: _jsx(SettingsIconWithArrow, { open: open }), buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open plot options menu", children: options })) : null);
46
+ const buttonIcon = useMemo(() => (_jsx(SettingsIconWithArrow, { open: open })), [open]);
47
+ return (options ? (_jsx(PopperMenu, { open: open, setOpen: setOpen, buttonIcon: buttonIcon, buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open plot options menu", children: options })) : null);
47
48
  }
48
49
  function CloudDownloadIconWithArrow({ open }) {
49
50
  return (_jsxs(_Fragment, { children: [_jsx(CloudDownloadIcon, {}), open ? _jsx(ArrowDropUpIcon, {}) : _jsx(ArrowDropDownIcon, {})] }));
@@ -52,7 +53,8 @@ function DownloadOptions(props) {
52
53
  const { urls } = props;
53
54
  const [open, setOpen] = useState(false);
54
55
  const classes = useStyles();
55
- return (urls && urls.length ? (_jsx(PopperMenu, { open: open, setOpen: setOpen, buttonIcon: _jsx(CloudDownloadIconWithArrow, { open: open }), buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open download options menu", children: urls.map(({ url, name }) => (_jsx(MenuItem, { dense: true, getArialLabel: () => `Click to download ${name}`, children: _jsxs(Link, { underline: "always", href: url, target: "_blank", rel: "noopener", className: classes.downloadLink, children: ["Download ", name] }) }, `${url}_${name}`))) })) : null);
56
+ const buttonIcon = useMemo(() => (_jsx(CloudDownloadIconWithArrow, { open: open })), [open]);
57
+ return (urls && urls.length ? (_jsx(PopperMenu, { open: open, setOpen: setOpen, buttonIcon: buttonIcon, buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open download options menu", children: urls.map(({ url, name }) => (_jsx(MenuItem, { dense: true, "aria-label": `Click to download ${name}`, children: _jsxs(Link, { underline: "always", href: url, target: "_blank", rel: "noopener", className: classes.downloadLink, children: ["Download ", name] }) }, `${url}_${name}`))) })) : null);
56
58
  }
57
59
  function ClosePaneButton(props) {
58
60
  const { removeGridComponent } = props;
@@ -60,11 +62,11 @@ function ClosePaneButton(props) {
60
62
  return (_jsx(IconButton, { onClick: removeGridComponent, size: "small", className: classes.iconButton, title: "close", "aria-label": "Close panel button", children: _jsx(CloseIcon, {}) }));
61
63
  }
62
64
  export function TitleInfo(props) {
63
- const { title, info, children, isScroll, isSpatial, removeGridComponent, urls, isReady, options, } = props;
65
+ const { title, info, children, isScroll, isSpatial, removeGridComponent, urls, isReady, options, closeButtonVisible = true, downloadButtonVisible = true, } = props;
64
66
  const classes = useTitleStyles();
65
67
  return (
66
68
  // d-flex without wrapping div is not always full height; I don't understand the root cause.
67
- _jsxs(_Fragment, { children: [_jsxs("div", { className: classes.title, role: "banner", children: [_jsx("div", { className: classes.titleLeft, role: "heading", "aria-level": "1", children: title }), _jsx("div", { className: classes.titleInfo, title: info, role: "note", children: info }), _jsxs("div", { className: classes.titleButtons, role: "toolbar", "aria-label": "Plot options and controls", children: [_jsx(PlotOptions, { options: options }), _jsx(DownloadOptions, { urls: urls }), _jsx(ClosePaneButton, { removeGridComponent: removeGridComponent })] })] }), _jsxs("div", { className: clsx(TOOLTIP_ANCESTOR, classes.card, {
69
+ _jsxs(_Fragment, { children: [_jsxs("div", { className: classes.title, role: "banner", children: [_jsx("div", { className: classes.titleLeft, role: "heading", "aria-level": "1", children: title }), _jsx("div", { className: classes.titleInfo, title: info, role: "note", children: info }), _jsxs("div", { className: classes.titleButtons, role: "toolbar", "aria-label": "Plot options and controls", children: [_jsx(PlotOptions, { options: options }), downloadButtonVisible ? (_jsx(DownloadOptions, { urls: urls })) : null, closeButtonVisible ? (_jsx(ClosePaneButton, { removeGridComponent: removeGridComponent })) : null] })] }), _jsxs("div", { className: clsx(TOOLTIP_ANCESTOR, classes.card, {
68
70
  [classes.scrollCard]: isScroll,
69
71
  [classes.spatialCard]: isSpatial,
70
72
  [classes.noScrollCard]: !isScroll && !isSpatial,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/vit-s",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -29,10 +29,10 @@
29
29
  "uuid": "^9.0.0",
30
30
  "zustand": "^3.5.10",
31
31
  "react-aria": "^3.28.0",
32
- "@vitessce/constants-internal": "3.3.1",
33
- "@vitessce/plugins": "3.3.1",
34
- "@vitessce/schemas": "3.3.1",
35
- "@vitessce/utils": "3.3.1"
32
+ "@vitessce/constants-internal": "3.3.2",
33
+ "@vitessce/plugins": "3.3.2",
34
+ "@vitessce/schemas": "3.3.2",
35
+ "@vitessce/utils": "3.3.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@testing-library/jest-dom": "^5.16.4",
package/src/TitleInfo.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useMemo } from 'react';
2
2
  import clsx from 'clsx';
3
3
  import { makeStyles, MenuItem, IconButton, Link } from '@material-ui/core';
4
4
  import {
@@ -57,11 +57,13 @@ function PlotOptions(props) {
57
57
  const { options } = props;
58
58
  const [open, setOpen] = useState(false);
59
59
  const classes = useStyles();
60
+
61
+ const buttonIcon = useMemo(() => (<SettingsIconWithArrow open={open} />), [open]);
60
62
  return (options ? (
61
63
  <PopperMenu
62
64
  open={open}
63
65
  setOpen={setOpen}
64
- buttonIcon={<SettingsIconWithArrow open={open} />}
66
+ buttonIcon={buttonIcon}
65
67
  buttonClassName={classes.iconButton}
66
68
  placement="bottom-end"
67
69
  aria-label="Open plot options menu"
@@ -84,17 +86,18 @@ function DownloadOptions(props) {
84
86
  const { urls } = props;
85
87
  const [open, setOpen] = useState(false);
86
88
  const classes = useStyles();
89
+ const buttonIcon = useMemo(() => (<CloudDownloadIconWithArrow open={open} />), [open]);
87
90
  return (urls && urls.length ? (
88
91
  <PopperMenu
89
92
  open={open}
90
93
  setOpen={setOpen}
91
- buttonIcon={<CloudDownloadIconWithArrow open={open} />}
94
+ buttonIcon={buttonIcon}
92
95
  buttonClassName={classes.iconButton}
93
96
  placement="bottom-end"
94
97
  aria-label="Open download options menu"
95
98
  >
96
99
  {urls.map(({ url, name }) => (
97
- <MenuItem dense key={`${url}_${name}`} getArialLabel={() => `Click to download ${name}`}>
100
+ <MenuItem dense key={`${url}_${name}`} aria-label={`Click to download ${name}`}>
98
101
  <Link underline="always" href={url} target="_blank" rel="noopener" className={classes.downloadLink}>
99
102
  Download {name}
100
103
  </Link>
@@ -123,7 +126,7 @@ function ClosePaneButton(props) {
123
126
  export function TitleInfo(props) {
124
127
  const {
125
128
  title, info, children, isScroll, isSpatial, removeGridComponent, urls,
126
- isReady, options,
129
+ isReady, options, closeButtonVisible = true, downloadButtonVisible = true,
127
130
  } = props;
128
131
 
129
132
  const classes = useTitleStyles();
@@ -142,12 +145,16 @@ export function TitleInfo(props) {
142
145
  <PlotOptions
143
146
  options={options}
144
147
  />
145
- <DownloadOptions
146
- urls={urls}
147
- />
148
- <ClosePaneButton
149
- removeGridComponent={removeGridComponent}
150
- />
148
+ {downloadButtonVisible ? (
149
+ <DownloadOptions
150
+ urls={urls}
151
+ />
152
+ ) : null}
153
+ {closeButtonVisible ? (
154
+ <ClosePaneButton
155
+ removeGridComponent={removeGridComponent}
156
+ />
157
+ ) : null}
151
158
  </div>
152
159
  </div>
153
160
  <div