@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
package/dist/index.mjs
CHANGED
|
@@ -1435,8 +1435,8 @@ function BroadcastPlayer({
|
|
|
1435
1435
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsx(LoadingSpinner, { variant: "white", text: "Loading..." }) });
|
|
1436
1436
|
}
|
|
1437
1437
|
const hasTranscript = broadcast.transcriptStatus === 2 && transcriptData && (transcriptData.segments && transcriptData.segments.some((s) => s.words && s.words.length > 0) || transcriptData.words && transcriptData.words.length > 0);
|
|
1438
|
-
return /* @__PURE__ */ jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full h-full flex flex-col ${className}`, children: [
|
|
1439
|
-
/* @__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: [
|
|
1438
|
+
return /* @__PURE__ */ jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full max-h-full flex flex-col overflow-hidden ${className}`, children: [
|
|
1439
|
+
/* @__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: [
|
|
1440
1440
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1441
1441
|
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-white", children: broadcast.streamKeyRecord?.foreignName || "Broadcast" }),
|
|
1442
1442
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-400", children: [
|
|
@@ -1464,8 +1464,8 @@ function BroadcastPlayer({
|
|
|
1464
1464
|
}
|
|
1465
1465
|
) })
|
|
1466
1466
|
] }),
|
|
1467
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
1468
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
1467
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row flex-1 min-h-0 overflow-hidden", children: [
|
|
1468
|
+
/* @__PURE__ */ jsxs("div", { className: "shrink-0 md:shrink md:flex-1 flex flex-col overflow-hidden", children: [
|
|
1469
1469
|
/* @__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: [
|
|
1470
1470
|
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: [
|
|
1471
1471
|
/* @__PURE__ */ jsx(AudioWaveform, { audioElement, isPlaying: isLiveStream ? true : playing, isLive: isLiveStream }),
|
|
@@ -1747,7 +1747,7 @@ function BroadcastPlayer({
|
|
|
1747
1747
|
] })
|
|
1748
1748
|
] }))
|
|
1749
1749
|
] }),
|
|
1750
|
-
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: [
|
|
1750
|
+
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: [
|
|
1751
1751
|
/* @__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: [
|
|
1752
1752
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1753
1753
|
/* @__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" }) }),
|
|
@@ -1776,7 +1776,7 @@ function BroadcastPlayer({
|
|
|
1776
1776
|
]
|
|
1777
1777
|
}
|
|
1778
1778
|
) }),
|
|
1779
|
-
/* @__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: (() => {
|
|
1779
|
+
/* @__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: (() => {
|
|
1780
1780
|
const filteredSegments = transcriptData.segments.filter((s) => s.words && s.words.length > 0);
|
|
1781
1781
|
let globalWordIndex = 0;
|
|
1782
1782
|
const wordMap = /* @__PURE__ */ new Map();
|
|
@@ -1936,14 +1936,12 @@ function BroadcastPlayerModal({
|
|
|
1936
1936
|
}) {
|
|
1937
1937
|
const closeButtonRef = useRef(null);
|
|
1938
1938
|
const previousActiveElement = useRef(null);
|
|
1939
|
-
if (!isOpen) return null;
|
|
1940
1939
|
useEffect(() => {
|
|
1941
|
-
if (isOpen)
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
}
|
|
1940
|
+
if (!isOpen) return;
|
|
1941
|
+
previousActiveElement.current = document.activeElement;
|
|
1942
|
+
setTimeout(() => {
|
|
1943
|
+
closeButtonRef.current?.focus();
|
|
1944
|
+
}, 100);
|
|
1947
1945
|
return () => {
|
|
1948
1946
|
if (previousActiveElement.current) {
|
|
1949
1947
|
previousActiveElement.current.focus();
|
|
@@ -1951,6 +1949,7 @@ function BroadcastPlayerModal({
|
|
|
1951
1949
|
};
|
|
1952
1950
|
}, [isOpen]);
|
|
1953
1951
|
useEffect(() => {
|
|
1952
|
+
if (!isOpen) return;
|
|
1954
1953
|
const handleKeyDown = (e) => {
|
|
1955
1954
|
if (e.key === "Escape") {
|
|
1956
1955
|
onClose();
|
|
@@ -1958,7 +1957,8 @@ function BroadcastPlayerModal({
|
|
|
1958
1957
|
};
|
|
1959
1958
|
document.addEventListener("keydown", handleKeyDown);
|
|
1960
1959
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1961
|
-
}, [onClose]);
|
|
1960
|
+
}, [isOpen, onClose]);
|
|
1961
|
+
if (!isOpen) return null;
|
|
1962
1962
|
const handleBackdropClick = (e) => {
|
|
1963
1963
|
if (e.target === e.currentTarget) {
|
|
1964
1964
|
onClose();
|
|
@@ -1967,18 +1967,18 @@ function BroadcastPlayerModal({
|
|
|
1967
1967
|
return /* @__PURE__ */ jsx(
|
|
1968
1968
|
"div",
|
|
1969
1969
|
{
|
|
1970
|
-
className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-4",
|
|
1970
|
+
className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-2 sm:p-4",
|
|
1971
1971
|
onClick: handleBackdropClick,
|
|
1972
1972
|
role: "dialog",
|
|
1973
1973
|
"aria-modal": "true",
|
|
1974
1974
|
"aria-label": "Broadcast player",
|
|
1975
|
-
children: /* @__PURE__ */ jsxs("div", { className: "relative w-full
|
|
1975
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative w-full max-w-7xl max-h-[95vh] sm:max-h-[90vh] overflow-hidden", children: [
|
|
1976
1976
|
/* @__PURE__ */ jsx(
|
|
1977
1977
|
"button",
|
|
1978
1978
|
{
|
|
1979
1979
|
ref: closeButtonRef,
|
|
1980
1980
|
onClick: onClose,
|
|
1981
|
-
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",
|
|
1981
|
+
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",
|
|
1982
1982
|
title: "Close (ESC)",
|
|
1983
1983
|
"aria-label": "Close player",
|
|
1984
1984
|
children: "\xD7"
|