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