@zydon/common 2.1.40 → 2.1.42

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.
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import Captions from 'yet-another-react-lightbox/plugins/captions';
3
3
  import { LightboxExternalProps, Slide } from 'yet-another-react-lightbox';
4
+ export { Slide } from 'yet-another-react-lightbox';
4
5
 
5
6
  type LightBoxProps = LightboxExternalProps & {
6
7
  disableZoom?: boolean;
@@ -20,7 +21,7 @@ type UseLightBoxReturn = {
20
21
  setSelected: React.Dispatch<React.SetStateAction<number>>;
21
22
  };
22
23
 
23
- declare function Lightbox({ slides, disableZoom, disableVideo, disableTotal, disableCaptions, disableSlideshow, disableThumbnails, disableFullscreen, onGetCurrentIndex, ...other }: LightBoxProps): react_jsx_runtime.JSX.Element;
24
+ declare function Lightbox({ slides, disableZoom, disableVideo, disableTotal, disableCaptions, disableSlideshow, disableThumbnails, disableFullscreen, onGetCurrentIndex, render, ...other }: LightBoxProps): react_jsx_runtime.JSX.Element;
24
25
  declare function getPlugins({ disableZoom, disableVideo, disableCaptions, disableSlideshow, disableThumbnails, disableFullscreen, }: Partial<LightBoxProps>): (typeof Captions)[];
25
26
  type DisplayTotalProps = {
26
27
  totalItems: number;
@@ -1,7 +1,7 @@
1
1
  import { a } from '../../chunk-C7G4JHJP.js';
2
2
  import '../../chunk-6HPAQ46I.js';
3
- import _ from '@mui/material/Box';
4
- import w, { useLightboxState } from 'yet-another-react-lightbox';
3
+ import w from '@mui/material/Box';
4
+ import C, { useLightboxState } from 'yet-another-react-lightbox';
5
5
  import d from 'yet-another-react-lightbox/plugins/captions';
6
6
  import h from 'yet-another-react-lightbox/plugins/fullscreen';
7
7
  import u from 'yet-another-react-lightbox/plugins/slideshow';
@@ -11,6 +11,6 @@ import y from 'yet-another-react-lightbox/plugins/zoom';
11
11
  import { jsx, jsxs } from 'react/jsx-runtime';
12
12
  import { useState, useCallback } from 'react';
13
13
 
14
- var f={root:"mnl__lightbox__root"};function v({slides:i,disableZoom:l,disableVideo:r,disableTotal:p,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t,onGetCurrentIndex:a$1,...E}){let m=i?i.length:0;return jsx(w,{slides:i,animation:{swipe:240},carousel:{finite:m<5},controller:{closeOnBackdropClick:!0},plugins:O({disableZoom:l,disableVideo:r,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t}),on:{view:({index:S})=>{a$1&&a$1(S);}},toolbar:{buttons:[jsx(L,{totalItems:m,disableTotal:p},0),"close"]},render:{iconClose:()=>jsx(a,{width:24,icon:"CLOSE_MARK_BUTTON"}),iconZoomIn:()=>jsx(a,{width:24,icon:"ZOOM_IN"}),iconZoomOut:()=>jsx(a,{width:24,icon:"ZOOM_OUT"}),iconSlideshowPlay:()=>jsx(a,{width:24,icon:"PLAY_EXECUTE"}),iconSlideshowPause:()=>jsx(a,{width:24,icon:"PAUSE"}),iconPrev:()=>jsx(a,{width:32,icon:"CHEVRON_LEFT"}),iconNext:()=>jsx(a,{width:32,icon:"CHEVRON_RIGHT"}),iconExitFullscreen:()=>jsx(a,{width:24,icon:"MINIMIZE_SCREEN"}),iconEnterFullscreen:()=>jsx(a,{width:24,icon:"MAXIMIZE_SCREEN"})},className:f.root,...E})}function O({disableZoom:i,disableVideo:l,disableCaptions:r,disableSlideshow:p,disableThumbnails:c,disableFullscreen:s}){let o=[d,h,u,x,g,y];return c&&(o=o.filter(t=>t!==x)),r&&(o=o.filter(t=>t!==d)),s&&(o=o.filter(t=>t!==h)),p&&(o=o.filter(t=>t!==u)),i&&(o=o.filter(t=>t!==y)),l&&(o=o.filter(t=>t!==g)),o}function L({totalItems:i,disableTotal:l}){let{currentIndex:r}=useLightboxState();return l?null:jsxs(_,{component:"span",className:"yarl__button",sx:{typography:"body2",alignItems:"center",display:"inline-flex",justifyContent:"center"},children:[jsxs("strong",{children:[" ",r+1," "]})," / ",i]})}function K(i){let[l,r]=useState(-1),p=useCallback(s=>{let o=i.findIndex(t=>t.type==="video"?t.poster===s:t.src===s);r(o);},[i]),c=useCallback(()=>{r(-1);},[]);return {selected:l,open:l>=0,onOpen:p,onClose:c,setSelected:r}}
14
+ var f={root:"mnl__lightbox__root"};function H({slides:i,disableZoom:l,disableVideo:n,disableTotal:p,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t,onGetCurrentIndex:a$1,render:I,...E}){let m=i?i.length:0;return jsx(C,{slides:i,animation:{swipe:240},carousel:{finite:m<5},controller:{closeOnBackdropClick:!0},plugins:L({disableZoom:l,disableVideo:n,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t}),on:{view:({index:_})=>{a$1&&a$1(_);}},toolbar:{buttons:[jsx(P,{totalItems:m,disableTotal:p},0),"close"]},render:{iconClose:()=>jsx(a,{width:24,icon:"CLOSE_MARK_BUTTON"}),iconZoomIn:()=>jsx(a,{width:24,icon:"ZOOM_IN"}),iconZoomOut:()=>jsx(a,{width:24,icon:"ZOOM_OUT"}),iconSlideshowPlay:()=>jsx(a,{width:24,icon:"PLAY_EXECUTE"}),iconSlideshowPause:()=>jsx(a,{width:24,icon:"PAUSE"}),iconPrev:()=>jsx(a,{width:32,icon:"CHEVRON_LEFT"}),iconNext:()=>jsx(a,{width:32,icon:"CHEVRON_RIGHT"}),iconExitFullscreen:()=>jsx(a,{width:24,icon:"MINIMIZE_SCREEN"}),iconEnterFullscreen:()=>jsx(a,{width:24,icon:"MAXIMIZE_SCREEN"}),...I},className:f.root,...E})}function L({disableZoom:i,disableVideo:l,disableCaptions:n,disableSlideshow:p,disableThumbnails:c,disableFullscreen:s}){let o=[d,h,u,x,g,y];return c&&(o=o.filter(t=>t!==x)),n&&(o=o.filter(t=>t!==d)),s&&(o=o.filter(t=>t!==h)),p&&(o=o.filter(t=>t!==u)),i&&(o=o.filter(t=>t!==y)),l&&(o=o.filter(t=>t!==g)),o}function P({totalItems:i,disableTotal:l}){let{currentIndex:n}=useLightboxState();return l?null:jsxs(w,{component:"span",className:"yarl__button",sx:{typography:"body2",alignItems:"center",display:"inline-flex",justifyContent:"center"},children:[jsxs("strong",{children:[" ",n+1," "]})," / ",i]})}function j(i){let[l,n]=useState(-1),p=useCallback(s=>{let o=i.findIndex(t=>t.type==="video"?t.poster===s:t.src===s);n(o);},[i]),c=useCallback(()=>{n(-1);},[]);return {selected:l,open:l>=0,onOpen:p,onClose:c,setSelected:n}}
15
15
 
16
- export { L as DisplayTotal, v as Lightbox, O as getPlugins, K as useLightBox };
16
+ export { P as DisplayTotal, H as Lightbox, L as getPlugins, j as useLightBox };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.1.40",
3
+ "version": "2.1.42",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",