@micromag/element-scroll 0.2.401 → 0.2.403
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/es/index.js +8 -8
- package/lib/index.js +11 -11
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
-
import React, { useState, useRef, useEffect } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import { useResizeObserver } from '@micromag/core/hooks';
|
|
7
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
8
3
|
import { faArrowDown } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
-
import {
|
|
4
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
+
import { useResizeObserver } from '@micromag/core/hooks';
|
|
6
|
+
import { useScroll } from '@use-gesture/react';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
10
10
|
|
|
11
11
|
var styles = {"container":"micromag-element-scroll-container","withScroll":"micromag-element-scroll-withScroll","scrollable":"micromag-element-scroll-scrollable","arrowContainer":"micromag-element-scroll-arrowContainer","arrow":"micromag-element-scroll-arrow","upAndDown":"micromag-element-scroll-upAndDown","containOverscroll":"micromag-element-scroll-containOverscroll","top":"micromag-element-scroll-top","scrollee":"micromag-element-scroll-scrollee","middle":"micromag-element-scroll-middle","bottom":"micromag-element-scroll-bottom","withArrow":"micromag-element-scroll-withArrow"};
|
|
12
12
|
|
|
@@ -36,7 +36,7 @@ var defaultProps = {
|
|
|
36
36
|
scrollContainerRef: null
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
function Scroll(_ref) {
|
|
40
40
|
var _ref5;
|
|
41
41
|
|
|
42
42
|
var width = _ref.width,
|
|
@@ -151,7 +151,7 @@ var Scroll = function Scroll(_ref) {
|
|
|
151
151
|
className: styles.arrow,
|
|
152
152
|
icon: faArrowDown
|
|
153
153
|
})) : null);
|
|
154
|
-
}
|
|
154
|
+
}
|
|
155
155
|
|
|
156
156
|
Scroll.propTypes = propTypes;
|
|
157
157
|
Scroll.defaultProps = defaultProps;
|
package/lib/index.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var PropTypes = require('prop-types');
|
|
7
|
-
var classNames = require('classnames');
|
|
8
|
-
var hooks = require('@micromag/core/hooks');
|
|
9
|
-
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
10
5
|
var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
|
|
11
|
-
var
|
|
6
|
+
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
7
|
+
var hooks = require('@micromag/core/hooks');
|
|
8
|
+
var react = require('@use-gesture/react');
|
|
9
|
+
var classNames = require('classnames');
|
|
10
|
+
var PropTypes = require('prop-types');
|
|
11
|
+
var React = require('react');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
14
|
|
|
15
15
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
16
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
17
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
18
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
20
|
|
|
21
21
|
var styles = {"container":"micromag-element-scroll-container","withScroll":"micromag-element-scroll-withScroll","scrollable":"micromag-element-scroll-scrollable","arrowContainer":"micromag-element-scroll-arrowContainer","arrow":"micromag-element-scroll-arrow","upAndDown":"micromag-element-scroll-upAndDown","containOverscroll":"micromag-element-scroll-containOverscroll","top":"micromag-element-scroll-top","scrollee":"micromag-element-scroll-scrollee","middle":"micromag-element-scroll-middle","bottom":"micromag-element-scroll-bottom","withArrow":"micromag-element-scroll-withArrow"};
|
|
22
22
|
|
|
@@ -46,7 +46,7 @@ var defaultProps = {
|
|
|
46
46
|
scrollContainerRef: null
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
function Scroll(_ref) {
|
|
50
50
|
var _ref5;
|
|
51
51
|
|
|
52
52
|
var width = _ref.width,
|
|
@@ -90,7 +90,7 @@ var Scroll = function Scroll(_ref) {
|
|
|
90
90
|
var scrolledBottomOnce = React.useRef(false);
|
|
91
91
|
var scrolledNotBottomOnce = React.useRef(false);
|
|
92
92
|
var reachedBottom = React.useRef(false);
|
|
93
|
-
var bind =
|
|
93
|
+
var bind = react.useScroll(function (_ref4) {
|
|
94
94
|
var _ref4$xy = _slicedToArray__default["default"](_ref4.xy, 2),
|
|
95
95
|
scrollY = _ref4$xy[1];
|
|
96
96
|
|
|
@@ -161,7 +161,7 @@ var Scroll = function Scroll(_ref) {
|
|
|
161
161
|
className: styles.arrow,
|
|
162
162
|
icon: freeSolidSvgIcons.faArrowDown
|
|
163
163
|
})) : null);
|
|
164
|
-
}
|
|
164
|
+
}
|
|
165
165
|
|
|
166
166
|
Scroll.propTypes = propTypes;
|
|
167
167
|
Scroll.defaultProps = defaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-scroll",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.403",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
53
53
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
54
54
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
55
|
-
"@micromag/core": "^0.2.
|
|
55
|
+
"@micromag/core": "^0.2.403",
|
|
56
|
+
"@use-gesture/react": "^10.2.4",
|
|
56
57
|
"classnames": "^2.2.6",
|
|
57
58
|
"lodash": "^4.17.21",
|
|
58
59
|
"prop-types": "^15.7.2",
|
|
59
60
|
"react-intl": "^5.12.1",
|
|
60
|
-
"react-use-gesture": "^9.0.0",
|
|
61
61
|
"uuid": "^8.3.2"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "7a6604651c990286e594350ef730d40772937195"
|
|
67
67
|
}
|