@elicecontents/content-ui 1.0.16 → 1.0.17-rc.0
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/cjs/components/AI-feedback/AIFeedback.js +3 -3
- package/cjs/components/layout/Layout.d.ts +2 -1
- package/cjs/components/layout/Layout.js +83 -31
- package/cjs/components/sound-visualizer/SoundVisualizer.js +1 -2
- package/cjs/components/video/VideoPlayer.js +190 -8
- package/cjs/theme/createAIDTTheme.js +3 -1
- package/cjs/typography/typography.d.ts +7 -7
- package/cjs/typography/typography.js +7 -7
- package/es/components/AI-feedback/AIFeedback.js +4 -4
- package/es/components/layout/Layout.d.ts +2 -1
- package/es/components/layout/Layout.js +83 -31
- package/es/components/sound-visualizer/SoundVisualizer.js +1 -2
- package/es/components/video/VideoPlayer.js +183 -11
- package/es/theme/createAIDTTheme.js +3 -1
- package/es/typography/typography.d.ts +7 -7
- package/es/typography/typography.js +7 -7
- package/package.json +1 -1
|
@@ -20,16 +20,16 @@ var EliceAIFeedback = function EliceAIFeedback(_a) {
|
|
|
20
20
|
}, rest, {
|
|
21
21
|
isControl: true,
|
|
22
22
|
triggerAction: "click",
|
|
23
|
-
children: jsxRuntime.
|
|
23
|
+
children: jsxRuntime.jsx(material.Stack, {
|
|
24
24
|
position: "relative",
|
|
25
25
|
width: "fit-content",
|
|
26
26
|
height: "fit-content",
|
|
27
27
|
maxWidth: "100%",
|
|
28
28
|
maxHeight: "100%",
|
|
29
|
-
children:
|
|
29
|
+
children: CustomAvatar !== null && CustomAvatar !== void 0 ? CustomAvatar : jsxRuntime.jsx("img", {
|
|
30
30
|
src: AIAvatar.default,
|
|
31
31
|
alt: "AI Avatar"
|
|
32
|
-
})
|
|
32
|
+
})
|
|
33
33
|
})
|
|
34
34
|
}));
|
|
35
35
|
};
|
|
@@ -20,9 +20,10 @@ declare const EliceLayout: (({ children, onPrev, onNext, allowPrev, allowNext, b
|
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
HeaderTitle: ({ children, titleComponent, sx }: import("./Header").LayoutHeaderTitleProps) => JSX.Element;
|
|
22
22
|
HeaderSubTitle: ({ children, sx }: import("./Header").LayoutHeaderSubTitleProps) => JSX.Element;
|
|
23
|
-
ContentContainer: ({ children, sx }: {
|
|
23
|
+
ContentContainer: ({ children, sx, scrollbarPostion }: {
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
sx?: SxProps<Theme> | undefined;
|
|
26
|
+
scrollbarPostion?: number | undefined;
|
|
26
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
28
|
Subtitle: ({ children, alignment, justifyContent, sx }: {
|
|
28
29
|
children: React.ReactNode;
|
|
@@ -74,7 +74,9 @@ var EliceLayout = Object.assign(function (_ref) {
|
|
|
74
74
|
HeaderSubTitle: LayoutHeaderSubTitle.default,
|
|
75
75
|
ContentContainer: function ContentContainer(_ref3) {
|
|
76
76
|
var children = _ref3.children,
|
|
77
|
-
sx = _ref3.sx
|
|
77
|
+
sx = _ref3.sx,
|
|
78
|
+
_ref3$scrollbarPostio = _ref3.scrollbarPostion,
|
|
79
|
+
scrollbarPostion = _ref3$scrollbarPostio === void 0 ? 10 : _ref3$scrollbarPostio;
|
|
78
80
|
var theme = material.useTheme();
|
|
79
81
|
var contentRef = React__default.default.useRef(null);
|
|
80
82
|
var context = React__default.default.useContext(EliceLayoutContext);
|
|
@@ -88,42 +90,92 @@ var EliceLayout = Object.assign(function (_ref) {
|
|
|
88
90
|
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
89
91
|
hasScroll = _React$useState4[0],
|
|
90
92
|
setHasScroll = _React$useState4[1];
|
|
93
|
+
var scrollTopRef = React__default.default.useRef(0);
|
|
94
|
+
var scrollBarRef = React__default.default.useRef(null);
|
|
91
95
|
React__default.default.useEffect(function () {
|
|
92
|
-
if (!enableScrollTracking) return;
|
|
96
|
+
if (!enableScrollTracking) return;
|
|
97
|
+
var element = contentRef.current;
|
|
98
|
+
if (!element) return;
|
|
93
99
|
var handleScroll = function handleScroll() {
|
|
94
|
-
|
|
95
|
-
var scrollTop = contentRef.current.scrollTop;
|
|
96
|
-
setIsScrollActive(scrollTop > 10);
|
|
97
|
-
}
|
|
100
|
+
setIsScrollActive(element.scrollTop > 10);
|
|
98
101
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
element.addEventListener('scroll', handleScroll);
|
|
103
|
+
return function () {
|
|
104
|
+
element.removeEventListener('scroll', handleScroll);
|
|
105
|
+
};
|
|
106
|
+
}, [enableScrollTracking, setIsScrollActive]);
|
|
107
|
+
// ✅ 2. 스크롤 위치 계산용 useEffect (커스텀 스크롤바용)
|
|
108
|
+
React__default.default.useEffect(function () {
|
|
109
|
+
var el = contentRef.current;
|
|
110
|
+
if (!el) return;
|
|
111
|
+
var updateScrollBar = function updateScrollBar() {
|
|
112
|
+
var scrollTop = el.scrollTop,
|
|
113
|
+
scrollHeight = el.scrollHeight,
|
|
114
|
+
clientHeight = el.clientHeight;
|
|
115
|
+
// 상태로 관리하지 않고 직접 반영
|
|
116
|
+
scrollTopRef.current = scrollTop;
|
|
117
|
+
var thumbHeight = clientHeight / scrollHeight * clientHeight;
|
|
118
|
+
var top = scrollTop / scrollHeight * clientHeight;
|
|
119
|
+
if (scrollBarRef.current) {
|
|
120
|
+
scrollBarRef.current.style.height = "".concat(thumbHeight, "px");
|
|
121
|
+
scrollBarRef.current.style.top = "".concat(top, "px");
|
|
105
122
|
}
|
|
123
|
+
setHasScroll(scrollHeight > clientHeight);
|
|
106
124
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (element) {
|
|
114
|
-
element.removeEventListener('scroll', handleScroll);
|
|
125
|
+
el.addEventListener('scroll', updateScrollBar);
|
|
126
|
+
requestAnimationFrame(function () {
|
|
127
|
+
if (el.scrollHeight > el.clientHeight) {
|
|
128
|
+
el.scrollTop = 1; // 👉 살짝 움직여줌
|
|
129
|
+
el.scrollTop = 0; // 👉 바로 다시 원위치
|
|
130
|
+
updateScrollBar(); // 👉 thumb도 즉시 업데이트
|
|
115
131
|
}
|
|
132
|
+
});
|
|
133
|
+
return function () {
|
|
134
|
+
return el.removeEventListener('scroll', updateScrollBar);
|
|
116
135
|
};
|
|
117
|
-
}, [
|
|
118
|
-
return jsxRuntime.jsxs(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
136
|
+
}, []);
|
|
137
|
+
return jsxRuntime.jsxs(material.Stack, {
|
|
138
|
+
sx: {
|
|
139
|
+
position: 'relative',
|
|
140
|
+
height: '100%'
|
|
141
|
+
},
|
|
142
|
+
children: [jsxRuntime.jsxs(_ContentContainer, {
|
|
143
|
+
ref: contentRef,
|
|
144
|
+
theme: theme,
|
|
145
|
+
flex: 1,
|
|
146
|
+
sx: Object.assign(Object.assign({}, sx), {
|
|
147
|
+
scrollbarWidth: 'none',
|
|
148
|
+
msOverflowStyle: 'none',
|
|
149
|
+
'&::-webkit-scrollbar': {
|
|
150
|
+
display: 'none'
|
|
151
|
+
}
|
|
152
|
+
}),
|
|
153
|
+
children: [children, enableScrollTracking && hasScroll && !isScrollActive && jsxRuntime.jsx(ScrollMoreButton, {
|
|
154
|
+
children: jsxRuntime.jsx(ScrollMoreIcon.default, {
|
|
155
|
+
size: 32,
|
|
156
|
+
color: "white",
|
|
157
|
+
bgOpacity: 0.5
|
|
158
|
+
})
|
|
159
|
+
})]
|
|
160
|
+
}), hasScroll && jsxRuntime.jsx("div", {
|
|
161
|
+
style: {
|
|
162
|
+
position: 'absolute',
|
|
163
|
+
top: 0,
|
|
164
|
+
right: "".concat(-1 * scrollbarPostion, "px"),
|
|
165
|
+
width: '8px',
|
|
166
|
+
height: '100%',
|
|
167
|
+
backgroundColor: '#eee',
|
|
168
|
+
borderRadius: '4px'
|
|
169
|
+
},
|
|
170
|
+
children: jsxRuntime.jsx("div", {
|
|
171
|
+
ref: scrollBarRef,
|
|
172
|
+
style: {
|
|
173
|
+
width: '100%',
|
|
174
|
+
backgroundColor: theme.palette.primary.main,
|
|
175
|
+
borderRadius: '4px',
|
|
176
|
+
position: 'absolute',
|
|
177
|
+
transition: 'top 0.01s linear'
|
|
178
|
+
}
|
|
127
179
|
})
|
|
128
180
|
})]
|
|
129
181
|
});
|
|
@@ -229,7 +281,7 @@ var SubtitleContainer = /*#__PURE__*/_styled__default.default(material.Stack, {
|
|
|
229
281
|
}, ";");
|
|
230
282
|
var _ContentContainer = /*#__PURE__*/_styled__default.default(material.Stack, {
|
|
231
283
|
target: "efnp08i2"
|
|
232
|
-
})("flex:1;width:100%;max-width:1200px;max-height:calc(100vh - 74px - 92px);max-width:1200px;overflow-y:auto;min-height:0;position:relative
|
|
284
|
+
})("flex:1;width:100%;max-width:1200px;max-height:calc(100vh - 74px - 92px);max-width:1200px;overflow-y:auto;min-height:0;position:relative;&::-webkit-scrollbar{width:8px;}&::-webkit-scrollbar-thumb{background-color:", function (_ref16) {
|
|
233
285
|
var theme = _ref16.theme;
|
|
234
286
|
return theme.palette.primary.main;
|
|
235
287
|
}, ";border-radius:4px;}&::-webkit-scrollbar-track{background-color:", function (_ref17) {
|
|
@@ -62,8 +62,7 @@ var SoundVisualizer = function SoundVisualizer(_ref) {
|
|
|
62
62
|
position: "relative",
|
|
63
63
|
children: [(variant === 'circle' || variant === 'both') && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
64
64
|
children: [jsxRuntime.jsx(PulseCircle, {
|
|
65
|
-
pulseSize: pulseSize
|
|
66
|
-
theme: theme
|
|
65
|
+
pulseSize: pulseSize
|
|
67
66
|
}), jsxRuntime.jsx(CenterIconWrapper, {
|
|
68
67
|
bgColor: theme.palette.primary.main,
|
|
69
68
|
onClick: onClickRecord,
|
|
@@ -2,9 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var material = require('@mui/material');
|
|
9
|
+
var PlayArrowIcon = require('@mui/icons-material/PlayArrow');
|
|
10
|
+
var PauseIcon = require('@mui/icons-material/Pause');
|
|
11
|
+
var VolumeUpIcon = require('@mui/icons-material/VolumeUp');
|
|
12
|
+
var VolumeOffIcon = require('@mui/icons-material/VolumeOff');
|
|
13
|
+
var FullscreenIcon = require('@mui/icons-material/Fullscreen');
|
|
14
|
+
var FullscreenExitIcon = require('@mui/icons-material/FullscreenExit');
|
|
15
|
+
var SubtitlesIcon = require('@mui/icons-material/Subtitles');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
18
|
+
|
|
19
|
+
var PlayArrowIcon__default = /*#__PURE__*/_interopDefaultCompat(PlayArrowIcon);
|
|
20
|
+
var PauseIcon__default = /*#__PURE__*/_interopDefaultCompat(PauseIcon);
|
|
21
|
+
var VolumeUpIcon__default = /*#__PURE__*/_interopDefaultCompat(VolumeUpIcon);
|
|
22
|
+
var VolumeOffIcon__default = /*#__PURE__*/_interopDefaultCompat(VolumeOffIcon);
|
|
23
|
+
var FullscreenIcon__default = /*#__PURE__*/_interopDefaultCompat(FullscreenIcon);
|
|
24
|
+
var FullscreenExitIcon__default = /*#__PURE__*/_interopDefaultCompat(FullscreenExitIcon);
|
|
25
|
+
var SubtitlesIcon__default = /*#__PURE__*/_interopDefaultCompat(SubtitlesIcon);
|
|
8
26
|
|
|
9
27
|
var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
10
28
|
var source = _ref.source,
|
|
@@ -21,38 +39,135 @@ var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
|
21
39
|
videoKey = _ref.videoKey;
|
|
22
40
|
var videoRef = React.useRef(null);
|
|
23
41
|
var lastTime = React.useRef(videoKey ? Number(localStorage.getItem(videoKey)) || 0 : 0);
|
|
42
|
+
var _useState = React.useState(false),
|
|
43
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
44
|
+
isPlaying = _useState2[0],
|
|
45
|
+
setIsPlaying = _useState2[1];
|
|
46
|
+
var _useState3 = React.useState(false),
|
|
47
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
48
|
+
isFullscreen = _useState4[0],
|
|
49
|
+
setIsFullscreen = _useState4[1];
|
|
50
|
+
var _useState5 = React.useState(0),
|
|
51
|
+
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
|
52
|
+
currentTime = _useState6[0],
|
|
53
|
+
setCurrentTime = _useState6[1];
|
|
54
|
+
var _useState7 = React.useState(0),
|
|
55
|
+
_useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
|
|
56
|
+
duration = _useState8[0],
|
|
57
|
+
setDuration = _useState8[1];
|
|
58
|
+
var _useState9 = React.useState(1),
|
|
59
|
+
_useState10 = _rollupPluginBabelHelpers.slicedToArray(_useState9, 2),
|
|
60
|
+
volume = _useState10[0],
|
|
61
|
+
setVolume = _useState10[1];
|
|
62
|
+
var _useState11 = React.useState(1),
|
|
63
|
+
_useState12 = _rollupPluginBabelHelpers.slicedToArray(_useState11, 2),
|
|
64
|
+
speed = _useState12[0],
|
|
65
|
+
setSpeed = _useState12[1];
|
|
66
|
+
var _useState13 = React.useState(false),
|
|
67
|
+
_useState14 = _rollupPluginBabelHelpers.slicedToArray(_useState13, 2),
|
|
68
|
+
isMuted = _useState14[0],
|
|
69
|
+
setIsMuted = _useState14[1];
|
|
24
70
|
React.useEffect(function () {
|
|
25
71
|
var video = videoRef.current;
|
|
26
72
|
if (!video) return;
|
|
27
73
|
video.currentTime = lastTime.current;
|
|
28
74
|
var handlePlay = function handlePlay() {
|
|
29
|
-
|
|
75
|
+
setIsPlaying(true);
|
|
76
|
+
onPlay === null || onPlay === void 0 ? void 0 : onPlay();
|
|
30
77
|
};
|
|
31
78
|
var handlePause = function handlePause() {
|
|
32
|
-
|
|
79
|
+
setIsPlaying(false);
|
|
80
|
+
onPause === null || onPause === void 0 ? void 0 : onPause();
|
|
33
81
|
};
|
|
34
82
|
var handleEnded = function handleEnded() {
|
|
35
|
-
|
|
83
|
+
setIsPlaying(false);
|
|
84
|
+
onEnded === null || onEnded === void 0 ? void 0 : onEnded();
|
|
36
85
|
};
|
|
37
86
|
var handleTimeUpdate = function handleTimeUpdate() {
|
|
38
87
|
var seconds = video.currentTime;
|
|
88
|
+
setCurrentTime(seconds);
|
|
39
89
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress(seconds);
|
|
40
90
|
if (videoKey) {
|
|
41
91
|
localStorage.setItem(videoKey, seconds.toString());
|
|
42
92
|
}
|
|
43
93
|
};
|
|
94
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
95
|
+
setDuration(video.duration);
|
|
96
|
+
};
|
|
44
97
|
video.addEventListener('play', handlePlay);
|
|
45
98
|
video.addEventListener('pause', handlePause);
|
|
46
99
|
video.addEventListener('ended', handleEnded);
|
|
47
100
|
video.addEventListener('timeupdate', handleTimeUpdate);
|
|
101
|
+
video.addEventListener('loadedmetadata', handleLoadedMetadata);
|
|
48
102
|
return function () {
|
|
49
103
|
video.removeEventListener('play', handlePlay);
|
|
50
104
|
video.removeEventListener('pause', handlePause);
|
|
51
105
|
video.removeEventListener('ended', handleEnded);
|
|
52
106
|
video.removeEventListener('timeupdate', handleTimeUpdate);
|
|
107
|
+
video.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
|
53
108
|
};
|
|
54
109
|
}, [videoKey, onPlay, onPause, onEnded, onProgress]);
|
|
55
|
-
|
|
110
|
+
var handlePlayPause = function handlePlayPause() {
|
|
111
|
+
var video = videoRef.current;
|
|
112
|
+
if (video) {
|
|
113
|
+
if (isPlaying) {
|
|
114
|
+
video.pause();
|
|
115
|
+
} else {
|
|
116
|
+
video.play();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var handleVolumeChange = function handleVolumeChange(event, newValue) {
|
|
121
|
+
var volume = newValue;
|
|
122
|
+
setVolume(volume);
|
|
123
|
+
var video = videoRef.current;
|
|
124
|
+
if (video) {
|
|
125
|
+
video.volume = volume;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var handleSpeedChange = function handleSpeedChange(event) {
|
|
129
|
+
var speed = event.target.value;
|
|
130
|
+
setSpeed(speed);
|
|
131
|
+
var video = videoRef.current;
|
|
132
|
+
if (video) {
|
|
133
|
+
video.playbackRate = speed;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
var toggleMute = function toggleMute() {
|
|
137
|
+
setIsMuted(function (prev) {
|
|
138
|
+
var video = videoRef.current;
|
|
139
|
+
if (video) {
|
|
140
|
+
video.muted = !prev;
|
|
141
|
+
return !prev;
|
|
142
|
+
}
|
|
143
|
+
return prev;
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
var toggleFullscreen = function toggleFullscreen() {
|
|
147
|
+
var _a;
|
|
148
|
+
var videoContainer = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
149
|
+
if (videoContainer) {
|
|
150
|
+
if (isFullscreen) {
|
|
151
|
+
if (document.exitFullscreen) {
|
|
152
|
+
document.exitFullscreen();
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
if (videoContainer.requestFullscreen) {
|
|
156
|
+
videoContainer.requestFullscreen();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
setIsFullscreen(!isFullscreen);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var handleSeek = function handleSeek(event, newValue) {
|
|
163
|
+
var newTime = newValue;
|
|
164
|
+
var video = videoRef.current;
|
|
165
|
+
if (video) {
|
|
166
|
+
video.currentTime = newTime;
|
|
167
|
+
setCurrentTime(newTime);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
return jsxRuntime.jsxs(material.Stack, {
|
|
56
171
|
width: "100%",
|
|
57
172
|
height: height,
|
|
58
173
|
borderRadius: "1rem",
|
|
@@ -62,13 +177,13 @@ var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
|
62
177
|
video: {
|
|
63
178
|
width: '100%',
|
|
64
179
|
height: '100%',
|
|
65
|
-
|
|
180
|
+
borderTopRadius: '1rem',
|
|
66
181
|
objectFit: 'cover'
|
|
67
182
|
}
|
|
68
183
|
}, sx),
|
|
69
|
-
children: jsxRuntime.jsxs("video", {
|
|
184
|
+
children: [jsxRuntime.jsxs("video", {
|
|
70
185
|
ref: videoRef,
|
|
71
|
-
controls:
|
|
186
|
+
controls: false,
|
|
72
187
|
autoPlay: autoPlay,
|
|
73
188
|
width: "100%",
|
|
74
189
|
crossOrigin: "anonymous",
|
|
@@ -83,7 +198,74 @@ var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
|
83
198
|
label: track.label
|
|
84
199
|
}, i);
|
|
85
200
|
}), "Your browser does not support the video tag."]
|
|
86
|
-
})
|
|
201
|
+
}), jsxRuntime.jsxs(material.Box, {
|
|
202
|
+
sx: {
|
|
203
|
+
backgroundColor: 'black',
|
|
204
|
+
padding: '10px',
|
|
205
|
+
display: 'flex',
|
|
206
|
+
alignItems: 'center',
|
|
207
|
+
justifyContent: 'space-between'
|
|
208
|
+
},
|
|
209
|
+
children: [jsxRuntime.jsx(material.IconButton, {
|
|
210
|
+
onClick: handlePlayPause,
|
|
211
|
+
color: "primary",
|
|
212
|
+
children: isPlaying ? jsxRuntime.jsx(PauseIcon__default.default, {}) : jsxRuntime.jsx(PlayArrowIcon__default.default, {})
|
|
213
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
214
|
+
color: "white",
|
|
215
|
+
children: "".concat(Math.floor(currentTime / 60), ":").concat(Math.floor(currentTime % 60))
|
|
216
|
+
}), jsxRuntime.jsx(material.Slider, {
|
|
217
|
+
value: currentTime,
|
|
218
|
+
max: duration,
|
|
219
|
+
onChange: handleSeek,
|
|
220
|
+
sx: {
|
|
221
|
+
width: '200px',
|
|
222
|
+
marginX: '10px'
|
|
223
|
+
}
|
|
224
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
225
|
+
color: "white",
|
|
226
|
+
children: "".concat(Math.floor(duration / 60), ":").concat(Math.floor(duration % 60))
|
|
227
|
+
}), jsxRuntime.jsxs("select", {
|
|
228
|
+
onChange: handleSpeedChange,
|
|
229
|
+
value: speed,
|
|
230
|
+
style: {
|
|
231
|
+
backgroundColor: 'black',
|
|
232
|
+
color: 'white'
|
|
233
|
+
},
|
|
234
|
+
children: [jsxRuntime.jsx("option", {
|
|
235
|
+
value: 0.5,
|
|
236
|
+
children: "0.5x"
|
|
237
|
+
}), jsxRuntime.jsx("option", {
|
|
238
|
+
value: 1,
|
|
239
|
+
children: "1x"
|
|
240
|
+
}), jsxRuntime.jsx("option", {
|
|
241
|
+
value: 1.5,
|
|
242
|
+
children: "1.5x"
|
|
243
|
+
}), jsxRuntime.jsx("option", {
|
|
244
|
+
value: 2,
|
|
245
|
+
children: "2x"
|
|
246
|
+
})]
|
|
247
|
+
}), jsxRuntime.jsx(material.IconButton, {
|
|
248
|
+
onClick: toggleMute,
|
|
249
|
+
color: "primary",
|
|
250
|
+
children: isMuted || volume === 0 ? jsxRuntime.jsx(VolumeOffIcon__default.default, {}) : jsxRuntime.jsx(VolumeUpIcon__default.default, {})
|
|
251
|
+
}), jsxRuntime.jsx(material.Slider, {
|
|
252
|
+
value: isMuted ? 0 : volume,
|
|
253
|
+
onChange: handleVolumeChange,
|
|
254
|
+
min: 0,
|
|
255
|
+
max: 1,
|
|
256
|
+
step: 0.01,
|
|
257
|
+
sx: {
|
|
258
|
+
width: '100px'
|
|
259
|
+
}
|
|
260
|
+
}), jsxRuntime.jsx(material.IconButton, {
|
|
261
|
+
color: "primary",
|
|
262
|
+
children: jsxRuntime.jsx(SubtitlesIcon__default.default, {})
|
|
263
|
+
}), jsxRuntime.jsx(material.IconButton, {
|
|
264
|
+
onClick: toggleFullscreen,
|
|
265
|
+
color: "primary",
|
|
266
|
+
children: isFullscreen ? jsxRuntime.jsx(FullscreenExitIcon__default.default, {}) : jsxRuntime.jsx(FullscreenIcon__default.default, {})
|
|
267
|
+
})]
|
|
268
|
+
})]
|
|
87
269
|
});
|
|
88
270
|
};
|
|
89
271
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var material = require('@mui/material');
|
|
4
|
+
var gray = require('../tokens/colors/gray.js');
|
|
4
5
|
var common = require('../tokens/colors/common.js');
|
|
5
6
|
var typography = require('../typography/typography.js');
|
|
6
7
|
var _base = require('./_base.js');
|
|
@@ -33,7 +34,8 @@ var createAIDTTheme = function createAIDTTheme(_ref) {
|
|
|
33
34
|
background: {
|
|
34
35
|
"default": themeColors.background
|
|
35
36
|
},
|
|
36
|
-
common: common.common
|
|
37
|
+
common: common.common,
|
|
38
|
+
grey: gray.gray
|
|
37
39
|
},
|
|
38
40
|
breakpoints: breakpoints.AIDTBreakpoints,
|
|
39
41
|
typography: typography.createAIDTTypography(typographyFontFamily)
|
|
@@ -15,7 +15,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
15
15
|
"@media (max-width:1200px)": {
|
|
16
16
|
fontSize: string;
|
|
17
17
|
};
|
|
18
|
-
"@media (max-width:
|
|
18
|
+
"@media (max-width:768px)": {
|
|
19
19
|
fontSize: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -26,7 +26,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
26
26
|
"@media (max-width:1200px)": {
|
|
27
27
|
fontSize: string;
|
|
28
28
|
};
|
|
29
|
-
"@media (max-width:
|
|
29
|
+
"@media (max-width:768px)": {
|
|
30
30
|
fontSize: string;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -37,7 +37,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
37
37
|
"@media (max-width:1200px)": {
|
|
38
38
|
fontSize: string;
|
|
39
39
|
};
|
|
40
|
-
"@media (max-width:
|
|
40
|
+
"@media (max-width:768px)": {
|
|
41
41
|
fontSize: string;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -48,7 +48,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
48
48
|
"@media (max-width:1200px)": {
|
|
49
49
|
fontSize: string;
|
|
50
50
|
};
|
|
51
|
-
"@media (max-width:
|
|
51
|
+
"@media (max-width:768px)": {
|
|
52
52
|
fontSize: string;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -59,7 +59,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
59
59
|
"@media (max-width:1200px)": {
|
|
60
60
|
fontSize: string;
|
|
61
61
|
};
|
|
62
|
-
"@media (max-width:
|
|
62
|
+
"@media (max-width:768px)": {
|
|
63
63
|
fontSize: string;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -70,7 +70,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
70
70
|
"@media (max-width:1200px)": {
|
|
71
71
|
fontSize: string;
|
|
72
72
|
};
|
|
73
|
-
"@media (max-width:
|
|
73
|
+
"@media (max-width:768px)": {
|
|
74
74
|
fontSize: string;
|
|
75
75
|
};
|
|
76
76
|
};
|
|
@@ -81,7 +81,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
81
81
|
"@media (max-width:1200px)": {
|
|
82
82
|
fontSize: string;
|
|
83
83
|
};
|
|
84
|
-
"@media (max-width:
|
|
84
|
+
"@media (max-width:768px)": {
|
|
85
85
|
fontSize: string;
|
|
86
86
|
};
|
|
87
87
|
};
|
|
@@ -49,7 +49,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
49
49
|
lineHeight: '140%'
|
|
50
50
|
}, "@media (max-width:1200px)", {
|
|
51
51
|
fontSize: '20px'
|
|
52
|
-
}), "@media (max-width:
|
|
52
|
+
}), "@media (max-width:768px)", {
|
|
53
53
|
fontSize: '22px'
|
|
54
54
|
}),
|
|
55
55
|
subtitle1: _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({
|
|
@@ -58,7 +58,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
58
58
|
lineHeight: '140%'
|
|
59
59
|
}, "@media (max-width:1200px)", {
|
|
60
60
|
fontSize: '26px'
|
|
61
|
-
}), "@media (max-width:
|
|
61
|
+
}), "@media (max-width:768px)", {
|
|
62
62
|
fontSize: '22px'
|
|
63
63
|
}),
|
|
64
64
|
subtitle2: _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({
|
|
@@ -67,7 +67,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
67
67
|
lineHeight: '160%'
|
|
68
68
|
}, "@media (max-width:1200px)", {
|
|
69
69
|
fontSize: '24px'
|
|
70
|
-
}), "@media (max-width:
|
|
70
|
+
}), "@media (max-width:768px)", {
|
|
71
71
|
fontSize: '18px'
|
|
72
72
|
}),
|
|
73
73
|
subtitle3: _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({
|
|
@@ -76,7 +76,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
76
76
|
lineHeight: '140%'
|
|
77
77
|
}, "@media (max-width:1200px)", {
|
|
78
78
|
fontSize: '20px'
|
|
79
|
-
}), "@media (max-width:
|
|
79
|
+
}), "@media (max-width:768px)", {
|
|
80
80
|
fontSize: '16px'
|
|
81
81
|
}),
|
|
82
82
|
body1: _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({
|
|
@@ -85,7 +85,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
85
85
|
lineHeight: '140%'
|
|
86
86
|
}, "@media (max-width:1200px)", {
|
|
87
87
|
fontSize: '20px'
|
|
88
|
-
}), "@media (max-width:
|
|
88
|
+
}), "@media (max-width:768px)", {
|
|
89
89
|
fontSize: '16px'
|
|
90
90
|
}),
|
|
91
91
|
buttoninput: _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({
|
|
@@ -94,7 +94,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
94
94
|
lineHeight: '140%'
|
|
95
95
|
}, "@media (max-width:1200px)", {
|
|
96
96
|
fontSize: '20px'
|
|
97
|
-
}), "@media (max-width:
|
|
97
|
+
}), "@media (max-width:768px)", {
|
|
98
98
|
fontSize: '16px'
|
|
99
99
|
}),
|
|
100
100
|
pagination: _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({
|
|
@@ -103,7 +103,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
103
103
|
lineHeight: '140%'
|
|
104
104
|
}, "@media (max-width:1200px)", {
|
|
105
105
|
fontSize: '32px'
|
|
106
|
-
}), "@media (max-width:
|
|
106
|
+
}), "@media (max-width:768px)", {
|
|
107
107
|
fontSize: '24px'
|
|
108
108
|
})
|
|
109
109
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
|
-
import { jsx
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Stack } from '@mui/material';
|
|
4
4
|
import img from '../../assets/AIAvatar.png.js';
|
|
5
5
|
import EliceTooltip from '../tooltip/Tooltip.js';
|
|
@@ -16,16 +16,16 @@ var EliceAIFeedback = function EliceAIFeedback(_a) {
|
|
|
16
16
|
}, rest, {
|
|
17
17
|
isControl: true,
|
|
18
18
|
triggerAction: "click",
|
|
19
|
-
children:
|
|
19
|
+
children: jsx(Stack, {
|
|
20
20
|
position: "relative",
|
|
21
21
|
width: "fit-content",
|
|
22
22
|
height: "fit-content",
|
|
23
23
|
maxWidth: "100%",
|
|
24
24
|
maxHeight: "100%",
|
|
25
|
-
children:
|
|
25
|
+
children: CustomAvatar !== null && CustomAvatar !== void 0 ? CustomAvatar : jsx("img", {
|
|
26
26
|
src: img,
|
|
27
27
|
alt: "AI Avatar"
|
|
28
|
-
})
|
|
28
|
+
})
|
|
29
29
|
})
|
|
30
30
|
}));
|
|
31
31
|
};
|
|
@@ -20,9 +20,10 @@ declare const EliceLayout: (({ children, onPrev, onNext, allowPrev, allowNext, b
|
|
|
20
20
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
HeaderTitle: ({ children, titleComponent, sx }: import("./Header").LayoutHeaderTitleProps) => JSX.Element;
|
|
22
22
|
HeaderSubTitle: ({ children, sx }: import("./Header").LayoutHeaderSubTitleProps) => JSX.Element;
|
|
23
|
-
ContentContainer: ({ children, sx }: {
|
|
23
|
+
ContentContainer: ({ children, sx, scrollbarPostion }: {
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
sx?: SxProps<Theme> | undefined;
|
|
26
|
+
scrollbarPostion?: number | undefined;
|
|
26
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
28
|
Subtitle: ({ children, alignment, justifyContent, sx }: {
|
|
28
29
|
children: React.ReactNode;
|
|
@@ -65,7 +65,9 @@ var EliceLayout = Object.assign(function (_ref) {
|
|
|
65
65
|
HeaderSubTitle: LayoutHeaderSubTitle,
|
|
66
66
|
ContentContainer: function ContentContainer(_ref3) {
|
|
67
67
|
var children = _ref3.children,
|
|
68
|
-
sx = _ref3.sx
|
|
68
|
+
sx = _ref3.sx,
|
|
69
|
+
_ref3$scrollbarPostio = _ref3.scrollbarPostion,
|
|
70
|
+
scrollbarPostion = _ref3$scrollbarPostio === void 0 ? 10 : _ref3$scrollbarPostio;
|
|
69
71
|
var theme = useTheme();
|
|
70
72
|
var contentRef = React.useRef(null);
|
|
71
73
|
var context = React.useContext(EliceLayoutContext);
|
|
@@ -79,42 +81,92 @@ var EliceLayout = Object.assign(function (_ref) {
|
|
|
79
81
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
80
82
|
hasScroll = _React$useState4[0],
|
|
81
83
|
setHasScroll = _React$useState4[1];
|
|
84
|
+
var scrollTopRef = React.useRef(0);
|
|
85
|
+
var scrollBarRef = React.useRef(null);
|
|
82
86
|
React.useEffect(function () {
|
|
83
|
-
if (!enableScrollTracking) return;
|
|
87
|
+
if (!enableScrollTracking) return;
|
|
88
|
+
var element = contentRef.current;
|
|
89
|
+
if (!element) return;
|
|
84
90
|
var handleScroll = function handleScroll() {
|
|
85
|
-
|
|
86
|
-
var scrollTop = contentRef.current.scrollTop;
|
|
87
|
-
setIsScrollActive(scrollTop > 10);
|
|
88
|
-
}
|
|
91
|
+
setIsScrollActive(element.scrollTop > 10);
|
|
89
92
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
element.addEventListener('scroll', handleScroll);
|
|
94
|
+
return function () {
|
|
95
|
+
element.removeEventListener('scroll', handleScroll);
|
|
96
|
+
};
|
|
97
|
+
}, [enableScrollTracking, setIsScrollActive]);
|
|
98
|
+
// ✅ 2. 스크롤 위치 계산용 useEffect (커스텀 스크롤바용)
|
|
99
|
+
React.useEffect(function () {
|
|
100
|
+
var el = contentRef.current;
|
|
101
|
+
if (!el) return;
|
|
102
|
+
var updateScrollBar = function updateScrollBar() {
|
|
103
|
+
var scrollTop = el.scrollTop,
|
|
104
|
+
scrollHeight = el.scrollHeight,
|
|
105
|
+
clientHeight = el.clientHeight;
|
|
106
|
+
// 상태로 관리하지 않고 직접 반영
|
|
107
|
+
scrollTopRef.current = scrollTop;
|
|
108
|
+
var thumbHeight = clientHeight / scrollHeight * clientHeight;
|
|
109
|
+
var top = scrollTop / scrollHeight * clientHeight;
|
|
110
|
+
if (scrollBarRef.current) {
|
|
111
|
+
scrollBarRef.current.style.height = "".concat(thumbHeight, "px");
|
|
112
|
+
scrollBarRef.current.style.top = "".concat(top, "px");
|
|
96
113
|
}
|
|
114
|
+
setHasScroll(scrollHeight > clientHeight);
|
|
97
115
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (element) {
|
|
105
|
-
element.removeEventListener('scroll', handleScroll);
|
|
116
|
+
el.addEventListener('scroll', updateScrollBar);
|
|
117
|
+
requestAnimationFrame(function () {
|
|
118
|
+
if (el.scrollHeight > el.clientHeight) {
|
|
119
|
+
el.scrollTop = 1; // 👉 살짝 움직여줌
|
|
120
|
+
el.scrollTop = 0; // 👉 바로 다시 원위치
|
|
121
|
+
updateScrollBar(); // 👉 thumb도 즉시 업데이트
|
|
106
122
|
}
|
|
123
|
+
});
|
|
124
|
+
return function () {
|
|
125
|
+
return el.removeEventListener('scroll', updateScrollBar);
|
|
107
126
|
};
|
|
108
|
-
}, [
|
|
109
|
-
return jsxs(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
}, []);
|
|
128
|
+
return jsxs(Stack, {
|
|
129
|
+
sx: {
|
|
130
|
+
position: 'relative',
|
|
131
|
+
height: '100%'
|
|
132
|
+
},
|
|
133
|
+
children: [jsxs(_ContentContainer, {
|
|
134
|
+
ref: contentRef,
|
|
135
|
+
theme: theme,
|
|
136
|
+
flex: 1,
|
|
137
|
+
sx: Object.assign(Object.assign({}, sx), {
|
|
138
|
+
scrollbarWidth: 'none',
|
|
139
|
+
msOverflowStyle: 'none',
|
|
140
|
+
'&::-webkit-scrollbar': {
|
|
141
|
+
display: 'none'
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
children: [children, enableScrollTracking && hasScroll && !isScrollActive && jsx(ScrollMoreButton, {
|
|
145
|
+
children: jsx(ScrollMoreIcon, {
|
|
146
|
+
size: 32,
|
|
147
|
+
color: "white",
|
|
148
|
+
bgOpacity: 0.5
|
|
149
|
+
})
|
|
150
|
+
})]
|
|
151
|
+
}), hasScroll && jsx("div", {
|
|
152
|
+
style: {
|
|
153
|
+
position: 'absolute',
|
|
154
|
+
top: 0,
|
|
155
|
+
right: "".concat(-1 * scrollbarPostion, "px"),
|
|
156
|
+
width: '8px',
|
|
157
|
+
height: '100%',
|
|
158
|
+
backgroundColor: '#eee',
|
|
159
|
+
borderRadius: '4px'
|
|
160
|
+
},
|
|
161
|
+
children: jsx("div", {
|
|
162
|
+
ref: scrollBarRef,
|
|
163
|
+
style: {
|
|
164
|
+
width: '100%',
|
|
165
|
+
backgroundColor: theme.palette.primary.main,
|
|
166
|
+
borderRadius: '4px',
|
|
167
|
+
position: 'absolute',
|
|
168
|
+
transition: 'top 0.01s linear'
|
|
169
|
+
}
|
|
118
170
|
})
|
|
119
171
|
})]
|
|
120
172
|
});
|
|
@@ -220,7 +272,7 @@ var SubtitleContainer = /*#__PURE__*/_styled(Stack, {
|
|
|
220
272
|
}, ";");
|
|
221
273
|
var _ContentContainer = /*#__PURE__*/_styled(Stack, {
|
|
222
274
|
target: "efnp08i2"
|
|
223
|
-
})("flex:1;width:100%;max-width:1200px;max-height:calc(100vh - 74px - 92px);max-width:1200px;overflow-y:auto;min-height:0;position:relative
|
|
275
|
+
})("flex:1;width:100%;max-width:1200px;max-height:calc(100vh - 74px - 92px);max-width:1200px;overflow-y:auto;min-height:0;position:relative;&::-webkit-scrollbar{width:8px;}&::-webkit-scrollbar-thumb{background-color:", function (_ref16) {
|
|
224
276
|
var theme = _ref16.theme;
|
|
225
277
|
return theme.palette.primary.main;
|
|
226
278
|
}, ";border-radius:4px;}&::-webkit-scrollbar-track{background-color:", function (_ref17) {
|
|
@@ -54,8 +54,7 @@ var SoundVisualizer = function SoundVisualizer(_ref) {
|
|
|
54
54
|
position: "relative",
|
|
55
55
|
children: [(variant === 'circle' || variant === 'both') && jsxs(Fragment, {
|
|
56
56
|
children: [jsx(PulseCircle, {
|
|
57
|
-
pulseSize: pulseSize
|
|
58
|
-
theme: theme
|
|
57
|
+
pulseSize: pulseSize
|
|
59
58
|
}), jsx(CenterIconWrapper, {
|
|
60
59
|
bgColor: theme.palette.primary.main,
|
|
61
60
|
onClick: onClickRecord,
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import { Stack, Box, IconButton, Typography, Slider } from '@mui/material';
|
|
5
|
+
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
|
6
|
+
import PauseIcon from '@mui/icons-material/Pause';
|
|
7
|
+
import VolumeUpIcon from '@mui/icons-material/VolumeUp';
|
|
8
|
+
import VolumeOffIcon from '@mui/icons-material/VolumeOff';
|
|
9
|
+
import FullscreenIcon from '@mui/icons-material/Fullscreen';
|
|
10
|
+
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';
|
|
11
|
+
import SubtitlesIcon from '@mui/icons-material/Subtitles';
|
|
4
12
|
|
|
5
13
|
var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
6
14
|
var source = _ref.source,
|
|
@@ -17,38 +25,135 @@ var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
|
17
25
|
videoKey = _ref.videoKey;
|
|
18
26
|
var videoRef = useRef(null);
|
|
19
27
|
var lastTime = useRef(videoKey ? Number(localStorage.getItem(videoKey)) || 0 : 0);
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
isPlaying = _useState2[0],
|
|
31
|
+
setIsPlaying = _useState2[1];
|
|
32
|
+
var _useState3 = useState(false),
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
isFullscreen = _useState4[0],
|
|
35
|
+
setIsFullscreen = _useState4[1];
|
|
36
|
+
var _useState5 = useState(0),
|
|
37
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
38
|
+
currentTime = _useState6[0],
|
|
39
|
+
setCurrentTime = _useState6[1];
|
|
40
|
+
var _useState7 = useState(0),
|
|
41
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
42
|
+
duration = _useState8[0],
|
|
43
|
+
setDuration = _useState8[1];
|
|
44
|
+
var _useState9 = useState(1),
|
|
45
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
46
|
+
volume = _useState10[0],
|
|
47
|
+
setVolume = _useState10[1];
|
|
48
|
+
var _useState11 = useState(1),
|
|
49
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
50
|
+
speed = _useState12[0],
|
|
51
|
+
setSpeed = _useState12[1];
|
|
52
|
+
var _useState13 = useState(false),
|
|
53
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
54
|
+
isMuted = _useState14[0],
|
|
55
|
+
setIsMuted = _useState14[1];
|
|
20
56
|
useEffect(function () {
|
|
21
57
|
var video = videoRef.current;
|
|
22
58
|
if (!video) return;
|
|
23
59
|
video.currentTime = lastTime.current;
|
|
24
60
|
var handlePlay = function handlePlay() {
|
|
25
|
-
|
|
61
|
+
setIsPlaying(true);
|
|
62
|
+
onPlay === null || onPlay === void 0 ? void 0 : onPlay();
|
|
26
63
|
};
|
|
27
64
|
var handlePause = function handlePause() {
|
|
28
|
-
|
|
65
|
+
setIsPlaying(false);
|
|
66
|
+
onPause === null || onPause === void 0 ? void 0 : onPause();
|
|
29
67
|
};
|
|
30
68
|
var handleEnded = function handleEnded() {
|
|
31
|
-
|
|
69
|
+
setIsPlaying(false);
|
|
70
|
+
onEnded === null || onEnded === void 0 ? void 0 : onEnded();
|
|
32
71
|
};
|
|
33
72
|
var handleTimeUpdate = function handleTimeUpdate() {
|
|
34
73
|
var seconds = video.currentTime;
|
|
74
|
+
setCurrentTime(seconds);
|
|
35
75
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress(seconds);
|
|
36
76
|
if (videoKey) {
|
|
37
77
|
localStorage.setItem(videoKey, seconds.toString());
|
|
38
78
|
}
|
|
39
79
|
};
|
|
80
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
81
|
+
setDuration(video.duration);
|
|
82
|
+
};
|
|
40
83
|
video.addEventListener('play', handlePlay);
|
|
41
84
|
video.addEventListener('pause', handlePause);
|
|
42
85
|
video.addEventListener('ended', handleEnded);
|
|
43
86
|
video.addEventListener('timeupdate', handleTimeUpdate);
|
|
87
|
+
video.addEventListener('loadedmetadata', handleLoadedMetadata);
|
|
44
88
|
return function () {
|
|
45
89
|
video.removeEventListener('play', handlePlay);
|
|
46
90
|
video.removeEventListener('pause', handlePause);
|
|
47
91
|
video.removeEventListener('ended', handleEnded);
|
|
48
92
|
video.removeEventListener('timeupdate', handleTimeUpdate);
|
|
93
|
+
video.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
|
49
94
|
};
|
|
50
95
|
}, [videoKey, onPlay, onPause, onEnded, onProgress]);
|
|
51
|
-
|
|
96
|
+
var handlePlayPause = function handlePlayPause() {
|
|
97
|
+
var video = videoRef.current;
|
|
98
|
+
if (video) {
|
|
99
|
+
if (isPlaying) {
|
|
100
|
+
video.pause();
|
|
101
|
+
} else {
|
|
102
|
+
video.play();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var handleVolumeChange = function handleVolumeChange(event, newValue) {
|
|
107
|
+
var volume = newValue;
|
|
108
|
+
setVolume(volume);
|
|
109
|
+
var video = videoRef.current;
|
|
110
|
+
if (video) {
|
|
111
|
+
video.volume = volume;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var handleSpeedChange = function handleSpeedChange(event) {
|
|
115
|
+
var speed = event.target.value;
|
|
116
|
+
setSpeed(speed);
|
|
117
|
+
var video = videoRef.current;
|
|
118
|
+
if (video) {
|
|
119
|
+
video.playbackRate = speed;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var toggleMute = function toggleMute() {
|
|
123
|
+
setIsMuted(function (prev) {
|
|
124
|
+
var video = videoRef.current;
|
|
125
|
+
if (video) {
|
|
126
|
+
video.muted = !prev;
|
|
127
|
+
return !prev;
|
|
128
|
+
}
|
|
129
|
+
return prev;
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
var toggleFullscreen = function toggleFullscreen() {
|
|
133
|
+
var _a;
|
|
134
|
+
var videoContainer = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
135
|
+
if (videoContainer) {
|
|
136
|
+
if (isFullscreen) {
|
|
137
|
+
if (document.exitFullscreen) {
|
|
138
|
+
document.exitFullscreen();
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
if (videoContainer.requestFullscreen) {
|
|
142
|
+
videoContainer.requestFullscreen();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
setIsFullscreen(!isFullscreen);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
var handleSeek = function handleSeek(event, newValue) {
|
|
149
|
+
var newTime = newValue;
|
|
150
|
+
var video = videoRef.current;
|
|
151
|
+
if (video) {
|
|
152
|
+
video.currentTime = newTime;
|
|
153
|
+
setCurrentTime(newTime);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return jsxs(Stack, {
|
|
52
157
|
width: "100%",
|
|
53
158
|
height: height,
|
|
54
159
|
borderRadius: "1rem",
|
|
@@ -58,13 +163,13 @@ var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
|
58
163
|
video: {
|
|
59
164
|
width: '100%',
|
|
60
165
|
height: '100%',
|
|
61
|
-
|
|
166
|
+
borderTopRadius: '1rem',
|
|
62
167
|
objectFit: 'cover'
|
|
63
168
|
}
|
|
64
169
|
}, sx),
|
|
65
|
-
children: jsxs("video", {
|
|
170
|
+
children: [jsxs("video", {
|
|
66
171
|
ref: videoRef,
|
|
67
|
-
controls:
|
|
172
|
+
controls: false,
|
|
68
173
|
autoPlay: autoPlay,
|
|
69
174
|
width: "100%",
|
|
70
175
|
crossOrigin: "anonymous",
|
|
@@ -79,7 +184,74 @@ var EliceVideoPlayer = function EliceVideoPlayer(_ref) {
|
|
|
79
184
|
label: track.label
|
|
80
185
|
}, i);
|
|
81
186
|
}), "Your browser does not support the video tag."]
|
|
82
|
-
})
|
|
187
|
+
}), jsxs(Box, {
|
|
188
|
+
sx: {
|
|
189
|
+
backgroundColor: 'black',
|
|
190
|
+
padding: '10px',
|
|
191
|
+
display: 'flex',
|
|
192
|
+
alignItems: 'center',
|
|
193
|
+
justifyContent: 'space-between'
|
|
194
|
+
},
|
|
195
|
+
children: [jsx(IconButton, {
|
|
196
|
+
onClick: handlePlayPause,
|
|
197
|
+
color: "primary",
|
|
198
|
+
children: isPlaying ? jsx(PauseIcon, {}) : jsx(PlayArrowIcon, {})
|
|
199
|
+
}), jsx(Typography, {
|
|
200
|
+
color: "white",
|
|
201
|
+
children: "".concat(Math.floor(currentTime / 60), ":").concat(Math.floor(currentTime % 60))
|
|
202
|
+
}), jsx(Slider, {
|
|
203
|
+
value: currentTime,
|
|
204
|
+
max: duration,
|
|
205
|
+
onChange: handleSeek,
|
|
206
|
+
sx: {
|
|
207
|
+
width: '200px',
|
|
208
|
+
marginX: '10px'
|
|
209
|
+
}
|
|
210
|
+
}), jsx(Typography, {
|
|
211
|
+
color: "white",
|
|
212
|
+
children: "".concat(Math.floor(duration / 60), ":").concat(Math.floor(duration % 60))
|
|
213
|
+
}), jsxs("select", {
|
|
214
|
+
onChange: handleSpeedChange,
|
|
215
|
+
value: speed,
|
|
216
|
+
style: {
|
|
217
|
+
backgroundColor: 'black',
|
|
218
|
+
color: 'white'
|
|
219
|
+
},
|
|
220
|
+
children: [jsx("option", {
|
|
221
|
+
value: 0.5,
|
|
222
|
+
children: "0.5x"
|
|
223
|
+
}), jsx("option", {
|
|
224
|
+
value: 1,
|
|
225
|
+
children: "1x"
|
|
226
|
+
}), jsx("option", {
|
|
227
|
+
value: 1.5,
|
|
228
|
+
children: "1.5x"
|
|
229
|
+
}), jsx("option", {
|
|
230
|
+
value: 2,
|
|
231
|
+
children: "2x"
|
|
232
|
+
})]
|
|
233
|
+
}), jsx(IconButton, {
|
|
234
|
+
onClick: toggleMute,
|
|
235
|
+
color: "primary",
|
|
236
|
+
children: isMuted || volume === 0 ? jsx(VolumeOffIcon, {}) : jsx(VolumeUpIcon, {})
|
|
237
|
+
}), jsx(Slider, {
|
|
238
|
+
value: isMuted ? 0 : volume,
|
|
239
|
+
onChange: handleVolumeChange,
|
|
240
|
+
min: 0,
|
|
241
|
+
max: 1,
|
|
242
|
+
step: 0.01,
|
|
243
|
+
sx: {
|
|
244
|
+
width: '100px'
|
|
245
|
+
}
|
|
246
|
+
}), jsx(IconButton, {
|
|
247
|
+
color: "primary",
|
|
248
|
+
children: jsx(SubtitlesIcon, {})
|
|
249
|
+
}), jsx(IconButton, {
|
|
250
|
+
onClick: toggleFullscreen,
|
|
251
|
+
color: "primary",
|
|
252
|
+
children: isFullscreen ? jsx(FullscreenExitIcon, {}) : jsx(FullscreenIcon, {})
|
|
253
|
+
})]
|
|
254
|
+
})]
|
|
83
255
|
});
|
|
84
256
|
};
|
|
85
257
|
|
|
@@ -4,6 +4,7 @@ import { basePalette } from './_base.js';
|
|
|
4
4
|
import { getThemeColors } from './AIDTTheme.js';
|
|
5
5
|
import { AIDTBreakpoints } from '../breakpoints/breakpoints.js';
|
|
6
6
|
import { common } from '../tokens/colors/common.js';
|
|
7
|
+
import { gray } from '../tokens/colors/gray.js';
|
|
7
8
|
|
|
8
9
|
var createAIDTTheme = function createAIDTTheme(_ref) {
|
|
9
10
|
var _ref$paletteMode = _ref.paletteMode,
|
|
@@ -31,7 +32,8 @@ var createAIDTTheme = function createAIDTTheme(_ref) {
|
|
|
31
32
|
background: {
|
|
32
33
|
"default": themeColors.background
|
|
33
34
|
},
|
|
34
|
-
common: common
|
|
35
|
+
common: common,
|
|
36
|
+
grey: gray
|
|
35
37
|
},
|
|
36
38
|
breakpoints: AIDTBreakpoints,
|
|
37
39
|
typography: createAIDTTypography(typographyFontFamily)
|
|
@@ -15,7 +15,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
15
15
|
"@media (max-width:1200px)": {
|
|
16
16
|
fontSize: string;
|
|
17
17
|
};
|
|
18
|
-
"@media (max-width:
|
|
18
|
+
"@media (max-width:768px)": {
|
|
19
19
|
fontSize: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -26,7 +26,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
26
26
|
"@media (max-width:1200px)": {
|
|
27
27
|
fontSize: string;
|
|
28
28
|
};
|
|
29
|
-
"@media (max-width:
|
|
29
|
+
"@media (max-width:768px)": {
|
|
30
30
|
fontSize: string;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -37,7 +37,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
37
37
|
"@media (max-width:1200px)": {
|
|
38
38
|
fontSize: string;
|
|
39
39
|
};
|
|
40
|
-
"@media (max-width:
|
|
40
|
+
"@media (max-width:768px)": {
|
|
41
41
|
fontSize: string;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
@@ -48,7 +48,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
48
48
|
"@media (max-width:1200px)": {
|
|
49
49
|
fontSize: string;
|
|
50
50
|
};
|
|
51
|
-
"@media (max-width:
|
|
51
|
+
"@media (max-width:768px)": {
|
|
52
52
|
fontSize: string;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -59,7 +59,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
59
59
|
"@media (max-width:1200px)": {
|
|
60
60
|
fontSize: string;
|
|
61
61
|
};
|
|
62
|
-
"@media (max-width:
|
|
62
|
+
"@media (max-width:768px)": {
|
|
63
63
|
fontSize: string;
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -70,7 +70,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
70
70
|
"@media (max-width:1200px)": {
|
|
71
71
|
fontSize: string;
|
|
72
72
|
};
|
|
73
|
-
"@media (max-width:
|
|
73
|
+
"@media (max-width:768px)": {
|
|
74
74
|
fontSize: string;
|
|
75
75
|
};
|
|
76
76
|
};
|
|
@@ -81,7 +81,7 @@ export declare const createAIDTTypography: (fontFamily: keyof typeof TYPOGRAPHY_
|
|
|
81
81
|
"@media (max-width:1200px)": {
|
|
82
82
|
fontSize: string;
|
|
83
83
|
};
|
|
84
|
-
"@media (max-width:
|
|
84
|
+
"@media (max-width:768px)": {
|
|
85
85
|
fontSize: string;
|
|
86
86
|
};
|
|
87
87
|
};
|
|
@@ -47,7 +47,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
47
47
|
lineHeight: '140%'
|
|
48
48
|
}, "@media (max-width:1200px)", {
|
|
49
49
|
fontSize: '20px'
|
|
50
|
-
}), "@media (max-width:
|
|
50
|
+
}), "@media (max-width:768px)", {
|
|
51
51
|
fontSize: '22px'
|
|
52
52
|
}),
|
|
53
53
|
subtitle1: _defineProperty(_defineProperty({
|
|
@@ -56,7 +56,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
56
56
|
lineHeight: '140%'
|
|
57
57
|
}, "@media (max-width:1200px)", {
|
|
58
58
|
fontSize: '26px'
|
|
59
|
-
}), "@media (max-width:
|
|
59
|
+
}), "@media (max-width:768px)", {
|
|
60
60
|
fontSize: '22px'
|
|
61
61
|
}),
|
|
62
62
|
subtitle2: _defineProperty(_defineProperty({
|
|
@@ -65,7 +65,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
65
65
|
lineHeight: '160%'
|
|
66
66
|
}, "@media (max-width:1200px)", {
|
|
67
67
|
fontSize: '24px'
|
|
68
|
-
}), "@media (max-width:
|
|
68
|
+
}), "@media (max-width:768px)", {
|
|
69
69
|
fontSize: '18px'
|
|
70
70
|
}),
|
|
71
71
|
subtitle3: _defineProperty(_defineProperty({
|
|
@@ -74,7 +74,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
74
74
|
lineHeight: '140%'
|
|
75
75
|
}, "@media (max-width:1200px)", {
|
|
76
76
|
fontSize: '20px'
|
|
77
|
-
}), "@media (max-width:
|
|
77
|
+
}), "@media (max-width:768px)", {
|
|
78
78
|
fontSize: '16px'
|
|
79
79
|
}),
|
|
80
80
|
body1: _defineProperty(_defineProperty({
|
|
@@ -83,7 +83,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
83
83
|
lineHeight: '140%'
|
|
84
84
|
}, "@media (max-width:1200px)", {
|
|
85
85
|
fontSize: '20px'
|
|
86
|
-
}), "@media (max-width:
|
|
86
|
+
}), "@media (max-width:768px)", {
|
|
87
87
|
fontSize: '16px'
|
|
88
88
|
}),
|
|
89
89
|
buttoninput: _defineProperty(_defineProperty({
|
|
@@ -92,7 +92,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
92
92
|
lineHeight: '140%'
|
|
93
93
|
}, "@media (max-width:1200px)", {
|
|
94
94
|
fontSize: '20px'
|
|
95
|
-
}), "@media (max-width:
|
|
95
|
+
}), "@media (max-width:768px)", {
|
|
96
96
|
fontSize: '16px'
|
|
97
97
|
}),
|
|
98
98
|
pagination: _defineProperty(_defineProperty({
|
|
@@ -101,7 +101,7 @@ var createAIDTTypography = function createAIDTTypography(fontFamily) {
|
|
|
101
101
|
lineHeight: '140%'
|
|
102
102
|
}, "@media (max-width:1200px)", {
|
|
103
103
|
fontSize: '32px'
|
|
104
|
-
}), "@media (max-width:
|
|
104
|
+
}), "@media (max-width:768px)", {
|
|
105
105
|
fontSize: '24px'
|
|
106
106
|
})
|
|
107
107
|
};
|