@dialtribe/react-sdk 0.1.0-alpha.6 → 0.1.0-alpha.7

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.js CHANGED
@@ -1441,8 +1441,8 @@ function BroadcastPlayer({
1441
1441
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { variant: "white", text: "Loading..." }) });
1442
1442
  }
1443
1443
  const hasTranscript = broadcast.transcriptStatus === 2 && transcriptData && (transcriptData.segments && transcriptData.segments.some((s) => s.words && s.words.length > 0) || transcriptData.words && transcriptData.words.length > 0);
1444
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full h-full flex flex-col ${className}`, children: [
1445
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-zinc-900/50 backdrop-blur-sm border-b border-zinc-800 px-4 md:px-6 py-3 md:py-4 flex justify-between items-center rounded-t-lg shrink-0", children: [
1444
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full max-h-full flex flex-col overflow-hidden ${className}`, children: [
1445
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-zinc-900/50 backdrop-blur-sm border-b border-zinc-800 px-3 sm:px-4 md:px-6 py-2 sm:py-3 md:py-4 flex justify-between items-center rounded-t-lg shrink-0", children: [
1446
1446
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1447
1447
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-white", children: broadcast.streamKeyRecord?.foreignName || "Broadcast" }),
1448
1448
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-400", children: [
@@ -1470,8 +1470,8 @@ function BroadcastPlayer({
1470
1470
  }
1471
1471
  ) })
1472
1472
  ] }),
1473
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
1474
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
1473
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row flex-1 min-h-0 overflow-hidden", children: [
1474
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 md:shrink md:flex-1 flex flex-col overflow-hidden", children: [
1475
1475
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `relative ${isAudioOnly ? "bg-linear-to-br from-zinc-900 via-zinc-800 to-zinc-900 flex items-stretch" : "bg-black"}`, children: [
1476
1476
  isAudioOnly ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative cursor-pointer w-full flex flex-col", onClick: handleVideoClick, children: !hasError ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full h-full relative", children: [
1477
1477
  /* @__PURE__ */ jsxRuntime.jsx(AudioWaveform, { audioElement, isPlaying: isLiveStream ? true : playing, isLive: isLiveStream }),
@@ -1753,7 +1753,7 @@ function BroadcastPlayer({
1753
1753
  ] })
1754
1754
  ] }))
1755
1755
  ] }),
1756
- showTranscript && hasTranscript && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full md:w-96 bg-zinc-900 border-l border-zinc-800 flex flex-col overflow-hidden", children: [
1756
+ showTranscript && hasTranscript && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 md:flex-none min-h-0 w-full md:w-96 bg-zinc-900 border-t md:border-t-0 border-l border-zinc-800 flex flex-col overflow-hidden", children: [
1757
1757
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-3 border-b border-zinc-800 bg-zinc-900/50 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
1758
1758
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1759
1759
  /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5 text-green-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }),
@@ -1782,7 +1782,7 @@ function BroadcastPlayer({
1782
1782
  ]
1783
1783
  }
1784
1784
  ) }),
1785
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: transcriptContainerRef, className: "flex-1 overflow-y-auto px-4 py-4 text-gray-300 leading-relaxed", children: isLoadingTranscript ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-6 w-6 border-2 border-gray-600 border-t-blue-500 rounded-full animate-spin" }) }) : transcriptData?.segments && transcriptData.segments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: (() => {
1785
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: transcriptContainerRef, className: "flex-1 min-h-0 overflow-y-auto px-4 py-4 text-gray-300 leading-relaxed", children: isLoadingTranscript ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-6 w-6 border-2 border-gray-600 border-t-blue-500 rounded-full animate-spin" }) }) : transcriptData?.segments && transcriptData.segments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: (() => {
1786
1786
  const filteredSegments = transcriptData.segments.filter((s) => s.words && s.words.length > 0);
1787
1787
  let globalWordIndex = 0;
1788
1788
  const wordMap = /* @__PURE__ */ new Map();
@@ -1942,14 +1942,12 @@ function BroadcastPlayerModal({
1942
1942
  }) {
1943
1943
  const closeButtonRef = react.useRef(null);
1944
1944
  const previousActiveElement = react.useRef(null);
1945
- if (!isOpen) return null;
1946
1945
  react.useEffect(() => {
1947
- if (isOpen) {
1948
- previousActiveElement.current = document.activeElement;
1949
- setTimeout(() => {
1950
- closeButtonRef.current?.focus();
1951
- }, 100);
1952
- }
1946
+ if (!isOpen) return;
1947
+ previousActiveElement.current = document.activeElement;
1948
+ setTimeout(() => {
1949
+ closeButtonRef.current?.focus();
1950
+ }, 100);
1953
1951
  return () => {
1954
1952
  if (previousActiveElement.current) {
1955
1953
  previousActiveElement.current.focus();
@@ -1957,6 +1955,7 @@ function BroadcastPlayerModal({
1957
1955
  };
1958
1956
  }, [isOpen]);
1959
1957
  react.useEffect(() => {
1958
+ if (!isOpen) return;
1960
1959
  const handleKeyDown = (e) => {
1961
1960
  if (e.key === "Escape") {
1962
1961
  onClose();
@@ -1964,7 +1963,8 @@ function BroadcastPlayerModal({
1964
1963
  };
1965
1964
  document.addEventListener("keydown", handleKeyDown);
1966
1965
  return () => document.removeEventListener("keydown", handleKeyDown);
1967
- }, [onClose]);
1966
+ }, [isOpen, onClose]);
1967
+ if (!isOpen) return null;
1968
1968
  const handleBackdropClick = (e) => {
1969
1969
  if (e.target === e.currentTarget) {
1970
1970
  onClose();
@@ -1973,18 +1973,18 @@ function BroadcastPlayerModal({
1973
1973
  return /* @__PURE__ */ jsxRuntime.jsx(
1974
1974
  "div",
1975
1975
  {
1976
- className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-4",
1976
+ className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-2 sm:p-4",
1977
1977
  onClick: handleBackdropClick,
1978
1978
  role: "dialog",
1979
1979
  "aria-modal": "true",
1980
1980
  "aria-label": "Broadcast player",
1981
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full h-full max-w-7xl max-h-[90vh]", children: [
1981
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full max-w-7xl max-h-[95vh] sm:max-h-[90vh] overflow-hidden", children: [
1982
1982
  /* @__PURE__ */ jsxRuntime.jsx(
1983
1983
  "button",
1984
1984
  {
1985
1985
  ref: closeButtonRef,
1986
1986
  onClick: onClose,
1987
- className: "absolute top-4 right-4 z-10 text-gray-400 hover:text-white text-2xl leading-none transition-colors w-8 h-8 flex items-center justify-center bg-black/50 rounded-full",
1987
+ className: "absolute top-2 right-2 sm:top-4 sm:right-4 z-10 text-gray-400 hover:text-white text-2xl leading-none transition-colors w-8 h-8 flex items-center justify-center bg-black/50 rounded-full",
1988
1988
  title: "Close (ESC)",
1989
1989
  "aria-label": "Close player",
1990
1990
  children: "\xD7"