@ringcentral/juno 2.36.5 → 2.38.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.
- package/components/VirtualizedMenu/VirtualizedMenu.js +2 -3
- package/components/Virtuoso/utils/useHighlightScroll.js +0 -1
- package/es6/components/VirtualizedMenu/VirtualizedMenu.js +2 -3
- package/es6/components/Virtuoso/utils/useHighlightScroll.js +0 -1
- package/es6/foundation/index.js +0 -1
- package/es6/foundation/theme/ThemeProvider.js +3 -8
- package/es6/foundation/theme/assets/typography.json +4 -4
- package/foundation/index.d.ts +0 -1
- package/foundation/index.js +0 -1
- package/foundation/theme/ThemeProvider.d.ts +0 -6
- package/foundation/theme/ThemeProvider.js +3 -8
- package/foundation/theme/assets/typography.json +4 -4
- package/package.json +1 -1
- package/components/VirtualizedMenu/useNextFrame.d.ts +0 -1
- package/components/VirtualizedMenu/useNextFrame.js +0 -22
- package/es6/components/VirtualizedMenu/useNextFrame.js +0 -20
- package/es6/foundation/isWebKit154.js +0 -57
- package/foundation/isWebKit154.d.ts +0 -20
- package/foundation/isWebKit154.js +0 -59
|
@@ -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
|
-
|
|
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) {
|
|
@@ -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
|
-
|
|
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) {
|
package/es6/foundation/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"body1": {
|
|
3
|
-
"fontSize": "0.
|
|
3
|
+
"fontSize": "0.875rem",
|
|
4
4
|
"fontWeight": 400,
|
|
5
|
-
"lineHeight": "
|
|
5
|
+
"lineHeight": "20px"
|
|
6
6
|
},
|
|
7
7
|
"body2": {
|
|
8
|
-
"fontSize": "0.
|
|
8
|
+
"fontSize": "0.875rem",
|
|
9
9
|
"fontWeight": 700,
|
|
10
|
-
"lineHeight": "
|
|
10
|
+
"lineHeight": "20px"
|
|
11
11
|
},
|
|
12
12
|
"button": {
|
|
13
13
|
"fontSize": "0.9375rem",
|
package/foundation/index.d.ts
CHANGED
package/foundation/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"body1": {
|
|
3
|
-
"fontSize": "0.
|
|
3
|
+
"fontSize": "0.875rem",
|
|
4
4
|
"fontWeight": 400,
|
|
5
|
-
"lineHeight": "
|
|
5
|
+
"lineHeight": "20px"
|
|
6
6
|
},
|
|
7
7
|
"body2": {
|
|
8
|
-
"fontSize": "0.
|
|
8
|
+
"fontSize": "0.875rem",
|
|
9
9
|
"fontWeight": 700,
|
|
10
|
-
"lineHeight": "
|
|
10
|
+
"lineHeight": "20px"
|
|
11
11
|
},
|
|
12
12
|
"button": {
|
|
13
13
|
"fontSize": "0.9375rem",
|
package/package.json
CHANGED
|
@@ -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;
|