@charcoal-ui/react-sandbox 2.3.0 → 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/dist/components/Carousel/index.d.ts.map +1 -1
- package/dist/components/TextEllipsis/helper.d.ts +1 -1
- package/dist/components/TextEllipsis/helper.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +6 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +6 -5
- package/dist/index.module.js.map +1 -1
- package/dist/styled.d.ts +75 -73
- package/dist/styled.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/components/Carousel/index.tsx +5 -10
- package/src/hooks/index.ts +4 -0
package/dist/index.modern.js
CHANGED
|
@@ -10,7 +10,7 @@ import { animated, useSpring } from 'react-spring';
|
|
|
10
10
|
import warning from 'warning';
|
|
11
11
|
|
|
12
12
|
function _extends() {
|
|
13
|
-
_extends = Object.assign
|
|
13
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
14
14
|
for (var i = 1; i < arguments.length; i++) {
|
|
15
15
|
var source = arguments[i];
|
|
16
16
|
|
|
@@ -23,7 +23,6 @@ function _extends() {
|
|
|
23
23
|
|
|
24
24
|
return target;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
26
|
return _extends.apply(this, arguments);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -1431,6 +1430,8 @@ function passiveEvents() {
|
|
|
1431
1430
|
}
|
|
1432
1431
|
const isEdge = () => navigator.userAgent.includes('Edge/');
|
|
1433
1432
|
|
|
1433
|
+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
1434
|
+
|
|
1434
1435
|
function unreachable(value) {
|
|
1435
1436
|
throw new Error(arguments.length === 0 ? 'unreachable' : `unreachable (${JSON.stringify(value)})`);
|
|
1436
1437
|
}
|
|
@@ -1750,7 +1751,7 @@ function Carousel(_ref) {
|
|
|
1750
1751
|
onResize(clientWidth);
|
|
1751
1752
|
}
|
|
1752
1753
|
}, [onResize]);
|
|
1753
|
-
|
|
1754
|
+
useIsomorphicLayoutEffect(() => {
|
|
1754
1755
|
const elm = ref.current;
|
|
1755
1756
|
const innerElm = innerRef.current;
|
|
1756
1757
|
|
|
@@ -1772,7 +1773,7 @@ function Carousel(_ref) {
|
|
|
1772
1773
|
};
|
|
1773
1774
|
}, [handleResize, handleScroll]); // 初期スクロールを行う
|
|
1774
1775
|
|
|
1775
|
-
|
|
1776
|
+
useIsomorphicLayoutEffect(() => {
|
|
1776
1777
|
if (align !== 'left' || scrollOffset !== 0) {
|
|
1777
1778
|
const scroll = ref.current;
|
|
1778
1779
|
|
|
@@ -1794,7 +1795,7 @@ function Carousel(_ref) {
|
|
|
1794
1795
|
}
|
|
1795
1796
|
}, [onScroll]);
|
|
1796
1797
|
const [disableGradient, setDisableGradient] = useState(false);
|
|
1797
|
-
|
|
1798
|
+
useIsomorphicLayoutEffect(() => {
|
|
1798
1799
|
if (isEdge()) {
|
|
1799
1800
|
setDisableGradient(true);
|
|
1800
1801
|
}
|