@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.
@@ -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 || function (target) {
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
- useLayoutEffect(() => {
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
- useLayoutEffect(() => {
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
- useLayoutEffect(() => {
1798
+ useIsomorphicLayoutEffect(() => {
1798
1799
  if (isEdge()) {
1799
1800
  setDisableGradient(true);
1800
1801
  }