deepsea-components 5.0.7 → 5.1.0

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 (33) hide show
  1. package/dist/cjs/components/InfiniteScroll.d.ts +29 -0
  2. package/dist/cjs/components/InfiniteScroll.js +116 -0
  3. package/dist/cjs/components/InfiniteScroll.js.map +7 -0
  4. package/dist/cjs/index.d.ts +1 -0
  5. package/dist/cjs/index.js +2 -0
  6. package/dist/cjs/index.js.map +2 -2
  7. package/dist/esm/components/AutoFit.d.ts.map +1 -0
  8. package/dist/esm/components/AutoScroll.d.ts.map +1 -0
  9. package/dist/esm/components/AutoSizeTextarea.d.ts.map +1 -0
  10. package/dist/esm/components/CircleText.d.ts.map +1 -0
  11. package/dist/esm/components/Flow.d.ts.map +1 -0
  12. package/dist/esm/components/HlsPlayer.d.ts.map +1 -0
  13. package/dist/esm/components/InfiniteScroll.d.ts +29 -0
  14. package/dist/esm/components/InfiniteScroll.d.ts.map +1 -0
  15. package/dist/esm/components/InfiniteScroll.js +83 -0
  16. package/dist/esm/components/InfiniteScroll.js.map +1 -0
  17. package/dist/esm/components/InputFile.d.ts.map +1 -0
  18. package/dist/esm/components/LoopSwiper.d.ts.map +1 -0
  19. package/dist/esm/components/Ring.d.ts.map +1 -0
  20. package/dist/esm/components/Scroll.d.ts.map +1 -0
  21. package/dist/esm/components/SectionRing.d.ts.map +1 -0
  22. package/dist/esm/components/Skeleton.d.ts.map +1 -0
  23. package/dist/esm/components/TransitionBox.d.ts.map +1 -0
  24. package/dist/esm/components/TransitionNum.d.ts.map +1 -0
  25. package/dist/esm/components/Trapezium.d.ts.map +1 -0
  26. package/dist/esm/index.d.ts +1 -0
  27. package/dist/esm/index.d.ts.map +1 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/utils/index.d.ts.map +1 -0
  31. package/package.json +1 -1
  32. package/src/components/InfiniteScroll.tsx +115 -0
  33. package/src/index.tsx +1 -0
@@ -0,0 +1,29 @@
1
+ import { ComponentProps, CSSProperties } from "react";
2
+ export type InfiniteScrollProps = ComponentProps<"div"> & {
3
+ /**
4
+ * 滚动的方向
5
+ * @default "vertical"
6
+ */
7
+ direction?: "vertical" | "horizontal";
8
+ /** 渲染 children 的容器的类名 */
9
+ containerClassName?: string;
10
+ /** 渲染 children 的容器的样式 */
11
+ containerStyle?: CSSProperties;
12
+ /**
13
+ * 两个 children 容器之间的间距
14
+ * @default 0
15
+ */
16
+ gap?: number;
17
+ /** 一个周期的时间,单位:毫秒 */
18
+ duration: number;
19
+ /** 是否将 gap 的距离也加入 overflow 的计算 */
20
+ withGap?: boolean;
21
+ /** 尺寸刚好相同时,是否视为溢出 */
22
+ withEqual?: boolean;
23
+ };
24
+ /**
25
+ * 无限滚动的组件
26
+ * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果
27
+ * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画
28
+ */
29
+ export declare const InfiniteScroll: import("react").ForwardRefExoticComponent<Omit<InfiniteScrollProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,116 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/InfiniteScroll.tsx
20
+ var InfiniteScroll_exports = {};
21
+ __export(InfiniteScroll_exports, {
22
+ InfiniteScroll: () => InfiniteScroll
23
+ });
24
+ module.exports = __toCommonJS(InfiniteScroll_exports);
25
+ var import_css = require("@emotion/css");
26
+ var import_ahooks = require("ahooks");
27
+ var import_deepsea_tools = require("deepsea-tools");
28
+ var import_react = require("react");
29
+ var InfiniteScroll = (0, import_react.forwardRef)((props, ref) => {
30
+ const { className, direction = "vertical", children, containerClassName, containerStyle, gap = 0, duration, withGap, withEqual, ...rest } = props;
31
+ const wrapper = (0, import_react.useRef)(null);
32
+ const wrapperSize = (0, import_ahooks.useSize)(wrapper);
33
+ const ele = (0, import_react.useRef)(null);
34
+ (0, import_react.useImperativeHandle)(ref, () => wrapper.current, [wrapper.current]);
35
+ const container = (0, import_react.useRef)(null);
36
+ const containerSize = (0, import_ahooks.useSize)(container);
37
+ function bigger(containerSize2, wrapperSize2) {
38
+ return withEqual ? containerSize2 + (withGap ? gap : 0) >= wrapperSize2 : containerSize2 + (withGap ? gap : 0) > wrapperSize2;
39
+ }
40
+ const overflow = wrapperSize && containerSize ? direction === "vertical" ? bigger(containerSize.height, wrapperSize.height) : bigger(containerSize.width, wrapperSize.width) : false;
41
+ (0, import_react.useEffect)(() => {
42
+ if (!wrapperSize || !containerSize || !overflow)
43
+ return;
44
+ const animation = ele.current?.animate(
45
+ {
46
+ transform: direction === "vertical" ? [`translateY(0)`, `translateY(-${containerSize.height + gap}px)`] : [`translateX(0)`, `translateX(-${containerSize.width + gap}px)`]
47
+ },
48
+ { duration, iterations: Infinity }
49
+ );
50
+ return () => animation?.cancel();
51
+ }, [wrapperSize, containerSize, overflow, direction, duration]);
52
+ return /* @__PURE__ */ React.createElement(
53
+ "div",
54
+ {
55
+ ref: wrapper,
56
+ className: (0, import_deepsea_tools.clsx)(
57
+ import_css.css`
58
+ position: relative;
59
+ overflow: hidden;
60
+ `,
61
+ className
62
+ ),
63
+ ...rest
64
+ },
65
+ /* @__PURE__ */ React.createElement(
66
+ "div",
67
+ {
68
+ ref: ele,
69
+ style: {
70
+ position: "absolute",
71
+ width: direction === "vertical" ? "100%" : containerSize && (overflow ? containerSize.width * 2 + gap : containerSize.width),
72
+ height: direction === "horizontal" ? "100%" : containerSize && (overflow ? containerSize.height * 2 + gap : containerSize.width)
73
+ }
74
+ },
75
+ /* @__PURE__ */ React.createElement(
76
+ "div",
77
+ {
78
+ ref: container,
79
+ className: (0, import_deepsea_tools.clsx)(
80
+ import_css.css`
81
+ position: absolute;
82
+ left: 0;
83
+ top: 0;
84
+ ${direction === "vertical" ? "width: 100%;" : "height: 100%;"}
85
+ `,
86
+ containerClassName
87
+ ),
88
+ style: containerStyle
89
+ },
90
+ children
91
+ ),
92
+ overflow && /* @__PURE__ */ React.createElement(
93
+ "div",
94
+ {
95
+ ref: container,
96
+ className: (0, import_deepsea_tools.clsx)(
97
+ import_css.css`
98
+ position: absolute;
99
+ right: 0;
100
+ bottom: 0;
101
+ ${direction === "vertical" ? "width: 100%;" : "height: 100%;"}
102
+ `,
103
+ containerClassName
104
+ ),
105
+ style: containerStyle
106
+ },
107
+ children
108
+ )
109
+ )
110
+ );
111
+ });
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ InfiniteScroll
115
+ });
116
+ //# sourceMappingURL=InfiniteScroll.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/InfiniteScroll.tsx"],
4
+ "sourcesContent": ["import { css } from \"@emotion/css\"\r\nimport { useSize } from \"ahooks\"\r\nimport { clsx } from \"deepsea-tools\"\r\nimport { ComponentProps, CSSProperties, forwardRef, useEffect, useImperativeHandle, useRef } from \"react\"\r\n\r\nexport type InfiniteScrollProps = ComponentProps<\"div\"> & {\r\n /**\r\n * 滚动的方向\r\n * @default \"vertical\"\r\n */\r\n direction?: \"vertical\" | \"horizontal\"\r\n /** 渲染 children 的容器的类名 */\r\n containerClassName?: string\r\n /** 渲染 children 的容器的样式 */\r\n containerStyle?: CSSProperties\r\n /**\r\n * 两个 children 容器之间的间距\r\n * @default 0\r\n */\r\n gap?: number\r\n /** 一个周期的时间,单位:毫秒 */\r\n duration: number\r\n /** 是否将 gap 的距离也加入 overflow 的计算 */\r\n withGap?: boolean\r\n /** 尺寸刚好相同时,是否视为溢出 */\r\n withEqual?: boolean\r\n}\r\n\r\n/**\r\n * 无限滚动的组件\r\n * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果\r\n * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画\r\n */\r\nexport const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((props, ref) => {\r\n const { className, direction = \"vertical\", children, containerClassName, containerStyle, gap = 0, duration, withGap, withEqual, ...rest } = props\r\n\r\n const wrapper = useRef<HTMLDivElement>(null)\r\n const wrapperSize = useSize(wrapper)\r\n\r\n const ele = useRef<HTMLDivElement>(null)\r\n\r\n useImperativeHandle(ref, () => wrapper.current as HTMLDivElement, [wrapper.current])\r\n\r\n const container = useRef<HTMLDivElement>(null)\r\n const containerSize = useSize(container)\r\n\r\n function bigger(containerSize: number, wrapperSize: number) {\r\n return withEqual ? containerSize + (withGap ? gap : 0) >= wrapperSize : containerSize + (withGap ? gap : 0) > wrapperSize\r\n }\r\n\r\n const overflow = wrapperSize && containerSize ? (direction === \"vertical\" ? bigger(containerSize.height, wrapperSize.height) : bigger(containerSize.width, wrapperSize.width)) : false\r\n\r\n useEffect(() => {\r\n if (!wrapperSize || !containerSize || !overflow) return\r\n const animation = ele.current?.animate(\r\n {\r\n transform: direction === \"vertical\" ? [`translateY(0)`, `translateY(-${containerSize.height + gap}px)`] : [`translateX(0)`, `translateX(-${containerSize.width + gap}px)`]\r\n },\r\n { duration, iterations: Infinity }\r\n )\r\n return () => animation?.cancel()\r\n }, [wrapperSize, containerSize, overflow, direction, duration])\r\n\r\n return (\r\n <div\r\n ref={wrapper}\r\n className={clsx(\r\n css`\r\n position: relative;\r\n overflow: hidden;\r\n `,\r\n className\r\n )}\r\n {...rest}>\r\n <div\r\n ref={ele}\r\n style={{\r\n position: \"absolute\",\r\n width: direction === \"vertical\" ? \"100%\" : containerSize && (overflow ? containerSize.width * 2 + gap : containerSize.width),\r\n height: direction === \"horizontal\" ? \"100%\" : containerSize && (overflow ? containerSize.height * 2 + gap : containerSize.width)\r\n }}>\r\n <div\r\n ref={container}\r\n className={clsx(\r\n css`\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n ${direction === \"vertical\" ? \"width: 100%;\" : \"height: 100%;\"}\r\n `,\r\n containerClassName\r\n )}\r\n style={containerStyle}>\r\n {children}\r\n </div>\r\n {overflow && (\r\n <div\r\n ref={container}\r\n className={clsx(\r\n css`\r\n position: absolute;\r\n right: 0;\r\n bottom: 0;\r\n ${direction === \"vertical\" ? \"width: 100%;\" : \"height: 100%;\"}\r\n `,\r\n containerClassName\r\n )}\r\n style={containerStyle}>\r\n {children}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n )\r\n})\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAoB;AACpB,oBAAwB;AACxB,2BAAqB;AACrB,mBAAkG;AA8B3F,IAAM,qBAAiB,yBAAgD,CAAC,OAAO,QAAQ;AAC1F,QAAM,EAAE,WAAW,YAAY,YAAY,UAAU,oBAAoB,gBAAgB,MAAM,GAAG,UAAU,SAAS,WAAW,GAAG,KAAK,IAAI;AAE5I,QAAM,cAAU,qBAAuB,IAAI;AAC3C,QAAM,kBAAc,uBAAQ,OAAO;AAEnC,QAAM,UAAM,qBAAuB,IAAI;AAEvC,wCAAoB,KAAK,MAAM,QAAQ,SAA2B,CAAC,QAAQ,OAAO,CAAC;AAEnF,QAAM,gBAAY,qBAAuB,IAAI;AAC7C,QAAM,oBAAgB,uBAAQ,SAAS;AAEvC,WAAS,OAAOA,gBAAuBC,cAAqB;AACxD,WAAO,YAAY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,UACL,eAAW;AAAA,YACP;AAAA;AAAA;AAAA;AAAA,kCAIM,cAAc,aAAa,iBAAiB;AAAA;AAAA,YAElD;AAAA,UACJ;AAAA,UACA,OAAO;AAAA;AAAA,QACN;AAAA,MACL;AAAA,IAER;AAAA,EACJ;AAER,CAAC;",
6
+ "names": ["containerSize", "wrapperSize"]
7
+ }
@@ -4,6 +4,7 @@ export * from "./components/AutoSizeTextarea";
4
4
  export * from "./components/CircleText";
5
5
  export * from "./components/Flow";
6
6
  export * from "./components/HlsPlayer";
7
+ export * from "./components/InfiniteScroll";
7
8
  export * from "./components/InputFile";
8
9
  export * from "./components/LoopSwiper";
9
10
  export * from "./components/Ring";
package/dist/cjs/index.js CHANGED
@@ -22,6 +22,7 @@ __reExport(src_exports, require("./components/AutoSizeTextarea"), module.exports
22
22
  __reExport(src_exports, require("./components/CircleText"), module.exports);
23
23
  __reExport(src_exports, require("./components/Flow"), module.exports);
24
24
  __reExport(src_exports, require("./components/HlsPlayer"), module.exports);
25
+ __reExport(src_exports, require("./components/InfiniteScroll"), module.exports);
25
26
  __reExport(src_exports, require("./components/InputFile"), module.exports);
26
27
  __reExport(src_exports, require("./components/LoopSwiper"), module.exports);
27
28
  __reExport(src_exports, require("./components/Ring"), module.exports);
@@ -39,6 +40,7 @@ __reExport(src_exports, require("./components/Trapezium"), module.exports);
39
40
  ...require("./components/CircleText"),
40
41
  ...require("./components/Flow"),
41
42
  ...require("./components/HlsPlayer"),
43
+ ...require("./components/InfiniteScroll"),
42
44
  ...require("./components/InputFile"),
43
45
  ...require("./components/LoopSwiper"),
44
46
  ...require("./components/Ring"),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx"],
4
- "sourcesContent": ["export * from \"./components/AutoFit\"\r\nexport * from \"./components/AutoScroll\"\r\nexport * from \"./components/AutoSizeTextarea\"\r\nexport * from \"./components/CircleText\"\r\nexport * from \"./components/Flow\"\r\nexport * from \"./components/HlsPlayer\"\r\nexport * from \"./components/InputFile\"\r\nexport * from \"./components/LoopSwiper\"\r\nexport * from \"./components/Ring\"\r\nexport * from \"./components/Scroll\"\r\nexport * from \"./components/SectionRing\"\r\nexport * from \"./components/Skeleton\"\r\nexport * from \"./components/TransitionBox\"\r\nexport * from \"./components/TransitionNum\"\r\nexport * from \"./components/Trapezium\"\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oCADd;AAEA,wBAAc,0CAFd;AAGA,wBAAc,oCAHd;AAIA,wBAAc,8BAJd;AAKA,wBAAc,mCALd;AAMA,wBAAc,mCANd;AAOA,wBAAc,oCAPd;AAQA,wBAAc,8BARd;AASA,wBAAc,gCATd;AAUA,wBAAc,qCAVd;AAWA,wBAAc,kCAXd;AAYA,wBAAc,uCAZd;AAaA,wBAAc,uCAbd;AAcA,wBAAc,mCAdd;",
4
+ "sourcesContent": ["export * from \"./components/AutoFit\"\r\nexport * from \"./components/AutoScroll\"\r\nexport * from \"./components/AutoSizeTextarea\"\r\nexport * from \"./components/CircleText\"\r\nexport * from \"./components/Flow\"\r\nexport * from \"./components/HlsPlayer\"\r\nexport * from \"./components/InfiniteScroll\"\r\nexport * from \"./components/InputFile\"\r\nexport * from \"./components/LoopSwiper\"\r\nexport * from \"./components/Ring\"\r\nexport * from \"./components/Scroll\"\r\nexport * from \"./components/SectionRing\"\r\nexport * from \"./components/Skeleton\"\r\nexport * from \"./components/TransitionBox\"\r\nexport * from \"./components/TransitionNum\"\r\nexport * from \"./components/Trapezium\"\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oCADd;AAEA,wBAAc,0CAFd;AAGA,wBAAc,oCAHd;AAIA,wBAAc,8BAJd;AAKA,wBAAc,mCALd;AAMA,wBAAc,wCANd;AAOA,wBAAc,mCAPd;AAQA,wBAAc,oCARd;AASA,wBAAc,8BATd;AAUA,wBAAc,gCAVd;AAWA,wBAAc,qCAXd;AAYA,wBAAc,kCAZd;AAaA,wBAAc,uCAbd;AAcA,wBAAc,uCAdd;AAeA,wBAAc,mCAfd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoFit.d.ts","sourceRoot":"","sources":["AutoFit.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,cAAc,EAAqE,MAAM,OAAO,CAAA;AAGrH,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAA;CACjD;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,yGAqElB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoScroll.d.ts","sourceRoot":"","sources":["AutoScroll.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAqF,MAAM,OAAO,CAAA;AAIxH,OAAO,EAAU,WAAW,EAAE,MAAM,UAAU,CAAA;AAE9C,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAChD,cAAc;IACd,KAAK,EAAE,MAAM,CAAA;IAEb,cAAc;IACd,UAAU,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,WAAW;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B,WAAW;IACX,cAAc,CAAC,EAAE,aAAa,CAAA;IAE9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,UAAU,4GA4ErB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoSizeTextarea.d.ts","sourceRoot":"","sources":["AutoSizeTextarea.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,sBAAsB,EAA0D,MAAM,OAAO,CAAA;AAGlH;;GAEG;AACH,eAAO,MAAM,gBAAgB,6IAsC3B,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CircleText.d.ts","sourceRoot":"","sources":["CircleText.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAY,cAAc,EAAE,MAAM,OAAO,CAAA;AAEpD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACtF,eAAe;IACf,KAAK,EAAE,MAAM,CAAA;IACb,eAAe;IACf,MAAM,EAAE,MAAM,CAAA;IACd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC7B,eAAe;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC,CAAA;IAC1D,YAAY;IACZ,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,WAAW;AACX,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA2B1C,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings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AC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,2CAS1C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HlsPlayer.d.ts","sourceRoot":"","sources":["HlsPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAsD,MAAM,OAAO,CAAA;AAE/F,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACtF,GAAG,EAAE,MAAM,CAAA;CACd;AAED,eAAO,MAAM,SAAS,6GAwBpB,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { ComponentProps, CSSProperties } from "react";
2
+ export type InfiniteScrollProps = ComponentProps<"div"> & {
3
+ /**
4
+ * 滚动的方向
5
+ * @default "vertical"
6
+ */
7
+ direction?: "vertical" | "horizontal";
8
+ /** 渲染 children 的容器的类名 */
9
+ containerClassName?: string;
10
+ /** 渲染 children 的容器的样式 */
11
+ containerStyle?: CSSProperties;
12
+ /**
13
+ * 两个 children 容器之间的间距
14
+ * @default 0
15
+ */
16
+ gap?: number;
17
+ /** 一个周期的时间,单位:毫秒 */
18
+ duration: number;
19
+ /** 是否将 gap 的距离也加入 overflow 的计算 */
20
+ withGap?: boolean;
21
+ /** 尺寸刚好相同时,是否视为溢出 */
22
+ withEqual?: boolean;
23
+ };
24
+ /**
25
+ * 无限滚动的组件
26
+ * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果
27
+ * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画
28
+ */
29
+ export declare const InfiniteScroll: import("react").ForwardRefExoticComponent<Omit<InfiniteScrollProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfiniteScroll.d.ts","sourceRoot":"","sources":["InfiniteScroll.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAsD,MAAM,OAAO,CAAA;AAEzG,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACtD;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAA;IACrC,yBAAyB;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,yBAAyB;IACzB,cAAc,CAAC,EAAE,aAAa,CAAA;IAC9B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,6HAiFzB,CAAA"}
@@ -0,0 +1,83 @@
1
+ import { css } from "@emotion/css";
2
+ import { useSize } from "ahooks";
3
+ import { clsx } from "deepsea-tools";
4
+ import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ /**
8
+ * 无限滚动的组件
9
+ * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果
10
+ * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画
11
+ */
12
+ export const InfiniteScroll = /*#__PURE__*/forwardRef((props, ref) => {
13
+ const {
14
+ className,
15
+ direction = "vertical",
16
+ children,
17
+ containerClassName,
18
+ containerStyle,
19
+ gap = 0,
20
+ duration,
21
+ withGap,
22
+ withEqual,
23
+ ...rest
24
+ } = props;
25
+ const wrapper = useRef(null);
26
+ const wrapperSize = useSize(wrapper);
27
+ const ele = useRef(null);
28
+ useImperativeHandle(ref, () => wrapper.current, [wrapper.current]);
29
+ const container = useRef(null);
30
+ const containerSize = useSize(container);
31
+ function bigger(containerSize, wrapperSize) {
32
+ return withEqual ? containerSize + (withGap ? gap : 0) >= wrapperSize : containerSize + (withGap ? gap : 0) > wrapperSize;
33
+ }
34
+ const overflow = wrapperSize && containerSize ? direction === "vertical" ? bigger(containerSize.height, wrapperSize.height) : bigger(containerSize.width, wrapperSize.width) : false;
35
+ useEffect(() => {
36
+ if (!wrapperSize || !containerSize || !overflow) return;
37
+ const animation = ele.current?.animate({
38
+ transform: direction === "vertical" ? [`translateY(0)`, `translateY(-${containerSize.height + gap}px)`] : [`translateX(0)`, `translateX(-${containerSize.width + gap}px)`]
39
+ }, {
40
+ duration,
41
+ iterations: Infinity
42
+ });
43
+ return () => animation?.cancel();
44
+ }, [wrapperSize, containerSize, overflow, direction, duration]);
45
+ return /*#__PURE__*/_jsx("div", {
46
+ ref: wrapper,
47
+ className: clsx(css`
48
+ position: relative;
49
+ overflow: hidden;
50
+ `, className),
51
+ ...rest,
52
+ children: /*#__PURE__*/_jsxs("div", {
53
+ ref: ele,
54
+ style: {
55
+ position: "absolute",
56
+ width: direction === "vertical" ? "100%" : containerSize && (overflow ? containerSize.width * 2 + gap : containerSize.width),
57
+ height: direction === "horizontal" ? "100%" : containerSize && (overflow ? containerSize.height * 2 + gap : containerSize.width)
58
+ },
59
+ children: [/*#__PURE__*/_jsx("div", {
60
+ ref: container,
61
+ className: clsx(css`
62
+ position: absolute;
63
+ left: 0;
64
+ top: 0;
65
+ ${direction === "vertical" ? "width: 100%;" : "height: 100%;"}
66
+ `, containerClassName),
67
+ style: containerStyle,
68
+ children: children
69
+ }), overflow && /*#__PURE__*/_jsx("div", {
70
+ ref: container,
71
+ className: clsx(css`
72
+ position: absolute;
73
+ right: 0;
74
+ bottom: 0;
75
+ ${direction === "vertical" ? "width: 100%;" : "height: 100%;"}
76
+ `, containerClassName),
77
+ style: containerStyle,
78
+ children: children
79
+ })]
80
+ })
81
+ });
82
+ });
83
+ //# sourceMappingURL=InfiniteScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["css","useSize","clsx","forwardRef","useEffect","useImperativeHandle","useRef","jsx","_jsx","jsxs","_jsxs","InfiniteScroll","props","ref","className","direction","children","containerClassName","containerStyle","gap","duration","withGap","withEqual","rest","wrapper","wrapperSize","ele","current","container","containerSize","bigger","overflow","height","width","animation","animate","transform","iterations","Infinity","cancel","style","position"],"sources":["../../../src/components/InfiniteScroll.tsx"],"sourcesContent":["import { css } from \"@emotion/css\"\r\nimport { useSize } from \"ahooks\"\r\nimport { clsx } from \"deepsea-tools\"\r\nimport { ComponentProps, CSSProperties, forwardRef, useEffect, useImperativeHandle, useRef } from \"react\"\r\n\r\nexport type InfiniteScrollProps = ComponentProps<\"div\"> & {\r\n /**\r\n * 滚动的方向\r\n * @default \"vertical\"\r\n */\r\n direction?: \"vertical\" | \"horizontal\"\r\n /** 渲染 children 的容器的类名 */\r\n containerClassName?: string\r\n /** 渲染 children 的容器的样式 */\r\n containerStyle?: CSSProperties\r\n /**\r\n * 两个 children 容器之间的间距\r\n * @default 0\r\n */\r\n gap?: number\r\n /** 一个周期的时间,单位:毫秒 */\r\n duration: number\r\n /** 是否将 gap 的距离也加入 overflow 的计算 */\r\n withGap?: boolean\r\n /** 尺寸刚好相同时,是否视为溢出 */\r\n withEqual?: boolean\r\n}\r\n\r\n/**\r\n * 无限滚动的组件\r\n * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果\r\n * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画\r\n */\r\nexport const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((props, ref) => {\r\n const { className, direction = \"vertical\", children, containerClassName, containerStyle, gap = 0, duration, withGap, withEqual, ...rest } = props\r\n\r\n const wrapper = useRef<HTMLDivElement>(null)\r\n const wrapperSize = useSize(wrapper)\r\n\r\n const ele = useRef<HTMLDivElement>(null)\r\n\r\n useImperativeHandle(ref, () => wrapper.current as HTMLDivElement, [wrapper.current])\r\n\r\n const container = useRef<HTMLDivElement>(null)\r\n const containerSize = useSize(container)\r\n\r\n function bigger(containerSize: number, wrapperSize: number) {\r\n return withEqual ? containerSize + (withGap ? gap : 0) >= wrapperSize : containerSize + (withGap ? gap : 0) > wrapperSize\r\n }\r\n\r\n const overflow = wrapperSize && containerSize ? (direction === \"vertical\" ? bigger(containerSize.height, wrapperSize.height) : bigger(containerSize.width, wrapperSize.width)) : false\r\n\r\n useEffect(() => {\r\n if (!wrapperSize || !containerSize || !overflow) return\r\n const animation = ele.current?.animate(\r\n {\r\n transform: direction === \"vertical\" ? [`translateY(0)`, `translateY(-${containerSize.height + gap}px)`] : [`translateX(0)`, `translateX(-${containerSize.width + gap}px)`]\r\n },\r\n { duration, iterations: Infinity }\r\n )\r\n return () => animation?.cancel()\r\n }, [wrapperSize, containerSize, overflow, direction, duration])\r\n\r\n return (\r\n <div\r\n ref={wrapper}\r\n className={clsx(\r\n css`\r\n position: relative;\r\n overflow: hidden;\r\n `,\r\n className\r\n )}\r\n {...rest}>\r\n <div\r\n ref={ele}\r\n style={{\r\n position: \"absolute\",\r\n width: direction === \"vertical\" ? \"100%\" : containerSize && (overflow ? containerSize.width * 2 + gap : containerSize.width),\r\n height: direction === \"horizontal\" ? \"100%\" : containerSize && (overflow ? containerSize.height * 2 + gap : containerSize.width)\r\n }}>\r\n <div\r\n ref={container}\r\n className={clsx(\r\n css`\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n ${direction === \"vertical\" ? \"width: 100%;\" : \"height: 100%;\"}\r\n `,\r\n containerClassName\r\n )}\r\n style={containerStyle}>\r\n {children}\r\n </div>\r\n {overflow && (\r\n <div\r\n ref={container}\r\n className={clsx(\r\n css`\r\n position: absolute;\r\n right: 0;\r\n bottom: 0;\r\n ${direction === \"vertical\" ? \"width: 100%;\" : \"height: 100%;\"}\r\n `,\r\n containerClassName\r\n )}\r\n style={containerStyle}>\r\n {children}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n )\r\n})\r\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,IAAI,QAAQ,eAAe;AACpC,SAA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
1
+ {"version":3,"file":"SectionRing.d.ts","sourceRoot":"","sources":["SectionRing.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE1C,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAuB5C,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["Skeleton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,cAAc,EAAE,MAAM,OAAO,CAAA;AAElD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,QAAQ,0GAmCnB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransitionBox.d.ts","sourceRoot":"","sources":["TransitionBox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,EAAE,EAAc,cAAc,EAA+B,MAAM,OAAO,CAAA;AAElG,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,aAAa,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,cAAc;AACd,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAqB/C,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransitionNum.d.ts","sourceRoot":"","sources":["TransitionNum.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAsD,MAAM,OAAO,CAAA;AAExG,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxF,WAAW;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe;IACf,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,SAAS;IACT,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC7B,GAAG,IAAI,MAAM,CAAA;CAChB;AAED,aAAa;AACb,eAAO,MAAM,aAAa,+GAgCxB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trapezium.d.ts","sourceRoot":"","sources":["Trapezium.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAA;AAGlD,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IAClE,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;CACvB;AAED,WAAW;AACX,eAAO,MAAM,SAAS,2GA2CpB,CAAA"}
@@ -4,6 +4,7 @@ export * from "./components/AutoSizeTextarea";
4
4
  export * from "./components/CircleText";
5
5
  export * from "./components/Flow";
6
6
  export * from "./components/HlsPlayer";
7
+ export * from "./components/InfiniteScroll";
7
8
  export * from "./components/InputFile";
8
9
  export * from "./components/LoopSwiper";
9
10
  export * from "./components/Ring";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA"}
package/dist/esm/index.js CHANGED
@@ -4,6 +4,7 @@ export * from "./components/AutoSizeTextarea";
4
4
  export * from "./components/CircleText";
5
5
  export * from "./components/Flow";
6
6
  export * from "./components/HlsPlayer";
7
+ export * from "./components/InfiniteScroll";
7
8
  export * from "./components/InputFile";
8
9
  export * from "./components/LoopSwiper";
9
10
  export * from "./components/Ring";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":["export * from \"./components/AutoFit\"\r\nexport * from \"./components/AutoScroll\"\r\nexport * from \"./components/AutoSizeTextarea\"\r\nexport * from \"./components/CircleText\"\r\nexport * from \"./components/Flow\"\r\nexport * from \"./components/HlsPlayer\"\r\nexport * from \"./components/InputFile\"\r\nexport * from \"./components/LoopSwiper\"\r\nexport * from \"./components/Ring\"\r\nexport * from \"./components/Scroll\"\r\nexport * from \"./components/SectionRing\"\r\nexport * from \"./components/Skeleton\"\r\nexport * from \"./components/TransitionBox\"\r\nexport * from \"./components/TransitionNum\"\r\nexport * from \"./components/Trapezium\"\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":["export * from \"./components/AutoFit\"\r\nexport * from \"./components/AutoScroll\"\r\nexport * from \"./components/AutoSizeTextarea\"\r\nexport * from \"./components/CircleText\"\r\nexport * from \"./components/Flow\"\r\nexport * from \"./components/HlsPlayer\"\r\nexport * from \"./components/InfiniteScroll\"\r\nexport * from \"./components/InputFile\"\r\nexport * from \"./components/LoopSwiper\"\r\nexport * from \"./components/Ring\"\r\nexport * from \"./components/Scroll\"\r\nexport * from \"./components/SectionRing\"\r\nexport * from \"./components/Skeleton\"\r\nexport * from \"./components/TransitionBox\"\r\nexport * from \"./components/TransitionNum\"\r\nexport * from \"./components/Trapezium\"\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,MAAM,eAAe,GAAG,KAAK,MAAM,EAAE,CAAA;AAE3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAE1D,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACvD,CAAC,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAAA;CACzC;AAQD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAEtE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,aAAa,CAQ5H;AAED,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEzE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepsea-components",
3
- "version": "5.0.7",
3
+ "version": "5.1.0",
4
4
  "description": "格数科技自用组件库",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,115 @@
1
+ import { css } from "@emotion/css"
2
+ import { useSize } from "ahooks"
3
+ import { clsx } from "deepsea-tools"
4
+ import { ComponentProps, CSSProperties, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
5
+
6
+ export type InfiniteScrollProps = ComponentProps<"div"> & {
7
+ /**
8
+ * 滚动的方向
9
+ * @default "vertical"
10
+ */
11
+ direction?: "vertical" | "horizontal"
12
+ /** 渲染 children 的容器的类名 */
13
+ containerClassName?: string
14
+ /** 渲染 children 的容器的样式 */
15
+ containerStyle?: CSSProperties
16
+ /**
17
+ * 两个 children 容器之间的间距
18
+ * @default 0
19
+ */
20
+ gap?: number
21
+ /** 一个周期的时间,单位:毫秒 */
22
+ duration: number
23
+ /** 是否将 gap 的距离也加入 overflow 的计算 */
24
+ withGap?: boolean
25
+ /** 尺寸刚好相同时,是否视为溢出 */
26
+ withEqual?: boolean
27
+ }
28
+
29
+ /**
30
+ * 无限滚动的组件
31
+ * 子元素会内置的容器中被渲染两次,首尾相连,形成无限滚动的效果
32
+ * 但是,如果内部检测到并没有溢出,那么不会渲染两次,并且没有动画
33
+ */
34
+ export const InfiniteScroll = forwardRef<HTMLDivElement, InfiniteScrollProps>((props, ref) => {
35
+ const { className, direction = "vertical", children, containerClassName, containerStyle, gap = 0, duration, withGap, withEqual, ...rest } = props
36
+
37
+ const wrapper = useRef<HTMLDivElement>(null)
38
+ const wrapperSize = useSize(wrapper)
39
+
40
+ const ele = useRef<HTMLDivElement>(null)
41
+
42
+ useImperativeHandle(ref, () => wrapper.current as HTMLDivElement, [wrapper.current])
43
+
44
+ const container = useRef<HTMLDivElement>(null)
45
+ const containerSize = useSize(container)
46
+
47
+ function bigger(containerSize: number, wrapperSize: number) {
48
+ return withEqual ? containerSize + (withGap ? gap : 0) >= wrapperSize : containerSize + (withGap ? gap : 0) > wrapperSize
49
+ }
50
+
51
+ const overflow = wrapperSize && containerSize ? (direction === "vertical" ? bigger(containerSize.height, wrapperSize.height) : bigger(containerSize.width, wrapperSize.width)) : false
52
+
53
+ useEffect(() => {
54
+ if (!wrapperSize || !containerSize || !overflow) return
55
+ const animation = ele.current?.animate(
56
+ {
57
+ transform: direction === "vertical" ? [`translateY(0)`, `translateY(-${containerSize.height + gap}px)`] : [`translateX(0)`, `translateX(-${containerSize.width + gap}px)`]
58
+ },
59
+ { duration, iterations: Infinity }
60
+ )
61
+ return () => animation?.cancel()
62
+ }, [wrapperSize, containerSize, overflow, direction, duration])
63
+
64
+ return (
65
+ <div
66
+ ref={wrapper}
67
+ className={clsx(
68
+ css`
69
+ position: relative;
70
+ overflow: hidden;
71
+ `,
72
+ className
73
+ )}
74
+ {...rest}>
75
+ <div
76
+ ref={ele}
77
+ style={{
78
+ position: "absolute",
79
+ width: direction === "vertical" ? "100%" : containerSize && (overflow ? containerSize.width * 2 + gap : containerSize.width),
80
+ height: direction === "horizontal" ? "100%" : containerSize && (overflow ? containerSize.height * 2 + gap : containerSize.width)
81
+ }}>
82
+ <div
83
+ ref={container}
84
+ className={clsx(
85
+ css`
86
+ position: absolute;
87
+ left: 0;
88
+ top: 0;
89
+ ${direction === "vertical" ? "width: 100%;" : "height: 100%;"}
90
+ `,
91
+ containerClassName
92
+ )}
93
+ style={containerStyle}>
94
+ {children}
95
+ </div>
96
+ {overflow && (
97
+ <div
98
+ ref={container}
99
+ className={clsx(
100
+ css`
101
+ position: absolute;
102
+ right: 0;
103
+ bottom: 0;
104
+ ${direction === "vertical" ? "width: 100%;" : "height: 100%;"}
105
+ `,
106
+ containerClassName
107
+ )}
108
+ style={containerStyle}>
109
+ {children}
110
+ </div>
111
+ )}
112
+ </div>
113
+ </div>
114
+ )
115
+ })
package/src/index.tsx CHANGED
@@ -4,6 +4,7 @@ export * from "./components/AutoSizeTextarea"
4
4
  export * from "./components/CircleText"
5
5
  export * from "./components/Flow"
6
6
  export * from "./components/HlsPlayer"
7
+ export * from "./components/InfiniteScroll"
7
8
  export * from "./components/InputFile"
8
9
  export * from "./components/LoopSwiper"
9
10
  export * from "./components/Ring"