@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/broadcast-player.js +17 -17
- package/dist/broadcast-player.js.map +1 -1
- package/dist/broadcast-player.mjs +17 -17
- package/dist/broadcast-player.mjs.map +1 -1
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -17
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -4
|
@@ -1417,8 +1417,8 @@ function BroadcastPlayer({
|
|
|
1417
1417
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsx(LoadingSpinner, { variant: "white", text: "Loading..." }) });
|
|
1418
1418
|
}
|
|
1419
1419
|
const hasTranscript = broadcast.transcriptStatus === 2 && transcriptData && (transcriptData.segments && transcriptData.segments.some((s) => s.words && s.words.length > 0) || transcriptData.words && transcriptData.words.length > 0);
|
|
1420
|
-
return /* @__PURE__ */ jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full h-full flex flex-col ${className}`, children: [
|
|
1421
|
-
/* @__PURE__ */ 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: [
|
|
1420
|
+
return /* @__PURE__ */ jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full max-h-full flex flex-col overflow-hidden ${className}`, children: [
|
|
1421
|
+
/* @__PURE__ */ 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: [
|
|
1422
1422
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1423
1423
|
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-white", children: broadcast.streamKeyRecord?.foreignName || "Broadcast" }),
|
|
1424
1424
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-400", children: [
|
|
@@ -1446,8 +1446,8 @@ function BroadcastPlayer({
|
|
|
1446
1446
|
}
|
|
1447
1447
|
) })
|
|
1448
1448
|
] }),
|
|
1449
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
1450
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
1449
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row flex-1 min-h-0 overflow-hidden", children: [
|
|
1450
|
+
/* @__PURE__ */ jsxs("div", { className: "shrink-0 md:shrink md:flex-1 flex flex-col overflow-hidden", children: [
|
|
1451
1451
|
/* @__PURE__ */ jsxs("div", { className: `relative ${isAudioOnly ? "bg-linear-to-br from-zinc-900 via-zinc-800 to-zinc-900 flex items-stretch" : "bg-black"}`, children: [
|
|
1452
1452
|
isAudioOnly ? /* @__PURE__ */ jsx("div", { className: "relative cursor-pointer w-full flex flex-col", onClick: handleVideoClick, children: !hasError ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full relative", children: [
|
|
1453
1453
|
/* @__PURE__ */ jsx(AudioWaveform, { audioElement, isPlaying: isLiveStream ? true : playing, isLive: isLiveStream }),
|
|
@@ -1729,7 +1729,7 @@ function BroadcastPlayer({
|
|
|
1729
1729
|
] })
|
|
1730
1730
|
] }))
|
|
1731
1731
|
] }),
|
|
1732
|
-
showTranscript && hasTranscript && /* @__PURE__ */ jsxs("div", { className: "w-full md:w-96 bg-zinc-900 border-l border-zinc-800 flex flex-col overflow-hidden", children: [
|
|
1732
|
+
showTranscript && hasTranscript && /* @__PURE__ */ 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: [
|
|
1733
1733
|
/* @__PURE__ */ jsx("div", { className: "px-4 py-3 border-b border-zinc-800 bg-zinc-900/50 shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1734
1734
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1735
1735
|
/* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-green-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ 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" }) }),
|
|
@@ -1758,7 +1758,7 @@ function BroadcastPlayer({
|
|
|
1758
1758
|
]
|
|
1759
1759
|
}
|
|
1760
1760
|
) }),
|
|
1761
|
-
/* @__PURE__ */ jsx("div", { ref: transcriptContainerRef, className: "flex-1 overflow-y-auto px-4 py-4 text-gray-300 leading-relaxed", children: isLoadingTranscript ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ 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__ */ jsx("div", { className: "space-y-4", children: (() => {
|
|
1761
|
+
/* @__PURE__ */ 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__ */ jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ 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__ */ jsx("div", { className: "space-y-4", children: (() => {
|
|
1762
1762
|
const filteredSegments = transcriptData.segments.filter((s) => s.words && s.words.length > 0);
|
|
1763
1763
|
let globalWordIndex = 0;
|
|
1764
1764
|
const wordMap = /* @__PURE__ */ new Map();
|
|
@@ -1918,14 +1918,12 @@ function BroadcastPlayerModal({
|
|
|
1918
1918
|
}) {
|
|
1919
1919
|
const closeButtonRef = useRef(null);
|
|
1920
1920
|
const previousActiveElement = useRef(null);
|
|
1921
|
-
if (!isOpen) return null;
|
|
1922
1921
|
useEffect(() => {
|
|
1923
|
-
if (isOpen)
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
}
|
|
1922
|
+
if (!isOpen) return;
|
|
1923
|
+
previousActiveElement.current = document.activeElement;
|
|
1924
|
+
setTimeout(() => {
|
|
1925
|
+
closeButtonRef.current?.focus();
|
|
1926
|
+
}, 100);
|
|
1929
1927
|
return () => {
|
|
1930
1928
|
if (previousActiveElement.current) {
|
|
1931
1929
|
previousActiveElement.current.focus();
|
|
@@ -1933,6 +1931,7 @@ function BroadcastPlayerModal({
|
|
|
1933
1931
|
};
|
|
1934
1932
|
}, [isOpen]);
|
|
1935
1933
|
useEffect(() => {
|
|
1934
|
+
if (!isOpen) return;
|
|
1936
1935
|
const handleKeyDown = (e) => {
|
|
1937
1936
|
if (e.key === "Escape") {
|
|
1938
1937
|
onClose();
|
|
@@ -1940,7 +1939,8 @@ function BroadcastPlayerModal({
|
|
|
1940
1939
|
};
|
|
1941
1940
|
document.addEventListener("keydown", handleKeyDown);
|
|
1942
1941
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1943
|
-
}, [onClose]);
|
|
1942
|
+
}, [isOpen, onClose]);
|
|
1943
|
+
if (!isOpen) return null;
|
|
1944
1944
|
const handleBackdropClick = (e) => {
|
|
1945
1945
|
if (e.target === e.currentTarget) {
|
|
1946
1946
|
onClose();
|
|
@@ -1949,18 +1949,18 @@ function BroadcastPlayerModal({
|
|
|
1949
1949
|
return /* @__PURE__ */ jsx(
|
|
1950
1950
|
"div",
|
|
1951
1951
|
{
|
|
1952
|
-
className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-4",
|
|
1952
|
+
className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-2 sm:p-4",
|
|
1953
1953
|
onClick: handleBackdropClick,
|
|
1954
1954
|
role: "dialog",
|
|
1955
1955
|
"aria-modal": "true",
|
|
1956
1956
|
"aria-label": "Broadcast player",
|
|
1957
|
-
children: /* @__PURE__ */ jsxs("div", { className: "relative w-full
|
|
1957
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative w-full max-w-7xl max-h-[95vh] sm:max-h-[90vh] overflow-hidden", children: [
|
|
1958
1958
|
/* @__PURE__ */ jsx(
|
|
1959
1959
|
"button",
|
|
1960
1960
|
{
|
|
1961
1961
|
ref: closeButtonRef,
|
|
1962
1962
|
onClick: onClose,
|
|
1963
|
-
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",
|
|
1963
|
+
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",
|
|
1964
1964
|
title: "Close (ESC)",
|
|
1965
1965
|
"aria-label": "Close player",
|
|
1966
1966
|
children: "\xD7"
|