@cntrl-site/components 0.1.0-alpha.0 → 0.1.0-alpha.10

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