indicator-ui 0.0.179 → 0.0.180

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
@@ -11911,16 +11911,16 @@ function MediaViewer({ media = [], initMediaIndex, nearestElementsOnly = true, o
11911
11911
  const isNearestElement = (curEl, el) => {
11912
11912
  const nextEl = curEl + 1 < media.length ? curEl + 1 : media.length - 1;
11913
11913
  const prevEl = curEl - 1 >= 0 ? curEl - 1 : 0;
11914
- return nextEl === el || prevEl === el;
11914
+ return nextEl === el || prevEl === el || el === curEl;
11915
11915
  };
11916
11916
  const getContent = (item, idx) => {
11917
- if (item == null || (nearestElementsOnly && !isNearestElement(idx, curMediaIndex)))
11917
+ if (item == null || (nearestElementsOnly && !isNearestElement(curMediaIndex, idx)))
11918
11918
  return undefined;
11919
11919
  switch (item.type) {
11920
11920
  case 'video':
11921
- return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components__WEBPACK_IMPORTED_MODULE_2__.VideoViewer, { src: item.src, muted: curMediaIndex === idx ? muted : undefined, play: curMediaIndex === idx ? play : undefined, onChangePlay: curMediaIndex === idx ? (play) => setPlay(play) : undefined }, item.src);
11921
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components__WEBPACK_IMPORTED_MODULE_2__.VideoViewer, { src: item.src, muted: curMediaIndex === idx ? muted : undefined, play: curMediaIndex === idx ? play : undefined, onChangePlay: curMediaIndex === idx ? (play) => setPlay(play) : undefined }, idx);
11922
11922
  case 'image':
11923
- return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components__WEBPACK_IMPORTED_MODULE_2__.ImageViewer, { src: item.src }, item.src);
11923
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components__WEBPACK_IMPORTED_MODULE_2__.ImageViewer, { src: item.src }, idx);
11924
11924
  default:
11925
11925
  return undefined;
11926
11926
  }