funuicss 3.7.10 → 3.7.12
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/css/fun.css +67 -48
- package/package.json +1 -1
- package/ui/card/Card.d.ts +22 -2
- package/ui/card/Card.js +51 -162
- package/ui/select/Select.d.ts +2 -1
- package/ui/select/Select.js +2 -2
- package/ui/theme/theme.js +0 -6
- package/ui/video/Video.d.ts +3 -1
- package/ui/video/Video.js +118 -73
- package/ui/vista/Vista.d.ts +28 -2
- package/ui/vista/Vista.js +250 -85
package/ui/video/Video.js
CHANGED
|
@@ -102,7 +102,6 @@ var tfi_1 = require("react-icons/tfi");
|
|
|
102
102
|
var Text_1 = __importDefault(require("../text/Text"));
|
|
103
103
|
var RowFlex_1 = __importDefault(require("../specials/RowFlex"));
|
|
104
104
|
var ToolTip_1 = __importDefault(require("../tooltip/ToolTip"));
|
|
105
|
-
var Circle_1 = __importDefault(require("../specials/Circle"));
|
|
106
105
|
var Tip_1 = __importDefault(require("../tooltip/Tip"));
|
|
107
106
|
var videoFunctions_1 = require("./videoFunctions");
|
|
108
107
|
var videoShortcuts_1 = require("./videoShortcuts");
|
|
@@ -110,7 +109,6 @@ var getDynamicIcon_1 = require("../../utils/getDynamicIcon");
|
|
|
110
109
|
// Configuration hook
|
|
111
110
|
var useComponentConfiguration = function (componentName, variant) {
|
|
112
111
|
if (variant === void 0) { variant = ''; }
|
|
113
|
-
// In a real implementation, this would come from a theme context or configuration file
|
|
114
112
|
var getComponentConfig = function () {
|
|
115
113
|
var baseConfig = {
|
|
116
114
|
Video: {
|
|
@@ -121,8 +119,8 @@ var useComponentConfiguration = function (componentName, variant) {
|
|
|
121
119
|
showVolume: true,
|
|
122
120
|
showTime: true,
|
|
123
121
|
showFullscreen: true,
|
|
124
|
-
showDownload:
|
|
125
|
-
showSeekButtons:
|
|
122
|
+
showDownload: false,
|
|
123
|
+
showSeekButtons: false,
|
|
126
124
|
spacebarPlay: true,
|
|
127
125
|
autoPlay: false,
|
|
128
126
|
loop: false,
|
|
@@ -144,18 +142,20 @@ var useComponentConfiguration = function (componentName, variant) {
|
|
|
144
142
|
rewindCss: '',
|
|
145
143
|
forwardCss: '',
|
|
146
144
|
buttonCss: '',
|
|
145
|
+
volumeStyle: 'slider', // 'slider' | 'compact' | 'hover'
|
|
147
146
|
},
|
|
148
147
|
minimal: {
|
|
149
148
|
showControls: true,
|
|
150
149
|
showPlayPause: true,
|
|
151
150
|
showProgress: true,
|
|
152
151
|
showVolume: false,
|
|
153
|
-
showTime:
|
|
154
|
-
showFullscreen:
|
|
152
|
+
showTime: true,
|
|
153
|
+
showFullscreen: true,
|
|
155
154
|
showDownload: false,
|
|
156
155
|
showSeekButtons: false,
|
|
157
156
|
controlsCss: 'minimal-controls',
|
|
158
157
|
buttonCss: 'minimal-btn',
|
|
158
|
+
volumeStyle: 'hover',
|
|
159
159
|
},
|
|
160
160
|
embedded: {
|
|
161
161
|
showControls: false,
|
|
@@ -175,6 +175,7 @@ var useComponentConfiguration = function (componentName, variant) {
|
|
|
175
175
|
showSeekButtons: true,
|
|
176
176
|
controlsCss: 'full-featured-controls',
|
|
177
177
|
buttonCss: 'featured-btn',
|
|
178
|
+
volumeStyle: 'slider',
|
|
178
179
|
},
|
|
179
180
|
theater: {
|
|
180
181
|
showControls: true,
|
|
@@ -182,6 +183,21 @@ var useComponentConfiguration = function (componentName, variant) {
|
|
|
182
183
|
videoCss: 'theater-video',
|
|
183
184
|
controlsCss: 'theater-controls',
|
|
184
185
|
fullscreenCss: 'theater-fullscreen',
|
|
186
|
+
volumeStyle: 'slider',
|
|
187
|
+
},
|
|
188
|
+
youtube: {
|
|
189
|
+
showControls: true,
|
|
190
|
+
showPlayPause: true,
|
|
191
|
+
showProgress: true,
|
|
192
|
+
showVolume: true,
|
|
193
|
+
showTime: true,
|
|
194
|
+
showFullscreen: true,
|
|
195
|
+
showDownload: false,
|
|
196
|
+
showSeekButtons: false,
|
|
197
|
+
controlsCss: 'youtube-controls',
|
|
198
|
+
buttonCss: 'youtube-btn',
|
|
199
|
+
volumeStyle: 'hover',
|
|
200
|
+
hideControlsDelay: 2000,
|
|
185
201
|
}
|
|
186
202
|
}
|
|
187
203
|
};
|
|
@@ -191,7 +207,6 @@ var useComponentConfiguration = function (componentName, variant) {
|
|
|
191
207
|
var config = getComponentConfig();
|
|
192
208
|
var variantConfig = variant && config[variant] ? config[variant] : {};
|
|
193
209
|
var defaultConfig = config.default || {};
|
|
194
|
-
// Merge: default config < variant config < local props (local props have highest priority)
|
|
195
210
|
var mergedProps = __assign(__assign(__assign({}, defaultConfig), variantConfig), localProps);
|
|
196
211
|
return {
|
|
197
212
|
props: mergedProps,
|
|
@@ -206,11 +221,11 @@ var useComponentConfiguration = function (componentName, variant) {
|
|
|
206
221
|
};
|
|
207
222
|
function Video(_a) {
|
|
208
223
|
var _this = this;
|
|
209
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
210
|
-
var src = _a.src, poster = _a.poster, onDuration = _a.onDuration, onEnded = _a.onEnded, isPause = _a.isPause, spacebarPlay = _a.spacebarPlay,
|
|
224
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
225
|
+
var src = _a.src, poster = _a.poster, onDuration = _a.onDuration, onEnded = _a.onEnded, isPause = _a.isPause, spacebarPlay = _a.spacebarPlay, _8 = _a.className, className = _8 === void 0 ? '' : _8, autoPlay = _a.autoPlay, showControls = _a.showControls, showPlayPause = _a.showPlayPause, showProgress = _a.showProgress, showVolume = _a.showVolume, showTime = _a.showTime, showFullscreen = _a.showFullscreen, showDownload = _a.showDownload, showSeekButtons = _a.showSeekButtons, playIcon = _a.playIcon, pauseIcon = _a.pauseIcon, fullscreenIcon = _a.fullscreenIcon, downloadIcon = _a.downloadIcon, volumeIcon = _a.volumeIcon, muteIcon = _a.muteIcon, rewindIcon = _a.rewindIcon, forwardIcon = _a.forwardIcon, hideControlsDelay = _a.hideControlsDelay, loop = _a.loop, muted = _a.muted, seekAmount = _a.seekAmount, _9 = _a.funcss, funcss = _9 === void 0 ? '' : _9, _10 = _a.containerCss, containerCss = _10 === void 0 ? '' : _10, _11 = _a.videoCss, videoCss = _11 === void 0 ? '' : _11, _12 = _a.controlsCss, controlsCss = _12 === void 0 ? '' : _12, _13 = _a.progressCss, progressCss = _13 === void 0 ? '' : _13, _14 = _a.progressBarCss, progressBarCss = _14 === void 0 ? '' : _14, _15 = _a.timeCss, timeCss = _15 === void 0 ? '' : _15, _16 = _a.playCss, playCss = _16 === void 0 ? '' : _16, _17 = _a.pauseCss, pauseCss = _17 === void 0 ? '' : _17, _18 = _a.volumeCss, volumeCss = _18 === void 0 ? '' : _18, _19 = _a.fullscreenCss, fullscreenCss = _19 === void 0 ? '' : _19, _20 = _a.downloadCss, downloadCss = _20 === void 0 ? '' : _20, _21 = _a.rewindCss, rewindCss = _21 === void 0 ? '' : _21, _22 = _a.forwardCss, forwardCss = _22 === void 0 ? '' : _22, _23 = _a.buttonCss, buttonCss = _23 === void 0 ? '' : _23, _24 = _a.volumeStyle, volumeStyle = _24 === void 0 ? 'slider' : _24, style = _a.style, _25 = _a.variant, variant = _25 === void 0 ? '' : _25, rest = __rest(_a, ["src", "poster", "onDuration", "onEnded", "isPause", "spacebarPlay", "className", "autoPlay", "showControls", "showPlayPause", "showProgress", "showVolume", "showTime", "showFullscreen", "showDownload", "showSeekButtons", "playIcon", "pauseIcon", "fullscreenIcon", "downloadIcon", "volumeIcon", "muteIcon", "rewindIcon", "forwardIcon", "hideControlsDelay", "loop", "muted", "seekAmount", "funcss", "containerCss", "videoCss", "controlsCss", "progressCss", "progressBarCss", "timeCss", "playCss", "pauseCss", "volumeCss", "fullscreenCss", "downloadCss", "rewindCss", "forwardCss", "buttonCss", "volumeStyle", "style", "variant"]);
|
|
211
226
|
var mergeWithLocal = useComponentConfiguration('Video', variant).mergeWithLocal;
|
|
212
227
|
// Create local props object - these will override config props
|
|
213
|
-
var localProps = __assign({ src: src, poster: poster, onDuration: onDuration, onEnded: onEnded, isPause: isPause, spacebarPlay: spacebarPlay, className: className, autoPlay: autoPlay, showControls: showControls, showPlayPause: showPlayPause, showProgress: showProgress, showVolume: showVolume, showTime: showTime, showFullscreen: showFullscreen, showDownload: showDownload, showSeekButtons: showSeekButtons, playIcon: playIcon, pauseIcon: pauseIcon, fullscreenIcon: fullscreenIcon, downloadIcon: downloadIcon, volumeIcon: volumeIcon, muteIcon: muteIcon, rewindIcon: rewindIcon, forwardIcon: forwardIcon, hideControlsDelay: hideControlsDelay, loop: loop, muted: muted, seekAmount: seekAmount, funcss: funcss, containerCss: containerCss, videoCss: videoCss, controlsCss: controlsCss, progressCss: progressCss, progressBarCss: progressBarCss, timeCss: timeCss, playCss: playCss, pauseCss: pauseCss, volumeCss: volumeCss, fullscreenCss: fullscreenCss, downloadCss: downloadCss, rewindCss: rewindCss, forwardCss: forwardCss, buttonCss: buttonCss }, rest);
|
|
228
|
+
var localProps = __assign({ src: src, poster: poster, onDuration: onDuration, onEnded: onEnded, isPause: isPause, spacebarPlay: spacebarPlay, className: className, autoPlay: autoPlay, showControls: showControls, showPlayPause: showPlayPause, showProgress: showProgress, showVolume: showVolume, showTime: showTime, showFullscreen: showFullscreen, showDownload: showDownload, showSeekButtons: showSeekButtons, playIcon: playIcon, pauseIcon: pauseIcon, fullscreenIcon: fullscreenIcon, downloadIcon: downloadIcon, volumeIcon: volumeIcon, muteIcon: muteIcon, rewindIcon: rewindIcon, forwardIcon: forwardIcon, hideControlsDelay: hideControlsDelay, loop: loop, muted: muted, seekAmount: seekAmount, funcss: funcss, containerCss: containerCss, videoCss: videoCss, controlsCss: controlsCss, progressCss: progressCss, progressBarCss: progressBarCss, timeCss: timeCss, playCss: playCss, pauseCss: pauseCss, volumeCss: volumeCss, fullscreenCss: fullscreenCss, downloadCss: downloadCss, rewindCss: rewindCss, forwardCss: forwardCss, buttonCss: buttonCss, volumeStyle: volumeStyle, style: style }, rest);
|
|
214
229
|
// Merge with config - LOCAL PROPS OVERRIDE CONFIG
|
|
215
230
|
var mergedProps = mergeWithLocal(localProps).props;
|
|
216
231
|
// Extract final values - local props take precedence
|
|
@@ -229,8 +244,8 @@ function Video(_a) {
|
|
|
229
244
|
showVolume: (_h = mergedProps.showVolume) !== null && _h !== void 0 ? _h : true,
|
|
230
245
|
showTime: (_j = mergedProps.showTime) !== null && _j !== void 0 ? _j : true,
|
|
231
246
|
showFullscreen: (_k = mergedProps.showFullscreen) !== null && _k !== void 0 ? _k : true,
|
|
232
|
-
showDownload: (_l = mergedProps.showDownload) !== null && _l !== void 0 ? _l :
|
|
233
|
-
showSeekButtons: (_m = mergedProps.showSeekButtons) !== null && _m !== void 0 ? _m :
|
|
247
|
+
showDownload: (_l = mergedProps.showDownload) !== null && _l !== void 0 ? _l : false,
|
|
248
|
+
showSeekButtons: (_m = mergedProps.showSeekButtons) !== null && _m !== void 0 ? _m : false,
|
|
234
249
|
playIcon: mergedProps.playIcon,
|
|
235
250
|
pauseIcon: mergedProps.pauseIcon,
|
|
236
251
|
fullscreenIcon: mergedProps.fullscreenIcon,
|
|
@@ -258,29 +273,31 @@ function Video(_a) {
|
|
|
258
273
|
rewindCss: (_4 = mergedProps.rewindCss) !== null && _4 !== void 0 ? _4 : '',
|
|
259
274
|
forwardCss: (_5 = mergedProps.forwardCss) !== null && _5 !== void 0 ? _5 : '',
|
|
260
275
|
buttonCss: (_6 = mergedProps.buttonCss) !== null && _6 !== void 0 ? _6 : '',
|
|
276
|
+
volumeStyle: (_7 = mergedProps.volumeStyle) !== null && _7 !== void 0 ? _7 : 'slider',
|
|
261
277
|
};
|
|
262
278
|
var videoRef = (0, react_1.useRef)(null);
|
|
263
279
|
var containerRef = (0, react_1.useRef)(null);
|
|
264
280
|
var animationFrameRef = (0, react_1.useRef)(null);
|
|
265
|
-
var
|
|
266
|
-
var
|
|
267
|
-
var
|
|
268
|
-
var
|
|
269
|
-
var
|
|
270
|
-
var
|
|
271
|
-
var
|
|
272
|
-
var
|
|
273
|
-
var
|
|
274
|
-
var
|
|
281
|
+
var _26 = (0, react_1.useState)(false), isPlaying = _26[0], setIsPlaying = _26[1];
|
|
282
|
+
var _27 = (0, react_1.useState)(0), currentTime = _27[0], setCurrentTime = _27[1];
|
|
283
|
+
var _28 = (0, react_1.useState)(0), duration = _28[0], setDuration = _28[1];
|
|
284
|
+
var _29 = (0, react_1.useState)(final.muted ? 0 : 1), volume = _29[0], setVolume = _29[1];
|
|
285
|
+
var _30 = (0, react_1.useState)(final.muted), isMuted = _30[0], setIsMuted = _30[1];
|
|
286
|
+
var _31 = (0, react_1.useState)(false), isFullScreen = _31[0], setIsFullScreen = _31[1];
|
|
287
|
+
var _32 = (0, react_1.useState)(false), showControlsState = _32[0], setShowControlsState = _32[1];
|
|
288
|
+
var _33 = (0, react_1.useState)(false), hasStarted = _33[0], setHasStarted = _33[1];
|
|
289
|
+
var _34 = (0, react_1.useState)(false), isHoveringProgress = _34[0], setIsHoveringProgress = _34[1];
|
|
290
|
+
var _35 = (0, react_1.useState)(false), isHoveringVolume = _35[0], setIsHoveringVolume = _35[1];
|
|
291
|
+
var _36 = (0, react_1.useState)(false), showVolumeSlider = _36[0], setShowVolumeSlider = _36[1];
|
|
275
292
|
// Dynamic icon states
|
|
276
|
-
var
|
|
277
|
-
var
|
|
278
|
-
var
|
|
279
|
-
var
|
|
280
|
-
var
|
|
281
|
-
var
|
|
282
|
-
var
|
|
283
|
-
var
|
|
293
|
+
var _37 = (0, react_1.useState)(null), dynamicPlayIcon = _37[0], setDynamicPlayIcon = _37[1];
|
|
294
|
+
var _38 = (0, react_1.useState)(null), dynamicPauseIcon = _38[0], setDynamicPauseIcon = _38[1];
|
|
295
|
+
var _39 = (0, react_1.useState)(null), dynamicFullscreenIcon = _39[0], setDynamicFullscreenIcon = _39[1];
|
|
296
|
+
var _40 = (0, react_1.useState)(null), dynamicDownloadIcon = _40[0], setDynamicDownloadIcon = _40[1];
|
|
297
|
+
var _41 = (0, react_1.useState)(null), dynamicVolumeIcon = _41[0], setDynamicVolumeIcon = _41[1];
|
|
298
|
+
var _42 = (0, react_1.useState)(null), dynamicMuteIcon = _42[0], setDynamicMuteIcon = _42[1];
|
|
299
|
+
var _43 = (0, react_1.useState)(null), dynamicRewindIcon = _43[0], setDynamicRewindIcon = _43[1];
|
|
300
|
+
var _44 = (0, react_1.useState)(null), dynamicForwardIcon = _44[0], setDynamicForwardIcon = _44[1];
|
|
284
301
|
// Helper function to load dynamic icons
|
|
285
302
|
var loadDynamicIcon = function (iconProp, setter, defaultIcon) { return __awaiter(_this, void 0, void 0, function () {
|
|
286
303
|
var iconNode;
|
|
@@ -298,27 +315,26 @@ function Video(_a) {
|
|
|
298
315
|
setter(iconNode || defaultIcon);
|
|
299
316
|
return [3 /*break*/, 3];
|
|
300
317
|
case 2:
|
|
301
|
-
// It's already a ReactNode - use it directly
|
|
302
318
|
setter(iconProp);
|
|
303
319
|
_a.label = 3;
|
|
304
320
|
case 3: return [2 /*return*/];
|
|
305
321
|
}
|
|
306
322
|
});
|
|
307
323
|
}); };
|
|
308
|
-
// Load all dynamic icons
|
|
324
|
+
// Load all dynamic icons
|
|
309
325
|
(0, react_1.useEffect)(function () {
|
|
310
326
|
var loadIcons = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
311
327
|
return __generator(this, function (_a) {
|
|
312
328
|
switch (_a.label) {
|
|
313
329
|
case 0: return [4 /*yield*/, Promise.all([
|
|
314
|
-
loadDynamicIcon(final.playIcon, setDynamicPlayIcon, react_1.default.createElement(pi_1.PiPlay, { size:
|
|
315
|
-
loadDynamicIcon(final.pauseIcon, setDynamicPauseIcon, react_1.default.createElement(pi_1.PiPause, { size:
|
|
316
|
-
loadDynamicIcon(final.fullscreenIcon, setDynamicFullscreenIcon, react_1.default.createElement(pi_1.PiCornersOut, { size:
|
|
317
|
-
loadDynamicIcon(final.downloadIcon, setDynamicDownloadIcon, react_1.default.createElement(tfi_1.TfiDownload, { size:
|
|
318
|
-
loadDynamicIcon(final.volumeIcon, setDynamicVolumeIcon, react_1.default.createElement(pi_1.PiSpeakerHigh, { size:
|
|
319
|
-
loadDynamicIcon(final.muteIcon, setDynamicMuteIcon, react_1.default.createElement(pi_1.PiSpeakerSlash, { size:
|
|
320
|
-
loadDynamicIcon(final.rewindIcon, setDynamicRewindIcon, react_1.default.createElement(tfi_1.TfiControlBackward, { size:
|
|
321
|
-
loadDynamicIcon(final.forwardIcon, setDynamicForwardIcon, react_1.default.createElement(tfi_1.TfiControlForward, { size:
|
|
330
|
+
loadDynamicIcon(final.playIcon, setDynamicPlayIcon, react_1.default.createElement(pi_1.PiPlay, { size: 20 })),
|
|
331
|
+
loadDynamicIcon(final.pauseIcon, setDynamicPauseIcon, react_1.default.createElement(pi_1.PiPause, { size: 20 })),
|
|
332
|
+
loadDynamicIcon(final.fullscreenIcon, setDynamicFullscreenIcon, react_1.default.createElement(pi_1.PiCornersOut, { size: 18 })),
|
|
333
|
+
loadDynamicIcon(final.downloadIcon, setDynamicDownloadIcon, react_1.default.createElement(tfi_1.TfiDownload, { size: 16 })),
|
|
334
|
+
loadDynamicIcon(final.volumeIcon, setDynamicVolumeIcon, react_1.default.createElement(pi_1.PiSpeakerHigh, { size: 18 })),
|
|
335
|
+
loadDynamicIcon(final.muteIcon, setDynamicMuteIcon, react_1.default.createElement(pi_1.PiSpeakerSlash, { size: 18 })),
|
|
336
|
+
loadDynamicIcon(final.rewindIcon, setDynamicRewindIcon, react_1.default.createElement(tfi_1.TfiControlBackward, { size: 16 })),
|
|
337
|
+
loadDynamicIcon(final.forwardIcon, setDynamicForwardIcon, react_1.default.createElement(tfi_1.TfiControlForward, { size: 16 })),
|
|
322
338
|
])];
|
|
323
339
|
case 1:
|
|
324
340
|
_a.sent();
|
|
@@ -331,12 +347,11 @@ function Video(_a) {
|
|
|
331
347
|
final.playIcon, final.pauseIcon, final.fullscreenIcon, final.downloadIcon,
|
|
332
348
|
final.volumeIcon, final.muteIcon, final.rewindIcon, final.forwardIcon
|
|
333
349
|
]);
|
|
334
|
-
// Helper function to render icon
|
|
350
|
+
// Helper function to render icon
|
|
335
351
|
var renderIcon = function (icon, defaultSize) {
|
|
336
352
|
if (defaultSize === void 0) { defaultSize = 16; }
|
|
337
353
|
if (!icon)
|
|
338
354
|
return null;
|
|
339
|
-
// If it's a React element, clone it with the size prop
|
|
340
355
|
if (react_1.default.isValidElement(icon)) {
|
|
341
356
|
return react_1.default.cloneElement(icon, {
|
|
342
357
|
size: icon.props.size || defaultSize
|
|
@@ -375,19 +390,15 @@ function Video(_a) {
|
|
|
375
390
|
var rect = container.getBoundingClientRect();
|
|
376
391
|
var clickX = e.clientX - rect.left;
|
|
377
392
|
var width = rect.width;
|
|
378
|
-
// Divide video into three areas
|
|
379
393
|
var leftArea = width * 0.3;
|
|
380
394
|
var rightArea = width * 0.7;
|
|
381
395
|
if (clickX < leftArea) {
|
|
382
|
-
// Left area - rewind
|
|
383
396
|
handleSeek(-final.seekAmount);
|
|
384
397
|
}
|
|
385
398
|
else if (clickX > rightArea) {
|
|
386
|
-
// Right area - forward
|
|
387
399
|
handleSeek(final.seekAmount);
|
|
388
400
|
}
|
|
389
401
|
else {
|
|
390
|
-
// Middle area - play/pause
|
|
391
402
|
handlePlayPauseToggle();
|
|
392
403
|
}
|
|
393
404
|
};
|
|
@@ -473,7 +484,7 @@ function Video(_a) {
|
|
|
473
484
|
var handleVideoEnd = function () {
|
|
474
485
|
var _a;
|
|
475
486
|
setIsPlaying(false);
|
|
476
|
-
(_a = final.onEnded) === null || _a === void 0 ? void 0 : _a.call(final);
|
|
487
|
+
(_a = final.onEnded) === null || _a === void 0 ? void 0 : _a.call(final);
|
|
477
488
|
if (final.loop && videoRef.current) {
|
|
478
489
|
videoRef.current.currentTime = 0;
|
|
479
490
|
playVideo();
|
|
@@ -511,10 +522,14 @@ function Video(_a) {
|
|
|
511
522
|
var show = function () {
|
|
512
523
|
setShowControlsState(true);
|
|
513
524
|
clearTimeout(timer);
|
|
514
|
-
timer = setTimeout(function () {
|
|
525
|
+
timer = setTimeout(function () {
|
|
526
|
+
setShowControlsState(false);
|
|
527
|
+
setShowVolumeSlider(false);
|
|
528
|
+
}, final.hideControlsDelay);
|
|
515
529
|
};
|
|
516
530
|
var hide = function () {
|
|
517
531
|
setShowControlsState(false);
|
|
532
|
+
setShowVolumeSlider(false);
|
|
518
533
|
};
|
|
519
534
|
var container = containerRef.current;
|
|
520
535
|
if (container && final.showControls) {
|
|
@@ -543,50 +558,80 @@ function Video(_a) {
|
|
|
543
558
|
cancelAnimationFrame(animationFrameRef.current);
|
|
544
559
|
};
|
|
545
560
|
}, [isPlaying, updateCurrentTime]);
|
|
546
|
-
//
|
|
547
|
-
var
|
|
561
|
+
// Get volume icon based on volume level
|
|
562
|
+
var getVolumeIcon = function () {
|
|
563
|
+
if (isMuted || volume === 0) {
|
|
564
|
+
return renderIcon(dynamicMuteIcon, 18);
|
|
565
|
+
}
|
|
566
|
+
else if (volume < 0.5) {
|
|
567
|
+
return react_1.default.createElement(pi_1.PiSpeakerNone, { size: 18 });
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
return renderIcon(dynamicVolumeIcon, 18);
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
// Simple Progress Bar Component (YouTube style)
|
|
574
|
+
var ProgressBar = function () { return (react_1.default.createElement("div", { className: "progress-container" },
|
|
548
575
|
react_1.default.createElement("div", { className: "progress-wrapper" },
|
|
549
576
|
react_1.default.createElement("input", { type: "range", min: 0, max: duration, value: currentTime, onChange: handleProgressChange, className: "video-progress ".concat(final.progressCss), style: {
|
|
550
577
|
'--progress-percent': "".concat((currentTime / duration) * 100, "%"),
|
|
551
578
|
}, onMouseEnter: function () { return setIsHoveringProgress(true); }, onMouseLeave: function () { return setIsHoveringProgress(false); } })))); };
|
|
552
|
-
//
|
|
553
|
-
var VolumeControl = function () {
|
|
554
|
-
|
|
555
|
-
react_1.default.createElement(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
579
|
+
// Volume Control Component with different styles
|
|
580
|
+
var VolumeControl = function () {
|
|
581
|
+
if (final.volumeStyle === 'hover') {
|
|
582
|
+
return (react_1.default.createElement("div", { className: "volume-control-wrapper relative" },
|
|
583
|
+
react_1.default.createElement(ToolTip_1.default, null,
|
|
584
|
+
react_1.default.createElement("div", { onClick: handleToggleMute, onMouseEnter: function () { return setShowVolumeSlider(true); }, className: "volume-toggle ".concat(final.buttonCss, " ").concat(final.volumeCss, " pointer") }, getVolumeIcon()),
|
|
585
|
+
react_1.default.createElement(Tip_1.default, { tip: "top", content: isMuted ? "Unmute" : "Mute" })),
|
|
586
|
+
showVolumeSlider && (react_1.default.createElement("div", { className: "volume-slider-wrapper absolute bottom-full left-0 mb-2 p-2 bg-black bg-opacity-80 rounded-lg backdrop-blur-sm", onMouseEnter: function () { return setShowVolumeSlider(true); }, onMouseLeave: function () { return setShowVolumeSlider(false); } },
|
|
587
|
+
react_1.default.createElement("input", { type: "range", min: 0, max: 1, step: 0.01, value: volume, onChange: handleVolumeChange, className: "volume-slider vertical", style: {
|
|
588
|
+
'--volume-percent': "".concat(volume * 100, "%"),
|
|
589
|
+
} })))));
|
|
590
|
+
}
|
|
591
|
+
if (final.volumeStyle === 'compact') {
|
|
592
|
+
return (react_1.default.createElement("div", { className: "volume-control-wrapper" },
|
|
593
|
+
react_1.default.createElement(ToolTip_1.default, null,
|
|
594
|
+
react_1.default.createElement("div", { onClick: handleToggleMute, className: "volume-toggle ".concat(final.buttonCss, " ").concat(final.volumeCss, " pointer") }, getVolumeIcon()),
|
|
595
|
+
react_1.default.createElement(Tip_1.default, { tip: "top", content: isMuted ? "Unmute" : "Mute" }))));
|
|
596
|
+
}
|
|
597
|
+
// Default slider style
|
|
598
|
+
return (react_1.default.createElement("div", { className: "volume-control-wrapper" },
|
|
599
|
+
react_1.default.createElement(ToolTip_1.default, null,
|
|
600
|
+
react_1.default.createElement("div", { onClick: handleToggleMute, className: "volume-toggle ".concat(final.buttonCss, " ").concat(final.volumeCss, " pointer") }, getVolumeIcon()),
|
|
601
|
+
react_1.default.createElement(Tip_1.default, { tip: "top", content: isMuted ? "Unmute" : "Mute" })),
|
|
602
|
+
react_1.default.createElement("div", { className: "volume-slider-wrapper" },
|
|
603
|
+
react_1.default.createElement("input", { type: "range", min: 0, max: 1, step: 0.01, value: volume, onChange: handleVolumeChange, className: "volume-slider", style: {
|
|
604
|
+
'--volume-percent': "".concat(volume * 100, "%"),
|
|
605
|
+
} }))));
|
|
606
|
+
};
|
|
563
607
|
return (react_1.default.createElement("div", { ref: containerRef, className: "video_container fit ".concat(final.funcss, " ").concat(final.containerCss, " ").concat(final.className), onClick: handleVideoClick },
|
|
564
608
|
final.poster && !hasStarted && !isPlaying && (react_1.default.createElement("div", { style: { backgroundImage: "url(".concat(final.poster, ")") }, className: "video_poster" })),
|
|
565
|
-
react_1.default.createElement("video", { ref: videoRef, preload: "auto", src: final.src, className: "video_player fit min-w-200 ".concat(final.videoCss), onLoadedMetadata: handleLoadedMetadata, playsInline: true, controls: false, loop: final.loop, muted: final.muted }),
|
|
609
|
+
react_1.default.createElement("video", { ref: videoRef, preload: "auto", autoPlay: final.autoPlay, style: style, src: final.src, className: "video_player fit min-w-200 ".concat(final.videoCss), onLoadedMetadata: handleLoadedMetadata, playsInline: true, controls: false, loop: final.loop, muted: final.muted }),
|
|
566
610
|
final.showControls && (react_1.default.createElement("div", { className: "video_controls ".concat(final.controlsCss, " ").concat(showControlsState ? 'show_controls' : 'hide_controls') },
|
|
567
|
-
final.showProgress && react_1.default.createElement(ProgressBar, null),
|
|
568
611
|
react_1.default.createElement(RowFlex_1.default, { gap: 1, justify: "space-between", alignItems: "center", className: "controls-row" },
|
|
569
|
-
react_1.default.createElement(RowFlex_1.default, { gap: 0.5, alignItems: "center" },
|
|
612
|
+
react_1.default.createElement(RowFlex_1.default, { gap: 0.5, alignItems: "center", funcss: 'videoLeftContainer' },
|
|
570
613
|
final.showPlayPause && (react_1.default.createElement(ToolTip_1.default, null,
|
|
571
|
-
react_1.default.createElement(
|
|
572
|
-
? renderIcon(dynamicPauseIcon,
|
|
573
|
-
: renderIcon(dynamicPlayIcon,
|
|
614
|
+
react_1.default.createElement("div", { onClick: handlePlayPauseToggle, className: "".concat(final.buttonCss, " ").concat(isPlaying ? final.pauseCss : final.playCss, " pointer") }, isPlaying
|
|
615
|
+
? renderIcon(dynamicPauseIcon, 20)
|
|
616
|
+
: renderIcon(dynamicPlayIcon, 20)),
|
|
574
617
|
react_1.default.createElement(Tip_1.default, { tip: "top", content: isPlaying ? "Pause" : "Play" }))),
|
|
575
618
|
final.showSeekButtons && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
576
619
|
react_1.default.createElement(ToolTip_1.default, null,
|
|
577
|
-
react_1.default.createElement(
|
|
620
|
+
react_1.default.createElement("div", { onClick: handleRewind, className: "".concat(final.buttonCss, " ").concat(final.rewindCss, " pointer") }, renderIcon(dynamicRewindIcon, 16)),
|
|
578
621
|
react_1.default.createElement(Tip_1.default, { tip: "top", content: "".concat(final.seekAmount, "s Back") })),
|
|
579
622
|
react_1.default.createElement(ToolTip_1.default, null,
|
|
580
|
-
react_1.default.createElement(
|
|
623
|
+
react_1.default.createElement("div", { onClick: handleForward, className: "".concat(final.buttonCss, " ").concat(final.forwardCss, " pointer") }, renderIcon(dynamicForwardIcon, 16)),
|
|
581
624
|
react_1.default.createElement(Tip_1.default, { tip: "top", content: "".concat(final.seekAmount, "s Forward") })))),
|
|
582
625
|
final.showVolume && react_1.default.createElement(VolumeControl, null),
|
|
583
626
|
final.showTime && (react_1.default.createElement("div", { className: "video_time ".concat(final.timeCss) },
|
|
584
|
-
react_1.default.createElement(Text_1.default, { text: "".concat((0, videoFunctions_1.formatTime)(currentTime), " / ").concat((0, videoFunctions_1.formatTime)(duration)),
|
|
585
|
-
react_1.default.createElement(
|
|
627
|
+
react_1.default.createElement(Text_1.default, { text: "".concat((0, videoFunctions_1.formatTime)(currentTime), " / ").concat((0, videoFunctions_1.formatTime)(duration)), size: "xs" })))),
|
|
628
|
+
react_1.default.createElement("div", { className: "col w-full " },
|
|
629
|
+
react_1.default.createElement("div", { className: 'videoProgressContainer' }, final.showProgress && react_1.default.createElement(ProgressBar, null))),
|
|
630
|
+
react_1.default.createElement(RowFlex_1.default, { gap: 0.3, funcss: 'videoRightContainer' },
|
|
586
631
|
final.showFullscreen && (react_1.default.createElement(ToolTip_1.default, null,
|
|
587
|
-
react_1.default.createElement(
|
|
632
|
+
react_1.default.createElement("div", { onClick: handleToggleFullScreen, className: "".concat(final.buttonCss, " ").concat(final.fullscreenCss, " pointer") }, renderIcon(dynamicFullscreenIcon, 18)),
|
|
588
633
|
react_1.default.createElement(Tip_1.default, { tip: "top", content: "Fullscreen" }))),
|
|
589
634
|
final.showDownload && (react_1.default.createElement(ToolTip_1.default, null,
|
|
590
|
-
react_1.default.createElement(
|
|
635
|
+
react_1.default.createElement("div", { onClick: function () { return window.open(final.src, '_blank'); }, className: "".concat(final.buttonCss, " ").concat(final.downloadCss, " pointer") }, renderIcon(dynamicDownloadIcon, 16)),
|
|
591
636
|
react_1.default.createElement(Tip_1.default, { tip: "top", content: "Download" })))))))));
|
|
592
637
|
}
|
package/ui/vista/Vista.d.ts
CHANGED
|
@@ -46,8 +46,6 @@ type VistaProps = {
|
|
|
46
46
|
fade?: boolean;
|
|
47
47
|
fadeDirection?: 'top' | 'bottom' | 'left' | 'right';
|
|
48
48
|
fadeRadial?: boolean;
|
|
49
|
-
fadeOverlayDarken?: number;
|
|
50
|
-
backgroundImage?: string;
|
|
51
49
|
variant?: string;
|
|
52
50
|
showPrimaryCTA?: boolean;
|
|
53
51
|
showSecondaryCTA?: boolean;
|
|
@@ -66,18 +64,46 @@ type VistaProps = {
|
|
|
66
64
|
ctaPrimaryPrefix?: string;
|
|
67
65
|
ctaPrimarySuffix?: string;
|
|
68
66
|
primaryIconSize?: number;
|
|
67
|
+
primaryButtonFuncss?: string;
|
|
68
|
+
primaryButtonSmall?: boolean;
|
|
69
69
|
ctaSecondaryRounded?: boolean;
|
|
70
70
|
ctaSecondaryFlat?: boolean;
|
|
71
71
|
ctaSecondaryPrefix?: string;
|
|
72
72
|
ctaSecondarySuffix?: string;
|
|
73
73
|
secondaryIconSize?: number;
|
|
74
|
+
secondaryButtonFuncss?: string;
|
|
75
|
+
secondaryButtonSmall?: boolean;
|
|
74
76
|
ctaAccentRounded?: boolean;
|
|
75
77
|
ctaAccentFlat?: boolean;
|
|
76
78
|
ctaAccentPrefix?: string;
|
|
77
79
|
ctaAccentSuffix?: string;
|
|
78
80
|
accentIconSize?: number;
|
|
81
|
+
accentButtonFuncss?: string;
|
|
82
|
+
accentButtonSmall?: boolean;
|
|
79
83
|
ctaGap?: number;
|
|
80
84
|
ctaFlexJustify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around';
|
|
85
|
+
mediaType?: 'image' | 'video' | 'iframe' | 'custom';
|
|
86
|
+
videoUrl?: string;
|
|
87
|
+
videoAutoplay?: boolean;
|
|
88
|
+
videoLoop?: boolean;
|
|
89
|
+
videoMuted?: boolean;
|
|
90
|
+
videoPoster?: string;
|
|
91
|
+
videoControls?: boolean;
|
|
92
|
+
iframeUrl?: string;
|
|
93
|
+
iframeSize?: string;
|
|
94
|
+
customMedia?: React.ReactNode;
|
|
95
|
+
imageOverlay?: boolean;
|
|
96
|
+
imageOverlayColor?: string;
|
|
97
|
+
imageOverlayOpacity?: number;
|
|
98
|
+
imageFilter?: 'grayscale' | 'sepia' | 'blur' | 'brightness' | 'contrast' | 'none';
|
|
99
|
+
imageFilterValue?: number;
|
|
100
|
+
imageBlendMode?: 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten';
|
|
101
|
+
hoverEffect?: 'lift' | 'scale' | 'tilt' | 'glow' | 'none';
|
|
102
|
+
parallax?: boolean;
|
|
103
|
+
parallaxSpeed?: number;
|
|
104
|
+
mobileLayout?: 'centered' | 'stacked';
|
|
105
|
+
tabletLayout?: 'centered' | 'imageLeft' | 'imageRight' | 'stacked';
|
|
106
|
+
desktopLayout?: 'centered' | 'imageLeft' | 'imageRight' | 'stacked';
|
|
81
107
|
};
|
|
82
108
|
declare const Vista: React.FC<VistaProps>;
|
|
83
109
|
export default Vista;
|