@agentscope-ai/design 1.0.26-beta.1768889945788 → 1.0.26-beta.1768893648373

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.
@@ -55,6 +55,7 @@ var Audio = /*#__PURE__*/forwardRef(function (props, ref) {
55
55
  muted = _useControllableValue2[0],
56
56
  setMuted = _useControllableValue2[1];
57
57
  var audioRef = useRef(null);
58
+ var isFirstSrcRef = useRef(true);
58
59
 
59
60
  // 合并refs
60
61
  var combinedRef = function combinedRef(element) {
@@ -68,6 +69,18 @@ var Audio = /*#__PURE__*/forwardRef(function (props, ref) {
68
69
  }
69
70
  };
70
71
 
72
+ // 监听src变化,重新加载音频
73
+ useEffect(function () {
74
+ // 跳过首次设置
75
+ if (isFirstSrcRef.current) {
76
+ isFirstSrcRef.current = false;
77
+ return;
78
+ }
79
+ if (audioRef.current && audioProps.src) {
80
+ audioRef.current.load();
81
+ }
82
+ }, [audioProps.src]);
83
+
71
84
  // 监听isPlaying状态来控制定时器
72
85
  useEffect(function () {
73
86
  var clock;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="40" height="40" viewBox="0 0 40 40"><defs><clipPath id="master_svg0_3_5173"><rect x="0" y="0" width="40" height="40" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_3_5173)"><g><path d="M4.000244140625,33.999989C4.000244140625,37.313709,6.686535340624999,40.000004,10.000241740625,40.000004L30.000238140625,40.000004C33.313948140625,40.000004,36.000238140625,37.313709,36.000238140625,33.999989L36.000238140625,10.000001L26.000238140625,0L10.000241740625,0C6.686535340624999,0,4.000244140625,2.6862917,4.000244140625,6L4.000244140625,33.999989Z" fill="#FFAB19" fill-opacity="1"/></g><g><path d="M24.909516,14.088724978L16.9869661,16.5167396C16.0008106,16.8278344,15.3104787,17.7172475,15.2537766,18.749753L15.2537766,27.09891C14.6780472,26.818808,14.023097,26.746672,13.4002068,26.894759C11.5198851,27.163677,10,28.599791,10,30.109818C10,31.619844,11.5198853,32.546986000000004,13.4009101,32.278065C15.2819343,32.009146,16.6532817,30.619495,16.6532817,29.110171L16.6532817,21.0475311Q16.6532817,20.3801618,17.4593339,20.0929399L24.461083000000002,17.8972373Q25.239680999999997,17.63747,25.239680999999997,18.3513026L25.239680999999997,25.004583C24.615850000000002,24.723058,23.922593,24.632665,23.24743,24.744816999999998C21.366404,24.976425,19.846518500000002,26.385080000000002,19.846518500000002,27.895110000000003C19.846518500000002,29.405139,21.366404,30.359028,23.24743,30.137274C25.128455000000002,29.915521,26.648338,28.497009,26.648338,26.986980000000003L26.648338,15.3213876C26.680285,14.4049432,25.763703,13.75517397,24.909516,14.088724978Z" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M25.999755859375,6C25.999755859375,8.2091389,27.790616959375,10,29.999756359375,10L35.999755859375,10L25.999755859375,0L25.999755859375,6Z" fill="#FFFFFF" fill-opacity="0.4000000059604645"/></g></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="40" height="40" viewBox="0 0 40 40"><defs><clipPath id="master_svg0_3_5191"><rect x="0" y="0" width="40" height="40" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_3_5191)"><g><path d="M4.000244140625,33.999989C4.000244140625,37.313709,6.686535340624999,40.000004,10.000241740625,40.000004L30.000238140625,40.000004C33.313948140625,40.000004,36.000238140625,37.313709,36.000238140625,33.999989L36.000238140625,10.000001L26.000238140625,0L10.000241740625,0C6.686535340624999,0,4.000244140625,2.6862917,4.000244140625,6L4.000244140625,33.999989Z" fill="#4E7DFF" fill-opacity="1"/></g><g><g><path d="M16.1156005859375,22.50004431640625L16.1156005859375,16.72701066640625C16.1156005859375,16.03676268640625,16.8625881059375,15.60516060640625,17.4605879859375,15.94988996640625L22.4693498859375,18.837294116406248L27.475032585937498,21.72292371640625C28.0737175859375,22.06804751640625,28.0737175859375,22.93204121640625,27.475032585937498,23.27716441640625L22.4693498859375,26.16279331640625L17.4605875859375,29.050198316406252C16.8625879859375,29.39492831640625,16.1156005859375,28.963325316406248,16.1156005859375,28.27307831640625L16.1156005859375,22.50004431640625Z" fill="#FFFFFF" fill-opacity="1"/></g></g><g><path d="M25.999755859375,6C25.999755859375,8.2091389,27.790616959375,10,29.999756359375,10L35.999755859375,10L25.999755859375,0L25.999755859375,6Z" fill="#FFFFFF" fill-opacity="0.4000000059604645"/></g></g></svg>
@@ -18,6 +18,8 @@ import ppt from "./icons/ppt.svg";
18
18
  import txt from "./icons/txt.svg";
19
19
  import web from "./icons/web.svg";
20
20
  import word from "./icons/word.svg";
21
+ import video from "./icons/video.svg";
22
+ import audio from "./icons/audio.svg";
21
23
  import { useStyle } from "./index.style";
22
24
  import { jsx as _jsx } from "react/jsx-runtime";
23
25
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -34,7 +36,9 @@ var maps = {
34
36
  ppt: ppt,
35
37
  txt: txt,
36
38
  web: web,
37
- word: word
39
+ word: word,
40
+ video: video,
41
+ audio: audio
38
42
  };
39
43
  function getSize(size) {
40
44
  var retSize = size;
@@ -59,6 +59,7 @@ var Video = /*#__PURE__*/forwardRef(function (props, ref) {
59
59
  setEnableVolume = _useState8[1];
60
60
  var videoRef = useRef(null);
61
61
  var lockMouseEnterAutoPlayRef = useRef(false);
62
+ var isFirstSrcRef = useRef(true);
62
63
 
63
64
  // 合并refs
64
65
  var combinedRef = function combinedRef(element) {
@@ -72,6 +73,18 @@ var Video = /*#__PURE__*/forwardRef(function (props, ref) {
72
73
  }
73
74
  };
74
75
 
76
+ // 监听src变化,重新加载视频
77
+ useEffect(function () {
78
+ // 跳过首次设置
79
+ if (isFirstSrcRef.current) {
80
+ isFirstSrcRef.current = false;
81
+ return;
82
+ }
83
+ if (videoRef.current && videoProps.src) {
84
+ videoRef.current.load();
85
+ }
86
+ }, [videoProps.src]);
87
+
75
88
  // 监听isPlaying状态来控制定时器
76
89
  useEffect(function () {
77
90
  var clock;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/design",
3
- "version": "1.0.26-beta.1768889945788",
3
+ "version": "1.0.26-beta.1768893648373",
4
4
  "description": "AgentScope Spark Design - UI Library for AgentScope AI",
5
5
  "repository": {
6
6
  "type": "git",