@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/broadcast-player.js
CHANGED
|
@@ -1423,8 +1423,8 @@ function BroadcastPlayer({
|
|
|
1423
1423
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { variant: "white", text: "Loading..." }) });
|
|
1424
1424
|
}
|
|
1425
1425
|
const hasTranscript = broadcast.transcriptStatus === 2 && transcriptData && (transcriptData.segments && transcriptData.segments.some((s) => s.words && s.words.length > 0) || transcriptData.words && transcriptData.words.length > 0);
|
|
1426
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full h-full flex flex-col ${className}`, children: [
|
|
1427
|
-
/* @__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: [
|
|
1426
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `bg-black rounded-lg shadow-2xl w-full max-h-full flex flex-col overflow-hidden ${className}`, children: [
|
|
1427
|
+
/* @__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: [
|
|
1428
1428
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1429
1429
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-white", children: broadcast.streamKeyRecord?.foreignName || "Broadcast" }),
|
|
1430
1430
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-400", children: [
|
|
@@ -1452,8 +1452,8 @@ function BroadcastPlayer({
|
|
|
1452
1452
|
}
|
|
1453
1453
|
) })
|
|
1454
1454
|
] }),
|
|
1455
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
1456
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
1455
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row flex-1 min-h-0 overflow-hidden", children: [
|
|
1456
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 md:shrink md:flex-1 flex flex-col overflow-hidden", children: [
|
|
1457
1457
|
/* @__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: [
|
|
1458
1458
|
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: [
|
|
1459
1459
|
/* @__PURE__ */ jsxRuntime.jsx(AudioWaveform, { audioElement, isPlaying: isLiveStream ? true : playing, isLive: isLiveStream }),
|
|
@@ -1735,7 +1735,7 @@ function BroadcastPlayer({
|
|
|
1735
1735
|
] })
|
|
1736
1736
|
] }))
|
|
1737
1737
|
] }),
|
|
1738
|
-
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: [
|
|
1738
|
+
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: [
|
|
1739
1739
|
/* @__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: [
|
|
1740
1740
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1741
1741
|
/* @__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" }) }),
|
|
@@ -1764,7 +1764,7 @@ function BroadcastPlayer({
|
|
|
1764
1764
|
]
|
|
1765
1765
|
}
|
|
1766
1766
|
) }),
|
|
1767
|
-
/* @__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: (() => {
|
|
1767
|
+
/* @__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: (() => {
|
|
1768
1768
|
const filteredSegments = transcriptData.segments.filter((s) => s.words && s.words.length > 0);
|
|
1769
1769
|
let globalWordIndex = 0;
|
|
1770
1770
|
const wordMap = /* @__PURE__ */ new Map();
|
|
@@ -1924,14 +1924,12 @@ function BroadcastPlayerModal({
|
|
|
1924
1924
|
}) {
|
|
1925
1925
|
const closeButtonRef = react.useRef(null);
|
|
1926
1926
|
const previousActiveElement = react.useRef(null);
|
|
1927
|
-
if (!isOpen) return null;
|
|
1928
1927
|
react.useEffect(() => {
|
|
1929
|
-
if (isOpen)
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
}
|
|
1928
|
+
if (!isOpen) return;
|
|
1929
|
+
previousActiveElement.current = document.activeElement;
|
|
1930
|
+
setTimeout(() => {
|
|
1931
|
+
closeButtonRef.current?.focus();
|
|
1932
|
+
}, 100);
|
|
1935
1933
|
return () => {
|
|
1936
1934
|
if (previousActiveElement.current) {
|
|
1937
1935
|
previousActiveElement.current.focus();
|
|
@@ -1939,6 +1937,7 @@ function BroadcastPlayerModal({
|
|
|
1939
1937
|
};
|
|
1940
1938
|
}, [isOpen]);
|
|
1941
1939
|
react.useEffect(() => {
|
|
1940
|
+
if (!isOpen) return;
|
|
1942
1941
|
const handleKeyDown = (e) => {
|
|
1943
1942
|
if (e.key === "Escape") {
|
|
1944
1943
|
onClose();
|
|
@@ -1946,7 +1945,8 @@ function BroadcastPlayerModal({
|
|
|
1946
1945
|
};
|
|
1947
1946
|
document.addEventListener("keydown", handleKeyDown);
|
|
1948
1947
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1949
|
-
}, [onClose]);
|
|
1948
|
+
}, [isOpen, onClose]);
|
|
1949
|
+
if (!isOpen) return null;
|
|
1950
1950
|
const handleBackdropClick = (e) => {
|
|
1951
1951
|
if (e.target === e.currentTarget) {
|
|
1952
1952
|
onClose();
|
|
@@ -1955,18 +1955,18 @@ function BroadcastPlayerModal({
|
|
|
1955
1955
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1956
1956
|
"div",
|
|
1957
1957
|
{
|
|
1958
|
-
className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-4",
|
|
1958
|
+
className: "fixed inset-0 bg-black/70 backdrop-blur-xl flex items-center justify-center z-50 p-2 sm:p-4",
|
|
1959
1959
|
onClick: handleBackdropClick,
|
|
1960
1960
|
role: "dialog",
|
|
1961
1961
|
"aria-modal": "true",
|
|
1962
1962
|
"aria-label": "Broadcast player",
|
|
1963
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full
|
|
1963
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full max-w-7xl max-h-[95vh] sm:max-h-[90vh] overflow-hidden", children: [
|
|
1964
1964
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1965
1965
|
"button",
|
|
1966
1966
|
{
|
|
1967
1967
|
ref: closeButtonRef,
|
|
1968
1968
|
onClick: onClose,
|
|
1969
|
-
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",
|
|
1969
|
+
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",
|
|
1970
1970
|
title: "Close (ESC)",
|
|
1971
1971
|
"aria-label": "Close player",
|
|
1972
1972
|
children: "\xD7"
|