qc-ui-lit 0.3.3 → 0.3.5

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.
@@ -8,7 +8,7 @@ var e = class {
8
8
  return t.lang = this.lang, t.rate = this.rate, t.pitch = this.pitch, t.volume = this.volume, t;
9
9
  }
10
10
  playNext() {
11
- if (this.currentIndex >= this.queue.length) {
11
+ if (console.trace("Speech ~ playNext"), console.log("🚀 ~ Speech ~ playNext ~ this.currentIndex >= this.queue.length:", this.currentIndex, this.queue.length), this.currentIndex >= this.queue.length) {
12
12
  this.playing = !1, this.paused = !1, this.onFinish?.();
13
13
  return;
14
14
  }
@@ -18,7 +18,7 @@ var e = class {
18
18
  }, e.onend = () => {
19
19
  this.onEnd?.(), this.currentIndex++, this.playNext();
20
20
  }, e.onerror = (e) => {
21
- this.onError?.(e), this.currentIndex++, this.playNext();
21
+ e.error !== "interrupted" && (this.onError?.(e), this.currentIndex++, this.playNext());
22
22
  }, requestAnimationFrame(() => {
23
23
  this.synth.speak(e);
24
24
  });
@@ -30,7 +30,7 @@ var e = class {
30
30
  let t = e.filter((e) => e.trim().length > 0);
31
31
  if (t.length === 0) return this;
32
32
  let n = this.playing;
33
- return this.queue.push(...t), n || (this.playing = !0, this.paused = !1, this.playNext()), this;
33
+ return console.log("🚀 ~ Speech ~ append ~ wasPlaying:", n, this.queue), this.queue.push(...t), console.log("🚀 ~ Speech ~ append ~ wasPlaying:", this.queue), n || (this.playing = !0, this.paused = !1, this.playNext()), this;
34
34
  }
35
35
  pause() {
36
36
  return this.playing && !this.paused && (this.synth.pause(), this.paused = !0, this.onPause?.()), this;
@@ -0,0 +1,18 @@
1
+ export interface DownloadOptions {
2
+ /** 下载文件名,不传则从 URL 自动提取 */
3
+ filename?: string;
4
+ /** 是否通过 fetch 转 Blob 下载(用于跨域或需要鉴权的资源),默认 false */
5
+ fetch?: boolean;
6
+ /** 请求头(仅在 fetch 为 true 时生效) */
7
+ headers?: Record<string, string>;
8
+ /** fetch 请求凭证(如 cookie),仅在 fetch 为 true 时生效 */
9
+ credentials?: RequestCredentials;
10
+ }
11
+ /**
12
+ * 下载 URL 对应的文件
13
+ * @param url 文件地址
14
+ * @param options 配置项
15
+ * @returns Promise<void>
16
+ */
17
+ export declare function downloadFile(url: string, options?: DownloadOptions): Promise<void>;
18
+ export default downloadFile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qc-ui-lit",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "基于 Lit 的 Web Components 组件库",
5
5
  "author": "",
6
6
  "license": "MIT",