shineout 3.5.2-beta.9 → 3.5.2

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/cjs/index.js CHANGED
@@ -500,5 +500,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
500
500
  // 此文件由脚本自动生成,请勿直接修改。
501
501
  // This file was generated automatically by a script. Please do not modify it directly.
502
502
  var _default = exports.default = {
503
- version: '3.5.2-beta.9'
503
+ version: '3.5.2'
504
504
  };
package/dist/shineout.js CHANGED
@@ -12002,7 +12002,7 @@ var handleStyle = function handleStyle(style) {
12002
12002
  };
12003
12003
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12004
12004
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12005
- /* harmony default export */ var version = ('3.5.2-beta.9');
12005
+ /* harmony default export */ var version = ('3.5.2');
12006
12006
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12007
12007
 
12008
12008
 
@@ -29026,6 +29026,25 @@ function getClosestScrollContainer(element) {
29026
29026
  // 如果没有找到可滚动的祖先,返回 body 或 documentElement
29027
29027
  return document.scrollingElement || document.documentElement;
29028
29028
  }
29029
+ function getClosestFixedContainer(element) {
29030
+ if (!element) {
29031
+ return null;
29032
+ }
29033
+ var isFixable = function isFixable(el) {
29034
+ var style = window.getComputedStyle(el);
29035
+ return style.position === 'fixed';
29036
+ };
29037
+
29038
+ // 遍历父元素
29039
+ var parent = element.parentElement;
29040
+ while (parent) {
29041
+ if (isFixable(parent)) {
29042
+ return parent;
29043
+ }
29044
+ parent = parent.parentElement;
29045
+ }
29046
+ return null;
29047
+ }
29029
29048
  function cssSupport(attr, value) {
29030
29049
  if (is_isBrowser()) {
29031
29050
  var element = document.createElement('div');
@@ -32925,6 +32944,7 @@ function getUidStr() {
32925
32944
  }
32926
32945
  ;// CONCATENATED MODULE: ../hooks/src/utils/lazyload.ts
32927
32946
 
32947
+
32928
32948
  var lazyload_throttle = 80;
32929
32949
  var components = {};
32930
32950
  var timeout = null;
@@ -32984,10 +33004,12 @@ function removeStack(id, removeListener) {
32984
33004
  function getObserver(obj, id) {
32985
33005
  var _obj$container = obj.container,
32986
33006
  container = _obj$container === void 0 ? null : _obj$container,
33007
+ element = obj.element,
32987
33008
  offset = obj.offset,
32988
33009
  render = obj.render,
32989
33010
  offscreen = obj.offscreen,
32990
33011
  noRemove = obj.noRemove;
33012
+ var fixedContainer = getClosestFixedContainer(element);
32991
33013
  var observer = new IntersectionObserver(function (entries) {
32992
33014
  entries.forEach(function (en) {
32993
33015
  if (en.isIntersecting || en.intersectionRatio > 0) {
@@ -32998,7 +33020,7 @@ function getObserver(obj, id) {
32998
33020
  }
32999
33021
  });
33000
33022
  }, {
33001
- root: container,
33023
+ root: fixedContainer || container,
33002
33024
  rootMargin: "".concat(offset, "px")
33003
33025
  });
33004
33026
  obj.observer = observer;
@@ -37097,7 +37119,8 @@ var Scroll = function Scroll(props) {
37097
37119
  _props$defaultHeight = props.defaultHeight,
37098
37120
  defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
37099
37121
  var _useResize = useResize({
37100
- targetRef: containerRef
37122
+ targetRef: containerRef,
37123
+ timer: 0
37101
37124
  }),
37102
37125
  width = _useResize.width,
37103
37126
  h = _useResize.height;
@@ -66445,7 +66468,7 @@ var upload_interface = __webpack_require__(8821);
66445
66468
 
66446
66469
 
66447
66470
  /* harmony default export */ var src_0 = ({
66448
- version: '3.5.2-beta.9'
66471
+ version: '3.5.2'
66449
66472
  });
66450
66473
  }();
66451
66474
  /******/ return __webpack_exports__;