@wq-hook/volcano-react 1.0.7 → 1.0.8
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/index.js +27 -0
- package/dist/index.mjs +27 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2196,6 +2196,30 @@ var AudioProgressBar = ({
|
|
|
2196
2196
|
window.addEventListener("mousemove", handleMouseMove);
|
|
2197
2197
|
window.addEventListener("mouseup", handleMouseUp);
|
|
2198
2198
|
};
|
|
2199
|
+
const handleTouchStart = (e) => {
|
|
2200
|
+
if (!onSeek) return;
|
|
2201
|
+
e.preventDefault();
|
|
2202
|
+
e.stopPropagation();
|
|
2203
|
+
isDragging.current = true;
|
|
2204
|
+
const touch = e.touches[0];
|
|
2205
|
+
const percentage = calculateProgress(touch.clientX);
|
|
2206
|
+
updateVisuals(percentage);
|
|
2207
|
+
};
|
|
2208
|
+
const handleTouchMove = (e) => {
|
|
2209
|
+
if (!onSeek || !isDragging.current) return;
|
|
2210
|
+
e.preventDefault();
|
|
2211
|
+
const touch = e.touches[0];
|
|
2212
|
+
const percentage = calculateProgress(touch.clientX);
|
|
2213
|
+
updateVisuals(percentage);
|
|
2214
|
+
};
|
|
2215
|
+
const handleTouchEnd = (e) => {
|
|
2216
|
+
if (!onSeek || !isDragging.current) return;
|
|
2217
|
+
e.preventDefault();
|
|
2218
|
+
isDragging.current = false;
|
|
2219
|
+
const touch = e.changedTouches[0];
|
|
2220
|
+
const percentage = calculateProgress(touch.clientX);
|
|
2221
|
+
onSeek(percentage);
|
|
2222
|
+
};
|
|
2199
2223
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2200
2224
|
"div",
|
|
2201
2225
|
{
|
|
@@ -2216,6 +2240,9 @@ var AudioProgressBar = ({
|
|
|
2216
2240
|
onMouseDown: handleMouseDown,
|
|
2217
2241
|
onMouseEnter: handleMouseEnter,
|
|
2218
2242
|
onMouseLeave: handleMouseLeave,
|
|
2243
|
+
onTouchStart: handleTouchStart,
|
|
2244
|
+
onTouchMove: handleTouchMove,
|
|
2245
|
+
onTouchEnd: handleTouchEnd,
|
|
2219
2246
|
children: [
|
|
2220
2247
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2221
2248
|
"div",
|
package/dist/index.mjs
CHANGED
|
@@ -2152,6 +2152,30 @@ var AudioProgressBar = ({
|
|
|
2152
2152
|
window.addEventListener("mousemove", handleMouseMove);
|
|
2153
2153
|
window.addEventListener("mouseup", handleMouseUp);
|
|
2154
2154
|
};
|
|
2155
|
+
const handleTouchStart = (e) => {
|
|
2156
|
+
if (!onSeek) return;
|
|
2157
|
+
e.preventDefault();
|
|
2158
|
+
e.stopPropagation();
|
|
2159
|
+
isDragging.current = true;
|
|
2160
|
+
const touch = e.touches[0];
|
|
2161
|
+
const percentage = calculateProgress(touch.clientX);
|
|
2162
|
+
updateVisuals(percentage);
|
|
2163
|
+
};
|
|
2164
|
+
const handleTouchMove = (e) => {
|
|
2165
|
+
if (!onSeek || !isDragging.current) return;
|
|
2166
|
+
e.preventDefault();
|
|
2167
|
+
const touch = e.touches[0];
|
|
2168
|
+
const percentage = calculateProgress(touch.clientX);
|
|
2169
|
+
updateVisuals(percentage);
|
|
2170
|
+
};
|
|
2171
|
+
const handleTouchEnd = (e) => {
|
|
2172
|
+
if (!onSeek || !isDragging.current) return;
|
|
2173
|
+
e.preventDefault();
|
|
2174
|
+
isDragging.current = false;
|
|
2175
|
+
const touch = e.changedTouches[0];
|
|
2176
|
+
const percentage = calculateProgress(touch.clientX);
|
|
2177
|
+
onSeek(percentage);
|
|
2178
|
+
};
|
|
2155
2179
|
return /* @__PURE__ */ jsxs(
|
|
2156
2180
|
"div",
|
|
2157
2181
|
{
|
|
@@ -2172,6 +2196,9 @@ var AudioProgressBar = ({
|
|
|
2172
2196
|
onMouseDown: handleMouseDown,
|
|
2173
2197
|
onMouseEnter: handleMouseEnter,
|
|
2174
2198
|
onMouseLeave: handleMouseLeave,
|
|
2199
|
+
onTouchStart: handleTouchStart,
|
|
2200
|
+
onTouchMove: handleTouchMove,
|
|
2201
|
+
onTouchEnd: handleTouchEnd,
|
|
2175
2202
|
children: [
|
|
2176
2203
|
/* @__PURE__ */ jsxs(
|
|
2177
2204
|
"div",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wq-hook/volcano-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Volcano Engine ASR & TTS React Hooks",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"emoji-regex": "^10.6.0",
|
|
27
|
-
"@wq-hook/volcano-sdk": "1.0.
|
|
27
|
+
"@wq-hook/volcano-sdk": "1.0.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/react": "^19.0.0",
|