indicator-ui 0.0.359 → 0.0.361

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/index.js CHANGED
@@ -48277,6 +48277,7 @@ function useBackgroundModalAnim() {
48277
48277
  var obj = ref.current;
48278
48278
  if (obj) {
48279
48279
  obj.style.position = 'fixed';
48280
+ obj.style.visibility = 'hidden';
48280
48281
  }
48281
48282
  }
48282
48283
  function initBackdropObj() {
@@ -48507,6 +48508,7 @@ function useModalAnim() {
48507
48508
  var obj = ref.current;
48508
48509
  if (obj) {
48509
48510
  obj.style.position = 'fixed';
48511
+ obj.style.visibility = 'hidden';
48510
48512
  }
48511
48513
  }
48512
48514
  function initBackdropObj() {
@@ -49439,8 +49441,8 @@ __webpack_require__.r(__webpack_exports__);
49439
49441
  /* harmony export */ });
49440
49442
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
49441
49443
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
49442
- /* harmony import */ var _hooks_useSmartScroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/hooks/useSmartScroll */ "./src/hooks/useSmartScroll/index.ts");
49443
49444
  /* harmony import */ var gsap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gsap */ "./node_modules/gsap/index.js");
49445
+ /* harmony import */ var _useSmartScroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useSmartScroll */ "./src/hooks/useSmartScroll/index.ts");
49444
49446
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
49445
49447
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
49446
49448
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -49459,6 +49461,9 @@ function useScrollIndicators() {
49459
49461
  var ref = args[0],
49460
49462
  _args$ = args[1],
49461
49463
  options = _args$ === void 0 ? {} : _args$;
49464
+ var offBottomEdge = options.offBottomEdge,
49465
+ offTopEdge = options.offTopEdge,
49466
+ wrapperClassName = options.wrapperClassName;
49462
49467
  var wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
49463
49468
  var topEdgeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
49464
49469
  var bottomEdgeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
@@ -49490,9 +49495,10 @@ function useScrollIndicators() {
49490
49495
  return hideEdge(bottomEdgeRef.current);
49491
49496
  });
49492
49497
  };
49493
- var _useSmartScroll = (0,_hooks_useSmartScroll__WEBPACK_IMPORTED_MODULE_1__.useSmartScroll)(ref, {
49498
+ var _useSmartScroll = (0,_useSmartScroll__WEBPACK_IMPORTED_MODULE_1__.useSmartScroll)(ref, {
49494
49499
  onScroll: function onScroll(_ref) {
49495
49500
  var state = _ref.state;
49501
+ console.log(state);
49496
49502
  switch (state) {
49497
49503
  case 'in-middle':
49498
49504
  showTopEdge();
@@ -49531,7 +49537,7 @@ function useScrollIndicators() {
49531
49537
  var wrapper = ((_options$wrapperRef2 = options.wrapperRef) === null || _options$wrapperRef2 === void 0 ? void 0 : _options$wrapperRef2.current) || document.createElement('div');
49532
49538
  wrapper.style.position = 'relative';
49533
49539
  wrapper.style.overflow = 'hidden';
49534
- wrapper.className = options.wrapperClassName;
49540
+ wrapper.className = wrapperClassName;
49535
49541
  if (!hasWrapper()) {
49536
49542
  wrapper.style.width = (container === null || container === void 0 ? void 0 : container.style.width) || '100%';
49537
49543
  wrapper.style.height = (container === null || container === void 0 ? void 0 : container.style.height) || '100%';
@@ -49540,8 +49546,6 @@ function useScrollIndicators() {
49540
49546
  return wrapper;
49541
49547
  };
49542
49548
  var initEdgesState = function initEdgesState() {
49543
- var topEdge = topEdgeRef.current;
49544
- var bottomEdge = bottomEdgeRef.current;
49545
49549
  var scrollState = getScrollCurState();
49546
49550
  if (scrollState) {
49547
49551
  var state = scrollState.state;
@@ -49566,8 +49570,8 @@ function useScrollIndicators() {
49566
49570
  }
49567
49571
  };
49568
49572
  var initEdges = function initEdges() {
49569
- var topEdge = document.createElement('div');
49570
- var bottomEdge = document.createElement('div');
49573
+ var topEdge = offTopEdge ? null : document.createElement('div');
49574
+ var bottomEdge = offBottomEdge ? null : document.createElement('div');
49571
49575
  topEdgeRef.current = topEdge;
49572
49576
  bottomEdgeRef.current = bottomEdge;
49573
49577
  var commonEdgeStyle = {
@@ -49579,14 +49583,18 @@ function useScrollIndicators() {
49579
49583
  pointerEvents: 'none',
49580
49584
  zIndex: '1'
49581
49585
  };
49582
- Object.assign(topEdge.style, commonEdgeStyle, {
49583
- top: '0',
49584
- background: 'linear-gradient(to bottom, rgba(255,255,255,255.2), transparent)'
49585
- });
49586
- Object.assign(bottomEdge.style, commonEdgeStyle, {
49587
- bottom: '0',
49588
- background: 'linear-gradient(to top, rgba(255,255,255,255.2), transparent)'
49589
- });
49586
+ if (topEdge) {
49587
+ Object.assign(topEdge.style, commonEdgeStyle, {
49588
+ top: '0',
49589
+ background: 'linear-gradient(to bottom, rgba(255,255,255,255.2), transparent)'
49590
+ });
49591
+ }
49592
+ if (bottomEdge) {
49593
+ Object.assign(bottomEdge.style, commonEdgeStyle, {
49594
+ bottom: '0',
49595
+ background: 'linear-gradient(to top, rgba(255,255,255,255.2), transparent)'
49596
+ });
49597
+ }
49590
49598
  return {
49591
49599
  topEdge: topEdge,
49592
49600
  bottomEdge: bottomEdge
@@ -49597,8 +49605,12 @@ function useScrollIndicators() {
49597
49605
  var topEdge = topEdgeRef.current;
49598
49606
  var bottomEdge = bottomEdgeRef.current;
49599
49607
  if (wrapper) {
49600
- wrapper.appendChild(topEdge);
49601
- wrapper.appendChild(bottomEdge);
49608
+ if (topEdge) {
49609
+ wrapper.appendChild(topEdge);
49610
+ }
49611
+ if (bottomEdge) {
49612
+ wrapper.appendChild(bottomEdge);
49613
+ }
49602
49614
  }
49603
49615
  };
49604
49616
  var replaceWrapper = function replaceWrapper() {