@ringcentral/juno 2.4.1 → 2.5.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/Buttons/IconButton/IconButton.d.ts +6 -2
- package/components/Buttons/IconButton/IconButton.js +9 -7
- package/components/Buttons/IconButton/styles/StyledIconButton.js +15 -7
- package/components/Buttons/IconButton/utils/IconButtonUtils.d.ts +1 -1
- package/components/Buttons/IconButton/utils/IconButtonUtils.js +9 -1
- package/components/Dialer/DialPad/DialPad.d.ts +25 -7
- package/components/Dialer/DialPad/DialPad.js +6 -6
- package/components/Dialer/DialPad/utils/useDialKeyboard.d.ts +8 -9
- package/components/Dialer/DialTextField/DialTextField.d.ts +3 -1
- package/components/Dialer/DialTextField/DialTextField.js +7 -6
- package/components/Downshift/SuggestionList/SuggestionList.d.ts +74 -2
- package/components/Downshift/SuggestionList/SuggestionList.js +4 -1
- package/components/Downshift/styles/DownshiftStyle.d.ts +1 -1
- package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +1 -1
- package/components/Forms/Picker/DatePicker/styles/StyledYear.d.ts +1 -1
- package/components/Forms/Picker/TimePicker/styles/StyledSelectionItem.d.ts +1 -1
- package/components/Forms/Picker/TimePicker/styles/StyledTimeIconButton.d.ts +1 -1
- package/components/Forms/Picker/styles/PickerBaseIconButton.d.ts +1 -1
- package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
- package/components/Grid/Grid.d.ts +1 -1
- package/components/Pagination/Pagination/Pagination.d.ts +1 -1
- package/components/Stepper/StepButton/StepButton.d.ts +1 -1
- package/components/Stepper/StepLabel/StepLabel.d.ts +1 -1
- package/components/Table/TableCell/styles/TableCellStyle.js +3 -1
- package/components/Table/types.d.ts +1 -1
- package/components/TablePagination/TablePagination.d.ts +1 -1
- package/components/VirtualizedMenu/VirtualizedMenu.js +11 -0
- package/components/VirtualizedMenu/VirtualizedMenuList.js +7 -14
- package/components/Virtuoso/react-virtuoso/AATree.js +15 -15
- package/components/Virtuoso/react-virtuoso/Grid.d.ts +193 -106
- package/components/Virtuoso/react-virtuoso/Grid.js +19 -24
- package/components/Virtuoso/react-virtuoso/List.d.ts +2664 -596
- package/components/Virtuoso/react-virtuoso/List.js +83 -70
- package/components/Virtuoso/react-virtuoso/Table.d.ts +6253 -0
- package/components/Virtuoso/react-virtuoso/Table.js +184 -0
- package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +153 -37
- package/components/Virtuoso/react-virtuoso/components.d.ts +248 -41
- package/components/Virtuoso/react-virtuoso/components.js +2 -0
- package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +2 -4
- package/components/Virtuoso/react-virtuoso/domIOSystem.js +12 -10
- package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +146 -27
- package/components/Virtuoso/react-virtuoso/followOutputSystem.js +28 -15
- package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +67 -52
- package/components/Virtuoso/react-virtuoso/gridSystem.js +17 -15
- package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +17 -3
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +2 -1
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +32 -7
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +40 -26
- package/components/Virtuoso/react-virtuoso/hooks/useSize.d.ts +2 -2
- package/components/Virtuoso/react-virtuoso/hooks/useSize.js +26 -28
- package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +32 -12
- package/components/Virtuoso/react-virtuoso/index.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/index.js +2 -0
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +165 -35
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +1 -8
- package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +160 -38
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +54 -12
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +26 -10
- package/components/Virtuoso/react-virtuoso/interfaces.d.ts +134 -28
- package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +141 -32
- package/components/Virtuoso/react-virtuoso/listStateSystem.js +1 -2
- package/components/Virtuoso/react-virtuoso/listSystem.d.ts +2123 -407
- package/components/Virtuoso/react-virtuoso/listSystem.js +10 -7
- package/components/Virtuoso/react-virtuoso/loggerSystem.d.ts +17 -0
- package/components/Virtuoso/react-virtuoso/loggerSystem.js +37 -0
- package/components/Virtuoso/react-virtuoso/propsReadySystem.d.ts +8 -1
- package/components/Virtuoso/react-virtuoso/propsReadySystem.js +8 -2
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +641 -0
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +42 -0
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +52 -67
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +11 -25
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +26 -5
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +37 -13
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +11 -4
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +44 -15
- package/components/Virtuoso/react-virtuoso/sizeSystem.d.ts +12 -2
- package/components/Virtuoso/react-virtuoso/sizeSystem.js +109 -52
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +17 -5
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +87 -18
- package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +145 -33
- package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +149 -35
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +183 -42
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +37 -26
- package/components/Virtuoso/react-virtuoso/utils/correctItemSize.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/utils/correctItemSize.js +6 -0
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +7 -4
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +9 -7
- package/components/Virtuoso/utils/useHighlightScroll.d.ts +4 -0
- package/components/Virtuoso/utils/useHighlightScroll.js +17 -0
- package/es6/components/Buttons/IconButton/IconButton.js +11 -9
- package/es6/components/Buttons/IconButton/styles/StyledIconButton.js +16 -8
- package/es6/components/Buttons/IconButton/utils/IconButtonUtils.js +9 -1
- package/es6/components/Dialer/DialPad/DialPad.js +6 -6
- package/es6/components/Dialer/DialTextField/DialTextField.js +7 -6
- package/es6/components/Downshift/SuggestionList/SuggestionList.js +5 -2
- package/es6/components/Table/TableCell/TableCell.js +2 -2
- package/es6/components/Table/TableCell/styles/TableCellStyle.js +3 -1
- package/es6/components/VirtualizedMenu/VirtualizedMenu.js +13 -2
- package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +9 -16
- package/es6/components/Virtuoso/react-virtuoso/AATree.js +15 -15
- package/es6/components/Virtuoso/react-virtuoso/Grid.js +20 -25
- package/es6/components/Virtuoso/react-virtuoso/List.js +84 -72
- package/es6/components/Virtuoso/react-virtuoso/Table.js +182 -0
- package/es6/components/Virtuoso/react-virtuoso/components.js +2 -0
- package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +13 -10
- package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +28 -15
- package/es6/components/Virtuoso/react-virtuoso/gridSystem.js +17 -15
- package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +31 -6
- package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +40 -26
- package/es6/components/Virtuoso/react-virtuoso/hooks/useSize.js +27 -29
- package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +32 -12
- package/es6/components/Virtuoso/react-virtuoso/index.js +1 -0
- package/es6/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +1 -8
- package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +25 -10
- package/es6/components/Virtuoso/react-virtuoso/listStateSystem.js +2 -3
- package/es6/components/Virtuoso/react-virtuoso/listSystem.js +10 -7
- package/es6/components/Virtuoso/react-virtuoso/loggerSystem.js +34 -0
- package/es6/components/Virtuoso/react-virtuoso/propsReadySystem.js +9 -2
- package/es6/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +40 -0
- package/es6/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +11 -25
- package/es6/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +37 -13
- package/es6/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +39 -11
- package/es6/components/Virtuoso/react-virtuoso/sizeSystem.js +109 -52
- package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +87 -18
- package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +39 -28
- package/es6/components/Virtuoso/react-virtuoso/utils/correctItemSize.js +3 -0
- package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +9 -7
- package/es6/components/Virtuoso/utils/useHighlightScroll.js +16 -0
- package/es6/foundation/hooks/useLongPress/useLongPress.js +7 -7
- package/es6/foundation/index.js +1 -1
- package/es6/foundation/isWebKit154.js +57 -0
- package/es6/foundation/theme/ThemeProvider.js +4 -4
- package/foundation/hooks/useLongPress/useLongPress.d.ts +3 -1
- package/foundation/hooks/useLongPress/useLongPress.js +7 -7
- package/foundation/index.d.ts +1 -1
- package/foundation/index.js +1 -1
- package/foundation/isWebKit154.d.ts +20 -0
- package/foundation/{isSafari154.js → isWebKit154.js} +22 -17
- package/foundation/theme/ThemeProvider.d.ts +1 -1
- package/foundation/theme/ThemeProvider.js +4 -4
- package/package.json +2 -2
- package/es6/foundation/isSafari154.js +0 -52
- package/foundation/isSafari154.d.ts +0 -15
|
@@ -0,0 +1,57 @@
|
|
|
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;
|
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { getWebKit154Theme, GlobalFixWebKitStyle, isWebKit154, } from '../isWebKit154';
|
|
7
7
|
import { ThemeProvider as StyledThemeProvider, useTheme, } from '../styled-components';
|
|
8
8
|
import createTheme from './createTheme';
|
|
9
9
|
var NestedThemeContext = createContext(false);
|
|
@@ -13,16 +13,16 @@ var NestedThemeContext = createContext(false);
|
|
|
13
13
|
* that will user parent's theme when not set theme
|
|
14
14
|
*/
|
|
15
15
|
var SubThemeProvider = function (_a) {
|
|
16
|
-
var themeProp = _a.theme, children = _a.children,
|
|
16
|
+
var themeProp = _a.theme, children = _a.children, fixWebKit154 = _a.fixWebKit154;
|
|
17
17
|
var _b, _c;
|
|
18
18
|
var parentTheme = useTheme();
|
|
19
19
|
var isHaveParentRcTheme = (_c = (_b = parentTheme.palette) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.brand;
|
|
20
20
|
// TODO: can be remove after safari fix that bug, maybe after v16
|
|
21
|
-
var theme =
|
|
21
|
+
var theme = getWebKit154Theme(!themeProp && isHaveParentRcTheme ? parentTheme : createTheme(themeProp), fixWebKit154);
|
|
22
22
|
return (React.createElement(MuiThemeProvider, { theme: theme },
|
|
23
23
|
React.createElement(StyledThemeProvider, { theme: theme },
|
|
24
24
|
React.createElement(React.Fragment, null,
|
|
25
|
-
(
|
|
25
|
+
(fixWebKit154 !== null && fixWebKit154 !== void 0 ? fixWebKit154 : isWebKit154) && React.createElement(GlobalFixWebKitStyle, null),
|
|
26
26
|
children))));
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
@@ -5,6 +5,8 @@ export interface UseLongPressOptions {
|
|
|
5
5
|
isPreventDefault?: boolean;
|
|
6
6
|
/** the longPress delay */
|
|
7
7
|
delay?: number;
|
|
8
|
+
/** for custom window */
|
|
9
|
+
externalWindow?: Window;
|
|
8
10
|
}
|
|
9
11
|
export declare type UseLongPressEventReason = 'keyboard' | 'click' | 'tap';
|
|
10
12
|
export declare type UseLongPressOutput<T> = {
|
|
@@ -26,7 +28,7 @@ export declare type UseLongPressInput<T> = {
|
|
|
26
28
|
*
|
|
27
29
|
* @default UseLongPressOptions { isPreventDefault = true, delay = 300 }
|
|
28
30
|
*/
|
|
29
|
-
export declare const useLongPress: <T = unknown>({ onTap, onPress }: UseLongPressOutput<T>, { onTouchStart, onTouchEnd, onMouseDown, onKeyDown, onKeyUp, onContextMenu, onMouseUp: onMouseUpArg, }?: UseLongPressInput<T>, { isPreventDefault, delay }?: UseLongPressOptions) => {
|
|
31
|
+
export declare const useLongPress: <T = unknown>({ onTap, onPress }: UseLongPressOutput<T>, { onTouchStart, onTouchEnd, onMouseDown, onKeyDown, onKeyUp, onContextMenu, onMouseUp: onMouseUpArg, }?: UseLongPressInput<T>, { isPreventDefault, delay, externalWindow, }?: UseLongPressOptions) => {
|
|
30
32
|
onTouchStart: (e: any) => void;
|
|
31
33
|
onTouchEnd: (e: any) => void;
|
|
32
34
|
onMouseDown: (event: React.MouseEvent<T, MouseEvent>) => void;
|
|
@@ -17,7 +17,7 @@ var useTouchMouseEvent_1 = require("../useTouchMouseEvent");
|
|
|
17
17
|
exports.useLongPress = function (_a, _b, _c) {
|
|
18
18
|
var onTap = _a.onTap, onPress = _a.onPress;
|
|
19
19
|
var _d = _b === void 0 ? {} : _b, onTouchStart = _d.onTouchStart, onTouchEnd = _d.onTouchEnd, onMouseDown = _d.onMouseDown, onKeyDown = _d.onKeyDown, onKeyUp = _d.onKeyUp, onContextMenu = _d.onContextMenu, onMouseUpArg = _d.onMouseUp;
|
|
20
|
-
var _e = _c === void 0 ? {} : _c, _f = _e.isPreventDefault, isPreventDefault = _f === void 0 ? true : _f, _g = _e.delay, delay = _g === void 0 ? 300 : _g;
|
|
20
|
+
var _e = _c === void 0 ? {} : _c, _f = _e.isPreventDefault, isPreventDefault = _f === void 0 ? true : _f, _g = _e.delay, delay = _g === void 0 ? 300 : _g, _h = _e.externalWindow, externalWindow = _h === void 0 ? window : _h;
|
|
21
21
|
var isEmittedRef = react_1.useRef(false);
|
|
22
22
|
var isA11yDownRef = react_1.useRef(false);
|
|
23
23
|
var elmRef = react_1.useRef(null);
|
|
@@ -31,7 +31,7 @@ exports.useLongPress = function (_a, _b, _c) {
|
|
|
31
31
|
}, delay);
|
|
32
32
|
var end = function (e) {
|
|
33
33
|
// ! mouse up only trigger when up on element, so we host that in document
|
|
34
|
-
document.removeEventListener('mouseup', onMouseUp);
|
|
34
|
+
externalWindow.document.removeEventListener('mouseup', onMouseUp);
|
|
35
35
|
if (!isEmittedRef.current && useTouchMouseEvent_1.isElmEqualOrContain(e.target, elmRef)) {
|
|
36
36
|
onTap === null || onTap === void 0 ? void 0 : onTap(e, reasonRef.current);
|
|
37
37
|
}
|
|
@@ -41,7 +41,7 @@ exports.useLongPress = function (_a, _b, _c) {
|
|
|
41
41
|
};
|
|
42
42
|
var start = function (e) {
|
|
43
43
|
// ! mouse up only trigger when up on element, so we host that in document
|
|
44
|
-
document.addEventListener('mouseup', onMouseUp);
|
|
44
|
+
externalWindow.document.addEventListener('mouseup', onMouseUp);
|
|
45
45
|
var isTouch = e.type === 'touchstart';
|
|
46
46
|
if (!isTouch)
|
|
47
47
|
e.preventDefault();
|
|
@@ -51,7 +51,7 @@ exports.useLongPress = function (_a, _b, _c) {
|
|
|
51
51
|
}
|
|
52
52
|
emitLongPress(e);
|
|
53
53
|
};
|
|
54
|
-
var
|
|
54
|
+
var _j = useTouchMouseEvent_1.useTouchMouseEvent({
|
|
55
55
|
onTouchStart: function (e) {
|
|
56
56
|
onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(e);
|
|
57
57
|
start(e);
|
|
@@ -68,7 +68,7 @@ exports.useLongPress = function (_a, _b, _c) {
|
|
|
68
68
|
onMouseUpArg === null || onMouseUpArg === void 0 ? void 0 : onMouseUpArg(e);
|
|
69
69
|
end(e);
|
|
70
70
|
},
|
|
71
|
-
}, { isPreventDefault: isPreventDefault }), onMouseUp =
|
|
71
|
+
}, { isPreventDefault: isPreventDefault }), onMouseUp = _j.onMouseUp, events = tslib_1.__rest(_j, ["onMouseUp"]);
|
|
72
72
|
var handleDeleteKeyDown = useA11yKeyEvent_1.useA11yKeyEvent(function (e) {
|
|
73
73
|
reasonRef.current = 'keyboard';
|
|
74
74
|
// * keydown when hold will trigger many time, show when current is a11y down, not trigger again
|
|
@@ -94,8 +94,8 @@ exports.useLongPress = function (_a, _b, _c) {
|
|
|
94
94
|
react_1.useEffect(function () {
|
|
95
95
|
return function () {
|
|
96
96
|
// * clean when in start remove
|
|
97
|
-
document.removeEventListener('mouseup', onMouseUp);
|
|
97
|
+
externalWindow.document.removeEventListener('mouseup', onMouseUp);
|
|
98
98
|
};
|
|
99
|
-
}, [onMouseUp]);
|
|
99
|
+
}, [onMouseUp, externalWindow]);
|
|
100
100
|
return tslib_1.__assign({ ref: elmRef, onContextMenu: handleContextMenu, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }, events);
|
|
101
101
|
};
|
package/foundation/index.d.ts
CHANGED
package/foundation/index.js
CHANGED
|
@@ -4,7 +4,7 @@ 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("./
|
|
7
|
+
tslib_1.__exportStar(require("./isWebKit154"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./contexts"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./hoc"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./hooks"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
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>;
|
|
@@ -4,51 +4,56 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var styled_components_1 = require("styled-components");
|
|
5
5
|
var classes_1 = require("./utils/classes");
|
|
6
6
|
var combineProps_1 = require("./utils/combineProps");
|
|
7
|
+
// * this whole file should be remove after webkit154 issue be fixed
|
|
7
8
|
/**
|
|
8
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
9
|
-
* Remove this workaround once the
|
|
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
|
|
10
15
|
*/
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var FixSafari154Classes = classes_1.RcClasses(['paper'], 'RcFixSafari154');
|
|
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');
|
|
16
20
|
/**
|
|
17
21
|
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
18
22
|
* Remove this workaround once the Safari bug is fixed.
|
|
19
23
|
*/
|
|
20
|
-
exports.
|
|
21
|
-
if (enable !== null && enable !== void 0 ? enable : exports.
|
|
24
|
+
exports.getWebKit154Theme = function (theme, enable) {
|
|
25
|
+
if (enable !== null && enable !== void 0 ? enable : exports.isWebKit154) {
|
|
22
26
|
return combineProps_1.combineProps({
|
|
23
27
|
props: {
|
|
24
28
|
// * set all grow related to only have one transition to make animation not shake after safari 15.4
|
|
25
29
|
MuiMenu: {
|
|
26
|
-
PopoverClasses: { paper:
|
|
30
|
+
PopoverClasses: { paper: FixWebKit154Classes.paper },
|
|
27
31
|
},
|
|
28
32
|
RcVirtualizedMenu: {
|
|
29
|
-
PopoverClasses: { paper:
|
|
33
|
+
PopoverClasses: { paper: FixWebKit154Classes.paper },
|
|
30
34
|
},
|
|
31
35
|
MuiPopover: {
|
|
32
|
-
PaperProps: { className:
|
|
36
|
+
PaperProps: { className: FixWebKit154Classes.paper },
|
|
33
37
|
},
|
|
34
38
|
// mui tooltip prop will cover all existing props
|
|
35
39
|
RcTooltip: {
|
|
36
40
|
classes: {
|
|
37
|
-
tooltip:
|
|
41
|
+
tooltip: FixWebKit154Classes.paper,
|
|
38
42
|
},
|
|
39
43
|
},
|
|
40
44
|
// mui grow not accept global prop
|
|
41
45
|
RcGrow: {
|
|
42
|
-
className:
|
|
46
|
+
className: FixWebKit154Classes.paper,
|
|
43
47
|
},
|
|
44
48
|
},
|
|
45
49
|
}, theme);
|
|
46
50
|
}
|
|
47
51
|
return theme;
|
|
48
52
|
};
|
|
49
|
-
exports.
|
|
53
|
+
exports.fixWebKitTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
|
|
50
54
|
/**
|
|
51
|
-
* A global style that can be used to
|
|
55
|
+
* A global style that can be used to
|
|
56
|
+
* apply a workaround for the CSS transition bug after WebKit 15.4.
|
|
52
57
|
*/
|
|
53
|
-
exports.
|
|
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);
|
|
54
59
|
var templateObject_1;
|
|
@@ -5,7 +5,7 @@ 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
|
|
8
|
+
var isWebKit154_1 = require("../isWebKit154");
|
|
9
9
|
var styled_components_1 = require("../styled-components");
|
|
10
10
|
var createTheme_1 = tslib_1.__importDefault(require("./createTheme"));
|
|
11
11
|
var NestedThemeContext = react_1.createContext(false);
|
|
@@ -15,16 +15,16 @@ var NestedThemeContext = react_1.createContext(false);
|
|
|
15
15
|
* that will user parent's theme when not set theme
|
|
16
16
|
*/
|
|
17
17
|
var SubThemeProvider = function (_a) {
|
|
18
|
-
var themeProp = _a.theme, children = _a.children,
|
|
18
|
+
var themeProp = _a.theme, children = _a.children, fixWebKit154 = _a.fixWebKit154;
|
|
19
19
|
var _b, _c;
|
|
20
20
|
var parentTheme = styled_components_1.useTheme();
|
|
21
21
|
var isHaveParentRcTheme = (_c = (_b = parentTheme.palette) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.brand;
|
|
22
22
|
// TODO: can be remove after safari fix that bug, maybe after v16
|
|
23
|
-
var theme =
|
|
23
|
+
var theme = isWebKit154_1.getWebKit154Theme(!themeProp && isHaveParentRcTheme ? parentTheme : createTheme_1.default(themeProp), fixWebKit154);
|
|
24
24
|
return (react_1.default.createElement(styles_1.MuiThemeProvider, { theme: theme },
|
|
25
25
|
react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
26
26
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
-
(
|
|
27
|
+
(fixWebKit154 !== null && fixWebKit154 !== void 0 ? fixWebKit154 : isWebKit154_1.isWebKit154) && react_1.default.createElement(isWebKit154_1.GlobalFixWebKitStyle, null),
|
|
28
28
|
children))));
|
|
29
29
|
};
|
|
30
30
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ringcentral/juno",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"author": "RingCentral",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"focus-visible": "^5.1.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"react-beautiful-dnd": "^13.0.0",
|
|
30
|
-
"react-virtuoso": "^
|
|
30
|
+
"react-virtuoso": "^2.8.3",
|
|
31
31
|
"resize-observer-polyfill": "^1.5.1",
|
|
32
32
|
"typeface-lato": "^0.0.75",
|
|
33
33
|
"tslib": ">=2.0.0"
|
|
@@ -1,52 +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
|
-
/**
|
|
6
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
7
|
-
* Remove this workaround once the Safari bug is fixed.
|
|
8
|
-
*/
|
|
9
|
-
export var isSafari154 = typeof navigator !== 'undefined' &&
|
|
10
|
-
(/^((?!chrome|android).)*safari/i.test(navigator.userAgent) ||
|
|
11
|
-
/(iPhone|iPad)/.test(navigator.userAgent)) &&
|
|
12
|
-
/15\.[4-9]/i.test(navigator.userAgent);
|
|
13
|
-
var FixSafari154Classes = RcClasses(['paper'], 'RcFixSafari154');
|
|
14
|
-
/**
|
|
15
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
16
|
-
* Remove this workaround once the Safari bug is fixed.
|
|
17
|
-
*/
|
|
18
|
-
export var getSafari154Theme = function (theme, enable) {
|
|
19
|
-
if (enable !== null && enable !== void 0 ? enable : isSafari154) {
|
|
20
|
-
return combineProps({
|
|
21
|
-
props: {
|
|
22
|
-
// * set all grow related to only have one transition to make animation not shake after safari 15.4
|
|
23
|
-
MuiMenu: {
|
|
24
|
-
PopoverClasses: { paper: FixSafari154Classes.paper },
|
|
25
|
-
},
|
|
26
|
-
RcVirtualizedMenu: {
|
|
27
|
-
PopoverClasses: { paper: FixSafari154Classes.paper },
|
|
28
|
-
},
|
|
29
|
-
MuiPopover: {
|
|
30
|
-
PaperProps: { className: FixSafari154Classes.paper },
|
|
31
|
-
},
|
|
32
|
-
// mui tooltip prop will cover all existing props
|
|
33
|
-
RcTooltip: {
|
|
34
|
-
classes: {
|
|
35
|
-
tooltip: FixSafari154Classes.paper,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
// mui grow not accept global prop
|
|
39
|
-
RcGrow: {
|
|
40
|
-
className: FixSafari154Classes.paper,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}, theme);
|
|
44
|
-
}
|
|
45
|
-
return theme;
|
|
46
|
-
};
|
|
47
|
-
export var fixSafariTransitionStyle = 'all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
|
|
48
|
-
/**
|
|
49
|
-
* A global style that can be used to apply a workaround for the CSS transition bug in Safari 15.4.
|
|
50
|
-
*/
|
|
51
|
-
export var GlobalFixSafariStyle = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .", " {\n transition: ", " !important;\n }\n"], ["\n .", " {\n transition: ", " !important;\n }\n"])), FixSafari154Classes.paper, fixSafariTransitionStyle);
|
|
52
|
-
var templateObject_1;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
3
|
-
* Remove this workaround once the Safari bug is fixed.
|
|
4
|
-
*/
|
|
5
|
-
export declare const isSafari154: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
|
|
8
|
-
* Remove this workaround once the Safari bug is fixed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getSafari154Theme: (theme: any, enable?: boolean | undefined) => any;
|
|
11
|
-
export declare const fixSafariTransitionStyle = "all 159ms cubic-bezier(0.4, 0, 0.2, 1) 0ms";
|
|
12
|
-
/**
|
|
13
|
-
* A global style that can be used to apply a workaround for the CSS transition bug in Safari 15.4.
|
|
14
|
-
*/
|
|
15
|
-
export declare const GlobalFixSafariStyle: import("styled-components").GlobalStyleClass<{}, import("styled-components").DefaultTheme>;
|