@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/Components/Lightbox/Lightbox.d.ts +2 -1
- package/dist/components.css +1 -1
- package/dist/index.js +284 -220
- package/dist/index.mjs +284 -220
- package/package.json +1 -1
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
|
-
|
|
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"
|
|
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,249 @@ const Lightbox = ({ isOpen, onClose, content, settings, closeOnBackdropClick = t
|
|
|
1696
1738
|
})();
|
|
1697
1739
|
if (!isOpen) return null;
|
|
1698
1740
|
return createPortal(
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
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: {
|
|
1747
|
+
...isEditor && { [styles.editor]: isEditor },
|
|
1748
|
+
backgroundColor: area.color,
|
|
1749
|
+
backdropFilter: `blur(${area.blur}px)`,
|
|
1750
|
+
animationDuration: `${backdropDurationMs}ms`,
|
|
1751
|
+
animationTimingFunction: "ease",
|
|
1752
|
+
animationFillMode: "both"
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
),
|
|
1756
|
+
/* @__PURE__ */ jsx(
|
|
1757
|
+
"div",
|
|
1758
|
+
{
|
|
1759
|
+
className: cn(styles.backdropStyle),
|
|
1760
|
+
onClick: handleBackdropClick,
|
|
1761
|
+
onTouchEnd: handleBackdropClick,
|
|
1762
|
+
children: /* @__PURE__ */ jsxs(
|
|
1763
|
+
"div",
|
|
1764
|
+
{
|
|
1765
|
+
className: cn(styles.contentStyle, appearClass),
|
|
1766
|
+
onClick: handleContentClick,
|
|
1767
|
+
style: {
|
|
1768
|
+
animationDuration: `${appearDurationMs}ms`,
|
|
1769
|
+
animationTimingFunction: "ease",
|
|
1770
|
+
animationFillMode: "both",
|
|
1771
|
+
...appear.type === "mix" && { animationDelay: `${backdropDurationMs}ms` },
|
|
1772
|
+
"--splide-speed": triggers.duration || "500ms"
|
|
1773
|
+
},
|
|
1774
|
+
children: [
|
|
1774
1775
|
/* @__PURE__ */ jsx(
|
|
1776
|
+
Splide,
|
|
1777
|
+
{
|
|
1778
|
+
onMove: (splide) => {
|
|
1779
|
+
setCurrentIndex(splide.index);
|
|
1780
|
+
},
|
|
1781
|
+
ref: lightboxRef,
|
|
1782
|
+
className: styles.lightboxSplide,
|
|
1783
|
+
options: {
|
|
1784
|
+
arrows: false,
|
|
1785
|
+
speed: triggers.duration ? parseInt(triggers.duration) : 500,
|
|
1786
|
+
direction: slider.direction === "horiz" || slider.type === "fade" || slider.type === "scale" ? "ltr" : "ttb",
|
|
1787
|
+
pagination: false,
|
|
1788
|
+
drag: triggers.type === "drag",
|
|
1789
|
+
perPage: 1,
|
|
1790
|
+
width: "100%",
|
|
1791
|
+
height: "100%",
|
|
1792
|
+
type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
|
|
1793
|
+
padding: 0,
|
|
1794
|
+
rewind: (slider.type === "scale" || slider.type === "fade") && appear.repeat !== "close"
|
|
1795
|
+
},
|
|
1796
|
+
style: { "--splide-speed": triggers.duration || "500ms" },
|
|
1797
|
+
children: content.map((item, index) => {
|
|
1798
|
+
const positionStyles = getPositionStyles(layout.position, layout.offset);
|
|
1799
|
+
const imageStyle2 = slider.type === "scale" ? (() => {
|
|
1800
|
+
const { transform, ...restStyles } = positionStyles;
|
|
1801
|
+
return {
|
|
1802
|
+
...restStyles,
|
|
1803
|
+
"--position-transform": transform || "none"
|
|
1804
|
+
};
|
|
1805
|
+
})() : positionStyles;
|
|
1806
|
+
return /* @__PURE__ */ jsx(SplideSlide, { children: /* @__PURE__ */ jsx(
|
|
1807
|
+
"div",
|
|
1808
|
+
{
|
|
1809
|
+
className: styles.imgWrapper,
|
|
1810
|
+
onClick: handleImageWrapperClick,
|
|
1811
|
+
style: {
|
|
1812
|
+
padding: `${layout.padding.top}px ${layout.padding.right}px ${layout.padding.bottom}px ${layout.padding.left}px`
|
|
1813
|
+
},
|
|
1814
|
+
children: /* @__PURE__ */ jsx(
|
|
1815
|
+
"img",
|
|
1816
|
+
{
|
|
1817
|
+
className: cn(styles.imageStyle, {
|
|
1818
|
+
[styles.contain]: item.image.objectFit === "contain",
|
|
1819
|
+
[styles.cover]: item.image.objectFit === "cover",
|
|
1820
|
+
[styles.scaleSlide]: slider.type === "scale"
|
|
1821
|
+
}),
|
|
1822
|
+
src: item.image.url,
|
|
1823
|
+
alt: item.image.name ?? "",
|
|
1824
|
+
onClick: onImageClick,
|
|
1825
|
+
style: imageStyle2
|
|
1826
|
+
}
|
|
1827
|
+
)
|
|
1828
|
+
}
|
|
1829
|
+
) }, index);
|
|
1830
|
+
})
|
|
1831
|
+
}
|
|
1832
|
+
),
|
|
1833
|
+
controls.isActive && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1834
|
+
/* @__PURE__ */ jsx(
|
|
1835
|
+
"div",
|
|
1836
|
+
{
|
|
1837
|
+
className: cn(styles.arrow, { [styles.arrowVertical]: slider.direction === "vert" }),
|
|
1838
|
+
style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
|
|
1839
|
+
children: /* @__PURE__ */ jsx(
|
|
1840
|
+
"button",
|
|
1841
|
+
{
|
|
1842
|
+
className: styles.arrowInner,
|
|
1843
|
+
style: {
|
|
1844
|
+
transform: `translate(${scalingValue(controls.offset.x)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1))}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
|
|
1845
|
+
},
|
|
1846
|
+
onClick: (e) => {
|
|
1847
|
+
handleArrowClick("-1");
|
|
1848
|
+
},
|
|
1849
|
+
children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
1850
|
+
SvgImage,
|
|
1851
|
+
{
|
|
1852
|
+
url: controls.arrowsImgUrl,
|
|
1853
|
+
fill: controls.color,
|
|
1854
|
+
hoverFill: controls.hover,
|
|
1855
|
+
className: cn(styles.arrowImg, styles.mirror)
|
|
1856
|
+
}
|
|
1857
|
+
)
|
|
1858
|
+
}
|
|
1859
|
+
)
|
|
1860
|
+
}
|
|
1861
|
+
),
|
|
1862
|
+
/* @__PURE__ */ jsx(
|
|
1863
|
+
"div",
|
|
1864
|
+
{
|
|
1865
|
+
className: cn(styles.arrow, styles.nextArrow, { [styles.arrowVertical]: slider.direction === "vert" }),
|
|
1866
|
+
style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
|
|
1867
|
+
children: /* @__PURE__ */ jsx(
|
|
1868
|
+
"button",
|
|
1869
|
+
{
|
|
1870
|
+
className: styles.arrowInner,
|
|
1871
|
+
style: {
|
|
1872
|
+
transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1))}, ${scalingValue(controls.offset.y)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})`
|
|
1873
|
+
},
|
|
1874
|
+
onClick: (e) => {
|
|
1875
|
+
handleArrowClick("+1");
|
|
1876
|
+
},
|
|
1877
|
+
"aria-label": "Next",
|
|
1878
|
+
children: controls.arrowsImgUrl && /* @__PURE__ */ jsx(
|
|
1879
|
+
SvgImage,
|
|
1880
|
+
{
|
|
1881
|
+
url: controls.arrowsImgUrl,
|
|
1882
|
+
fill: controls.color,
|
|
1883
|
+
hoverFill: controls.hover,
|
|
1884
|
+
className: styles.arrowImg
|
|
1885
|
+
}
|
|
1886
|
+
)
|
|
1887
|
+
}
|
|
1888
|
+
)
|
|
1889
|
+
}
|
|
1890
|
+
)
|
|
1891
|
+
] }),
|
|
1892
|
+
area.closeIconUrl && (() => {
|
|
1893
|
+
const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset);
|
|
1894
|
+
const scaleTransform = `scale(${area.closeIconScale})`;
|
|
1895
|
+
const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
|
|
1896
|
+
return /* @__PURE__ */ jsx(
|
|
1897
|
+
"button",
|
|
1898
|
+
{
|
|
1899
|
+
className: styles.closeButton,
|
|
1900
|
+
style: {
|
|
1901
|
+
...positionStyles,
|
|
1902
|
+
transform: combinedTransform
|
|
1903
|
+
},
|
|
1904
|
+
onClick: onClose,
|
|
1905
|
+
children: /* @__PURE__ */ jsx(SvgImage, { url: area.closeIconUrl })
|
|
1906
|
+
}
|
|
1907
|
+
);
|
|
1908
|
+
})(),
|
|
1909
|
+
caption2.isActive && /* @__PURE__ */ jsx(
|
|
1775
1910
|
"div",
|
|
1776
1911
|
{
|
|
1777
|
-
className:
|
|
1778
|
-
style: {
|
|
1779
|
-
|
|
1780
|
-
"
|
|
1781
|
-
|
|
1782
|
-
|
|
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
|
-
)
|
|
1912
|
+
className: styles.caption,
|
|
1913
|
+
style: {
|
|
1914
|
+
...getPositionStyles(caption2.alignment, caption2.offset),
|
|
1915
|
+
["--link-hover-color"]: caption2.hover
|
|
1916
|
+
},
|
|
1917
|
+
children: /* @__PURE__ */ jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
|
|
1800
1918
|
}
|
|
1801
1919
|
),
|
|
1802
|
-
/* @__PURE__ */ jsx(
|
|
1920
|
+
thumbnail.isActive && /* @__PURE__ */ jsx(
|
|
1803
1921
|
"div",
|
|
1804
1922
|
{
|
|
1805
|
-
className: cn(
|
|
1806
|
-
|
|
1807
|
-
children: /* @__PURE__ */ jsx(
|
|
1808
|
-
"button",
|
|
1923
|
+
className: cn(
|
|
1924
|
+
styles.thumbsContainer,
|
|
1809
1925
|
{
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
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
|
-
)
|
|
1926
|
+
[styles.thumbsContainerVertical]: slider.direction === "vert",
|
|
1927
|
+
[styles.thumbsAlignStart]: thumbnail.align === "start",
|
|
1928
|
+
[styles.thumbsAlignCenter]: thumbnail.align === "center",
|
|
1929
|
+
[styles.thumbsAlignEnd]: thumbnail.align === "end"
|
|
1827
1930
|
}
|
|
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,
|
|
1931
|
+
),
|
|
1840
1932
|
style: {
|
|
1841
|
-
|
|
1842
|
-
|
|
1933
|
+
gap: `${thumbnail.grid.gap}px`,
|
|
1934
|
+
...slider.direction === "horiz" ? { height: `${thumbnail.grid.height}px` } : {},
|
|
1935
|
+
...slider.direction === "vert" ? { width: `${thumbnail.grid.width}px` } : {},
|
|
1936
|
+
...getPositionStyles(thumbnail.position, thumbnail.offset)
|
|
1843
1937
|
},
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
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%" } : {}
|
|
1938
|
+
children: content.map((item, index) => {
|
|
1939
|
+
const isActive = index === currentIndex;
|
|
1940
|
+
return /* @__PURE__ */ jsx(
|
|
1941
|
+
"button",
|
|
1942
|
+
{
|
|
1943
|
+
className: styles.thumbItem,
|
|
1944
|
+
style: {
|
|
1945
|
+
transform: `scale(${isActive ? thumbnail.activeState.scale : 1})`,
|
|
1946
|
+
...slider.direction === "horiz" ? { height: "100%" } : {},
|
|
1947
|
+
...slider.direction === "vert" ? { width: "100%" } : {},
|
|
1948
|
+
opacity: isActive ? thumbnail.activeState.opacity : thumbnail.opacity,
|
|
1949
|
+
["--thumb-hover"]: thumbnail.activeState.opacity
|
|
1950
|
+
},
|
|
1951
|
+
onClick: (e) => {
|
|
1952
|
+
var _a;
|
|
1953
|
+
e.stopPropagation();
|
|
1954
|
+
setCurrentIndex(index);
|
|
1955
|
+
(_a = lightboxRef.current) == null ? void 0 : _a.go(index);
|
|
1956
|
+
},
|
|
1957
|
+
children: /* @__PURE__ */ jsx(
|
|
1958
|
+
"img",
|
|
1959
|
+
{
|
|
1960
|
+
src: item.image.url,
|
|
1961
|
+
alt: item.image.name ?? "",
|
|
1962
|
+
className: styles.thumbImage,
|
|
1963
|
+
style: {
|
|
1964
|
+
objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
|
|
1965
|
+
...thumbnail.fit === "fit" && slider.direction === "horiz" ? { width: "fit-content" } : {},
|
|
1966
|
+
...thumbnail.fit === "fit" && slider.direction === "vert" ? { height: "fit-content" } : {},
|
|
1967
|
+
...slider.direction === "horiz" ? { height: "100%" } : {},
|
|
1968
|
+
...slider.direction === "vert" ? { width: "100%" } : {}
|
|
1969
|
+
}
|
|
1907
1970
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
)
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
),
|
|
1971
|
+
)
|
|
1972
|
+
},
|
|
1973
|
+
`${item.image.url}-${index}`
|
|
1974
|
+
);
|
|
1975
|
+
})
|
|
1976
|
+
}
|
|
1977
|
+
)
|
|
1978
|
+
]
|
|
1979
|
+
}
|
|
1980
|
+
)
|
|
1981
|
+
}
|
|
1982
|
+
)
|
|
1983
|
+
] }),
|
|
1921
1984
|
document.getElementById(portalId)
|
|
1922
1985
|
);
|
|
1923
1986
|
};
|
|
@@ -2116,7 +2179,8 @@ const LightboxComponent = {
|
|
|
2116
2179
|
type: "number",
|
|
2117
2180
|
label: "H",
|
|
2118
2181
|
display: {
|
|
2119
|
-
type: "numeric-input"
|
|
2182
|
+
type: "numeric-input",
|
|
2183
|
+
visible: true
|
|
2120
2184
|
}
|
|
2121
2185
|
},
|
|
2122
2186
|
width: {
|
|
@@ -2496,7 +2560,7 @@ const LightboxComponent = {
|
|
|
2496
2560
|
value: "vert"
|
|
2497
2561
|
},
|
|
2498
2562
|
then: {
|
|
2499
|
-
name: "properties.lightboxBlock.properties.thumbnail.properties.
|
|
2563
|
+
name: "properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",
|
|
2500
2564
|
value: "vertical"
|
|
2501
2565
|
}
|
|
2502
2566
|
},
|