ronds-metadata 1.3.44 → 1.3.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,13 +2,14 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  /*
3
3
  * @Author: wangxian
4
4
  * @Date: 2022-06-24 08:44:41
5
- * @LastEditTime: 2022-06-24 16:25:38
5
+ * @LastEditTime: 2024-05-27 19:14:55
6
6
  */
7
7
  import React from 'react';
8
8
  function syncScroll(target, others, TopLeft, WidthHeight) {
9
9
  var percentage = target["scroll".concat(TopLeft)] / (target["scroll".concat(WidthHeight)] - target["offset".concat(WidthHeight)]);
10
10
  window.requestAnimationFrame(function () {
11
11
  others.forEach(function (el) {
12
+ if (!el) return;
12
13
  el["scroll".concat(TopLeft)] = Math.round(percentage * (el["scroll".concat(WidthHeight)] - el["offset".concat(WidthHeight)]));
13
14
  });
14
15
  });
@@ -70,14 +71,14 @@ export function useSyncScrollByRefs(refsRef, _ref3) {
70
71
  }
71
72
  locksRef.current = refsRef.current.length - 1;
72
73
  var others = refsRef.current.reduce(function (result, ref) {
73
- if (ref.current && ref.current !== target) result.push(ref.current);
74
+ if (ref && ref !== target) result.push(ref);
74
75
  return result;
75
76
  }, []);
76
77
  if (vertical) syncVerticalScroll(target, others);
77
78
  if (horizontal) syncHorizontalScroll(target, others);
78
79
  }
79
80
  var elements = refsRef.current.reduce(function (result, ref) {
80
- if (ref.current) result.push(ref.current);
81
+ if (ref) result.push(ref);
81
82
  return result;
82
83
  }, []);
83
84
  elements.forEach(function (el) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.3.44",
4
+ "version": "1.3.46",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",