@44-audio/components 0.1.0-dev.14 → 0.1.0-dev.15

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.
Files changed (2) hide show
  1. package/dist/player.es.js +18 -18
  2. package/package.json +1 -1
package/dist/player.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d as ut, c as Q, p as V, a as W, b as v, f as y, A as pt, i as S, t as h, s as ft, e as i, g as X, h as g, j as n, u as G, k as _, l as b, r as m, m as T, n as L, o as F, q as D, v as u, w as N, x as bt, y as ht } from "./AudioPlayer-BnKA5uw-.mjs";
1
+ import { d as ut, c as Q, p as V, a as W, b as v, f as y, A as ft, i as S, t as h, s as pt, e as i, g as X, h as g, j as n, u as G, k as _, l as b, r as m, m as T, n as L, o as F, q as D, v as u, w as N, x as bt, y as ht } from "./AudioPlayer-BnKA5uw-.mjs";
2
2
  function _t(d, e) {
3
3
  u(e, !n(e));
4
4
  }
@@ -9,7 +9,7 @@ const St = {
9
9
  };
10
10
  function Y(d, e) {
11
11
  V(e, !0), W(d, St);
12
- let l = v(e, "recordingId", 7), a = v(e, "recording", 7, null), c = v(e, "loading", 7, !1), j = v(e, "error", 7, !1), x = v(e, "apiHost", 7), p = L(!1), f = L(!1);
12
+ let l = v(e, "recordingId", 7), a = v(e, "recording", 7, null), c = v(e, "loading", 7, !1), j = v(e, "error", 7, !1), x = v(e, "apiHost", 7), f = L(!1), p = L(!1);
13
13
  const O = G(() => a()?.waveform ?? Array(100).fill(0));
14
14
  var k = {
15
15
  get recordingId() {
@@ -47,7 +47,7 @@ function Y(d, e) {
47
47
  var o = _(w), Z = _(o);
48
48
  {
49
49
  let t = G(() => `https://${x()}/v1/recordings/${l()}/audio.mp3`);
50
- pt(Z, {
50
+ ft(Z, {
51
51
  get audioURL() {
52
52
  return n(t);
53
53
  },
@@ -71,9 +71,9 @@ function Y(d, e) {
71
71
  {
72
72
  var et = (t) => {
73
73
  var s = yt(), A = b(T(s));
74
- A.__click = [_t, p];
74
+ A.__click = [_t, f];
75
75
  var U = _(A, !0);
76
- m(A), h(() => F(U, n(p) ? "Original" : "Translation")), i(t, s);
76
+ m(A), h(() => F(U, n(f) ? "Original" : "Translation")), i(t, s);
77
77
  };
78
78
  S(tt, (t) => {
79
79
  a()?.translation && t(et);
@@ -96,13 +96,13 @@ function Y(d, e) {
96
96
  {
97
97
  var ct = (z) => {
98
98
  var P = kt(), q = T(P), B = b(q);
99
- B.__click = [xt, f], h((gt) => F(q, `${gt ?? ""}... `), [() => a().transcription.slice(0, 200)]), i(z, P);
99
+ B.__click = [xt, p], h((gt) => F(q, `${gt ?? ""}... `), [() => a().transcription.slice(0, 200)]), i(z, P);
100
100
  }, vt = (z) => {
101
101
  var P = Ht(), q = T(P), B = b(q);
102
- B.__click = [wt, f], h(() => F(q, `${a().transcription ?? ""} `)), i(z, P);
102
+ B.__click = [wt, p], h(() => F(q, `${a().transcription ?? ""} `)), i(z, P);
103
103
  };
104
104
  S(dt, (z) => {
105
- n(f) ? z(vt, !1) : z(ct);
105
+ n(p) ? z(vt, !1) : z(ct);
106
106
  });
107
107
  }
108
108
  i(I, E);
@@ -121,7 +121,7 @@ function Y(d, e) {
121
121
  i(H, C);
122
122
  };
123
123
  S(A, (H) => {
124
- n(p) ? H(U) : H(it, !1);
124
+ n(f) ? H(U) : H(it, !1);
125
125
  });
126
126
  }
127
127
  i(t, s);
@@ -133,7 +133,7 @@ function Y(d, e) {
133
133
  a()?.transcription ? t(at) : t(ot, !1);
134
134
  });
135
135
  }
136
- return m(M), m(K), m(w), h((t) => r = ft(w, 1, "container svelte-47ttlb", null, r, t), [() => ({ loading: c() })]), i(d, w), X(k);
136
+ return m(M), m(K), m(w), h((t) => r = pt(w, 1, "container svelte-47ttlb", null, r, t), [() => ({ loading: c() })]), i(d, w), X(k);
137
137
  }
138
138
  ut(["click"]);
139
139
  Q(
@@ -156,21 +156,21 @@ const jt = {
156
156
  };
157
157
  function At(d, e) {
158
158
  V(e, !0), W(d, jt);
159
- let l = v(e, "recordingId", 7), a = v(e, "theme", 7), c = v(e, "apiHost", 7, "api.44.audio");
159
+ let l = v(e, "recordingId", 7), a = v(e, "theme", 7, "#ffffff,#000000,#3b82f6,#2563eb,#8b5cf6,#7c3aed"), c = v(e, "apiHost", 7, "api.44.audio");
160
160
  const j = G(() => a().split(",").map((r, o) => `--44-color-${o}: ${r.trim()};`).join(" "));
161
- let x = L(null), p = L(!0), f = L(!1);
161
+ let x = L(null), f = L(!0), p = L(!1);
162
162
  bt(() => {
163
163
  const r = l();
164
- u(p, !0), u(f, !1), fetch(`https://${c()}/v1/recordings/${r}/player`).then((o) => {
164
+ u(f, !0), u(p, !1), fetch(`https://${c()}/v1/recordings/${r}/player`).then((o) => {
165
165
  if (!o.ok)
166
166
  throw new Error("Failed to fetch data");
167
167
  return o.json();
168
168
  }).then((o) => {
169
169
  l() === r && o.status === "ready" && u(x, o, !0);
170
170
  }).catch((o) => {
171
- console.error(o), l() === r && u(f, !0);
171
+ console.error(o), l() === r && u(p, !0);
172
172
  }).finally(() => {
173
- l() === r && u(p, !1);
173
+ l() === r && u(f, !1);
174
174
  });
175
175
  });
176
176
  var O = {
@@ -183,7 +183,7 @@ function At(d, e) {
183
183
  get theme() {
184
184
  return a();
185
185
  },
186
- set theme(r) {
186
+ set theme(r = "#ffffff,#000000,#3b82f6,#2563eb,#8b5cf6,#7c3aed") {
187
187
  a(r), g();
188
188
  },
189
189
  get apiHost() {
@@ -204,10 +204,10 @@ function At(d, e) {
204
204
  return n(x);
205
205
  },
206
206
  get loading() {
207
- return n(p);
207
+ return n(f);
208
208
  },
209
209
  get error() {
210
- return n(f);
210
+ return n(p);
211
211
  }
212
212
  }), m(k), h(() => ht(k, n(j))), i(d, k), X(O);
213
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@44-audio/components",
3
- "version": "0.1.0-dev.14",
3
+ "version": "0.1.0-dev.15",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"