@zydon/common 2.1.41 → 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;
@@ -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 D({slides:i,disableZoom:l,disableVideo:r,disableTotal:p,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t,onGetCurrentIndex:a$1,render:E,...S}){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:r,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"}),...E},className:f.root,...S})}function L({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 P({totalItems:i,disableTotal:l}){let{currentIndex:r}=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:[" ",r+1," "]})," / ",i]})}function Y(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 { P as DisplayTotal, D as Lightbox, L as getPlugins, Y 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.41",
3
+ "version": "2.1.42",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",