@aics/vole-app 3.2.3 → 3.3.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 (36) hide show
  1. package/LICENSE +21 -25
  2. package/es/aics-image-viewer/components/App/index.js +18 -12
  3. package/es/aics-image-viewer/components/AxisClipSliders/index.js +2 -1
  4. package/es/aics-image-viewer/components/ChannelsWidget.js +2 -2
  5. package/es/aics-image-viewer/components/ControlPanel/index.js +15 -11
  6. package/es/aics-image-viewer/components/ControlPanel/styles.css +5 -5
  7. package/es/aics-image-viewer/components/ErrorAlert/index.js +102 -65
  8. package/es/aics-image-viewer/components/ErrorAlert/styles.css +40 -7
  9. package/es/aics-image-viewer/components/StyleProvider/index.js +65 -27
  10. package/es/aics-image-viewer/components/TfEditor/index.js +8 -1
  11. package/es/aics-image-viewer/components/Toolbar/index.js +65 -7
  12. package/es/aics-image-viewer/components/Toolbar/styles.css +22 -110
  13. package/es/aics-image-viewer/components/shared/ControlPanelRow/styles.css +1 -1
  14. package/es/aics-image-viewer/components/useVolume.js +45 -40
  15. package/es/aics-image-viewer/shared/constants.js +3 -1
  16. package/es/aics-image-viewer/shared/utils/playControls.js +12 -1
  17. package/es/aics-image-viewer/shared/utils/sceneStore.js +26 -7
  18. package/es/aics-image-viewer/shared/utils/test/urlParsing.test.js +10 -2
  19. package/es/aics-image-viewer/shared/utils/urlParsing.js +17 -3
  20. package/es/aics-image-viewer/shared/utils/viewerChannelSettings.js +3 -4
  21. package/es/aics-image-viewer/state/store.js +24 -6
  22. package/es/aics-image-viewer/state/subscribers.js +22 -1
  23. package/es/aics-image-viewer/state/test/reset.test.js +3 -1
  24. package/package.json +5 -5
  25. package/type-declarations/aics-image-viewer/components/App/types.d.ts +2 -2
  26. package/type-declarations/aics-image-viewer/components/ControlPanel/index.d.ts +4 -5
  27. package/type-declarations/aics-image-viewer/components/ErrorAlert/index.d.ts +8 -5
  28. package/type-declarations/aics-image-viewer/components/Toolbar/index.d.ts +4 -0
  29. package/type-declarations/aics-image-viewer/components/useVolume.d.ts +3 -3
  30. package/type-declarations/aics-image-viewer/shared/constants.d.ts +1 -1
  31. package/type-declarations/aics-image-viewer/shared/utils/playControls.d.ts +1 -0
  32. package/type-declarations/aics-image-viewer/shared/utils/sceneStore.d.ts +3 -2
  33. package/type-declarations/aics-image-viewer/shared/utils/urlParsing.d.ts +7 -1
  34. package/type-declarations/aics-image-viewer/state/store.d.ts +2 -0
  35. package/type-declarations/aics-image-viewer/state/types.d.ts +2 -0
  36. package/LICENSE.txt +0 -26
@@ -1,8 +1,8 @@
1
- var _templateObject, _templateObject2;
1
+ var _templateObject, _templateObject2, _templateObject3;
2
2
  function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
3
  import { theme as AntTheme, ConfigProvider } from "antd";
4
4
  import React from "react";
5
- import styled, { css } from "styled-components";
5
+ import styled, { createGlobalStyle, css } from "styled-components";
6
6
  var palette = {
7
7
  black: "#000000",
8
8
  white: "#ffffff",
@@ -18,10 +18,14 @@ var palette = {
18
18
  darkPurple: "#7e46d4",
19
19
  veryDarkPurple: "#5f369f",
20
20
  veryLtPurple: "#e7e4f2",
21
- brightRed: "#ff4d4d",
21
+ brightRed: "#dc4446",
22
+ brightYellow: "#e39b0d",
22
23
  brightGreen: "#61d900",
23
24
  veryBrightGreen: "#61ff00",
24
- brightBlue: "#0099ff"
25
+ brightBlue: "#0099ff",
26
+ veryBrightBlue: "#0dc4d9",
27
+ darkBlue: "#29484c",
28
+ darkYellow: "#4c3c29"
25
29
  };
26
30
  var theme = {
27
31
  colors: {
@@ -31,7 +35,7 @@ var theme = {
31
35
  primaryDk: palette.darkPurple,
32
36
  success: palette.brightGreen,
33
37
  error: palette.brightRed,
34
- warning: palette.brightRed,
38
+ warning: palette.brightYellow,
35
39
  info: palette.brightBlue
36
40
  },
37
41
  text: {
@@ -75,10 +79,10 @@ var theme = {
75
79
  outline: palette.ltGrey,
76
80
  hoverOutline: palette.ltPurple,
77
81
  hoverText: palette.ltPurple,
78
- activeOutline: palette.medPurple,
79
- activatedText: palette.white,
80
- activatedBg: palette.medDarkGrey,
81
- activatedOutline: palette.purpleGrey,
82
+ activeText: palette.white,
83
+ activeBg: palette.medDarkGrey,
84
+ activeOutline: palette.purpleGrey,
85
+ disabledOutline: palette.medGrey,
82
86
  disabledText: palette.medGrey
83
87
  }
84
88
  },
@@ -121,8 +125,18 @@ var theme = {
121
125
  selectedBg: palette.medGrey,
122
126
  textPlaceholder: palette.ltPurple
123
127
  },
128
+ alert: {
129
+ warning: {
130
+ text: palette.brightYellow,
131
+ bg: palette.darkYellow
132
+ },
133
+ info: {
134
+ text: palette.veryBrightBlue,
135
+ bg: palette.darkBlue
136
+ }
137
+ },
124
138
  tooltip: {
125
- bg: palette.black
139
+ bg: palette.medDarkGrey
126
140
  },
127
141
  modal: {
128
142
  maskBg: "#000000cc",
@@ -136,10 +150,11 @@ var theme = {
136
150
  }
137
151
  };
138
152
  /** Makes theme styling available to child components via CSS variables. */
139
- var CssProvider = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n ", "\n\n h1, h2, h3, h4, p {\n font-family: var(--font-family);\n }\n\n h1 {\n color: var(--color-text-header);\n font-size: 28px;\n font-weight: 400;\n }\n\n h2 {\n color: var(--color-text-section);\n font-size: 19px;\n font-weight: 400;\n }\n\n h3 {\n color: var(--color-text-header);\n font-size: 16px;\n font-weight: 600;\n }\n\n h4 {\n color: var(--color-text-header);\n font-size: 14px;\n font-weight: 400;\n }\n\n p {\n color: var(--color-text-body);\n font-size: 14px;\n font-weight: 400;\n }\n\n a {\n color: var(--color-text-link);\n }\n\n & *::selection {\n background-color: var(--color-text-selection-bg);\n color: var(--color-text-selection-text);\n }\n\n /** TODO: Go through these styles and see if we can use Ant ConfigProvider for them instead. */\n .ant-btn-link,\n .ant-btn-text,\n .ant-btn-primary,\n .ant-btn-icon-only {\n box-shadow: none;\n\n &:hover:not(:disabled),\n &:focus-visible:not(:disabled) {\n background-color: var(--color-button-primary-hover-bg);\n border-color: var(--color-button-primary-hover-bg);\n color: var(--color-button-primary-text);\n }\n\n &:active:not(:disabled) {\n background-color: var(--color-button-primary-hover-bg);\n border: 1px solid var(--color-button-primary-active-outline);\n color: var(--color-button-primary-text);\n }\n }\n\n /* Let us use buttons with type=\"text\" as purely semantic containers - don't bring any styling! */\n .ant-btn-text {\n width: unset;\n height: unset;\n padding: unset;\n\n &:hover:not(:disabled),\n &:focus-visible:not(:disabled) {\n background-color: unset;\n border-color: transparent;\n }\n }\n\n .ant-btn-icon-only:disabled {\n color: var(--color-button-icon-disabled-text);\n }\n\n .ant-btn-link:not(:disabled) {\n // Change from default blue link text\n color: var(--color-button-link-text);\n }\n\n /**\n * Tertiary style buttons. Grey outline by default, turns to light\n * purple outline on hover.\n */\n .ant-btn-default:not(.ant-btn-icon-only) {\n background-color: var(--color-button-tertiary-bg);\n color: var(--color-button-tertiary-text);\n border-color: var(--color-button-tertiary-outline);\n\n &:hover:not(:disabled),\n &:focus-visible:not(:disabled) {\n background-color: transparent;\n border-color: var(--color-button-tertiary-hover-bg);\n color: var(--color-button-tertiary-hover-text);\n }\n\n &:active:not(:disabled) {\n background-color: transparent;\n border-color: var(--color-button-tertiary-active-outline);\n color: var(--color-button-tertiary-active-text);\n }\n }\n\n // Overrides for checkbox styling\n & .ant-checkbox-input {\n &:hover,\n &:focus-visible {\n border: 1px solid white;\n }\n }\n\n & .ant-checkbox.ant-checkbox-checked {\n background-color: var(--color-checkbox-bg);\n }\n\n .ant-checkbox-inner {\n background-color: transparent !important;\n }\n\n // Add outlines to modals and dropdowns\n & .ant-select-dropdown,\n & .ant-dropdown-menu,\n & .ant-modal-content {\n border: 1px solid var(--color-modal-border);\n }\n\n // Force active/hovered text to be white instead of grey for better contrast\n & .ant-dropdown-menu-item-active {\n color: var(--color-menu-hover-text);\n }\n\n // Remove padding in dropdown menus and make items reactangular + flush with the edge\n & .ant-dropdown-menu,\n & .ant-select-dropdown {\n padding: 0;\n overflow: hidden;\n\n & .ant-dropdown-menu-item,\n & .ant-select-item {\n border-radius: 0;\n }\n }\n"])), function (_ref) {
153
+ var CssProvider = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n ", "\n\n h1, h2, h3, h4, p {\n font-family: var(--font-family);\n }\n\n h1 {\n color: var(--color-text-header);\n font-size: 28px;\n font-weight: 400;\n }\n\n h2 {\n color: var(--color-text-section);\n font-size: 19px;\n font-weight: 400;\n }\n\n h3 {\n color: var(--color-text-header);\n font-size: 16px;\n font-weight: 600;\n }\n\n h4 {\n color: var(--color-text-header);\n font-size: 14px;\n font-weight: 400;\n }\n\n p {\n color: var(--color-text-body);\n font-size: 14px;\n font-weight: 400;\n }\n\n a {\n color: var(--color-text-link);\n }\n\n *::selection {\n background-color: var(--color-text-selection-bg);\n color: var(--color-text-selection-text);\n }\n\n /** TODO: Go through these styles and see if we can use Ant ConfigProvider for them instead. */\n .ant-btn-link,\n .ant-btn-text,\n .ant-btn-primary,\n .ant-btn-icon-only {\n box-shadow: none;\n\n &:hover:not(:disabled),\n &:focus-visible:not(:disabled) {\n background-color: var(--color-button-primary-hover-bg);\n border-color: var(--color-button-primary-hover-bg);\n color: var(--color-button-primary-text);\n outline: none;\n }\n\n &:active:not(:disabled) {\n background-color: var(--color-button-primary-hover-bg);\n border: 1px solid var(--color-button-primary-active-outline);\n color: var(--color-button-primary-text);\n }\n }\n\n /* Let us use buttons with type=\"text\" as purely semantic containers - don't bring any styling! */\n .ant-btn-text {\n width: unset;\n height: unset;\n padding: unset;\n\n &:hover:not(:disabled),\n &:focus-visible:not(:disabled) {\n background-color: unset;\n border-color: transparent;\n }\n }\n\n .ant-btn-icon-only:disabled {\n color: var(--color-button-icon-disabled-text);\n }\n\n .ant-btn-link:not(:disabled) {\n // Change from default blue link text\n color: var(--color-button-link-text);\n }\n\n /**\n * Tertiary style buttons. Grey outline by default, turns to light\n * purple outline on hover.\n */\n .ant-btn-default:not(.ant-btn-icon-only) {\n background-color: var(--color-button-tertiary-bg);\n color: var(--color-button-tertiary-text);\n border-color: var(--color-button-tertiary-outline);\n\n &:hover:not(:disabled),\n &:focus-visible:not(:disabled) {\n background-color: transparent;\n border-color: var(--color-button-tertiary-hover-outline);\n color: var(--color-button-tertiary-hover-text);\n }\n }\n\n // Overrides for checkbox styling\n .ant-checkbox-input {\n &:hover,\n &:focus-visible {\n border: 1px solid white;\n }\n }\n\n .ant-checkbox.ant-checkbox-checked {\n background-color: var(--color-checkbox-bg);\n }\n\n .ant-checkbox-inner {\n background-color: transparent !important;\n }\n\n // Add outlines to modals and dropdowns\n .ant-select-dropdown,\n .ant-dropdown-menu,\n .ant-modal-content {\n border: 1px solid var(--color-modal-border);\n }\n\n // Force active/hovered text to be white instead of grey for better contrast\n .ant-dropdown-menu-item-active {\n color: var(--color-menu-hover-text);\n }\n\n // Remove padding in dropdown menus and make items reactangular + flush with the edge\n .ant-dropdown-menu,\n .ant-select-dropdown {\n padding: 0;\n overflow: hidden;\n\n .ant-dropdown-menu-item,\n .ant-select-item:not(.ant-select-item-option-disabled) {\n border-radius: 0;\n color: var(--color-button-icon-active-text);\n }\n }\n\n .ant-select {\n &.ant-select-disabled .ant-select-selector {\n border-color: var(--color-button-icon-disabled-outline);\n }\n\n .ant-select-arrow {\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n }\n\n /* Control response to hover + active menu */\n &:hover:not(.ant-select-disabled),\n &:focus-visible:not(.ant-select-disabled),\n &.ant-select.ant-select-open {\n .ant-select-selector,\n .ant-select-arrow,\n .ant-select-selection-item {\n color: var(--color-button-tertiary-hover-text);\n outline-color: var(--color-button-tertiary-hover-outline);\n }\n }\n }\n\n // Toolbar has special colors for radio buttons and will use these variables to apply them\n --color-button-radio-hover-outline: var(--color-button-tertiary-hover-outline);\n --color-button-radio-hover-text: var(--color-button-tertiary-hover-text);\n\n .ant-radio-button-wrapper {\n &::before {\n content: none;\n }\n\n &.ant-radio-button-wrapper-checked {\n color: var(--color-button-icon-active-text);\n\n &:not(:first-child) {\n box-shadow: -1px 0px 0px 0px var(--color-button-tertiary-active-outline);\n }\n }\n\n &:hover,\n &:has(:focus-visible) {\n color: var(--color-button-radio-hover-text);\n border-color: var(--color-button-radio-hover-outline);\n outline: none;\n z-index: 2;\n\n &:not(:first-child) {\n box-shadow: -1px 0px 0px 0px var(--color-button-radio-hover-outline);\n }\n }\n }\n\n"])), function (_ref) {
140
154
  var $theme = _ref.$theme;
141
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* Component and color variables. */\n // TODO: Fix inconsistent use of border vs. outline\n // TODO: Remove variables that aren't used in other CSS files. These should be set directly\n // from the $theme object to reduce unnecessary variables.\n --color-text-link: ", ";\n --color-text-header: ", ";\n --color-text-section: ", ";\n --color-text-body: ", ";\n --color-text-error: ", ";\n\n --color-text-selection-bg: ", ";\n --color-text-selection-text: ", ";\n\n --color-header-title: ", ";\n --color-header-hover-title: ", ";\n --color-header-bg: ", ";\n --color-header-border: ", ";\n\n --color-button-primary-bg: ", ";\n --color-button-primary-text: ", ";\n --color-button-primary-hover-bg: ", ";\n --color-button-primary-active-bg: ", ";\n --color-button-primary-active-outline: ", ";\n --color-button-primary-disabled-bg: ", ";\n\n --color-button-link-text: ", ";\n\n --color-button-secondary-bg: ", ";\n --color-button-secondary-text: ", ";\n --color-button-secondary-outline: ", ";\n\n --color-button-tertiary-bg: transparent;\n --color-button-tertiary-text: ", ";\n --color-button-tertiary-outline: ", ";\n --color-button-tertiary-hover-outline: ", ";\n --color-button-tertiary-hover-text: ", ";\n --color-button-tertiary-active-outline: ", ";\n --color-button-tertiary-active-text: ", ";\n\n --color-button-icon-disabled-text: ", ";\n --color-button-icon-disabled-text: ", ";\n --color-button-icon-activated-text: ", ";\n --color-button-icon-activated-bg: ", ";\n --color-button-icon-activated-outline: ", ";\n\n --color-toolbar-button-bg: ", ";\n\n --color-controlpanel-bg: ", ";\n --color-controlpanel-border: ", ";\n --color-controlpanel-section-text: ", ";\n --color-controlpanel-text: ", ";\n --color-controlpanel-section-bg: ", ";\n --color-controlpanel-drawer-bg: ", ";\n --color-controlpanel-ramp-slider: ", ";\n --color-controlpanel-isovalue-slider: ", ";\n\n --color-landingpage-bg: ", ";\n --color-landingpage-bg-alt: ", ";\n --color-landingpage-text: ", ";\n --color-landingpage-banner-highlight-bg: ", ";\n\n --color-statusflag-border: ", ";\n --color-statusflag-text: ", ";\n\n --color-layout-dividers: ", ";\n\n --color-modal-border: ", ";\n\n --color-menu-hover-text: ", ";\n --color-menu-selected-text: ", ";\n\n --color-checkbox-bg: ", ";\n\n --font-family: ", ";\n "])), $theme.colors.text.link, $theme.colors.text.header, $theme.colors.text.section, $theme.colors.text.body, $theme.colors.text.error, $theme.colors.text.selectionBg, $theme.colors.text.selectionText, $theme.colors.header.title, $theme.colors.header.hoverTitle, $theme.colors.header.bg, $theme.colors.header.border, $theme.colors.button.primary.bg, $theme.colors.button.primary.text, $theme.colors.button.primary.hoverBg, $theme.colors.button.primary.hoverBg, $theme.colors.button.primary.activeOutline, $theme.colors.button.primary.disabledBg, $theme.colors.button.link.text, $theme.colors.button.secondary.bg, $theme.colors.button.secondary.text, $theme.colors.button.secondary.outline, $theme.colors.button.tertiary.text, $theme.colors.button.tertiary.outline, $theme.colors.button.tertiary.hoverOutline, $theme.colors.button.tertiary.hoverText, $theme.colors.button.tertiary.activeOutline, $theme.colors.button.tertiary.hoverText, $theme.colors.button.tertiary.disabledText, $theme.colors.button.tertiary.disabledText, $theme.colors.button.tertiary.activatedText, $theme.colors.button.tertiary.activatedBg, $theme.colors.button.tertiary.activatedOutline, $theme.colors.toolbar.buttonBg, $theme.colors.controlPanel.bg, $theme.colors.controlPanel.border, $theme.colors.controlPanel.sectionText, $theme.colors.controlPanel.text, $theme.colors.controlPanel.sectionBg, $theme.colors.controlPanel.drawerBg, $theme.colors.controlPanel.rampSlider, $theme.colors.controlPanel.isovalueSlider, $theme.colors.landingPage.bg, $theme.colors.landingPage.bgAlt, $theme.colors.landingPage.text, $theme.colors.landingPage.bannerBg, $theme.colors.statusFlag.border, $theme.colors.statusFlag.text, $theme.colors.layout.dividers, $theme.colors.modal.border, $theme.colors.menu.hoverText, $theme.colors.menu.selectedText, $theme.colors.checkbox.bg, $theme.fonts.family);
155
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* Component and color variables. */\n // TODO: Fix inconsistent use of border vs. outline\n // TODO: Remove variables that aren't used in other CSS files. These should be set directly\n // from the $theme object to reduce unnecessary variables.\n --color-text-link: ", ";\n --color-text-header: ", ";\n --color-text-section: ", ";\n --color-text-body: ", ";\n --color-text-error: ", ";\n\n --color-text-selection-bg: ", ";\n --color-text-selection-text: ", ";\n\n --color-header-title: ", ";\n --color-header-hover-title: ", ";\n --color-header-bg: ", ";\n --color-header-border: ", ";\n\n --color-button-primary-bg: ", ";\n --color-button-primary-text: ", ";\n --color-button-primary-hover-bg: ", ";\n --color-button-primary-active-bg: ", ";\n --color-button-primary-active-outline: ", ";\n --color-button-primary-disabled-bg: ", ";\n\n --color-button-link-text: ", ";\n\n --color-button-secondary-bg: ", ";\n --color-button-secondary-text: ", ";\n --color-button-secondary-outline: ", ";\n\n --color-button-tertiary-bg: transparent;\n --color-button-tertiary-text: ", ";\n --color-button-tertiary-outline: ", ";\n --color-button-tertiary-hover-outline: ", ";\n --color-button-tertiary-hover-text: ", ";\n --color-button-tertiary-active-outline: ", ";\n --color-button-tertiary-active-text: ", ";\n\n --color-button-icon-disabled-outline: ", ";\n --color-button-icon-disabled-text: ", ";\n --color-button-icon-active-text: ", ";\n --color-button-icon-active-bg: ", ";\n --color-button-icon-active-outline: ", ";\n\n --color-toolbar-button-bg: ", ";\n\n --color-controlpanel-bg: ", ";\n --color-controlpanel-border: ", ";\n --color-controlpanel-section-text: ", ";\n --color-controlpanel-text: ", ";\n --color-controlpanel-section-bg: ", ";\n --color-controlpanel-drawer-bg: ", ";\n --color-controlpanel-ramp-slider: ", ";\n --color-controlpanel-isovalue-slider: ", ";\n\n --color-landingpage-bg: ", ";\n --color-landingpage-bg-alt: ", ";\n --color-landingpage-text: ", ";\n --color-landingpage-banner-highlight-bg: ", ";\n\n --color-statusflag-border: ", ";\n --color-statusflag-text: ", ";\n\n --color-alert-warning-text: ", ";\n --color-alert-warning-bg: ", ";\n --color-alert-info-text: ", ";\n --color-alert-info-bg: ", ";\n\n --color-layout-dividers: ", ";\n\n --color-modal-border: ", ";\n\n --color-menu-hover-text: ", ";\n --color-menu-selected-text: ", ";\n\n --color-checkbox-bg: ", ";\n\n --font-family: ", ";\n "])), $theme.colors.text.link, $theme.colors.text.header, $theme.colors.text.section, $theme.colors.text.body, $theme.colors.text.error, $theme.colors.text.selectionBg, $theme.colors.text.selectionText, $theme.colors.header.title, $theme.colors.header.hoverTitle, $theme.colors.header.bg, $theme.colors.header.border, $theme.colors.button.primary.bg, $theme.colors.button.primary.text, $theme.colors.button.primary.hoverBg, $theme.colors.button.primary.hoverBg, $theme.colors.button.primary.activeOutline, $theme.colors.button.primary.disabledBg, $theme.colors.button.link.text, $theme.colors.button.secondary.bg, $theme.colors.button.secondary.text, $theme.colors.button.secondary.outline, $theme.colors.button.tertiary.text, $theme.colors.button.tertiary.outline, $theme.colors.button.tertiary.hoverOutline, $theme.colors.button.tertiary.hoverText, $theme.colors.button.tertiary.activeOutline, $theme.colors.button.tertiary.hoverText, $theme.colors.button.tertiary.disabledOutline, $theme.colors.button.tertiary.disabledText, $theme.colors.button.tertiary.activeText, $theme.colors.button.tertiary.activeBg, $theme.colors.button.tertiary.activeOutline, $theme.colors.toolbar.buttonBg, $theme.colors.controlPanel.bg, $theme.colors.controlPanel.border, $theme.colors.controlPanel.sectionText, $theme.colors.controlPanel.text, $theme.colors.controlPanel.sectionBg, $theme.colors.controlPanel.drawerBg, $theme.colors.controlPanel.rampSlider, $theme.colors.controlPanel.isovalueSlider, $theme.colors.landingPage.bg, $theme.colors.landingPage.bgAlt, $theme.colors.landingPage.text, $theme.colors.landingPage.bannerBg, $theme.colors.statusFlag.border, $theme.colors.statusFlag.text, $theme.colors.alert.warning.text, $theme.colors.alert.warning.bg, $theme.colors.alert.info.text, $theme.colors.alert.info.bg, $theme.colors.layout.dividers, $theme.colors.modal.border, $theme.colors.menu.hoverText, $theme.colors.menu.selectedText, $theme.colors.checkbox.bg, $theme.fonts.family);
142
156
  });
157
+ var GlobalTooltipStyle = createGlobalStyle(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-tooltip-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n /* !important needed: antd hardcodes text-align: start on tooltip inner */\n text-align: center !important;\n line-height: 1.4;\n font-weight: 400;\n /* !important needed: antd's CSS-in-JS injects tooltip styles into portals at higher specificity than global stylesheets */\n box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.30), 0 3px 6px -4px rgba(0, 0, 0, 0.40), 0 9px 28px 8px rgba(0, 0, 0, 0.20) !important;\n }\n\n"])));
143
158
 
144
159
  /**
145
160
  * Provides CSS variables and global styling for the image viewer.
@@ -157,6 +172,14 @@ export default function StyleProvider(props) {
157
172
  colorBgContainer: "transparent",
158
173
  colorSplit: theme.colors.layout.split,
159
174
  colorPrimaryTextHover: theme.colors.text.selectionText,
175
+ colorWarning: theme.colors.alert.warning.text,
176
+ colorWarningBg: theme.colors.alert.warning.bg,
177
+ colorWarningBorder: theme.colors.alert.warning.text,
178
+ colorWarningText: theme.colors.alert.warning.text,
179
+ colorInfo: theme.colors.alert.info.text,
180
+ colorInfoBg: theme.colors.alert.info.bg,
181
+ colorInfoBorder: theme.colors.alert.info.text,
182
+ colorInfoText: theme.colors.alert.info.text,
160
183
  fontWeightStrong: 400,
161
184
  colorBgElevated: palette.darkGrey,
162
185
  controlItemBgHover: theme.colors.menu.hoverBg,
@@ -170,11 +193,14 @@ export default function StyleProvider(props) {
170
193
  primaryColor: theme.colors.button.primary.text,
171
194
  defaultHoverBg: theme.colors.button.secondary.bg,
172
195
  defaultActiveBg: theme.colors.button.secondary.bg,
173
- defaultActiveBorderColor: theme.colors.button.tertiary.activeOutline
196
+ defaultActiveBorderColor: theme.colors.button.primary.activeOutline
174
197
  },
175
- Card: {
176
- borderRadiusLG: 0,
177
- headerHeight: 48
198
+ Checkbox: {
199
+ borderRadiusSM: 2,
200
+ colorBgContainer: theme.colors.checkbox.bg,
201
+ colorPrimary: theme.colors.checkbox.bg,
202
+ colorPrimaryHover: theme.colors.checkbox.hoverBg,
203
+ colorText: theme.colors.checkbox.text
178
204
  },
179
205
  Collapse: {
180
206
  borderRadiusLG: 0,
@@ -187,26 +213,38 @@ export default function StyleProvider(props) {
187
213
  Layout: {
188
214
  siderBg: theme.colors.controlPanel.bg
189
215
  },
190
- Checkbox: {
191
- borderRadiusSM: 2,
192
- colorBgContainer: theme.colors.checkbox.bg,
193
- colorPrimary: theme.colors.checkbox.bg,
194
- colorPrimaryHover: theme.colors.checkbox.hoverBg,
195
- colorText: theme.colors.checkbox.text
196
- },
197
- Tooltip: {
198
- colorBgSpotlight: theme.colors.tooltip.bg
199
- },
200
216
  Modal: {
201
217
  colorBgMask: theme.colors.modal.maskBg,
202
218
  contentBg: theme.colors.modal.bg,
203
219
  headerBg: theme.colors.modal.bg,
204
220
  footerBg: theme.colors.modal.bg,
205
221
  titleFontSize: 19
222
+ },
223
+ Radio: {
224
+ buttonCheckedBg: theme.colors.button.tertiary.activeBg,
225
+ buttonColor: theme.colors.button.tertiary.text,
226
+ // can't style borders and text of activated buttons independently within ant's system, so we set border
227
+ // colors here and text/bg colors in custom css
228
+ colorPrimary: theme.colors.button.tertiary.activeOutline
229
+ },
230
+ Select: {
231
+ colorText: theme.colors.button.tertiary.text,
232
+ colorBorder: theme.colors.button.tertiary.outline,
233
+ // arrow color
234
+ colorTextQuaternary: theme.colors.button.tertiary.text,
235
+ colorTextDisabled: theme.colors.button.tertiary.disabledText,
236
+ colorTextPlaceholder: theme.colors.button.tertiary.hoverText,
237
+ colorBgContainerDisabled: "transparent"
238
+ },
239
+ // Additional tooltip overrides (font-weight, box-shadow, layout) are in GlobalTooltipStyle below,
240
+ // which is required because antd renders tooltips in portals outside the scoped CssProvider.
241
+ Tooltip: {
242
+ colorBgSpotlight: theme.colors.tooltip.bg,
243
+ fontSize: 12
206
244
  }
207
245
  }
208
246
  }
209
- }, /*#__PURE__*/React.createElement(CssProvider, {
247
+ }, /*#__PURE__*/React.createElement(GlobalTooltipStyle, null), /*#__PURE__*/React.createElement(CssProvider, {
210
248
  $theme: theme
211
249
  }, props.children));
212
250
  }
@@ -317,6 +317,7 @@ var TfEditor = function TfEditor(props) {
317
317
  colorPickerPosition = _useState8[0],
318
318
  setColorPickerPosition = _useState8[1];
319
319
  var lastColorRef = useRef(TFEDITOR_DEFAULT_COLOR);
320
+ var dropdownContainerRef = useRef(null);
320
321
  var svgRef = useRef(null); // need access to SVG element to measure mouse position
321
322
 
322
323
  var histogram = props.channelData.histogram;
@@ -765,7 +766,9 @@ var TfEditor = function TfEditor(props) {
765
766
  }
766
767
  })))), props.volumeEnabled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h4", null, "Volume settings"), /*#__PURE__*/React.createElement("div", {
767
768
  className: "tf-editor-control-row"
768
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Dropdown, {
769
+ }, /*#__PURE__*/React.createElement("div", {
770
+ ref: dropdownContainerRef
771
+ }, /*#__PURE__*/React.createElement(Dropdown, {
769
772
  trigger: ["click"],
770
773
  menu: {
771
774
  items: [{
@@ -785,6 +788,10 @@ var TfEditor = function TfEditor(props) {
785
788
  var key = _ref5.key;
786
789
  return applyTFGenerator(key);
787
790
  }
791
+ },
792
+ getPopupContainer: function getPopupContainer() {
793
+ var _dropdownContainerRef;
794
+ return (_dropdownContainerRef = dropdownContainerRef.current) !== null && _dropdownContainerRef !== void 0 ? _dropdownContainerRef : document.body;
788
795
  }
789
796
  }, /*#__PURE__*/React.createElement(Button, {
790
797
  size: "small"
@@ -27,11 +27,13 @@ var visuallyHiddenStyle = {
27
27
  borderWidth: "0"
28
28
  };
29
29
  var Toolbar = function Toolbar(props) {
30
+ var _props$multiscaleInde;
30
31
  var containerRef = React.useRef(null);
31
32
  var barRef = React.useRef(null);
32
33
  var leftRef = React.useRef(null);
33
34
  var rightRef = React.useRef(null);
34
35
  var centerRef = React.useRef(null);
36
+ var resizeObserver = React.useRef();
35
37
  var _React$useState = React.useState(false),
36
38
  _React$useState2 = _slicedToArray(_React$useState, 2),
37
39
  scrollMode = _React$useState2[0],
@@ -50,6 +52,8 @@ var Toolbar = function Toolbar(props) {
50
52
  var autorotate = useViewerState(select("autorotate"));
51
53
  var showAxes = useViewerState(select("showAxes"));
52
54
  var showBoundingBox = useViewerState(select("showBoundingBox"));
55
+ var useExactScaleLevel = useViewerState(select("useExactScaleLevel"));
56
+ var scaleLevelIndex = useViewerState(select("scaleLevelIndex"));
53
57
  var changeViewerSetting = useViewerState(select("changeViewerSetting"));
54
58
 
55
59
  // Scroll buttons are only visible when toolbar can be scrolled in that direction.
@@ -60,7 +64,7 @@ var Toolbar = function Toolbar(props) {
60
64
  return;
61
65
  }
62
66
  setScrollBtnLeft(barEl.scrollLeft > 0);
63
- setScrollBtnRight(barEl.scrollLeft < barEl.scrollWidth - barEl.clientWidth);
67
+ setScrollBtnRight(Math.ceil(barEl.scrollLeft) < barEl.scrollWidth - barEl.clientWidth);
64
68
  }, []);
65
69
 
66
70
  // This is effectively a `useCallback` - it memoizes a function - but since we're feeding the whole function into
@@ -88,15 +92,30 @@ var Toolbar = function Toolbar(props) {
88
92
  return leftRect.right > centerRect.left || centerRect.right > rightRect.left;
89
93
  }
90
94
  });
91
- checkScrollBtnVisible();
95
+ window.setTimeout(checkScrollBtnVisible, 0);
92
96
  }, RESIZE_DEBOUNCE_DELAY);
93
97
  }, [checkScrollBtnVisible]);
94
98
  React.useEffect(function () {
95
99
  // Make sure `checkSize` is run once on mount
96
100
  checkSize();
101
+ if (resizeObserver.current !== undefined) {
102
+ resizeObserver.current.disconnect();
103
+ }
104
+ resizeObserver.current = new ResizeObserver(checkSize);
105
+ if (leftRef.current !== null) {
106
+ resizeObserver.current.observe(leftRef.current);
107
+ }
108
+ if (centerRef.current !== null) {
109
+ resizeObserver.current.observe(centerRef.current);
110
+ }
111
+ if (rightRef.current !== null) {
112
+ resizeObserver.current.observe(rightRef.current);
113
+ }
97
114
  window.addEventListener("resize", checkSize);
98
115
  return function () {
99
- return window.removeEventListener("resize", checkSize);
116
+ var _resizeObserver$curre;
117
+ (_resizeObserver$curre = resizeObserver.current) === null || _resizeObserver$curre === void 0 || _resizeObserver$curre.disconnect();
118
+ window.removeEventListener("resize", checkSize);
100
119
  };
101
120
  }, [checkSize]);
102
121
  var scrollX = function scrollX(amount) {
@@ -121,7 +140,8 @@ var Toolbar = function Toolbar(props) {
121
140
  var classForToggleBtn = function classForToggleBtn(active) {
122
141
  return "ant-btn-icon-only btn-borderless" + (active ? " btn-active" : "");
123
142
  };
124
- var visibleControls = props.visibleControls;
143
+ var visibleControls = props.visibleControls,
144
+ multiscaleDims = props.multiscaleDims;
125
145
  var twoDMode = viewMode !== ViewMode.threeD;
126
146
  var renderGroup1 = visibleControls.viewModeRadioButtons || visibleControls.resetCameraButton || visibleControls.autoRotateButton;
127
147
  var renderGroup4 = visibleControls.showAxesButton || visibleControls.showBoundingBoxButton;
@@ -209,8 +229,9 @@ var Toolbar = function Toolbar(props) {
209
229
  }, "Full field"))), /*#__PURE__*/React.createElement("div", {
210
230
  className: "viewer-toolbar-group"
211
231
  }, /*#__PURE__*/React.createElement(Select, {
212
- className: "select-render-setting",
213
- popupClassName: "viewer-toolbar-dropdown",
232
+ style: {
233
+ minWidth: 120
234
+ },
214
235
  value: renderMode,
215
236
  onChange: function onChange(value) {
216
237
  return changeViewerSetting("renderMode", value);
@@ -244,7 +265,44 @@ var Toolbar = function Toolbar(props) {
244
265
  onClick: toggleBoundingBox
245
266
  }, /*#__PURE__*/React.createElement(ViewerIcon, {
246
267
  type: "boundingBox"
247
- }))))), /*#__PURE__*/React.createElement("div", {
268
+ })))), multiscaleDims !== undefined && multiscaleDims.length > 1 && visibleControls.scaleLevelControls && /*#__PURE__*/React.createElement("div", {
269
+ className: "viewer-toolbar-group"
270
+ }, /*#__PURE__*/React.createElement("span", {
271
+ style: {
272
+ color: "var(--color-button-tertiary-text)"
273
+ }
274
+ }, "Resolution"), /*#__PURE__*/React.createElement(Radio.Group, {
275
+ value: useExactScaleLevel,
276
+ onChange: function onChange(e) {
277
+ return changeViewerSetting("useExactScaleLevel", e.target.value);
278
+ }
279
+ }, /*#__PURE__*/React.createElement(Radio.Button, {
280
+ value: false
281
+ }, "Auto"), /*#__PURE__*/React.createElement(Radio.Button, {
282
+ value: true
283
+ }, "Manual")), /*#__PURE__*/React.createElement(Select, {
284
+ className: "select-resolution",
285
+ getPopupContainer: getPopupContainer,
286
+ style: {
287
+ minWidth: 150
288
+ },
289
+ value: useExactScaleLevel ? scaleLevelIndex : (_props$multiscaleInde = props.multiscaleIndex) !== null && _props$multiscaleInde !== void 0 ? _props$multiscaleInde : scaleLevelIndex,
290
+ onChange: function onChange(value) {
291
+ return changeViewerSetting("scaleLevelIndex", value);
292
+ },
293
+ disabled: !useExactScaleLevel
294
+ }, multiscaleDims.map(function (dims, idx) {
295
+ var _dims$shape = _slicedToArray(dims.shape, 5),
296
+ _t = _dims$shape[0],
297
+ _c = _dims$shape[1],
298
+ z = _dims$shape[2],
299
+ y = _dims$shape[3],
300
+ x = _dims$shape[4];
301
+ return /*#__PURE__*/React.createElement(Select.Option, {
302
+ key: idx,
303
+ value: idx
304
+ }, x, " x ", y, " x ", z);
305
+ })))), /*#__PURE__*/React.createElement("div", {
248
306
  className: "viewer-toolbar-right viewer-toolbar-group",
249
307
  ref: rightRef
250
308
  }, /*#__PURE__*/React.createElement(Tooltip, {
@@ -108,134 +108,46 @@
108
108
  margin-right:6px;
109
109
  }
110
110
 
111
+ .viewer-toolbar .btn-borderless,
112
+ .viewer-toolbar .ant-select.ant-select-outlined .ant-select-selector,
113
+ .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked){
114
+ background-color:var(--color-toolbar-button-bg);
115
+ }
116
+
111
117
  .viewer-toolbar .ant-btn-icon-only{
112
118
  padding-bottom:4px;
113
119
  padding-left:1px;
114
120
  }
115
121
 
116
122
  .viewer-toolbar .btn-borderless{
117
- background-color:var(--color-toolbar-button-bg);
118
123
  border-color:transparent;
119
124
  color:var(--color-text-body);
120
125
  }
121
126
 
122
127
  .viewer-toolbar .btn-active{
123
- color:var(--color-button-icon-activated-text);
124
- background-color:var(--color-button-icon-activated-bg);
125
- border:1px solid var(--color-button-icon-activated-outline);
126
- }
127
-
128
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled){
129
- background-color:black;
130
- box-shadow:-1px 0px 0px 0px transparent;
131
- transition-property:color, background-color, border-color, box-shadow;
132
- }
133
-
134
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled).ant-radio-button-wrapper-checked,
135
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):hover{
136
- outline:none;
137
- color:white;
138
- border-color:#aeacae;
139
- }
140
-
141
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled).ant-radio-button-wrapper-checked:not(:first-child), .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):hover:not(:first-child){
142
- box-shadow:-1px 0px 0px 0px #aeacae;
143
- }
144
-
145
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled).ant-radio-button-wrapper-checked{
146
- background-color:#4b4b4b;
147
- }
148
-
149
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):hover{
150
- background-color:#aa88ed;
151
- color:white;
152
- }
153
-
154
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):focus-within{
155
- outline:none;
156
- }
157
-
158
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled)::before{
159
- content:none;
160
- }
161
-
162
- .viewer-toolbar.viewer-toolbar .ant-select.select-render-setting{
163
- min-width:120px;
164
- }
165
-
166
- .viewer-toolbar.viewer-toolbar .ant-select.select-render-setting .ant-select-selection-item,
167
- .viewer-toolbar.viewer-toolbar .ant-select.select-render-setting .ant-select-arrow{
168
- color:var(--color-button-tertiary-text);
169
- transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
170
- }
171
-
172
- .viewer-toolbar.viewer-toolbar .ant-select.select-render-setting .ant-select-selector{
173
- border-color:#aeacae;
174
- box-shadow:none;
175
- background-color:var(--color-toolbar-button-bg);
176
- }
177
-
178
- .viewer-toolbar .ant-select.select-render-setting:hover:not(:disabled) .ant-select-selector,
179
- .viewer-toolbar .ant-select.select-render-setting:hover:not(:disabled) .ant-select-arrow,
180
- .viewer-toolbar .ant-select.select-render-setting:hover:not(:disabled) .ant-select-selection-item,
181
- .viewer-toolbar .ant-select.select-render-setting:focus-visible:not(:disabled) .ant-select-selector,
182
- .viewer-toolbar .ant-select.select-render-setting:focus-visible:not(:disabled) .ant-select-arrow,
183
- .viewer-toolbar .ant-select.select-render-setting:focus-visible:not(:disabled) .ant-select-selection-item,
184
- .viewer-toolbar.viewer-toolbar.viewer-toolbar .ant-select-open .ant-select-selector,
185
- .viewer-toolbar.viewer-toolbar.viewer-toolbar .ant-select-open .ant-select-arrow,
186
- .viewer-toolbar.viewer-toolbar.viewer-toolbar .ant-select-open .ant-select-selection-item{
187
- color:var(--color-button-tertiary-hover-text);
188
- outline-color:var(--color-button-tertiary-hover-outline);
189
- }
190
-
191
- .viewer-toolbar-dropdown .ant-select-dropdown-menu-item-active{
192
- transition-property:background-color, color;
193
- }
194
-
195
- .viewer-toolbar-dropdown .ant-select-dropdown-menu-item-disabled,
196
- .viewer-toolbar-dropdown .ant-select-dropdown-menu-item-disabled:hover{
197
- color:#6e6e6e;
198
- }
199
-
200
- .viewer-toolbar-dropdown .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled){
201
- background-color:transparent;
202
- color:white;
128
+ color:var(--color-button-icon-active-text);
129
+ background-color:var(--color-button-icon-active-bg);
130
+ border:1px solid var(--color-button-icon-active-outline);
203
131
  }
204
132
 
205
- .viewer-toolbar-dropdown .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled).ant-select-dropdown-menu-item-selected{
206
- background-color:#4b4b4b;
207
- }
133
+ .viewer-toolbar{
134
+ --color-button-radio-hover-outline:var(--color-button-tertiary-active-outline);
135
+ --color-button-radio-hover-text:var(--color-button-icon-active-text);
136
+ }
208
137
 
209
- .viewer-toolbar-dropdown .ant-select-dropdown-menu-item:hover:not(.ant-select-dropdown-menu-item-disabled){
210
- background-color:#f6f0ff;
211
- color:#4b4b4b;
138
+ .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):hover,
139
+ .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):has(:focus-visible){
140
+ background-color:var(--color-button-tertiary-hover-text);
212
141
  }
213
142
 
214
- @supports selector(:has(:focus-visible)){
215
- .viewer-toolbar .ant-select-selection:focus-visible,
216
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):has(:focus-visible),
217
- .viewer-toolbar .btn-borderless:focus-visible{
218
- background-color:#aa88ed !important;
219
- color:white !important;
143
+ .viewer-toolbar .ant-select.select-resolution > .ant-select-selector{
144
+ text-align:left;
220
145
  }
221
146
 
222
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):has(:focus-visible){
223
- outline:none;
224
- border-color:#aeacae;
225
- }
226
-
227
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):has(:focus-visible):not(:first-child){
228
- box-shadow:-1px 0px 0px 0px #aeacae;
229
- }
230
- }
231
-
232
- @supports not (selector(:has(:focus-visible))){
233
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):focus-within{
234
- outline:none;
235
- border-color:#aeacae;
147
+ .viewer-toolbar .ant-select.select-resolution .ant-select-selection-item{
148
+ color:var(--color-button-tertiary-text);
236
149
  }
237
150
 
238
- .viewer-toolbar .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-disabled):focus-within:not(:first-child){
239
- box-shadow:-1px 0px 0px 0px #aeacae;
151
+ .viewer-toolbar .ant-select.select-resolution.ant-select-disabled .ant-select-arrow{
152
+ display:none;
240
153
  }
241
- }
@@ -25,7 +25,7 @@
25
25
  }
26
26
 
27
27
  .control-panel-col .control-panel-row .ant-btn-text{
28
- color:var(--color-button-icon-activated-text);
28
+ color:var(--color-button-icon-active-text);
29
29
  transition:color 0.3s;
30
30
  }
31
31