@xiping/react-components 1.0.70 → 1.0.77
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/_virtual/_rolldown/runtime.js +1 -0
- package/dist/cjs/components/blur-fade/BlurFade.js +1 -1
- package/dist/cjs/components/blur-text/BlurText.js +1 -1
- package/dist/cjs/components/button/Button.css +1 -1
- package/dist/cjs/components/button/Button2.js +1 -0
- package/dist/cjs/components/comic-text/ComicText2.js +4 -0
- package/dist/cjs/components/confetti-button/index.js +1 -1
- package/dist/cjs/components/dock/Duck.css +1 -1
- package/dist/cjs/components/dock/Duck2.js +1 -0
- package/dist/cjs/components/flip-text/FlipText.css +1 -1
- package/dist/cjs/components/flip-text/FlipText2.js +1 -0
- package/dist/cjs/components/gradient-text/index.css +1 -1
- package/dist/cjs/components/gradient-text/index2.js +1 -0
- package/dist/cjs/components/hyper-text/HyperText.css +1 -1
- package/dist/cjs/components/hyper-text/index.js +1 -1
- package/dist/cjs/components/image-compare/ImageCompare.css +1 -1
- package/dist/cjs/components/image-compare/ImageCompare2.js +1 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.css +1 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails2.js +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.css +1 -1
- package/dist/cjs/components/image-viewer/ImageViewer.d.ts +1 -1
- package/dist/cjs/components/image-viewer/ImageViewer2.js +1 -0
- package/dist/cjs/components/message/Message.css +1 -1
- package/dist/cjs/components/message/Message2.js +1 -0
- package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
- package/dist/cjs/components/pinch-content/index.js +1 -1
- package/dist/cjs/components/pointer/Pointer.css +1 -1
- package/dist/cjs/components/pointer/Pointer2.js +1 -0
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.css +1 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal2.js +1 -0
- package/dist/cjs/components/shimmer-button/ShimmerButton.css +1 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton2.js +1 -0
- package/dist/cjs/components/shiny-button/ShinyButton.css +1 -1
- package/dist/cjs/components/shiny-button/ShinyButton2.js +1 -0
- package/dist/cjs/components/shiny-text/ShinyText2.js +1 -0
- package/dist/cjs/components/sparkles-text/SparklesText.css +1 -1
- package/dist/cjs/components/sparkles-text/SparklesText2.js +1 -0
- package/dist/cjs/components/split-text/SplitText.css +1 -1
- package/dist/cjs/components/split-text/SplitText2.js +1 -0
- package/dist/cjs/components/subtitle-player/CurrentMode.css +1 -1
- package/dist/cjs/components/subtitle-player/CurrentMode2.js +2 -0
- package/dist/cjs/components/subtitle-player/LyricsMode.css +1 -1
- package/dist/cjs/components/subtitle-player/LyricsMode2.js +2 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.css +1 -1
- package/dist/cjs/components/subtitle-player/SubtitlePlayer2.js +1 -0
- package/dist/cjs/components/subtitle-player/utils.js +1 -1
- package/dist/cjs/components/text-animate/TextAnimate.css +1 -1
- package/dist/cjs/components/text-animate/TextAnimate2.js +2 -0
- package/dist/cjs/components/text-type/TextType.css +1 -1
- package/dist/cjs/components/text-type/TextType2.js +1 -0
- package/dist/cjs/components/txt-editor/TxtEditor.js +4 -4
- package/dist/cjs/components/txt-reader/TxtReader.js +1 -1
- package/dist/cjs/components/txt-reader/index.module.css +1 -1
- package/dist/cjs/components/txt-reader/index.module.js +1 -0
- package/dist/cjs/components/typing-animation/index.css +1 -1
- package/dist/cjs/components/typing-animation/index2.js +1 -0
- package/dist/cjs/components/variable-proximity/index.css +1 -1
- package/dist/cjs/components/variable-proximity/index2.js +1 -0
- package/dist/cjs/components/video-dialog/VideoDialog.css +1 -1
- package/dist/cjs/components/video-dialog/VideoDialog2.js +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.mobile.css +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.pc.css +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer2.js +1 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerMobile.js +1 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayerPC.js +1 -1
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.js +1 -1
- package/dist/cjs/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.js +1 -1
- package/dist/cjs/components/video-subtitle-player/useVideoSubtitleStore.js +1 -1
- package/dist/cjs/components/video-subtitle-player/useXGPlayer.js +1 -1
- package/dist/cjs/hooks/useStayTimeReport.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.24_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -1
- package/dist/cjs/packages/subtitle/lib/index.js +1 -0
- package/dist/cjs/packages/subtitle/lib/src/json-converter.js +1 -1
- package/dist/cjs/packages/subtitle/lib/src/parser.js +5 -5
- package/dist/cjs/react-components.css +27 -27
- package/dist/es/components/blur-fade/BlurFade.js +37 -49
- package/dist/es/components/blur-text/BlurText.js +67 -76
- package/dist/es/components/button/Button.css +1 -1
- package/dist/es/components/button/Button2.js +48 -0
- package/dist/es/components/comic-text/ComicText2.js +55 -0
- package/dist/es/components/confetti-button/index.js +63 -75
- package/dist/es/components/dock/Duck.css +1 -1
- package/dist/es/components/dock/Duck2.js +60 -0
- package/dist/es/components/flip-text/FlipText.css +1 -1
- package/dist/es/components/flip-text/FlipText2.js +41 -0
- package/dist/es/components/gradient-text/index.css +1 -1
- package/dist/es/components/gradient-text/index2.js +29 -0
- package/dist/es/components/hyper-text/HyperText.css +1 -1
- package/dist/es/components/hyper-text/index.js +51 -79
- package/dist/es/components/image-compare/ImageCompare.css +1 -1
- package/dist/es/components/image-compare/ImageCompare2.js +96 -0
- package/dist/es/components/image-viewer/ImageThumbnails.css +1 -1
- package/dist/es/components/image-viewer/ImageThumbnails2.js +40 -0
- package/dist/es/components/image-viewer/ImageViewer.css +1 -1
- package/dist/es/components/image-viewer/ImageViewer.d.ts +1 -1
- package/dist/es/components/image-viewer/ImageViewer2.js +151 -0
- package/dist/es/components/message/Message.css +1 -1
- package/dist/es/components/message/Message2.js +189 -0
- package/dist/es/components/pinch-content/PinchContent.js +120 -127
- package/dist/es/components/pinch-content/index.js +5 -5
- package/dist/es/components/pointer/Pointer.css +1 -1
- package/dist/es/components/pointer/Pointer2.js +61 -0
- package/dist/es/components/react-force-graph-3d/index.js +2 -0
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.css +1 -1
- package/dist/es/components/scratch-to-reveal/ScratchToReveal2.js +88 -0
- package/dist/es/components/shimmer-button/ShimmerButton.css +1 -1
- package/dist/es/components/shimmer-button/ShimmerButton2.js +33 -0
- package/dist/es/components/shiny-button/ShinyButton.css +1 -1
- package/dist/es/components/shiny-button/ShinyButton2.js +53 -0
- package/dist/es/components/shiny-text/ShinyText2.js +61 -0
- package/dist/es/components/sparkles-text/SparklesText.css +1 -1
- package/dist/es/components/sparkles-text/SparklesText2.js +90 -0
- package/dist/es/components/split-text/SplitText.css +1 -1
- package/dist/es/components/split-text/SplitText2.js +109 -0
- package/dist/es/components/subtitle-player/CurrentMode.css +1 -1
- package/dist/es/components/subtitle-player/CurrentMode2.js +44 -0
- package/dist/es/components/subtitle-player/LyricsMode.css +1 -1
- package/dist/es/components/subtitle-player/LyricsMode2.js +114 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.css +1 -1
- package/dist/es/components/subtitle-player/SubtitlePlayer2.js +169 -0
- package/dist/es/components/subtitle-player/utils.js +63 -69
- package/dist/es/components/text-animate/TextAnimate.css +1 -1
- package/dist/es/components/text-animate/TextAnimate2.js +312 -0
- package/dist/es/components/text-type/TextType.css +1 -1
- package/dist/es/components/text-type/TextType2.js +80 -0
- package/dist/es/components/txt-editor/TxtEditor.js +60 -95
- package/dist/es/components/txt-reader/TxtReader.js +45 -74
- package/dist/es/components/txt-reader/index.module.css +1 -1
- package/dist/es/components/txt-reader/index.module.js +10 -0
- package/dist/es/components/typing-animation/index.css +1 -1
- package/dist/es/components/typing-animation/index2.js +43 -0
- package/dist/es/components/variable-proximity/index.css +1 -1
- package/dist/es/components/variable-proximity/index2.js +179 -0
- package/dist/es/components/video-dialog/VideoDialog.css +1 -1
- package/dist/es/components/video-dialog/VideoDialog2.js +168 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.css +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.mobile.css +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.pc.css +1 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer2.js +43 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerMobile.js +29 -46
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayerPC.js +94 -74
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.js +24 -21
- package/dist/es/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.js +58 -50
- package/dist/es/components/video-subtitle-player/useVideoSubtitleStore.js +61 -56
- package/dist/es/components/video-subtitle-player/useXGPlayer.js +38 -35
- package/dist/es/hooks/useStayTimeReport.js +29 -29
- package/dist/es/index.js +33 -70
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.24_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css +1 -1
- package/dist/es/packages/subtitle/lib/index.js +2 -0
- package/dist/es/packages/subtitle/lib/src/json-converter.js +22 -23
- package/dist/es/packages/subtitle/lib/src/parser.js +41 -54
- package/dist/es/react-components.css +27 -27
- package/package.json +26 -27
- package/dist/cjs/components/button/Button.js +0 -1
- package/dist/cjs/components/comic-text/ComicText.js +0 -4
- package/dist/cjs/components/dock/Duck.js +0 -1
- package/dist/cjs/components/flip-text/FlipText.js +0 -1
- package/dist/cjs/components/gradient-text/index.js +0 -1
- package/dist/cjs/components/image-compare/ImageCompare.js +0 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails.js +0 -1
- package/dist/cjs/components/image-viewer/ImageViewer.js +0 -1
- package/dist/cjs/components/message/Message.js +0 -1
- package/dist/cjs/components/pointer/Pointer.js +0 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.js +0 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton.js +0 -1
- package/dist/cjs/components/shiny-button/ShinyButton.js +0 -1
- package/dist/cjs/components/shiny-text/ShinyText.js +0 -1
- package/dist/cjs/components/sparkles-text/SparklesText.js +0 -1
- package/dist/cjs/components/split-text/SplitText.js +0 -1
- package/dist/cjs/components/subtitle-player/CurrentMode.js +0 -2
- package/dist/cjs/components/subtitle-player/LyricsMode.js +0 -2
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.js +0 -1
- package/dist/cjs/components/text-animate/TextAnimate.js +0 -2
- package/dist/cjs/components/text-type/TextType.js +0 -1
- package/dist/cjs/components/txt-reader/index.module.css.js +0 -1
- package/dist/cjs/components/typing-animation/index.js +0 -1
- package/dist/cjs/components/variable-proximity/index.js +0 -1
- package/dist/cjs/components/video-dialog/VideoDialog.js +0 -1
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.js +0 -1
- package/dist/es/components/button/Button.js +0 -72
- package/dist/es/components/comic-text/ComicText.js +0 -52
- package/dist/es/components/dock/Duck.js +0 -80
- package/dist/es/components/flip-text/FlipText.js +0 -38
- package/dist/es/components/gradient-text/index.js +0 -22
- package/dist/es/components/image-compare/ImageCompare.js +0 -127
- package/dist/es/components/image-viewer/ImageThumbnails.js +0 -73
- package/dist/es/components/image-viewer/ImageViewer.js +0 -141
- package/dist/es/components/message/Message.js +0 -220
- package/dist/es/components/pointer/Pointer.js +0 -75
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.js +0 -97
- package/dist/es/components/shimmer-button/ShimmerButton.js +0 -42
- package/dist/es/components/shiny-button/ShinyButton.js +0 -61
- package/dist/es/components/shiny-text/ShinyText.js +0 -76
- package/dist/es/components/sparkles-text/SparklesText.js +0 -71
- package/dist/es/components/split-text/SplitText.js +0 -116
- package/dist/es/components/subtitle-player/CurrentMode.js +0 -78
- package/dist/es/components/subtitle-player/LyricsMode.js +0 -152
- package/dist/es/components/subtitle-player/SubtitlePlayer.js +0 -234
- package/dist/es/components/text-animate/TextAnimate.js +0 -310
- package/dist/es/components/text-type/TextType.js +0 -121
- package/dist/es/components/txt-reader/index.module.css.js +0 -10
- package/dist/es/components/typing-animation/index.js +0 -56
- package/dist/es/components/variable-proximity/index.js +0 -211
- package/dist/es/components/video-dialog/VideoDialog.js +0 -113
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.js +0 -74
|
@@ -1,75 +1,95 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
import e from "../subtitle-player/SubtitlePlayer2.js";
|
|
2
|
+
import { VideoSubtitlePlayerLayoutPC as t } from "./layouts/VideoSubtitlePlayerLayoutPC.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { useCallback as i } from "react";
|
|
5
|
+
import a from "clsx";
|
|
6
|
+
//#region src/components/video-subtitle-player/VideoSubtitlePlayerPC.tsx
|
|
7
|
+
var o = ({ playerRef: o, subtitles: s, currentTime: c, currentDetail: l, isLoadingDetail: u, onWordHoverChange: d, className: f = "", style: p }) => {
|
|
8
|
+
let m = i(async (e) => {
|
|
9
|
+
await d(e);
|
|
10
|
+
}, [d]), h = /* @__PURE__ */ n("div", {
|
|
11
|
+
ref: o,
|
|
12
|
+
className: "xiping-video-subtitle-player__video"
|
|
13
|
+
}), g = /* @__PURE__ */ n(e, {
|
|
14
|
+
subtitles: s,
|
|
15
|
+
currentTime: c,
|
|
16
|
+
mode: "lyrics",
|
|
17
|
+
onWordHoverChange: m
|
|
18
|
+
}), _ = /* @__PURE__ */ n("div", {
|
|
19
|
+
className: "xiping-video-subtitle-player__detail",
|
|
20
|
+
children: u ? /* @__PURE__ */ r("div", {
|
|
21
|
+
className: "xiping-video-subtitle-player__detail-loading",
|
|
22
|
+
children: [/* @__PURE__ */ n("div", { className: "xiping-video-subtitle-player__detail-loading-spinner" }), /* @__PURE__ */ n("span", { children: "加载中..." })]
|
|
23
|
+
}) : l ? /* @__PURE__ */ r("div", {
|
|
24
|
+
className: "xiping-video-subtitle-player__detail-content",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ n("div", {
|
|
27
|
+
className: "xiping-video-subtitle-player__detail-word",
|
|
28
|
+
children: l.word
|
|
29
|
+
}),
|
|
30
|
+
l.pronunciation && /* @__PURE__ */ n("div", {
|
|
31
|
+
className: "xiping-video-subtitle-player__detail-pronunciation",
|
|
32
|
+
children: l.pronunciation
|
|
33
|
+
}),
|
|
34
|
+
l.partOfSpeech && /* @__PURE__ */ n("div", {
|
|
35
|
+
className: "xiping-video-subtitle-player__detail-pos",
|
|
36
|
+
children: l.partOfSpeech
|
|
37
|
+
}),
|
|
38
|
+
l.translation && /* @__PURE__ */ r("div", {
|
|
39
|
+
className: "xiping-video-subtitle-player__detail-translation",
|
|
40
|
+
children: [/* @__PURE__ */ n("div", {
|
|
41
|
+
className: "xiping-video-subtitle-player__detail-label",
|
|
42
|
+
children: "中文翻译"
|
|
43
|
+
}), /* @__PURE__ */ n("div", {
|
|
44
|
+
className: "xiping-video-subtitle-player__detail-text",
|
|
45
|
+
children: l.translation
|
|
46
|
+
})]
|
|
47
|
+
}),
|
|
48
|
+
l.definition && /* @__PURE__ */ r("div", {
|
|
49
|
+
className: "xiping-video-subtitle-player__detail-definition",
|
|
50
|
+
children: [/* @__PURE__ */ n("div", {
|
|
51
|
+
className: "xiping-video-subtitle-player__detail-label",
|
|
52
|
+
children: "英文解释"
|
|
53
|
+
}), /* @__PURE__ */ n("div", {
|
|
54
|
+
className: "xiping-video-subtitle-player__detail-text",
|
|
55
|
+
children: l.definition
|
|
56
|
+
})]
|
|
57
|
+
}),
|
|
58
|
+
l.examples && l.examples.length > 0 && /* @__PURE__ */ r("div", {
|
|
59
|
+
className: "xiping-video-subtitle-player__detail-examples",
|
|
60
|
+
children: [/* @__PURE__ */ n("div", {
|
|
61
|
+
className: "xiping-video-subtitle-player__detail-label",
|
|
62
|
+
children: "例句"
|
|
63
|
+
}), l.examples.map((e, t) => /* @__PURE__ */ r("div", {
|
|
64
|
+
className: "xiping-video-subtitle-player__detail-example",
|
|
65
|
+
children: [/* @__PURE__ */ n("div", {
|
|
66
|
+
className: "xiping-video-subtitle-player__detail-example-en",
|
|
67
|
+
children: e.sentence
|
|
68
|
+
}), /* @__PURE__ */ n("div", {
|
|
69
|
+
className: "xiping-video-subtitle-player__detail-example-zh",
|
|
70
|
+
children: e.translation
|
|
71
|
+
})]
|
|
72
|
+
}, t))]
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
}) : /* @__PURE__ */ r("div", {
|
|
76
|
+
className: "xiping-video-subtitle-player__detail-empty",
|
|
77
|
+
children: [/* @__PURE__ */ n("div", {
|
|
78
|
+
className: "xiping-video-subtitle-player__detail-empty-icon",
|
|
79
|
+
children: "📖"
|
|
80
|
+
}), /* @__PURE__ */ n("div", {
|
|
81
|
+
className: "xiping-video-subtitle-player__detail-empty-text",
|
|
82
|
+
children: "将鼠标悬停在字幕单词上查看详情"
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
return /* @__PURE__ */ n(t, {
|
|
87
|
+
className: a(f),
|
|
88
|
+
style: p,
|
|
89
|
+
videoSlot: h,
|
|
90
|
+
subtitleSlot: g,
|
|
91
|
+
detailSlot: _
|
|
92
|
+
});
|
|
75
93
|
};
|
|
94
|
+
//#endregion
|
|
95
|
+
export { o as VideoSubtitlePlayerPC };
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
1
|
+
import '../VideoSubtitlePlayer.mobile.css';/* empty css */
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
//#region src/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutMobile.tsx
|
|
6
|
+
var r = ({ className: r = "", style: i, videoSlot: a, subtitleSlot: o }) => /* @__PURE__ */ t("div", {
|
|
7
|
+
className: n("xiping-video-subtitle-player", "xiping-video-subtitle-player--mobile", r),
|
|
8
|
+
style: i,
|
|
9
|
+
children: [/* @__PURE__ */ e("div", {
|
|
10
|
+
className: "xiping-video-subtitle-player__mobile-video",
|
|
11
|
+
children: /* @__PURE__ */ e("div", {
|
|
12
|
+
className: "xiping-video-subtitle-player__mobile-video-wrapper",
|
|
13
|
+
children: /* @__PURE__ */ e("div", {
|
|
14
|
+
className: "xiping-video-subtitle-player__mobile-video-container",
|
|
15
|
+
children: a
|
|
16
|
+
})
|
|
17
|
+
})
|
|
18
|
+
}), /* @__PURE__ */ e("div", {
|
|
19
|
+
className: "xiping-video-subtitle-player__mobile-subtitle",
|
|
20
|
+
children: o
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as VideoSubtitlePlayerLayoutMobile };
|
|
@@ -1,50 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
import '../VideoSubtitlePlayer.pc.css';/* empty css */
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { Group as r, Panel as i, Separator as a } from "react-resizable-panels";
|
|
6
|
+
//#region src/components/video-subtitle-player/layouts/VideoSubtitlePlayerLayoutPC.tsx
|
|
7
|
+
var o = ({ className: o = "", style: s, videoSlot: c, subtitleSlot: l, detailSlot: u }) => /* @__PURE__ */ e("div", {
|
|
8
|
+
className: n("xiping-video-subtitle-player", "xiping-video-subtitle-player--pc", o),
|
|
9
|
+
style: s,
|
|
10
|
+
children: /* @__PURE__ */ t(r, {
|
|
11
|
+
orientation: "horizontal",
|
|
12
|
+
className: "xiping-video-subtitle-player__panel-group",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ e(i, {
|
|
15
|
+
defaultSize: "65",
|
|
16
|
+
minSize: "40",
|
|
17
|
+
children: /* @__PURE__ */ t(r, {
|
|
18
|
+
orientation: "vertical",
|
|
19
|
+
className: "xiping-video-subtitle-player__panel-group-inner",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ e(i, {
|
|
22
|
+
defaultSize: "60",
|
|
23
|
+
minSize: "30",
|
|
24
|
+
children: /* @__PURE__ */ e("div", {
|
|
25
|
+
className: "xiping-video-subtitle-player__video-wrapper",
|
|
26
|
+
children: /* @__PURE__ */ e("div", {
|
|
27
|
+
className: "xiping-video-subtitle-player__video-container",
|
|
28
|
+
children: c
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ e(a, { className: n("xiping-video-subtitle-player__resize-handle", "xiping-video-subtitle-player__resize-handle--vertical") }),
|
|
33
|
+
/* @__PURE__ */ e(i, {
|
|
34
|
+
defaultSize: "40",
|
|
35
|
+
minSize: "20",
|
|
36
|
+
children: /* @__PURE__ */ e("div", {
|
|
37
|
+
className: "xiping-video-subtitle-player__subtitle-container",
|
|
38
|
+
children: l
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
})
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ e(a, { className: n("xiping-video-subtitle-player__resize-handle", "xiping-video-subtitle-player__resize-handle--horizontal") }),
|
|
45
|
+
/* @__PURE__ */ e(i, {
|
|
46
|
+
defaultSize: "35",
|
|
47
|
+
minSize: "25",
|
|
48
|
+
maxSize: "50",
|
|
49
|
+
children: /* @__PURE__ */ e("div", {
|
|
50
|
+
className: "xiping-video-subtitle-player__right",
|
|
51
|
+
children: u
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { o as VideoSubtitlePlayerLayoutPC };
|
|
@@ -1,57 +1,62 @@
|
|
|
1
|
-
import { create as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { create as e } from "zustand";
|
|
2
|
+
//#region src/components/video-subtitle-player/useVideoSubtitleStore.ts
|
|
3
|
+
var t = {
|
|
4
|
+
currentTime: 0,
|
|
5
|
+
isPlaying: !1,
|
|
6
|
+
subtitles: [],
|
|
7
|
+
currentDetail: null,
|
|
8
|
+
isLoadingDetail: !1
|
|
9
|
+
}, n = e((e, n) => ({
|
|
10
|
+
...t,
|
|
11
|
+
setCurrentTime: (t) => {
|
|
12
|
+
e({ currentTime: t });
|
|
13
|
+
},
|
|
14
|
+
setIsPlaying: (t) => {
|
|
15
|
+
e({ isPlaying: t });
|
|
16
|
+
},
|
|
17
|
+
setSubtitles: (t) => {
|
|
18
|
+
e({ subtitles: t });
|
|
19
|
+
},
|
|
20
|
+
setCurrentDetail: (t) => {
|
|
21
|
+
e({ currentDetail: t });
|
|
22
|
+
},
|
|
23
|
+
setIsLoadingDetail: (t) => {
|
|
24
|
+
e({ isLoadingDetail: t });
|
|
25
|
+
},
|
|
26
|
+
fetchDetail: async (t) => {
|
|
27
|
+
if (!t) {
|
|
28
|
+
e({
|
|
29
|
+
currentDetail: null,
|
|
30
|
+
isLoadingDetail: !1
|
|
31
|
+
});
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
e({ isLoadingDetail: !0 });
|
|
35
|
+
try {
|
|
36
|
+
await new Promise((e) => setTimeout(e, 300)), e({
|
|
37
|
+
currentDetail: {
|
|
38
|
+
word: t.word,
|
|
39
|
+
pronunciation: `/${t.word.toLowerCase()}/`,
|
|
40
|
+
translation: `${t.word}的中文翻译`,
|
|
41
|
+
definition: `Definition of ${t.word}`,
|
|
42
|
+
examples: [{
|
|
43
|
+
sentence: `This is an example sentence with ${t.word}.`,
|
|
44
|
+
translation: `这是一个包含${t.word}的例句。`
|
|
45
|
+
}],
|
|
46
|
+
partOfSpeech: "noun"
|
|
47
|
+
},
|
|
48
|
+
isLoadingDetail: !1
|
|
49
|
+
});
|
|
50
|
+
} catch (t) {
|
|
51
|
+
console.error("获取详情失败:", t), e({
|
|
52
|
+
currentDetail: null,
|
|
53
|
+
isLoadingDetail: !1
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
reset: () => {
|
|
58
|
+
e(t);
|
|
59
|
+
}
|
|
54
60
|
}));
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { n as useVideoSubtitleStore };
|
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import '../../node_modules/.pnpm/xgplayer@3.0.24_core-js@3.47.0/node_modules/xgplayer/dist/index.min.css';/* empty css */
|
|
2
|
+
import { useEffect as e, useRef as t } from "react";
|
|
3
|
+
import n from "xgplayer";
|
|
4
|
+
//#region src/components/video-subtitle-player/useXGPlayer.ts
|
|
5
|
+
function r(r, i, a, o, s) {
|
|
6
|
+
let c = t(null), { setCurrentTime: l, setIsPlaying: u } = o;
|
|
7
|
+
e(() => {
|
|
8
|
+
if (!r.current) return;
|
|
9
|
+
let e = `xiping-video-subtitle-player-${Date.now()}`;
|
|
10
|
+
r.current.id = e;
|
|
11
|
+
let t = new n({
|
|
12
|
+
id: e,
|
|
13
|
+
url: i,
|
|
14
|
+
poster: a,
|
|
15
|
+
autoplay: !1,
|
|
16
|
+
fluid: !1,
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%",
|
|
19
|
+
controls: !0
|
|
20
|
+
});
|
|
21
|
+
c.current = t;
|
|
22
|
+
let o = () => {
|
|
23
|
+
l(t.currentTime ?? 0);
|
|
24
|
+
}, s = () => u(!0), d = () => u(!1), f = () => u(!1);
|
|
25
|
+
return t.on("timeupdate", o), t.on("play", s), t.on("pause", d), t.on("ended", f), () => {
|
|
26
|
+
t.off("timeupdate", o), t.off("play", s), t.off("pause", d), t.off("ended", f), t.destroy(), c.current = null;
|
|
27
|
+
};
|
|
28
|
+
}, [
|
|
29
|
+
i,
|
|
30
|
+
a,
|
|
31
|
+
l,
|
|
32
|
+
u
|
|
33
|
+
]), e(() => {
|
|
34
|
+
let e = c.current;
|
|
35
|
+
e && Math.abs(e.currentTime - s) > .5 && (e.currentTime = s);
|
|
36
|
+
}, [s]);
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { r as useXGPlayer };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useEffect as e, useRef as t } from "react";
|
|
2
|
+
import n from "bowser";
|
|
3
|
+
//#region src/hooks/useStayTimeReport.ts
|
|
4
|
+
function r() {
|
|
5
|
+
let e = n.getParser(window.navigator.userAgent), t = e.getBrowser(), r = e.getOS();
|
|
6
|
+
return `${t.name} ${t.version} (${r.name} ${r.version})`;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
function i(n) {
|
|
9
|
+
let i = t(Date.now()), a = t(!1);
|
|
10
|
+
e(() => {
|
|
11
|
+
i.current = Date.now(), a.current = !1;
|
|
12
|
+
let e = () => {
|
|
13
|
+
if (a.current) return;
|
|
14
|
+
a.current = !0;
|
|
15
|
+
let e = Date.now(), t = e - i.current, o = r();
|
|
16
|
+
n({
|
|
17
|
+
enterTime: i.current,
|
|
18
|
+
leaveTime: e,
|
|
19
|
+
duration: t,
|
|
20
|
+
browser: o
|
|
21
|
+
});
|
|
22
|
+
}, t = () => {
|
|
23
|
+
document.visibilityState === "hidden" && e();
|
|
24
|
+
};
|
|
25
|
+
return window.addEventListener("beforeunload", e), document.addEventListener("visibilitychange", t), () => {
|
|
26
|
+
e(), window.removeEventListener("beforeunload", e), document.removeEventListener("visibilitychange", t);
|
|
27
|
+
};
|
|
28
|
+
}, []);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as useStayTimeReport };
|