@xiping/react-components 1.0.55 → 1.0.57
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/cjs/components/blur-text/BlurText.d.ts +16 -0
- package/dist/cjs/components/blur-text/BlurText.js +1 -0
- package/dist/cjs/components/blur-text/index.d.ts +2 -0
- package/dist/cjs/components/button/Button.css +1 -0
- package/dist/cjs/components/button/Button.js +1 -1
- package/dist/cjs/components/comic-text/ComicText.css +1 -0
- package/dist/cjs/components/comic-text/ComicText.js +2 -2
- package/dist/cjs/components/dock/Duck.css +1 -0
- package/dist/cjs/components/dock/Duck.d.ts +2 -4
- package/dist/cjs/components/dock/Duck.js +1 -1
- package/dist/cjs/components/flip-text/FlipText.css +1 -0
- package/dist/cjs/components/flip-text/FlipText.js +1 -1
- package/dist/cjs/components/gradient-text/index.css +1 -0
- package/dist/cjs/components/gradient-text/index.js +1 -1
- package/dist/cjs/components/hyper-text/HyperText.css +1 -0
- package/dist/cjs/components/hyper-text/index.js +1 -1
- package/dist/cjs/components/image-compare/ImageCompare.css +1 -0
- package/dist/cjs/components/image-compare/ImageCompare.d.ts +4 -2
- package/dist/cjs/components/image-compare/ImageCompare.js +1 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails.css +1 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.js +1 -1
- package/dist/cjs/components/image-viewer/ImageViewer.css +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.js +1 -1
- package/dist/cjs/components/message/Message.css +1 -0
- package/dist/cjs/components/message/Message.js +1 -1
- package/dist/cjs/components/pointer/Pointer.css +1 -0
- package/dist/cjs/components/pointer/Pointer.js +1 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.css +1 -0
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.js +1 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton.css +1 -0
- package/dist/cjs/components/shimmer-button/ShimmerButton.js +1 -1
- package/dist/cjs/components/shiny-button/ShinyButton.css +1 -0
- package/dist/cjs/components/shiny-button/ShinyButton.js +1 -1
- package/dist/cjs/components/shiny-text/ShinyText.css +1 -0
- package/dist/cjs/components/shiny-text/ShinyText.d.ts +16 -0
- package/dist/cjs/components/shiny-text/ShinyText.js +1 -0
- package/dist/cjs/components/shiny-text/index.d.ts +2 -0
- package/dist/cjs/components/sparkles-text/SparklesText.css +1 -0
- package/dist/cjs/components/sparkles-text/SparklesText.js +1 -1
- package/dist/cjs/components/split-text/SplitText.css +1 -0
- package/dist/cjs/components/split-text/SplitText.js +1 -1
- package/dist/cjs/components/subtitle-player/CurrentMode.css +1 -0
- package/dist/cjs/components/subtitle-player/CurrentMode.d.ts +2 -0
- package/dist/cjs/components/subtitle-player/CurrentMode.js +2 -2
- package/dist/cjs/components/subtitle-player/LyricsMode.css +1 -0
- package/dist/cjs/components/subtitle-player/LyricsMode.d.ts +2 -0
- package/dist/cjs/components/subtitle-player/LyricsMode.js +2 -2
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.css +1 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.d.ts +2 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.js +1 -1
- package/dist/cjs/components/text-animate/TextAnimate.css +1 -0
- package/dist/cjs/components/text-animate/TextAnimate.js +2 -2
- package/dist/cjs/components/text-type/TextType.css +1 -0
- package/dist/cjs/components/text-type/TextType.js +1 -1
- package/dist/cjs/components/txt-reader/index.module.css +1 -0
- package/dist/cjs/components/txt-reader/index.module.css.js +1 -1
- package/dist/cjs/components/typing-animation/index.css +1 -0
- package/dist/cjs/components/typing-animation/index.js +1 -1
- package/dist/cjs/components/variable-proximity/index.css +1 -0
- package/dist/cjs/components/variable-proximity/index.js +1 -1
- package/dist/cjs/components/video-dialog/VideoDialog.css +1 -0
- package/dist/cjs/components/video-dialog/VideoDialog.js +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.js +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/llms.txt +2 -13
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -0
- package/dist/es/components/blur-text/BlurText.d.ts +16 -0
- package/dist/es/components/blur-text/BlurText.js +77 -0
- package/dist/es/components/blur-text/index.d.ts +2 -0
- package/dist/es/components/button/Button.css +1 -0
- package/dist/es/components/button/Button.js +35 -46
- package/dist/es/components/comic-text/ComicText.css +1 -0
- package/dist/es/components/comic-text/ComicText.js +13 -12
- package/dist/es/components/dock/Duck.css +1 -0
- package/dist/es/components/dock/Duck.d.ts +2 -4
- package/dist/es/components/dock/Duck.js +60 -64
- package/dist/es/components/flip-text/FlipText.css +1 -0
- package/dist/es/components/flip-text/FlipText.js +8 -8
- package/dist/es/components/gradient-text/index.css +1 -0
- package/dist/es/components/gradient-text/index.js +9 -8
- package/dist/es/components/hyper-text/HyperText.css +1 -0
- package/dist/es/components/hyper-text/index.js +16 -13
- package/dist/es/components/image-compare/ImageCompare.css +1 -0
- package/dist/es/components/image-compare/ImageCompare.d.ts +4 -2
- package/dist/es/components/image-compare/ImageCompare.js +55 -48
- package/dist/es/components/image-viewer/ImageThumbnails.css +1 -0
- package/dist/es/components/image-viewer/ImageThumbnails.js +41 -42
- package/dist/es/components/image-viewer/ImageViewer.css +1 -0
- package/dist/es/components/image-viewer/ImageViewer.js +34 -35
- package/dist/es/components/message/Message.css +1 -0
- package/dist/es/components/message/Message.js +65 -54
- package/dist/es/components/pointer/Pointer.css +1 -0
- package/dist/es/components/pointer/Pointer.js +23 -25
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.css +1 -0
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.js +17 -16
- package/dist/es/components/shimmer-button/ShimmerButton.css +1 -0
- package/dist/es/components/shimmer-button/ShimmerButton.js +8 -8
- package/dist/es/components/shiny-button/ShinyButton.css +1 -0
- package/dist/es/components/shiny-button/ShinyButton.js +13 -13
- package/dist/es/components/shiny-text/ShinyText.css +1 -0
- package/dist/es/components/shiny-text/ShinyText.d.ts +16 -0
- package/dist/es/components/shiny-text/ShinyText.js +76 -0
- package/dist/es/components/shiny-text/index.d.ts +2 -0
- package/dist/es/components/sparkles-text/SparklesText.css +1 -0
- package/dist/es/components/sparkles-text/SparklesText.js +14 -14
- package/dist/es/components/split-text/SplitText.css +1 -0
- package/dist/es/components/split-text/SplitText.js +1 -1
- package/dist/es/components/subtitle-player/CurrentMode.css +1 -0
- package/dist/es/components/subtitle-player/CurrentMode.d.ts +2 -0
- package/dist/es/components/subtitle-player/CurrentMode.js +75 -40
- package/dist/es/components/subtitle-player/LyricsMode.css +1 -0
- package/dist/es/components/subtitle-player/LyricsMode.d.ts +2 -0
- package/dist/es/components/subtitle-player/LyricsMode.js +139 -68
- package/dist/es/components/subtitle-player/SubtitlePlayer.css +1 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.d.ts +2 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.js +63 -60
- package/dist/es/components/text-animate/TextAnimate.css +1 -0
- package/dist/es/components/text-animate/TextAnimate.js +57 -55
- package/dist/es/components/text-type/TextType.css +1 -0
- package/dist/es/components/text-type/TextType.js +24 -19
- package/dist/es/components/txt-reader/index.module.css +1 -0
- package/dist/es/components/txt-reader/index.module.css.js +1 -1
- package/dist/es/components/typing-animation/index.css +1 -0
- package/dist/es/components/typing-animation/index.js +12 -12
- package/dist/es/components/variable-proximity/index.css +1 -0
- package/dist/es/components/variable-proximity/index.js +19 -18
- package/dist/es/components/video-dialog/VideoDialog.css +1 -0
- package/dist/es/components/video-dialog/VideoDialog.js +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.js +100 -93
- package/dist/es/index.d.ts +2 -1
- package/dist/es/index.js +59 -60
- package/dist/es/llms.txt +2 -13
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -0
- package/package.json +14 -12
- package/dist/cjs/components/animated-list/AnimatedList.d.ts +0 -9
- package/dist/cjs/components/animated-list/AnimatedList.js +0 -1
- package/dist/cjs/components/animated-list/index.d.ts +0 -1
- package/dist/cjs/react-components.css +0 -1
- package/dist/cjs/utils/utils.js +0 -1
- package/dist/es/components/animated-list/AnimatedList.d.ts +0 -9
- package/dist/es/components/animated-list/AnimatedList.js +0 -44
- package/dist/es/components/animated-list/index.d.ts +0 -1
- package/dist/es/react-components.css +0 -1
- package/dist/es/utils/utils.js +0 -8
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as T } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
3
|
+
import { motion as x } from "motion/react";
|
|
4
|
+
import { useState as u, useRef as I, useEffect as a } from "react";
|
|
5
|
+
import b from "clsx";
|
|
6
|
+
import './index.css';/* empty css */
|
|
7
7
|
function S({
|
|
8
8
|
children: r,
|
|
9
9
|
className: m,
|
|
10
|
-
duration:
|
|
10
|
+
duration: o = 100,
|
|
11
11
|
delay: n = 0,
|
|
12
12
|
as: l = "div",
|
|
13
13
|
startOnView: i = !1,
|
|
14
14
|
...p
|
|
15
15
|
}) {
|
|
16
|
-
const d =
|
|
16
|
+
const d = x.create(l, {
|
|
17
17
|
forwardMotionProps: !0
|
|
18
|
-
}), [g, v] = u(""), [c, f] = u(!1),
|
|
18
|
+
}), [g, v] = u(""), [c, f] = u(!1), s = I(null);
|
|
19
19
|
return a(() => {
|
|
20
20
|
if (!i) {
|
|
21
21
|
const t = setTimeout(() => {
|
|
@@ -31,21 +31,21 @@ function S({
|
|
|
31
31
|
},
|
|
32
32
|
{ threshold: 0.1 }
|
|
33
33
|
);
|
|
34
|
-
return
|
|
34
|
+
return s.current && e.observe(s.current), () => e.disconnect();
|
|
35
35
|
}, [n, i]), a(() => {
|
|
36
36
|
if (!c) return;
|
|
37
37
|
let e = 0;
|
|
38
38
|
const t = setInterval(() => {
|
|
39
39
|
e < r.length ? (v(r.substring(0, e + 1)), e++) : clearInterval(t);
|
|
40
|
-
},
|
|
40
|
+
}, o);
|
|
41
41
|
return () => {
|
|
42
42
|
clearInterval(t);
|
|
43
43
|
};
|
|
44
|
-
}, [r,
|
|
44
|
+
}, [r, o, c]), /* @__PURE__ */ T(
|
|
45
45
|
d,
|
|
46
46
|
{
|
|
47
|
-
ref:
|
|
48
|
-
className:
|
|
47
|
+
ref: s,
|
|
48
|
+
className: b("xiping-typing-animation", m),
|
|
49
49
|
...p,
|
|
50
50
|
children: g
|
|
51
51
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-variable-proximity{font-family:Roboto Flex,Noto Sans SC,PingFang SC,Microsoft YaHei,SimHei,sans-serif}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsxs as G, jsx as k } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as H, useRef as y, useMemo as N, useEffect as w } from "react";
|
|
3
3
|
import { motion as J } from "motion/react";
|
|
4
|
-
|
|
4
|
+
import K from "clsx";
|
|
5
|
+
import './index.css';/* empty css */
|
|
5
6
|
const l = {
|
|
6
7
|
robotoFlex: !1,
|
|
7
8
|
notoSansSC: !1,
|
|
@@ -15,7 +16,7 @@ function V(n) {
|
|
|
15
16
|
return !0;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function O() {
|
|
19
20
|
if (l.loading || l.robotoFlex && l.notoSansSC) return;
|
|
20
21
|
l.loading = !0;
|
|
21
22
|
const n = V("Roboto Flex"), r = V("Noto Sans SC");
|
|
@@ -61,12 +62,12 @@ function K() {
|
|
|
61
62
|
};
|
|
62
63
|
d(0);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function Q(n = !0) {
|
|
65
66
|
w(() => {
|
|
66
|
-
n && typeof document < "u" &&
|
|
67
|
+
n && typeof document < "u" && O();
|
|
67
68
|
}, [n]);
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function W(n) {
|
|
70
71
|
w(() => {
|
|
71
72
|
let r;
|
|
72
73
|
const i = () => {
|
|
@@ -75,7 +76,7 @@ function Q(n) {
|
|
|
75
76
|
return r = requestAnimationFrame(i), () => cancelAnimationFrame(r);
|
|
76
77
|
}, [n]);
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function Z(n) {
|
|
79
80
|
const r = y({ x: 0, y: 0 });
|
|
80
81
|
return w(() => {
|
|
81
82
|
const i = (t, s) => {
|
|
@@ -93,7 +94,7 @@ function W(n) {
|
|
|
93
94
|
};
|
|
94
95
|
}, [n]), r;
|
|
95
96
|
}
|
|
96
|
-
const
|
|
97
|
+
const _ = H(
|
|
97
98
|
(n, r) => {
|
|
98
99
|
const {
|
|
99
100
|
label: i,
|
|
@@ -109,11 +110,11 @@ const Z = H(
|
|
|
109
110
|
autoLoadFonts: P = !0,
|
|
110
111
|
...A
|
|
111
112
|
} = n;
|
|
112
|
-
|
|
113
|
-
const b = y([]), v = y([]), S =
|
|
113
|
+
Q(P && !g);
|
|
114
|
+
const b = y([]), v = y([]), S = Z(t), x = y({
|
|
114
115
|
x: null,
|
|
115
116
|
y: null
|
|
116
|
-
}),
|
|
117
|
+
}), q = N(() => {
|
|
117
118
|
const e = (o) => new Map(
|
|
118
119
|
o.split(",").map((p) => p.trim()).map((p) => {
|
|
119
120
|
const [h, F] = p.split(" ");
|
|
@@ -125,7 +126,7 @@ const Z = H(
|
|
|
125
126
|
fromValue: p,
|
|
126
127
|
toValue: u.get(o) ?? p
|
|
127
128
|
}));
|
|
128
|
-
}, [f, d]),
|
|
129
|
+
}, [f, d]), I = (e, a, u, o) => Math.sqrt((u - e) ** 2 + (o - a) ** 2), $ = (e) => {
|
|
129
130
|
const a = Math.min(Math.max(1 - e / s, 0), 1);
|
|
130
131
|
switch (m) {
|
|
131
132
|
case "exponential":
|
|
@@ -136,7 +137,7 @@ const Z = H(
|
|
|
136
137
|
return a;
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
+
W(() => {
|
|
140
141
|
if (!t?.current) return;
|
|
141
142
|
const { x: e, y: a } = S.current;
|
|
142
143
|
if (x.current.x === e && x.current.y === a)
|
|
@@ -145,7 +146,7 @@ const Z = H(
|
|
|
145
146
|
const u = t.current.getBoundingClientRect();
|
|
146
147
|
b.current.forEach((o, p) => {
|
|
147
148
|
if (!o) return;
|
|
148
|
-
const h = o.getBoundingClientRect(), F = h.left + h.width / 2 - u.left, Y = h.top + h.height / 2 - u.top, L =
|
|
149
|
+
const h = o.getBoundingClientRect(), F = h.left + h.width / 2 - u.left, Y = h.top + h.height / 2 - u.top, L = I(
|
|
149
150
|
S.current.x,
|
|
150
151
|
S.current.y,
|
|
151
152
|
F,
|
|
@@ -155,7 +156,7 @@ const Z = H(
|
|
|
155
156
|
o.style.fontVariationSettings = f;
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
const z =
|
|
159
|
+
const z = $(L), M = q.map(({ axis: T, fromValue: R, toValue: D }) => {
|
|
159
160
|
const U = R + (D - R) * z;
|
|
160
161
|
return `'${T}' ${U}`;
|
|
161
162
|
}).join(", ");
|
|
@@ -175,7 +176,7 @@ const Z = H(
|
|
|
175
176
|
"span",
|
|
176
177
|
{
|
|
177
178
|
ref: r,
|
|
178
|
-
className:
|
|
179
|
+
className: K("xiping-variable-proximity", c),
|
|
179
180
|
onClick: E,
|
|
180
181
|
style: X,
|
|
181
182
|
...A,
|
|
@@ -204,8 +205,8 @@ const Z = H(
|
|
|
204
205
|
);
|
|
205
206
|
}
|
|
206
207
|
);
|
|
207
|
-
|
|
208
|
+
_.displayName = "VariableProximity";
|
|
208
209
|
export {
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
_ as VariableProximity,
|
|
211
|
+
_ as default
|
|
211
212
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-video-dialog{position:relative}.xiping-video-dialog-container{position:relative;cursor:pointer}.xiping-video-dialog-thumbnail{width:100%;border-radius:.375rem;border:1px solid;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;transition:all .2s ease-out}.xiping-video-dialog-container:hover .xiping-video-dialog-thumbnail{filter:brightness(.8)}.xiping-video-dialog-overlay{position:absolute;inset:0;display:flex;transform:scale(.9);align-items:center;justify-content:center;border-radius:1rem;transition:all .2s ease-out}.xiping-video-dialog-container:hover .xiping-video-dialog-overlay{transform:scale(1)}.xiping-video-dialog-play-outer{display:flex;width:7rem;height:7rem;align-items:center;justify-content:center;border-radius:9999px;background-color:hsla(var(--primary-h),var(--primary-s),var(--primary-l),.1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.xiping-video-dialog-play-inner{position:relative;display:flex;width:5rem;height:5rem;transform:scale(1);align-items:center;justify-content:center;border-radius:9999px;background:linear-gradient(to bottom,hsla(var(--primary-h),var(--primary-s),var(--primary-l),.3),hsl(var(--primary-h),var(--primary-s),var(--primary-l)));box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;transition:all .2s ease-out}.xiping-video-dialog-container:hover .xiping-video-dialog-play-inner{transform:scale(1.2)}.xiping-video-dialog-play-icon{width:2rem;height:2rem;transform:scale(1);fill:#fff;color:#fff;transition:transform .2s ease-out;filter:drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06))}.xiping-video-dialog-container:hover .xiping-video-dialog-play-icon{transform:scale(1.05)}.xiping-video-dialog-modal{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background-color:#00000080;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.xiping-video-dialog-modal-content{position:relative;margin:0 1rem;aspect-ratio:16 / 9;width:100%;max-width:56rem}@media(min-width:768px){.xiping-video-dialog-modal-content{margin:0}}.xiping-video-dialog-close-button{position:absolute;top:-4rem;right:0;border-radius:9999px;background-color:#17171780;padding:.5rem;font-size:1.25rem;color:#fff;box-shadow:0 0 0 1px #0000001a;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}@media(prefers-color-scheme:dark){.xiping-video-dialog-close-button{background-color:#f5f5f580;color:#000}}.xiping-video-dialog-close-icon{width:1.25rem;height:1.25rem}.xiping-video-dialog-video-wrapper{position:relative;isolation:isolate;z-index:1;width:100%;height:100%;overflow:hidden;border-radius:1rem;border:2px solid white}.xiping-video-dialog-iframe{width:100%;height:100%;border-radius:1rem}:root{--primary-h: 221.2;--primary-s: 83.2%;--primary-l: 53.3%}
|
|
@@ -4,7 +4,7 @@ import { useState as s } from "react";
|
|
|
4
4
|
import { AnimatePresence as m, motion as e } from "motion/react";
|
|
5
5
|
import { Play as y, XIcon as x } from "lucide-react";
|
|
6
6
|
import g from "clsx";
|
|
7
|
-
|
|
7
|
+
import './VideoDialog.css';/* empty css */
|
|
8
8
|
const v = {
|
|
9
9
|
"from-bottom": {
|
|
10
10
|
initial: { y: "100%", opacity: 0 },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xiping-video-subtitle-player{width:100%;height:100%;background:#1a1a1a;border-radius:8px;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.xiping-video-subtitle-player__video-wrapper{width:100%;height:100%;background:#000;overflow:hidden}.xiping-video-subtitle-player__video-container{position:relative;width:100%;height:100%;background:#000;overflow:hidden}.xiping-video-subtitle-player__video{position:absolute;top:0;left:0;width:100%;height:100%;padding:0}.xiping-video-subtitle-player__video-container .xgplayer{width:100%!important;height:100%!important}.xiping-video-subtitle-player__video-container .xgplayer video{-o-object-fit:fill!important;object-fit:fill!important}.xiping-video-subtitle-player__subtitle-container{width:100%;height:100%;padding:20px;overflow-y:auto;background:#0000004d}.xiping-video-subtitle-player__resize-handle--horizontal{position:relative;width:2px;background:#ffffff1a;cursor:col-resize;transition:background .2s ease;flex-shrink:0}.xiping-video-subtitle-player__resize-handle--horizontal:hover{background:#fbbf2480}.xiping-video-subtitle-player__resize-handle--horizontal:active{background:#fbbf24cc}.xiping-video-subtitle-player__resize-handle--horizontal:before{content:"";position:absolute;inset:0 -4px;cursor:col-resize}.xiping-video-subtitle-player__resize-handle--vertical{position:relative;height:2px;background:#ffffff1a;cursor:row-resize;transition:background .2s ease;flex-shrink:0}.xiping-video-subtitle-player__resize-handle--vertical:hover{background:#fbbf2480}.xiping-video-subtitle-player__resize-handle--vertical:active{background:#fbbf24cc}.xiping-video-subtitle-player__resize-handle--vertical:before{content:"";position:absolute;inset:-4px 0;cursor:row-resize}.xiping-video-subtitle-player__right{width:100%;height:100%;border-left:1px solid rgba(255,255,255,.1);background:#00000080;display:flex;flex-direction:column}.xiping-video-subtitle-player__detail{flex:1;padding:24px;overflow-y:auto;color:#fff}.xiping-video-subtitle-player__detail-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px;color:#ffffffb3}.xiping-video-subtitle-player__detail-loading-spinner{width:40px;height:40px;border:3px solid rgba(255,255,255,.1);border-top-color:#fbbf24;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.xiping-video-subtitle-player__detail-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:16px;color:#ffffff80;text-align:center}.xiping-video-subtitle-player__detail-empty-icon{font-size:48px;opacity:.5}.xiping-video-subtitle-player__detail-empty-text{font-size:14px;line-height:1.6}.xiping-video-subtitle-player__detail-content{display:flex;flex-direction:column;gap:20px}.xiping-video-subtitle-player__detail-word{font-size:32px;font-weight:700;color:#fbbf24;line-height:1.2;margin-bottom:8px}.xiping-video-subtitle-player__detail-pronunciation{font-size:18px;color:#ffffffb3;font-style:italic;margin-bottom:4px}.xiping-video-subtitle-player__detail-pos{display:inline-block;padding:4px 12px;background:#fbbf2433;color:#fbbf24;border-radius:4px;font-size:12px;font-weight:600;text-transform:uppercase;width:-moz-fit-content;width:fit-content;margin-bottom:8px}.xiping-video-subtitle-player__detail-label{font-size:12px;font-weight:600;color:#ffffff80;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}.xiping-video-subtitle-player__detail-text{font-size:16px;line-height:1.6;color:#ffffffe6}.xiping-video-subtitle-player__detail-translation,.xiping-video-subtitle-player__detail-definition{padding-bottom:16px;border-bottom:1px solid rgba(255,255,255,.1)}.xiping-video-subtitle-player__detail-definition{border-bottom:none}.xiping-video-subtitle-player__detail-examples{display:flex;flex-direction:column;gap:16px}.xiping-video-subtitle-player__detail-example{padding:16px;background:#ffffff0d;border-radius:8px;border-left:3px solid #fbbf24}.xiping-video-subtitle-player__detail-example-en{font-size:15px;line-height:1.6;color:#fffffff2;margin-bottom:8px}.xiping-video-subtitle-player__detail-example-zh{font-size:14px;line-height:1.6;color:#ffffffb3;padding-left:12px;border-left:2px solid rgba(255,255,255,.2)}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar,.xiping-video-subtitle-player__detail::-webkit-scrollbar{width:8px}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar-track,.xiping-video-subtitle-player__detail::-webkit-scrollbar-track{background:#ffffff0d;border-radius:4px}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar-thumb,.xiping-video-subtitle-player__detail::-webkit-scrollbar-thumb{background:#fff3;border-radius:4px}.xiping-video-subtitle-player__subtitle-container::-webkit-scrollbar-thumb:hover,.xiping-video-subtitle-player__detail::-webkit-scrollbar-thumb:hover{background:#ffffff4d}@media(max-width:1024px){.xiping-video-subtitle-player{flex-direction:column;min-height:auto}.xiping-video-subtitle-player__right{width:100%;min-width:unset;max-width:unset;border-left:none;border-top:1px solid rgba(255,255,255,.1);max-height:400px}.xiping-video-subtitle-player__subtitle-container{min-height:150px}}@media(max-width:768px){.xiping-video-subtitle-player__detail{padding:16px}.xiping-video-subtitle-player__detail-word{font-size:24px}.xiping-video-subtitle-player__detail-pronunciation{font-size:16px}.xiping-video-subtitle-player__subtitle-container{padding:16px}}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as N, useEffect as u, useCallback as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
2
|
+
import { useRef as N, useEffect as u, useCallback as R } from "react";
|
|
3
|
+
import j from "xgplayer";
|
|
4
|
+
import './VideoSubtitlePlayer.css';import '../../node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css';/* empty css */
|
|
5
|
+
import { Group as S, Panel as s, Separator as z } from "react-resizable-panels";
|
|
6
|
+
import D from "clsx";
|
|
7
|
+
import { SubtitlePlayer as E } from "../subtitle-player/SubtitlePlayer.js";
|
|
8
|
+
import { useVideoSubtitleStore as H } from "./useVideoSubtitleStore.js";
|
|
8
9
|
/* empty css */
|
|
9
|
-
const
|
|
10
|
+
const A = ({
|
|
10
11
|
videoUrl: m,
|
|
11
|
-
subtitles:
|
|
12
|
+
subtitles: o,
|
|
12
13
|
poster: v,
|
|
13
|
-
className:
|
|
14
|
-
style:
|
|
15
|
-
onFetchDetail:
|
|
14
|
+
className: w = "",
|
|
15
|
+
style: P,
|
|
16
|
+
onFetchDetail: p
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
+
const c = N(null), n = N(null), {
|
|
18
19
|
currentTime: r,
|
|
19
|
-
isPlaying: E,
|
|
20
20
|
setCurrentTime: _,
|
|
21
|
-
setIsPlaying:
|
|
21
|
+
setIsPlaying: d,
|
|
22
22
|
setSubtitles: h,
|
|
23
23
|
currentDetail: l,
|
|
24
24
|
isLoadingDetail: T,
|
|
25
25
|
fetchDetail: y
|
|
26
|
-
} =
|
|
26
|
+
} = H();
|
|
27
27
|
u(() => {
|
|
28
|
-
h(
|
|
29
|
-
}, [
|
|
30
|
-
if (!
|
|
28
|
+
h(o);
|
|
29
|
+
}, [o, h]), u(() => {
|
|
30
|
+
if (!c.current) return;
|
|
31
31
|
const a = `xiping-video-subtitle-player-${Date.now()}`;
|
|
32
|
-
|
|
33
|
-
const i = new
|
|
32
|
+
c.current.id = a;
|
|
33
|
+
const i = new j({
|
|
34
34
|
id: a,
|
|
35
35
|
url: m,
|
|
36
36
|
poster: v,
|
|
@@ -40,89 +40,96 @@ const q = ({
|
|
|
40
40
|
height: "100%",
|
|
41
41
|
controls: !0
|
|
42
42
|
});
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
_(
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
}, g = () => {
|
|
50
|
-
s(!1);
|
|
43
|
+
n.current = i;
|
|
44
|
+
const x = () => {
|
|
45
|
+
const I = i.currentTime || 0;
|
|
46
|
+
_(I);
|
|
47
|
+
}, f = () => {
|
|
48
|
+
d(!0);
|
|
51
49
|
}, b = () => {
|
|
52
|
-
|
|
50
|
+
d(!1);
|
|
51
|
+
}, g = () => {
|
|
52
|
+
d(!1);
|
|
53
53
|
};
|
|
54
|
-
return i.on("timeupdate",
|
|
55
|
-
i.off("timeupdate",
|
|
54
|
+
return i.on("timeupdate", x), i.on("play", f), i.on("pause", b), i.on("ended", g), () => {
|
|
55
|
+
i.off("timeupdate", x), i.off("play", f), i.off("pause", b), i.off("ended", g), i.destroy(), n.current = null;
|
|
56
56
|
};
|
|
57
|
-
}, [m, v, _,
|
|
58
|
-
if (
|
|
59
|
-
const a =
|
|
57
|
+
}, [m, v, _, d]), u(() => {
|
|
58
|
+
if (n.current) {
|
|
59
|
+
const a = n.current;
|
|
60
60
|
Math.abs(a.currentTime - r) > 0.5 && (a.currentTime = r);
|
|
61
61
|
}
|
|
62
62
|
}, [r]);
|
|
63
|
-
const C =
|
|
63
|
+
const C = R(
|
|
64
64
|
async (a) => {
|
|
65
|
-
|
|
65
|
+
p ? await p(a) : await y(a);
|
|
66
66
|
},
|
|
67
|
-
[
|
|
67
|
+
[p, y]
|
|
68
68
|
);
|
|
69
|
-
return /* @__PURE__ */ e(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
children:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
69
|
+
return /* @__PURE__ */ e(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: D("xiping-video-subtitle-player", w),
|
|
73
|
+
style: P,
|
|
74
|
+
children: /* @__PURE__ */ t(S, { orientation: "horizontal", children: [
|
|
75
|
+
/* @__PURE__ */ e(s, { defaultSize: 65, minSize: 40, children: /* @__PURE__ */ t(S, { orientation: "vertical", children: [
|
|
76
|
+
/* @__PURE__ */ e(s, { defaultSize: 60, minSize: 30, children: /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__video-wrapper", children: /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__video-container", children: /* @__PURE__ */ e(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
ref: c,
|
|
80
|
+
className: "xiping-video-subtitle-player__video"
|
|
81
|
+
}
|
|
82
|
+
) }) }) }),
|
|
83
|
+
/* @__PURE__ */ e(z, { className: "xiping-video-subtitle-player__resize-handle xiping-video-subtitle-player__resize-handle--vertical" }),
|
|
84
|
+
/* @__PURE__ */ e(s, { defaultSize: 40, minSize: 20, children: /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__subtitle-container", children: /* @__PURE__ */ e(
|
|
85
|
+
E,
|
|
86
|
+
{
|
|
87
|
+
subtitles: o,
|
|
88
|
+
currentTime: r,
|
|
89
|
+
mode: "current",
|
|
90
|
+
onWordHoverChange: C
|
|
91
|
+
}
|
|
92
|
+
) }) })
|
|
93
|
+
] }) }),
|
|
94
|
+
/* @__PURE__ */ e(z, { className: "xiping-video-subtitle-player__resize-handle xiping-video-subtitle-player__resize-handle--horizontal" }),
|
|
95
|
+
/* @__PURE__ */ e(s, { defaultSize: 35, minSize: 25, maxSize: 50, children: /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__right", children: /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail", children: T ? /* @__PURE__ */ t("div", { className: "xiping-video-subtitle-player__detail-loading", children: [
|
|
96
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-loading-spinner" }),
|
|
97
|
+
/* @__PURE__ */ e("span", { children: "加载中..." })
|
|
98
|
+
] }) : l ? /* @__PURE__ */ t("div", { className: "xiping-video-subtitle-player__detail-content", children: [
|
|
99
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-word", children: l.word }),
|
|
100
|
+
l.pronunciation && /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-pronunciation", children: l.pronunciation }),
|
|
101
|
+
l.partOfSpeech && /* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-pos", children: l.partOfSpeech }),
|
|
102
|
+
l.translation && /* @__PURE__ */ t("div", { className: "xiping-video-subtitle-player__detail-translation", children: [
|
|
103
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-label", children: "中文翻译" }),
|
|
104
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-text", children: l.translation })
|
|
105
|
+
] }),
|
|
106
|
+
l.definition && /* @__PURE__ */ t("div", { className: "xiping-video-subtitle-player__detail-definition", children: [
|
|
107
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-label", children: "英文解释" }),
|
|
108
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-text", children: l.definition })
|
|
109
|
+
] }),
|
|
110
|
+
l.examples && l.examples.length > 0 && /* @__PURE__ */ t("div", { className: "xiping-video-subtitle-player__detail-examples", children: [
|
|
111
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-label", children: "例句" }),
|
|
112
|
+
l.examples.map((a, i) => /* @__PURE__ */ t(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: "xiping-video-subtitle-player__detail-example",
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-example-en", children: a.sentence }),
|
|
118
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-example-zh", children: a.translation })
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
i
|
|
122
|
+
))
|
|
123
|
+
] })
|
|
124
|
+
] }) : /* @__PURE__ */ t("div", { className: "xiping-video-subtitle-player__detail-empty", children: [
|
|
125
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-empty-icon", children: "📖" }),
|
|
126
|
+
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-empty-text", children: "将鼠标悬停在字幕单词上查看详情" })
|
|
127
|
+
] }) }) }) })
|
|
118
128
|
] })
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/* @__PURE__ */ e("div", { className: "xiping-video-subtitle-player__detail-empty-text", children: "将鼠标悬停在字幕单词上查看详情" })
|
|
122
|
-
] }) }) }) })
|
|
123
|
-
] }) });
|
|
129
|
+
}
|
|
130
|
+
);
|
|
124
131
|
};
|
|
125
132
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
A as VideoSubtitlePlayer,
|
|
134
|
+
A as default
|
|
128
135
|
};
|
package/dist/es/index.d.ts
CHANGED
|
@@ -18,13 +18,14 @@ export * from './components/blur-fade';
|
|
|
18
18
|
export * from './components/video-dialog';
|
|
19
19
|
export * from './components/comic-text';
|
|
20
20
|
export * from './components/flip-text';
|
|
21
|
-
export * from './components/animated-list';
|
|
22
21
|
export * from './components/shiny-button';
|
|
22
|
+
export * from './components/shiny-text';
|
|
23
23
|
export * from './components/scratch-to-reveal';
|
|
24
24
|
export * from './components/split-text';
|
|
25
25
|
export * from './components/dome-gallery';
|
|
26
26
|
export * from './components/text-type';
|
|
27
27
|
export * from './components/gradient-text';
|
|
28
|
+
export * from './components/blur-text';
|
|
28
29
|
export * from './components/variable-proximity';
|
|
29
30
|
export * from './components/subtitle-player';
|
|
30
31
|
export * from './components/video-subtitle-player';
|
package/dist/es/index.js
CHANGED
|
@@ -1,71 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
import { Button as r } from "./components/button/Button.js";
|
|
1
|
+
import { Button as t } from "./components/button/Button.js";
|
|
3
2
|
import { TxtReader as x } from "./components/txt-reader/TxtReader.js";
|
|
4
|
-
import { HyperText as
|
|
5
|
-
import { TypingAnimation as
|
|
6
|
-
import { Confetti as l, ConfettiButton as
|
|
7
|
-
import { default as
|
|
8
|
-
import { VariableProximity as
|
|
9
|
-
import { useStayTimeReport as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
3
|
+
import { HyperText as m } from "./components/hyper-text/index.js";
|
|
4
|
+
import { TypingAnimation as a } from "./components/typing-animation/index.js";
|
|
5
|
+
import { Confetti as l, ConfettiButton as u } from "./components/confetti-button/index.js";
|
|
6
|
+
import { default as d } from "./components/gradient-text/index.js";
|
|
7
|
+
import { VariableProximity as s } from "./components/variable-proximity/index.js";
|
|
8
|
+
import { useStayTimeReport as c } from "./hooks/useStayTimeReport.js";
|
|
9
|
+
import { default as h } from "./components/pinch-content/PinchContent.js";
|
|
10
|
+
import { default as g } from "./components/image-viewer/ImageViewer.js";
|
|
12
11
|
import { ShimmerButton as P } from "./components/shimmer-button/ShimmerButton.js";
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
12
|
+
import { default as b } from "./components/image-compare/ImageCompare.js";
|
|
13
|
+
import { default as k } from "./components/shiny-text/ShinyText.js";
|
|
14
|
+
import { default as I } from "./components/text-type/TextType.js";
|
|
15
|
+
import { default as A } from "./components/blur-text/BlurText.js";
|
|
16
|
+
import { TextAnimate as v } from "./components/text-animate/TextAnimate.js";
|
|
17
|
+
import { Dock as E, DockIcon as H } from "./components/dock/Duck.js";
|
|
18
|
+
import { TxtEditor as j } from "./components/txt-editor/TxtEditor.js";
|
|
19
|
+
import { Message as z } from "./components/message/Message.js";
|
|
20
|
+
import { default as K } from "react-force-graph-3d";
|
|
21
|
+
import { default as N } from "canvas-confetti";
|
|
22
|
+
import { Pointer as Q } from "./components/pointer/Pointer.js";
|
|
23
|
+
import { SparklesText as W } from "./components/sparkles-text/SparklesText.js";
|
|
24
|
+
import { BlurFade as Y } from "./components/blur-fade/BlurFade.js";
|
|
25
|
+
import { VideoDialog as _ } from "./components/video-dialog/VideoDialog.js";
|
|
26
|
+
import { ComicText as oo } from "./components/comic-text/ComicText.js";
|
|
27
|
+
import { FlipText as to } from "./components/flip-text/FlipText.js";
|
|
28
28
|
import { ShinyButton as xo } from "./components/shiny-button/ShinyButton.js";
|
|
29
|
-
import { ScratchToReveal as
|
|
30
|
-
import { SplitText as
|
|
29
|
+
import { ScratchToReveal as mo } from "./components/scratch-to-reveal/ScratchToReveal.js";
|
|
30
|
+
import { SplitText as ao } from "./components/split-text/SplitText.js";
|
|
31
31
|
import { SubtitlePlayer as lo } from "./components/subtitle-player/SubtitlePlayer.js";
|
|
32
|
-
import { VideoSubtitlePlayer as
|
|
33
|
-
import { useVideoSubtitleStore as
|
|
32
|
+
import { VideoSubtitlePlayer as no } from "./components/video-subtitle-player/VideoSubtitlePlayer.js";
|
|
33
|
+
import { useVideoSubtitleStore as so } from "./components/video-subtitle-player/useVideoSubtitleStore.js";
|
|
34
34
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
_ as ComicText,
|
|
35
|
+
Y as BlurFade,
|
|
36
|
+
A as BlurText,
|
|
37
|
+
t as Button,
|
|
38
|
+
oo as ComicText,
|
|
40
39
|
l as Confetti,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
u as ConfettiButton,
|
|
41
|
+
E as Dock,
|
|
42
|
+
H as DockIcon,
|
|
43
|
+
to as FlipText,
|
|
44
|
+
K as ForceGraph3D,
|
|
45
|
+
d as GradientText,
|
|
46
|
+
m as HyperText,
|
|
47
|
+
b as ImageCompare,
|
|
48
|
+
g as ImageViewer,
|
|
49
|
+
z as Message,
|
|
50
|
+
h as PinchContent,
|
|
51
|
+
Q as Pointer,
|
|
52
|
+
mo as ScratchToReveal,
|
|
54
53
|
P as ShimmerButton,
|
|
55
54
|
xo as ShinyButton,
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
k as ShinyText,
|
|
56
|
+
W as SparklesText,
|
|
57
|
+
ao as SplitText,
|
|
58
58
|
lo as SubtitlePlayer,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
v as TextAnimate,
|
|
60
|
+
I as TextType,
|
|
61
|
+
j as TxtEditor,
|
|
62
62
|
x as TxtReader,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
co as useVideoSubtitleStore
|
|
63
|
+
a as TypingAnimation,
|
|
64
|
+
s as VariableProximity,
|
|
65
|
+
_ as VideoDialog,
|
|
66
|
+
no as VideoSubtitlePlayer,
|
|
67
|
+
N as confetti,
|
|
68
|
+
c as useStayTimeReport,
|
|
69
|
+
so as useVideoSubtitleStore
|
|
71
70
|
};
|
package/dist/es/llms.txt
CHANGED
|
@@ -18,11 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
### 1. 动画组件
|
|
20
20
|
|
|
21
|
-
#### AnimatedList
|
|
22
|
-
- **功能**: 带有动画效果的列表组件,逐个显示列表项目
|
|
23
|
-
- **特性**: 缩放和透明度动画,可自定义延迟时间
|
|
24
|
-
- **使用场景**: 列表展示、导航菜单、卡片列表
|
|
25
|
-
|
|
26
21
|
#### ConfettiButton
|
|
27
22
|
- **功能**: 带有烟花效果的按钮组件
|
|
28
23
|
- **特性**: 基于 canvas-confetti,支持自定义烟花配置
|
|
@@ -197,21 +192,16 @@ npm install @xiping/react-components
|
|
|
197
192
|
|
|
198
193
|
### 基本使用
|
|
199
194
|
```tsx
|
|
200
|
-
import {
|
|
195
|
+
import { ConfettiButton, ImageViewer } from '@xiping/react-components';
|
|
201
196
|
|
|
202
197
|
function App() {
|
|
203
198
|
return (
|
|
204
199
|
<div>
|
|
205
|
-
<AnimatedList delay={800}>
|
|
206
|
-
<div>项目 1</div>
|
|
207
|
-
<div>项目 2</div>
|
|
208
|
-
</AnimatedList>
|
|
209
|
-
|
|
210
200
|
<ConfettiButton>
|
|
211
201
|
点击触发烟花 🎉
|
|
212
202
|
</ConfettiButton>
|
|
213
203
|
|
|
214
|
-
<
|
|
204
|
+
<ImageViewer images={[...]} />
|
|
215
205
|
</div>
|
|
216
206
|
);
|
|
217
207
|
}
|
|
@@ -281,7 +271,6 @@ MIT License
|
|
|
281
271
|
## 更新日志
|
|
282
272
|
|
|
283
273
|
### v1.0.33
|
|
284
|
-
- 新增 AnimatedList 组件
|
|
285
274
|
- 优化 ConfettiButton 性能
|
|
286
275
|
- 修复 ImageViewer 移动端问题
|
|
287
276
|
- 更新依赖版本
|