@cntrl-site/components 0.1.10-alpha.1 → 0.1.10-alpha.4

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
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
4
+ const react = require("react");
5
5
  const reactSplide = require("@splidejs/react-splide");
6
6
  const cn = require("classnames");
7
7
  const reactDom = require("react-dom");
8
- const wrapper$1 = "ControlSlider-module__wrapper___sHEkd";
8
+ const wrapper = "ControlSlider-module__wrapper___sHEkd";
9
9
  const hoverArrow = "ControlSlider-module__hoverArrow___A-dOH";
10
10
  const sliderItem = "ControlSlider-module__sliderItem___QQSkR";
11
11
  const sliderImage = "ControlSlider-module__sliderImage___9hRl-";
12
- const arrow$2 = "ControlSlider-module__arrow___05ghY";
12
+ const arrow$1 = "ControlSlider-module__arrow___05ghY";
13
13
  const arrowVertical$1 = "ControlSlider-module__arrowVertical___tBfVN";
14
- const nextArrow$2 = "ControlSlider-module__nextArrow___-30Yc";
15
- const arrowInner$2 = "ControlSlider-module__arrowInner___aEra3";
14
+ const nextArrow$1 = "ControlSlider-module__nextArrow___-30Yc";
15
+ const arrowInner$1 = "ControlSlider-module__arrowInner___aEra3";
16
16
  const arrowIcon$1 = "ControlSlider-module__arrowIcon___S4ztF";
17
- const arrowImg$2 = "ControlSlider-module__arrowImg___2dwJW";
18
- const mirror$2 = "ControlSlider-module__mirror___brd6U";
17
+ const arrowImg$1 = "ControlSlider-module__arrowImg___2dwJW";
18
+ const mirror$1 = "ControlSlider-module__mirror___brd6U";
19
19
  const pagination = "ControlSlider-module__pagination___bicLF";
20
20
  const paginationInner = "ControlSlider-module__paginationInner___bT-P-";
21
21
  const paginationVertical = "ControlSlider-module__paginationVertical___zYqKw";
@@ -47,19 +47,19 @@ const bottomCenterAlignment = "ControlSlider-module__bottomCenterAlignment___c54
47
47
  const bottomRightAlignment = "ControlSlider-module__bottomRightAlignment___kEwrz";
48
48
  const clickOverlay = "ControlSlider-module__clickOverlay___DZA28";
49
49
  const contain$1 = "ControlSlider-module__contain___pLyq7";
50
- const cover$2 = "ControlSlider-module__cover___KdDat";
50
+ const cover$1 = "ControlSlider-module__cover___KdDat";
51
51
  const styles$3 = {
52
- wrapper: wrapper$1,
52
+ wrapper,
53
53
  hoverArrow,
54
54
  sliderItem,
55
55
  sliderImage,
56
- arrow: arrow$2,
56
+ arrow: arrow$1,
57
57
  arrowVertical: arrowVertical$1,
58
- nextArrow: nextArrow$2,
59
- arrowInner: arrowInner$2,
58
+ nextArrow: nextArrow$1,
59
+ arrowInner: arrowInner$1,
60
60
  arrowIcon: arrowIcon$1,
61
- arrowImg: arrowImg$2,
62
- mirror: mirror$2,
61
+ arrowImg: arrowImg$1,
62
+ mirror: mirror$1,
63
63
  pagination,
64
64
  paginationInner,
65
65
  paginationVertical,
@@ -91,7 +91,7 @@ const styles$3 = {
91
91
  bottomRightAlignment,
92
92
  clickOverlay,
93
93
  contain: contain$1,
94
- cover: cover$2
94
+ cover: cover$1
95
95
  };
96
96
  const link$1 = "RichTextRenderer-module__link___BWeZ2";
97
97
  const styles$2 = {
@@ -135,8 +135,8 @@ const styles$1 = {
135
135
  img
136
136
  };
137
137
  const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = "" }) => {
138
- const [supportsMask, setSupportsMask] = React.useState(true);
139
- React.useEffect(() => {
138
+ const [supportsMask, setSupportsMask] = react.useState(true);
139
+ react.useEffect(() => {
140
140
  if (typeof window !== "undefined" && window.CSS) {
141
141
  const supported = CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")');
142
142
  setSupportsMask(supported);
@@ -170,21 +170,21 @@ const alignmentClassName = {
170
170
  "bottom-right": styles$3.bottomRightAlignment
171
171
  };
172
172
  function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
173
- const [sliderRef, setSliderRef] = React.useState(null);
173
+ const [sliderRef, setSliderRef] = react.useState(null);
174
174
  const { widthSettings, fontSettings, letterSpacing, textAlign, wordSpacing, fontSizeLineHeight, textAppearance, color } = sliderStyles.caption;
175
- const [sliderDimensions, setSliderDimensions] = React.useState(void 0);
176
- const [wrapperRef, setWrapperRef] = React.useState(null);
177
- const [currentSlideIndex, setCurrentSlideIndex] = React.useState(0);
178
- const [key, setKey] = React.useState(0);
175
+ const [sliderDimensions, setSliderDimensions] = react.useState(void 0);
176
+ const [wrapperRef, setWrapperRef] = react.useState(null);
177
+ const [currentSlideIndex, setCurrentSlideIndex] = react.useState(0);
178
+ const [key, setKey] = react.useState(0);
179
179
  const { direction, transition, controls, pagination: pagination2, caption: caption2, triggers } = settings;
180
- const prevSliderTypeRef = React.useRef(transition.type);
180
+ const prevSliderTypeRef = react.useRef(transition.type);
181
181
  const { x: controlsOffsetX, y: controlsOffsetY } = settings.controls.offset;
182
182
  const handleArrowClick = (dir) => {
183
183
  if (sliderRef) {
184
184
  sliderRef.go(dir);
185
185
  }
186
186
  };
187
- React.useEffect(() => {
187
+ react.useEffect(() => {
188
188
  if (!wrapperRef) return;
189
189
  const observer = new ResizeObserver((entries) => {
190
190
  if (!sliderRef) return;
@@ -197,7 +197,7 @@ function ControlSlider({ settings, content, styles: sliderStyles, isEditor }) {
197
197
  observer.observe(wrapperRef);
198
198
  return () => observer.unobserve(wrapperRef);
199
199
  }, [wrapperRef]);
200
- React.useEffect(() => {
200
+ react.useEffect(() => {
201
201
  if (!sliderRef || prevSliderTypeRef.current === transition.type) return;
202
202
  setKey((prev) => prev + 1);
203
203
  prevSliderTypeRef.current = transition.type;
@@ -1102,19 +1102,19 @@ async function calculateImageWidthHeight(imgUrl, sizeType, customWidth, randomRa
1102
1102
  return { width, height, finalWidth: `${width}px` };
1103
1103
  }
1104
1104
  function ImageRevealSlider({ settings, content, isEditor }) {
1105
- const [divRef, setDivRef] = React.useState(null);
1106
- const [placedImages, setPlacedImages] = React.useState([]);
1107
- const [counter, setCounter] = React.useState(0);
1108
- const imageIdCounter = React.useRef(0);
1109
- const [cursorCenter, setCursorCenter] = React.useState({ x: 0, y: 0 });
1110
- const [cursorScale, setCursorScale] = React.useState(1);
1111
- const [customCursorImg, setCustomCursorImg] = React.useState("none");
1112
- const lastMousePos = React.useRef({ x: 0, y: 0 });
1113
- const [isInside, setIsInside] = React.useState(false);
1105
+ const [divRef, setDivRef] = react.useState(null);
1106
+ const [placedImages, setPlacedImages] = react.useState([]);
1107
+ const [counter, setCounter] = react.useState(0);
1108
+ const imageIdCounter = react.useRef(0);
1109
+ const [cursorCenter, setCursorCenter] = react.useState({ x: 0, y: 0 });
1110
+ const [cursorScale, setCursorScale] = react.useState(1);
1111
+ const [customCursorImg, setCustomCursorImg] = react.useState("none");
1112
+ const lastMousePos = react.useRef({ x: 0, y: 0 });
1113
+ const [isInside, setIsInside] = react.useState(false);
1114
1114
  const { sizeType, imageWidth: customWidth, randomRangeImageWidth: randomRange } = settings.imageSize;
1115
1115
  const { revealPosition, visible } = settings.position;
1116
1116
  const { cursorType, target, defaultCursorScale, defaultCursor, hoverCursorScale, hoverCursor } = settings.cursor;
1117
- React.useEffect(() => {
1117
+ react.useEffect(() => {
1118
1118
  if (!divRef) return;
1119
1119
  const updateCursorPosition = (clientX, clientY) => {
1120
1120
  const rect = divRef.getBoundingClientRect();
@@ -1165,7 +1165,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1165
1165
  defaultCursorScale,
1166
1166
  placedImages
1167
1167
  ]);
1168
- React.useEffect(() => {
1168
+ react.useEffect(() => {
1169
1169
  if (!isInside) {
1170
1170
  setCustomCursorImg("none");
1171
1171
  setCursorScale(0);
@@ -1198,7 +1198,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1198
1198
  width: finalWidth
1199
1199
  };
1200
1200
  };
1201
- React.useEffect(() => {
1201
+ react.useEffect(() => {
1202
1202
  if (!divRef || content.length === 0) return;
1203
1203
  const rect = divRef.getBoundingClientRect();
1204
1204
  const containerWidth = rect.width;
@@ -1213,7 +1213,7 @@ function ImageRevealSlider({ settings, content, isEditor }) {
1213
1213
  };
1214
1214
  placeImages();
1215
1215
  }, [sizeType, customWidth, randomRange, revealPosition, divRef]);
1216
- React.useEffect(() => {
1216
+ react.useEffect(() => {
1217
1217
  if (visible === "last One") {
1218
1218
  setPlacedImages((prev) => prev.length > 0 ? [prev[prev.length - 1]] : []);
1219
1219
  }
@@ -1617,6 +1617,7 @@ const ControlImageRevealSliderComponent = {
1617
1617
  }
1618
1618
  }
1619
1619
  };
1620
+ const hidden = "LightBox-module__hidden___9s-9x";
1620
1621
  const heroImage = "LightBox-module__heroImage___sTxNF";
1621
1622
  const background = "LightBox-module__background___rm9ml";
1622
1623
  const editor = "LightBox-module__editor___4ACaY";
@@ -1624,16 +1625,18 @@ const contentStyle = "LightBox-module__contentStyle___Bgnsq";
1624
1625
  const imageStyle = "LightBox-module__imageStyle___tLIlB";
1625
1626
  const imgWrapper = "LightBox-module__imgWrapper___LuFUp";
1626
1627
  const contain = "LightBox-module__contain___8-yaS";
1627
- const cover$1 = "LightBox-module__cover___hNvOG";
1628
- const caption$1 = "LightBox-module__caption___b6L2I";
1628
+ const cover = "LightBox-module__cover___hNvOG";
1629
+ const caption = "LightBox-module__caption___b6L2I";
1629
1630
  const captionTextInner = "LightBox-module__captionTextInner___rCGNH";
1630
1631
  const lightboxSplide = "LightBox-module__lightboxSplide___XFuWC";
1631
- const arrow$1 = "LightBox-module__arrow___iz38X";
1632
+ const arrow = "LightBox-module__arrow___iz38X";
1632
1633
  const arrowVertical = "LightBox-module__arrowVertical___Zfz81";
1633
- const nextArrow$1 = "LightBox-module__nextArrow___zkAQN";
1634
- const arrowInner$1 = "LightBox-module__arrowInner___p48sW";
1635
- const arrowImg$1 = "LightBox-module__arrowImg___pNV88";
1636
- const mirror$1 = "LightBox-module__mirror___pjeXc";
1634
+ const nextArrow = "LightBox-module__nextArrow___zkAQN";
1635
+ const arrowInner = "LightBox-module__arrowInner___p48sW";
1636
+ const arrowIcon = "LightBox-module__arrowIcon___3VaFf";
1637
+ const arrowImg = "LightBox-module__arrowImg___pNV88";
1638
+ const mirror = "LightBox-module__mirror___pjeXc";
1639
+ const thumbsWrapper = "LightBox-module__thumbsWrapper___GB-nU";
1637
1640
  const thumbsContainerVertical = "LightBox-module__thumbsContainerVertical___wttk5";
1638
1641
  const thumbsContainer = "LightBox-module__thumbsContainer___osSma";
1639
1642
  const thumbsAlignStart = "LightBox-module__thumbsAlignStart___MO6tY";
@@ -1652,7 +1655,8 @@ const slideOutRight = "LightBox-module__slideOutRight___SK7eC";
1652
1655
  const slideOutTop = "LightBox-module__slideOutTop___Vgg0z";
1653
1656
  const slideOutBottom = "LightBox-module__slideOutBottom___nJ0Ef";
1654
1657
  const scaleSlide = "LightBox-module__scaleSlide___vZriG";
1655
- const classes$1 = {
1658
+ const classes = {
1659
+ hidden,
1656
1660
  heroImage,
1657
1661
  background,
1658
1662
  editor,
@@ -1660,16 +1664,18 @@ const classes$1 = {
1660
1664
  imageStyle,
1661
1665
  imgWrapper,
1662
1666
  contain,
1663
- cover: cover$1,
1664
- caption: caption$1,
1667
+ cover,
1668
+ caption,
1665
1669
  captionTextInner,
1666
1670
  lightboxSplide,
1667
- arrow: arrow$1,
1671
+ arrow,
1668
1672
  arrowVertical,
1669
- nextArrow: nextArrow$1,
1670
- arrowInner: arrowInner$1,
1671
- arrowImg: arrowImg$1,
1672
- mirror: mirror$1,
1673
+ nextArrow,
1674
+ arrowInner,
1675
+ arrowIcon,
1676
+ arrowImg,
1677
+ mirror,
1678
+ thumbsWrapper,
1673
1679
  thumbsContainerVertical,
1674
1680
  thumbsContainer,
1675
1681
  thumbsAlignStart,
@@ -1725,8 +1731,13 @@ const getPositionStyles = (position, offset, isEditor) => {
1725
1731
  };
1726
1732
  function getDisplayedImageRect(img2) {
1727
1733
  const container = img2.getBoundingClientRect();
1728
- const containerW = container.width;
1729
- const containerH = container.height;
1734
+ const style = window.getComputedStyle(img2);
1735
+ const paddingTop = parseFloat(style.paddingTop) || 0;
1736
+ const paddingRight = parseFloat(style.paddingRight) || 0;
1737
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
1738
+ const paddingLeft = parseFloat(style.paddingLeft) || 0;
1739
+ const containerW = Math.max(0, container.width - paddingLeft - paddingRight);
1740
+ const containerH = Math.max(0, container.height - paddingTop - paddingBottom);
1730
1741
  const imgW = img2.naturalWidth;
1731
1742
  const imgH = img2.naturalHeight;
1732
1743
  const containerRatio = containerW / containerH;
@@ -1739,8 +1750,10 @@ function getDisplayedImageRect(img2) {
1739
1750
  renderedH = containerH;
1740
1751
  renderedW = containerH * imgRatio;
1741
1752
  }
1742
- const offsetX = (containerW - renderedW) / 2 + container.left;
1743
- const offsetY = (containerH - renderedH) / 2 + container.top;
1753
+ const contentLeft = container.left + paddingLeft;
1754
+ const contentTop = container.top + paddingTop;
1755
+ const offsetX = (containerW - renderedW) / 2 + contentLeft;
1756
+ const offsetY = (containerH - renderedH) / 2 + contentTop;
1744
1757
  return {
1745
1758
  x: offsetX,
1746
1759
  y: offsetY,
@@ -1769,83 +1782,83 @@ function getColorAlpha(color) {
1769
1782
  }
1770
1783
  function getAnimationClasses(type, direction) {
1771
1784
  const appearClass = (() => {
1772
- if (type === "fade in") return classes$1.fadeIn;
1785
+ if (type === "fade in") return classes.fadeIn;
1773
1786
  if (type === "slide in" || type === "mix") {
1774
1787
  switch (direction) {
1775
1788
  case "left":
1776
- return classes$1.slideInLeft;
1789
+ return classes.slideInLeft;
1777
1790
  case "right":
1778
- return classes$1.slideInRight;
1791
+ return classes.slideInRight;
1779
1792
  case "top":
1780
- return classes$1.slideInTop;
1793
+ return classes.slideInTop;
1781
1794
  case "bottom":
1782
- return classes$1.slideInBottom;
1795
+ return classes.slideInBottom;
1783
1796
  default:
1784
- return classes$1.slideInRight;
1797
+ return classes.slideInRight;
1785
1798
  }
1786
1799
  }
1787
- return classes$1.fadeIn;
1800
+ return classes.fadeIn;
1788
1801
  })();
1789
1802
  const backdropAppearClass = (() => {
1790
- if (type === "fade in" || type === "mix") return classes$1.fadeIn;
1803
+ if (type === "fade in" || type === "mix") return classes.fadeIn;
1791
1804
  if (type === "slide in") {
1792
1805
  switch (direction) {
1793
1806
  case "left":
1794
- return classes$1.slideInLeft;
1807
+ return classes.slideInLeft;
1795
1808
  case "right":
1796
- return classes$1.slideInRight;
1809
+ return classes.slideInRight;
1797
1810
  case "top":
1798
- return classes$1.slideInTop;
1811
+ return classes.slideInTop;
1799
1812
  case "bottom":
1800
- return classes$1.slideInBottom;
1813
+ return classes.slideInBottom;
1801
1814
  default:
1802
- return classes$1.slideInRight;
1815
+ return classes.slideInRight;
1803
1816
  }
1804
1817
  }
1805
- return classes$1.fadeIn;
1818
+ return classes.fadeIn;
1806
1819
  })();
1807
1820
  const backdropDisappearClass = (() => {
1808
- if (type === "fade in" || type === "mix") return classes$1.fadeOut;
1821
+ if (type === "fade in" || type === "mix") return classes.fadeOut;
1809
1822
  if (type === "slide in") {
1810
1823
  switch (direction) {
1811
1824
  case "left":
1812
- return classes$1.slideOutLeft;
1825
+ return classes.slideOutLeft;
1813
1826
  case "right":
1814
- return classes$1.slideOutRight;
1827
+ return classes.slideOutRight;
1815
1828
  case "top":
1816
- return classes$1.slideOutTop;
1829
+ return classes.slideOutTop;
1817
1830
  case "bottom":
1818
- return classes$1.slideOutBottom;
1831
+ return classes.slideOutBottom;
1819
1832
  default:
1820
- return classes$1.slideOutRight;
1833
+ return classes.slideOutRight;
1821
1834
  }
1822
1835
  }
1823
- return classes$1.fadeOut;
1836
+ return classes.fadeOut;
1824
1837
  })();
1825
1838
  const disappearClass = (() => {
1826
- if (type === "fade in") return classes$1.fadeOut;
1839
+ if (type === "fade in") return classes.fadeOut;
1827
1840
  if (type === "slide in" || type === "mix") {
1828
1841
  switch (direction) {
1829
1842
  case "left":
1830
- return classes$1.slideOutLeft;
1843
+ return classes.slideOutLeft;
1831
1844
  case "right":
1832
- return classes$1.slideOutRight;
1845
+ return classes.slideOutRight;
1833
1846
  case "top":
1834
- return classes$1.slideOutTop;
1847
+ return classes.slideOutTop;
1835
1848
  case "bottom":
1836
- return classes$1.slideOutBottom;
1849
+ return classes.slideOutBottom;
1837
1850
  default:
1838
- return classes$1.slideOutRight;
1851
+ return classes.slideOutRight;
1839
1852
  }
1840
1853
  }
1841
- return classes$1.fadeOut;
1854
+ return classes.fadeOut;
1842
1855
  })();
1843
1856
  return { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass };
1844
1857
  }
1845
1858
  const LightboxGallery = ({ settings, content, styles: styles2, portalId, activeEvent, isEditor }) => {
1846
- const [open, setOpen] = React.useState(false);
1859
+ const [open, setOpen] = react.useState(false);
1847
1860
  const { url } = settings.thumbnailBlock.cover;
1848
- React.useEffect(() => {
1861
+ react.useEffect(() => {
1849
1862
  if (activeEvent === "close") {
1850
1863
  setOpen(false);
1851
1864
  }
@@ -1859,7 +1872,7 @@ const LightboxGallery = ({ settings, content, styles: styles2, portalId, activeE
1859
1872
  {
1860
1873
  src: url,
1861
1874
  alt: "Cover",
1862
- className: classes$1.heroImage,
1875
+ className: classes.heroImage,
1863
1876
  onClick: () => setOpen(true)
1864
1877
  }
1865
1878
  ),
@@ -1878,22 +1891,22 @@ const LightboxGallery = ({ settings, content, styles: styles2, portalId, activeE
1878
1891
  ] });
1879
1892
  };
1880
1893
  const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId, isEditor }) => {
1881
- const [currentIndex, setCurrentIndex] = React.useState(0);
1882
- const [splideKey, setSplideKey] = React.useState(0);
1883
- const [isClosing, setIsClosing] = React.useState(false);
1884
- const [animationFinished, setAnimationFinished] = React.useState(false);
1885
- const [thumbnailDimensions, setThumbnailDimensions] = React.useState({});
1886
- const lightboxRef = React.useRef(null);
1887
- const prevSliderTypeRef = React.useRef(null);
1888
- const imageRef = React.useRef(null);
1889
- const isClosingRef = React.useRef(false);
1890
- const animationTargetRef = React.useRef(null);
1891
- const animationEndHandlerRef = React.useRef(null);
1892
- const appearAnimationEndHandlerRef = React.useRef(null);
1894
+ const [currentIndex, setCurrentIndex] = react.useState(0);
1895
+ const [splideKey, setSplideKey] = react.useState(0);
1896
+ const [isClosing, setIsClosing] = react.useState(false);
1897
+ const [animationFinished, setAnimationFinished] = react.useState(false);
1898
+ const [thumbnailDimensions, setThumbnailDimensions] = react.useState({});
1899
+ const lightboxRef = react.useRef(null);
1900
+ const prevSliderTypeRef = react.useRef(null);
1901
+ const imageRef = react.useRef(null);
1902
+ const isClosingRef = react.useRef(false);
1903
+ const animationTargetRef = react.useRef(null);
1904
+ const animationEndHandlerRef = react.useRef(null);
1905
+ const appearAnimationEndHandlerRef = react.useRef(null);
1893
1906
  const { appear, triggers, slider, thumbnail, controls, area, caption: caption2, layout } = settings.lightboxBlock;
1894
1907
  const { widthSettings, fontSettings, letterSpacing, textAlign, wordSpacing, fontSizeLineHeight, textAppearance, color } = lightboxStyles.caption;
1895
1908
  const { appearClass, backdropAppearClass, backdropDisappearClass, disappearClass } = getAnimationClasses(appear.type, appear.direction);
1896
- React.useEffect(() => {
1909
+ react.useEffect(() => {
1897
1910
  const handleLayoutChange = () => {
1898
1911
  setTimeout(() => {
1899
1912
  var _a, _b;
@@ -1910,7 +1923,7 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
1910
1923
  window.removeEventListener("ArticleEditor.ComponentContent:change", handleComponentContentChange);
1911
1924
  };
1912
1925
  }, []);
1913
- const handleClose = React.useCallback(() => {
1926
+ const handleClose = react.useCallback(() => {
1914
1927
  const isMobile = window.matchMedia("(max-width: 768px)").matches;
1915
1928
  const colorAlpha = getColorAlpha(area.color);
1916
1929
  if (isMobile && !isEditor && colorAlpha > 0.9) {
@@ -1957,6 +1970,19 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
1957
1970
  (_b = lightboxRef.current) == null ? void 0 : _b.go(dir);
1958
1971
  }
1959
1972
  };
1973
+ const isClickInImagePadding = (img2, clientX, clientY) => {
1974
+ const rect = img2.getBoundingClientRect();
1975
+ const style = window.getComputedStyle(img2);
1976
+ const paddingTop = parseFloat(style.paddingTop) || 0;
1977
+ const paddingRight = parseFloat(style.paddingRight) || 0;
1978
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
1979
+ const paddingLeft = parseFloat(style.paddingLeft) || 0;
1980
+ const contentLeft = rect.left + paddingLeft;
1981
+ const contentRight = rect.right - paddingRight;
1982
+ const contentTop = rect.top + paddingTop;
1983
+ const contentBottom = rect.bottom - paddingBottom;
1984
+ return clientX < contentLeft || clientX > contentRight || clientY < contentTop || clientY > contentBottom;
1985
+ };
1960
1986
  const handleImageWrapperClick = (e) => {
1961
1987
  const currentImage = content[currentIndex];
1962
1988
  const isCover = (currentImage == null ? void 0 : currentImage.image.objectFit) === "cover";
@@ -1974,7 +2000,16 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
1974
2000
  let inside;
1975
2001
  if (isCover && imageRef.current) {
1976
2002
  const imgRect = imageRef.current.getBoundingClientRect();
1977
- inside = clientX >= imgRect.left && clientX <= imgRect.right && clientY >= imgRect.top && clientY <= imgRect.bottom;
2003
+ const style = window.getComputedStyle(imageRef.current);
2004
+ const paddingTop = parseFloat(style.paddingTop) || 0;
2005
+ const paddingRight = parseFloat(style.paddingRight) || 0;
2006
+ const paddingBottom = parseFloat(style.paddingBottom) || 0;
2007
+ const paddingLeft = parseFloat(style.paddingLeft) || 0;
2008
+ const contentLeft = imgRect.left + paddingLeft;
2009
+ const contentRight = imgRect.right - paddingRight;
2010
+ const contentTop = imgRect.top + paddingTop;
2011
+ const contentBottom = imgRect.bottom - paddingBottom;
2012
+ inside = clientX >= contentLeft && clientX <= contentRight && clientY >= contentTop && clientY <= contentBottom;
1978
2013
  } else {
1979
2014
  const rect = imageRef.current ? getDisplayedImageRect(imageRef.current) : null;
1980
2015
  if (!rect) {
@@ -1991,9 +2026,13 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
1991
2026
  };
1992
2027
  const onImageClick = (e) => {
1993
2028
  e.stopPropagation();
2029
+ if (isClickInImagePadding(e.currentTarget, e.clientX, e.clientY)) {
2030
+ handleClose();
2031
+ return;
2032
+ }
1994
2033
  handleTriggerClick(e.currentTarget, e.clientX, e.clientY);
1995
2034
  };
1996
- React.useEffect(() => {
2035
+ react.useEffect(() => {
1997
2036
  if (!isOpen) return;
1998
2037
  const onKeyDown = (event) => {
1999
2038
  var _a, _b;
@@ -2016,9 +2055,10 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2016
2055
  window.removeEventListener("keydown", onKeyDown);
2017
2056
  };
2018
2057
  }, [isOpen, handleClose, content.length]);
2019
- React.useEffect(() => {
2058
+ react.useEffect(() => {
2020
2059
  if (isOpen) {
2021
2060
  setCurrentIndex(0);
2061
+ setSplideKey((prev) => prev + 1);
2022
2062
  isClosingRef.current = false;
2023
2063
  setIsClosing(false);
2024
2064
  setAnimationFinished(false);
@@ -2032,13 +2072,13 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2032
2072
  setAnimationFinished(false);
2033
2073
  };
2034
2074
  }, [isOpen]);
2035
- React.useEffect(() => {
2075
+ react.useEffect(() => {
2036
2076
  if (prevSliderTypeRef.current !== null && prevSliderTypeRef.current !== slider.type) {
2037
2077
  setSplideKey((prev) => prev + 1);
2038
2078
  }
2039
2079
  prevSliderTypeRef.current = slider.type;
2040
2080
  }, [slider.type]);
2041
- React.useEffect(() => {
2081
+ react.useEffect(() => {
2042
2082
  if (!isOpen) return;
2043
2083
  const originalOverflow = document.body.style.overflow;
2044
2084
  const isMobile = window.matchMedia("(max-width: 768px)").matches;
@@ -2073,7 +2113,7 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2073
2113
  setAnimationFinished(false);
2074
2114
  };
2075
2115
  }, [isOpen, isEditor, area.color]);
2076
- React.useEffect(() => {
2116
+ react.useEffect(() => {
2077
2117
  if (!isOpen) return;
2078
2118
  const handleTouchEnd = (e) => {
2079
2119
  if (isClosingRef.current) {
@@ -2081,7 +2121,7 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2081
2121
  return;
2082
2122
  }
2083
2123
  const target = e.target;
2084
- if (target && (target.closest(`.${classes$1.thumbsContainer}`) || target.closest(`.${classes$1.thumbItem}`))) {
2124
+ if (target && (target.closest(`.${classes.thumbsContainer}`) || target.closest(`.${classes.thumbItem}`))) {
2085
2125
  return;
2086
2126
  }
2087
2127
  if (e.touches.length === 0 && e.changedTouches.length > 0) {
@@ -2122,14 +2162,14 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2122
2162
  animationTimingFunction: "ease",
2123
2163
  animationFillMode: "both"
2124
2164
  };
2125
- if (!isOpen && !isClosing) return null;
2165
+ if (!document.getElementById(portalId)) return null;
2126
2166
  return reactDom.createPortal(
2127
2167
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2128
2168
  /* @__PURE__ */ jsxRuntime.jsx(
2129
2169
  "div",
2130
2170
  {
2131
2171
  ref: !isEditor ? animationTargetRef : null,
2132
- className: cn(classes$1.background, isClosing ? backdropDisappearClass : backdropAppearClass, { [classes$1.editor]: isEditor }),
2172
+ className: cn(classes.background, isClosing ? backdropDisappearClass : backdropAppearClass, { [classes.editor]: isEditor }, { [classes.hidden]: !isOpen }),
2133
2173
  style: {
2134
2174
  ...backdropStyles,
2135
2175
  ...animationFinished && !isEditor && !isClosing ? { position: "absolute" } : {}
@@ -2140,7 +2180,7 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2140
2180
  "div",
2141
2181
  {
2142
2182
  ref: isEditor ? animationTargetRef : null,
2143
- className: cn(classes$1.contentStyle, !isClosing ? appearClass : disappearClass, { [classes$1.editor]: isEditor }),
2183
+ className: cn(classes.contentStyle, !isClosing ? appearClass : disappearClass, { [classes.editor]: isEditor }, { [classes.hidden]: !isOpen }),
2144
2184
  style: {
2145
2185
  animationDuration: `${parseInt(appear.duration)}ms`,
2146
2186
  animationTimingFunction: "ease",
@@ -2152,7 +2192,7 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2152
2192
  {
2153
2193
  onMove: (splide) => setCurrentIndex(splide.index),
2154
2194
  ref: lightboxRef,
2155
- className: classes$1.lightboxSplide,
2195
+ className: classes.lightboxSplide,
2156
2196
  options: {
2157
2197
  arrows: false,
2158
2198
  speed: slider.duration ? parseInt(slider.duration) : 500,
@@ -2164,7 +2204,8 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2164
2204
  height: "100%",
2165
2205
  type: slider.type === "fade" || slider.type === "scale" ? "fade" : "loop",
2166
2206
  padding: 0,
2167
- rewind: (slider.type === "scale" || slider.type === "fade") && triggers.repeat === "loop"
2207
+ rewind: (slider.type === "scale" || slider.type === "fade") && triggers.repeat === "loop",
2208
+ start: 0
2168
2209
  },
2169
2210
  style: { "--splide-speed": slider.duration },
2170
2211
  children: content.map((item, index) => {
@@ -2180,14 +2221,14 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2180
2221
  "--position-transform": transform || "none"
2181
2222
  };
2182
2223
  })() : { ...positionStyles, position: "absolute", padding, boxSizing: "border-box" };
2183
- return /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes$1.imgWrapper, onClick: handleImageWrapperClick, children: /* @__PURE__ */ jsxRuntime.jsx(
2224
+ return /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.imgWrapper, onClick: handleImageWrapperClick, children: /* @__PURE__ */ jsxRuntime.jsx(
2184
2225
  "img",
2185
2226
  {
2186
2227
  ref: index === currentIndex ? imageRef : null,
2187
- className: cn(classes$1.imageStyle, {
2188
- [classes$1.contain]: item.image.objectFit === "contain",
2189
- [classes$1.cover]: item.image.objectFit === "cover",
2190
- [classes$1.scaleSlide]: slider.type === "scale"
2228
+ className: cn(classes.imageStyle, {
2229
+ [classes.contain]: item.image.objectFit === "contain",
2230
+ [classes.cover]: item.image.objectFit === "cover",
2231
+ [classes.scaleSlide]: slider.type === "scale"
2191
2232
  }),
2192
2233
  onClick: item.image.objectFit !== "contain" ? onImageClick : void 0,
2193
2234
  src: item.image.url,
@@ -2199,31 +2240,34 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2199
2240
  },
2200
2241
  splideKey
2201
2242
  ),
2202
- controls.isActive && controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2243
+ controls.isActive && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2203
2244
  /* @__PURE__ */ jsxRuntime.jsx(
2204
2245
  "div",
2205
2246
  {
2206
- className: cn(classes$1.arrow, { [classes$1.arrowVertical]: slider.direction === "vert" }),
2247
+ className: cn(classes.arrow, { [classes.arrowVertical]: slider.direction === "vert" }),
2207
2248
  style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
2208
- children: /* @__PURE__ */ jsxRuntime.jsx(
2249
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2209
2250
  "button",
2210
2251
  {
2211
- className: classes$1.arrowInner,
2252
+ className: classes.arrowInner,
2212
2253
  style: { transform: `translate(${scalingValue(controls.offset.x, isEditor)}, ${scalingValue(controls.offset.y * (slider.direction === "horiz" ? 1 : -1), isEditor)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})` },
2213
2254
  onClick: () => {
2214
2255
  var _a;
2215
2256
  return (_a = lightboxRef.current) == null ? void 0 : _a.go("-1");
2216
2257
  },
2217
2258
  "aria-label": "Previous",
2218
- children: controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
2219
- SvgImage,
2220
- {
2221
- url: controls.arrowsImgUrl,
2222
- fill: controls.color,
2223
- hoverFill: controls.hover,
2224
- className: cn(classes$1.arrowImg, classes$1.mirror)
2225
- }
2226
- )
2259
+ children: [
2260
+ controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
2261
+ SvgImage,
2262
+ {
2263
+ url: controls.arrowsImgUrl,
2264
+ fill: controls.color,
2265
+ hoverFill: controls.hover,
2266
+ className: cn(classes.arrowImg, classes.mirror)
2267
+ }
2268
+ ),
2269
+ !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon, { color: controls.color, className: cn(classes.arrowIcon, classes.arrowImg, classes.mirror) })
2270
+ ]
2227
2271
  }
2228
2272
  )
2229
2273
  }
@@ -2231,27 +2275,30 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2231
2275
  /* @__PURE__ */ jsxRuntime.jsx(
2232
2276
  "div",
2233
2277
  {
2234
- className: cn(classes$1.arrow, classes$1.nextArrow, { [classes$1.arrowVertical]: slider.direction === "vert" }),
2278
+ className: cn(classes.arrow, classes.nextArrow, { [classes.arrowVertical]: slider.direction === "vert" }),
2235
2279
  style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
2236
- children: /* @__PURE__ */ jsxRuntime.jsx(
2280
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2237
2281
  "button",
2238
2282
  {
2239
- className: classes$1.arrowInner,
2283
+ className: classes.arrowInner,
2240
2284
  style: { transform: `translate(${scalingValue(controls.offset.x * (slider.direction === "horiz" ? -1 : 1), isEditor)}, ${scalingValue(controls.offset.y, isEditor)}) scale(${controls.scale}) rotate(${slider.direction === "horiz" ? "0deg" : "90deg"})` },
2241
2285
  onClick: () => {
2242
2286
  var _a;
2243
2287
  return (_a = lightboxRef.current) == null ? void 0 : _a.go("+1");
2244
2288
  },
2245
2289
  "aria-label": "Next",
2246
- children: controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
2247
- SvgImage,
2248
- {
2249
- url: controls.arrowsImgUrl,
2250
- fill: controls.color,
2251
- hoverFill: controls.hover,
2252
- className: classes$1.arrowImg
2253
- }
2254
- )
2290
+ children: [
2291
+ controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
2292
+ SvgImage,
2293
+ {
2294
+ url: controls.arrowsImgUrl,
2295
+ fill: controls.color,
2296
+ hoverFill: controls.hover,
2297
+ className: classes.arrowImg
2298
+ }
2299
+ ),
2300
+ !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon, { color: controls.color, className: cn(classes.arrowIcon, classes.arrowImg) })
2301
+ ]
2255
2302
  }
2256
2303
  )
2257
2304
  }
@@ -2261,12 +2308,12 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2261
2308
  const positionStyles = getPositionStyles(area.closeIconAlign, area.closeIconOffset, isEditor);
2262
2309
  const scaleTransform = `scale(${area.closeIconScale})`;
2263
2310
  const combinedTransform = positionStyles.transform ? `${positionStyles.transform} ${scaleTransform}` : scaleTransform;
2264
- return /* @__PURE__ */ jsxRuntime.jsx("button", { className: classes$1.closeButton, style: { ...positionStyles, transform: combinedTransform }, onClick: handleClose, "aria-label": "Close lightbox", children: /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { url: area.closeIconUrl }) });
2311
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { className: classes.closeButton, style: { ...positionStyles, transform: combinedTransform }, onClick: handleClose, "aria-label": "Close lightbox", children: /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { url: area.closeIconUrl, fill: area.closeIconColor, hoverFill: area.closeIconHover }) });
2265
2312
  })(),
2266
2313
  caption2.isActive && /* @__PURE__ */ jsxRuntime.jsx(
2267
2314
  "div",
2268
2315
  {
2269
- className: classes$1.caption,
2316
+ className: classes.caption,
2270
2317
  style: {
2271
2318
  ...getPositionStyles(caption2.alignment, caption2.offset, isEditor),
2272
2319
  fontFamily: fontSettings.fontFamily,
@@ -2288,103 +2335,133 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2288
2335
  "div",
2289
2336
  {
2290
2337
  "data-styles": "caption",
2291
- className: classes$1.captionTextInner,
2338
+ className: classes.captionTextInner,
2292
2339
  style: { ["--link-hover-color"]: caption2.hover },
2293
2340
  children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: content[currentIndex].imageCaption })
2294
2341
  }
2295
2342
  )
2296
2343
  }
2297
2344
  ),
2298
- thumbnail.isActive && /* @__PURE__ */ jsxRuntime.jsx(
2299
- "div",
2300
- {
2301
- className: cn(classes$1.thumbsContainer, {
2302
- [classes$1.thumbsContainerVertical]: slider.direction === "vert",
2303
- [classes$1.thumbsAlignStart]: thumbnail.align === "start",
2304
- [classes$1.thumbsAlignCenter]: thumbnail.align === "center",
2305
- [classes$1.thumbsAlignEnd]: thumbnail.align === "end"
2306
- }),
2307
- style: {
2308
- position: isEditor ? "absolute" : "fixed",
2309
- gap: scalingValue(thumbnail.grid.gap, isEditor),
2310
- ...getPositionStyles(thumbnail.position, thumbnail.offset, isEditor)
2311
- },
2312
- children: content.map((item, index) => {
2313
- const isActive = index === currentIndex;
2314
- const thumbDims = thumbnailDimensions[index];
2315
- const baseSizeValue = thumbnail.grid.size;
2316
- const activeSizeValue = baseSizeValue * (isActive ? thumbnail.activeState.scale : 1);
2317
- const getFitDimensions = () => {
2318
- if (thumbnail.fit !== "fit" || !thumbDims) return {};
2319
- const aspectRatio = thumbDims.width / thumbDims.height;
2320
- if (slider.direction === "horiz") {
2321
- const heightValue = activeSizeValue;
2322
- const widthValue = heightValue * aspectRatio;
2323
- return {
2324
- width: scalingValue(widthValue, isEditor),
2325
- height: scalingValue(heightValue, isEditor)
2326
- };
2327
- } else {
2328
- const widthValue = activeSizeValue;
2329
- const heightValue = widthValue / aspectRatio;
2330
- return {
2331
- width: scalingValue(widthValue, isEditor),
2332
- height: scalingValue(heightValue, isEditor)
2333
- };
2345
+ thumbnail.isActive && (() => {
2346
+ const [vertical] = thumbnail.position.split("-");
2347
+ const effectivePosition = slider.direction === "horiz" ? `${vertical}-left` : thumbnail.position;
2348
+ const thumbsPositionStyles = getPositionStyles(effectivePosition, thumbnail.offset, isEditor);
2349
+ return /* @__PURE__ */ jsxRuntime.jsx(
2350
+ "div",
2351
+ {
2352
+ className: classes.thumbsWrapper,
2353
+ style: {
2354
+ position: isEditor ? "absolute" : "fixed",
2355
+ ...thumbsPositionStyles,
2356
+ ...slider.direction === "horiz" ? {
2357
+ maxWidth: "100vw",
2358
+ width: "100vw",
2359
+ overflowX: "auto",
2360
+ overflowY: "hidden"
2361
+ } : {
2362
+ maxHeight: "100vh",
2363
+ overflowY: "auto",
2364
+ overflowX: "hidden"
2334
2365
  }
2335
- };
2336
- return /* @__PURE__ */ jsxRuntime.jsx(
2337
- "button",
2366
+ },
2367
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2368
+ "div",
2338
2369
  {
2339
- className: classes$1.thumbItem,
2370
+ className: cn(classes.thumbsContainer, {
2371
+ [classes.thumbsContainerVertical]: slider.direction === "vert",
2372
+ [classes.thumbsAlignStart]: thumbnail.align === "start",
2373
+ [classes.thumbsAlignCenter]: thumbnail.align === "center",
2374
+ [classes.thumbsAlignEnd]: thumbnail.align === "end"
2375
+ }),
2340
2376
  style: {
2341
- ...slider.direction === "horiz" && thumbnail.fit !== "fit" ? { height: scalingValue(activeSizeValue, isEditor) } : {},
2342
- ...slider.direction === "vert" && thumbnail.fit !== "fit" ? { width: scalingValue(activeSizeValue, isEditor) } : {},
2343
- ...thumbnail.fit === "cover" ? { width: scalingValue(activeSizeValue, isEditor), height: scalingValue(activeSizeValue, isEditor) } : {},
2344
- ...thumbnail.fit === "fit" ? getFitDimensions() : {},
2345
- transition: isActive ? "all 0.2s ease" : "none",
2346
- opacity: isActive ? thumbnail.activeState.opacity / 100 : thumbnail.opacity / 100,
2347
- ["--thumb-hover"]: thumbnail.activeState.opacity / 100
2348
- },
2349
- onClick: (e) => {
2350
- var _a;
2351
- e.stopPropagation();
2352
- setCurrentIndex(index);
2353
- (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
2377
+ gap: scalingValue(thumbnail.grid.gap, isEditor)
2354
2378
  },
2355
- onMouseEnter: () => {
2356
- var _a;
2357
- if (thumbnail.triggers === "hov") {
2358
- (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
2359
- }
2360
- },
2361
- children: /* @__PURE__ */ jsxRuntime.jsx(
2362
- "img",
2363
- {
2364
- src: item.image.url,
2365
- alt: item.image.name ?? "",
2366
- onLoad: (e) => {
2367
- const img2 = e.currentTarget;
2368
- if (img2.naturalWidth && img2.naturalHeight) {
2369
- setThumbnailDimensions((prev) => ({
2370
- ...prev,
2371
- [index]: { width: img2.naturalWidth, height: img2.naturalHeight }
2372
- }));
2379
+ children: content.map((item, index) => {
2380
+ const isActive = index === currentIndex;
2381
+ const thumbDims = thumbnailDimensions[index];
2382
+ const baseSizeValue = thumbnail.grid.size;
2383
+ const activeSizeValue = baseSizeValue * (isActive ? thumbnail.activeState.scale : 1);
2384
+ const getFitDimensions = () => {
2385
+ if (thumbnail.fit !== "fit") return {};
2386
+ if (!thumbDims) {
2387
+ if (slider.direction === "horiz") {
2388
+ return { height: scalingValue(activeSizeValue, isEditor) };
2389
+ } else {
2390
+ return { width: scalingValue(activeSizeValue, isEditor) };
2373
2391
  }
2374
- },
2375
- style: {
2376
- objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
2377
- ...thumbnail.fit === "fit" ? { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } : {},
2378
- ...thumbnail.fit === "cover" && slider.direction === "horiz" ? { width: "100%", height: "100%" } : {}
2379
2392
  }
2380
- }
2381
- )
2382
- },
2383
- `${item.image.name}-${index}`
2384
- );
2385
- })
2386
- }
2387
- )
2393
+ const aspectRatio = thumbDims.width / thumbDims.height;
2394
+ if (slider.direction === "horiz") {
2395
+ const heightValue = activeSizeValue;
2396
+ const widthValue = heightValue * aspectRatio;
2397
+ return {
2398
+ width: scalingValue(widthValue, isEditor),
2399
+ height: scalingValue(heightValue, isEditor)
2400
+ };
2401
+ } else {
2402
+ const widthValue = activeSizeValue;
2403
+ const heightValue = widthValue / aspectRatio;
2404
+ return {
2405
+ width: scalingValue(widthValue, isEditor),
2406
+ height: scalingValue(heightValue, isEditor)
2407
+ };
2408
+ }
2409
+ };
2410
+ return /* @__PURE__ */ jsxRuntime.jsx(
2411
+ "button",
2412
+ {
2413
+ className: classes.thumbItem,
2414
+ style: {
2415
+ ...slider.direction === "horiz" && thumbnail.fit !== "fit" ? { height: scalingValue(activeSizeValue, isEditor) } : {},
2416
+ ...slider.direction === "vert" && thumbnail.fit !== "fit" ? { width: scalingValue(activeSizeValue, isEditor) } : {},
2417
+ ...thumbnail.fit === "cover" ? { width: scalingValue(activeSizeValue, isEditor), height: scalingValue(activeSizeValue, isEditor) } : {},
2418
+ ...getFitDimensions(),
2419
+ transition: isActive ? "all 0.2s ease-out" : "none",
2420
+ opacity: isActive ? thumbnail.activeState.opacity / 100 : thumbnail.opacity / 100,
2421
+ ["--thumb-hover"]: thumbnail.activeState.opacity / 100
2422
+ },
2423
+ onClick: (e) => {
2424
+ var _a;
2425
+ e.stopPropagation();
2426
+ setCurrentIndex(index);
2427
+ (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
2428
+ },
2429
+ onMouseEnter: () => {
2430
+ var _a;
2431
+ if (thumbnail.triggers === "hov") {
2432
+ (_a = lightboxRef.current) == null ? void 0 : _a.go(index);
2433
+ }
2434
+ },
2435
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2436
+ "img",
2437
+ {
2438
+ src: item.image.url,
2439
+ alt: item.image.name ?? "",
2440
+ onLoad: (e) => {
2441
+ const img2 = e.currentTarget;
2442
+ if (img2.naturalWidth && img2.naturalHeight) {
2443
+ setThumbnailDimensions((prev) => ({
2444
+ ...prev,
2445
+ [index]: { width: img2.naturalWidth, height: img2.naturalHeight }
2446
+ }));
2447
+ }
2448
+ },
2449
+ style: {
2450
+ objectFit: thumbnail.fit === "cover" ? "cover" : "contain",
2451
+ ...thumbnail.fit === "fit" ? { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } : {},
2452
+ ...thumbnail.fit === "cover" && slider.direction === "horiz" ? { width: "100%", height: "100%" } : {}
2453
+ }
2454
+ }
2455
+ )
2456
+ },
2457
+ `${item.image.name}-${index}`
2458
+ );
2459
+ })
2460
+ }
2461
+ )
2462
+ }
2463
+ );
2464
+ })()
2388
2465
  ]
2389
2466
  }
2390
2467
  )
@@ -2392,6 +2469,9 @@ const Lightbox = ({ isOpen, onClose, content, lightboxStyles, settings, portalId
2392
2469
  document.getElementById(portalId)
2393
2470
  );
2394
2471
  };
2472
+ function ArrowIcon({ color, className }) {
2473
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
2474
+ }
2395
2475
  const LightboxComponent = {
2396
2476
  element: LightboxGallery,
2397
2477
  id: "lightbox",
@@ -2889,6 +2969,22 @@ const LightboxComponent = {
2889
2969
  }
2890
2970
  }
2891
2971
  }
2972
+ },
2973
+ closeIconColor: {
2974
+ title: "Color",
2975
+ type: "string",
2976
+ display: {
2977
+ type: "settings-color-picker",
2978
+ format: "single"
2979
+ }
2980
+ },
2981
+ closeIconHover: {
2982
+ title: "Hover",
2983
+ type: "string",
2984
+ display: {
2985
+ type: "settings-color-picker",
2986
+ format: "single"
2987
+ }
2892
2988
  }
2893
2989
  }
2894
2990
  },
@@ -2997,7 +3093,7 @@ const LightboxComponent = {
2997
3093
  padding: { top: 0.06, right: 0, bottom: 0.06, left: 0 }
2998
3094
  },
2999
3095
  controls: {
3000
- isActive: true,
3096
+ isActive: false,
3001
3097
  arrowsImgUrl: null,
3002
3098
  offset: { x: 0, y: 0 },
3003
3099
  scale: 1,
@@ -3008,6 +3104,8 @@ const LightboxComponent = {
3008
3104
  color: "rgba(28,31,34,0.9)",
3009
3105
  blur: 0,
3010
3106
  closeIconUrl: null,
3107
+ closeIconColor: "#000000",
3108
+ closeIconHover: "#cccccc",
3011
3109
  closeIconAlign: "top-right",
3012
3110
  closeIconOffset: { x: 0, y: 0 },
3013
3111
  closeIconScale: 1
@@ -3065,7 +3163,7 @@ const LightboxComponent = {
3065
3163
  padding: { top: 0.06, right: 0.05, bottom: 0.06, left: 0.05 }
3066
3164
  },
3067
3165
  controls: {
3068
- isActive: true,
3166
+ isActive: false,
3069
3167
  arrowsImgUrl: null,
3070
3168
  offset: { x: 0, y: 0 },
3071
3169
  scale: 1,
@@ -3076,6 +3174,8 @@ const LightboxComponent = {
3076
3174
  color: "rgba(28,31,34,0.9)",
3077
3175
  blur: 0,
3078
3176
  closeIconUrl: null,
3177
+ closeIconColor: "#000000",
3178
+ closeIconHover: "#cccccc",
3079
3179
  closeIconAlign: "top-right",
3080
3180
  closeIconOffset: { x: 0, y: 0 },
3081
3181
  closeIconScale: 1
@@ -3133,7 +3233,7 @@ const LightboxComponent = {
3133
3233
  padding: { top: 0.06, right: 0.1, bottom: 0.06, left: 0.1 }
3134
3234
  },
3135
3235
  controls: {
3136
- isActive: true,
3236
+ isActive: false,
3137
3237
  arrowsImgUrl: null,
3138
3238
  offset: { x: 0, y: 0 },
3139
3239
  scale: 1,
@@ -3144,6 +3244,8 @@ const LightboxComponent = {
3144
3244
  color: "rgba(28,31,34,0.9)",
3145
3245
  blur: 0,
3146
3246
  closeIconUrl: null,
3247
+ closeIconColor: "#000000",
3248
+ closeIconHover: "#cccccc",
3147
3249
  closeIconAlign: "top-right",
3148
3250
  closeIconOffset: { x: 0, y: 0 },
3149
3251
  closeIconScale: 1
@@ -3428,945 +3530,9 @@ const LightboxComponent = {
3428
3530
  required: ["settings", "content", "styles"]
3429
3531
  }
3430
3532
  };
3431
- const wrapper = "Testimonials-module__wrapper___eCRwv";
3432
- const cover = "Testimonials-module__cover___5I7Fh";
3433
- const caption = "Testimonials-module__caption___-YQRG";
3434
- const creds = "Testimonials-module__creds___KKvX1";
3435
- const icon = "Testimonials-module__icon___SstqT";
3436
- const arrow = "Testimonials-module__arrow___NO6BN";
3437
- const nextArrow = "Testimonials-module__nextArrow___L3G-W";
3438
- const arrowInner = "Testimonials-module__arrowInner___GSjnA";
3439
- const arrowIcon = "Testimonials-module__arrowIcon___fw7vy";
3440
- const arrowImg = "Testimonials-module__arrowImg___7R9fl";
3441
- const mirror = "Testimonials-module__mirror___JkFna";
3442
- const classes = {
3443
- wrapper,
3444
- cover,
3445
- caption,
3446
- creds,
3447
- icon,
3448
- arrow,
3449
- nextArrow,
3450
- arrowInner,
3451
- arrowIcon,
3452
- arrowImg,
3453
- mirror
3454
- };
3455
- function getAlignPosition(alignment, offset, isEditor) {
3456
- const styles2 = {};
3457
- const [vertical, horizontal] = alignment.split("-");
3458
- if (vertical === "top") {
3459
- styles2.top = "0";
3460
- styles2.bottom = "auto";
3461
- } else if (vertical === "middle") {
3462
- styles2.top = "50%";
3463
- styles2.bottom = "auto";
3464
- } else if (vertical === "bottom") {
3465
- styles2.top = "auto";
3466
- styles2.bottom = "0";
3467
- }
3468
- if (horizontal === "left") {
3469
- styles2.left = "0";
3470
- styles2.right = "auto";
3471
- } else if (horizontal === "center") {
3472
- styles2.left = "50%";
3473
- styles2.right = "auto";
3474
- } else if (horizontal === "right") {
3475
- styles2.left = "auto";
3476
- styles2.right = "0";
3477
- }
3478
- if (vertical === "middle" && horizontal === "center") {
3479
- styles2.transform = `translate(calc(-50% + ${scalingValue(offset.x, isEditor)}), calc(-50% + ${scalingValue(offset.y, isEditor)}))`;
3480
- } else if (vertical === "middle") {
3481
- styles2.transform = `translate(${scalingValue(offset.x, isEditor)}, calc(-50% + ${scalingValue(offset.y, isEditor)}))`;
3482
- } else if (horizontal === "center") {
3483
- styles2.transform = `translate(calc(-50% + ${scalingValue(offset.x, isEditor)}), ${scalingValue(offset.y, isEditor)})`;
3484
- } else {
3485
- styles2.transform = `translate(${scalingValue(offset.x, isEditor)}, ${scalingValue(offset.y, isEditor)})`;
3486
- }
3487
- return styles2;
3488
- }
3489
- const Testimonials = ({ settings, content, styles: styles2 }) => {
3490
- const sliderRef = React.useRef(null);
3491
- const { general, card, controls } = settings;
3492
- const { width, height } = card.dimensions;
3493
- const perMove = settings.general.move === "one" ? 1 : settings.general.inView || 1;
3494
- const perPage = settings.general.inView || 3;
3495
- const wrapperWidth = !settings.general.autoplay ? width * perPage + settings.card.gap * (perPage - 1) + card.borderWidth * 2 : void 0;
3496
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3497
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflow: "hidden", display: "flex", justifyContent: settings.general.alignment }, children: /* @__PURE__ */ jsxRuntime.jsx(
3498
- "div",
3499
- {
3500
- className: `${classes.wrapper}`,
3501
- style: wrapperWidth ? { width: `${scalingValue(wrapperWidth, false)}` } : void 0,
3502
- children: /* @__PURE__ */ jsxRuntime.jsx(
3503
- reactSplide.Splide,
3504
- {
3505
- ref: sliderRef,
3506
- options: {
3507
- type: "loop",
3508
- fixedWidth: width,
3509
- ...!settings.general.autoplay && {
3510
- perPage,
3511
- width: wrapperWidth
3512
- },
3513
- arrows: false,
3514
- perMove,
3515
- gap: settings.card.gap,
3516
- padding: 0,
3517
- autoplay: settings.general.autoplay,
3518
- speed: settings.general.speed,
3519
- interval: settings.general.autoplay ? settings.general.speed : 0,
3520
- rewind: true,
3521
- easing: "linear",
3522
- direction: settings.general.direction === "left" ? "ltr" : "rtl",
3523
- pagination: false,
3524
- pauseOnHover: settings.general.pause === "hover",
3525
- pauseOnFocus: settings.general.pause === "click"
3526
- },
3527
- children: content.map((item, index) => {
3528
- var _a, _b, _c, _d, _e;
3529
- return /* @__PURE__ */ jsxRuntime.jsx(reactSplide.SplideSlide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: `${width}px`, height: `${height}px`, borderRadius: `${settings.card.corner}px`, border: `${settings.card.borderWidth}px solid ${settings.card.borderColor}`, backgroundColor: settings.card.bgColor, overflow: "hidden", boxSizing: "border-box" }, children: [
3530
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: (_a = item.image) == null ? void 0 : _a.url, alt: (_b = item.image) == null ? void 0 : _b.name, style: { width: "100%", height: "100%", objectFit: ((_c = item.image) == null ? void 0 : _c.objectFit) || "cover" } }),
3531
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.cover, style: { background: settings.elements.cover.gradient, borderRadius: `${settings.card.corner}px` } }),
3532
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3533
- /* @__PURE__ */ jsxRuntime.jsx("img", { src: (_d = item.icon) == null ? void 0 : _d.url, alt: (_e = item.icon) == null ? void 0 : _e.name, className: classes.icon, style: getAlignPosition(settings.elements.icon.alignment, settings.elements.icon.offset) }),
3534
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.caption, style: getAlignPosition(settings.elements.text.alignment, settings.elements.text.offset), children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: item.imageCaption }) }),
3535
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.creds, style: getAlignPosition(settings.elements.creds.alignment, settings.elements.creds.offset), children: /* @__PURE__ */ jsxRuntime.jsx(RichTextRenderer, { content: item.creds }) })
3536
- ] })
3537
- ] }) }, index);
3538
- })
3539
- }
3540
- )
3541
- }
3542
- ) }),
3543
- controls.isActive && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3544
- /* @__PURE__ */ jsxRuntime.jsx(
3545
- "div",
3546
- {
3547
- className: classes.arrow,
3548
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
3549
- children: /* @__PURE__ */ jsxRuntime.jsxs(
3550
- "button",
3551
- {
3552
- className: classes.arrowInner,
3553
- style: { transform: `translate(${scalingValue(controls.offset.x, false)}, ${scalingValue(controls.offset.y, false)}) scale(${controls.scale / 100})` },
3554
- onClick: () => {
3555
- var _a;
3556
- return (_a = sliderRef.current) == null ? void 0 : _a.go("-1");
3557
- },
3558
- "aria-label": "Previous",
3559
- children: [
3560
- controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
3561
- SvgImage,
3562
- {
3563
- url: controls.arrowsImgUrl,
3564
- fill: controls.color,
3565
- hoverFill: controls.hover,
3566
- className: cn(classes.arrowImg, classes.mirror)
3567
- }
3568
- ),
3569
- !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon, { color: controls.color, className: cn(classes.arrowIcon, classes.arrowImg, classes.mirror) })
3570
- ]
3571
- }
3572
- )
3573
- }
3574
- ),
3575
- /* @__PURE__ */ jsxRuntime.jsx(
3576
- "div",
3577
- {
3578
- className: cn(classes.arrow, classes.nextArrow),
3579
- style: { color: controls.color, ["--arrow-hover-color"]: controls.hover },
3580
- children: /* @__PURE__ */ jsxRuntime.jsxs(
3581
- "button",
3582
- {
3583
- className: classes.arrowInner,
3584
- style: { transform: `translate(${scalingValue(controls.offset.x * -1, false)}, ${scalingValue(controls.offset.y, false)}) scale(${controls.scale / 100})` },
3585
- onClick: () => {
3586
- var _a;
3587
- return (_a = sliderRef.current) == null ? void 0 : _a.go("+1");
3588
- },
3589
- "aria-label": "Next",
3590
- children: [
3591
- controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(
3592
- SvgImage,
3593
- {
3594
- url: controls.arrowsImgUrl,
3595
- fill: controls.color,
3596
- hoverFill: controls.hover,
3597
- className: classes.arrowImg
3598
- }
3599
- ),
3600
- !controls.arrowsImgUrl && /* @__PURE__ */ jsxRuntime.jsx(ArrowIcon, { color: controls.color, className: cn(classes.arrowIcon, classes.arrowImg) })
3601
- ]
3602
- }
3603
- )
3604
- }
3605
- )
3606
- ] })
3607
- ] });
3608
- };
3609
- function ArrowIcon({ color, className }) {
3610
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 10 18", className, children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: color, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
3611
- }
3612
- const TestimonialsComponent = {
3613
- element: Testimonials,
3614
- id: "testimonials",
3615
- name: "Testimonials",
3616
- preview: {
3617
- type: "video",
3618
- url: "https://cdn.cntrl.site/component-assets/testimonials.mp4"
3619
- },
3620
- defaultSize: {
3621
- width: 700,
3622
- height: 400
3623
- },
3624
- schema: {
3625
- type: "object",
3626
- properties: {
3627
- settings: {
3628
- layoutBased: true,
3629
- type: "object",
3630
- display: {
3631
- type: "settings-block"
3632
- },
3633
- properties: {
3634
- general: {
3635
- title: "general",
3636
- icon: "thumbnail",
3637
- tooltip: "General",
3638
- type: "object",
3639
- properties: {
3640
- autoplay: {
3641
- type: "boolean",
3642
- display: {
3643
- type: "ratio-group",
3644
- direction: "horizontal"
3645
- },
3646
- enum: ["on", "off"]
3647
- },
3648
- inView: {
3649
- type: "number",
3650
- title: "In View",
3651
- min: 1,
3652
- display: {
3653
- type: "numeric-input"
3654
- }
3655
- },
3656
- alignment: {
3657
- type: "string",
3658
- title: "Align",
3659
- display: {
3660
- type: "align-group",
3661
- direction: "horizontal"
3662
- },
3663
- enum: ["start", "center", "end"]
3664
- },
3665
- move: {
3666
- type: "string",
3667
- display: {
3668
- type: "ratio-group",
3669
- direction: "horizontal"
3670
- },
3671
- enum: ["one", "view"]
3672
- },
3673
- speed: {
3674
- type: "number",
3675
- title: "Speed",
3676
- min: 100,
3677
- max: 1e4,
3678
- step: 100,
3679
- display: {
3680
- type: "numeric-input"
3681
- }
3682
- },
3683
- direction: {
3684
- type: "string",
3685
- display: {
3686
- type: "ratio-group"
3687
- },
3688
- enum: ["left", "right"]
3689
- },
3690
- pause: {
3691
- title: "Pause on",
3692
- type: "string",
3693
- display: {
3694
- type: "ratio-group"
3695
- },
3696
- enum: ["hover", "click", "off"]
3697
- }
3698
- }
3699
- },
3700
- card: {
3701
- title: "card",
3702
- icon: "card",
3703
- tooltip: "Card",
3704
- type: "object",
3705
- properties: {
3706
- dimensions: {
3707
- type: "object",
3708
- title: "Size",
3709
- display: {
3710
- type: "group"
3711
- },
3712
- properties: {
3713
- width: {
3714
- type: "number",
3715
- label: "W",
3716
- scalingEnabled: true,
3717
- display: {
3718
- type: "numeric-input",
3719
- visible: true
3720
- }
3721
- },
3722
- height: {
3723
- type: "number",
3724
- label: "H",
3725
- scalingEnabled: true,
3726
- display: {
3727
- type: "numeric-input",
3728
- visible: true
3729
- }
3730
- }
3731
- }
3732
- },
3733
- gap: {
3734
- type: "number",
3735
- title: "Gap",
3736
- scalingEnabled: true,
3737
- min: 0,
3738
- display: {
3739
- type: "numeric-input"
3740
- }
3741
- },
3742
- corner: {
3743
- type: "number",
3744
- title: "Corners",
3745
- scalingEnabled: true,
3746
- min: 0,
3747
- display: {
3748
- type: "numeric-input"
3749
- }
3750
- },
3751
- borders: {
3752
- type: "object",
3753
- title: "Borders",
3754
- display: {
3755
- type: "group"
3756
- },
3757
- properties: {
3758
- borderWidth: {
3759
- type: "number",
3760
- title: "Borders",
3761
- scalingEnabled: true,
3762
- min: 0,
3763
- display: {
3764
- type: "numeric-input"
3765
- }
3766
- },
3767
- borderColor: {
3768
- title: "Border Color",
3769
- type: "string",
3770
- display: {
3771
- type: "settings-color-picker",
3772
- format: "single"
3773
- }
3774
- }
3775
- }
3776
- },
3777
- bgColor: {
3778
- title: "BG color",
3779
- type: "string",
3780
- display: {
3781
- type: "settings-color-picker",
3782
- format: "single"
3783
- }
3784
- }
3785
- }
3786
- },
3787
- elements: {
3788
- title: "elements",
3789
- icon: "star",
3790
- tooltip: "Elements",
3791
- type: "object",
3792
- properties: {
3793
- text: {
3794
- type: "object",
3795
- title: "Text",
3796
- display: {
3797
- type: "group"
3798
- },
3799
- properties: {
3800
- alignment: {
3801
- type: "string",
3802
- display: {
3803
- type: "position-selector"
3804
- },
3805
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
3806
- },
3807
- offset: {
3808
- type: "object",
3809
- title: "Offset",
3810
- display: {
3811
- type: "group"
3812
- },
3813
- properties: {
3814
- x: {
3815
- type: "number",
3816
- label: "X",
3817
- scalingEnabled: true,
3818
- display: {
3819
- type: "numeric-input",
3820
- visible: true
3821
- }
3822
- },
3823
- y: {
3824
- type: "number",
3825
- label: "Y",
3826
- scalingEnabled: true,
3827
- display: {
3828
- type: "numeric-input",
3829
- visible: true
3830
- }
3831
- }
3832
- }
3833
- }
3834
- }
3835
- },
3836
- icon: {
3837
- type: "object",
3838
- title: "Icon",
3839
- display: {
3840
- type: "group"
3841
- },
3842
- properties: {
3843
- alignment: {
3844
- type: "string",
3845
- display: {
3846
- type: "position-selector"
3847
- },
3848
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
3849
- },
3850
- offset: {
3851
- type: "object",
3852
- title: "Offset",
3853
- display: {
3854
- type: "group"
3855
- },
3856
- properties: {
3857
- x: {
3858
- type: "number",
3859
- label: "X",
3860
- scalingEnabled: true,
3861
- display: {
3862
- type: "numeric-input",
3863
- visible: true
3864
- }
3865
- },
3866
- y: {
3867
- type: "number",
3868
- label: "Y",
3869
- scalingEnabled: true,
3870
- display: {
3871
- type: "numeric-input",
3872
- visible: true
3873
- }
3874
- }
3875
- }
3876
- },
3877
- scale: {
3878
- type: "number",
3879
- title: "scale",
3880
- min: 50,
3881
- max: 600,
3882
- display: {
3883
- type: "range-control"
3884
- }
3885
- }
3886
- }
3887
- },
3888
- creds: {
3889
- type: "object",
3890
- title: "Credentials",
3891
- display: {
3892
- type: "group"
3893
- },
3894
- properties: {
3895
- alignment: {
3896
- type: "string",
3897
- display: {
3898
- type: "position-selector"
3899
- },
3900
- enum: ["top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", "bottom-right"]
3901
- },
3902
- offset: {
3903
- type: "object",
3904
- title: "Offset",
3905
- display: {
3906
- type: "group"
3907
- },
3908
- properties: {
3909
- x: {
3910
- type: "number",
3911
- label: "X",
3912
- scalingEnabled: true,
3913
- display: {
3914
- type: "numeric-input",
3915
- visible: true
3916
- }
3917
- },
3918
- y: {
3919
- type: "number",
3920
- label: "Y",
3921
- scalingEnabled: true,
3922
- display: {
3923
- type: "numeric-input",
3924
- visible: true
3925
- }
3926
- }
3927
- }
3928
- }
3929
- }
3930
- },
3931
- cover: {
3932
- type: "object",
3933
- title: "Cover",
3934
- display: {
3935
- type: "group"
3936
- },
3937
- properties: {
3938
- gradient: {
3939
- title: "Gradient",
3940
- type: "string",
3941
- display: {
3942
- type: "settings-color-picker",
3943
- format: "gradient"
3944
- }
3945
- }
3946
- }
3947
- }
3948
- }
3949
- },
3950
- controls: {
3951
- title: "controls",
3952
- icon: "controls",
3953
- tooltip: "Controls",
3954
- type: "object",
3955
- properties: {
3956
- isActive: {
3957
- type: "boolean",
3958
- display: {
3959
- type: "setting-toggle"
3960
- }
3961
- },
3962
- arrowsImgUrl: {
3963
- type: ["string", "null"],
3964
- display: {
3965
- type: "settings-image-input"
3966
- }
3967
- },
3968
- offset: {
3969
- type: "object",
3970
- title: "Offset",
3971
- display: {
3972
- type: "group"
3973
- },
3974
- properties: {
3975
- x: {
3976
- type: "number",
3977
- label: "X",
3978
- scalingEnabled: true,
3979
- display: {
3980
- type: "numeric-input",
3981
- visible: true
3982
- }
3983
- },
3984
- y: {
3985
- type: "number",
3986
- label: "Y",
3987
- scalingEnabled: true,
3988
- display: {
3989
- type: "numeric-input",
3990
- visible: true
3991
- }
3992
- }
3993
- }
3994
- },
3995
- scale: {
3996
- type: "number",
3997
- title: "scale",
3998
- min: 50,
3999
- max: 600,
4000
- display: {
4001
- type: "range-control"
4002
- }
4003
- },
4004
- color: {
4005
- title: "color",
4006
- type: "string",
4007
- display: {
4008
- type: "settings-color-picker",
4009
- format: "single"
4010
- }
4011
- },
4012
- hover: {
4013
- title: "hover",
4014
- type: "string",
4015
- display: {
4016
- type: "settings-color-picker",
4017
- format: "single"
4018
- }
4019
- }
4020
- }
4021
- }
4022
- },
4023
- default: {
4024
- general: {
4025
- autoplay: true,
4026
- inView: 3,
4027
- alignment: "center",
4028
- move: "one",
4029
- speed: 3e3,
4030
- direction: "left",
4031
- pause: "hover"
4032
- },
4033
- card: {
4034
- dimensions: {
4035
- width: 300,
4036
- height: 400
4037
- },
4038
- gap: 20,
4039
- corner: 10,
4040
- borderWidth: 0,
4041
- borderColor: "#000000",
4042
- bgColor: "#ffffff"
4043
- },
4044
- controls: {
4045
- isActive: false,
4046
- arrowsImgUrl: null,
4047
- offset: {
4048
- x: 0,
4049
- y: 0
4050
- },
4051
- scale: 100,
4052
- color: "#000000",
4053
- hover: "#cccccc"
4054
- },
4055
- elements: {
4056
- text: {
4057
- alignment: "bottom-center",
4058
- offset: {
4059
- x: 0,
4060
- y: 0
4061
- }
4062
- },
4063
- icon: {
4064
- alignment: "top-left",
4065
- offset: {
4066
- x: 0,
4067
- y: 0
4068
- },
4069
- scale: 100
4070
- },
4071
- creds: {
4072
- alignment: "bottom-center",
4073
- offset: {
4074
- x: 0,
4075
- y: 0
4076
- }
4077
- },
4078
- cover: {
4079
- gradient: ""
4080
- }
4081
- }
4082
- }
4083
- },
4084
- content: {
4085
- layoutBased: false,
4086
- type: "array",
4087
- settings: {
4088
- addItemFromFileExplorer: true,
4089
- defaultWidth: 500
4090
- },
4091
- items: {
4092
- type: "object",
4093
- properties: {
4094
- image: {
4095
- type: "object",
4096
- label: "Image",
4097
- display: {
4098
- minWidth: 58,
4099
- maxWidth: 108,
4100
- type: "media-input"
4101
- },
4102
- properties: {
4103
- url: {
4104
- type: "string"
4105
- },
4106
- name: {
4107
- type: "string"
4108
- },
4109
- objectFit: {
4110
- type: "string",
4111
- enum: ["cover", "contain"]
4112
- }
4113
- },
4114
- required: ["url", "name"]
4115
- },
4116
- icon: {
4117
- type: "object",
4118
- label: "Icon",
4119
- display: {
4120
- minWidth: 58,
4121
- maxWidth: 108,
4122
- type: "media-input"
4123
- },
4124
- properties: {
4125
- url: {
4126
- type: "string"
4127
- },
4128
- name: {
4129
- type: "string"
4130
- },
4131
- objectFit: {
4132
- type: "string",
4133
- enum: ["cover", "contain"]
4134
- }
4135
- },
4136
- required: ["url", "name"]
4137
- },
4138
- imageCaption: {
4139
- placeholder: "Add Caption...",
4140
- label: "Description",
4141
- display: {
4142
- type: "rich-text",
4143
- minWidth: 300,
4144
- maxWidth: 550
4145
- }
4146
- },
4147
- creds: {
4148
- placeholder: "Add Credentials...",
4149
- label: "Credentials",
4150
- display: {
4151
- type: "rich-text",
4152
- minWidth: 300,
4153
- maxWidth: 550
4154
- }
4155
- }
4156
- },
4157
- required: ["image"]
4158
- },
4159
- default: [
4160
- {
4161
- image: {
4162
- objectFit: "cover",
4163
- url: "https://cdn.cntrl.site/component-assets/2.jpg",
4164
- name: "Testimonial-1.png"
4165
- },
4166
- icon: {
4167
- objectFit: "cover",
4168
- url: "",
4169
- name: ""
4170
- },
4171
- imageCaption: [
4172
- {
4173
- type: "paragraph",
4174
- children: [{ text: "" }]
4175
- }
4176
- ],
4177
- creds: [
4178
- {
4179
- type: "paragraph",
4180
- children: [{ text: "" }]
4181
- }
4182
- ]
4183
- },
4184
- {
4185
- image: {
4186
- objectFit: "cover",
4187
- url: "https://cdn.cntrl.site/component-assets/3.jpg",
4188
- name: "Testimonial-2.png"
4189
- },
4190
- icon: {
4191
- objectFit: "cover",
4192
- url: "",
4193
- name: ""
4194
- },
4195
- imageCaption: [
4196
- {
4197
- type: "paragraph",
4198
- children: [{ text: "" }]
4199
- }
4200
- ],
4201
- creds: [
4202
- {
4203
- type: "paragraph",
4204
- children: [{ text: "" }]
4205
- }
4206
- ]
4207
- },
4208
- {
4209
- image: {
4210
- objectFit: "cover",
4211
- url: "https://cdn.cntrl.site/component-assets/4.jpg",
4212
- name: "Testimonial-3.png"
4213
- },
4214
- icon: {
4215
- objectFit: "cover",
4216
- url: "",
4217
- name: ""
4218
- },
4219
- imageCaption: [
4220
- {
4221
- type: "paragraph",
4222
- children: [{ text: "" }]
4223
- }
4224
- ],
4225
- creds: [
4226
- {
4227
- type: "paragraph",
4228
- children: [{ text: "" }]
4229
- }
4230
- ]
4231
- }
4232
- ]
4233
- },
4234
- styles: {
4235
- layoutBased: true,
4236
- type: "object",
4237
- properties: {
4238
- caption: {
4239
- dataName: "caption",
4240
- type: "object",
4241
- properties: {
4242
- fontSettings: {
4243
- type: "object",
4244
- display: {
4245
- type: "font-settings"
4246
- },
4247
- properties: {
4248
- fontFamily: {
4249
- type: "string"
4250
- },
4251
- fontWeight: {
4252
- type: "number"
4253
- },
4254
- fontStyle: {
4255
- type: "string"
4256
- }
4257
- }
4258
- },
4259
- widthSettings: {
4260
- display: {
4261
- type: "text-width-control"
4262
- },
4263
- type: "object",
4264
- properties: {
4265
- width: {
4266
- type: "number"
4267
- },
4268
- sizing: {
4269
- type: "string",
4270
- enum: ["auto", "manual"]
4271
- }
4272
- }
4273
- },
4274
- fontSizeLineHeight: {
4275
- type: "object",
4276
- display: {
4277
- type: "font-size-line-height"
4278
- },
4279
- properties: {
4280
- fontSize: {
4281
- type: "number"
4282
- },
4283
- lineHeight: {
4284
- type: "number"
4285
- }
4286
- }
4287
- },
4288
- letterSpacing: {
4289
- display: {
4290
- type: "letter-spacing-input"
4291
- },
4292
- type: "number"
4293
- },
4294
- wordSpacing: {
4295
- display: {
4296
- type: "word-spacing-input"
4297
- },
4298
- type: "number"
4299
- },
4300
- textAlign: {
4301
- display: {
4302
- type: "text-align-control"
4303
- },
4304
- type: "string",
4305
- enum: ["left", "center", "right"]
4306
- },
4307
- textAppearance: {
4308
- display: {
4309
- type: "text-appearance"
4310
- },
4311
- properties: {
4312
- textTransform: {
4313
- type: "string",
4314
- enum: ["none", "uppercase", "lowercase"]
4315
- },
4316
- textDecoration: {
4317
- type: "string",
4318
- enum: ["none", "underline"]
4319
- },
4320
- fontVariant: {
4321
- type: "string",
4322
- enum: ["normal", "small-caps"]
4323
- }
4324
- }
4325
- },
4326
- color: {
4327
- display: {
4328
- type: "style-panel-color-picker"
4329
- },
4330
- type: "string"
4331
- }
4332
- }
4333
- }
4334
- },
4335
- default: {
4336
- caption: {
4337
- widthSettings: {
4338
- width: 0.13,
4339
- sizing: "auto"
4340
- },
4341
- fontSettings: {
4342
- fontFamily: "Arial",
4343
- fontWeight: 400,
4344
- fontStyle: "normal"
4345
- },
4346
- fontSizeLineHeight: {
4347
- fontSize: 0.02,
4348
- lineHeight: 0.02
4349
- },
4350
- letterSpacing: 0,
4351
- wordSpacing: 0,
4352
- textAlign: "left",
4353
- textAppearance: {
4354
- textTransform: "none",
4355
- textDecoration: "none",
4356
- fontVariant: "normal"
4357
- },
4358
- color: "#000000"
4359
- }
4360
- }
4361
- }
4362
- },
4363
- required: ["settings", "content", "styles"]
4364
- }
4365
- };
4366
3533
  const components = [
4367
3534
  ControlSliderComponent,
4368
3535
  ControlImageRevealSliderComponent,
4369
- LightboxComponent,
4370
- TestimonialsComponent
3536
+ LightboxComponent
4371
3537
  ];
4372
3538
  exports.components = components;