indicator-ui 0.0.174 → 0.0.176
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/index.js
CHANGED
|
@@ -11886,8 +11886,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11886
11886
|
|
|
11887
11887
|
|
|
11888
11888
|
|
|
11889
|
-
function MediaViewer({ media = [], initMediaIndex }) {
|
|
11890
|
-
const [curMediaIndex, setCurMediaIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initMediaIndex && media.length
|
|
11889
|
+
function MediaViewer({ media = [], initMediaIndex, onClose }) {
|
|
11890
|
+
const [curMediaIndex, setCurMediaIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initMediaIndex && initMediaIndex >= 0 && media.length > initMediaIndex ? initMediaIndex : 0);
|
|
11891
11891
|
const [muted, setMuted] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
|
11892
11892
|
const [play, setPlay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
|
11893
11893
|
const resetVideo = () => {
|
|
@@ -11920,7 +11920,7 @@ function MediaViewer({ media = [], initMediaIndex }) {
|
|
|
11920
11920
|
return undefined;
|
|
11921
11921
|
}
|
|
11922
11922
|
};
|
|
11923
|
-
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: _ui_MediaViewer_styles__WEBPACK_IMPORTED_MODULE_3__.MediaViewerStyle.MediaViewer, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui__WEBPACK_IMPORTED_MODULE_4__.Carousel, { activeIndex: curMediaIndex, setActiveIndex: setCurMediaIndex, children: media.map((item, idx) => (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _ui_MediaViewer_styles__WEBPACK_IMPORTED_MODULE_3__.MediaViewerStyle.content, children: getContent(item, idx) })) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _ui_MediaViewer_styles__WEBPACK_IMPORTED_MODULE_3__.MediaViewerStyle.control, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components__WEBPACK_IMPORTED_MODULE_2__.ControlBar, { muted: muted, play: play, onPlay: media[curMediaIndex]?.type === 'video' ? _play : undefined, onMute: media[curMediaIndex]?.type === 'video' ? mute : undefined, onNext: next, onPrev: prev }) })] }));
|
|
11923
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: _ui_MediaViewer_styles__WEBPACK_IMPORTED_MODULE_3__.MediaViewerStyle.MediaViewer, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui__WEBPACK_IMPORTED_MODULE_4__.Carousel, { activeIndex: curMediaIndex, setActiveIndex: setCurMediaIndex, children: media.map((item, idx) => (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _ui_MediaViewer_styles__WEBPACK_IMPORTED_MODULE_3__.MediaViewerStyle.content, children: getContent(item, idx) })) }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _ui_MediaViewer_styles__WEBPACK_IMPORTED_MODULE_3__.MediaViewerStyle.control, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components__WEBPACK_IMPORTED_MODULE_2__.ControlBar, { muted: muted, play: play, onPlay: media[curMediaIndex]?.type === 'video' ? _play : undefined, onMute: media[curMediaIndex]?.type === 'video' ? mute : undefined, onNext: next, onClose: onClose, onPrev: prev }) })] }));
|
|
11924
11924
|
}
|
|
11925
11925
|
|
|
11926
11926
|
|