@vitessce/vit-s 3.4.10 → 3.4.11

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
@@ -28247,10 +28247,10 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
28247
28247
  CoordinationType$1.EMBEDDING_OBS_OPACITY
28248
28248
  ];
28249
28249
  const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
28250
- const version = "3.4.10";
28251
- const date = "2024-09-01";
28250
+ const version = "3.4.11";
28251
+ const date = "2024-09-27";
28252
28252
  const branch = "changeset-release/main";
28253
- const hash = "26b1c2d6";
28253
+ const hash = "efd7d698";
28254
28254
  const META_VERSION = {
28255
28255
  note,
28256
28256
  version,
@@ -38180,6 +38180,9 @@ const CloseIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
38180
38180
  const CloudDownloadIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
38181
38181
  d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"
38182
38182
  }), "CloudDownload");
38183
+ const HelpIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
38184
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
38185
+ }), "Help");
38183
38186
  const SettingsIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
38184
38187
  d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"
38185
38188
  }), "Settings");
@@ -38305,6 +38308,18 @@ const useStyles$1 = makeStyles((theme) => ({
38305
38308
  },
38306
38309
  downloadLink: {
38307
38310
  color: theme.palette.primaryForeground
38311
+ },
38312
+ helpTextSpan: {
38313
+ maxWidth: "400px",
38314
+ padding: "5px 10px",
38315
+ display: "inline-block",
38316
+ textAlign: "justify",
38317
+ fontSize: "14px",
38318
+ backgroundColor: theme.palette.gridLayoutBackground,
38319
+ color: theme.palette.tooltipText,
38320
+ borderRadius: "8px",
38321
+ boxShadow: "0 0 10px rgba(0, 0, 0, 0.2)",
38322
+ border: "10px solid grey"
38308
38323
  }
38309
38324
  }));
38310
38325
  function SettingsIconWithArrow({ open }) {
@@ -38358,6 +38373,24 @@ function DownloadOptions(props) {
38358
38373
  }
38359
38374
  ) : null;
38360
38375
  }
38376
+ function HelpButton(props) {
38377
+ const { helpText } = props;
38378
+ const [open, setOpen] = useState(false);
38379
+ const classes = useStyles$1();
38380
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
38381
+ PopperMenu,
38382
+ {
38383
+ open,
38384
+ setOpen,
38385
+ buttonIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(HelpIcon, {}),
38386
+ buttonClassName: classes.iconButton,
38387
+ placement: "bottom-end",
38388
+ "aria-label": "Open help info",
38389
+ withPaper: false,
38390
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.helpTextSpan, children: helpText })
38391
+ }
38392
+ );
38393
+ }
38361
38394
  function ClosePaneButton(props) {
38362
38395
  const { removeGridComponent } = props;
38363
38396
  const classes = useStyles$1();
@@ -38385,7 +38418,8 @@ function TitleInfo(props) {
38385
38418
  isReady,
38386
38419
  options,
38387
38420
  closeButtonVisible = true,
38388
- downloadButtonVisible = true
38421
+ downloadButtonVisible = true,
38422
+ helpText
38389
38423
  } = props;
38390
38424
  const classes = useTitleStyles();
38391
38425
  return (
@@ -38407,6 +38441,12 @@ function TitleInfo(props) {
38407
38441
  urls
38408
38442
  }
38409
38443
  ) : null,
38444
+ helpText ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38445
+ HelpButton,
38446
+ {
38447
+ helpText
38448
+ }
38449
+ ) : null,
38410
38450
  closeButtonVisible && removeGridComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38411
38451
  ClosePaneButton,
38412
38452
  {
@@ -38430,7 +38470,7 @@ function TitleInfo(props) {
38430
38470
  "aria-busy": !isReady,
38431
38471
  role: "main",
38432
38472
  children: [
38433
- !isReady && /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIndicator, {}),
38473
+ !isReady ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIndicator, {}) : null,
38434
38474
  children2
38435
38475
  ]
38436
38476
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TitleInfo.d.ts","sourceRoot":"","sources":["../src/TitleInfo.js"],"names":[],"mappings":"AA6HA,mDAqDC"}
1
+ {"version":3,"file":"TitleInfo.d.ts","sourceRoot":"","sources":["../src/TitleInfo.js"],"names":[],"mappings":"AA8JA,mDA2DC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
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
- import { CloudDownload as CloudDownloadIcon, ArrowDropDown as ArrowDropDownIcon, ArrowDropUp as ArrowDropUpIcon, Settings as SettingsIcon, Close as CloseIcon, } from '@material-ui/icons';
5
+ import { CloudDownload as CloudDownloadIcon, ArrowDropDown as ArrowDropDownIcon, ArrowDropUp as ArrowDropUpIcon, Settings as SettingsIcon, Close as CloseIcon, Help as HelpIcon, } from '@material-ui/icons';
6
6
  import { TOOLTIP_ANCESTOR } from './classNames.js';
7
7
  import LoadingIndicator from './LoadingIndicator.js';
8
8
  import { PopperMenu } from './shared-mui/components.js';
@@ -35,6 +35,18 @@ const useStyles = makeStyles(theme => ({
35
35
  downloadLink: {
36
36
  color: theme.palette.primaryForeground,
37
37
  },
38
+ helpTextSpan: {
39
+ maxWidth: '400px',
40
+ padding: '5px 10px',
41
+ display: 'inline-block',
42
+ textAlign: 'justify',
43
+ fontSize: '14px',
44
+ backgroundColor: theme.palette.gridLayoutBackground,
45
+ color: theme.palette.tooltipText,
46
+ borderRadius: '8px',
47
+ boxShadow: '0 0 10px rgba(0, 0, 0, 0.2)',
48
+ border: '10px solid grey',
49
+ },
38
50
  }));
39
51
  function SettingsIconWithArrow({ open }) {
40
52
  return (_jsxs(_Fragment, { children: [_jsx(SettingsIcon, {}), open ? _jsx(ArrowDropUpIcon, {}) : _jsx(ArrowDropDownIcon, {})] }));
@@ -56,21 +68,27 @@ function DownloadOptions(props) {
56
68
  const buttonIcon = useMemo(() => (_jsx(CloudDownloadIconWithArrow, { open: open })), [open]);
57
69
  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);
58
70
  }
71
+ function HelpButton(props) {
72
+ const { helpText } = props;
73
+ const [open, setOpen] = useState(false);
74
+ const classes = useStyles();
75
+ return (_jsx(PopperMenu, { open: open, setOpen: setOpen, buttonIcon: _jsx(HelpIcon, {}), buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open help info", withPaper: false, children: _jsx("span", { className: classes.helpTextSpan, children: helpText }) }));
76
+ }
59
77
  function ClosePaneButton(props) {
60
78
  const { removeGridComponent } = props;
61
79
  const classes = useStyles();
62
80
  return (_jsx(IconButton, { onClick: removeGridComponent, size: "small", className: classes.iconButton, title: "close", "aria-label": "Close panel button", children: _jsx(CloseIcon, {}) }));
63
81
  }
64
82
  export function TitleInfo(props) {
65
- const { title, info, children, isScroll, isSpatial, removeGridComponent, urls, isReady, options, closeButtonVisible = true, downloadButtonVisible = true, } = props;
83
+ const { title, info, children, isScroll, isSpatial, removeGridComponent, urls, isReady, options, closeButtonVisible = true, downloadButtonVisible = true, helpText, } = props;
66
84
  const classes = useTitleStyles();
67
85
  return (
68
86
  // d-flex without wrapping div is not always full height; I don't understand the root cause.
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 && removeGridComponent ? (_jsx(ClosePaneButton, { removeGridComponent: removeGridComponent })) : null] })] }), _jsxs("div", { className: clsx(TOOLTIP_ANCESTOR, classes.card, {
87
+ _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, helpText ? (_jsx(HelpButton, { helpText: helpText })) : null, closeButtonVisible && removeGridComponent ? (_jsx(ClosePaneButton, { removeGridComponent: removeGridComponent })) : null] })] }), _jsxs("div", { className: clsx(TOOLTIP_ANCESTOR, classes.card, {
70
88
  [classes.scrollCard]: isScroll,
71
89
  [classes.spatialCard]: isSpatial,
72
90
  [classes.noScrollCard]: !isScroll && !isSpatial,
73
- }), "aria-busy": !isReady, role: "main", children: [!isReady && _jsx(LoadingIndicator, {}), children] })] })
91
+ }), "aria-busy": !isReady, role: "main", children: [!isReady ? _jsx(LoadingIndicator, {}) : null, children] })] })
74
92
  // "pl-2" only matters when the window is very narrow.
75
93
  );
76
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/vit-s",
3
- "version": "3.4.10",
3
+ "version": "3.4.11",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -29,12 +29,12 @@
29
29
  "uuid": "^9.0.0",
30
30
  "zustand": "^3.5.10",
31
31
  "react-aria": "^3.28.0",
32
- "@vitessce/constants-internal": "3.4.10",
33
- "@vitessce/plugins": "3.4.10",
34
- "@vitessce/schemas": "3.4.10",
35
- "@vitessce/utils": "3.4.10",
36
- "@vitessce/sets-utils": "3.4.10",
37
- "@vitessce/config": "3.4.10"
32
+ "@vitessce/constants-internal": "3.4.11",
33
+ "@vitessce/plugins": "3.4.11",
34
+ "@vitessce/schemas": "3.4.11",
35
+ "@vitessce/utils": "3.4.11",
36
+ "@vitessce/sets-utils": "3.4.11",
37
+ "@vitessce/config": "3.4.11"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@testing-library/jest-dom": "^5.16.4",
@@ -42,7 +42,7 @@
42
42
  "react": "^18.0.0",
43
43
  "vite": "^4.3.0",
44
44
  "vitest": "^0.32.2",
45
- "@vitessce/types": "3.4.10"
45
+ "@vitessce/types": "3.4.11"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
package/src/TitleInfo.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  ArrowDropUp as ArrowDropUpIcon,
8
8
  Settings as SettingsIcon,
9
9
  Close as CloseIcon,
10
+ Help as HelpIcon,
10
11
  } from '@material-ui/icons';
11
12
 
12
13
  import { TOOLTIP_ANCESTOR } from './classNames.js';
@@ -42,6 +43,18 @@ const useStyles = makeStyles(theme => ({
42
43
  downloadLink: {
43
44
  color: theme.palette.primaryForeground,
44
45
  },
46
+ helpTextSpan: {
47
+ maxWidth: '400px',
48
+ padding: '5px 10px',
49
+ display: 'inline-block',
50
+ textAlign: 'justify',
51
+ fontSize: '14px',
52
+ backgroundColor: theme.palette.gridLayoutBackground,
53
+ color: theme.palette.tooltipText,
54
+ borderRadius: '8px',
55
+ boxShadow: '0 0 10px rgba(0, 0, 0, 0.2)',
56
+ border: '10px solid grey',
57
+ },
45
58
  }));
46
59
 
47
60
  function SettingsIconWithArrow({ open }) {
@@ -107,6 +120,26 @@ function DownloadOptions(props) {
107
120
  ) : null);
108
121
  }
109
122
 
123
+ function HelpButton(props) {
124
+ const { helpText } = props;
125
+ const [open, setOpen] = useState(false);
126
+ const classes = useStyles();
127
+ return (
128
+ <PopperMenu
129
+ open={open}
130
+ setOpen={setOpen}
131
+ buttonIcon={<HelpIcon />}
132
+ buttonClassName={classes.iconButton}
133
+ placement="bottom-end"
134
+ aria-label="Open help info"
135
+ withPaper={false}
136
+ >
137
+ <span className={classes.helpTextSpan}>{helpText}</span>
138
+ </PopperMenu>
139
+ );
140
+ }
141
+
142
+
110
143
  function ClosePaneButton(props) {
111
144
  const { removeGridComponent } = props;
112
145
  const classes = useStyles();
@@ -127,6 +160,7 @@ export function TitleInfo(props) {
127
160
  const {
128
161
  title, info, children, isScroll, isSpatial, removeGridComponent, urls,
129
162
  isReady, options, closeButtonVisible = true, downloadButtonVisible = true,
163
+ helpText,
130
164
  } = props;
131
165
 
132
166
  const classes = useTitleStyles();
@@ -150,6 +184,11 @@ export function TitleInfo(props) {
150
184
  urls={urls}
151
185
  />
152
186
  ) : null}
187
+ {helpText ? (
188
+ <HelpButton
189
+ helpText={helpText}
190
+ />
191
+ ) : null}
153
192
  {closeButtonVisible && removeGridComponent ? (
154
193
  <ClosePaneButton
155
194
  removeGridComponent={removeGridComponent}
@@ -170,7 +209,7 @@ export function TitleInfo(props) {
170
209
  aria-busy={!isReady}
171
210
  role="main"
172
211
  >
173
- { !isReady && <LoadingIndicator /> }
212
+ { !isReady ? <LoadingIndicator /> : null }
174
213
  {children}
175
214
  </div>
176
215
  </>