@xhsreds/reds-rn-next 0.11.1-beta202601131935 → 0.11.1-beta202601151410

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 (49) hide show
  1. package/coverage/.tmp/coverage-0.json +1 -1
  2. package/coverage/.tmp/coverage-1.json +1 -1
  3. package/coverage/.tmp/coverage-10.json +1 -1
  4. package/coverage/.tmp/coverage-11.json +1 -1
  5. package/coverage/.tmp/coverage-12.json +1 -1
  6. package/coverage/.tmp/coverage-13.json +1 -1
  7. package/coverage/.tmp/coverage-14.json +1 -1
  8. package/coverage/.tmp/coverage-15.json +1 -1
  9. package/coverage/.tmp/coverage-16.json +1 -1
  10. package/coverage/.tmp/coverage-18.json +1 -1
  11. package/coverage/.tmp/coverage-2.json +1 -1
  12. package/coverage/.tmp/coverage-21.json +1 -1
  13. package/coverage/.tmp/coverage-23.json +1 -1
  14. package/coverage/.tmp/coverage-24.json +1 -1
  15. package/coverage/.tmp/coverage-29.json +1 -1
  16. package/coverage/.tmp/coverage-3.json +1 -1
  17. package/coverage/.tmp/coverage-30.json +1 -1
  18. package/coverage/.tmp/coverage-31.json +1 -1
  19. package/coverage/.tmp/coverage-33.json +1 -1
  20. package/coverage/.tmp/coverage-34.json +1 -1
  21. package/coverage/.tmp/coverage-35.json +1 -1
  22. package/coverage/.tmp/coverage-37.json +1 -1
  23. package/coverage/.tmp/coverage-38.json +1 -1
  24. package/coverage/.tmp/coverage-39.json +1 -1
  25. package/coverage/.tmp/coverage-4.json +1 -1
  26. package/coverage/.tmp/coverage-40.json +1 -1
  27. package/coverage/.tmp/coverage-41.json +1 -1
  28. package/coverage/.tmp/coverage-42.json +1 -1
  29. package/coverage/.tmp/coverage-43.json +1 -1
  30. package/coverage/.tmp/coverage-5.json +1 -1
  31. package/coverage/.tmp/coverage-6.json +1 -1
  32. package/coverage/.tmp/coverage-7.json +1 -1
  33. package/coverage/.tmp/coverage-8.json +1 -1
  34. package/coverage/.tmp/coverage-9.json +1 -1
  35. package/lib/cjs/components/PullRefresh/PullRefresh.js +32 -7
  36. package/lib/cjs/components/PullRefresh/PullRefresh.js.map +1 -1
  37. package/lib/cjs/components/PullRefresh/RefreshControl.js +4 -6
  38. package/lib/cjs/components/PullRefresh/RefreshControl.js.map +1 -1
  39. package/lib/esm/components/PullRefresh/PullRefresh.js +32 -7
  40. package/lib/esm/components/PullRefresh/PullRefresh.js.map +1 -1
  41. package/lib/esm/components/PullRefresh/RefreshControl.js +4 -6
  42. package/lib/esm/components/PullRefresh/RefreshControl.js.map +1 -1
  43. package/lib/src/components/PullRefresh/RefreshControl.d.ts +2 -2
  44. package/lib/types/components/PullRefresh/RefreshControl.d.ts +2 -2
  45. package/package.json +2 -2
  46. package/src/components/PullRefresh/PullRefresh.tsx +26 -4
  47. package/src/components/PullRefresh/RefreshControl.tsx +3 -4
  48. package/src/i18n/@types/resources.d.ts +27 -27
  49. package/src/i18n/index.json +31 -31
@@ -1,7 +1,7 @@
1
+ import { a as _objectSpread2 } from '../../_chunks/BcGvf0Pc.js';
1
2
  import React from 'react';
2
3
  import { RefreshControl, View } from 'react-native';
3
4
  import ProgressIndicator from '../ProgressIndicator/ProgressIndicator.js';
4
- import '../../_chunks/BcGvf0Pc.js';
5
5
  import '../../_chunks/B_AP2PTq.js';
6
6
  import '../ProgressIndicator/lottie/getLottieSource.js';
7
7
  import '../ProgressIndicator/lottie/index.js';
@@ -31,7 +31,7 @@ var IOSRefreshControl = function IOSRefreshControl(_ref) {
31
31
  var onRefresh = _ref.onRefresh,
32
32
  refreshing = _ref.refreshing,
33
33
  progressViewOffset = _ref.progressViewOffset,
34
- colors = _ref.colors;
34
+ style = _ref.style;
35
35
  return /* @__PURE__ */React.createElement(RefreshControl, {
36
36
  refreshing: refreshing,
37
37
  onRefresh: onRefresh,
@@ -39,10 +39,9 @@ var IOSRefreshControl = function IOSRefreshControl(_ref) {
39
39
  style: {
40
40
  backgroundColor: "transparent"
41
41
  },
42
- colors: colors,
43
42
  tintColor: "transparent"
44
43
  }, refreshing && /* @__PURE__ */React.createElement(View, {
45
- style: {
44
+ style: _objectSpread2({
46
45
  position: "absolute",
47
46
  top: 0,
48
47
  left: 0,
@@ -50,9 +49,8 @@ var IOSRefreshControl = function IOSRefreshControl(_ref) {
50
49
  zIndex: 1e3,
51
50
  alignItems: "center",
52
51
  width: "100%",
53
- backgroundColor: "transparent",
54
52
  justifyContent: "center"
55
- }
53
+ }, style)
56
54
  }, /* @__PURE__ */React.createElement(ProgressIndicator, {
57
55
  type: "refresh",
58
56
  size: 36
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshControl.js","sources":["../../../../src/components/PullRefresh/RefreshControl.tsx"],"sourcesContent":["import React from \"react\";\nimport { View, RefreshControl as RNRefreshControl } from \"react-native\";\nimport { ProgressIndicator } from \"../ProgressIndicator\";\n\ninterface IOSRefreshControlProps {\n onRefresh: () => void;\n refreshing: boolean;\n progressViewOffset?: number;\n height?: number;\n colors?: string[];\n}\nconst IOSRefreshControl = ({ onRefresh, refreshing, progressViewOffset, colors }: IOSRefreshControlProps) => {\n return (\n <RNRefreshControl\n refreshing={refreshing}\n onRefresh={onRefresh}\n progressViewOffset={progressViewOffset}\n style={{ backgroundColor: \"transparent\" }}\n colors={colors}\n tintColor=\"transparent\" // 隐藏原生指示器\n >\n {refreshing && (\n <View\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: 1000,\n alignItems: \"center\",\n width: \"100%\",\n backgroundColor: \"transparent\",\n justifyContent: \"center\",\n }}\n >\n <ProgressIndicator type={\"refresh\"} size={36} />\n </View>\n )}\n </RNRefreshControl>\n );\n};\n\nexport default IOSRefreshControl;\n"],"names":["IOSRefreshControl","onRefresh","refreshing","_ref","progressViewOffset","colors","React","createElement","RNRefreshControl","style","backgroundColor","tintColor","View","position","top","left","right","zIndex","alignItems","width","justifyContent","ProgressIndicator","type","size"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,oBAAoB,SAApBA,wBAAuG;AAAA,EAAA,IAAhFC,iBAAAA;IAAWC,UAAY,GAAAC,IAAA,CAAZD,UAAY;IAAAE,kBAAA,GAAAD,IAAA,CAAAC,kBAAA;IAAoBC,cAAAA;AAEpE,EAAA,sBAAAC,KAAA,CAAAC,aAAA,CAACC,cAAA,EAAA;AACCN,IAAAA,UAAA,EAAAA,UAAA;AACAD,IAAAA,SAAA,EAAAA,SAAA;AACAG,IAAAA,kBAAA,EAAAA,kBAAA;AACAK,IAAAA,KAAA,EAAO;AAAEC,MAAAA,eAAA,EAAiB,aAAA;KAAc;AACxCL,IAAAA,MAAA,EAAAA,MAAA;AACAM,IAAAA,SAAU,EAAA,aAAA;GAAA,EAETT,UACC,mBAAAI,KAAA,CAAAC,aAAA,CAACK,IAAA,EAAA;AACCH,IAAAA,KAAO,EAAA;AACLI,MAAAA,QAAU,EAAA,UAAA;AACVC,MAAAA,GAAK,EAAA,CAAA;AACLC,MAAAA,IAAM,EAAA,CAAA;AACNC,MAAAA,KAAO,EAAA,CAAA;AACPC,MAAAA,MAAQ,EAAA,GAAA;AACRC,MAAAA,UAAY,EAAA,QAAA;AACZC,MAAAA,KAAO,EAAA,MAAA;AACPT,MAAAA,eAAiB,EAAA,aAAA;AACjBU,MAAAA,cAAgB,EAAA,QAAA;AAClB,KAAA;AAAA,GAAA,iBAECd,KAAA,CAAAC,aAAA,CAAAc,iBAAA,EAAA;AAAkBC,IAAAA,IAAM,EAAA,SAAA;AAAWC,IAAAA,MAAM,EAAA;GAAI,CAChD,CAEJ,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"RefreshControl.js","sources":["../../../../src/components/PullRefresh/RefreshControl.tsx"],"sourcesContent":["import React from \"react\";\nimport { View, RefreshControl as RNRefreshControl } from \"react-native\";\nimport { ProgressIndicator } from \"../ProgressIndicator\";\n\ninterface IOSRefreshControlProps {\n onRefresh: () => void;\n refreshing: boolean;\n progressViewOffset?: number;\n height?: number;\n style?: any;\n}\nconst IOSRefreshControl = ({ onRefresh, refreshing, progressViewOffset, style }: IOSRefreshControlProps) => {\n return (\n <RNRefreshControl\n refreshing={refreshing}\n onRefresh={onRefresh}\n progressViewOffset={progressViewOffset}\n style={{ backgroundColor: \"transparent\" }}\n tintColor=\"transparent\" // 隐藏原生指示器\n >\n {refreshing && (\n <View\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: 1000,\n alignItems: \"center\",\n width: \"100%\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ProgressIndicator type={\"refresh\"} size={36} />\n </View>\n )}\n </RNRefreshControl>\n );\n};\n\nexport default IOSRefreshControl;\n"],"names":["IOSRefreshControl","onRefresh","refreshing","_ref","progressViewOffset","style","React","createElement","RNRefreshControl","backgroundColor","tintColor","View","_objectSpread","position","top","left","right","zIndex","alignItems","width","justifyContent","ProgressIndicator","type","size"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,oBAAoB,SAApBA,wBAAsG;AAAA,EAAA,IAA/EC,iBAAAA;IAAWC,UAAY,GAAAC,IAAA,CAAZD,UAAY;IAAAE,kBAAA,GAAAD,IAAA,CAAAC,kBAAA;IAAoBC,aAAAA;AAEpE,EAAA,sBAAAC,KAAA,CAAAC,aAAA,CAACC,cAAA,EAAA;AACCN,IAAAA,UAAA,EAAAA,UAAA;AACAD,IAAAA,SAAA,EAAAA,SAAA;AACAG,IAAAA,kBAAA,EAAAA,kBAAA;AACAC,IAAAA,KAAA,EAAO;AAAEI,MAAAA,eAAA,EAAiB,aAAA;KAAc;AACxCC,IAAAA,SAAU,EAAA,aAAA;GAAA,EAETR,UACC,mBAAAI,KAAA,CAAAC,aAAA,CAACI,IAAA,EAAA;AACCN,IAAAA,KAAO,EAAAO,cAAA,CAAA;AACLC,MAAAA,QAAU,EAAA,UAAA;AACVC,MAAAA,GAAK,EAAA,CAAA;AACLC,MAAAA,IAAM,EAAA,CAAA;AACNC,MAAAA,KAAO,EAAA,CAAA;AACPC,MAAAA,MAAQ,EAAA,GAAA;AACRC,MAAAA,UAAY,EAAA,QAAA;AACZC,MAAAA,KAAO,EAAA,MAAA;AACPC,MAAAA,cAAgB,EAAA,QAAA;AAAA,KAAA,EACbf,KAAA,CAAA;AACL,GAAA,iBAECC,KAAA,CAAAC,aAAA,CAAAc,iBAAA,EAAA;AAAkBC,IAAAA,IAAM,EAAA,SAAA;AAAWC,IAAAA,MAAM,EAAA;GAAI,CAChD,CAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -4,7 +4,7 @@ interface IOSRefreshControlProps {
4
4
  refreshing: boolean;
5
5
  progressViewOffset?: number;
6
6
  height?: number;
7
- colors?: string[];
7
+ style?: any;
8
8
  }
9
- declare const IOSRefreshControl: ({ onRefresh, refreshing, progressViewOffset, colors }: IOSRefreshControlProps) => React.JSX.Element;
9
+ declare const IOSRefreshControl: ({ onRefresh, refreshing, progressViewOffset, style }: IOSRefreshControlProps) => React.JSX.Element;
10
10
  export default IOSRefreshControl;
@@ -4,7 +4,7 @@ interface IOSRefreshControlProps {
4
4
  refreshing: boolean;
5
5
  progressViewOffset?: number;
6
6
  height?: number;
7
- colors?: string[];
7
+ style?: any;
8
8
  }
9
- declare const IOSRefreshControl: ({ onRefresh, refreshing, progressViewOffset, colors }: IOSRefreshControlProps) => React.JSX.Element;
9
+ declare const IOSRefreshControl: ({ onRefresh, refreshing, progressViewOffset, style }: IOSRefreshControlProps) => React.JSX.Element;
10
10
  export default IOSRefreshControl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xhsreds/reds-rn-next",
3
- "version": "0.11.1-beta202601131935",
3
+ "version": "0.11.1-beta202601151410",
4
4
  "author": "贾斌(呀哈) <jiabin@xiaohongshu.com>",
5
5
  "license": "ISC",
6
6
  "dependencies": {
@@ -27,7 +27,7 @@
27
27
  "react-native-svg": "13.14.0",
28
28
  "@xhs/react-native-harmony": "*",
29
29
  "@xhs/reds-components": "*",
30
- "@xhsreds/reds-token-next": "0.11.1-beta202601131935"
30
+ "@xhsreds/reds-token-next": "0.11.1-beta202601151410"
31
31
  },
32
32
  "peerDependenciesMeta": {
33
33
  "ozone-schema-web": {
@@ -194,10 +194,8 @@ export default function PullRefresh(props: RedsPullRefresh) {
194
194
  }
195
195
  setAnimation(animation);
196
196
  animation.start(({ finished }: { finished: boolean }) => {
197
- if (finished) {
198
- cb && cb();
199
- setAnimation(undefined);
200
- }
197
+ cb && cb();
198
+ setAnimation(undefined);
201
199
  });
202
200
  };
203
201
 
@@ -341,6 +339,30 @@ export default function PullRefresh(props: RedsPullRefresh) {
341
339
  updatePullState(PullState.FINISH);
342
340
  }, props?.msHoldingTime ?? 1000),
343
341
  );
342
+ setIsRefreshing(false);
343
+ }
344
+ // 滚动结束了但是还有下拉距离
345
+ if (effectiveRefreshing === false && pullState === PullState.FINISH) {
346
+ console.log("滚动结束了但是还有下拉距离");
347
+ setIsPulling(false);
348
+ updatePullState(PullState.HOLDING);
349
+ setPullTimeout(
350
+ //@ts-ignore
351
+ setTimeout(() => {
352
+ pan.flattenOffset();
353
+ setMoveHeight(0);
354
+ setMovePercent(0);
355
+ props.onPullProgress?.({ distance: 0, percent: 0 });
356
+ lastMoveHeightRef.current = 0;
357
+ animatedTo(0, () => {
358
+ setIsPulling(false);
359
+ updatePullState(PullState.INIT);
360
+ pan.setValue(0);
361
+ pan.flattenOffset();
362
+ });
363
+ updatePullState(PullState.FINISH);
364
+ }, props?.msHoldingTime ?? 1000),
365
+ );
344
366
 
345
367
  setIsRefreshing(false);
346
368
  }
@@ -7,16 +7,15 @@ interface IOSRefreshControlProps {
7
7
  refreshing: boolean;
8
8
  progressViewOffset?: number;
9
9
  height?: number;
10
- colors?: string[];
10
+ style?: any;
11
11
  }
12
- const IOSRefreshControl = ({ onRefresh, refreshing, progressViewOffset, colors }: IOSRefreshControlProps) => {
12
+ const IOSRefreshControl = ({ onRefresh, refreshing, progressViewOffset, style }: IOSRefreshControlProps) => {
13
13
  return (
14
14
  <RNRefreshControl
15
15
  refreshing={refreshing}
16
16
  onRefresh={onRefresh}
17
17
  progressViewOffset={progressViewOffset}
18
18
  style={{ backgroundColor: "transparent" }}
19
- colors={colors}
20
19
  tintColor="transparent" // 隐藏原生指示器
21
20
  >
22
21
  {refreshing && (
@@ -29,8 +28,8 @@ const IOSRefreshControl = ({ onRefresh, refreshing, progressViewOffset, colors }
29
28
  zIndex: 1000,
30
29
  alignItems: "center",
31
30
  width: "100%",
32
- backgroundColor: "transparent",
33
31
  justifyContent: "center",
32
+ ...style,
34
33
  }}
35
34
  >
36
35
  <ProgressIndicator type={"refresh"} size={36} />
@@ -1,32 +1,32 @@
1
1
  interface Resources {
2
2
  componentKey: {
3
- sureKey: "Confirm";
4
- satisfyKey: "Satisfy";
5
- confirmKey: "Confirm";
6
- uploadingKey: "Uploading";
7
- resetKey: "Reset";
8
- NoDataKey: "No data available at the moment";
9
- liveStreamingKey: "live";
10
- generallyKey: "Generally";
11
- uploadFailedKey: "Upload failed";
12
- submitKey: "Submit";
13
- requestSuccessfulKey: "Request successful";
14
- cancelKey: "Cancel";
15
- PullDownToRefreshKey: "Pull down to refresh";
16
- selectAllKey: "SelectAll";
17
- requestDataKey: "Request data";
18
- closeKey: "Close";
19
- veryBadKey: "Very bad";
20
- searchKey: "Search";
21
- expandKey: "Expand";
22
- IDCardPhotoKey: "ID card photo";
23
- finishKey: "Finish";
24
- surpriseKey: "Surprise";
25
- releaseRefreshKey: "Release refresh";
26
- nationalEmblemSideOfIDCardKey: "National emblem side of ID card";
27
- buttonKey: "Button";
28
- jumpKey: "Jump";
29
- disappointmentKey: "Disappointment";
3
+ sureKey: "確定";
4
+ satisfyKey: "滿意";
5
+ confirmKey: "確認";
6
+ uploadingKey: "上傳中";
7
+ resetKey: "重置";
8
+ NoDataKey: "暫無數據";
9
+ liveStreamingKey: "直播";
10
+ generallyKey: "一般";
11
+ uploadFailedKey: "上傳失敗";
12
+ submitKey: "提交";
13
+ requestSuccessfulKey: "請求成功";
14
+ cancelKey: "取消";
15
+ PullDownToRefreshKey: "下拉重繪";
16
+ selectAllKey: "全選";
17
+ requestDataKey: "請求數據中";
18
+ closeKey: "收起";
19
+ veryBadKey: "極差";
20
+ searchKey: "蒐索";
21
+ expandKey: "展開";
22
+ IDCardPhotoKey: "身份證人像面";
23
+ finishKey: "完成";
24
+ surpriseKey: "驚喜";
25
+ releaseRefreshKey: "鬆開重繪";
26
+ nationalEmblemSideOfIDCardKey: "身份证国徽面";
27
+ buttonKey: "按鈕";
28
+ jumpKey: "跳轉";
29
+ disappointmentKey: "失望";
30
30
  };
31
31
  }
32
32
  export default Resources;
@@ -1,4 +1,35 @@
1
1
  {
2
+ "zh_tw": {
3
+ "componentKey": {
4
+ "sureKey": "確定",
5
+ "satisfyKey": "滿意",
6
+ "confirmKey": "確認",
7
+ "uploadingKey": "上傳中",
8
+ "resetKey": "重置",
9
+ "NoDataKey": "暫無數據",
10
+ "liveStreamingKey": "直播",
11
+ "generallyKey": "一般",
12
+ "uploadFailedKey": "上傳失敗",
13
+ "submitKey": "提交",
14
+ "requestSuccessfulKey": "請求成功",
15
+ "cancelKey": "取消",
16
+ "PullDownToRefreshKey": "下拉重繪",
17
+ "selectAllKey": "全選",
18
+ "requestDataKey": "請求數據中",
19
+ "closeKey": "收起",
20
+ "veryBadKey": "極差",
21
+ "searchKey": "蒐索",
22
+ "expandKey": "展開",
23
+ "IDCardPhotoKey": "身份證人像面",
24
+ "finishKey": "完成",
25
+ "surpriseKey": "驚喜",
26
+ "releaseRefreshKey": "鬆開重繪",
27
+ "nationalEmblemSideOfIDCardKey": "身份证国徽面",
28
+ "buttonKey": "按鈕",
29
+ "jumpKey": "跳轉",
30
+ "disappointmentKey": "失望"
31
+ }
32
+ },
2
33
  "en_us": {
3
34
  "componentKey": {
4
35
  "sureKey": "Confirm",
@@ -60,36 +91,5 @@
60
91
  "jumpKey": "跳转",
61
92
  "disappointmentKey": "失望"
62
93
  }
63
- },
64
- "zh_tw": {
65
- "componentKey": {
66
- "sureKey": "確定",
67
- "satisfyKey": "滿意",
68
- "confirmKey": "確認",
69
- "uploadingKey": "上傳中",
70
- "resetKey": "重置",
71
- "NoDataKey": "暫無數據",
72
- "liveStreamingKey": "直播",
73
- "generallyKey": "一般",
74
- "uploadFailedKey": "上傳失敗",
75
- "submitKey": "提交",
76
- "requestSuccessfulKey": "請求成功",
77
- "cancelKey": "取消",
78
- "PullDownToRefreshKey": "下拉重繪",
79
- "selectAllKey": "全選",
80
- "requestDataKey": "請求數據中",
81
- "closeKey": "收起",
82
- "veryBadKey": "極差",
83
- "searchKey": "蒐索",
84
- "expandKey": "展開",
85
- "IDCardPhotoKey": "身份證人像面",
86
- "finishKey": "完成",
87
- "surpriseKey": "驚喜",
88
- "releaseRefreshKey": "鬆開重繪",
89
- "nationalEmblemSideOfIDCardKey": "身份证国徽面",
90
- "buttonKey": "按鈕",
91
- "jumpKey": "跳轉",
92
- "disappointmentKey": "失望"
93
- }
94
94
  }
95
95
  }