@micromag/element-scroll 0.3.769 → 0.3.779

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.
Files changed (2) hide show
  1. package/es/index.js +5 -4
  2. package/package.json +3 -3
package/es/index.js CHANGED
@@ -39,7 +39,7 @@ var defaultProps = {
39
39
  scrolleeClassName: null,
40
40
  children: null,
41
41
  scrollPosition: null,
42
- triggers: [0.25, 0.5, 0.75, 1.0],
42
+ triggers: [0.1, 0.25, 0.5, 0.75, 0.9, 1.0],
43
43
  onScrolledTrigger: null,
44
44
  onScrolledBottom: null,
45
45
  onScrolledNotBottom: null,
@@ -93,12 +93,13 @@ function Scroll(_ref) {
93
93
  var newWithArrow = scrollY <= 1;
94
94
  var maxScrollAmount = scrolleeHeight - scrollableHeight;
95
95
  var nowReachedBottom = scrollY + 1 >= maxScrollAmount;
96
- var progress = Math.min(Math.max(scrollY + 1 / maxScrollAmount, 0), 1);
96
+ var progress = Math.min(Math.max((scrollY + 1) / maxScrollAmount, 0), 1);
97
97
  var newTriggersCompleted = (triggers || []).filter(function (step) {
98
98
  return progress >= step && triggersCompletedRef.current.indexOf(step) === -1;
99
99
  });
100
100
  newTriggersCompleted.forEach(function (step) {
101
101
  if (onScrolledTrigger != null) {
102
+ // console.log('call me', step, progress);
102
103
  onScrolledTrigger(step);
103
104
  }
104
105
  });
@@ -194,10 +195,10 @@ function Scroll(_ref) {
194
195
  }
195
196
  Scroll.defaultProps = defaultProps;
196
197
  Scroll.propTypes = propTypes;
197
- var Scroll$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
198
+ var Scroll_default = /*#__PURE__*/React.forwardRef(function (props, ref) {
198
199
  return /*#__PURE__*/React.createElement(Scroll, Object.assign({
199
200
  scrollContainerRef: ref
200
201
  }, props));
201
202
  });
202
203
 
203
- export { Scroll$1 as default };
204
+ export { Scroll_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-scroll",
3
- "version": "0.3.769",
3
+ "version": "0.3.779",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@babel/runtime": "^7.13.10",
62
- "@micromag/core": "^0.3.769",
62
+ "@micromag/core": "^0.3.779",
63
63
  "@use-gesture/react": "^10.3.0",
64
64
  "classnames": "^2.2.6",
65
65
  "lodash": "^4.17.21",
@@ -71,5 +71,5 @@
71
71
  "access": "public",
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
- "gitHead": "a009106ec28c6e34288f0b3292f1bc6826812dd0"
74
+ "gitHead": "5cc7b8fc6d58ba77100060a9d9a4a3f87f835559"
75
75
  }