@hadoku/watchparty-ui 0.44.13 → 0.44.16

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 (27) hide show
  1. package/dist/chunks/{AdminPanel-BmZPZ-JU.js → AdminPanel-CJtacvRu.js} +13 -13
  2. package/dist/chunks/{AdminPanel-BmZPZ-JU.js.map → AdminPanel-CJtacvRu.js.map} +1 -1
  3. package/dist/chunks/{GameModule-k9Cccia2.js → GameModule-BvqNQcVk.js} +158 -158
  4. package/dist/chunks/{GameModule-k9Cccia2.js.map → GameModule-BvqNQcVk.js.map} +1 -1
  5. package/dist/chunks/{MapEditor-ChMOAaVW.js → MapEditor-Bc0_hjZQ.js} +2 -2
  6. package/dist/chunks/{MapEditor-ChMOAaVW.js.map → MapEditor-Bc0_hjZQ.js.map} +1 -1
  7. package/dist/chunks/{MediaDrawer-C7esBn07.js → MediaDrawer-CgoGUHwV.js} +39 -39
  8. package/dist/chunks/{MediaDrawer-C7esBn07.js.map → MediaDrawer-CgoGUHwV.js.map} +1 -1
  9. package/dist/chunks/{PlaylistPanel-C17X31ES.js → PlaylistPanel-BmKnGMqa.js} +27 -27
  10. package/dist/chunks/{PlaylistPanel-C17X31ES.js.map → PlaylistPanel-BmKnGMqa.js.map} +1 -1
  11. package/dist/chunks/{Room-gmERzNR6.js → Room-CoE8L9aw.js} +1841 -1871
  12. package/dist/chunks/Room-CoE8L9aw.js.map +1 -0
  13. package/dist/chunks/{index-CR-0msod.js → index-Buah62TP.js} +2625 -2457
  14. package/dist/chunks/index-Buah62TP.js.map +1 -0
  15. package/dist/chunks/{submissionsApi-DsHETYSv.js → submissionsApi-DXsG0ItW.js} +15 -15
  16. package/dist/chunks/{submissionsApi-DsHETYSv.js.map → submissionsApi-DXsG0ItW.js.map} +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/room-chrome.css +1 -1
  19. package/dist/room-chrome.d.ts +1 -1
  20. package/dist/room-chrome.js +1293 -1397
  21. package/dist/room-chrome.js.map +1 -1
  22. package/dist/watchparty-ui.css +1 -1
  23. package/package.json +2 -2
  24. package/dist/chunks/CharacterModal-CCb4K-A7.js +0 -158
  25. package/dist/chunks/CharacterModal-CCb4K-A7.js.map +0 -1
  26. package/dist/chunks/Room-gmERzNR6.js.map +0 -1
  27. package/dist/chunks/index-CR-0msod.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { jsxs as u, jsx as a, Fragment as j } from "react/jsx-runtime";
2
2
  import { useState as x, useEffect as D, useRef as ce, useMemo as ke, useCallback as Se } from "react";
3
- import { g as K, at as Y, d as A, aj as Fe, w as q, U as Q, au as Be, av as De, h as se, v as Oe, G as Ce, aw as Pe } from "./index-CR-0msod.js";
4
- import { D as $e, a as ae, u as Ge, s as je, b as qe } from "./Room-gmERzNR6.js";
5
- import { s as Ee, a as W, g as ue, f as He, b as pe, h as Ve, u as We, c as ze, e as Ye, d as Je, i as Ke, j as Qe, k as Xe } from "./submissionsApi-DsHETYSv.js";
3
+ import { g as K, aA as Y, d as A, ap as Fe, w as q, _ as Q, aB as Be, aC as De, h as se, v as Oe, I as Ce, aD as Pe } from "./index-Buah62TP.js";
4
+ import { D as $e, a as ae, u as Ge, s as je, b as qe } from "./Room-CoE8L9aw.js";
5
+ import { s as Ee, a as W, g as ue, f as He, b as pe, h as Ve, u as We, c as ze, e as Ye, d as Je, i as Ke, j as Qe, k as Xe } from "./submissionsApi-DXsG0ItW.js";
6
6
  import { Icon as re } from "@wolffm/themes";
7
7
  import { b as Ze } from "./cover-AUIrlUMF.js";
8
8
  const ne = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), et = 6e4;
@@ -192,15 +192,15 @@ function ft({ query: e, onSubmitted: r }) {
192
192
  const m = await mt(d.source, d.id);
193
193
  v((S) => ({ ...S, [N]: m.ok || m.code === "exists" ? "added" : `error ${m.status}` }));
194
194
  }
195
- async function R(d) {
195
+ async function L(d) {
196
196
  const N = `yt:${d.id}`;
197
197
  v((S) => ({ ...S, [N]: "adding" }));
198
198
  const m = await Ee(d.url, d.title);
199
199
  m.ok ? (v((S) => ({ ...S, [N]: "added" })), r(m.value)) : v((S) => ({ ...S, [N]: W(m.failure) }));
200
200
  }
201
- const _ = f?.ok && $?.ok && f.value.length === 0 && $.value.length === 0;
201
+ const T = f?.ok && $?.ok && f.value.length === 0 && $.value.length === 0;
202
202
  return /* @__PURE__ */ u("div", { className: "border-b border-border", "data-testid": "media-search", children: [
203
- _ && /* @__PURE__ */ a("div", { className: "px-3 py-2 text-[11px] text-text-muted", children: "no results" }),
203
+ T && /* @__PURE__ */ a("div", { className: "px-3 py-2 text-[11px] text-text-muted", children: "no results" }),
204
204
  /* @__PURE__ */ a(we, { label: "Shows", answer: f, testId: "search-shows", children: f?.ok && f.value.map((d) => {
205
205
  const N = `${d.source}:${d.id}`, m = d.onWatchlist ? "added" : y[N];
206
206
  return /* @__PURE__ */ a(
@@ -233,7 +233,7 @@ function ft({ query: e, onSubmitted: r }) {
233
233
  canAdd: !0,
234
234
  addLabel: `Request ${d.title}`,
235
235
  onAdd: () => {
236
- R(d);
236
+ L(d);
237
237
  }
238
238
  },
239
239
  d.id
@@ -301,7 +301,7 @@ function xt({ item: e }) {
301
301
  );
302
302
  }
303
303
  function yt({ open: e, onClose: r }) {
304
- const [t, l] = x(""), [o, i] = x(""), [p, c] = x(""), [y, v] = x(!1), [f, $] = x([]), [M, R] = x(!1), [_, d] = x(null), [N, m] = x(null), [S, H] = x(null), [L, V] = x(null), [T, O] = x(null), [U, n] = x(!1), [h, g] = x(null), [b, k] = x(null), E = ce(null), P = ce(!1), F = ke(() => ue(t), [t]) === "magnet" && t.trim().length > 0, ie = Ae(t), B = Se(async () => {
304
+ const [t, l] = x(""), [o, i] = x(""), [p, c] = x(""), [y, v] = x(!1), [f, $] = x([]), [M, L] = x(!1), [T, d] = x(null), [N, m] = x(null), [S, H] = x(null), [_, V] = x(null), [R, O] = x(null), [U, n] = x(!1), [h, g] = x(null), [b, k] = x(null), E = ce(null), P = ce(!1), F = ke(() => ue(t), [t]) === "magnet" && t.trim().length > 0, ie = Ae(t), B = Se(async () => {
305
305
  const s = await He();
306
306
  P.current && (s.ok ? (m(s.value), H(null)) : H(s.failure));
307
307
  }, []);
@@ -332,39 +332,39 @@ function yt({ open: e, onClose: r }) {
332
332
  s = !1;
333
333
  };
334
334
  }, [e]);
335
- function Le(s) {
335
+ function _e(s) {
336
336
  if (l(s), ue(s) === "magnet" && s.trim().length > 0 && !y) {
337
337
  const C = Ye(s);
338
338
  C && c(C);
339
339
  }
340
340
  }
341
- function Re() {
341
+ function Le() {
342
342
  l(""), i(""), c(""), v(!1);
343
343
  }
344
344
  const le = !F || o.trim().length > 0 && Ve(p);
345
345
  async function oe() {
346
346
  const s = t.trim();
347
347
  if (!s || M || ie || F && !le) return;
348
- R(!0), d(null);
348
+ L(!0), d(null);
349
349
  const w = F ? await Je(s, { title: p.trim() || void 0, series: o.trim() }) : await Ee(s);
350
- if (R(!1), !w.ok) {
350
+ if (L(!1), !w.ok) {
351
351
  d(w.failure);
352
352
  return;
353
353
  }
354
- A("submissions", "Submit accepted", { id: w.value.id, state: w.value.state }), Re(), m((C) => [w.value, ...(C ?? []).filter((I) => I.id !== w.value.id)]), B();
354
+ A("submissions", "Submit accepted", { id: w.value.id, state: w.value.state }), Le(), m((C) => [w.value, ...(C ?? []).filter((I) => I.id !== w.value.id)]), B();
355
355
  }
356
- function Te(s) {
356
+ function Re(s) {
357
357
  const w = s.target.files?.[0] ?? null;
358
- if (k(null), w && L && w.size > L.maxBytes) {
359
- O(null), k({ code: "too_large", maxBytes: L.maxBytes }), E.current && (E.current.value = "");
358
+ if (k(null), w && _ && w.size > _.maxBytes) {
359
+ O(null), k({ code: "too_large", maxBytes: _.maxBytes }), E.current && (E.current.value = "");
360
360
  return;
361
361
  }
362
362
  O(w);
363
363
  }
364
- async function _e() {
365
- if (!T || U) return;
364
+ async function Te() {
365
+ if (!R || U) return;
366
366
  n(!0), k(null);
367
- let s = L;
367
+ let s = _;
368
368
  if (!s) {
369
369
  const I = await pe();
370
370
  if (!I.ok) {
@@ -373,18 +373,18 @@ function yt({ open: e, onClose: r }) {
373
373
  }
374
374
  s = I.value, V(s);
375
375
  }
376
- if (T.size > s.maxBytes) {
376
+ if (R.size > s.maxBytes) {
377
377
  n(!1), k({ code: "too_large", maxBytes: s.maxBytes });
378
378
  return;
379
379
  }
380
- const w = await Ke(T, s, (I, X, Ue) => {
380
+ const w = await Ke(R, s, (I, X, Ue) => {
381
381
  g({ sent: I, total: X, phase: Ue });
382
382
  });
383
383
  if (!w.ok) {
384
384
  n(!1), g(null), k(w.failure);
385
385
  return;
386
386
  }
387
- const C = await Qe(w.value.fileId, T.name);
387
+ const C = await Qe(w.value.fileId, R.name);
388
388
  if (n(!1), g(null), !C.ok) {
389
389
  k(C.failure);
390
390
  return;
@@ -417,7 +417,7 @@ function yt({ open: e, onClose: r }) {
417
417
  "input",
418
418
  {
419
419
  value: t,
420
- onChange: (s) => Le(s.target.value),
420
+ onChange: (s) => _e(s.target.value),
421
421
  onKeyDown: (s) => {
422
422
  s.key === "Enter" && !F && oe();
423
423
  },
@@ -465,7 +465,7 @@ function yt({ open: e, onClose: r }) {
465
465
  children: M ? "Submitting…" : "Submit"
466
466
  }
467
467
  ),
468
- _ && /* @__PURE__ */ a("span", { "data-testid": "submit-failure", className: "text-[11px] bg-danger-bg text-on-danger-bg px-1.5 py-0.5 rounded", children: W(_) })
468
+ T && /* @__PURE__ */ a("span", { "data-testid": "submit-failure", className: "text-[11px] bg-danger-bg text-on-danger-bg px-1.5 py-0.5 rounded", children: W(T) })
469
469
  ] })
470
470
  ] }),
471
471
  /* @__PURE__ */ a(
@@ -482,7 +482,7 @@ function yt({ open: e, onClose: r }) {
482
482
  {
483
483
  ref: E,
484
484
  type: "file",
485
- onChange: Te,
485
+ onChange: Re,
486
486
  "aria-label": "Upload file",
487
487
  className: "text-[11px] flex-1 min-w-0"
488
488
  }
@@ -491,16 +491,16 @@ function yt({ open: e, onClose: r }) {
491
491
  "button",
492
492
  {
493
493
  onClick: () => {
494
- _e();
494
+ Te();
495
495
  },
496
- disabled: !T || U,
496
+ disabled: !R || U,
497
497
  "aria-label": "Upload",
498
498
  className: "drawer-btn drawer-btn-primary",
499
499
  children: U ? h?.phase === "assembling" ? "Assembling…" : "Uploading…" : "Upload"
500
500
  }
501
501
  )
502
502
  ] }),
503
- /* @__PURE__ */ a("span", { className: "text-[10px] text-text-muted", "data-testid": "upload-cap", children: L ? `cap ${ze(L.maxBytes)}` : "" }),
503
+ /* @__PURE__ */ a("span", { className: "text-[10px] text-text-muted", "data-testid": "upload-cap", children: _ ? `cap ${ze(_.maxBytes)}` : "" }),
504
504
  de && /* @__PURE__ */ a("span", { "data-testid": "upload-failure", className: "text-[11px] bg-danger-bg text-on-danger-bg px-1.5 py-0.5 rounded", children: de })
505
505
  ] }),
506
506
  /* @__PURE__ */ u("div", { className: "flex-1 overflow-auto", "data-testid": "my-submissions", children: [
@@ -554,8 +554,8 @@ function Nt({ onDone: e }) {
554
554
  }, className: "drawer-btn drawer-btn-danger ml-auto", children: "Stop game" }) : null;
555
555
  }
556
556
  const G = (e) => e.type === "category" ? e.series : [], te = (e, r) => e.type === "category" ? { ...e, series: r } : e;
557
- function Lt({ open: e, onClose: r }) {
558
- const [t, l] = x(!1), [o, i] = x(null), [p, c] = x([]), [y, v] = x(""), [f, $] = x(!1), [M, R] = x("watch"), _ = se((n) => n.snapshot.mediaId), d = Xe(), N = Se(async () => {
557
+ function _t({ open: e, onClose: r }) {
558
+ const [t, l] = x(!1), [o, i] = x(null), [p, c] = x([]), [y, v] = x(""), [f, $] = x(!1), [M, L] = x("watch"), T = se((n) => n.snapshot.mediaId), d = Xe(), N = Se(async () => {
559
559
  l(!0), i(null);
560
560
  try {
561
561
  const n = await ye(J);
@@ -578,7 +578,7 @@ function Lt({ open: e, onClose: r }) {
578
578
  n = !1;
579
579
  };
580
580
  }, [m]), D(() => {
581
- e && (R("watch"), c((n) => ot(n, G, te)), N());
581
+ e && (L("watch"), c((n) => ot(n, G, te)), N());
582
582
  }, [e, N]);
583
583
  function S(n) {
584
584
  je(n), A("catalog", "control_load", { mediaId: n }), r();
@@ -586,13 +586,13 @@ function Lt({ open: e, onClose: r }) {
586
586
  function H(n) {
587
587
  Pe(n), A("catalog", "playlist_load", { playlistId: n }), r();
588
588
  }
589
- function L() {
589
+ function _() {
590
590
  qe(), A("controls", "Unload media clicked (media drawer)"), r();
591
591
  }
592
592
  function V(n, h) {
593
593
  c((g) => g.map((b, k) => k !== n || !("series" in b) ? b : { ...b, series: b.series.map((E, P) => P !== h ? E : { ...E, expanded: !E.expanded }) }));
594
594
  }
595
- function T(n) {
595
+ function R(n) {
596
596
  c((h) => h.map((g, b) => b !== n ? g : { ...g, expanded: !g.expanded }));
597
597
  }
598
598
  function O() {
@@ -626,7 +626,7 @@ function Lt({ open: e, onClose: r }) {
626
626
  {
627
627
  role: "tab",
628
628
  "aria-selected": M === n,
629
- onClick: () => R(n),
629
+ onClick: () => L(n),
630
630
  className: "tl-tab",
631
631
  children: n === "watch" ? "Watch" : "Play"
632
632
  },
@@ -643,10 +643,10 @@ function Lt({ open: e, onClose: r }) {
643
643
  children: "Add"
644
644
  }
645
645
  ),
646
- _ && /* @__PURE__ */ a(
646
+ T && /* @__PURE__ */ a(
647
647
  "button",
648
648
  {
649
- onClick: L,
649
+ onClick: _,
650
650
  title: "Unload the current media for everyone in the room",
651
651
  className: "drawer-btn drawer-btn-primary",
652
652
  children: "Unload"
@@ -671,7 +671,7 @@ function Lt({ open: e, onClose: r }) {
671
671
  className: "flex items-center gap-2 cursor-pointer select-none group",
672
672
  "data-category": n.name,
673
673
  "data-expanded": n.expanded ? "true" : "false",
674
- onClick: () => T(h),
674
+ onClick: () => R(h),
675
675
  children: [
676
676
  /* @__PURE__ */ a("span", { className: "text-xs uppercase tracking-wider text-text-muted group-hover:text-text-secondary", children: n.name }),
677
677
  /* @__PURE__ */ a("span", { className: "text-[10px] opacity-50", children: n.expanded ? "−" : "+" })
@@ -710,6 +710,6 @@ function Lt({ open: e, onClose: r }) {
710
710
  ] });
711
711
  }
712
712
  export {
713
- Lt as default
713
+ _t as default
714
714
  };
715
- //# sourceMappingURL=MediaDrawer-C7esBn07.js.map
715
+ //# sourceMappingURL=MediaDrawer-CgoGUHwV.js.map