@cntrl-site/components 0.1.0-alpha.1 → 0.1.0-alpha.11

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
@@ -1443,7 +1443,9 @@ const ControlImageRevealSliderComponent = {
1443
1443
  }
1444
1444
  }
1445
1445
  };
1446
+ const background = "Lightbox-module__background___wf1Ii";
1446
1447
  const backdropStyle = "Lightbox-module__backdropStyle___y7avj";
1448
+ const editor = "Lightbox-module__editor___Vh82D";
1447
1449
  const contentStyle = "Lightbox-module__contentStyle___FzFaW";
1448
1450
  const imageStyle = "Lightbox-module__imageStyle___Qb7f5";
1449
1451
  const imgWrapper = "Lightbox-module__imgWrapper___cdytV";
@@ -1472,7 +1474,9 @@ const slideInTop = "Lightbox-module__slideInTop___XRKCs";
1472
1474
  const slideInBottom = "Lightbox-module__slideInBottom___TYOBS";
1473
1475
  const scaleSlide = "Lightbox-module__scaleSlide___wS7d4";
1474
1476
  const styles = {
1477
+ background,
1475
1478
  backdropStyle,
1479
+ editor,
1476
1480
  contentStyle,
1477
1481
  imageStyle,
1478
1482
  imgWrapper,
@@ -1535,7 +1539,7 @@ const getPositionStyles = (position, offset) => {
1535
1539
  }
1536
1540
  return styles2;
1537
1541
  };
1538
- function LightboxGallery({ settings, content, styles: styles2, portalId, activeEvent }) {
1542
+ function LightboxGallery({ settings, content, styles: styles2, portalId, activeEvent, isEditor }) {
1539
1543
  const [open, setOpen] = React.useState(false);
1540
1544
  const { url } = settings.thumbnailBlock.cover;
1541
1545
  React.useEffect(() => {
@@ -1556,10 +1560,10 @@ function LightboxGallery({ settings, content, styles: styles2, portalId, activeE
1556
1560
  onClick: () => setOpen(true)
1557
1561
  }
1558
1562
  ),
1559
- /* @__PURE__ */ jsxRuntime.jsx(Lightbox, { isOpen: open, onClose: () => setOpen(false), content, settings, portalId })
1563
+ /* @__PURE__ */ jsxRuntime.jsx(Lightbox, { isOpen: open, onClose: () => setOpen(false), content, settings, portalId, isEditor })
1560
1564
  ] });
1561
1565
  }
1562
- const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = true, closeOnEsc = true, portalId }) => {
1566
+ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = true, closeOnEsc = true, portalId, isEditor }) => {
1563
1567
  const [currentIndex, setCurrentIndex] = React.useState(0);
1564
1568
  const lightboxRef = React.useRef(null);
1565
1569
  const resizeObserverRef = React.useRef(null);
@@ -1576,6 +1580,20 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1576
1580
  onClose();
1577
1581
  }
1578
1582
  };
1583
+ const handleContentClick = (e) => {
1584
+ if (!closeOnBackdropClick) return;
1585
+ const target = e.target;
1586
+ const currentTarget = e.currentTarget;
1587
+ if (target === currentTarget) {
1588
+ onClose();
1589
+ return;
1590
+ }
1591
+ const isImg = target.tagName === "IMG" || target.closest("img");
1592
+ const isButton = target.tagName === "BUTTON" || target.closest("button");
1593
+ if (!isImg && !isButton) {
1594
+ onClose();
1595
+ }
1596
+ };
1579
1597
  const onImageClick = (e) => {
1580
1598
  var _a, _b;
1581
1599
  if (triggers.type === "click" && triggers.switch === "image") {
@@ -1622,6 +1640,19 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1622
1640
  React.useEffect(() => {
1623
1641
  if (isOpen) setCurrentIndex(0);
1624
1642
  }, [isOpen]);
1643
+ React.useEffect(() => {
1644
+ if (!isOpen) return;
1645
+ const originalOverflow = document.body.style.overflow;
1646
+ document.body.style.overflow = "hidden";
1647
+ document.body.style.backgroundColor = area.color;
1648
+ const preventScroll = (e) => e.preventDefault();
1649
+ document.addEventListener("touchmove", preventScroll, { passive: false });
1650
+ return () => {
1651
+ document.body.style.overflow = originalOverflow;
1652
+ document.removeEventListener("touchmove", preventScroll);
1653
+ document.body.style.backgroundColor = "";
1654
+ };
1655
+ }, [isOpen]);
1625
1656
  React.useEffect(() => {
1626
1657
  if (!isOpen) return;
1627
1658
  if (resizeObserverRef.current) {
@@ -1670,17 +1701,28 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1670
1701
  (_a = lightboxRef.current) == null ? void 0 : _a.go(dir);
1671
1702
  };
1672
1703
  const appearDurationMs = appear.duration ? parseInt(appear.duration) : 300;
1704
+ const backdropDurationMs = appear.type === "fade in" || appear.type === "mix" ? Math.floor(appearDurationMs * 0.7) : appearDurationMs;
1673
1705
  const appearClass = (() => {
1674
1706
  if (appear.type === "fade in") return styles.fadeIn;
1675
- if (appear.type === "slide in") {
1676
- return "";
1707
+ if (appear.type === "slide in" || appear.type === "mix") {
1708
+ switch (appear.direction) {
1709
+ case "left":
1710
+ return styles.slideInLeft;
1711
+ case "right":
1712
+ return styles.slideInRight;
1713
+ case "top":
1714
+ return styles.slideInTop;
1715
+ case "bottom":
1716
+ return styles.slideInBottom;
1717
+ default:
1718
+ return styles.slideInRight;
1719
+ }
1677
1720
  }
1678
- if (appear.type === "mix") return styles.fadeIn;
1679
1721
  return styles.fadeIn;
1680
1722
  })();
1681
1723
  const backdropAppearClass = (() => {
1682
- if (appear.type === "fade in") return styles.fadeIn;
1683
- if (appear.type === "slide in" || appear.type === "mix") {
1724
+ if (appear.type === "fade in" || appear.type === "mix") return styles.fadeIn;
1725
+ if (appear.type === "slide in") {
1684
1726
  switch (appear.direction) {
1685
1727
  case "left":
1686
1728
  return styles.slideInLeft;
@@ -1698,228 +1740,249 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
1698
1740
  })();
1699
1741
  if (!isOpen) return null;
1700
1742
  return reactDom.createPortal(
1701
- /* @__PURE__ */ jsxRuntime.jsx(
1702
- "div",
1703
- {
1704
- className: cn(styles.backdropStyle, backdropAppearClass),
1705
- style: { backgroundColor: area.color, backdropFilter: `blur(${area.blur}px)`, animationDuration: `${appearDurationMs}ms`, animationTimingFunction: "ease", animationFillMode: "both" },
1706
- onClick: handleBackdropClick,
1707
- children: /* @__PURE__ */ jsxRuntime.jsxs(
1708
- "div",
1709
- {
1710
- className: cn(styles.contentStyle, appearClass),
1711
- style: {
1712
- padding: `${layout.padding.top}px ${layout.padding.right}px ${layout.padding.bottom}px ${layout.padding.left}px`,
1713
- animationDuration: `${appearDurationMs}ms`,
1714
- animationTimingFunction: "ease",
1715
- animationFillMode: "both",
1716
- ...appear.type === "mix" && { animationDelay: "0.5s" },
1717
- "--splide-speed": triggers.duration || "500ms"
1718
- },
1719
- children: [
1720
- /* @__PURE__ */ jsxRuntime.jsx(
1721
- reactSplide.Splide,
1722
- {
1723
- onMove: (splide) => {
1724
- setCurrentIndex(splide.index);
1725
- },
1726
- ref: lightboxRef,
1727
- className: styles.lightboxSplide,
1728
- options: {
1729
- arrows: false,
1730
- speed: triggers.duration ? parseInt(triggers.duration) : 500,
1731
- direction: slider.direction === "horiz" || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb",
1732
- pagination: false,
1733
- drag: triggers.type === "drag",
1734
- perPage: 1,
1735
- width: "100%",
1736
- height: "100%",
1737
- type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
1738
- padding: 0,
1739
- rewind: (slider.type === "scale" || slider.type === "fade") && appear.repeat !== "close"
1740
- },
1741
- style: { "--splide-speed": triggers.duration || "500ms" },
1742
- children: content.map((item, index) => {
1743
- const positionStyles = getPositionStyles(layout.position, layout.offset);
1744
- const imageStyle2 = slider.type === "scale" ? (() => {
1745
- const { transform, ...restStyles } = positionStyles;
1746
- return {
1747
- ...restStyles,
1748
- "--position-transform": transform || "none"
1749
- };
1750
- })() : positionStyles;
1751
- return /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsx(
1752
- "div",
1753
- {
1754
- className: styles.imgWrapper,
1755
- onClick: handleImageWrapperClick,
1756
- children: /* @__PURE__ */ jsxRuntime.jsx(
1757
- "img",
1758
- {
1759
- className: cn(styles.imageStyle, {
1760
- [styles.contain]: item.image.objectFit === "contain",
1761
- [styles.cover]: item.image.objectFit === "cover",
1762
- [styles.scaleSlide]: slider.type === "scale"
1763
- }),
1764
- src: item.image.url,
1765
- alt: item.image.name ?? "",
1766
- onClick: onImageClick,
1767
- style: imageStyle2
1768
- }
1769
- )
1770
- }
1771
- ) }, index);
1772
- })
1773
- }
1774
- ),
1775
- controls.isActive && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1743
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1744
+ /* @__PURE__ */ jsxRuntime.jsx(
1745
+ "div",
1746
+ {
1747
+ className: cn(styles.background, backdropAppearClass),
1748
+ style: {
1749
+ ...isEditor && { [styles.editor]: isEditor },
1750
+ backgroundColor: area.color,
1751
+ backdropFilter: `blur(${area.blur}px)`,
1752
+ animationDuration: `${backdropDurationMs}ms`,
1753
+ animationTimingFunction: "ease",
1754
+ animationFillMode: "both"
1755
+ }
1756
+ }
1757
+ ),
1758
+ /* @__PURE__ */ jsxRuntime.jsx(
1759
+ "div",
1760
+ {
1761
+ className: cn(styles.backdropStyle),
1762
+ onClick: handleBackdropClick,
1763
+ onTouchEnd: handleBackdropClick,
1764
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1765
+ "div",
1766
+ {
1767
+ className: cn(styles.contentStyle, appearClass),
1768
+ onClick: handleContentClick,
1769
+ style: {
1770
+ animationDuration: `${appearDurationMs}ms`,
1771
+ animationTimingFunction: "ease",
1772
+ animationFillMode: "both",
1773
+ ...appear.type === "mix" && { animationDelay: `${backdropDurationMs}ms` },
1774
+ "--splide-speed": triggers.duration || "500ms"
1775
+ },
1776
+ children: [
1776
1777
  /* @__PURE__ */ jsxRuntime.jsx(
1778
+ reactSplide.Splide,
1779
+ {
1780
+ onMove: (splide) => {
1781
+ setCurrentIndex(splide.index);
1782
+ },
1783
+ ref: lightboxRef,
1784
+ className: styles.lightboxSplide,
1785
+ options: {
1786
+ arrows: false,
1787
+ speed: triggers.duration ? parseInt(triggers.duration) : 500,
1788
+ direction: slider.direction === "horiz" || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb",
1789
+ pagination: false,
1790
+ drag: triggers.type === "drag",
1791
+ perPage: 1,
1792
+ width: "100%",
1793
+ height: "100%",
1794
+ type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
1795
+ padding: 0,
1796
+ rewind: (slider.type === "scale" || slider.type === "fade") && appear.repeat !== "close"
1797
+ },
1798
+ style: { "--splide-speed": triggers.duration || "500ms" },
1799
+ children: content.map((item, index) => {
1800
+ const positionStyles = getPositionStyles(layout.position, layout.offset);
1801
+ const imageStyle2 = slider.type === "scale" ? (() => {
1802
+ const { transform, ...restStyles } = positionStyles;
1803
+ return {
1804
+ ...restStyles,
1805
+ "--position-transform": transform || "none"
1806
+ };
1807
+ })() : positionStyles;
1808
+ return /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsx(
1809
+ "div",
1810
+ {
1811
+ className: styles.imgWrapper,
1812
+ onClick: handleImageWrapperClick,
1813
+ style: {
1814
+ padding: `${layout.padding.top}px ${layout.padding.right}px ${layout.padding.bottom}px ${layout.padding.left}px`
1815
+ },
1816
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1817
+ "img",
1818
+ {
1819
+ className: cn(styles.imageStyle, {
1820
+ [styles.contain]: item.image.objectFit === "contain",
1821
+ [styles.cover]: item.image.objectFit === "cover",
1822
+ [styles.scaleSlide]: slider.type === "scale"
1823
+ }),
1824
+ src: item.image.url,
1825
+ alt: item.image.name ?? "",
1826
+ onClick: onImageClick,
1827
+ style: imageStyle2
1828
+ }
1829
+ )
1830
+ }
1831
+ ) }, index);
1832
+ })
1833
+ }
1834
+ ),
1835
+ controls.isActive && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1836
+ /* @__PURE__ */ jsxRuntime.jsx(
1837
+ "div",
1838
+ {
1839
+ className: cn(styles.arrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1840
+ style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1841
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1842
+ "button",
1843
+ {
1844
+ className: styles.arrowInner,
1845
+ style: {
1846
+ transform: `translate(${scalingValue(controls.offset.x)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1))}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1847
+ },
1848
+ onClick: (e) => {
1849
+ handleArrowClick("-1");
1850
+ },
1851
+ children: controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
1852
+ SvgImage,
1853
+ {
1854
+ url: controls.arrowsImgUrl,
1855
+ fill: controls.color,
1856
+ hoverFill: controls.hover,
1857
+ className: cn(styles.arrowImg, styles.mirror)
1858
+ }
1859
+ )
1860
+ }
1861
+ )
1862
+ }
1863
+ ),
1864
+ /* @__PURE__ */ jsxRuntime.jsx(
1865
+ "div",
1866
+ {
1867
+ className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1868
+ style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1869
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1870
+ "button",
1871
+ {
1872
+ className: styles.arrowInner,
1873
+ style: {
1874
+ transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(controls.offset.y)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1875
+ },
1876
+ onClick: (e) => {
1877
+ handleArrowClick("+1");
1878
+ },
1879
+ "aria-label": "Next",
1880
+ children: controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
1881
+ SvgImage,
1882
+ {
1883
+ url: controls.arrowsImgUrl,
1884
+ fill: controls.color,
1885
+ hoverFill: controls.hover,
1886
+ className: styles.arrowImg
1887
+ }
1888
+ )
1889
+ }
1890
+ )
1891
+ }
1892
+ )
1893
+ ] }),
1894
+ area.closeIconUrl && (() => {
1895
+ const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset);
1896
+ const scaleTransform = `scale(${area.closeIconScale})`;
1897
+ const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
1898
+ return /* @__PURE__ */ jsxRuntime.jsx(
1899
+ "button",
1900
+ {
1901
+ className: styles.closeButton,
1902
+ style: {
1903
+ ...positionStyles,
1904
+ transform: combinedTransform
1905
+ },
1906
+ onClick: onClose,
1907
+ children: /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { url: area.closeIconUrl })
1908
+ }
1909
+ );
1910
+ })(),
1911
+ caption2.isActive && /* @__PURE__ */ jsxRuntime.jsx(
1777
1912
  "div",
1778
1913
  {
1779
- className: cn(styles.arrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1780
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1781
- children: /* @__PURE__ */ jsxRuntime.jsx(
1782
- "button",
1783
- {
1784
- className: styles.arrowInner,
1785
- style: {
1786
- transform: `translate(${scalingValue(controls.offset.x)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1))}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1787
- },
1788
- onClick: (e) => {
1789
- handleArrowClick("-1");
1790
- },
1791
- children: controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
1792
- SvgImage,
1793
- {
1794
- url: controls.arrowsImgUrl,
1795
- fill: controls.color,
1796
- hoverFill: controls.hover,
1797
- className: cn(styles.arrowImg, styles.mirror)
1798
- }
1799
- )
1800
- }
1801
- )
1914
+ className: styles.caption,
1915
+ style: {
1916
+ ...getPositionStyles(caption2.alignment, caption2.offset),
1917
+ ["--link-hover-color"]: caption2.hover
1918
+ },
1919
+ children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
1802
1920
  }
1803
1921
  ),
1804
- /* @__PURE__ */ jsxRuntime.jsx(
1922
+ thumbnail.isActive && /* @__PURE__ */ jsxRuntime.jsx(
1805
1923
  "div",
1806
1924
  {
1807
- className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: slider.direction === "vert" }),
1808
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
1809
- children: /* @__PURE__ */ jsxRuntime.jsx(
1810
- "button",
1925
+ className: cn(
1926
+ styles.thumbsContainer,
1811
1927
  {
1812
- className: styles.arrowInner,
1813
- style: {
1814
- transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(controls.offset.y)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
1815
- },
1816
- onClick: (e) => {
1817
- handleArrowClick("+1");
1818
- },
1819
- "aria-label": "Next",
1820
- children: controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
1821
- SvgImage,
1822
- {
1823
- url: controls.arrowsImgUrl,
1824
- fill: controls.color,
1825
- hoverFill: controls.hover,
1826
- className: styles.arrowImg
1827
- }
1828
- )
1928
+ [styles.thumbsContainerVertical]: slider.direction === "vert",
1929
+ [styles.thumbsAlignStart]: thumbnail.align === "start",
1930
+ [styles.thumbsAlignCenter]: thumbnail.align === "center",
1931
+ [styles.thumbsAlignEnd]: thumbnail.align === "end"
1829
1932
  }
1830
- )
1831
- }
1832
- )
1833
- ] }),
1834
- area.closeIconUrl && (() => {
1835
- const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset);
1836
- const scaleTransform = `scale(${area.closeIconScale})`;
1837
- const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
1838
- return /* @__PURE__ */ jsxRuntime.jsx(
1839
- "button",
1840
- {
1841
- className: styles.closeButton,
1933
+ ),
1842
1934
  style: {
1843
- ...positionStyles,
1844
- transform: combinedTransform
1935
+ gap: `${thumbnail.grid.gap}px`,
1936
+ ...slider.direction === "horiz" ? { height: `${thumbnail.grid.height}px` } : {},
1937
+ ...slider.direction === "vert" ? { width: `${thumbnail.grid.width}px` } : {},
1938
+ ...getPositionStyles(thumbnail.position, thumbnail.offset)
1845
1939
  },
1846
- onClick: onClose,
1847
- children: /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { url: area.closeIconUrl })
1848
- }
1849
- );
1850
- })(),
1851
- caption2.isActive && /* @__PURE__ */ jsxRuntime.jsx(
1852
- "div",
1853
- {
1854
- className: styles.caption,
1855
- style: {
1856
- ...getPositionStyles(caption2.alignment, caption2.offset),
1857
- ["--link-hover-color"]: caption2.hover
1858
- },
1859
- children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
1860
- }
1861
- ),
1862
- thumbnail.isActive && /* @__PURE__ */ jsxRuntime.jsx(
1863
- "div",
1864
- {
1865
- className: cn(
1866
- styles.thumbsContainer,
1867
- {
1868
- [styles.thumbsContainerVertical]: slider.direction === "vert",
1869
- [styles.thumbsAlignStart]: thumbnail.align === "start",
1870
- [styles.thumbsAlignCenter]: thumbnail.align === "center",
1871
- [styles.thumbsAlignEnd]: thumbnail.align === "end"
1872
- }
1873
- ),
1874
- style: {
1875
- gap: `${thumbnail.grid.gap}px`,
1876
- ...slider.direction === "horiz" ? { height: `${thumbnail.grid.height}px` } : {},
1877
- ...slider.direction === "vert" ? { width: `${thumbnail.grid.width}px` } : {},
1878
- ...getPositionStyles(thumbnail.position, thumbnail.offset)
1879
- },
1880
- children: content.map((item, index) => {
1881
- const isActive = index === currentIndex;
1882
- return /* @__PURE__ */ jsxRuntime.jsx(
1883
- "button",
1884
- {
1885
- className: styles.thumbItem,
1886
- style: {
1887
- transform: `scale(${isActive ? thumbnail.activeState.scale : 1})`,
1888
- ...slider.direction === "horiz" ? { height: "100%" } : {},
1889
- ...slider.direction === "vert" ? { width: "100%" } : {},
1890
- opacity: isActive ? thumbnail.activeState.opacity : thumbnail.opacity,
1891
- ["--thumb-hover"]: thumbnail.activeState.opacity
1892
- },
1893
- onClick: (e) => {
1894
- var _a;
1895
- e.stopPropagation();
1896
- setCurrentIndex(index);
1897
- (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
1898
- },
1899
- children: /* @__PURE__ */ jsxRuntime.jsx(
1900
- "img",
1901
- {
1902
- src: item.image.url,
1903
- alt: item.image.name ?? "",
1904
- className: styles.thumbImage,
1905
- style: {
1906
- objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
1907
- ...slider.direction === "horiz" ? { height: "100%" } : {},
1908
- ...slider.direction === "vert" ? { width: "100%" } : {}
1940
+ children: content.map((item, index) => {
1941
+ const isActive = index === currentIndex;
1942
+ return /* @__PURE__ */ jsxRuntime.jsx(
1943
+ "button",
1944
+ {
1945
+ className: styles.thumbItem,
1946
+ style: {
1947
+ transform: `scale(${isActive ? thumbnail.activeState.scale : 1})`,
1948
+ ...slider.direction === "horiz" ? { height: "100%" } : {},
1949
+ ...slider.direction === "vert" ? { width: "100%" } : {},
1950
+ opacity: isActive ? thumbnail.activeState.opacity : thumbnail.opacity,
1951
+ ["--thumb-hover"]: thumbnail.activeState.opacity
1952
+ },
1953
+ onClick: (e) => {
1954
+ var _a;
1955
+ e.stopPropagation();
1956
+ setCurrentIndex(index);
1957
+ (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
1958
+ },
1959
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1960
+ "img",
1961
+ {
1962
+ src: item.image.url,
1963
+ alt: item.image.name ?? "",
1964
+ className: styles.thumbImage,
1965
+ style: {
1966
+ objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
1967
+ ...thumbnail.fit === "fit" && slider.direction === "horiz" ? { width: "fit-content" } : {},
1968
+ ...thumbnail.fit === "fit" && slider.direction === "vert" ? { height: "fit-content" } : {},
1969
+ ...slider.direction === "horiz" ? { height: "100%" } : {},
1970
+ ...slider.direction === "vert" ? { width: "100%" } : {}
1971
+ }
1909
1972
  }
1910
- }
1911
- )
1912
- },
1913
- `${item.image.url}-${index}`
1914
- );
1915
- })
1916
- }
1917
- )
1918
- ]
1919
- }
1920
- )
1921
- }
1922
- ),
1973
+ )
1974
+ },
1975
+ `${item.image.url}-${index}`
1976
+ );
1977
+ })
1978
+ }
1979
+ )
1980
+ ]
1981
+ }
1982
+ )
1983
+ }
1984
+ )
1985
+ ] }),
1923
1986
  document.getElementById(portalId)
1924
1987
  );
1925
1988
  };
@@ -2118,7 +2181,8 @@ const LightboxComponent = {
2118
2181
  type: "number",
2119
2182
  label: "H",
2120
2183
  display: {
2121
- type: "numeric-input"
2184
+ type: "numeric-input",
2185
+ visible: true
2122
2186
  }
2123
2187
  },
2124
2188
  width: {
@@ -2498,7 +2562,7 @@ const LightboxComponent = {
2498
2562
  value: "vert"
2499
2563
  },
2500
2564
  then: {
2501
- name: "properties.lightboxBlock.properties.thumbnail.properties.position.display.direction",
2565
+ name: "properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",
2502
2566
  value: "vertical"
2503
2567
  }
2504
2568
  },