@zero-library/common 3.0.11 → 3.1.1
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.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +8 -8
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -21,6 +21,7 @@ interface AudioPlayerProps {
|
|
|
21
21
|
* 音频播放器组件
|
|
22
22
|
* 提供基本的音频播放功能
|
|
23
23
|
* @param props - 组件属性
|
|
24
|
+
* @param key - 强制重新渲染的key - 只更新url不会重新渲染source
|
|
24
25
|
*/
|
|
25
26
|
declare const _default$u: ({ fileUrl }: AudioPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
26
27
|
|
|
@@ -224,6 +225,7 @@ interface VideoPlayerProps {
|
|
|
224
225
|
* 视频播放器组件
|
|
225
226
|
* 提供基本的视频播放功能
|
|
226
227
|
* @param props - 组件属性
|
|
228
|
+
* @param key - 强制重新渲染的key - 只更新url不会重新渲染source
|
|
227
229
|
*/
|
|
228
230
|
declare const _default$l: ({ fileUrl }: VideoPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
229
231
|
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface AudioPlayerProps {
|
|
|
21
21
|
* 音频播放器组件
|
|
22
22
|
* 提供基本的音频播放功能
|
|
23
23
|
* @param props - 组件属性
|
|
24
|
+
* @param key - 强制重新渲染的key - 只更新url不会重新渲染source
|
|
24
25
|
*/
|
|
25
26
|
declare const _default$u: ({ fileUrl }: AudioPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
26
27
|
|
|
@@ -224,6 +225,7 @@ interface VideoPlayerProps {
|
|
|
224
225
|
* 视频播放器组件
|
|
225
226
|
* 提供基本的视频播放功能
|
|
226
227
|
* @param props - 组件属性
|
|
228
|
+
* @param key - 强制重新渲染的key - 只更新url不会重新渲染source
|
|
227
229
|
*/
|
|
228
230
|
declare const _default$l: ({ fileUrl }: VideoPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
229
231
|
|
package/dist/index.esm.js
CHANGED
|
@@ -99,7 +99,7 @@ var AudioPlayer_default = ({ fileUrl }) => {
|
|
|
99
99
|
return /* @__PURE__ */ jsxs("audio", { controls: true, className: styles_module_default.nsPreviewAudio, children: [
|
|
100
100
|
/* @__PURE__ */ jsx("source", { src: fileUrl, type: "audio/mpeg" }),
|
|
101
101
|
"\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 audio \u6807\u7B7E\u3002"
|
|
102
|
-
] });
|
|
102
|
+
] }, fileUrl);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
// src/utils/is.ts
|
|
@@ -1383,7 +1383,7 @@ var VideoPlayer_default = ({ fileUrl }) => {
|
|
|
1383
1383
|
return /* @__PURE__ */ jsxs("video", { controls: true, className: styles_module_default.nsPreviewVideo, children: [
|
|
1384
1384
|
/* @__PURE__ */ jsx("source", { src: fileUrl, type: "video/mp4" }),
|
|
1385
1385
|
"\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002"
|
|
1386
|
-
] });
|
|
1386
|
+
] }, fileUrl);
|
|
1387
1387
|
};
|
|
1388
1388
|
|
|
1389
1389
|
// src/components/LazyComponent/styles.module.less
|
|
@@ -2041,13 +2041,13 @@ var WebSocketManager = class _WebSocketManager {
|
|
|
2041
2041
|
if ((!isNumber(this.maxReconnectAttempts) || this.reconnectAttempts < this.maxReconnectAttempts) && this.reconnectIntervalRef === null) {
|
|
2042
2042
|
this.reconnectIntervalRef = setTimeout(() => {
|
|
2043
2043
|
this.reconnectIntervalRef = null;
|
|
2044
|
-
console.log(`\u5C1D\u8BD5\u7B2C ${this.reconnectAttempts + 1} \u6B21\u91CD\u8FDE...`, this.url);
|
|
2044
|
+
console.log(`[${(/* @__PURE__ */ new Date()).toLocaleString()}]`, `\u5C1D\u8BD5\u7B2C ${this.reconnectAttempts + 1} \u6B21\u91CD\u8FDE...`, this.url);
|
|
2045
2045
|
this.reconnectAttempts++;
|
|
2046
2046
|
this.createAndListenWebSocket();
|
|
2047
2047
|
}, this.reconnectInterval);
|
|
2048
2048
|
} else {
|
|
2049
2049
|
if (isNumber(this.maxReconnectAttempts) && this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
2050
|
-
console.log("\u8FBE\u5230\u6700\u5927\u91CD\u8FDE\u5C1D\u8BD5\u6B21\u6570\uFF0C\u505C\u6B62\u91CD\u8FDE");
|
|
2050
|
+
console.log(`[${(/* @__PURE__ */ new Date()).toLocaleString()}]`, "\u8FBE\u5230\u6700\u5927\u91CD\u8FDE\u5C1D\u8BD5\u6B21\u6570\uFF0C\u505C\u6B62\u91CD\u8FDE");
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
}
|
|
@@ -2056,7 +2056,7 @@ var WebSocketManager = class _WebSocketManager {
|
|
|
2056
2056
|
* WebSocket onopen 事件处理
|
|
2057
2057
|
*/
|
|
2058
2058
|
handleOpen = (newSocket) => {
|
|
2059
|
-
console.log("WebSocket \u8FDE\u63A5\u5DF2\u6253\u5F00");
|
|
2059
|
+
console.log(`[${(/* @__PURE__ */ new Date()).toLocaleString()}]`, "WebSocket \u8FDE\u63A5\u5DF2\u6253\u5F00");
|
|
2060
2060
|
this.stopReconnectTimer();
|
|
2061
2061
|
this.setSocketReadyState(newSocket.readyState);
|
|
2062
2062
|
this.resetHeartbeat(newSocket);
|
|
@@ -2074,7 +2074,7 @@ var WebSocketManager = class _WebSocketManager {
|
|
|
2074
2074
|
* WebSocket onclose 事件处理
|
|
2075
2075
|
*/
|
|
2076
2076
|
handleClose = (event) => {
|
|
2077
|
-
console.log("WebSocket \u8FDE\u63A5\u5DF2\u5173\u95ED", event.code, event.reason);
|
|
2077
|
+
console.log(`[${(/* @__PURE__ */ new Date()).toLocaleString()}]`, "WebSocket \u8FDE\u63A5\u5DF2\u5173\u95ED", event.code, event.reason);
|
|
2078
2078
|
this.setSocketReadyState(WebSocket.CLOSED);
|
|
2079
2079
|
this.stopHeartbeat();
|
|
2080
2080
|
this.listeners.forEach((l) => l.onClose?.());
|
|
@@ -2084,7 +2084,7 @@ var WebSocketManager = class _WebSocketManager {
|
|
|
2084
2084
|
* WebSocket onerror 事件处理
|
|
2085
2085
|
*/
|
|
2086
2086
|
handleError = (error) => {
|
|
2087
|
-
console.error("WebSocket \u53D1\u751F\u9519\u8BEF:", error);
|
|
2087
|
+
console.error(`[${(/* @__PURE__ */ new Date()).toLocaleString()}]`, "WebSocket \u53D1\u751F\u9519\u8BEF:", error);
|
|
2088
2088
|
this.setSocketReadyState(null);
|
|
2089
2089
|
this.stopHeartbeat();
|
|
2090
2090
|
this.tryReconnect();
|
|
@@ -2138,7 +2138,7 @@ var WebSocketManager = class _WebSocketManager {
|
|
|
2138
2138
|
this.socket.send(message3);
|
|
2139
2139
|
this.resetHeartbeat(this.socket);
|
|
2140
2140
|
} else {
|
|
2141
|
-
console.warn("WebSocket \u672A\u8FDE\u63A5\uFF0C\u65E0\u6CD5\u53D1\u9001\u6D88\u606F:", message3);
|
|
2141
|
+
console.warn(`[${(/* @__PURE__ */ new Date()).toLocaleString()}]`, "WebSocket \u672A\u8FDE\u63A5\uFF0C\u65E0\u6CD5\u53D1\u9001\u6D88\u606F:", message3);
|
|
2142
2142
|
}
|
|
2143
2143
|
};
|
|
2144
2144
|
/**
|