@charcoal-ui/react-sandbox 2.4.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/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/index.cjs +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +5 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +5 -3
- 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
|
@@ -1430,6 +1430,8 @@ function passiveEvents() {
|
|
|
1430
1430
|
}
|
|
1431
1431
|
const isEdge = () => navigator.userAgent.includes('Edge/');
|
|
1432
1432
|
|
|
1433
|
+
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
1434
|
+
|
|
1433
1435
|
function unreachable(value) {
|
|
1434
1436
|
throw new Error(arguments.length === 0 ? 'unreachable' : `unreachable (${JSON.stringify(value)})`);
|
|
1435
1437
|
}
|
|
@@ -1749,7 +1751,7 @@ function Carousel(_ref) {
|
|
|
1749
1751
|
onResize(clientWidth);
|
|
1750
1752
|
}
|
|
1751
1753
|
}, [onResize]);
|
|
1752
|
-
|
|
1754
|
+
useIsomorphicLayoutEffect(() => {
|
|
1753
1755
|
const elm = ref.current;
|
|
1754
1756
|
const innerElm = innerRef.current;
|
|
1755
1757
|
|
|
@@ -1771,7 +1773,7 @@ function Carousel(_ref) {
|
|
|
1771
1773
|
};
|
|
1772
1774
|
}, [handleResize, handleScroll]); // 初期スクロールを行う
|
|
1773
1775
|
|
|
1774
|
-
|
|
1776
|
+
useIsomorphicLayoutEffect(() => {
|
|
1775
1777
|
if (align !== 'left' || scrollOffset !== 0) {
|
|
1776
1778
|
const scroll = ref.current;
|
|
1777
1779
|
|
|
@@ -1793,7 +1795,7 @@ function Carousel(_ref) {
|
|
|
1793
1795
|
}
|
|
1794
1796
|
}, [onScroll]);
|
|
1795
1797
|
const [disableGradient, setDisableGradient] = useState(false);
|
|
1796
|
-
|
|
1798
|
+
useIsomorphicLayoutEffect(() => {
|
|
1797
1799
|
if (isEdge()) {
|
|
1798
1800
|
setDisableGradient(true);
|
|
1799
1801
|
}
|