@vitessce/vit-s 3.5.12 → 3.6.1

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 (68) hide show
  1. package/dist/index.js +29645 -26007
  2. package/dist-tsc/CallbackPublisher.d.ts.map +1 -1
  3. package/dist-tsc/CallbackPublisher.js +4 -4
  4. package/dist-tsc/DebugWindow.d.ts +1 -1
  5. package/dist-tsc/DebugWindow.d.ts.map +1 -1
  6. package/dist-tsc/DebugWindow.js +1 -1
  7. package/dist-tsc/LoadingIndicator.js +3 -3
  8. package/dist-tsc/TitleInfo.d.ts.map +1 -1
  9. package/dist-tsc/TitleInfo.js +8 -9
  10. package/dist-tsc/VitS.d.ts +3 -0
  11. package/dist-tsc/VitS.d.ts.map +1 -1
  12. package/dist-tsc/VitS.js +11 -6
  13. package/dist-tsc/VitessceGrid.d.ts.map +1 -1
  14. package/dist-tsc/VitessceGrid.js +5 -5
  15. package/dist-tsc/VitessceGrid.test.js +2 -6
  16. package/dist-tsc/Warning.d.ts +1 -1
  17. package/dist-tsc/Warning.d.ts.map +1 -1
  18. package/dist-tsc/Warning.js +1 -1
  19. package/dist-tsc/mui-utils.d.ts.map +1 -1
  20. package/dist-tsc/mui-utils.js +2 -0
  21. package/dist-tsc/shared-mui/components.d.ts.map +1 -1
  22. package/dist-tsc/shared-mui/components.js +5 -5
  23. package/dist-tsc/shared-mui/container.d.ts +10 -1
  24. package/dist-tsc/shared-mui/container.d.ts.map +1 -1
  25. package/dist-tsc/shared-mui/container.js +199 -190
  26. package/dist-tsc/shared-mui/styles.d.ts +3 -3
  27. package/dist-tsc/shared-mui/styles.js +9 -6
  28. package/dist-tsc/shared-plot-options/CellColorEncodingOption.js +2 -2
  29. package/dist-tsc/shared-plot-options/OptionSelect.d.ts.map +1 -1
  30. package/dist-tsc/shared-plot-options/OptionSelect.js +3 -3
  31. package/dist-tsc/shared-plot-options/OptionsContainer.js +2 -2
  32. package/dist-tsc/shared-plot-options/styles.d.ts +9 -1
  33. package/dist-tsc/shared-plot-options/styles.d.ts.map +1 -1
  34. package/dist-tsc/shared-plot-options/styles.js +4 -3
  35. package/dist-tsc/shared-warning-styles.d.ts +9 -1
  36. package/dist-tsc/shared-warning-styles.d.ts.map +1 -1
  37. package/dist-tsc/shared-warning-styles.js +2 -2
  38. package/dist-tsc/state/hooks.d.ts +8 -18
  39. package/dist-tsc/state/hooks.d.ts.map +1 -1
  40. package/dist-tsc/state/hooks.js +92 -36
  41. package/dist-tsc/title-styles.d.ts +9 -1
  42. package/dist-tsc/title-styles.d.ts.map +1 -1
  43. package/dist-tsc/title-styles.js +2 -2
  44. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts +0 -6
  45. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.js +1 -5
  46. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.test.js +2 -6
  47. package/package.json +19 -19
  48. package/src/CallbackPublisher.js +4 -3
  49. package/src/DebugWindow.js +1 -1
  50. package/src/LoadingIndicator.js +3 -3
  51. package/src/TitleInfo.js +9 -10
  52. package/src/VitS.js +19 -11
  53. package/src/VitessceGrid.js +7 -3
  54. package/src/VitessceGrid.test.jsx +3 -8
  55. package/src/Warning.js +1 -1
  56. package/src/mui-utils.js +2 -0
  57. package/src/shared-mui/components.js +11 -8
  58. package/src/shared-mui/container.js +206 -190
  59. package/src/shared-mui/styles.js +9 -7
  60. package/src/shared-plot-options/CellColorEncodingOption.js +2 -2
  61. package/src/shared-plot-options/OptionSelect.js +3 -4
  62. package/src/shared-plot-options/OptionsContainer.js +2 -2
  63. package/src/shared-plot-options/styles.js +4 -3
  64. package/src/shared-warning-styles.js +2 -2
  65. package/src/state/hooks.js +119 -43
  66. package/src/title-styles.js +2 -2
  67. package/src/vitessce-grid-layout/VitessceGridLayout.js +1 -6
  68. package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +2 -7
@@ -1 +1 @@
1
- {"version":3,"file":"CallbackPublisher.d.ts","sourceRoot":"","sources":["../src/CallbackPublisher.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,iDAPG;IAAwB,cAAc;IAEd,cAAc;IAEf,sBAAsB,EAArC,OAAO;CAEjB,QAkDA"}
1
+ {"version":3,"file":"CallbackPublisher.d.ts","sourceRoot":"","sources":["../src/CallbackPublisher.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,iDAPG;IAAwB,cAAc;IAEd,cAAc;IAEf,sBAAsB,EAArC,OAAO;CAEjB,QAmDA"}
@@ -34,6 +34,9 @@ export default function CallbackPublisher(props) {
34
34
  // to subscribe to view config changes.
35
35
  // Reference: https://github.com/react-spring/zustand#transient-updates-for-often-occuring-state-changes
36
36
  useEffect(() => viewConfigStoreApi.subscribe(
37
+ // The function to specify which part of the store
38
+ // we want to subscribe to.
39
+ state => state.viewConfig,
37
40
  // The function to run on each publish.
38
41
  (viewConfig) => {
39
42
  if (validateOnConfigChange && viewConfig) {
@@ -42,10 +45,7 @@ export default function CallbackPublisher(props) {
42
45
  if (onConfigChange && viewConfig) {
43
46
  onConfigChange(viewConfig);
44
47
  }
45
- },
46
- // The function to specify which part of the store
47
- // we want to subscribe to.
48
- state => state.viewConfig), [onConfigChange, validateOnConfigChange, viewConfigStoreApi, pluginSpecificConfigSchema]);
48
+ }), [onConfigChange, validateOnConfigChange, viewConfigStoreApi, pluginSpecificConfigSchema]);
49
49
  // Emit updates to the warning message.
50
50
  useEffect(() => {
51
51
  if (onWarn && warning) {
@@ -1,4 +1,4 @@
1
1
  export function DebugWindow({ debugErrors }: {
2
2
  debugErrors: any;
3
- }): import("react").JSX.Element;
3
+ }): import(".pnpm/@types+react@19.1.6/node_modules/@types/react").JSX.Element;
4
4
  //# sourceMappingURL=DebugWindow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DebugWindow.d.ts","sourceRoot":"","sources":["../src/DebugWindow.js"],"names":[],"mappings":"AAIA;;gCA8BC"}
1
+ {"version":3,"file":"DebugWindow.d.ts","sourceRoot":"","sources":["../src/DebugWindow.js"],"names":[],"mappings":"AAIA;;8EA8BC"}
@@ -3,7 +3,7 @@ import clsx from 'clsx';
3
3
  import { useStyles } from './shared-warning-styles.js';
4
4
  import { VITESSCE_CONTAINER } from './classNames.js';
5
5
  export function DebugWindow({ debugErrors }) {
6
- const classes = useStyles();
6
+ const { classes } = useStyles();
7
7
  return (_jsx("div", { className: VITESSCE_CONTAINER, children: _jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: _jsx("div", { className: classes.row, children: _jsx("div", { className: classes.warningCard, children: debugErrors.map((error, index) => (_jsxs("div", { children: [index === 0 && (_jsxs("div", { children: [_jsxs("h1", { children: ["Error Type: ", error.name] }), Object.keys(error).map(key => key !== 'name'
8
8
  && key !== 'message' && (_jsxs("p", { children: [key.charAt(0).toUpperCase() + key.slice(1), ": ", error[key]] }, key)))] })), _jsxs("p", { children: ["Error: ", error.message] })] }, error.message || index))) }) }) }) }));
9
9
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { makeStyles, CircularProgress } from '@material-ui/core';
4
- const useStyles = makeStyles(() => ({
3
+ import { makeStyles, CircularProgress } from '@vitessce/styles';
4
+ const useStyles = makeStyles()(() => ({
5
5
  loadingIndicatorBackdrop: {
6
6
  position: 'absolute',
7
7
  top: '0',
@@ -29,6 +29,6 @@ const useStyles = makeStyles(() => ({
29
29
  },
30
30
  }));
31
31
  export default function LoadingIndicator() {
32
- const classes = useStyles();
32
+ const { classes } = useStyles();
33
33
  return (_jsx("div", { className: classes.loadingIndicatorBackdrop, children: _jsxs("div", { className: classes.loadingIndicatorContainer, role: "status", "aria-live": "polite", children: [_jsx(CircularProgress, {}), _jsx("span", { className: classes.visuallyHidden, children: "Loading..." })] }) }));
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TitleInfo.d.ts","sourceRoot":"","sources":["../src/TitleInfo.js"],"names":[],"mappings":"AA8JA,mDA6DC"}
1
+ {"version":3,"file":"TitleInfo.d.ts","sourceRoot":"","sources":["../src/TitleInfo.js"],"names":[],"mappings":"AA6JA,mDA6DC"}
@@ -1,13 +1,12 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useMemo } from 'react';
3
3
  import clsx from 'clsx';
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, Help as HelpIcon, } from '@material-ui/icons';
4
+ import { makeStyles, MenuItem, IconButton, Link, CloudDownload as CloudDownloadIcon, ArrowDropDown as ArrowDropDownIcon, ArrowDropUp as ArrowDropUpIcon, Settings as SettingsIcon, Close as CloseIcon, Help as HelpIcon, } from '@vitessce/styles';
6
5
  import { TOOLTIP_ANCESTOR } from './classNames.js';
7
6
  import LoadingIndicator from './LoadingIndicator.js';
8
7
  import { PopperMenu } from './shared-mui/components.js';
9
8
  import { useTitleStyles } from './title-styles.js';
10
- const useStyles = makeStyles(theme => ({
9
+ const useStyles = makeStyles()(theme => ({
11
10
  iconButton: {
12
11
  border: 'none',
13
12
  marginLeft: 0,
@@ -19,7 +18,7 @@ const useStyles = makeStyles(theme => ({
19
18
  '&:hover': {
20
19
  backgroundColor: theme.palette.primaryBackgroundLight,
21
20
  },
22
- '&:first-child': {
21
+ '&:first-of-type': {
23
22
  marginLeft: '0.25em',
24
23
  },
25
24
  '&:last-child': {
@@ -54,7 +53,7 @@ function SettingsIconWithArrow({ open }) {
54
53
  function PlotOptions(props) {
55
54
  const { options } = props;
56
55
  const [open, setOpen] = useState(false);
57
- const classes = useStyles();
56
+ const { classes } = useStyles();
58
57
  const buttonIcon = useMemo(() => (_jsx(SettingsIconWithArrow, { open: open })), [open]);
59
58
  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);
60
59
  }
@@ -64,24 +63,24 @@ function CloudDownloadIconWithArrow({ open }) {
64
63
  function DownloadOptions(props) {
65
64
  const { urls } = props;
66
65
  const [open, setOpen] = useState(false);
67
- const classes = useStyles();
66
+ const { classes } = useStyles();
68
67
  const buttonIcon = useMemo(() => (_jsx(CloudDownloadIconWithArrow, { open: open })), [open]);
69
68
  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);
70
69
  }
71
70
  function HelpButton(props) {
72
71
  const { helpText } = props;
73
72
  const [open, setOpen] = useState(false);
74
- const classes = useStyles();
73
+ const { classes } = useStyles();
75
74
  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
75
  }
77
76
  function ClosePaneButton(props) {
78
77
  const { removeGridComponent } = props;
79
- const classes = useStyles();
78
+ const { classes } = useStyles();
80
79
  return (_jsx(IconButton, { onClick: removeGridComponent, size: "small", className: classes.iconButton, title: "close", "aria-label": "Close panel button", children: _jsx(CloseIcon, {}) }));
81
80
  }
82
81
  export function TitleInfo(props) {
83
82
  const { title, info, children, isScroll, isSpatial, removeGridComponent, urls, isReady, options, closeButtonVisible = true, downloadButtonVisible = true, helpText, withPadding = true, } = props;
84
- const classes = useTitleStyles();
83
+ const { classes } = useTitleStyles();
85
84
  return (
86
85
  // d-flex without wrapping div is not always full height; I don't understand the root cause.
87
86
  _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, {
@@ -23,6 +23,8 @@
23
23
  * @param {null|string} props.uid A unique identifier for this Vitessce instance,
24
24
  * for the purpose of avoiding CSS autogenerated class name conflicts. Must be valid as part
25
25
  * of a CSS class name string.
26
+ * @param {undefined|Node} props.styleContainer The DOM node for insertion of styles,
27
+ * passed to Emotion's createCache.container. Useful when Vitessce is in the Shadow DOM.
26
28
  * @param {boolean} props.remountOnUidChange Whether to remount the coordination provider
27
29
  * upon changes to config.uid. By default, true.
28
30
  * @param {array} props.viewTypes Plugin view types.
@@ -46,6 +48,7 @@ export function VitS(props: {
46
48
  validateConfig: boolean;
47
49
  validateOnConfigChange: boolean;
48
50
  uid: null | string;
51
+ styleContainer: undefined | Node;
49
52
  remountOnUidChange: boolean;
50
53
  viewTypes: array;
51
54
  fileTypes: array;
@@ -1 +1 @@
1
- {"version":3,"file":"VitS.d.ts","sourceRoot":"","sources":["../src/VitS.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,4BAlCG;IAAsB,MAAM,EAApB,MAAM;IAGkB,SAAS,EAAjC,SAAS,GAAC,MAAM;IACF,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IAEU,MAAM;IACN,cAAc;IAEd,cAAc;IAEf,cAAc,EAA7B,OAAO;IAIQ,sBAAsB,EAArC,OAAO;IAGY,GAAG,EAAtB,IAAI,GAAC,MAAM;IAGI,kBAAkB,EAAjC,OAAO;IAEM,SAAS,EAAtB,KAAK;IACQ,SAAS,EAAtB,KAAK;IACQ,cAAc,EAA3B,KAAK;IACQ,iBAAiB,EAA9B,KAAK;IACc,OAAO,EAA1B,IAAI,GAAC,MAAM;IACI,QAAQ,EAAvB,OAAO;IACQ,SAAS,EAAxB,OAAO;IACY,QAAQ,EAA3B,IAAI,GAAC,MAAM;CAErB,eA2OA"}
1
+ {"version":3,"file":"VitS.d.ts","sourceRoot":"","sources":["../src/VitS.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,4BApCG;IAAsB,MAAM,EAApB,MAAM;IAGkB,SAAS,EAAjC,SAAS,GAAC,MAAM;IACF,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IAEU,MAAM;IACN,cAAc;IAEd,cAAc;IAEf,cAAc,EAA7B,OAAO;IAIQ,sBAAsB,EAArC,OAAO;IAGY,GAAG,EAAtB,IAAI,GAAC,MAAM;IAGW,cAAc,EAApC,SAAS,GAAC,IAAI;IAEC,kBAAkB,EAAjC,OAAO;IAEM,SAAS,EAAtB,KAAK;IACQ,SAAS,EAAtB,KAAK;IACQ,cAAc,EAA3B,KAAK;IACQ,iBAAiB,EAA9B,KAAK;IACc,OAAO,EAA1B,IAAI,GAAC,MAAM;IACI,QAAQ,EAAvB,OAAO;IACQ,SAAS,EAAxB,OAAO;IACY,QAAQ,EAA3B,IAAI,GAAC,MAAM;CAErB,eAiPA"}
package/dist-tsc/VitS.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useEffect, useMemo, useCallback, useLayoutEffect } from 'react';
3
- import { ThemeProvider, StylesProvider, } from '@material-ui/core';
3
+ import { ThemeProvider, CacheProvider, createCache, } from '@vitessce/styles';
4
4
  import { QueryClient, QueryClientProvider, } from '@tanstack/react-query';
5
5
  import { isEqual } from 'lodash-es';
6
6
  import { buildConfigSchema, latestConfigSchema } from '@vitessce/schemas';
@@ -13,7 +13,6 @@ import { DebugWindow } from './DebugWindow.js';
13
13
  import CallbackPublisher from './CallbackPublisher.js';
14
14
  import { initialize, logConfig, } from './view-config-utils.js';
15
15
  import { createLoaders } from './vitessce-grid-utils.js';
16
- import { createGenerateClassName } from './mui-utils.js';
17
16
  import { AsyncFunctionsContext } from './contexts.js';
18
17
  /**
19
18
  * The Vitessce component.
@@ -40,6 +39,8 @@ import { AsyncFunctionsContext } from './contexts.js';
40
39
  * @param {null|string} props.uid A unique identifier for this Vitessce instance,
41
40
  * for the purpose of avoiding CSS autogenerated class name conflicts. Must be valid as part
42
41
  * of a CSS class name string.
42
+ * @param {undefined|Node} props.styleContainer The DOM node for insertion of styles,
43
+ * passed to Emotion's createCache.container. Useful when Vitessce is in the Shadow DOM.
43
44
  * @param {boolean} props.remountOnUidChange Whether to remount the coordination provider
44
45
  * upon changes to config.uid. By default, true.
45
46
  * @param {array} props.viewTypes Plugin view types.
@@ -53,14 +54,13 @@ import { AsyncFunctionsContext } from './contexts.js';
53
54
  * provided by the parent.
54
55
  */
55
56
  export function VitS(props) {
56
- const { config, stores, rowHeight, height, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid = null, remountOnUidChange = true, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, asyncFunctions: asyncFunctionsProp, warning, pageMode = false, children, debugMode = DEFAULT_DEBUG_MODE, logLevel = DEFAULT_LOG_LEVEL, } = props;
57
+ const { config, stores, rowHeight, height, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid = null, styleContainer, remountOnUidChange = true, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, asyncFunctions: asyncFunctionsProp, warning, pageMode = false, children, debugMode = DEFAULT_DEBUG_MODE, logLevel = DEFAULT_LOG_LEVEL, } = props;
57
58
  // eslint-disable-next-line no-unused-vars
58
59
  const [debugErrors, setDebugErrors] = useState([]);
59
60
  const viewTypes = useMemo(() => (viewTypesProp || []), [viewTypesProp]);
60
61
  const fileTypes = useMemo(() => (fileTypesProp || []), [fileTypesProp]);
61
62
  const jointFileTypes = useMemo(() => (jointFileTypesProp || []), [jointFileTypesProp]);
62
63
  const coordinationTypes = useMemo(() => (coordinationTypesProp || []), [coordinationTypesProp]);
63
- const generateClassName = useMemo(() => createGenerateClassName(uid), [uid]);
64
64
  // Set error handling-related globals.
65
65
  useLayoutEffect(() => {
66
66
  setLogLevel(logLevel);
@@ -151,6 +151,11 @@ export function VitS(props) {
151
151
  asyncFunctionsProp?.map(p => ([p.functionType, p.asyncFunction]))
152
152
  || []),
153
153
  }), [asyncFunctionsProp, queryClient]);
154
+ const muiCache = useMemo(() => createCache({
155
+ key: uid || 'vit',
156
+ prepend: true,
157
+ container: styleContainer,
158
+ }), [uid, styleContainer]);
154
159
  // Emit the upgraded/initialized view config
155
160
  // to onConfigChange if necessary.
156
161
  useEffect(() => {
@@ -173,7 +178,7 @@ export function VitS(props) {
173
178
  // Will probably need to move a lot to a child of VitS
174
179
  // so that when the child throws errors the parent can catch.
175
180
  if (debugMode && debugErrors.length > 0) {
176
- return (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(DebugWindow, { debugErrors: debugErrors }) }) }));
181
+ return (_jsx(CacheProvider, { value: muiCache, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(DebugWindow, { debugErrors: debugErrors }) }) }));
177
182
  }
178
- return success ? (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, ...(remountOnUidChange ? ({ key: configKey }) : {}), children: _jsx(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: _jsxs(AsyncFunctionsContext.Provider, { value: asyncFunctions, children: [_jsx(VitessceGrid, { pageMode: pageMode, success: success, configKey: configKey, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, config: configOrWarning, rowHeight: rowHeight, height: height, theme: theme, isBounded: isBounded, stores: stores, children: children }), _jsx(CallbackPublisher, { onWarn: onWarn, onConfigChange: onConfigChange, onLoaderChange: onLoaderChange, validateOnConfigChange: validateOnConfigChange, pluginSpecificConfigSchema: pluginSpecificConfigSchema })] }) }) }) }) }) })) : (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(Warning, { ...configOrWarning }) }) }));
183
+ return success ? (_jsx(CacheProvider, { value: muiCache, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, children: _jsx(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: _jsxs(AsyncFunctionsContext.Provider, { value: asyncFunctions, children: [_jsx(VitessceGrid, { pageMode: pageMode, success: success, configKey: configKey, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, config: configOrWarning, rowHeight: rowHeight, height: height, theme: theme, isBounded: isBounded, stores: stores, children: children }), _jsx(CallbackPublisher, { onWarn: onWarn, onConfigChange: onConfigChange, onLoaderChange: onLoaderChange, validateOnConfigChange: validateOnConfigChange, pluginSpecificConfigSchema: pluginSpecificConfigSchema })] }) }) }, (remountOnUidChange ? configKey : undefined)) }) }) })) : (_jsx(CacheProvider, { value: muiCache, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(Warning, { ...configOrWarning }) }) }));
179
184
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VitessceGrid.d.ts","sourceRoot":"","sources":["../src/VitessceGrid.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;GAYG;AACH,4CAVG;IAAsB,SAAS,EAAvB,MAAM;IACQ,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,MAAM,EAApB,MAAM;IACU,MAAM;IACE,SAAS,EAAjC,cAAc,EAAE;IACQ,SAAS,EAAjC,cAAc,EAAE;IACgB,iBAAiB,EAAjD,sBAAsB,EAAE;IACT,QAAQ,EAAvB,OAAO;CACjB,eAqGA"}
1
+ {"version":3,"file":"VitessceGrid.d.ts","sourceRoot":"","sources":["../src/VitessceGrid.js"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;GAYG;AACH,4CAVG;IAAsB,SAAS,EAAvB,MAAM;IACQ,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,MAAM,EAApB,MAAM;IACU,MAAM;IACE,SAAS,EAAjC,cAAc,EAAE;IACQ,SAAS,EAAjC,cAAc,EAAE;IACgB,iBAAiB,EAAjD,sBAAsB,EAAE;IACT,QAAQ,EAAvB,OAAO;CACjB,eAsGA"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useEffect, useCallback, useMemo, } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { VITESSCE_CONTAINER } from './classNames.js';
@@ -6,7 +6,7 @@ import { VitessceGridLayout } from './vitessce-grid-layout/index.js';
6
6
  import { useRowHeight, createLoaders } from './vitessce-grid-utils.js';
7
7
  import { useViewConfigStoreApi, useSetViewConfig, useSetLoaders, useEmitGridResize, useRemoveComponent, useChangeLayout, useLayout, } from './state/hooks.js';
8
8
  import { useClosestVitessceContainerSize, } from './hooks.js';
9
- import { useVitessceContainerStyles } from './shared-mui/container.js';
9
+ import { useVitessceContainerStyles, GridLayoutGlobalStyles, } from './shared-mui/container.js';
10
10
  import { useTitleStyles } from './title-styles.js';
11
11
  import { getAltText } from './generate-alt-text.js';
12
12
  const padding = 10;
@@ -29,8 +29,8 @@ export default function VitessceGrid(props) {
29
29
  const [rowHeight, containerRef] = useRowHeight(config, initialRowHeight, height, margin, padding);
30
30
  const onResize = useEmitGridResize();
31
31
  const [componentWidth] = useClosestVitessceContainerSize(containerRef);
32
- const classes = useVitessceContainerStyles();
33
- const titleClasses = useTitleStyles();
32
+ const { classes } = useVitessceContainerStyles();
33
+ const { classes: titleClasses } = useTitleStyles();
34
34
  const altText = useMemo(() => getAltText(config), [configKey]);
35
35
  // When the row height has changed, publish a GRID_RESIZE event.
36
36
  useEffect(() => {
@@ -62,5 +62,5 @@ export default function VitessceGrid(props) {
62
62
  setLoaders(newLoaders);
63
63
  // eslint-disable-next-line react-hooks/exhaustive-deps
64
64
  }, [success, configKey]);
65
- return (_jsx("div", { ref: containerRef, className: clsx(VITESSCE_CONTAINER, classes.vitessceContainer), role: "group", "aria-label": altText, children: layout ? (_jsx(VitessceGridLayout, { pageMode: pageMode, role: "group", layout: layout, height: height, rowHeight: rowHeight, theme: theme, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, stores: stores, draggableHandle: titleClasses.title, margin: margin, padding: padding, onRemoveComponent: removeComponent, onLayoutChange: changeLayoutPostMount, isBounded: isBounded, onResize: onResize, onResizeStop: onResize, children: children })) : null }));
65
+ return (_jsxs("div", { ref: containerRef, className: clsx(VITESSCE_CONTAINER, classes.vitessceContainer), role: "group", "aria-label": altText, children: [_jsx(GridLayoutGlobalStyles, { classes: classes }), layout ? (_jsx(VitessceGridLayout, { pageMode: pageMode, role: "group", layout: layout, height: height, rowHeight: rowHeight, theme: theme, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, stores: stores, draggableHandle: titleClasses.title, margin: margin, padding: padding, onRemoveComponent: removeComponent, onLayoutChange: changeLayoutPostMount, isBounded: isBounded, onResize: onResize, onResizeStop: onResize, children: children })) : null] }));
66
66
  }
@@ -1,14 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { describe, it, expect, afterEach } from 'vitest';
3
- import '@testing-library/jest-dom';
4
- import { cleanup, render, screen } from '@testing-library/react';
5
2
  import React from 'react';
3
+ import { describe, it, expect } from 'vitest';
4
+ import { render, screen } from '@testing-library/react';
6
5
  import { PluginViewType } from '@vitessce/plugins';
7
6
  import VitessceGrid from './VitessceGrid.js';
8
7
  import { ViewConfigProvider, createViewConfigStore, AuxiliaryProvider, createAuxiliaryStore, } from './state/hooks.js';
9
- afterEach(() => {
10
- cleanup();
11
- });
12
8
  describe('VitessceGrid.js', () => {
13
9
  describe('<VitessceGrid />', () => {
14
10
  it('renders', async () => {
@@ -1,2 +1,2 @@
1
- export function Warning(props: any): import("react").JSX.Element;
1
+ export function Warning(props: any): import(".pnpm/@types+react@19.1.6/node_modules/@types/react").JSX.Element;
2
2
  //# sourceMappingURL=Warning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Warning.d.ts","sourceRoot":"","sources":["../src/Warning.js"],"names":[],"mappings":"AAIA,iEAoBC"}
1
+ {"version":3,"file":"Warning.d.ts","sourceRoot":"","sources":["../src/Warning.js"],"names":[],"mappings":"AAIA,+GAoBC"}
@@ -4,6 +4,6 @@ import { useStyles } from './shared-warning-styles.js';
4
4
  import { VITESSCE_CONTAINER } from './classNames.js';
5
5
  export function Warning(props) {
6
6
  const { title, preformatted, unformatted, } = props;
7
- const classes = useStyles();
7
+ const { classes } = useStyles();
8
8
  return (_jsx("div", { className: VITESSCE_CONTAINER, children: _jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: _jsx("div", { className: classes.row, children: _jsxs("div", { className: classes.warningCard, children: [_jsx("h1", { children: title }), preformatted ? (_jsx("pre", { children: preformatted })) : null, _jsx("p", { children: unformatted })] }) }) }) }));
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mui-utils.d.ts","sourceRoot":"","sources":["../src/mui-utils.js"],"names":[],"mappings":"AAyBA,mGA0BC"}
1
+ {"version":3,"file":"mui-utils.d.ts","sourceRoot":"","sources":["../src/mui-utils.js"],"names":[],"mappings":"AA2BA,mGA0BC"}
@@ -21,6 +21,8 @@ const stateClasses = [
21
21
  'selected',
22
22
  ];
23
23
  const defaultPrefix = 'vit-';
24
+ // TODO: We are no longer using this; is it still needed?
25
+ // Reference: https://mui.com/material-ui/experimental-api/classname-generator/
24
26
  export function createGenerateClassName(customPrefix) {
25
27
  return (rule, styleSheet) => {
26
28
  const { name: styleSheetName, link: styleSheetLink, classNamePrefix, } = styleSheet.options;
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/shared-mui/components.js"],"names":[],"mappings":"AAyBA,oDA+DC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/shared-mui/components.js"],"names":[],"mappings":"AAyBA,oDAkEC"}
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useRef } from 'react';
3
- import { makeStyles, Paper, Popper, IconButton, MenuList, ClickAwayListener, Fade, } from '@material-ui/core';
3
+ import { makeStyles, Paper, Popper, IconButton, MenuList, ClickAwayListener, Fade, } from '@vitessce/styles';
4
4
  import clsx from 'clsx';
5
5
  import { useVitessceContainer } from '../hooks.js';
6
- const useStyles = makeStyles(() => ({
6
+ const useStyles = makeStyles()(() => ({
7
7
  paper: {
8
8
  maxHeight: 200,
9
9
  overflow: 'auto',
@@ -15,8 +15,8 @@ const useStyles = makeStyles(() => ({
15
15
  },
16
16
  }));
17
17
  export function PopperMenu(props) {
18
- const { buttonIcon, open, setOpen, children, buttonClassName, placement = 'bottom-end', withPaper = true, containerClassName, 'aria-label': ariaLabel, } = props;
19
- const classes = useStyles();
18
+ const { buttonIcon, open, setOpen, children, buttonClassName, placement = 'bottom-end', withPaper = true, containerClassName, paperClassName, 'aria-label': ariaLabel, } = props;
19
+ const { classes } = useStyles();
20
20
  const anchorRef = useRef();
21
21
  const handleClick = () => {
22
22
  setOpen(prev => !prev);
@@ -26,5 +26,5 @@ export function PopperMenu(props) {
26
26
  };
27
27
  const id = open ? 'v-popover-menu' : undefined;
28
28
  const getTooltipContainer = useVitessceContainer(anchorRef);
29
- return (_jsxs("div", { ref: anchorRef, className: clsx(classes.container, containerClassName), children: [_jsx(IconButton, { "aria-describedby": id, onClick: handleClick, onTouchEnd: handleClick, size: "small", className: buttonClassName, "aria-label": ariaLabel, children: buttonIcon }), _jsx(Popper, { id: id, open: open, anchorEl: anchorRef && anchorRef.current, container: getTooltipContainer, onClose: handleClose, placement: placement, transition: true, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: handleClose, children: _jsx(Fade, { ...TransitionProps, timeout: 100, children: withPaper ? (_jsx(Paper, { elevation: 4, className: classes.paper, children: _jsx(MenuList, { children: children }) })) : children }) })) })] }));
29
+ return (_jsxs("div", { ref: anchorRef, className: clsx(classes.container, containerClassName), children: [_jsx(IconButton, { "aria-describedby": id, onClick: handleClick, onTouchEnd: handleClick, size: "small", className: buttonClassName, "aria-label": ariaLabel, children: buttonIcon }), _jsx(Popper, { id: id, open: open, anchorEl: anchorRef && anchorRef.current, container: getTooltipContainer, onClose: handleClose, placement: placement, transition: true, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: handleClose, children: _jsx(Fade, { ...TransitionProps, timeout: 100, children: _jsx("div", { children: withPaper ? (_jsx(Paper, { elevation: 16, className: clsx(classes.paper, paperClassName), children: _jsx(MenuList, { children: children }) })) : children }) }) })) })] }));
30
30
  }
@@ -1,2 +1,11 @@
1
- export const useVitessceContainerStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"vitessceContainer">;
1
+ export function GridLayoutGlobalStyles(props: any): JSX.Element;
2
+ export const useVitessceContainerStyles: (params: void, muiStyleOverridesParams?: {
3
+ props: Record<string, unknown>;
4
+ ownerState?: Record<string, unknown> | undefined;
5
+ } | undefined) => {
6
+ classes: Record<"vitessceContainer", string>;
7
+ theme: import("@mui/material").Theme;
8
+ css: import("tss-react").Css;
9
+ cx: import("tss-react").Cx;
10
+ };
2
11
  //# sourceMappingURL=container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/shared-mui/container.js"],"names":[],"mappings":"AAEA,0IAiNI"}
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/shared-mui/container.js"],"names":[],"mappings":"AA0NA,gEASC;AA/ND;;cAekB,CAAC;;;kBAQA,eACL;gBAAyB,WAAU;eAG/C,WAFO;EAJL"}