@ringcentral/juno 2.36.4 → 2.37.0

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.
@@ -30,6 +30,13 @@ var arrowSize = {
30
30
  var marginOffset = '-0.4em';
31
31
  var horizontalMarginTopAndMarginBottom = foundation_1.css(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n margin-top: 3px;\n margin-bottom: 3px;\n"], ["\n margin-top: 3px;\n margin-bottom: 3px;\n"])));
32
32
  exports.tooltipStyle = function () {
33
- return foundation_1.css(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "], ["\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "])), utils_1.RcTooltipClasses.tooltip, tooltipTypography, tooltipColor, tooltipTextColor, tooltipPadding, utils_1.RcTooltipClasses.tooltipPlacementTop, utils_1.RcTooltipClasses.tooltipPlacementBottom, placementSpace, utils_1.RcTooltipClasses.tooltipPlacementRight, utils_1.RcTooltipClasses.tooltipPlacementLeft, placementSpace, utils_1.RcTooltipClasses.arrow, tooltipColor, utils_1.RcTooltipClasses.tooltipPlacementTop, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, utils_1.RcTooltipClasses.tooltipPlacementBottom, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, utils_1.RcTooltipClasses.tooltipPlacementLeft, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom, utils_1.RcTooltipClasses.tooltipPlacementRight, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom);
33
+ return foundation_1.css(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n ", "\n max-width: calc(100% - 10px);\n\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "], ["\n "
34
+ // The preventOverflowModifier of popperjs has 5px padding.
35
+ // So need set max-width to calc(100% - 10px) to prevent overflow when the tooltip is too long.
36
+ ,
37
+ "\n max-width: calc(100% - 10px);\n\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "])),
38
+ // The preventOverflowModifier of popperjs has 5px padding.
39
+ // So need set max-width to calc(100% - 10px) to prevent overflow when the tooltip is too long.
40
+ '', utils_1.RcTooltipClasses.tooltip, tooltipTypography, tooltipColor, tooltipTextColor, tooltipPadding, utils_1.RcTooltipClasses.tooltipPlacementTop, utils_1.RcTooltipClasses.tooltipPlacementBottom, placementSpace, utils_1.RcTooltipClasses.tooltipPlacementRight, utils_1.RcTooltipClasses.tooltipPlacementLeft, placementSpace, utils_1.RcTooltipClasses.arrow, tooltipColor, utils_1.RcTooltipClasses.tooltipPlacementTop, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, utils_1.RcTooltipClasses.tooltipPlacementBottom, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, utils_1.RcTooltipClasses.tooltipPlacementLeft, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom, utils_1.RcTooltipClasses.tooltipPlacementRight, utils_1.RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom);
34
41
  };
35
42
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -9,7 +9,6 @@ var Transitions_1 = require("../Transitions");
9
9
  var styles_1 = require("./styles");
10
10
  var utils_1 = require("./utils");
11
11
  var VirtualizedMenuList_1 = require("./VirtualizedMenuList");
12
- var useNextFrame_1 = require("./useNextFrame");
13
12
  var _RcVirtualizedMenu = react_1.forwardRef(function (inProps, ref) {
14
13
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcVirtualizedMenu' });
15
14
  var _a = props.autoFocus, autoFocus = _a === void 0 ? true : _a, children = props.children, classesProp = props.classes, _b = props.disableAutoFocusItem, disableAutoFocusItem = _b === void 0 ? false : _b, _c = props.MenuListProps, _d = _c === void 0 ? {} : _c, _e = _d.maxHeight, maxHeight = _e === void 0 ? 416 : _e, onKeyDown = _d.onKeyDown, VirtuosoProps = _d.VirtuosoProps, MenuListProps = tslib_1.__rest(_d, ["maxHeight", "onKeyDown", "VirtuosoProps"]), onClose = props.onClose, open = props.open, TransitionPropsProp = props.TransitionProps, _f = props.PaperProps, PaperPropsProp = _f === void 0 ? {} : _f, PopoverClasses = props.PopoverClasses, _g = props.transitionDuration, transitionDuration = _g === void 0 ? 'auto' : _g, _h = props.variant, variant = _h === void 0 ? 'selectedMenu' : _h, _j = props.action, popoverActionProp = _j === void 0 ? null : _j, rest = tslib_1.__rest(props, ["autoFocus", "children", "classes", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "TransitionProps", "PaperProps", "PopoverClasses", "transitionDuration", "variant", "action"]);
@@ -54,14 +53,14 @@ var _RcVirtualizedMenu = react_1.forwardRef(function (inProps, ref) {
54
53
  }
55
54
  }
56
55
  });
57
- var runInNextFrame = useNextFrame_1.useNextFrame();
58
56
  return (react_1.default.createElement(Popover_1.RcPopover, tslib_1.__assign({ ref: handleRef, action: handlePopoverAction, container: document.body, classes: PopoverClasses, onClose: onClose, open: open,
59
57
  // FIXME: workaround for virtualized menu height incorrect issue
60
58
  TransitionComponent: Transitions_1.RcFade, transitionDuration: transitionDuration, PaperProps: PaperProps, TransitionProps: TransitionProps }, rest),
61
59
  react_1.default.createElement(VirtualizedMenuList_1.RcVirtualizedMenuList, tslib_1.__assign({ position: "unset", action: menuListActionRef, autoFocus: autoFocus, autoFocusItem: autoFocusItem, maxHeight: maxHeight, variant: variant, onKeyDown: handleListKeyDown, VirtuosoProps: tslib_1.__assign(tslib_1.__assign({}, VirtuosoProps), { totalListHeightChanged: function (height) {
62
60
  var _a;
63
61
  (_a = VirtuosoProps === null || VirtuosoProps === void 0 ? void 0 : VirtuosoProps.totalListHeightChanged) === null || _a === void 0 ? void 0 : _a.call(VirtuosoProps, height);
64
- runInNextFrame(function () {
62
+ // fix for popover position incorrect issue
63
+ queueMicrotask(function () {
65
64
  var _a;
66
65
  (_a = popoverAction.current) === null || _a === void 0 ? void 0 : _a.updatePosition();
67
66
  });
@@ -107,7 +107,6 @@ exports.useHighlightScroll = useHighlightScroll;
107
107
  function modifyVlScrollerStyle(scrollElm, position) {
108
108
  if (position === void 0) { position = 'absolute'; }
109
109
  if (scrollElm) {
110
- scrollElm.style.transition = 'all 1ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
111
110
  if (position) {
112
111
  var viewPortElm = scrollElm.firstChild;
113
112
  if (viewPortElm) {
@@ -28,6 +28,13 @@ var arrowSize = {
28
28
  var marginOffset = '-0.4em';
29
29
  var horizontalMarginTopAndMarginBottom = css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: 3px;\n margin-bottom: 3px;\n"], ["\n margin-top: 3px;\n margin-bottom: 3px;\n"])));
30
30
  export var tooltipStyle = function () {
31
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "], ["\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "])), RcTooltipClasses.tooltip, tooltipTypography, tooltipColor, tooltipTextColor, tooltipPadding, RcTooltipClasses.tooltipPlacementTop, RcTooltipClasses.tooltipPlacementBottom, placementSpace, RcTooltipClasses.tooltipPlacementRight, RcTooltipClasses.tooltipPlacementLeft, placementSpace, RcTooltipClasses.arrow, tooltipColor, RcTooltipClasses.tooltipPlacementTop, RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, RcTooltipClasses.tooltipPlacementBottom, RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, RcTooltipClasses.tooltipPlacementLeft, RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom, RcTooltipClasses.tooltipPlacementRight, RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom);
31
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n max-width: calc(100% - 10px);\n\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "], ["\n "
32
+ // The preventOverflowModifier of popperjs has 5px padding.
33
+ // So need set max-width to calc(100% - 10px) to prevent overflow when the tooltip is too long.
34
+ ,
35
+ "\n max-width: calc(100% - 10px);\n\n .", " {\n ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n word-break: break-word;\n position: relative;\n }\n\n .", ",\n .", " {\n margin: ", " 0;\n }\n\n .", ",\n .", " {\n margin: 0 ", ";\n }\n\n .", " {\n color: ", ";\n }\n\n .", " {\n .", " {\n margin-bottom: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-right: ", ";\n ", "\n ", "\n }\n }\n\n .", " {\n .", " {\n margin-left: ", ";\n ", "\n ", "\n }\n }\n "])),
36
+ // The preventOverflowModifier of popperjs has 5px padding.
37
+ // So need set max-width to calc(100% - 10px) to prevent overflow when the tooltip is too long.
38
+ '', RcTooltipClasses.tooltip, tooltipTypography, tooltipColor, tooltipTextColor, tooltipPadding, RcTooltipClasses.tooltipPlacementTop, RcTooltipClasses.tooltipPlacementBottom, placementSpace, RcTooltipClasses.tooltipPlacementRight, RcTooltipClasses.tooltipPlacementLeft, placementSpace, RcTooltipClasses.arrow, tooltipColor, RcTooltipClasses.tooltipPlacementTop, RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, RcTooltipClasses.tooltipPlacementBottom, RcTooltipClasses.arrow, marginOffset, arrowSize.vertical, RcTooltipClasses.tooltipPlacementLeft, RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom, RcTooltipClasses.tooltipPlacementRight, RcTooltipClasses.arrow, marginOffset, arrowSize.horizontal, horizontalMarginTopAndMarginBottom);
32
39
  };
33
40
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -7,7 +7,6 @@ import { RcFade } from '../Transitions';
7
7
  import { VirtualizedMenuStyle } from './styles';
8
8
  import { RcVirtualizedMenuClasses } from './utils';
9
9
  import { RcVirtualizedMenuList, } from './VirtualizedMenuList';
10
- import { useNextFrame } from './useNextFrame';
11
10
  var _RcVirtualizedMenu = forwardRef(function (inProps, ref) {
12
11
  var props = useThemeProps({ props: inProps, name: 'RcVirtualizedMenu' });
13
12
  var _a = props.autoFocus, autoFocus = _a === void 0 ? true : _a, children = props.children, classesProp = props.classes, _b = props.disableAutoFocusItem, disableAutoFocusItem = _b === void 0 ? false : _b, _c = props.MenuListProps, _d = _c === void 0 ? {} : _c, _e = _d.maxHeight, maxHeight = _e === void 0 ? 416 : _e, onKeyDown = _d.onKeyDown, VirtuosoProps = _d.VirtuosoProps, MenuListProps = __rest(_d, ["maxHeight", "onKeyDown", "VirtuosoProps"]), onClose = props.onClose, open = props.open, TransitionPropsProp = props.TransitionProps, _f = props.PaperProps, PaperPropsProp = _f === void 0 ? {} : _f, PopoverClasses = props.PopoverClasses, _g = props.transitionDuration, transitionDuration = _g === void 0 ? 'auto' : _g, _h = props.variant, variant = _h === void 0 ? 'selectedMenu' : _h, _j = props.action, popoverActionProp = _j === void 0 ? null : _j, rest = __rest(props, ["autoFocus", "children", "classes", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "TransitionProps", "PaperProps", "PopoverClasses", "transitionDuration", "variant", "action"]);
@@ -52,14 +51,14 @@ var _RcVirtualizedMenu = forwardRef(function (inProps, ref) {
52
51
  }
53
52
  }
54
53
  });
55
- var runInNextFrame = useNextFrame();
56
54
  return (React.createElement(RcPopover, __assign({ ref: handleRef, action: handlePopoverAction, container: document.body, classes: PopoverClasses, onClose: onClose, open: open,
57
55
  // FIXME: workaround for virtualized menu height incorrect issue
58
56
  TransitionComponent: RcFade, transitionDuration: transitionDuration, PaperProps: PaperProps, TransitionProps: TransitionProps }, rest),
59
57
  React.createElement(RcVirtualizedMenuList, __assign({ position: "unset", action: menuListActionRef, autoFocus: autoFocus, autoFocusItem: autoFocusItem, maxHeight: maxHeight, variant: variant, onKeyDown: handleListKeyDown, VirtuosoProps: __assign(__assign({}, VirtuosoProps), { totalListHeightChanged: function (height) {
60
58
  var _a;
61
59
  (_a = VirtuosoProps === null || VirtuosoProps === void 0 ? void 0 : VirtuosoProps.totalListHeightChanged) === null || _a === void 0 ? void 0 : _a.call(VirtuosoProps, height);
62
- runInNextFrame(function () {
60
+ // fix for popover position incorrect issue
61
+ queueMicrotask(function () {
63
62
  var _a;
64
63
  (_a = popoverAction.current) === null || _a === void 0 ? void 0 : _a.updatePosition();
65
64
  });
@@ -104,7 +104,6 @@ export function useHighlightScroll(_a) {
104
104
  export function modifyVlScrollerStyle(scrollElm, position) {
105
105
  if (position === void 0) { position = 'absolute'; }
106
106
  if (scrollElm) {
107
- scrollElm.style.transition = 'all 1ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
108
107
  if (position) {
109
108
  var viewPortElm = scrollElm.firstChild;
110
109
  if (viewPortElm) {
@@ -1,6 +1,5 @@
1
1
  import styled from './styled-components';
2
2
  export * from './config';
3
- export * from './isWebKit154';
4
3
  export * from './contexts';
5
4
  export * from './hoc';
6
5
  export * from './hooks';
@@ -3,7 +3,6 @@ import 'focus-visible';
3
3
  import React, { createContext, useContext, } from 'react';
4
4
  import { createGenerateClassName, MuiThemeProvider, StylesProvider, } from '@material-ui/core/styles';
5
5
  import { useResultRef } from '../hooks';
6
- import { getWebKit154Theme, GlobalFixWebKitStyle, isWebKit154, } from '../isWebKit154';
7
6
  import { ThemeProvider as StyledThemeProvider, useTheme, } from '../styled-components';
8
7
  import createTheme from './createTheme';
9
8
  var NestedThemeContext = createContext(false);
@@ -13,17 +12,13 @@ var NestedThemeContext = createContext(false);
13
12
  * that will user parent's theme when not set theme
14
13
  */
15
14
  var SubThemeProvider = function (_a) {
16
- var themeProp = _a.theme, children = _a.children, fixWebKit154 = _a.fixWebKit154;
15
+ var themeProp = _a.theme, children = _a.children;
17
16
  var _b, _c;
18
17
  var parentTheme = useTheme();
19
18
  var isHaveParentRcTheme = (_c = (_b = parentTheme.palette) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.brand;
20
- // TODO: can be remove after safari fix that bug, maybe after v16
21
- var theme = getWebKit154Theme(!themeProp && isHaveParentRcTheme ? parentTheme : createTheme(themeProp), fixWebKit154);
19
+ var theme = !themeProp && isHaveParentRcTheme ? parentTheme : createTheme(themeProp);
22
20
  return (React.createElement(MuiThemeProvider, { theme: theme },
23
- React.createElement(StyledThemeProvider, { theme: theme },
24
- React.createElement(React.Fragment, null,
25
- (fixWebKit154 !== null && fixWebKit154 !== void 0 ? fixWebKit154 : isWebKit154) && React.createElement(GlobalFixWebKitStyle, null),
26
- children))));
21
+ React.createElement(StyledThemeProvider, { theme: theme }, children)));
27
22
  };
28
23
  /**
29
24
  * theme wrapper, apply in root,
@@ -1,6 +1,5 @@
1
1
  import styled from './styled-components';
2
2
  export * from './config';
3
- export * from './isWebKit154';
4
3
  export * from './contexts';
5
4
  export * from './hoc';
6
5
  export * from './hooks';
@@ -4,7 +4,6 @@ var tslib_1 = require("tslib");
4
4
  var styled_components_1 = tslib_1.__importDefault(require("./styled-components"));
5
5
  exports.styled = styled_components_1.default;
6
6
  tslib_1.__exportStar(require("./config"), exports);
7
- tslib_1.__exportStar(require("./isWebKit154"), exports);
8
7
  tslib_1.__exportStar(require("./contexts"), exports);
9
8
  tslib_1.__exportStar(require("./hoc"), exports);
10
9
  tslib_1.__exportStar(require("./hooks"), exports);
@@ -4,12 +4,6 @@ import { RcThemeInput } from './theme.type';
4
4
  declare type SubThemeProviderProps = {
5
5
  /** custom theme */
6
6
  theme?: RcThemeInput;
7
- /**
8
- * workaround for fix safari 15.4~.9 bug
9
- *
10
- * use for when your environment need that fix but userAgent not have safari
11
- */
12
- fixWebKit154?: boolean;
13
7
  children?: ReactNode;
14
8
  };
15
9
  declare type RootThemeProviderProps = {
@@ -5,7 +5,6 @@ require("focus-visible");
5
5
  var react_1 = tslib_1.__importStar(require("react"));
6
6
  var styles_1 = require("@material-ui/core/styles");
7
7
  var hooks_1 = require("../hooks");
8
- var isWebKit154_1 = require("../isWebKit154");
9
8
  var styled_components_1 = require("../styled-components");
10
9
  var createTheme_1 = tslib_1.__importDefault(require("./createTheme"));
11
10
  var NestedThemeContext = react_1.createContext(false);
@@ -15,17 +14,13 @@ var NestedThemeContext = react_1.createContext(false);
15
14
  * that will user parent's theme when not set theme
16
15
  */
17
16
  var SubThemeProvider = function (_a) {
18
- var themeProp = _a.theme, children = _a.children, fixWebKit154 = _a.fixWebKit154;
17
+ var themeProp = _a.theme, children = _a.children;
19
18
  var _b, _c;
20
19
  var parentTheme = styled_components_1.useTheme();
21
20
  var isHaveParentRcTheme = (_c = (_b = parentTheme.palette) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.brand;
22
- // TODO: can be remove after safari fix that bug, maybe after v16
23
- var theme = isWebKit154_1.getWebKit154Theme(!themeProp && isHaveParentRcTheme ? parentTheme : createTheme_1.default(themeProp), fixWebKit154);
21
+ var theme = !themeProp && isHaveParentRcTheme ? parentTheme : createTheme_1.default(themeProp);
24
22
  return (react_1.default.createElement(styles_1.MuiThemeProvider, { theme: theme },
25
- react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
26
- react_1.default.createElement(react_1.default.Fragment, null,
27
- (fixWebKit154 !== null && fixWebKit154 !== void 0 ? fixWebKit154 : isWebKit154_1.isWebKit154) && react_1.default.createElement(isWebKit154_1.GlobalFixWebKitStyle, null),
28
- children))));
23
+ react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme }, children)));
29
24
  };
30
25
  /**
31
26
  * theme wrapper, apply in root,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.36.4",
3
+ "version": "2.37.0",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",
@@ -1 +0,0 @@
1
- export declare const useNextFrame: () => (task: Function) => void;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var react_1 = require("react");
4
- exports.useNextFrame = function () {
5
- var rafIdRef = react_1.useRef(null);
6
- react_1.useLayoutEffect(function () {
7
- if (rafIdRef.current !== null) {
8
- cancelAnimationFrame(rafIdRef.current);
9
- }
10
- }, []);
11
- return function (task) {
12
- if (rafIdRef.current !== null) {
13
- cancelAnimationFrame(rafIdRef.current);
14
- }
15
- rafIdRef.current = requestAnimationFrame(function () {
16
- rafIdRef.current = requestAnimationFrame(function () {
17
- rafIdRef.current = null;
18
- task();
19
- });
20
- });
21
- };
22
- };
@@ -1,20 +0,0 @@
1
- import { useRef, useLayoutEffect } from 'react';
2
- export var useNextFrame = function () {
3
- var rafIdRef = useRef(null);
4
- useLayoutEffect(function () {
5
- if (rafIdRef.current !== null) {
6
- cancelAnimationFrame(rafIdRef.current);
7
- }
8
- }, []);
9
- return function (task) {
10
- if (rafIdRef.current !== null) {
11
- cancelAnimationFrame(rafIdRef.current);
12
- }
13
- rafIdRef.current = requestAnimationFrame(function () {
14
- rafIdRef.current = requestAnimationFrame(function () {
15
- rafIdRef.current = null;
16
- task();
17
- });
18
- });
19
- };
20
- };
@@ -1,57 +0,0 @@
1
- import { __makeTemplateObject } from "tslib";
2
- import { createGlobalStyle } from 'styled-components';
3
- import { RcClasses } from './utils/classes';
4
- import { combineProps } from './utils/combineProps';
5
- // * this whole file should be remove after webkit154 issue be fixed
6
- /**
7
- * Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
8
- * Remove this workaround once the WebKit bug fix is released.
9
- *
10
- * follow up:
11
- * https://github.com/mui/material-ui/pull/31975/files
12
- * https://github.com/mui/material-ui/pull/32202/files
13
- */
14
- export var isWebKit154 = typeof navigator !== 'undefined' &&
15
- /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) &&
16
- /(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);
17
- var FixWebKit154Classes = RcClasses(['paper'], 'RcFixWebKit154');
18
- /**
19
- * Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
20
- * Remove this workaround once the Safari bug is fixed.
21
- */
22
- export var getWebKit154Theme = function (theme, enable) {
23
- if (enable !== null && enable !== void 0 ? enable : isWebKit154) {
24
- return combineProps({
25
- props: {
26
- // * set all grow related to only have one transition to make animation not shake after safari 15.4
27
- MuiMenu: {
28
- PopoverClasses: { paper: FixWebKit154Classes.paper },
29
- },
30
- RcVirtualizedMenu: {
31
- PopoverClasses: { paper: FixWebKit154Classes.paper },
32
- },
33
- MuiPopover: {
34
- PaperProps: { className: FixWebKit154Classes.paper },
35
- },
36
- // mui tooltip prop will cover all existing props
37
- RcTooltip: {
38
- classes: {
39
- tooltip: FixWebKit154Classes.paper,
40
- },
41
- },
42
- // mui grow not accept global prop
43
- RcGrow: {
44
- className: FixWebKit154Classes.paper,
45
- },
46
- },
47
- }, theme);
48
- }
49
- return theme;
50
- };
51
- export var fixWebKitTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
52
- /**
53
- * A global style that can be used to
54
- * apply a workaround for the CSS transition bug after WebKit 15.4.
55
- */
56
- export var GlobalFixWebKitStyle = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n transition: ", " !important;\n }\n"], ["\n .", " {\n transition: ", " !important;\n }\n"])), FixWebKit154Classes.paper, fixWebKitTransitionStyle);
57
- var templateObject_1;
@@ -1,20 +0,0 @@
1
- /**
2
- * Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
3
- * Remove this workaround once the WebKit bug fix is released.
4
- *
5
- * follow up:
6
- * https://github.com/mui/material-ui/pull/31975/files
7
- * https://github.com/mui/material-ui/pull/32202/files
8
- */
9
- export declare const isWebKit154: boolean;
10
- /**
11
- * Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
12
- * Remove this workaround once the Safari bug is fixed.
13
- */
14
- export declare const getWebKit154Theme: (theme: any, enable?: boolean | undefined) => any;
15
- export declare const fixWebKitTransitionStyle = "all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms";
16
- /**
17
- * A global style that can be used to
18
- * apply a workaround for the CSS transition bug after WebKit 15.4.
19
- */
20
- export declare const GlobalFixWebKitStyle: import("styled-components").GlobalStyleClass<{}, import("styled-components").DefaultTheme>;
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var styled_components_1 = require("styled-components");
5
- var classes_1 = require("./utils/classes");
6
- var combineProps_1 = require("./utils/combineProps");
7
- // * this whole file should be remove after webkit154 issue be fixed
8
- /**
9
- * Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
10
- * Remove this workaround once the WebKit bug fix is released.
11
- *
12
- * follow up:
13
- * https://github.com/mui/material-ui/pull/31975/files
14
- * https://github.com/mui/material-ui/pull/32202/files
15
- */
16
- exports.isWebKit154 = typeof navigator !== 'undefined' &&
17
- /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) &&
18
- /(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);
19
- var FixWebKit154Classes = classes_1.RcClasses(['paper'], 'RcFixWebKit154');
20
- /**
21
- * Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
22
- * Remove this workaround once the Safari bug is fixed.
23
- */
24
- exports.getWebKit154Theme = function (theme, enable) {
25
- if (enable !== null && enable !== void 0 ? enable : exports.isWebKit154) {
26
- return combineProps_1.combineProps({
27
- props: {
28
- // * set all grow related to only have one transition to make animation not shake after safari 15.4
29
- MuiMenu: {
30
- PopoverClasses: { paper: FixWebKit154Classes.paper },
31
- },
32
- RcVirtualizedMenu: {
33
- PopoverClasses: { paper: FixWebKit154Classes.paper },
34
- },
35
- MuiPopover: {
36
- PaperProps: { className: FixWebKit154Classes.paper },
37
- },
38
- // mui tooltip prop will cover all existing props
39
- RcTooltip: {
40
- classes: {
41
- tooltip: FixWebKit154Classes.paper,
42
- },
43
- },
44
- // mui grow not accept global prop
45
- RcGrow: {
46
- className: FixWebKit154Classes.paper,
47
- },
48
- },
49
- }, theme);
50
- }
51
- return theme;
52
- };
53
- exports.fixWebKitTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
54
- /**
55
- * A global style that can be used to
56
- * apply a workaround for the CSS transition bug after WebKit 15.4.
57
- */
58
- exports.GlobalFixWebKitStyle = styled_components_1.createGlobalStyle(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n .", " {\n transition: ", " !important;\n }\n"], ["\n .", " {\n transition: ", " !important;\n }\n"])), FixWebKit154Classes.paper, exports.fixWebKitTransitionStyle);
59
- var templateObject_1;